diff --git a/.eslintrc.cjs b/.eslintrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..098cb70e262e9bf8edba58693a289e58c771063c --- /dev/null +++ b/.eslintrc.cjs @@ -0,0 +1,16 @@ +module.exports = { + root: true, + env: { + browser: true, + es2021: true, + node: true, + }, + // TODO: we need to move to the following, but this gets us started with infrastructure without breaking our build + // extends: [ "eslint:recommended", "plugin:@typescript-eslint/eslint-recommended"], + extends: ["plugin:@typescript-eslint/eslint-recommended"], + parser: "@typescript-eslint/parser", + parserOptions: { + ecmaVersion: "latest", + sourceType: "module", + }, +}; diff --git a/.github/multi-labeler.yml b/.github/multi-labeler.yml index ffab4f55723de9813cb2ed322f5d04be9110b138..b2e84bec1076735d09847d3b68546f5a5b13a0cc 100644 --- a/.github/multi-labeler.yml +++ b/.github/multi-labeler.yml @@ -95,3 +95,7 @@ labels: - label: 'epic-ldml' matcher: branch: '.*epic-ldml.*' # anywhere in the branch name, e.g. feat/epic-ldml/developer/... or feat/developer/foo-epic-ldml + + - label: 'epic-kmcompx' + matcher: + branch: '.*epic-kmcompx.*' diff --git a/.github/workflows/deb-packaging.yml b/.github/workflows/deb-packaging.yml index d05570a7c9f6eb473ffd07b49512d0f80bbeb462..7b12bf88809a1ba9766554f89408696050a83ffe 100644 --- a/.github/workflows/deb-packaging.yml +++ b/.github/workflows/deb-packaging.yml @@ -1,7 +1,7 @@ name: "Ubuntu packaging" on: repository_dispatch: - types: ['deb-release-packaging', 'deb-pr-packaging'] + types: ['deb-release-packaging:*', 'deb-pr-packaging:*'] env: COLOR_GREEN: "\e[32m" GH_TOKEN: ${{ github.token }} @@ -26,8 +26,9 @@ jobs: - name: Set pending status on PR builds id: set_status if: github.event.client_payload.isTestBuild == 'true' + shell: bash run: | - GIT_SHA=$(git rev-parse HEAD) + GIT_SHA="${{ github.event.client_payload.sha }}" echo "GIT_SHA=$GIT_SHA" >> $GITHUB_OUTPUT gh api \ --method POST \ @@ -61,7 +62,7 @@ jobs: shell: bash run: | THIS_SCRIPT="$GITHUB_WORKSPACE/.github/workflows/deb-packaging.yml" - . "resources/build/build-utils.sh" + . "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" echo "VERSION=$VERSION" >> $GITHUB_OUTPUT - name: Set prerelease tag as output parameter @@ -101,7 +102,7 @@ jobs: strategy: fail-fast: true matrix: - dist: [focal, jammy, kinetic] + dist: [focal, jammy, kinetic, lunar] arch: [amd64] runs-on: ubuntu-latest @@ -146,7 +147,7 @@ jobs: steps: - name: Sign packages - uses: sillsdev/gha-deb-signing@cd1af3dddf83787f9da20a93fc449d927a63bfbf # v0.4 + uses: sillsdev/gha-deb-signing@c85704766bdf6056e03ea2b2e761c33ed0acc187 # v0.5 with: src-pkg-path: "artifacts/keyman-srcpkg" src-pkg-name: "keyman_${{ needs.sourcepackage.outputs.VERSION }}-1_source.changes" @@ -156,28 +157,63 @@ jobs: gpg-signing-key: "${{ secrets.GPG_SIGNING_KEY }}" debsign-keyid: "${{ secrets.DEBSIGN_KEYID }}" - # TODO: upload not yet possible - will need a self-hosted runner inside of - # the VPN to do that. + upload-to-llso: + name: Upload packages to llso + needs: deb_signing + runs-on: self-hosted + environment: "deploy (linux)" + if: github.event.client_payload.isTestBuild == 'false' + + steps: + - name: Install dput + run: | + export DEBIAN_FRONTEND=noninteractive + export DEBIAN_PRIORITY=critical + export DEBCONF_NOWARNINGS=yes + sudo apt-get update + sudo apt-get install -q -y dput + + - name: Setup .dput.cf + run: | + echo "${{vars.ENV_DPUT_CONFIG}}" > ~/.dput.cf + + - name: Configure GPG Key + shell: bash + run: | + echo -e "::group::\e[32mConfigure GPG key" + echo -n "${{ secrets.GPG_SIGNING_KEY }}" | base64 --decode | gpg --import + echo "${{ secrets.DEBSIGN_KEYID }}:6:" | gpg --import-ownertrust + echo "::endgroup::" + + - name: Download Artifacts + uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 + with: + name: keyman-signedpkgs - # upload-to-llso: - # name: Upload packages to llso - # needs: deb_signing - # runs-on: ubuntu-latest - # environment: "deploy (linux)" - # if: ${{ ! github.event.client_payload.isTestBuild }} + - name: Upload + run: | + case ${{ github.event.client_payload.branch }} in + stable-*) destination='' ;; + beta) destination='-proposed' ;; + *) destination='-experimental' ;; + esac - # steps: - # - name: Configure GPG Key - # run: | - # echo -n "${{ secrets.GPG_SIGNING_KEY }}" | base64 --decode | gpg --import + echo -e "::group::${COLOR_GREEN}Upload source package" + cd keyman-srcpkg - # - name: Download Artifacts - # uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2 - # with: - # path: artifacts + dput -U llso:ubuntu/jammy${destination} *_source.changes + echo "::endgroup::" - # - name: Upload - # run: echo "Upload..." + echo -e "::group::${COLOR_GREEN}Uploading binary packages" + cd ../keyman-binarypkgs + pattern="keyman_${{ needs.sourcepackage.outputs.VERSION }}.+\+(.*)[0-9]_[^.]+.changes" + for f in *.changes; do + if [[ $f =~ $pattern ]]; then + dist=${BASH_REMATCH[1]} + dput -U llso:ubuntu/${dist}${destination} $f + fi + done + echo "::endgroup::" api_verification: name: Verify API for libkmnkbp0.so @@ -206,35 +242,35 @@ jobs: SRC_PKG="${GITHUB_WORKSPACE}/artifacts/keyman-srcpkg/keyman_${{ needs.sourcepackage.outputs.VERSION }}-1.debian.tar.xz" \ BIN_PKG="${GITHUB_WORKSPACE}/artifacts/keyman-binarypkgs/libkmnkbp0-0_${{ needs.sourcepackage.outputs.VERSION }}-1${{ needs.sourcepackage.outputs.PRERELEASE_TAG }}+jammy1_amd64.deb" \ PKG_VERSION="${{ needs.sourcepackage.outputs.VERSION }}" \ - ./scripts/deb-packaging.sh --gha verify >> $GITHUB_STEP_SUMMARY + ./scripts/deb-packaging.sh --gha verify 2>> $GITHUB_STEP_SUMMARY - name: Archive .symbols file uses: actions/upload-artifact@0b7f8abb1508181956e8e162db84b466c27e18ce # v3.1.2 with: name: libkmnkbp0-0.symbols - path: debian/libkmnkbp0-0.symbols + path: linux/debian/libkmnkbp0-0.symbols if: always() set_status: name: Set result status on PR builds - needs: [sourcepackage, binary_packages, deb_signing, api_verification] + needs: [sourcepackage, binary_packages, api_verification] runs-on: ubuntu-latest if: ${{ always() && github.event.client_payload.isTestBuild == 'true' }} steps: - name: Set success - if: needs.sourcepackage.result == 'success' && needs.binary_packages.result == 'success' && (needs.deb_signing.result == 'success' || needs.deb_signing.result == 'skipped') && needs.api_verification.result == 'success' + if: needs.sourcepackage.result == 'success' && needs.binary_packages.result == 'success' && needs.api_verification.result == 'success' run: | echo "RESULT=success" >> $GITHUB_ENV echo "MSG=Package build succeeded" >> $GITHUB_ENV - name: Set cancelled - if: needs.sourcepackage.result == 'cancelled' || needs.binary_packages.result == 'cancelled' || needs.deb_signing.result == 'cancelled' || needs.api_verification.result == 'cancelled' + if: needs.sourcepackage.result == 'cancelled' || needs.binary_packages.result == 'cancelled' || needs.api_verification.result == 'cancelled' run: | echo "RESULT=error" >> $GITHUB_ENV echo "MSG=Package build cancelled" >> $GITHUB_ENV - name: Set failure - if: needs.sourcepackage.result == 'failure' || needs.binary_packages.result == 'failure' || needs.deb_signing.result == 'failure' || needs.api_verification.result == 'failure' + if: needs.sourcepackage.result == 'failure' || needs.binary_packages.result == 'failure' || needs.api_verification.result == 'failure' run: | echo "RESULT=failure" >> $GITHUB_ENV echo "MSG=Package build failed" >> $GITHUB_ENV diff --git a/.gitignore b/.gitignore index b1b97f583f7bd18a5bfa4ed55600396b1b7b6010..0abec10c3b1651343c64920b615f5a5c236de9a6 100644 --- a/.gitignore +++ b/.gitignore @@ -36,6 +36,7 @@ /common/windows/delphi/**/*.bpl /common/windows/delphi/**/*.map /common/windows/delphi/**/*.tds +/common/windows/delphi/**/*.identcache # Temp files generated during release build /windows/src/buildtools/inst/copydebug.mak @@ -166,6 +167,7 @@ resources/environment.sh /core/VERSION.md **/node_modules/ +tsconfig.tsbuildinfo # Windows system files Thumbs.db @@ -174,6 +176,13 @@ Thumbs.db # details /xcodebuild-scripts.log +# +# Code coverage tools for JS/TS - nyc and c8 +# +.nyc_output/ +lcov-report/ +lcov.info + # Linux packaging related /debian/ /results/ @@ -182,3 +191,10 @@ Thumbs.db /keyman*.buildinfo /keyman*.changes /keyman*.tar.?z + +#Sabine: +# /common/test/keyboards/invalid/source/*.kmx +# /developer/src/test/auto/kmcomp/*.kmn +# /developer/src/test/auto/kmcomp/*.kvk +# /developer/src/test/auto/kmcomp/*.kvk* +# /developer/src/test/auto/kmcomp/*.txt diff --git a/.nycrc.json b/.nycrc.json new file mode 100644 index 0000000000000000000000000000000000000000..ee788b804638ed63141c8ffb60628539226b4ff9 --- /dev/null +++ b/.nycrc.json @@ -0,0 +1,6 @@ +{ + "check-coverage": true, + "temp-directory": ".nyc_output", + "lines": 90, + "reporter": "text" +} diff --git a/.shellcheckrc b/.shellcheckrc new file mode 100644 index 0000000000000000000000000000000000000000..1c46a510eb4508ab1bbc640d7fab211fbe5931f1 --- /dev/null +++ b/.shellcheckrc @@ -0,0 +1,5 @@ +external-sources=true + +# If you get SC1091 for sourced files, add the following setting to +# your .vscode/settings.json file: +# "shellcheck.useWorkspaceRootAsCwd": false diff --git a/HISTORY.md b/HISTORY.md index 63112ab447144e9dfcc9f20d193f8eedb4ee99fb..213b87a6f8e75b8fd289f0214d69a2ecc5571fa1 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,398 @@ # Keyman Version History +## 17.0.109 alpha 2023-05-17 + +* fix(windows): add wrap-symbols to Text Editor Makefile (#8819) +* chore(linux): Make postinst script comply with Debian policy (#8810) +* chore(windows): remove legacy core and flag ️ (#8593) + +## 17.0.108 alpha 2023-05-16 + +* feat(windows): add text editor to the support makefile (#8750) +* feat(developer): verify keyboard versions in kmc-package (#8769) +* feat(developer): verify bcp47 tags are valid and minimal in kmc-package (#8778) +* feat(developer): verify at least one language in package (#8783) +* chore(developer): verify file types of content files in package (#8792) +* chore(developer): verify that package has at least a model or keyboard (#8793) +* chore(ios): Changes required for XCode 14.3 (#8746) + +## 17.0.107 alpha 2023-05-15 + +* chore(linux): Fix installation build step on TC (#8784) +* refactor(android/engine): Consolidate updateSelection (#8739) + +## 17.0.106 alpha 2023-05-12 + +* chore(developer): move package formats to common/web/types (#8729) +* feat(developer): add package validation (#8740) +* feat(developer): add validation of package filenames (#8751) +* feat(developer): validate content file names in packages (#8755) +* feat(developer): validate package name in compiler (#8757) +* chore(developer): rename Compiler and related classes (#8726) +* feat(developer): uset api from wasm! (#8716) + +## 17.0.105 alpha 2023-05-11 + +* chore(common): Update crowdin strings for Amharic (#8748) +* chore(android/app): Cleanup build-play-store-notes script (#8749) +* chore(linux): Add build.sh for keyman-config (#8733) + +## 17.0.104 alpha 2023-05-10 + +* chore(developer): rename kmc-keyboard to kmc-ldml (#8725) +* chore(linux): bring kmp.json for unit test up to spec (#8732) +* feat(common): add `builder_run_action` shorthand function (#8742) + +## 17.0.103 alpha 2023-05-09 + +* fix(mac): `$CONFIG` not `$CONFIGURATION` in build path (#8724) +* chore(linux): Fix another problem uploading to launchpad (#8727) + +## 17.0.102 alpha 2023-05-08 + +* chore(linux): Build for Lunar on all platforms (#8713) +* fix(linux): Fix linux tests (#8510) +* chore(linux): Fix uploading to launchpad (#8720) + +## 17.0.101 alpha 2023-05-05 + +* chore(common): `set -eu` in build-utils.sh (#8698) +* fix(android/app): Resize OSK when resuming app from background (#8704) + +## 17.0.100 alpha 2023-05-04 + +* (#8690) +* (#8691) + +## 17.0.99 alpha 2023-05-03 + +* chore(linux): Fix build script (#8705) + +## 17.0.98 alpha 2023-05-02 + +* chore(common): run common and resources tests (#8692) + +## 17.0.97 alpha 2023-04-28 + +* docs(windows): Add verify vs build tools (#8676) +* (#8686) + +## 17.0.96 alpha 2023-04-27 + +* chore(android): Update QRGen version for Java 11 (#8673) +* refactor(android/engine): Move toggleSuggestionBanner to KMKeyboard (#8679) +* refactor(android/engine): Use isKeyboardLoaded() on a consistent basis (#8680) +* chore(developer): test message correctness in compiler modules (#8664) +* chore(developer): add eslint devDependency for kmc (#8665) +* chore(developer): kmc-keyboard should not use any node-specific modules (#8666) +* fix(common): builder parse multi-param order (#8668) +* refactor(developer): use callbacks to avoid direct fs access in kmc-package (#8674) +* refactor(android/engine): Move shouldIgnore booleans to KMKeyboard (#8682) +* chore(linux): Build for Ubuntu 23.04 Lunar as well (#8683) + +## 17.0.95 alpha 2023-04-26 + +* refactor(android/engine): Move currentBanner to KMKeyboard (#8671) +* chore(android/engine): Remove jvm args (#8675) +* fix(developer): kmc: fix jis/abnt2 scan codes (#8670) + +## 17.0.94 alpha 2023-04-25 + +* fix(android/engine): Update InApp input connection (#8647) +* chore(common): Move the_99 test fixture keyboard (#8660) +* chore(android): Move namespace to Gradle files (#8667) + +## 17.0.93 alpha 2023-04-24 + +* feat(common): kmx file reader (#8641) +* feat(developer): support FollowKeyboardVersion in kmc-package (#8642) +* chore(common): Update crowdin strings for Simplified Chinese (#8653) +* fix(common): builder - pass deps flags to child scripts (#8654) +* feat(developer): use CompilerEvent for messages in all of kmc (#8651) +* chore(developer): fixup deps for kmc modules (#8652) +* feat(core): ldml repertoire test, initial ICU integration (#8441) + +## 17.0.92 alpha 2023-04-21 + +* fix(developer): kmc-package path reference (#8634) +* chore(developer): only run keyboards-repo tests for a full-test (#8635) +* refactor(developer): move comperr.h to kmn_compiler_errors.h (#8636) +* refactor(developer): kmc-model to use `CompilerEvent` (#8637) + +## 17.0.91 alpha 2023-04-20 + +* fix(developer): kmc-kmn would abort build on warnings (#8617) +* fix(developer): kmc no longer emits double file extension for models (#8618) +* refactor(developer): move build activities (#8622) +* feat(developer): add warning options to kmc (#8623) +* feat(developer): use new message infrastructure in kmc-kmn (#8625) +* refactor(developer): move shared test helpers into common (#8626) +* feat(developer): add CompilerMessages support to kmc-package (#8627) +* feat(developer): warn if .kps file includes a non-binary .kvk file (#8628) +* chore(web): sets kmc-model as dependency of input-processor test action (#8629) +* fix(android/engine): Fix resetContext calls when selection changes (#8611) + +## 17.0.90 alpha 2023-04-19 + +* chore(android/engine): Cleanup old SDK calls (#8612) +* fix(developer): package editor no longer loses RTL flag for LMs (#8606) + +## 17.0.89 alpha 2023-04-18 + +* chore(developer): tweak build of extension list in kmc (#8597) +* docs(ios): Add help page for Settings (#8546) +* fix(developer): add missing dependencies (#8605) + +## 17.0.88 alpha 2023-04-17 + +* docs(android): Update Linux dev environment for Java 11 (#8596) + +## 17.0.87 alpha 2023-04-13 + +* refactor(developer): DRY kmc module references (#8577) +* chore(developer): kmc-kmn should build all baseline fixtures (#8578) +* fix(developer): kmc should not validate as well as compile keyboard (#8579) +* fix(developer): improve 'does not exist' error message (#8580) +* fix(common): consolidate npm publishing (#8587) +* chore(common): add missing deps and files for npm publish (#8588) + +## 17.0.86 alpha 2023-04-12 + +* docs(windows): link to wiki architecture faq page (#8584) + +## 17.0.85 alpha 2023-04-11 + +* chore(developer): AddWarning and SetError cleanup (#8571) +* fix(developer): add DRY_RUN variable to build.sh (#8576) +* fix(ios): fixes xcode-triggered debug, run builds (#8575) + +## 17.0.84 alpha 2023-04-10 + +* epic: kmcompx - kmcmpdll cross-platform compiler (#7330) +* chore(android): Update projects to use Java 11 (#8543) +* docs: clarify dependency meanings in build-utils (#8567) +* fix(mac): fix corrupt installer (#8565) + +## 17.0.83 alpha 2023-04-05 + +* fix(windows): use right instead of left alignment for popup buttons (#8561) + +## 17.0.82 alpha 2023-03-31 + +* feat(developer): support jis and abnt2 (#8513) +* revert: #8549 "chore(web): merge master into feature-esmodule-web-engine (A17S9 end) " (#8553) + +## 17.0.81 alpha 2023-03-30 + +* feat(windows): simple text editor using Edit Control (#8391) + +## 17.0.80 alpha 2023-03-29 + +* chore(linux): Remove dependency on `sudo` (#8535) +* chore(linux): Improve robustness of test cleanup (#8536) +* fix(linux): Remove warning after pressing Close button (#8538) + +## 17.0.79 alpha 2023-03-28 + +* chore(linux): Revert "Run and ignore autopkgtests on s390x" (#8506) +* docs(linux): Update minimum required Ubuntu version (#8526) +* docs(linux): Update common questions (#8532) + +## 17.0.78 alpha 2023-03-27 + +* chore(linux): Remove python3-raven dependency (#8507) +* refactor(android/engine): Make KMKeyboardJSHandler a normal class (#8494) + +## 17.0.77 alpha 2023-03-25 + +* chore(common): use mac /usr/bin/stat rather than homebrew version (#8498) + +## 17.0.76 alpha 2023-03-24 + +* chore(linux): Run and ignore autopkgtests on s390x (#8492) +* refactor(android/engine): Consolidate dispatchKey (#8483) + +## 17.0.75 alpha 2023-03-23 + +* chore(common): define BUILDER_CONFIGURATION env var (#8496) + +## 17.0.74 alpha 2023-03-22 + +* chore(windows): update sentry-native to 0.6.0 (#8464) +* chore(linux): Prevent building on s390x (#8477) +* fix(linux): Display error message for corrupt .kmp file (#8479) + +## 17.0.73 alpha 2023-03-21 + +* refactor(android/engine): Consolidate insertText (#8438) +* chore(common): prevent multiple npm ci runs in child scripts (#8484) + +## 17.0.72 alpha 2023-03-20 + +* chore(common): die early when --ci and --debug passed to test.sh (#8465) +* chore(common): Update crowdin strings for Kibaku (#8447) + +## 17.0.71 alpha 2023-03-18 + +* fix(core): ldml update fr-azerty for VKEY mapping (#8434) + +## 17.0.70 alpha 2023-03-17 + +* chore(android): Document builder script steps (#8449) + +## 17.0.69 alpha 2023-03-16 + +* chore(web): Cleanup build echo (#8446) +* fix(developer): lm compiler handle missing line no in errors (#8444) +* fix(android/app): Temporarily disable Keyman browser (#8430) +* fix(android/engine): Add builder output for configure (#8442) +* chore(linux): Update debian changelog (#8452) + +## 17.0.68 alpha 2023-03-15 + +* chore(common): add common test build configurations (#8431) +* fix(common): fix broken common/web/types cases (#8426) +* fix(developer/compilers): locks esbuild target detection for kmc building (#8437) +* (#8412) +* (#8436) +* chore(linux): Use dependency on core in ibus-keyman/build.sh (#8423) + +## 17.0.67 alpha 2023-03-14 + +* (developer):Update copyright period in License.rtf (#8425) +* chore(common): support shorthand for build.sh (#8415) +* chore(common): build script performance improvements (#8416) +* chore(common): TS updates to non-sync'd packages, feature-esmodule merge conflict prevention (#8429) + +## 17.0.66 alpha 2023-03-13 + +* refactor(android): Use builder scripts (#7407) + +## 17.0.65 alpha 2023-03-12 + +* refactor(core): consolidate wasm defs (#8409) + +## 17.0.64 alpha 2023-03-10 + +* feat(common): support single target for a dependency (#8404) +* chore(core): breadth-first build (#8400) +* refactor(common): Make build-help into helper functions (#8386) + +## 17.0.63 alpha 2023-03-09 + +* fix(web): --no-minify, not --skip-minify (#8394) +* chore(core): Remove obsolete `--target-path` option (#8376) + +## 17.0.62 alpha 2023-03-08 + +* chore(linux): Remove debug output from packaging GHA (#8372) +* chore: merge feature-ldml to master, again (#8377) +* chore(common): cleanup build.inc.sh echo (#8344) +* chore(common): remove vswhere (#8357) +* feat(linux): Add DBus method `SendText` (#8039) +* chore(core): Create both dynamic and static libs on Linux (#8375) +* chore(common): clean up `--debug` usage in build scripts (#8382) +* feat(common): builder.inc.sh inheritable options (#8384) + +## 17.0.61 alpha 2023-03-03 + +* fix(android/app): Another attempt at fixing OSK rotation (#8353) + +## 17.0.60 alpha 2023-03-02 + +* fix(android/engine): Fix various OSK bugs due to refactor (#8349) +* feat(core): Build both architectures for mac and generate a 'fat' library for them (#8342) +* fix(common): fixup npm publish (#8350) +* chore(linux): More GHA debugging (#8354) + +## 17.0.59 alpha 2023-03-01 + +* fix(common): builder: skip dependency build for clean action (#8341) +* chore(web): fixup dependencies in web build script (#8332) +* chore(linux): More debug output (#8345) + +## 17.0.58 alpha 2023-02-28 + +* chore(common): fix child build error handling (#8327) +* chore(linux): Improve and fix packaging GHA (#8328) +* fix(linux): Fix ibus-keyman/build.sh (#8329) +* epic: LDML keyboard support (#7054) +* fix(linux): Fix debian postinst script (#8294) + +## 17.0.57 alpha 2023-02-26 + +* chore(android/app): Revert #8291 (#8314) + +## 17.0.56 alpha 2023-02-24 + +* fix(linux): Fix upload in packaging GHA (#8308) +* feat(common): adds warning if described output does not exist (#8304) +* chore(linux): Improve detecting presence of test files (#8313) + +## 17.0.55 alpha 2023-02-23 + +* chore(docs): update docs due to Mac Ventura (#8277) +* chore: remove greadlink from standard script prolog (#8288) +* chore: use builtin instead of dirname for perf (#8289) +* chore(common): stats script for planning (#7861) + +## 17.0.54 alpha 2023-02-22 + +* fix(ios): allow duplicate languages in kmp file (#8125) +* fix(linux): Fix paths in upload action of packaging GHA (#8285) +* fix(android/app): Fix OSK width when rotating (#8291) + +## 17.0.53 alpha 2023-02-21 + +* chore(windows): Remove old Kannada setup strings (#8257) +* fix(linux): Collect consecutive backspaces (#8274) +* chore(linux): Improve deb-packaging GHA (#8281) +* chore(linux): Cleanup GHA (#8282) + +## 17.0.52 alpha 2023-02-20 + +* fix(windows): use min-width allow to expand (#8215) +* chore(web): minor cleanup of web/build.sh (#8254) +* fix(web): `--no-minify`, not `--skip-minify` (#8264) +* chore(web): Actually skip browser-stack for non-web builds (#8266) +* chore: cleanup some of shellHelperFunctions.sh (#8260) +* chore: consolidate script helper functions (#8261) +* chore(linux): Output results of API verification on stderr (#8241) +* chore(linux): Create draft PR after updating changelog (#8242) +* fix(linux): Checkout before running apt-install (#8247) +* fix(linux): Fix bug in deb-packaging script (#8273) +* chore(developer): update bundled node to 18.14.1 LTS (#8268) +* chore(developer): ignore Esc key when compiling (#8263) +* docs: builder.inc.sh improved documentation around dependencies (#8173) +* chore(linux): Add build.sh to ibus-keyman ️ (#8112) + +## 17.0.51 alpha 2023-02-18 + +* chore(common): Update Fula strings for Sprint A17S6 (#8245) + +## 17.0.50 alpha 2023-02-16 + +* feat(common): parent-child scripts for builder (#8198) +* fix(linux): Another iteration to fix packaging GHA (#8230) +* chore(common): updates Web & Web-related dependencies (#8196) +* fix(linux): Fix syntax for skipping upload in packaging GHA (#8236) + +## 17.0.49 alpha 2023-02-15 + +* feat(linux): Pass PR# in the event type (#8221) +* feat(linux): Implement uploading of packages in packaging GHA (#8223) +* fix(linux): Fix GHA package build (#8225) +* fix(linux): Another fix for GHA package build (#8228) + +## 17.0.48 alpha 2023-02-14 + +* fix(developer): Select BCP47 Code dialog inconsistencies (#8179) +* chore(common): automatically apply _builder_check_color (#8197) +* docs(linux): Update packaging documentation (#8202) +* chore(common): Report status if no platform needs build (#8210) +* chore(linux): Exclude autopkg tests on s390x (#8218) +* fix(linux): Fix path to symbols file in packaging GHA (#8209) + ## 17.0.47 alpha 2023-02-10 * fix(linux): Fix autopkgtests (#8201) diff --git a/VERSION.md b/VERSION.md index be7283703ac742fd1d08d47a9c6b89637476661c..18bc0b4cd19fcbf71734f01988f1b280f3cdb03b 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -17.0.48 \ No newline at end of file +17.0.110 \ No newline at end of file diff --git a/android/.build-builder b/android/.build-builder new file mode 100644 index 0000000000000000000000000000000000000000..3769f7152bdeb0f4fb878dd6eff6f215f52ba247 --- /dev/null +++ b/android/.build-builder @@ -0,0 +1,4 @@ +The presence of this file tells CI to use the new builder_ style parameters for build.sh + +Once all branches for 16.0+ are updated to merge #7407, then we +can remove this file and the corresponding bash test branches in CI. diff --git a/android/KMAPro/build-play-store-notes.inc.sh b/android/KMAPro/build-play-store-notes.inc.sh new file mode 100755 index 0000000000000000000000000000000000000000..04fa8764179ff7e888b8065bfbbd22ae31ff28c0 --- /dev/null +++ b/android/KMAPro/build-play-store-notes.inc.sh @@ -0,0 +1,54 @@ +#!/usr/bin/env bash + +# Assumption: parent script that sources this already has START STANDARD BUILD SCRIPT INCLUDE + +################################ Main script ################################ + +function generateReleaseNotes() { + pushd "$KEYMAN_ROOT/android/KMAPro/" + + # + # Copy release notes for Gradle Play Publisher to upload + # Reference: https://github.com/Triple-T/gradle-play-publisher#uploading-release-notes + # + local PLAY_RELEASE_NOTES="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/play/release-notes/en-US/$TIER.txt" + if [ $TIER = "stable" ]; then + PLAY_RELEASE_NOTES="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/play/release-notes/en-US/default.txt" + fi + builder_heading "Generating Play Store release notes to $PLAY_RELEASE_NOTES" + # write to file + echo "" > "$PLAY_RELEASE_NOTES" + + # Copy whatsnew.md to release notes 1 line at a time, + # filtering for lines that start with "*". + # Pad release notes if whatsnew.md doesn't have any line items + # Play Store release notes have a limit of 500 characters + local DEFAULT_RELEASE_NOTE="* Additional bug fixes and improvements" + local FILTERED_LINES=$( grep '^\s*\*.*$' "$KEYMAN_ROOT/android/help/about/whatsnew.md" || [[ $? == 1 ]] ) # Continue if grep has no matches + if [ -z "$FILTERED_LINES" ]; then + FILTERED_LINES="$DEFAULT_RELEASE_NOTE" + builder_warn "Warning: whatsnew.md empty so using default release note: '$FILTERED_LINES'" + fi + + # Change IFS to new line + local old_IFS="${IFS}" + IFS=$'\n' + for line in $FILTERED_LINES + do + local CHARS_IN_RELEASE_NOTES=$( wc -m < "$PLAY_RELEASE_NOTES" ) + local CHARS_IN_CURRENT_LINE=$( wc -m <<< $line ) + if (( CHARS_IN_RELEASE_NOTES + CHARS_IN_CURRENT_LINE + 1 < 450 )); then + # Copy line to Play Store release notes + echo "$line" >> "$PLAY_RELEASE_NOTES" + else + # 450 chars reached + builder_warn "Warning: Play Store release notes approaching 500 character limit" + echo "$DEFAULT_RELEASE_NOTE" >> "$PLAY_RELEASE_NOTES" + break + fi + done + + # Restore IFS + IFS="${old_IFS}" + popd +} diff --git a/android/KMAPro/build-play-store-notes.sh b/android/KMAPro/build-play-store-notes.sh deleted file mode 100755 index a3566dbbcdd6eb279c7768418e044fa65776bb3a..0000000000000000000000000000000000000000 --- a/android/KMAPro/build-play-store-notes.sh +++ /dev/null @@ -1,55 +0,0 @@ -# Set sensible script defaults: -# set -e: Terminate script if a command returns an error -set -e -# set -u: Terminate script if an unset variable is used -set -u - -## START STANDARD BUILD SCRIPT INCLUDE -# adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" -## END STANDARD BUILD SCRIPT INCLUDE - -QUIET=0 - -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" - -THIS_DIR="$(dirname "$THIS_SCRIPT")" - -# -# Copy release notes for Gradle Play Publisher to upload -# Reference: https://github.com/Triple-T/gradle-play-publisher#uploading-release-notes -# -PLAY_RELEASE_NOTES="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/play/release-notes/en-US/$TIER.txt" -if [ $TIER = "stable" ]; then - PLAY_RELEASE_NOTES="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/play/release-notes/en-US/default.txt" -fi -echo "Generating Play Store release notes to $PLAY_RELEASE_NOTES" -echo "" > "$PLAY_RELEASE_NOTES" - -# Copy whatsnew.md to release notes 1 line at a time, -# filtering for lines that start with "*". -# Pad release notes if whatsnew.md doesn't have any line items -# Play Store release notes have a limit of 500 characters -DEFAULT_RELEASE_NOTE="* Additional bug fixes and improvements" -FILTERED_LINES=$( grep '^\s*\*.*$' "$KEYMAN_ROOT/android/help/about/whatsnew.md" || [[ $? == 1 ]] ) # Continue if grep has no matches -if [ -z "$FILTERED_LINES" ]; then - FILTERED_LINES="$DEFAULT_RELEASE_NOTE" - warn "Warning: whatsnew.md empty so using default release note: '$FILTERED_LINES'" -fi - -IFS=$'\n' # Change IFS to new line -for line in $FILTERED_LINES -do - CHARS_IN_RELEASE_NOTES=$( wc -m < $PLAY_RELEASE_NOTES ) - CHARS_IN_CURRENT_LINE=$( wc -m <<< $line ) - if (( CHARS_IN_RELEASE_NOTES + CHARS_IN_CURRENT_LINE + 1 < 450 )); then - # Copy line to Play Store release notes - echo "$line" >> $PLAY_RELEASE_NOTES - else - # 450 chars reached - warn "Warning: Play Store release notes approaching 500 character limit" - echo "$DEFAULT_RELEASE_NOTE" >> $PLAY_RELEASE_NOTES - break - fi -done diff --git a/android/KMAPro/build.gradle b/android/KMAPro/build.gradle index f77d9cc534b59115cddf2144cdd53847806f1a5d..7e49d3dc01819159a066fe7c5b4450a667867599 100644 --- a/android/KMAPro/build.gradle +++ b/android/KMAPro/build.gradle @@ -6,7 +6,7 @@ buildscript { mavenCentral() } dependencies { - classpath 'com.android.tools.build:gradle:4.2.2' + classpath 'com.android.tools.build:gradle:7.4.0' // sentry-android-gradle-plugin 2.1.5+ requires AGP 7.0 classpath 'io.sentry:sentry-android-gradle-plugin:2.1.2' classpath 'name.remal:gradle-plugins:1.5.0' diff --git a/android/KMAPro/build.sh b/android/KMAPro/build.sh index f2ec3dacda7d78a763bfc4c8591c2171b970e1fb..192e3211187130db205b09b1ba36d0f63ebaeab5 100755 --- a/android/KMAPro/build.sh +++ b/android/KMAPro/build.sh @@ -1,39 +1,64 @@ #!/usr/bin/env bash -# Build KMAPro - -# Set sensible script defaults: -# set -e: Terminate script if a command returns an error -set -e -# set -u: Terminate script if an unset variable is used -set -u -# set -x: Debugging use, print each statement +# Build Keyman for Android app (KMAPro) + # set -x +set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" +. "$KEYMAN_ROOT/resources/build/build-help.inc.sh" . "$KEYMAN_ROOT/resources/build/build-download-resources.sh" -echo Build KMAPro - -# -# Prevents 'clear' on exit of mingw64 bash shell -# -SHLVL=0 - -display_usage ( ) { - echo "build.sh [-no-daemon] [-debug] [-download-resources]" - echo - echo "Build Keyman for Android" - echo " -no-daemon Don't start the Gradle daemon. Use for CI" - echo " -upload-sentry Uploads debug symbols, etc, to Sentry" - echo " -debug Compile only Debug variant" - echo " -download-resources Download sil_euro_latin.kmp and nrc.en.mtnt.model.kmp from downloads.keyman.com" - exit 1 -} +# This script runs from its own folder +cd "$THIS_SCRIPT_PATH" + +# ################################ Main script ################################ + +# Definition of global compile constants + +CONFIG="release" +BUILD_FLAGS="build -x lint -x test" # Gradle build w/o test +TEST_FLAGS="-x assembleRelease lintRelease testRelease" # Gradle test w/o build +DAEMON_FLAG= + +builder_describe "Builds Keyman for Android app." \ + "@/android/KMEA" \ + "clean" \ + "configure" \ + "build" \ + "test Runs lint and unit tests." \ + "--ci Don't start the Gradle daemon. For CI" \ + "--upload-sentry Upload to sentry" + +# parse before describe_outputs to check debug flags +builder_parse "$@" + +if builder_is_debug_build; then + builder_heading "### Debug config ####" + CONFIG="debug" + BUILD_FLAGS="assembleDebug -x lint -x test" + TEST_FLAGS="-x assembleDebug lintDebug testDebug" +fi + +builder_describe_outputs \ + configure /android/KMAPro/kMAPro/libs/keyman-engine.aar \ + build /android/KMAPro/kMAPro/build/outputs/apk/$CONFIG/keyman-${VERSION}.apk + +#### Build + + +# Parse args + +if builder_has_option --ci; then + DAEMON_FLAG=--no-daemon +fi + +#### Build action definitions #### function makeLocalSentryRelease() { echo "Making a Sentry release for tag $VERSION_GIT_TAG" @@ -44,97 +69,50 @@ function makeLocalSentryRelease() { sentry-cli releases finalize "$VERSION_GIT_TAG" } -NO_DAEMON=false -ONLY_DEBUG=false -DO_KEYBOARDS_DOWNLOAD=false -DO_MODELS_DOWNLOAD=false -DO_SENTRY_LOCAL_UPLOAD=false -# Parse args -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - -no-daemon) - NO_DAEMON=true - ;; - -upload-sentry) - # Overrides default set by build-utils.sh - UPLOAD_SENTRY=true - ;; - -debug) - ONLY_DEBUG=true - ;; - -download-resources) - DO_KEYBOARDS_DOWNLOAD=true - DO_MODELS_DOWNLOAD=true - ;; - -h|-\?) - display_usage - ;; - esac - shift # past argument -done - -KEYBOARD_PACKAGE_ID="sil_euro_latin" -KEYBOARDS_TARGET="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/assets/${KEYBOARD_PACKAGE_ID}.kmp" -MODEL_PACKAGE_ID="nrc.en.mtnt" -MODELS_TARGET="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/assets/${MODEL_PACKAGE_ID}.model.kmp" - -# Verify default keyboard and dictionary exist -if [[ ! -f "$KEYBOARDS_TARGET" ]]; then - echo "$KEYBOARDS_TARGET doesn't exist. Will download the latest version" - DO_KEYBOARDS_DOWNLOAD=true -fi +#### Build action definitions #### -if [[ ! -f "$MODELS_TARGET" ]]; then - echo "$MODELS_TARGET doesn't exist. Will download the latest version" - DO_MODELS_DOWNLOAD=true +# Check about cleaning artifact paths +if builder_start_action clean; then + rm -rf "$KEYMAN_ROOT/android/KMAPro/kMAPro/build/outputs" + builder_finish_action success clean fi -# Local development optimization to upload local symbols to Sentry -if [[ $VERSION_ENVIRONMENT == "local" && $ONLY_DEBUG == true && $UPLOAD_SENTRY == true ]]; then - DO_SENTRY_LOCAL_UPLOAD=true -fi +if builder_start_action configure; then -echo -echo "NO_DAEMON: $NO_DAEMON" -echo "ONLY_DEBUG: $ONLY_DEBUG" -echo "DO_KEYBOARDS_DOWNLOAD: $DO_KEYBOARDS_DOWNLOAD" -echo "DO_MODELS_DOWNLOAD: $DO_MODELS_DOWNLOAD" -echo "DO_SENTRY_LOCAL_UPLOAD: $DO_SENTRY_LOCAL_UPLOAD" -echo + KEYBOARD_PACKAGE_ID="sil_euro_latin" + KEYBOARDS_TARGET="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/assets/${KEYBOARD_PACKAGE_ID}.kmp" + MODEL_PACKAGE_ID="nrc.en.mtnt" + MODELS_TARGET="$KEYMAN_ROOT/android/KMAPro/kMAPro/src/main/assets/${MODEL_PACKAGE_ID}.model.kmp" -if [ "$NO_DAEMON" = true ]; then - DAEMON_FLAG=--no-daemon -else - DAEMON_FLAG= + downloadKeyboardPackage "$KEYBOARD_PACKAGE_ID" "$KEYBOARDS_TARGET" + downloadModelPackage "$MODEL_PACKAGE_ID" "$MODELS_TARGET" + + builder_finish_action success configure fi -# Convert markdown to html for offline help -echo "Converting markdown to html for offline help" -cd "$KEYMAN_ROOT/android" -./build-help.sh htm -cd "$KEYMAN_ROOT/android/KMAPro" +if builder_start_action build; then -# Download default keyboard and dictionary -if [ "$DO_KEYBOARDS_DOWNLOAD" = true ]; then - downloadKeyboardPackage "$KEYBOARD_PACKAGE_ID" "$KEYBOARDS_TARGET" -fi + # Copy Keyman Engine for Android + cp "$KEYMAN_ROOT/android/KMEA/app/build/outputs/aar/keyman-engine-${CONFIG}.aar" "$KEYMAN_ROOT/android/KMAPro/kMAPro/libs/keyman-engine.aar" -if [ "$DO_MODELS_DOWNLOAD" = true ]; then - downloadModelPackage "$MODEL_PACKAGE_ID" "$MODELS_TARGET" -fi + # Convert markdown to html for offline help + build_help_html android KMAPro/kMAPro/src/main/assets/info -if [ "$ONLY_DEBUG" = true ]; then - BUILD_FLAGS="assembleDebug lintDebug" -else - # build = assemble + check; check = test + lint - BUILD_FLAGS=build + echo "BUILD_FLAGS $BUILD_FLAGS" + ./gradlew $DAEMON_FLAG clean $BUILD_FLAGS + + if builder_has_option --upload-sentry; then + makeLocalSentryRelease + fi + + builder_finish_action success build fi -echo "BUILD_FLAGS $BUILD_FLAGS" -./gradlew $DAEMON_FLAG clean $BUILD_FLAGS +if builder_start_action test; then -if [ "$DO_SENTRY_LOCAL_UPLOAD" = true ]; then - makeLocalSentryRelease -fi \ No newline at end of file + echo "TEST_FLAGS $TEST_FLAGS" + ./gradlew $DAEMON_FLAG $TEST_FLAGS + + builder_finish_action success test +fi diff --git a/android/KMAPro/gradle/wrapper/gradle-wrapper.properties b/android/KMAPro/gradle/wrapper/gradle-wrapper.properties index 41dfb87909a877d96c3af4adccce4c7a301b55a2..ae04661ee733431762e7ccf8ab9b7409ed44960c 100644 --- a/android/KMAPro/gradle/wrapper/gradle-wrapper.properties +++ b/android/KMAPro/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/KMAPro/kMAPro/build.gradle b/android/KMAPro/kMAPro/build.gradle index f2d788df2b42384a46598b6429981c00ff22fdc2..e12b928a9c7f2a78a584fd6f1095e3bb32284765 100644 --- a/android/KMAPro/kMAPro/build.gradle +++ b/android/KMAPro/kMAPro/build.gradle @@ -2,7 +2,7 @@ plugins { id 'com.android.application' id 'io.sentry.android.gradle' // https://github.com/Triple-T/gradle-play-publisher/issues/947#issuecomment-843634852 - id 'com.github.triplet.play' version '3.7.0-agp4.2' apply false + id 'com.github.triplet.play' version '3.8.1' apply false id 'name.remal.default-plugins' } @@ -11,15 +11,12 @@ apply from: "$rootPath/version.gradle" android { compileSdkVersion 33 + namespace="com.tavultesoft.kmapro" // Don't compress kmp files so they can be copied via AssetManager aaptOptions { noCompress "kmp" } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } defaultConfig { applicationId "com.tavultesoft.kmapro" @@ -95,6 +92,11 @@ android { } } variant.resValue "string", "app_name", 'Keyman' + appSuffix; + + // Adjust output name to "keyman-${VERSION_MD}.apk" + variant.outputs.all { + outputFileName = "keyman-" + VERSION_MD + ".apk" + } } lintOptions { disable 'MissingQuantity', 'MissingTranslation' @@ -159,7 +161,7 @@ dependencies { // Add dependency for generating QR Codes // (Even though it's embedded in KMEA, because we're manually copying keyman-engine.aar, // we "lose" it in the dependency management) - implementation ('com.github.kenglxn.QRGen:android:2.7.0') { + implementation ('com.github.kenglxn.QRGen:android:3.0.1') { transitive = true } } diff --git a/android/KMAPro/kMAPro/src/main/AndroidManifest.xml b/android/KMAPro/kMAPro/src/main/AndroidManifest.xml index 6acb4d9da107592b9bf3c9d0cf0924c243cfd4e0..5392c842277eb0152a2c19cde66d4bbe0f7b30fa 100644 --- a/android/KMAPro/kMAPro/src/main/AndroidManifest.xml +++ b/android/KMAPro/kMAPro/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/android/KMAPro/kMAPro/src/main/assets/.gitkeep b/android/KMAPro/kMAPro/src/main/assets/.gitkeep new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java index 96c0d3edfeddc56b3dae0d017e65ed3065a66544..6b92d4c2eb5ab8641b70876097c37d2727aa6b03 100644 --- a/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java +++ b/android/KMAPro/kMAPro/src/main/java/com/tavultesoft/kmapro/MainActivity.java @@ -109,6 +109,7 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene private final int minTextSize = 16; private final int maxTextSize = 72; private int textSize = minTextSize; + private int lastOrientation = Configuration.ORIENTATION_UNDEFINED; private static final String defaultKeyboardInstalled = "DefaultKeyboardInstalled"; private static final String defaultDictionaryInstalled = "DefaultDictionaryInstalled"; private static final String userTextKey = "UserText"; @@ -262,6 +263,14 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene super.onResume(); KMManager.onResume(); KMManager.hideSystemKeyboard(); + + // onConfigurationChanged() only triggers when device is rotated while app is in foreground + // This handles when device is rotated while app is in background + Configuration newConfig = this.getResources().getConfiguration(); + if (newConfig != null && newConfig.orientation != lastOrientation) { + lastOrientation = newConfig.orientation; + KMManager.onConfigurationChanged(newConfig); + } resizeTextView(textView.isKeyboardVisible()); KMManager.addKeyboardEventListener(this); @@ -345,9 +354,11 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene @Override public void onConfigurationChanged(Configuration newConfig) { super.onConfigurationChanged(newConfig); + KMManager.onConfigurationChanged(newConfig); getSupportActionBar().setBackgroundDrawable(getActionBarDrawable(this)); resizeTextView(textView.isKeyboardVisible()); invalidateOptionsMenu(); + lastOrientation = newConfig.orientation; } @SuppressLint("RestrictedApi") @@ -434,9 +445,10 @@ public class MainActivity extends BaseActivity implements OnKeyboardEventListene case R.id.action_share: showShareDialog(); return true; + /* Disable Web Browser to investigate Google sign-in case R.id.action_web: showWebBrowser(); - return true; + return true;*/ case R.id.action_text_size: showTextSizeDialog(); return true; diff --git a/android/KMAPro/kMAPro/src/main/res/menu-land/main.xml b/android/KMAPro/kMAPro/src/main/res/menu-land/main.xml index f1f9e614a1111253fb6b296008136c38f7bd9d48..bce17bc43a364596f3588e2ebd5f10824e5724c3 100644 --- a/android/KMAPro/kMAPro/src/main/res/menu-land/main.xml +++ b/android/KMAPro/kMAPro/src/main/res/menu-land/main.xml @@ -8,12 +8,13 @@ app:showAsAction="always" android:title="@string/action_share" android:icon="@drawable/ic_light_action_share" /> - - + - - + - - + + አጋራ @@ -25,6 +26,7 @@ እዚህ ጋር መጻፍ ይጀምሩ … + የጽሑፍ መጠን፦ %1$d @@ -156,5 +158,5 @@ የፊደል ገበታው አዲሱን የኪይማን ስሪት ይፈልጋል - Unable to launch web browser + ብራውሰሩን ማስጀመር አልተቻለም diff --git a/android/KMAPro/kMAPro/src/main/res/values-ckl-rNG/strings.xml b/android/KMAPro/kMAPro/src/main/res/values-ckl-rNG/strings.xml index 41e86134f7ab7cc10309aa0caae6133006da3d60..b6c15b2315dceb4546f748c10f9c6a0cae0bc23e 100644 --- a/android/KMAPro/kMAPro/src/main/res/values-ckl-rNG/strings.xml +++ b/android/KMAPro/kMAPro/src/main/res/values-ckl-rNG/strings.xml @@ -1,5 +1,6 @@ + Ndǝɦǝnta @@ -25,6 +26,7 @@ Badicini taiping akwani… + Ngakurǝr Text: %1$d @@ -82,7 +84,7 @@ Ta gǝta tsanti kapshion ata spesba - Vibrate when typing + Ata kǝngǝri ko tuwa ma gata kǝra ʻya taiping Tsanti banner kǝlara saka @@ -154,7 +156,7 @@ Invalid/Missing metadata in package - Keyboard requires a newer version of Keyman + Kibod ǝni ada kǝthlǝr aka jiliyir Keyman nam bǝlin. - Unable to launch web browser + Yar ta mǝzi ka mburnta brauza wɛ diff --git a/android/KMAPro/kMAPro/src/main/res/values-ff-rZA/strings.xml b/android/KMAPro/kMAPro/src/main/res/values-ff-rZA/strings.xml index a14154d44969050a5edc6494dcf959e47ddbed9e..c5780766f023a4fbc09c92f6cc72867ab7ca5b33 100644 --- a/android/KMAPro/kMAPro/src/main/res/values-ff-rZA/strings.xml +++ b/android/KMAPro/kMAPro/src/main/res/values-ff-rZA/strings.xml @@ -1,5 +1,6 @@ + Lollin @@ -82,7 +83,7 @@ Hoto hollu cifol e palal boowe - Vibrate when typing + Yerɓu tuma tappugol Hollu beywal sahaa kala @@ -156,5 +157,5 @@ Tappirde ena naamndii yamre Keyman ɓurnde hesɗude - Unable to launch web browser + Horiima hurminde wanngorde geese diff --git a/android/KMAPro/kMAPro/src/main/res/values-zh-rCN/strings.xml b/android/KMAPro/kMAPro/src/main/res/values-zh-rCN/strings.xml index 950f7530015c582654ff2e715c7ac70d6602fb72..ef07ed981347080a67d7ddef78f5dc1ce3ea6570 100644 --- a/android/KMAPro/kMAPro/src/main/res/values-zh-rCN/strings.xml +++ b/android/KMAPro/kMAPro/src/main/res/values-zh-rCN/strings.xml @@ -1,5 +1,6 @@ + 分享 @@ -25,6 +26,7 @@ 开始在这里输入… + 文本大小: %1$d diff --git a/android/KMEA/app/build.gradle b/android/KMEA/app/build.gradle index 0caa91a70b5709918c82cda0ce87ba9ed955743e..423862b79b82be1fc6ba02bee160ff83317ca524 100644 --- a/android/KMEA/app/build.gradle +++ b/android/KMEA/app/build.gradle @@ -8,6 +8,7 @@ apply from: "$rootPath/version.gradle" android { compileSdkVersion 33 + namespace "com.keyman.engine" defaultConfig { minSdkVersion 21 @@ -16,6 +17,9 @@ android { // VERSION_CODE and VERSION_NAME from version.gradle but Gradle removes them for libraries buildConfigField "String", "KEYMAN_ENGINE_VERSION_NAME", "\""+VERSION_NAME+"\"" buildConfigField "String", "VERSION_ENVIRONMENT", "\""+VERSION_ENVIRONMENT+"\"" + + // Sepcify library filename keyman-engine-$CONFIG.aar + setProperty("archivesBaseName", "keyman-engine") } buildTypes { @@ -45,16 +49,6 @@ android { } systemProperty 'kmeaTestMode', 'true' workingDir = "../" // Defaults to the `app` subdirectory, which is different from Android Studio's default. - - //Avoid Warning: an illegal reflective access operation has occurred - //Change argument jdk.module.illegalAccess=warn for detailed information which module needs to be opened - //Problem is caused by robolectric: see https://github.com/robolectric/robolectric/issues/4776 - if(JavaVersion.current().isJava9Compatible()){ - jvmArgs ('-Djdk.module.illegalAccess=permit') - jvmArgs('--add-opens', 'java.base/java.lang=ALL-UNNAMED') - jvmArgs('--add-opens', 'java.base/java.lang.reflect=ALL-UNNAMED') - } - } } } @@ -74,8 +68,7 @@ dependencies { testImplementation 'org.robolectric:robolectric:4.8.1' // Generate QR Codes - // 3.0.1 requires Java 11 - implementation ('com.github.kenglxn.QRGen:android:2.7.0') { + implementation ('com.github.kenglxn.QRGen:android:3.0.1') { transitive = true } } diff --git a/android/KMEA/app/src/main/AndroidManifest.xml b/android/KMEA/app/src/main/AndroidManifest.xml index b880992618947d224aae4fee680d3e3eac32f2ce..c4522addc4ada721c3d589a1efa04e13d9014e92 100644 --- a/android/KMEA/app/src/main/AndroidManifest.xml +++ b/android/KMEA/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java index 2c137f971f24f68164f39794c00bcca190cb42ab..88dc290322cb9ba588934c855f3ee79afa13e229 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboard.java @@ -47,6 +47,9 @@ import android.view.MotionEvent; import android.view.View; import android.view.ViewGroup; import android.view.WindowManager; +import android.view.inputmethod.ExtractedText; +import android.view.inputmethod.ExtractedTextRequest; +import android.view.inputmethod.InputConnection; import android.webkit.ConsoleMessage; import android.webkit.WebChromeClient; import android.webkit.WebSettings; @@ -67,15 +70,33 @@ import io.sentry.SentryLevel; final class KMKeyboard extends WebView { private static final String TAG = "KMKeyboard"; private final Context context; - private KeyboardType keyboardType = KeyboardType.KEYBOARD_TYPE_UNDEFINED; private String packageID; private String keyboardID; private String keyboardName; private String keyboardVersion; + private boolean shouldIgnoreTextChange = false; + private boolean shouldIgnoreSelectionChange = false; + + protected KeyboardType keyboardType = KeyboardType.KEYBOARD_TYPE_UNDEFINED; protected ArrayList javascriptAfterLoad = new ArrayList(); private static String currentKeyboard = null; + + /** + * Banner state value: "blank" - no banner available. + */ + protected static final String KM_BANNER_STATE_BLANK = "blank"; + /** + * Banner state value: "suggestion" - dictionary suggestions are shown. + */ + protected static final String KM_BANNER_STATE_SUGGESTION = "suggestion"; + + /** + * Current banner state. + */ + protected static String currentBanner = KM_BANNER_STATE_BLANK; + private static String txtFont = ""; private static String oskFont = null; private static String keyboardRoot = ""; @@ -121,7 +142,7 @@ final class KMKeyboard extends WebView { } public boolean getShouldShowHelpBubble() { - if(this._shouldShowHelpBubble == null) { + if (this._shouldShowHelpBubble == null) { SharedPreferences prefs = context.getSharedPreferences(context.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE); this._shouldShowHelpBubble = prefs.getBoolean(KMManager.KMKey_ShouldShowHelpBubble, true); } @@ -133,6 +154,55 @@ final class KMKeyboard extends WebView { this._shouldShowHelpBubble = flag; } + protected boolean shouldIgnoreTextChange() { + return shouldIgnoreTextChange; + } + + protected void setShouldIgnoreTextChange(boolean ignore) { + this.shouldIgnoreTextChange = ignore; + } + + protected boolean shouldIgnoreSelectionChange() { + return shouldIgnoreSelectionChange; + } + + protected void setShouldIgnoreSelectionChange(boolean ignore) { + this.shouldIgnoreSelectionChange = ignore; + } + + protected boolean updateText(String text) { + boolean result = false; + String kmText = ""; + if (text != null) { + kmText = text.toString().replace("\\", "\\u005C").replace("'", "\\u0027").replace("\n", "\\n"); + } + + if (KMManager.isKeyboardLoaded(this.keyboardType) && !shouldIgnoreTextChange) { + this.loadJavascript(KMString.format("updateKMText('%s')", kmText)); + result = true; + } + + shouldIgnoreTextChange = false; + return result; + } + + protected boolean updateSelectionRange(int selStart, int selEnd) { + boolean result = false; + InputConnection ic = KMManager.getInputConnection(this.keyboardType); + if (ic != null) { + ExtractedText icText = ic.getExtractedText(new ExtractedTextRequest(), 0); + if (icText != null) { + updateText(icText.text.toString()); + } + } + this.loadJavascript(KMString.format("updateKMSelectionRange(%d,%d)", selStart, selEnd)); + result = true; + + return result; + } + + + @SuppressWarnings("deprecation") @SuppressLint("SetJavaScriptEnabled") public void initKMKeyboard(final Context context) { @@ -150,21 +220,10 @@ final class KMKeyboard extends WebView { getSettings().setCacheMode(WebSettings.LOAD_NO_CACHE); getSettings().setSupportZoom(false); - if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { - getSettings().setUseWideViewPort(true); - getSettings().setLoadWithOverviewMode(true); - setWebContentsDebuggingEnabled(true); - } - if (keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP && Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR1) - setLayerType(View.LAYER_TYPE_SOFTWARE, null); // Disable hardware acceleration for API < 17, Keyman keyboard is slower without HWA but it causes some display issues. - // (Tested on Samsung Galaxy Nexus running Android 4.1.2) - - if (Build.VERSION.SDK_INT < Build.VERSION_CODES.JELLY_BEAN_MR2) { - // These were deprecated in API 18 - getSettings().setRenderPriority(WebSettings.RenderPriority.HIGH); - getSettings().setPluginState(WebSettings.PluginState.ON_DEMAND); - } + getSettings().setUseWideViewPort(true); + getSettings().setLoadWithOverviewMode(true); + setWebContentsDebuggingEnabled(true); setWebChromeClient(new WebChromeClient() { public boolean onConsoleMessage(ConsoleMessage cm) { @@ -412,6 +471,24 @@ final class KMKeyboard extends WebView { return currentKeyboard; } + public static void setCurrentBanner(String banner) { + currentBanner = banner; + } + + public static String currentBanner() { return currentBanner; } + + protected void toggleSuggestionBanner(HashMap associatedLexicalModel, boolean keyboardChanged) { + //reset banner state if new language has no lexical model + if (currentBanner != null && currentBanner.equals(KM_BANNER_STATE_SUGGESTION) + && associatedLexicalModel == null) { + setCurrentBanner(KMKeyboard.KM_BANNER_STATE_BLANK); + } + + if(keyboardChanged) { + setLayoutParams(KMManager.getKeyboardLayoutParams()); + } + } + /** * Return the full path to the display text font. Usually used for creating a Typeface font * @return String diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java index 47d7d03231589b03907e2aaae509809fbfe7f3a4..2e939d15ba91716395f23b780b4d8899dc72b2a4 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardJSHandler.java @@ -2,16 +2,28 @@ package com.keyman.engine; import android.content.Context; import android.os.Build; +import android.os.Handler; +import android.os.Looper; import android.os.VibrationEffect; import android.os.Vibrator; import android.util.DisplayMetrics; import android.util.Log; +import android.view.HapticFeedbackConstants; +import android.view.KeyEvent; +import android.view.ViewGroup; +import android.view.inputmethod.EditorInfo; +import android.view.inputmethod.ExtractedText; +import android.view.inputmethod.ExtractedTextRequest; +import android.view.inputmethod.InputConnection; import android.webkit.JavascriptInterface; -import android.widget.RelativeLayout; import static android.content.Context.VIBRATOR_SERVICE; -public abstract class KMKeyboardJSHandler { +import com.keyman.engine.KMManager.KeyboardType; +import com.keyman.engine.util.CharSequenceUtil; +import com.keyman.engine.util.KMLog; + +public class KMKeyboardJSHandler { private Context context; private KMKeyboard k = null; private static int KM_VIBRATE_DURATION = 100; // milliseconds @@ -64,6 +76,116 @@ public abstract class KMKeyboardJSHandler { } } + /** + * Inserts the selected string s + * @param dn Number of pre-caret code points (UTF+8 characters) to delete + * @param s Text to insert + * @param dr Number of post-caret code points to delete. + */ + @JavascriptInterface + public void insertText(final int dn, final String s, final int dr, final boolean executingHardwareKeystroke) { + Handler mainLoop = new Handler(Looper.getMainLooper()); + mainLoop.post(new Runnable() { + public void run() { + if (k == null) { + KMLog.LogError(TAG, "insertText failed: Keyboard is null"); + return; + } + + if (k.subKeysWindow != null) { + return; + } + + if (!isInappKMTextViewValid(k.keyboardType)) { + return; + } + + InputConnection ic = KMManager.getInputConnection(k.keyboardType); + if (ic == null) { + KMLog.LogError(TAG, "insertText failed: InputConnection is null"); + return; + } + + ic.beginBatchEdit(); + + int deleteLeft = dn; + + // Delete any existing selected text. + ExtractedText icText = ic.getExtractedText(new ExtractedTextRequest(), 0); + if (icText != null) { // This can be null if the input connection becomes invalid. + int start = icText.startOffset + icText.selectionStart; + int end = icText.startOffset + icText.selectionEnd; + if (end < start) { + // Swap start/end for backward selection + int temp = start; + start = end; + end = temp; + } + if (end > start) { + if (s.length() == 0) { + ic.setSelection(start, start); + ic.deleteSurroundingText(0, end - start); + ic.endBatchEdit(); + return; + } else { + k.setShouldIgnoreSelectionChange(true); + ic.setSelection(start, start); + ic.deleteSurroundingText(0, end - start); + } + + // KeymanWeb tells us how to delete the selection, but we don't + // want to do that twice + deleteLeft = 0; + } + } + + if (s.length() > 0 && s.charAt(0) == '\n') { + keyDownUp(KeyEvent.KEYCODE_ENTER, 0); + ic.endBatchEdit(); + return; + } + + // Perform left-deletions + if (deleteLeft > 0) { + if (k.keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP) { + k.setShouldIgnoreTextChange(true); + k.setShouldIgnoreSelectionChange(true); + } + performLeftDeletions(ic, deleteLeft); + } + + // Perform right-deletions + for (int i = 0; i < dr; i++) { + CharSequence chars = ic.getTextAfterCursor(1, 0); + if (chars != null && chars.length() > 0) { + char c = chars.charAt(0); + k.setShouldIgnoreSelectionChange(true); + if (Character.isHighSurrogate(c)) { + ic.deleteSurroundingText(0, 2); + } else { + ic.deleteSurroundingText(0, 1); + } + } + } + + if (s.length() > 0) { + k.setShouldIgnoreSelectionChange(true); + // Commit the string s. Use newCursorPosition 1 so cursor will end up after the string. + ic.commitText(s, 1); + } + + k.dismissHelpBubble(); + k.setShouldShowHelpBubble(false); + + ic.endBatchEdit(); + ViewGroup parent = (ViewGroup) k.getParent(); + if (parent != null && KMManager.getHapticFeedback() && !executingHardwareKeystroke) { + parent.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); + } + } + }); + } + // Store the current keyboard chirality status from KMW in the Keyboard @JavascriptInterface public void setIsChiral(boolean isChiral) { @@ -73,14 +195,155 @@ public abstract class KMKeyboardJSHandler { } @JavascriptInterface - public abstract boolean dispatchKey(final int code, final int eventModifiers); + public boolean dispatchKey(final int code, final int eventModifiers) { + Handler mainLoop = new Handler(Looper.getMainLooper()); + mainLoop.post(new Runnable() { + public void run() { + if (k == null) { + KMLog.LogError(TAG, "dispatchKey failed: Keyboard is null"); + return; + } + + if (k.subKeysWindow != null) { + return; + } + + if (!isInappKMTextViewValid(k.keyboardType)) { + return; + } + + InputConnection ic = KMManager.getInputConnection(k.keyboardType); + if (ic == null) { + KMLog.LogError(TAG, "dispatchKey failed: InputConnection is null"); + return; + } + + k.dismissHelpBubble(); + k.setShouldShowHelpBubble(false); + + // Handle tab or enter since KMW didn't process it + if (KMManager.isDebugMode()) { + Log.d(TAG, "dispatchKey called with code: " + code + ", eventModifiers: " + eventModifiers); + } + if (code == KMScanCodeMap.scanCodeMap[KMScanCodeMap.KEY_TAB]) { + keyDownUp(KeyEvent.KEYCODE_TAB, eventModifiers); + } else if (code == KMScanCodeMap.scanCodeMap[KMScanCodeMap.KEY_ENTER]) { + keyDownUp(KeyEvent.KEYCODE_ENTER, eventModifiers); + } + } + }); + return true; + } + + private void keyDownUp(int keyEventCode, int eventModifiers) { + if (k.keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP) { + KMTextView textView = (KMTextView)KMTextView.activeView; + if (keyEventCode == KeyEvent.KEYCODE_TAB) { + KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_TAB, 0, eventModifiers, 0, 0, 0); + textView.dispatchKeyEvent(event); + } else { + textView.keyDownUp(keyEventCode); + } + } else if (k.keyboardType == KeyboardType.KEYBOARD_TYPE_SYSTEM) { + InputConnection ic = KMManager.getInputConnection(KeyboardType.KEYBOARD_TYPE_SYSTEM); + ic.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, keyEventCode)); + ic.sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, keyEventCode)); + } + } + + /* + // Chromium up until version M81 had a bug where deleteSurroundingText deletes an entire + // grapheme cluster instead of one code-point. See Chromium issue #1024738 + // https://bugs.chromium.org/p/chromium/issues/detail?id=1024738 + // + // We'll retrieve up to (dn*2+16) characters before the cursor to collect enough characters + // for surrogate pairs + a long grapheme cluster. + // This buffer will be used to put back characters as-needed + */ + private static void performLeftDeletions(InputConnection ic, int dn) { + int originalBufferLength = dn*2 + 16; // characters + CharSequence charsBackup = getCharacterSequence(ic, originalBufferLength); + + int lastIndex = charsBackup.length()-1; + + // Exit if there's no context to delete + if (lastIndex < 0) { + return; + } + + // Count the number of characters which are surrogate pairs + int numPairs = CharSequenceUtil.countSurrogatePairs(charsBackup, dn); + + // Chop dn+numPairs code points from the end of charsBackup + // subSequence indices are start(inclusive) to end(exclusive) + CharSequence expectedChars = charsBackup.subSequence(0, charsBackup.length() - (dn + numPairs)); + ic.deleteSurroundingText(dn + numPairs, 0); + CharSequence newContext = getCharacterSequence(ic, originalBufferLength - 2*dn); + + CharSequence charsToRestore = CharSequenceUtil.restoreChars(expectedChars, newContext); + if (charsToRestore.length() > 0) { + // Restore expectedChars that Chromium deleted. + // Use newCusorPosition 1 so cursor will be after the inserted string + ic.commitText(charsToRestore, 1); + } + } /** - * Inserts the selected string s - * @param dn Number of pre-caret code points (UTF+8 characters) to delete - * @param s Text to insert - * @param dr Number of post-caret code points to delete. + * Get a character sequence from the InputConnection. + * Sometimes the WebView can split a surrogate pair at either end, + * so chop that and update the cursor + * @param ic - the InputConnection + * @param length - number of characters to get + * @return CharSequence */ - @JavascriptInterface - public abstract void insertText(final int dn, final String s, final int dr, final boolean executingHardwareKeystroke); + private static CharSequence getCharacterSequence(InputConnection ic, int length) { + if (ic == null || length <= 0) { + return ""; + } + + CharSequence sequence = ic.getTextBeforeCursor(length, 0); + if (sequence == null || sequence.length() <= 0) { + return ""; + } + + // Move the cursor back if there's a split surrogate pair + if (Character.isHighSurrogate(sequence.charAt(sequence.length()-1))) { + ic.commitText("", -1); + sequence = ic.getTextBeforeCursor(length, 0); + } + + if (sequence == null || sequence.length() <= 0) { + return ""; + } + + if (Character.isLowSurrogate(sequence.charAt(0))) { + // Adjust if the first char is also a split surrogate pair + // subSequence indices are start(inclusive) to end(exclusive) + sequence = sequence.subSequence(1, sequence.length()); + } + + return sequence; + } + + /** + * If the keyboard type is KEYBOARD_TYPE_INAPP, check if the KMTextView is valid. + * For KEYBOARD_TYPE_SYSTEM, returns true. + * @param keyboardType + * @return boolean - false if keyboard type is INAPP and KMTextView is invalid. Otherwise true + */ + private static boolean isInappKMTextViewValid(KeyboardType keyboardType) { + if (keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP) { + if (KMTextView.activeView == null) { + if (KMManager.isDebugMode()) { + Log.w(TAG, "activeView is null"); + } + return false; + } + if (KMTextView.activeView.getClass() != KMTextView.class) { + return false; + } + } + + return true; + } } diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardWebViewClient.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardWebViewClient.java index 6b6503828de350fc9cc328f69299a6974d82d62a..7ea366f0d12b443cafdf3a9695b90f30036d734a 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardWebViewClient.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMKeyboardWebViewClient.java @@ -27,14 +27,14 @@ import java.util.HashMap; public final class KMKeyboardWebViewClient extends WebViewClient { public static final String TAG = "KMKeyboardWebViewClient"; - public static Context context; - private static KeyboardType keyboardType; - private static boolean keyboardLoaded; + public Context context; + private KeyboardType keyboardType; + private boolean keyboardLoaded; KMKeyboardWebViewClient(Context context, KeyboardType keyboardType) { - KMKeyboardWebViewClient.context = context; - KMKeyboardWebViewClient.keyboardType = keyboardType; - KMKeyboardWebViewClient.keyboardLoaded = false; + this.context = context; + this.keyboardType = keyboardType; + this.keyboardLoaded = false; if (keyboardType != KeyboardType.KEYBOARD_TYPE_INAPP && keyboardType != KeyboardType.KEYBOARD_TYPE_SYSTEM) { KMLog.LogError(TAG, String.format("Cannot initialize: Invalid keyboard type: %s", keyboardType.toString())); @@ -42,7 +42,7 @@ public final class KMKeyboardWebViewClient extends WebViewClient { } public void setContext(Context context) { - KMKeyboardWebViewClient.context = context; + this.context = context; } public boolean getKeyboardLoaded() { @@ -50,7 +50,7 @@ public final class KMKeyboardWebViewClient extends WebViewClient { } public void setKeyboardLoaded(boolean keyboardLoaded) { - KMKeyboardWebViewClient.keyboardLoaded = keyboardLoaded; + this.keyboardLoaded = keyboardLoaded; } @Override @@ -74,7 +74,7 @@ public final class KMKeyboardWebViewClient extends WebViewClient { KMManager.currentLexicalModel = null; if (url.startsWith("file")) { // TODO: is this test necessary? - KMKeyboardWebViewClient.keyboardLoaded = true; + this.keyboardLoaded = true; SharedPreferences prefs = context.getSharedPreferences(context.getString(R.string.kma_prefs_name), Context.MODE_PRIVATE); int index = prefs.getInt(KMManager.KMKey_UserKeyboardIndex, 0); @@ -245,8 +245,8 @@ public final class KMKeyboardWebViewClient extends WebViewClient { if (KMManager.currentLexicalModel != null) { modelPredictionPref = prefs.getBoolean(KMManager.getLanguagePredictionPreferenceKey(KMManager.currentLexicalModel.get(KMManager.KMKey_LanguageID)), true); } - KMManager.currentBanner = (isModelActive && modelPredictionPref) ? - KMManager.KM_BANNER_STATE_SUGGESTION : KMManager.KM_BANNER_STATE_BLANK; + kmKeyboard.setCurrentBanner((isModelActive && modelPredictionPref) ? + KMKeyboard.KM_BANNER_STATE_SUGGESTION : KMKeyboard.KM_BANNER_STATE_BLANK); RelativeLayout.LayoutParams params = KMManager.getKeyboardLayoutParams(); kmKeyboard.setLayoutParams(params); } else if (url.indexOf("suggestPopup") >= 0) { diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java b/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java index b8e115f3e89d3cc8c408f383a27633a0266634f0..ebb8727bef53e5c39457f7f5bfeb1fcad89d7e82 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/KMManager.java @@ -158,6 +158,7 @@ public final class KMManager { }; protected static InputMethodService IMService; + private static boolean debugMode = false; private static boolean shouldAllowSetKeyboard = true; private static boolean didCopyAssets = false; @@ -174,10 +175,6 @@ public final class KMManager { private static KMManager.SpacebarText spacebarText = KMManager.SpacebarText.LANGUAGE_KEYBOARD; // must match default given in kmwbase.ts - protected static boolean InAppKeyboardShouldIgnoreTextChange = false; - protected static boolean InAppKeyboardShouldIgnoreSelectionChange = false; - protected static boolean SystemKeyboardShouldIgnoreTextChange = false; - protected static boolean SystemKeyboardShouldIgnoreSelectionChange = false; protected static KMKeyboard InAppKeyboard = null; protected static KMKeyboard SystemKeyboard = null; protected static KMKeyboardWebViewClient InAppKeyboardWebViewClient = null; @@ -189,22 +186,6 @@ public final class KMManager { public final static String predictionPrefSuffix = ".mayPredict"; public final static String correctionPrefSuffix = ".mayCorrect"; - /** - * Banner state value: "blank" - no banner available. - */ - protected static final String KM_BANNER_STATE_BLANK = "blank"; - /** - * Banner state value: "suggestion" - dictionary suggestions are shown. - */ - protected static final String KM_BANNER_STATE_SUGGESTION = "suggestion"; - - //TODO: should be part of kmkeyboard - /** - * Current banner state. - */ - protected static String currentBanner = KM_BANNER_STATE_BLANK; - - // Special override for when the keyboard may have haptic feedback when typing. // haptic feedback disabled for hardware keystrokes private static boolean mayHaveHapticFeedback = false; @@ -421,13 +402,11 @@ public final class KMManager { didCopyAssets = true; } - if (keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP) { - initInAppKeyboard(appContext); - } else if (keyboardType == KeyboardType.KEYBOARD_TYPE_SYSTEM) { - initSystemKeyboard(appContext); - } else { + if (keyboardType == KeyboardType.KEYBOARD_TYPE_UNDEFINED) { String msg = "Cannot initialize: Invalid keyboard type"; KMLog.LogError(TAG, msg); + } else { + initKeyboard(appContext, keyboardType); } JSONUtils.initialize(new File(getPackagesDir())); @@ -459,6 +438,22 @@ public final class KMManager { } public static InputMethodService getInputMethodService() { return IMService; } + /** + * Get the input connection based on the keyboard type. + * @param {KeyboardType} keyboard + * @return InputConnection + */ + protected static InputConnection getInputConnection(KeyboardType keyboard) { + if (keyboard == KeyboardType.KEYBOARD_TYPE_INAPP) { + return KMTextView.activeView.onCreateInputConnection(new EditorInfo()); + } else if (keyboard == KeyboardType.KEYBOARD_TYPE_SYSTEM && IMService != null) { + return IMService.getCurrentInputConnection(); + } + + KMLog.LogError(TAG, "Unable to determine input connection"); + return null; + } + public static boolean executeHardwareKeystroke(int code, int shift, int lstates, int eventModifiers) { if (SystemKeyboard != null) { return executeHardwareKeystroke(code, shift, KeyboardType.KEYBOARD_TYPE_SYSTEM, lstates, eventModifiers); @@ -609,36 +604,35 @@ public final class KMManager { return params; } - private static void initInAppKeyboard(Context appContext) { - if (InAppKeyboard == null) { + private static void initKeyboard(Context appContext, KeyboardType keyboardType) { + KMKeyboard keyboard = null; + KMKeyboardWebViewClient webViewClient = null; + + if (keyboardType == KeyboardType.KEYBOARD_TYPE_INAPP && InAppKeyboard == null) { InAppKeyboard = new KMKeyboard(appContext, KeyboardType.KEYBOARD_TYPE_INAPP); - RelativeLayout.LayoutParams params = getKeyboardLayoutParams(); - InAppKeyboard.setLayoutParams(params); - InAppKeyboard.setVerticalScrollBarEnabled(false); - InAppKeyboard.setHorizontalScrollBarEnabled(false); - InAppKeyboardWebViewClient = new KMKeyboardWebViewClient(appContext, KeyboardType.KEYBOARD_TYPE_INAPP); - InAppKeyboard.setWebViewClient(InAppKeyboardWebViewClient); - InAppKeyboard.addJavascriptInterface(new KMInAppKeyboardJSHandler(appContext, InAppKeyboard), "jsInterface"); - InAppKeyboard.loadKeyboard(); + InAppKeyboardWebViewClient = new KMKeyboardWebViewClient(appContext, keyboardType); + keyboard = InAppKeyboard; + webViewClient = InAppKeyboardWebViewClient; + } else if (keyboardType == KeyboardType.KEYBOARD_TYPE_SYSTEM && SystemKeyboard == null) { + SystemKeyboard = new KMKeyboard(appContext, KeyboardType.KEYBOARD_TYPE_SYSTEM); + SystemKeyboardWebViewClient = new KMKeyboardWebViewClient(appContext, keyboardType); + keyboard = SystemKeyboard; + webViewClient = SystemKeyboardWebViewClient; + } - setEngineWebViewVersionStatus(appContext, InAppKeyboard); + if (keyboard == null) { + return; } - } - private static void initSystemKeyboard(Context appContext) { - if (SystemKeyboard == null) { - SystemKeyboard = new KMKeyboard(appContext, KeyboardType.KEYBOARD_TYPE_SYSTEM); - RelativeLayout.LayoutParams params = getKeyboardLayoutParams(); - SystemKeyboard.setLayoutParams(params); - SystemKeyboard.setVerticalScrollBarEnabled(false); - SystemKeyboard.setHorizontalScrollBarEnabled(false); - SystemKeyboardWebViewClient = new KMKeyboardWebViewClient(appContext, KeyboardType.KEYBOARD_TYPE_SYSTEM); - SystemKeyboard.setWebViewClient(SystemKeyboardWebViewClient); - SystemKeyboard.addJavascriptInterface(new KMSystemKeyboardJSHandler(appContext, SystemKeyboard), "jsInterface"); - SystemKeyboard.loadKeyboard(); + RelativeLayout.LayoutParams params = getKeyboardLayoutParams(); + keyboard.setLayoutParams(params); + keyboard.setVerticalScrollBarEnabled(false); + keyboard.setHorizontalScrollBarEnabled(false); + keyboard.setWebViewClient(webViewClient); + keyboard.addJavascriptInterface(new KMKeyboardJSHandler(appContext, keyboard), "jsInterface"); + keyboard.loadKeyboard(); - setEngineWebViewVersionStatus(appContext, SystemKeyboard); - } + setEngineWebViewVersionStatus(appContext, keyboard); } public static String getLanguagePredictionPreferenceKey(String langID) { @@ -663,12 +657,12 @@ public final class KMManager { public static boolean isKeyboardLoaded(KeyboardType type) { if (type == KeyboardType.KEYBOARD_TYPE_INAPP) { - if (InAppKeyboardWebViewClient != null) { + if (InAppKeyboard != null && InAppKeyboardWebViewClient != null) { return InAppKeyboardWebViewClient.getKeyboardLoaded(); } return false; } else if (type == KeyboardType.KEYBOARD_TYPE_SYSTEM) { - if (SystemKeyboardWebViewClient != null) { + if (SystemKeyboard != null && SystemKeyboardWebViewClient != null) { return SystemKeyboardWebViewClient.getKeyboardLoaded(); } return false; @@ -764,7 +758,7 @@ public final class KMManager { * @param permission - The manifest permission to query * @return boolean - true if the manifest permission is granted */ - protected static boolean hasPermission(Context context, String permission) { + public static boolean hasPermission(Context context, String permission) { // API to check permission depends on Android SDK level if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.M) { return (context.checkSelfPermission(permission) == PackageManager.PERMISSION_GRANTED); @@ -1331,12 +1325,12 @@ public final class KMManager { boolean mayCorrect = prefs.getBoolean(getLanguageCorrectionPreferenceKey(languageID), true); RelativeLayout.LayoutParams params; - if (InAppKeyboard != null && InAppKeyboardWebViewClient.getKeyboardLoaded() && !InAppKeyboardShouldIgnoreTextChange && modelFileExists) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_INAPP) && !InAppKeyboard.shouldIgnoreTextChange() && modelFileExists) { params = getKeyboardLayoutParams(); InAppKeyboard.setLayoutParams(params); InAppKeyboard.loadJavascript(KMString.format("enableSuggestions(%s, %s, %s)", model, mayPredict, mayCorrect)); } - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded() && !SystemKeyboardShouldIgnoreTextChange && modelFileExists) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM) && !SystemKeyboard.shouldIgnoreTextChange() && modelFileExists) { params = getKeyboardLayoutParams(); SystemKeyboard.setLayoutParams(params); SystemKeyboard.loadJavascript(KMString.format("enableSuggestions(%s, %s, %s)", model, mayPredict, mayCorrect)); @@ -1501,11 +1495,13 @@ public final class KMManager { boolean result1 = false; boolean result2 = false; - if (InAppKeyboard != null && InAppKeyboardWebViewClient.getKeyboardLoaded()) + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_INAPP)) { result1 = InAppKeyboard.setKeyboard(packageID, keyboardID, languageID); + } - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded()) + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM)) { result2 = SystemKeyboard.setKeyboard(packageID, keyboardID, languageID); + } return (result1 || result2); } @@ -1513,20 +1509,26 @@ public final class KMManager { public static boolean setKeyboard(Keyboard keyboardInfo) { boolean result1 = false; boolean result2 = false; + HashMap associatedLexicalModel = null; + String languageID = null; + + if (keyboardInfo != null) { + languageID = keyboardInfo.getLanguageID(); + associatedLexicalModel = getAssociatedLexicalModel(languageID); + } - if (InAppKeyboard != null && InAppKeyboardWebViewClient.getKeyboardLoaded() && keyboardInfo != null) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_INAPP) && keyboardInfo != null) { result1 = InAppKeyboard.setKeyboard(keyboardInfo); + InAppKeyboard.toggleSuggestionBanner(associatedLexicalModel, result1); } - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded() && keyboardInfo != null) + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM) && keyboardInfo != null) { result2 = SystemKeyboard.setKeyboard(keyboardInfo); - - if (keyboardInfo != null) { - String languageID = keyboardInfo.getLanguageID(); - toggleSuggestionBanner(languageID, result1, result2); - registerAssociatedLexicalModel(languageID); + SystemKeyboard.toggleSuggestionBanner(associatedLexicalModel, result2); } + registerAssociatedLexicalModel(languageID); + return (result1 || result2); } @@ -1539,21 +1541,19 @@ public final class KMManager { * @return the success result */ public static boolean prepareKeyboardSwitch(String packageID, String keyboardID, String languageID, String keyboardName) { - - boolean result1 = false; boolean result2 = false; - if (InAppKeyboard != null && InAppKeyboardWebViewClient.getKeyboardLoaded()) - { + HashMap associatedLexicalModel = getAssociatedLexicalModel(languageID); + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_INAPP)) { result1 = InAppKeyboard.prepareKeyboardSwitch(packageID, keyboardID, languageID,keyboardName); + InAppKeyboard.toggleSuggestionBanner(associatedLexicalModel, result1); } - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded()) - { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM)) { result2 = SystemKeyboard.prepareKeyboardSwitch(packageID, keyboardID, languageID,keyboardName); + SystemKeyboard.toggleSuggestionBanner(associatedLexicalModel, result2); } - toggleSuggestionBanner(languageID, result1, result2); registerAssociatedLexicalModel(languageID); return (result1 || result2); @@ -1563,11 +1563,13 @@ public final class KMManager { boolean result1 = false; boolean result2 = false; - if (InAppKeyboard != null && (InAppKeyboardWebViewClient.getKeyboardLoaded() || isTestMode())) + if (InAppKeyboard != null && (InAppKeyboardWebViewClient.getKeyboardLoaded() || isTestMode())) { result1 = InAppKeyboard.setKeyboard(packageID, keyboardID, languageID, keyboardName, languageName, kFont, kOskFont); + } - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded()) + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM)) { result2 = SystemKeyboard.setKeyboard(packageID, keyboardID, languageID, keyboardName, languageName, kFont, kOskFont); + } registerAssociatedLexicalModel(languageID); @@ -1606,11 +1608,11 @@ public final class KMManager { } public static void clearKeyboardCache() { - if (InAppKeyboard != null && InAppKeyboardWebViewClient.getKeyboardLoaded()) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_INAPP)) { InAppKeyboard.clearCache(true); InAppKeyboard.loadKeyboard(); } - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded()) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM)) { SystemKeyboard.clearCache(true); SystemKeyboard.loadKeyboard(); } @@ -1636,7 +1638,7 @@ public final class KMManager { if (IMService != null) { IMService.switchToPreviousInputMethod(); } - } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + } else { // This method is added in API level 16 and deprecated in API level 28 // Reference: https://developer.android.com/reference/android/view/inputmethod/InputMethodManager#switchToLastInputMethod(android.os.IBinder) InputMethodManager imm = (InputMethodManager) appContext.getSystemService(Context.INPUT_METHOD_SERVICE); @@ -1649,7 +1651,7 @@ public final class KMManager { if (IMService != null) { IMService.switchToNextInputMethod(false); } - } else if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN) { + } else { // This method is added in API level 16 and deprecated in API level 28 // Reference: https://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#switchToNextInputMethod(android.os.IBinder,%20boolean) InputMethodManager imm = (InputMethodManager) appContext.getSystemService(Context.INPUT_METHOD_SERVICE); @@ -1838,7 +1840,9 @@ public final class KMManager { public static int getBannerHeight(Context context) { int bannerHeight = 0; - if (currentBanner.equals(KM_BANNER_STATE_SUGGESTION)) { + if (InAppKeyboard != null && InAppKeyboard.currentBanner().equals(KMKeyboard.KM_BANNER_STATE_SUGGESTION)) { + bannerHeight = (int) context.getResources().getDimension(R.dimen.banner_height); + } else if (SystemKeyboard != null && SystemKeyboard.currentBanner().equals(KMKeyboard.KM_BANNER_STATE_SUGGESTION)) { bannerHeight = (int) context.getResources().getDimension(R.dimen.banner_height); } return bannerHeight; @@ -1858,12 +1862,12 @@ public final class KMManager { } public static void applyKeyboardHeight(Context context, int height) { - if (InAppKeyboard != null && InAppKeyboardWebViewClient.getKeyboardLoaded()) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_INAPP)) { InAppKeyboard.loadJavascript(KMString.format("setOskHeight('%s')", height)); RelativeLayout.LayoutParams params = getKeyboardLayoutParams(); InAppKeyboard.setLayoutParams(params); } - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded()) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM)) { SystemKeyboard.loadJavascript(KMString.format("setOskHeight('%s')", height)); RelativeLayout.LayoutParams params = getKeyboardLayoutParams(); SystemKeyboard.setLayoutParams(params); @@ -1934,11 +1938,11 @@ public final class KMManager { public static void setNumericLayer(KeyboardType kbType) { if (kbType == KeyboardType.KEYBOARD_TYPE_INAPP) { - if (InAppKeyboard != null && InAppKeyboardWebViewClient.getKeyboardLoaded() && !InAppKeyboardShouldIgnoreTextChange) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_INAPP) && !InAppKeyboard.shouldIgnoreTextChange()) { InAppKeyboard.loadJavascript("setNumericLayer()"); } } else if (kbType == KeyboardType.KEYBOARD_TYPE_SYSTEM) { - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded() && !SystemKeyboardShouldIgnoreTextChange) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM) && !SystemKeyboard.shouldIgnoreTextChange()) { SystemKeyboard.loadJavascript("setNumericLayer()"); } } @@ -1946,25 +1950,11 @@ public final class KMManager { public static boolean updateText(KeyboardType kbType, String text) { boolean result = false; - String kmText = ""; - if (text != null) { - kmText = text.toString().replace("\\", "\\u005C").replace("'", "\\u0027").replace("\n", "\\n"); - } if (kbType == KeyboardType.KEYBOARD_TYPE_INAPP) { - if (InAppKeyboard != null && InAppKeyboardWebViewClient.getKeyboardLoaded() && !InAppKeyboardShouldIgnoreTextChange) { - InAppKeyboard.loadJavascript(KMString.format("updateKMText('%s')", kmText)); - result = true; - } - - InAppKeyboardShouldIgnoreTextChange = false; + return InAppKeyboard.updateText(text); } else if (kbType == KeyboardType.KEYBOARD_TYPE_SYSTEM) { - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded() && !SystemKeyboardShouldIgnoreTextChange) { - SystemKeyboard.loadJavascript(KMString.format("updateKMText('%s')", kmText)); - result = true; - } - - SystemKeyboardShouldIgnoreTextChange = false; + return SystemKeyboard.updateText(text); } return result; @@ -1973,27 +1963,17 @@ public final class KMManager { public static boolean updateSelectionRange(KeyboardType kbType, int selStart, int selEnd) { boolean result = false; if (kbType == KeyboardType.KEYBOARD_TYPE_INAPP) { - if (InAppKeyboard != null && InAppKeyboardWebViewClient.getKeyboardLoaded() && !InAppKeyboardShouldIgnoreSelectionChange) { - InAppKeyboard.loadJavascript(KMString.format("updateKMSelectionRange(%d,%d)", selStart, selEnd)); - result = true; + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_INAPP) && !InAppKeyboard.shouldIgnoreSelectionChange()) { + result = InAppKeyboard.updateSelectionRange(selStart, selEnd); } - InAppKeyboardShouldIgnoreSelectionChange = false; + InAppKeyboard.setShouldIgnoreSelectionChange(false); } else if (kbType == KeyboardType.KEYBOARD_TYPE_SYSTEM) { - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded() && !SystemKeyboardShouldIgnoreSelectionChange) { - InputConnection ic = (IMService != null ? IMService.getCurrentInputConnection() : null); - if (ic != null) { - ExtractedText icText = ic.getExtractedText(new ExtractedTextRequest(), 0); - if (icText != null) { - updateText(kbType, icText.text.toString()); - } - } - - SystemKeyboard.loadJavascript(KMString.format("updateKMSelectionRange(%d,%d)", selStart, selEnd)); - result = true; + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM) && !SystemKeyboard.shouldIgnoreSelectionChange()) { + result = SystemKeyboard.updateSelectionRange(selStart, selEnd); } - SystemKeyboardShouldIgnoreSelectionChange = false; + SystemKeyboard.setShouldIgnoreSelectionChange(false); } return result; @@ -2001,11 +1981,11 @@ public final class KMManager { public static void resetContext(KeyboardType kbType) { if (kbType == KeyboardType.KEYBOARD_TYPE_INAPP) { - if (InAppKeyboard != null && InAppKeyboardWebViewClient.getKeyboardLoaded()) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_INAPP)) { InAppKeyboard.loadJavascript("resetContext()"); } } else if (kbType == KeyboardType.KEYBOARD_TYPE_SYSTEM) { - if (SystemKeyboard != null && SystemKeyboardWebViewClient.getKeyboardLoaded()) { + if (isKeyboardLoaded(KeyboardType.KEYBOARD_TYPE_SYSTEM)) { SystemKeyboard.loadJavascript("resetContext()"); } } @@ -2152,21 +2132,6 @@ public final class KMManager { globeKeyState = state; } - private static void toggleSuggestionBanner(String languageID, boolean inappKeyboardChanged, boolean systemKeyboardChanged) { - //reset banner state if new language has no lexical model - if (currentBanner.equals(KMManager.KM_BANNER_STATE_SUGGESTION) - && getAssociatedLexicalModel(languageID)==null) { - currentBanner = KMManager.KM_BANNER_STATE_BLANK; - } - - if(inappKeyboardChanged) { - InAppKeyboard.setLayoutParams(getKeyboardLayoutParams()); - } - if(systemKeyboardChanged) { - SystemKeyboard.setLayoutParams(getKeyboardLayoutParams()); - } - } - /** * Return if the lock screen is locked (prevents keyboard picker menu from being displayed) * @return boolean @@ -2226,387 +2191,4 @@ public final class KMManager { globeKeyState = GlobeKeyState.GLOBE_KEY_STATE_UP; } } - - private static final class KMInAppKeyboardJSHandler extends KMKeyboardJSHandler { - - KMInAppKeyboardJSHandler(Context context, KMKeyboard k) { - super(context, k); - } - private static final String HANDLER_TAG = "IAK: JS Handler"; - - @JavascriptInterface - public boolean dispatchKey(final int code, final int eventModifiers) { - Handler mainLoop = new Handler(Looper.getMainLooper()); - mainLoop.post(new Runnable() { - public void run() { - if (InAppKeyboard == null) { - KMLog.LogError(TAG, "dispatchKey failed: InAppKeyboard is null"); - return; - } - - if (InAppKeyboard.subKeysWindow != null || KMTextView.activeView == null || KMTextView.activeView.getClass() != KMTextView.class) { - if ((KMTextView.activeView == null) && isDebugMode()) { - Log.w(HANDLER_TAG, "dispatchKey failed: activeView is null"); - } - return; - } - - // Handle tab or enter since KMW didn't process it - KMTextView textView = (KMTextView) KMTextView.activeView; - if (code == KMScanCodeMap.scanCodeMap[KMScanCodeMap.KEY_TAB]) { - KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_TAB, 0, eventModifiers, 0, 0, 0); - textView.dispatchKeyEvent(event); - } else if (code == KMScanCodeMap.scanCodeMap[KMScanCodeMap.KEY_ENTER]) { - KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_ENTER, 0, eventModifiers, 0, 0, 0); - textView.dispatchKeyEvent(event); - } - } - }); - return true; - } - - // This annotation is required in Jelly Bean and later: - @JavascriptInterface - public void insertText(final int dn, final String s, final int dr, final boolean executingHardwareKeystroke) { - if(dr != 0) { - Log.d(TAG, "Right deletions requested but are not presently supported by the in-app keyboard."); - } - - Handler mainLoop = new Handler(Looper.getMainLooper()); - mainLoop.post(new Runnable() { - public void run() { - if (InAppKeyboard == null) { - KMLog.LogError(TAG, "insertText failed: InAppKeyboard is null"); - return; - } - - if (InAppKeyboard.subKeysWindow != null || KMTextView.activeView == null || KMTextView.activeView.getClass() != KMTextView.class) { - if ((KMTextView.activeView == null) && isDebugMode()) { - Log.w("IAK: JS Handler", "insertText failed: activeView is null"); - } - return; - } - - InAppKeyboard.dismissHelpBubble(); - InAppKeyboard.setShouldShowHelpBubble(false); - - KMTextView textView = (KMTextView) KMTextView.activeView; - textView.beginBatchEdit(); - - int start = textView.getSelectionStart(); - int end = textView.getSelectionEnd(); - // Workaround for Android TextView bug where end < start - // Reference: https://issuetracker.google.com/issues/36911048 - if (end < start) { - Log.d(TAG, "Swapping TextView selection end:" + end + " and start:" + start); - int temp = end; - end = start; - start = temp; - } - - int deleteLeft = dn; - - if(start != end && dn == 1 && s.length() == 0) { - /* Handle backspace with a selection: just delete selection */ - deleteLeft = 0; - } - - if (deleteLeft <= 0) { - if (start == end) { - if (s.length() > 0 && s.charAt(0) == '\n') { - textView.keyDownUp(KeyEvent.KEYCODE_ENTER); - } else if (s.length() > 0) { - // *** TO DO: Try to find a solution to the bug on API < 17, insert overwrites on next line - InAppKeyboardShouldIgnoreTextChange = true; - InAppKeyboardShouldIgnoreSelectionChange = true; - textView.getText().insert(start, s); - } else { - textView.getText().delete(start, end); - } - } else { - if (s.length() > 0 && s.charAt(0) == '\n') { - InAppKeyboardShouldIgnoreTextChange = true; - InAppKeyboardShouldIgnoreSelectionChange = true; - textView.getText().replace(start, end, ""); - textView.keyDownUp(KeyEvent.KEYCODE_ENTER); - } else { - if (s.length() == 0) { - textView.getText().delete(start, end); - } else { - InAppKeyboardShouldIgnoreTextChange = true; - InAppKeyboardShouldIgnoreSelectionChange = true; - textView.getText().replace(start, end, s); - } - } - } - } else { - if(start != end) { - // Delete the selection - InAppKeyboardShouldIgnoreTextChange = true; - InAppKeyboardShouldIgnoreSelectionChange = true; - textView.getText().delete(start, end); - textView.setSelection(start); - end = start; - deleteLeft = 0; - } - for (int i = 0; i < deleteLeft; i++) { - CharSequence chars = textView.getText().subSequence(0, start); - if (chars != null && chars.length() > 0) { - char c = chars.charAt(start - 1); - InAppKeyboardShouldIgnoreTextChange = true; - InAppKeyboardShouldIgnoreSelectionChange = true; - if (Character.isLowSurrogate(c)) { - textView.getText().delete(start - 2, end); - } else { - textView.getText().delete(start - 1, end); - } - - start = textView.getSelectionStart(); - end = textView.getSelectionEnd(); - } - } - - if (s.length() > 0) { - InAppKeyboardShouldIgnoreTextChange = true; - InAppKeyboardShouldIgnoreSelectionChange = true; - textView.getText().insert(start, s); - } - } - - // Collapse the selection - textView.setSelection(start + s.length()); - textView.endBatchEdit(); - if (mayHaveHapticFeedback && !executingHardwareKeystroke) { - textView.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); - } - } - }); - } - } - - private static final class KMSystemKeyboardJSHandler extends KMKeyboardJSHandler { - KMSystemKeyboardJSHandler(Context context, KMKeyboard k) { - super(context, k); - } - private static final String HANDLER_TAG = "SWK: JS Handler"; - - @JavascriptInterface - public boolean dispatchKey(final int code, final int eventModifiers) { - Handler mainLoop = new Handler(Looper.getMainLooper()); - mainLoop.post(new Runnable() { - public void run() { - if (SystemKeyboard == null) { - KMLog.LogError(TAG, "dispatchKey failed: SystemKeyboard is null"); - return; - } - - if (SystemKeyboard.subKeysWindow != null) { - return; - } - - InputConnection ic = IMService.getCurrentInputConnection(); - if (ic == null) { - if (isDebugMode()) { - Log.w(HANDLER_TAG, "insertText failed: InputConnection is null"); - } - return; - } - - SystemKeyboard.dismissHelpBubble(); - SystemKeyboard.setShouldShowHelpBubble(false); - - // Handle tab or enter since KMW didn't process it - Log.d(HANDLER_TAG, "dispatchKey called with code: " + code + ", eventModifiers: " + eventModifiers); - if (code == KMScanCodeMap.scanCodeMap[KMScanCodeMap.KEY_TAB]) { - KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_TAB, 0, eventModifiers, 0, 0, 0); - ic.sendKeyEvent(event); - } else if (code == KMScanCodeMap.scanCodeMap[KMScanCodeMap.KEY_ENTER]) { - KeyEvent event = new KeyEvent(0, 0, 0, KeyEvent.KEYCODE_ENTER, 0, eventModifiers, 0, 0, 0); - ic.sendKeyEvent(event); - } - } - }); - return true; - } - - // This annotation is required in Jelly Bean and later: - @JavascriptInterface - public void insertText(final int dn, final String s, final int dr, final boolean executingHardwareKeystroke) { - // TODO: Unify in-app and system insertText - Handler mainLoop = new Handler(Looper.getMainLooper()); - mainLoop.post(new Runnable() { - public void run() { - if (SystemKeyboard == null) { - KMLog.LogError(TAG, "insertText failed: SystemKeyboard is null"); - return; - } - - if (SystemKeyboard.subKeysWindow != null) { - return; - } - - InputConnection ic = IMService.getCurrentInputConnection(); - if (ic == null) { - if (isDebugMode()) { - Log.w(HANDLER_TAG, "insertText failed: InputConnection is null"); - } - return; - } - - ic.beginBatchEdit(); - - int deleteLeft = dn; - - // Delete any existing selected text. - ExtractedText icText = ic.getExtractedText(new ExtractedTextRequest(), 0); - if (icText != null) { // This can be null if the input connection becomes invalid. - int start = icText.startOffset + icText.selectionStart; - int end = icText.startOffset + icText.selectionEnd; - if (end < start) { - // Swap start/end for backward selection - int temp = start; - start = end; - end = temp; - } - if (end > start) { - if (s.length() == 0) { - ic.setSelection(start, start); - ic.deleteSurroundingText(0, end - start); - ic.endBatchEdit(); - return; - } else { - SystemKeyboardShouldIgnoreSelectionChange = true; - ic.setSelection(start, start); - ic.deleteSurroundingText(0, end - start); - } - - // KeymanWeb tells us how to delete the selection, but we don't - // want to do that twice - deleteLeft = 0; - } - } - - if (s.length() > 0 && s.charAt(0) == '\n') { - keyDownUp(KeyEvent.KEYCODE_ENTER); - ic.endBatchEdit(); - return; - } - - // Perform left-deletions - if (deleteLeft > 0) { - performLeftDeletions(ic, deleteLeft); - } - - // Perform right-deletions - for (int i = 0; i < dr; i++) { - CharSequence chars = ic.getTextAfterCursor(1, 0); - if (chars != null && chars.length() > 0) { - char c = chars.charAt(0); - SystemKeyboardShouldIgnoreSelectionChange = true; - if (Character.isHighSurrogate(c)) { - ic.deleteSurroundingText(0, 2); - } else { - ic.deleteSurroundingText(0, 1); - } - } - } - - if (s.length() > 0) { - SystemKeyboardShouldIgnoreSelectionChange = true; - - // Commit the string s. Use newCursorPosition 1 so cursor will end up after the string. - ic.commitText(s, 1); - } - - SystemKeyboard.dismissHelpBubble(); - SystemKeyboard.setShouldShowHelpBubble(false); - - ic.endBatchEdit(); - ViewGroup parent = (ViewGroup) SystemKeyboard.getParent(); - if (parent != null && mayHaveHapticFeedback && !executingHardwareKeystroke) { - parent.performHapticFeedback(HapticFeedbackConstants.VIRTUAL_KEY, HapticFeedbackConstants.FLAG_IGNORE_GLOBAL_SETTING); - } - } - }); - } - - private void keyDownUp(int keyEventCode) { - IMService.getCurrentInputConnection().sendKeyEvent(new KeyEvent(KeyEvent.ACTION_DOWN, keyEventCode)); - IMService.getCurrentInputConnection().sendKeyEvent(new KeyEvent(KeyEvent.ACTION_UP, keyEventCode)); - } - - /* - // Chromium up until version M81 had a bug where deleteSurroundingText deletes an entire - // grapheme cluster instead of one code-point. See Chromium issue #1024738 - // https://bugs.chromium.org/p/chromium/issues/detail?id=1024738 - // - // We'll retrieve up to (dn*2+16) characters before the cursor to collect enough characters - // for surrogate pairs + a long grapheme cluster. - // This buffer will be used to put back characters as-needed - */ - private static void performLeftDeletions(InputConnection ic, int dn) { - int originalBufferLength = dn*2 + 16; // characters - CharSequence charsBackup = getCharacterSequence(ic, originalBufferLength); - - int lastIndex = charsBackup.length()-1; - - // Exit if there's no context to delete - if (lastIndex < 0) { - return; - } - - // Count the number of characters which are surrogate pairs - int numPairs = CharSequenceUtil.countSurrogatePairs(charsBackup, dn); - - // Chop dn+numPairs code points from the end of charsBackup - // subSequence indices are start(inclusive) to end(exclusive) - CharSequence expectedChars = charsBackup.subSequence(0, charsBackup.length() - (dn + numPairs)); - ic.deleteSurroundingText(dn + numPairs, 0); - CharSequence newContext = getCharacterSequence(ic, originalBufferLength - 2*dn); - - CharSequence charsToRestore = CharSequenceUtil.restoreChars(expectedChars, newContext); - if (charsToRestore.length() > 0) { - // Restore expectedChars that Chromium deleted. - // Use newCusorPosition 1 so cursor will be after the inserted string - ic.commitText(charsToRestore, 1); - } - } - - /** - * Get a character sequence from the InputConnection. - * Sometimes the WebView can split a surrogate pair at either end, - * so chop that and update the cursor - * @param ic - the InputConnection - * @param length - number of characters to get - * @return CharSequence - */ - private static CharSequence getCharacterSequence(InputConnection ic, int length) { - if (ic == null || length <= 0) { - return ""; - } - - CharSequence sequence = ic.getTextBeforeCursor(length, 0); - if (sequence == null || sequence.length() <= 0) { - return ""; - } - - // Move the cursor back if there's a split surrogate pair - if (Character.isHighSurrogate(sequence.charAt(sequence.length()-1))) { - ic.commitText("", -1); - sequence = ic.getTextBeforeCursor(length, 0); - } - - if (sequence == null || sequence.length() <= 0) { - return ""; - } - - if (Character.isLowSurrogate(sequence.charAt(0))) { - // Adjust if the first char is also a split surrogate pair - // subSequence indices are start(inclusive) to end(exclusive) - sequence = sequence.subSequence(1, sequence.length()); - } - - return sequence; - } - } } diff --git a/android/KMEA/app/src/main/java/com/keyman/engine/logic/ResourcesUpdateTool.java b/android/KMEA/app/src/main/java/com/keyman/engine/logic/ResourcesUpdateTool.java index 0e1db6847fb9b586325738dd37efd760bc5b700d..1111d92978b25ce92e4253352d6c82b45554d103 100644 --- a/android/KMEA/app/src/main/java/com/keyman/engine/logic/ResourcesUpdateTool.java +++ b/android/KMEA/app/src/main/java/com/keyman/engine/logic/ResourcesUpdateTool.java @@ -436,7 +436,11 @@ public class ResourcesUpdateTool implements KeyboardEventHandler.OnKeyboardDownl .setAutoCancel(true) .setContentIntent(startUpdateIntent); - notificationManager.notify(notification_id,builder.build()); + try { + notificationManager.notify(notification_id, builder.build()); + } catch (SecurityException e) { + KMLog.LogException(TAG, "Security permission POST_NOTIFICATIONS denied", e); + } } private boolean isContextAvailable() { diff --git a/android/KMEA/app/src/main/res/values-am-rET/strings.xml b/android/KMEA/app/src/main/res/values-am-rET/strings.xml index dc9e7711add173453a6ffa4f061b698d50420e63..1bb95d51576187d5626c1791145dedbdc8b0b9ef 100644 --- a/android/KMEA/app/src/main/res/values-am-rET/strings.xml +++ b/android/KMEA/app/src/main/res/values-am-rET/strings.xml @@ -168,5 +168,5 @@ የፊደል ገበታውን ለመቀየር እዚህ ጋር ንካ - Unable to launch web browser + ብራውሰሩን ማስጀመር አልተቻለም diff --git a/android/KMEA/app/src/main/res/values-ckl-rNG/strings.xml b/android/KMEA/app/src/main/res/values-ckl-rNG/strings.xml index 09dd795b87eba1be25c8c6de66785550653d4fbe..61768013b74545b5c50480373d87ba565559adfe 100644 --- a/android/KMEA/app/src/main/res/values-ckl-rNG/strings.xml +++ b/android/KMEA/app/src/main/res/values-ckl-rNG/strings.xml @@ -9,8 +9,8 @@ - Other Input Method - Other Input Methods + Whalǝr ʻYa ko pu Suyere Damwa + Whalǝr ʻYa ko Pu Suyere Dzakǝr Kibod Ɓǝlin @@ -45,7 +45,7 @@ Update - No internet connection + Layǝr intanet adiwɛ Adi ata mǝzi ɓui ka lukwa Keyman server wɛ! @@ -84,7 +84,7 @@ Su kura kal kalakwa kibod %1$s:%2$s nǝr %3$s nya. Ata kǝra chakǝnta akuyaka ɓui suyere tara tsukwar bwar dictionary kadǝbar ka ndǝ download ko sǝgǝl akǝr - Cannot connect to Keyman server to check for associated dictionary to download + Gadiyata mǝzi bui sava nǝr Keyman wɛ akuya ka gǝ bui ka sǝgǝl aka jiliyir dikshinari namtǝ gada bara. Gada bara download vershon nam ɓǝlin nǝr kibod ǝni ya? @@ -128,11 +128,11 @@ Gada bara kǝlba ka ɗalba dictionary ǝni ya? - Dictionary deleted + Ndɛ kǝlba ka ɗalba dikshinari. %1$s ndǝ kurta vu kibod - Keyboard deleted + Ndǝ kǝlba ka ɗalba Kibod Mǝrti ka dza mǝzi ʻyati ka dzǝ dzukti suwar su wato correctionyere @@ -140,12 +140,12 @@ Dictionary - Dictionary - Dictionaries + Dikshinari + Dikshinariyere Baraba ka zǝndi dictionary nam adai - Check for dictionaries online + Wulba ka gǝ bui dikshinariyere akwa layir shambar Dictionary: %1$s @@ -168,5 +168,5 @@ Tsukwar vi ǝni akuya ka gǝ pali kibod - Unable to launch web browser + Yar ta mǝzi ka mburnta brauza wɛ diff --git a/android/KMEA/app/src/main/res/values-ff-rZA/strings.xml b/android/KMEA/app/src/main/res/values-ff-rZA/strings.xml index f0e9ce3d2ceb2ec58a63b74664da8eb480315ad2..7d52d61f6bfc331834bbca68e128e76e35f92ba3 100644 --- a/android/KMEA/app/src/main/res/values-ff-rZA/strings.xml +++ b/android/KMEA/app/src/main/res/values-ff-rZA/strings.xml @@ -45,7 +45,7 @@ Hesɗitin - No internet connection + Alaa ceŋol Enternet Horiima seŋaade e Sarworde Keyman! @@ -128,11 +128,11 @@ Aɗa yiɗnoo momtude ndee saggitorde? - Dictionary deleted + Saggitorde momtaama Tappirde %1$s aafaama - Keyboard deleted + Tappirde momtaama Hurmin caatagol @@ -168,5 +168,5 @@ Tappu ɗoo ngam waylude tappirde - Unable to launch web browser + Horiima hurminde wanngorde geese diff --git a/android/KMEA/app/src/test/resources/com/tavultesoft/kmea/robolectric.properties b/android/KMEA/app/src/test/resources/com/tavultesoft/kmea/robolectric.properties index 1c3d9c523c48b87c383ca4417adbcf1a28494fa8..480ab323eae4117794ffd24d9816472a8a318997 100644 --- a/android/KMEA/app/src/test/resources/com/tavultesoft/kmea/robolectric.properties +++ b/android/KMEA/app/src/test/resources/com/tavultesoft/kmea/robolectric.properties @@ -1,3 +1,2 @@ -#Android SDK 29 requires java 9. -#To execute the tests on during the automatic build process, we need to force robolectric to use an older sdk version for test -sdk=28 \ No newline at end of file +#Android SDK to use for tests. +sdk=33 \ No newline at end of file diff --git a/android/KMEA/build.gradle b/android/KMEA/build.gradle index 55a31cb9af6d4dacfab68362ebb7ed65074c9eb1..8e6b39bd3e3cb4051878835e18e2031df016a423 100644 --- a/android/KMEA/build.gradle +++ b/android/KMEA/build.gradle @@ -5,9 +5,7 @@ buildscript { mavenCentral() } dependencies { - // Gradle plugin 7.3.0+ requires JDK 11 - // https://developer.android.com/studio/releases/gradle-plugin#compatibility-7-3-0 - classpath 'com.android.tools.build:gradle:4.2.2' + classpath 'com.android.tools.build:gradle:7.4.0' // io.sentry:sentry-android-gradle-plugin not available for library project classpath 'io.sentry:sentry-android:6.9.2' classpath 'name.remal:gradle-plugins:1.5.0' diff --git a/android/KMEA/build.sh b/android/KMEA/build.sh index 5cd32059228df6528c3e0e029f47b5cf68c9be21..c479d9a13375a226ef115a6820c5c3efecb14855 100755 --- a/android/KMEA/build.sh +++ b/android/KMEA/build.sh @@ -1,202 +1,115 @@ #!/usr/bin/env bash -# Build Keyman Engine Android using Keyman Web artifacts +# Build Keyman Engine for Android using Keyman Web artifacts # -# Abbreviations: -# KMA - Keyman Android -# KMEA - Keyman Engine Android -# KMW - Keyman Web - -# Set sensible script defaults: -# set -e: Terminate script if a command returns an error -set -e -# set -u: Terminate script if an unset variable is used -set -u -# set -x: Debugging use, print each statement -# set -x + +#set -x +set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE -display_usage ( ) { - echo "build.sh [-no-kmw-build] | [-no-kmw] [-no-daemon] | [-no-test] | [-upload-sentry] | [-debug]" - echo - echo "Build Keyman Engine Android (KMEA) using Keyman Web (KMW) artifacts" - echo " -no-kmw-build Don't build KMW. Just copy existing artifacts" - echo " -no-kmw Don't build KMW. Don't copy artifacts" - echo " -no-daemon Don't start the Gradle daemon. Use for CI" - echo " -no-test Don't run the unit-test suite. Use for development builds" - echo " to facilitate manual debugging and testing" - echo " -upload-sentry Uploads debug symbols, etc, to Sentry" - echo " -debug Local debug build; use for development builds" - exit 1 -} - -echo Build KMEA +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +# This script runs from its own folder +cd "$THIS_SCRIPT_PATH" + +# ################################ Main script ################################ + +# Definition of global compile constants + +KEYMAN_ANDROID_ROOT="$KEYMAN_ROOT/android" +KEYMAN_WEB_ROOT="$KEYMAN_ROOT/web" +ENGINE_ASSETS="$KEYMAN_ANDROID_ROOT/KMEA/app/src/main/assets" +CONFIG="release" +BUILD_FLAGS="aR -x lint -x test" # Gradle build w/o test +TEST_FLAGS="-x aR lintRelease testRelease" # Gradle test w/o build +JUNIT_RESULTS="##teamcity[importData type='junit' path='keyman\android\KMEA\app\build\test-results\testReleaseUnitTest\']" + +builder_describe "Builds Keyman Engine for Android." \ + "@/web" \ + "clean" \ + "configure" \ + "build" \ + "test Runs lint and unit tests." \ + ":engine Builds Engine" \ + "--ci Don't start the Gradle daemon. For CI" + +# parse before describe_outputs to check debug flags +builder_parse "$@" + +if builder_is_debug_build; then + builder_heading "### Debug config ####" + CONFIG="debug" + BUILD_FLAGS="assembleDebug -x lint -x test" + TEST_FLAGS="-x assembleDebug lintDebug testDebug" + JUNIT_RESULTS="##teamcity[importData type='junit' path='keyman\android\KMEA\app\build\test-results\testDebugUnitTest\']" +fi + +builder_describe_outputs \ + configure:engine /android/KMEA/app/src/main/assets/keymanandroid.js \ + build:engine /android/KMEA/app/build/outputs/aar/keyman-engine-${CONFIG}.aar + +#### Build -# -# Prevents 'clear' on exit of mingw64 bash shell -# -SHLVL=0 - -# Path definitions - -KMA_ROOT="$KEYMAN_ROOT/android" -KMW_ROOT="$KEYMAN_ROOT/web" -KMEA_ASSETS="$KMA_ROOT/KMEA/app/src/main/assets" - -warn ( ) { - echo "$*" -} - -die ( ) { - echo - echo "$*" - echo - exit 1 -} - -# Default is building KMW and copying artifacts -DO_BUILD=true -DO_COPY=true -DO_TEST=true -NO_DAEMON=false -DEBUG_BUILD=false -KMWFLAGS="build:embed" -KMW_CONFIG=release # Parse args -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - -no-kmw-build) - DO_BUILD=false - DO_COPY=true - ;; - -no-kmw) - DO_BUILD=false - DO_COPY=false - ;; - -no-daemon) - NO_DAEMON=true - ;; - -upload-sentry) - # Overrides default set by build-utils.sh - UPLOAD_SENTRY=true - ;; - -debug) - DEBUG_BUILD=true - KMWFLAGS="$KMWFLAGS --debug" - KMW_CONFIG=debug - ;; - -h|-\?) - display_usage - ;; - -no-test) - DO_TEST=false - ;; - esac - shift # past argument -done - -# Local development optimization - cross-target Sentry uploading when requested -# by developer. As it's not CI, the Web artifacts won't exist otherwise... -# unless the developer manually runs the correct build configuration accordingly. -if [[ $VERSION_ENVIRONMENT == "local" ]] && [[ $UPLOAD_SENTRY == true ]]; then - # TODO: handle the -upload-sentry in its eventual new form - KMWFLAGS="$KMWFLAGS -upload-sentry" -fi -echo -echo "DO_BUILD: $DO_BUILD" -echo "DO_COPY: $DO_COPY" -echo "DO_TEST: $DO_TEST" -echo "NO_DAEMON: $NO_DAEMON" -echo "DEBUG_BUILD: $DEBUG_BUILD" -echo "KMWFLAGS: $KMWFLAGS" -echo "KMW_CONFIG: $KMW_CONFIG" -echo - -if [ "$NO_DAEMON" = true ]; then +DAEMON_FLAG= +if builder_has_option --ci; then DAEMON_FLAG=--no-daemon -else - DAEMON_FLAG= +fi + +#### Build action definitions #### + +# Check about cleaning artifact paths +if builder_start_action clean:engine; then + rm -rf "$KEYMAN_ROOT/android/KMEA/app/build/outputs" + builder_finish_action success clean:engine +fi + +if builder_start_action configure:engine; then + + builder_finish_action success configure:engine fi # Destinations that will need the keymanweb artifacts -PLATFORM=`uname -s` -if [ "$DO_BUILD" = true ]; then - echo "Building keyman web engine" +if builder_start_action build:engine; then - "$KMW_ROOT/build.sh" $KMWFLAGS + # Copy KeymanWeb artifacts + echo "Copying Keyman Web artifacts" + cp "$KEYMAN_WEB_ROOT/build/app/embed/$CONFIG/osk/ajax-loader.gif" "$ENGINE_ASSETS/ajax-loader.gif" + cp "$KEYMAN_WEB_ROOT/build/app/embed/$CONFIG/keyman.js" "$ENGINE_ASSETS/keymanandroid.js" + cp "$KEYMAN_WEB_ROOT/build/app/embed/$CONFIG/keyman.js.map" "$ENGINE_ASSETS/keyman.js.map" + cp "$KEYMAN_WEB_ROOT/build/app/embed/$CONFIG/osk/kmwosk.css" "$ENGINE_ASSETS/kmwosk.css" + cp "$KEYMAN_WEB_ROOT/build/app/embed/$CONFIG/osk/globe-hint.css" "$ENGINE_ASSETS/globe-hint.css" + cp "$KEYMAN_WEB_ROOT/build/app/embed/$CONFIG/osk/keymanweb-osk.ttf" "$ENGINE_ASSETS/keymanweb-osk.ttf" - if [ $? -ne 0 ]; then - die "ERROR: keymanweb build failed. Exiting" - fi -fi -if [ "$DO_COPY" = true ]; then - echo "Copying KMW artifacts" - cp $KMW_ROOT/build/app/embed/$KMW_CONFIG/osk/ajax-loader.gif $KMEA_ASSETS/ajax-loader.gif - cp $KMW_ROOT/build/app/embed/$KMW_CONFIG/keyman.js $KMEA_ASSETS/keymanandroid.js - cp $KMW_ROOT/build/app/embed/$KMW_CONFIG/keyman.js.map $KMEA_ASSETS/keyman.js.map - cp $KMW_ROOT/build/app/embed/$KMW_CONFIG/osk/kmwosk.css $KMEA_ASSETS/kmwosk.css - cp $KMW_ROOT/build/app/embed/$KMW_CONFIG/osk/globe-hint.css $KMEA_ASSETS/globe-hint.css - cp $KMW_ROOT/build/app/embed/$KMW_CONFIG/osk/keymanweb-osk.ttf $KMEA_ASSETS/keymanweb-osk.ttf - - cp $KEYMAN_ROOT/common/web/sentry-manager/build/index.js $KMEA_ASSETS/keyman-sentry.js - - echo "Copying es6-shim polyfill" - cp $KEYMAN_ROOT/node_modules/es6-shim/es6-shim.min.js $KMEA_ASSETS/es6-shim.min.js - - if [ $? -ne 0 ]; then - die "ERROR: copying artifacts failed" - fi + cp "$KEYMAN_ROOT/common/web/sentry-manager/build/index.js" "$ENGINE_ASSETS/keyman-sentry.js" + + echo "Copying es6-shim polyfill" + cp "$KEYMAN_ROOT/node_modules/es6-shim/es6-shim.min.js" "$ENGINE_ASSETS/es6-shim.min.js" + + echo "BUILD_FLAGS $BUILD_FLAGS" + # Build without test + ./gradlew $DAEMON_FLAG clean $BUILD_FLAGS + + builder_finish_action success build:engine fi -echo "Gradle Build of KMEA" -cd $KMA_ROOT/KMEA +if builder_start_action test:engine; then -if [ "$DEBUG_BUILD" = true ]; then - BUILD_FLAGS="assembleDebug lintDebug" - TEST_FLAGS="testDebug" - ARTIFACT="app-debug.aar" - if [ "$DO_TEST" = true ]; then + if builder_has_option --ci; then # Report JUnit test results to CI - echo "##teamcity[importData type='junit' path='keyman\android\KMEA\app\build\test-results\testDebugUnitTest\']" + echo "$JUNIT_RESULTS" fi -else - BUILD_FLAGS="aR lint" - TEST_FLAGS="testRelease" - ARTIFACT="app-release.aar" - if [ "$DO_TEST" = true ]; then - # Report JUnit test results to CI - echo "##teamcity[importData type='junit' path='keyman\android\KMEA\app\build\test-results\testReleaseUnitTest\']" - fi -fi -echo "BUILD_FLAGS $BUILD_FLAGS" -./gradlew $DAEMON_FLAG clean $BUILD_FLAGS -if [ $? -ne 0 ]; then - die "ERROR: Build of KMEA failed" -fi -if [ "$DO_TEST" = true ]; then - echo "TEST_FLAGS $TEST_FLAGS" - ./gradlew $DAEMON_FLAG $TEST_FLAGS - if [ $? -ne 0 ]; then - die "ERROR: KMEA test cases failed" - fi -fi + echo "TEST_FLAGS: $TEST_FLAGS" + ./gradlew $DAEMON_FLAG $TEST_FLAGS -echo "Copying Keyman Engine for Android to KMAPro, Sample apps, and Tests" -mv $KMA_ROOT/KMEA/app/build/outputs/aar/$ARTIFACT $KMA_ROOT/KMAPro/kMAPro/libs/keyman-engine.aar -cp $KMA_ROOT/KMAPro/kMAPro/libs/keyman-engine.aar $KMA_ROOT/Samples/KMSample1/app/libs/keyman-engine.aar -cp $KMA_ROOT/KMAPro/kMAPro/libs/keyman-engine.aar $KMA_ROOT/Samples/KMSample2/app/libs/keyman-engine.aar -cp $KMA_ROOT/KMAPro/kMAPro/libs/keyman-engine.aar $KMA_ROOT/Tests/KeyboardHarness/app/libs/keyman-engine.aar -if [ ! -z ${RELEASE_OEM+x} ]; then - cp $KMA_ROOT/KMAPro/kMAPro/libs/keyman-engine.aar $KMA_ROOT/../oem/firstvoices/android/app/libs/keyman-engine.aar + builder_finish_action success test:engine fi -cd ..\ diff --git a/android/KMEA/gradle/wrapper/gradle-wrapper.properties b/android/KMEA/gradle/wrapper/gradle-wrapper.properties index 41dfb87909a877d96c3af4adccce4c7a301b55a2..ae04661ee733431762e7ccf8ab9b7409ed44960c 100644 --- a/android/KMEA/gradle/wrapper/gradle-wrapper.properties +++ b/android/KMEA/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/android/README.md b/android/README.md index 067f3667bec7ba275a901ceb6f9a94b9369df9a8..2c776873a396f948e8df1a16c58d27042f0e5b20 100644 --- a/android/README.md +++ b/android/README.md @@ -21,13 +21,11 @@ Keyman for Android uses [Sentry](https://sentry.io) for crash reporting at a ser ### Compiling From Command Line 1. Launch a command prompt and cd to the directory **keyman/android** -2. Run the top level build script `./build.sh -debug` which will: +2. Run the top level build script `./build.sh configure build --debug` which will: * Compile KMEA (and its KMW dependency) * Download default keyboard and dictionary resources as needed * Compile KMAPro - * Note: to force an update to the latest keyboard and dictionary packages, use the `-download-resources` flag. - -3. The APK will be found in **keyman/android/KMAPro/kMAPro/build/outputs/apk/debug/kMAPro-debug.apk** +3. The APK will be found in **keyman/android/KMAPro/kMAPro/build/outputs/apk/debug/keyman-${version}.apk** where `${version}` is the current version number. ### Compiling From Android Studio 1. Ensure that [Keyman Engine for Android](#how-to-build-keyman-engine-for-android) is built. @@ -60,10 +58,11 @@ Keyman for Android uses [Sentry](https://sentry.io) for crash reporting at a ser ### Compiling the app's offline help Keyman for Android help is maintained in the Markdown files in android/help/. -The script `build-help.sh` uses the `pandoc` tool to convert the Markdown files into html. +The script `/resources/build/build-help.inc.sh` uses the `pandoc` tool to convert the Markdown files into html. ```bash -./build-help.sh htm + # Convert markdown to html for offline help + build_help_html android KMAPro/kMAPro/src/main/assets/info ``` This script is automatically called when Keyman for Android is built. @@ -75,14 +74,13 @@ There are two included sample projects that can be modified to test a keyboard. **android/Samples/KMSample1** app runs a bare Keyman app for testing a keyboard. **android/Samples/KMSample2** app provides prompts for setting KMSample2 as a system level keyboard. -Both sample apps include a default Tamil keyboard. +Both sample apps include a default Tamil keyboard and sample dictionary. Building these projects follow the same steps as KMAPro: -1. Build KMEA -2. cd to the desired KMSample directory -3. `./build.sh` -4. Open Android Studio to run the app +1. cd to the desired KMSample directory +2. `./build.sh configure build --debug` +3. Open Android Studio to run the app ### Tests: KeyboardHarness @@ -94,14 +92,14 @@ Building these projects follow the same steps as KMAPro: * Build the keyboardharness.kmp keyboard package 3. Add the keyboard in *android/Tests/KeyboardHarness/app/src/main/java/com/keyman/android/tests/keyboardHarness/MainActivity.java* 4. cd to android/Tests/KeyboardHarness/ -5. `./build.sh` +5. `./build.sh configure build --debug` 6. Open Android Studio to run the app -------------------------------------------------------------- ## How to Build Keyman Engine for Android -1. Open a terminal or Git Bash prompt and go to Keyman Engine for Android project folder (e.g. `cd ~/keyman/android/KMEA/`) -2. Run `./build.sh` +1. Open a terminal or Git Bash prompt and go to the Android project folder (e.g. `cd ~/keyman/android/`) +2. Run `./build.sh --debug` Keyman Engine for Android library (**keyman-engine.aar**) is now ready to be imported in any project. @@ -121,10 +119,6 @@ android { aaptOptions { noCompress "kmp" } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } ``` 5. After the `android {}` object, include the following: ````gradle @@ -144,7 +138,7 @@ dependencies { implementation 'androidx.preference:preference:1.2.0' // Include this if you want to have QR Codes displayed on Keyboard Info - implementation ('com.github.kenglxn.QRGen:android:2.7.0') { + implementation ('com.github.kenglxn.QRGen:android:3.0.1') { transitive = true } } diff --git a/android/Samples/KMSample1/app/build.gradle b/android/Samples/KMSample1/app/build.gradle index 23dbaf892b0ccf13697e9745cf0b5a55727056c7..7be5ef6b1b5974ec9be48b3b62752e431bee9f34 100644 --- a/android/Samples/KMSample1/app/build.gradle +++ b/android/Samples/KMSample1/app/build.gradle @@ -4,15 +4,12 @@ plugins { android { compileSdkVersion 33 + namespace="com.keyman.kmsample1" // Don't compress kmp files so they can be copied via AssetManager aaptOptions { noCompress "kmp" } - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } defaultConfig { applicationId "com.keyman.kmsample1" diff --git a/android/Samples/KMSample1/app/src/main/AndroidManifest.xml b/android/Samples/KMSample1/app/src/main/AndroidManifest.xml index 664edec8b576426728efdb435faa09735895be12..3385b035cc7cb99bfc3ffc6e6200d591059e9456 100644 --- a/android/Samples/KMSample1/app/src/main/AndroidManifest.xml +++ b/android/Samples/KMSample1/app/src/main/AndroidManifest.xml @@ -1,6 +1,5 @@ - + - + - + - + /dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../resources/build/build-utils.sh" -## END STANDARD BUILD SCRIPT INCLUDE - -QUIET=0 - -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" - -THIS_DIR="$(dirname "$THIS_SCRIPT")" - -display_usage() { - echo "build.sh [--no-clean] target [...target]" - echo "Builds help documentation for Keyman for Android" - echo "Targets:" - echo " * htm or html: convert documentation to html using pandoc" - echo - echo " --no-clean: don't clean target folder before building" -} - -DO_HTM=false -DO_CLEAN=true - -# Debug flags -DO_HTM_CONVERSION=true - -# -# Parse args -# - -shopt -s nocasematch - -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - htm | html) - DO_HTM=true - ;; - --no-clean) - DO_CLEAN=false - ;; - *) - display_usage - exit 1 - esac - shift # past argument -done - -if ! $DO_HTM ; then - display_usage - exit 1 -fi - -displayInfo "" \ - "DO_HTM: $DO_HTM" \ - "DO_CLEAN: $DO_CLEAN" \ - "" - -# -# Compile all .md to .html -# - -cd $KEYMAN_ROOT/android/help - -MDLUA="$KEYMAN_ROOT/resources/build/html-link.lua" -CSS="../../resources/build/offline-help-style-spec.txt" -MD=`find . -name "*.md"` -DESTHTM="$THIS_DIR/KMAPro/kMAPro/src/main/assets/info" - -if $DO_HTM; then - # - # Clean existing folder - # - - if $DO_CLEAN; then - rm -rf "$DESTHTM" || true # We don't want to die when we clean an empty folder - fi - mkdir -p "$DESTHTM" - - # - # Generate HTML files from Markdown - # - - if $DO_HTM_CONVERSION; then - for INFILE in $MD; do - OUTFILE="$DESTHTM/${INFILE%.md}.html" - echo "Processing $INFILE to $(basename "$OUTFILE")" - mkdir -p "$(dirname "$OUTFILE")" - pandoc -s -H "$CSS" --lua-filter="$MDLUA" -t html -o "$OUTFILE" $INFILE - done - fi - - # - # Copy Images - # - cd $KEYMAN_ROOT/android/help/ - mkdir -p "$DESTHTM/android_images" - cp android_images/* "$DESTHTM/android_images/" - -fi diff --git a/android/build-publish.sh b/android/build-publish.sh index 4acb3c06ba90b3bd77c602e046fe94245ef8c075..a77903c9feb786b8e96e852e91201436a96e60cb 100755 --- a/android/build-publish.sh +++ b/android/build-publish.sh @@ -2,20 +2,17 @@ # CI script to publish specified app APKs to the Play Store. # The APKs should already have been built from a separate script -# Set sensible script defaults: -# set -e: Terminate script if a command returns an error -set -e -# set -u: Terminate script if an unset variable is used -set -u # set -x: Debugging use, print each statement # set -x ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE +. "$KEYMAN_ROOT/android/KMAPro/build-play-store-notes.inc.sh" + echo Publishing APKs to Play Store # @@ -57,6 +54,9 @@ while [[ $# -gt 0 ]] ; do shift # past argument done +# Override JAVA_HOME to OpenJDK 11 +set_java_home + echo echo "NO_DAEMON: $NO_DAEMON" echo "DO_KMAPRO: $DO_KMAPRO" @@ -74,10 +74,8 @@ echo "BUILD_FLAGS $BUILD_FLAGS" # Publish Keyman for Android if [ "$DO_KMAPRO" = true ]; then - cd "$KEYMAN_ROOT/android/KMAPro/" # Copy Release Notes - ./build-play-store-notes.sh - + generateReleaseNotes ./gradlew $DAEMON_FLAG $BUILD_FLAGS fi diff --git a/android/build.sh b/android/build.sh index d03c73432dedff431d4e218e9d5462efede42c33..b22d8887f1ed535cbb952254350bff9b798b97e0 100755 --- a/android/build.sh +++ b/android/build.sh @@ -1,85 +1,52 @@ #!/usr/bin/env bash -# Build Keyman Engine for Android, Keyman for Android, and FirstVoices Android app -# Use '-clean' flag to clean build artifacts (won't do other build steps) +# +# Build Keyman Engine for Android, Keyman for Android, OEM FirstVoices Android app, +# Samples: KMsample1 and KMSample2, Test - KeyboardHarness -# Set sensible script defaults: -# set -e: Terminate script if a command returns an error -set -e -# set -u: Terminate script if an unset variable is used -#set -u: Not set because of $RELEASE_OEM -# set -x: Debugging use, print each statement -# set -x +#set -x +set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE -# -# Prevents 'clear' on exit of mingw64 bash shell -# -SHLVL=0 - -# Clean build artifacts: keyman-engine.aar libaries, output and upload directories -clean ( ) { - cd "$KEYMAN_ROOT/android" - - find . -name "keyman-engine.aar" | while read fname; do - echo "Cleaning $fname" - rm $fname - done - if [ -f "$KEYMAN_ROOT/oem/firstvoices/android/app/libs/keyman-engine.aar" ]; then - echo "Cleaning OEM FirstVoices keyman-engine.aar" - rm "$KEYMAN_ROOT/oem/firstvoices/android/app/libs/keyman-engine.aar" - fi - - if [ -d "$KEYMAN_ROOT/android/KMAPro/kMAPro/build/outputs" ]; then - echo "Cleaning KMAPro build outputs directory" - rm -rf "$KEYMAN_ROOT/android/KMAPro/kMAPro/build/outputs" - fi - - if [ -d "$KEYMAN_ROOT/android/upload" ]; then - echo "Cleaning upload directory" - rm -rf "$KEYMAN_ROOT/android/upload" - fi -} - -echo Build KMEA and KMAPro: - -# Check about cleaning artifact paths -if [[ "$1" == "-clean" ]] ; then - clean - exit +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +# This script runs from its own folder +cd "$THIS_SCRIPT_PATH" + +################################ Main script ################################ + +builder_describe \ + "Build Keyman Engine for Android, Keyman for Android, and FirstVoices Android app." \ + clean \ + configure \ + build \ + test \ + "publish Publishes the APKs to the Play Store." \ + --ci+ \ + --upload-sentry+ \ + ":engine=KMEA Keyman Engine for Android" \ + ":app=KMAPro Keyman for Android" \ + ":sample1=Samples/KMSample1 Sample app: KMSample1" \ + ":sample2=Samples/KMSample2 Sample app: KMSample2" \ + ":keyboardharness=Tests/KeyboardHarness Test app: KeyboardHarness" \ + ":fv=../oem/firstvoices/android OEM FirstVoices for Android app" + +builder_parse "$@" + +# Override JAVA_HOME to OpenJDK 11 +set_java_home + +# This script also responsible for cleaning up /android/upload +builder_run_child_actions clean + +if builder_start_action clean; then + builder_heading "Cleanup /android/upload" + rm -rf "$KEYMAN_ROOT/android/upload" + builder_finish_action success clean fi -# Building Keyman Engine for Android - -cd "$KEYMAN_ROOT/android/KMEA" -./build.sh "$@" - -if [ $? -ne 0 ]; then - die "ERROR: KMEA/build.sh failed" -fi - -# Building Keyman for Android - -cd "$KEYMAN_ROOT/android/KMAPro" -./build.sh "$@" - -if [ $? -ne 0 ]; then - die "ERROR: KMAPro/build.sh failed" -fi - -cd "$KEYMAN_ROOT/android" - -# Building OEM apps - -if [ ! -z "$RELEASE_OEM" ]; then - pushd "$KEYMAN_ROOT/oem/firstvoices/android" - ./build.sh -download-keyboards -lib-nobuild "$@" - - if [ $? -ne 0 ]; then - die "ERROR: oem/firstvoices/android/build.sh failed" - fi -fi +builder_run_child_actions configure build test publish diff --git a/android/htmlink.lua b/android/htmlink.lua deleted file mode 100644 index d74d974c2de9e25316dc735e56045bf731125235..0000000000000000000000000000000000000000 --- a/android/htmlink.lua +++ /dev/null @@ -1,18 +0,0 @@ -function Link(elem) - if isLocalLink(elem) then - if isFolderLink(elem) then - return pandoc.Link(elem.content, elem.target .. 'index.html', elem.title, elem.attr) - else - return pandoc.Link(elem.content, elem.target .. '.html', elem.title, elem.attr) - end - end - return elem -end - -function isLocalLink(elem) - return string.match(elem.target, "://") == nil -end - -function isFolderLink(elem) - return not ( string.match(elem.target, "/$") == nil ) -end diff --git a/android/utility/i18n-check-unused-strings.sh b/android/utility/i18n-check-unused-strings.sh index 7da2bb151194739191b31df0e07c6a52f38bb849..062ff8cff4d31bdcc20a3276f38c6ec93ba69bb2 100755 --- a/android/utility/i18n-check-unused-strings.sh +++ b/android/utility/i18n-check-unused-strings.sh @@ -24,8 +24,8 @@ set -u # die on undefined variables ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE # Preparation diff --git a/android/version.gradle b/android/version.gradle index 7aef41058b3219a10597a8eda615d7ac2dd6f237..ebf68a94e0223e65308aa98f57c7f5d12f806985 100644 --- a/android/version.gradle +++ b/android/version.gradle @@ -35,6 +35,18 @@ def getVersionCode = { -> return 100 } +def getVersionMD = { -> + String env_version = System.getenv("VERSION") + if (env_version != null) { + // If building from script, we have build number in VERSION + println "Using build $env_version from VERSION" + return "$env_version" + } else { + String version_md = file("$rootPath/../VERSION.md").text.trim() + return "$version_md" + } +} + def getVersionName = { -> String env_version = System.getenv("VERSION_WITH_TAG") if (env_version != null) { @@ -78,6 +90,7 @@ def getVersionGitTag = { -> } ext { VERSION_CODE=getVersionCode() + VERSION_MD=getVersionMD() VERSION_NAME=getVersionName() VERSION_ENVIRONMENT=getVersionEnvironment() VERSION_TAG=System.getenv("VERSION_TAG") diff --git a/common/build.sh b/common/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..eb35adc72a82026486f1d80be0a5103e7ac52ec1 --- /dev/null +++ b/common/build.sh @@ -0,0 +1,23 @@ +#!/usr/bin/env bash +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +builder_describe "Keyman common and resources modules" \ + ":resources=../resources" \ + ":linux" \ + ":mac" \ + ":web" \ + ":windows" \ + clean \ + configure \ + build \ + test + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +builder_run_child_actions clean configure build test diff --git a/common/include/.gitignore b/common/include/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..39eb38049fb9d488df0054a682651b27f6aeac5d --- /dev/null +++ b/common/include/.gitignore @@ -0,0 +1,2 @@ +keymanversion_build.h +.keymanversion_build.configured \ No newline at end of file diff --git a/common/include/build.sh b/common/include/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..43d8c51a510fc5aa9ac622f9db6a1696b7196ee0 --- /dev/null +++ b/common/include/build.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +# +# Creates keymanversion_build.h +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +cd "$THIS_SCRIPT_PATH" + +builder_describe "Build keymanversion_build.h" configure build clean + +builder_describe_outputs \ + configure /common/include/.keymanversion_build.configured \ + build /common/include/keymanversion_build.h + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action clean; then + rm -f keymanversion_build.h .keymanversion_build.configured + builder_finish_action success clean +fi + +if builder_start_action configure; then + # no-op, keeping 'configure' for deps + touch .keymanversion_build.configured + builder_finish_action success configure +fi + +if builder_start_action build; then + replaceVersionStrings_Mkver keymanversion_build.in keymanversion_build.h + builder_finish_action success build +fi diff --git a/common/windows/cpp/include/keymanversion_build.in b/common/include/keymanversion_build.in similarity index 94% rename from common/windows/cpp/include/keymanversion_build.in rename to common/include/keymanversion_build.in index a6a9ee010b736e97b86b129326aa30bcba05f1f8..80724f103b5d16969a0f90f0a3a72e51a1582c1d 100644 --- a/common/windows/cpp/include/keymanversion_build.in +++ b/common/include/keymanversion_build.in @@ -1,6 +1,6 @@ #pragma once -// This file is transformed from keymanversion_build.in to keymanversion_build.h by mkver +// This file is transformed from keymanversion_build.in to keymanversion_build.h by /common/include/build.sh // Legacy version number defines #define KEYMANVERSION "$RELEASE" @@ -12,6 +12,7 @@ #define KEYMAN_VersionWin "$VersionWin" #define KEYMAN_VersionWin_W L"$VersionWin" +#define KEYMAN_VersionWin_W16 u"$VersionWin" #define KEYMAN_VersionRelease "$VersionRelease" #define KEYMAN_VersionRelease_W L"$VersionRelease" diff --git a/common/include/km_types.h b/common/include/km_types.h index 113647d3a0a82d48d2f256e013b4fb305b8cc209..d81f2672384c5bd9e091d109338e53a1e57e8b3a 100644 --- a/common/include/km_types.h +++ b/common/include/km_types.h @@ -1,4 +1,7 @@ #pragma once +#include + +#include /* #if defined(_WIN32) || defined(_WIN64) @@ -19,30 +22,31 @@ #define KMX_64BIT #endif -typedef uint32_t KMX_DWORD; -typedef int32_t KMX_BOOL; -typedef uint8_t KMX_BYTE; -typedef uint16_t KMX_WORD; +typedef uint32_t KMX_DWORD; +typedef int32_t KMX_BOOL; +typedef uint8_t KMX_BYTE; +typedef uint16_t KMX_WORD; #if defined(__cplusplus) typedef char16_t km_kbp_cp; typedef char32_t km_kbp_usv; #else -typedef uint16_t km_kbp_cp; // code point -typedef uint32_t km_kbp_usv; // Unicode Scalar Value +typedef uint16_t km_kbp_cp; // code point +typedef uint32_t km_kbp_usv; // Unicode Scalar Value #endif -typedef km_kbp_cp KMX_WCHAR; // wc, 16-bit UNICODE character -typedef KMX_WCHAR *PKMX_WCHAR; +typedef km_kbp_cp KMX_WCHAR; // wc, 16-bit UNICODE character +typedef KMX_WCHAR* PKMX_WCHAR; -typedef char KMX_CHAR; -typedef KMX_CHAR *PKMX_CHAR; +typedef char KMX_CHAR; +typedef char* PKMX_STR; +typedef KMX_CHAR* PKMX_CHAR; -typedef uint32_t KMX_UINT; +typedef uint32_t KMX_UINT; -typedef KMX_BYTE *PKMX_BYTE; -typedef KMX_WORD *PKMX_WORD; -typedef KMX_DWORD *PKMX_DWORD; +typedef KMX_BYTE* PKMX_BYTE; +typedef KMX_WORD* PKMX_WORD; +typedef KMX_DWORD* PKMX_DWORD; #ifndef FALSE #define FALSE 0 diff --git a/common/include/kmx_file.h b/common/include/kmx_file.h index 91df31c3b2211ab2de160476764c6cf896f4ab16..998c97800728e600e8a0be0e2a931e9544438118 100644 --- a/common/include/kmx_file.h +++ b/common/include/kmx_file.h @@ -14,6 +14,7 @@ namespace kbp { namespace kmx { #endif +#define KMX_MAX_ALLOWED_FILE_SIZE (128 * 1024 * 1024) /* 128MB */ /* */ #define KEYMAN_LAYOUT_DEFAULT 0x000005FE @@ -48,8 +49,10 @@ namespace kmx { #define VERSION_140 0x00000E00 #define VERSION_150 0x00000F00 +#define VERSION_160 0x00001000 + #define VERSION_MIN VERSION_50 -#define VERSION_MAX VERSION_150 +#define VERSION_MAX VERSION_160 // // Backspace types @@ -61,6 +64,8 @@ namespace kmx { // Different begin types #define BEGIN_ANSI 0 #define BEGIN_UNICODE 1 +#define BEGIN_NEWCONTEXT 2 +#define BEGIN_POSTKEYSTROKE 3 #define TSS_NONE 0 #define TSS_BITMAP 1 @@ -261,6 +266,9 @@ namespace kmx { #define KF_LOGICALLAYOUT 0x0008 #define KF_AUTOMATICVERSION 0x0010 +// 16.0: Support for LDML Keyboards in KMXPlus file format +#define KF_KMXPLUS 0x0020 + #define HK_ALT 0x00010000 #define HK_CTRL 0x00020000 #define HK_SHIFT 0x00040000 @@ -296,6 +304,7 @@ struct COMP_STORE { struct COMP_KEY { KMX_WORD Key; + KMX_WORD _reserved; KMX_DWORD Line; KMX_DWORD ShiftFlags; KMX_DWORD dpOutput; @@ -316,7 +325,7 @@ struct COMP_KEYBOARD { KMX_DWORD dwFileVersion; // 0004 Version of the file - Keyman 4.0 is 0x0400 - KMX_DWORD dwCheckSum; // 0008 As stored in keyboard + KMX_DWORD dwCheckSum; // 0008 As stored in keyboard. DEPRECATED as of 16.0 KMX_DWORD KeyboardID; // 000C as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts KMX_DWORD IsRegistered; // 0010 KMX_DWORD version; // 0014 keyboard version @@ -335,7 +344,20 @@ struct COMP_KEYBOARD { KMX_DWORD dpBitmapOffset; // 0038 offset of the bitmaps in the file KMX_DWORD dwBitmapSize; // 003C size in bytes of the bitmaps - }; +}; + +struct COMP_KEYBOARD_KMXPLUSINFO { + KMX_DWORD dpKMXPlus; // 0040 offset of KMXPlus data, header is first + KMX_DWORD dwKMXPlusSize; // 0044 size in bytes of entire KMXPlus data +}; + +/** + * Only valid if comp_keyboard.dwFlags&KF_KMXPLUS + */ +struct COMP_KEYBOARD_EX { + COMP_KEYBOARD header; // 0000 see COMP_KEYBOARD + COMP_KEYBOARD_KMXPLUSINFO kmxplus; // 0040 see COMP_KEYBOARD_EXTRA +}; typedef COMP_KEYBOARD *PCOMP_KEYBOARD; typedef COMP_STORE *PCOMP_STORE; @@ -359,4 +381,4 @@ static_assert(sizeof(COMP_KEYBOARD) == KEYBOARDFILEHEADER_SIZE, "COMP_KEYBOARD m } // namespace kmx } // namespace kbp } // namespace km -#endif \ No newline at end of file +#endif diff --git a/core/tests/unit/test_assert.h b/common/include/test_assert.h similarity index 100% rename from core/tests/unit/test_assert.h rename to common/include/test_assert.h diff --git a/core/tests/unit/test_color.h b/common/include/test_color.h similarity index 100% rename from core/tests/unit/test_color.h rename to common/include/test_color.h diff --git a/common/linux/build.sh b/common/linux/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..852a626bed79d62c59f15aba1dd454c4dd26aa48 --- /dev/null +++ b/common/linux/build.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +if [[ $BUILDER_OS != linux ]]; then + builder_echo grey "Platform is not linux; skipping common/linux" + exit 0 +fi + +# +# TODO: when we have linux-specific tests, add them here +# as child modules +# + +builder_describe "Keyman common Linux modules" \ + clean \ + configure \ + build \ + test + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +builder_run_child_actions clean configure build test diff --git a/common/mac/build.sh b/common/mac/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..b1c93d333d704574d4d1a589cd26c90c37818879 --- /dev/null +++ b/common/mac/build.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +if [[ $BUILDER_OS != mac ]]; then + builder_echo grey "Platform is not macOS; skipping common/mac" + exit 0 +fi + +# +# TODO: when we have mac-specific tests, add them here +# as child modules +# + +builder_describe "Keyman common mac modules" \ + clean \ + configure \ + build \ + test + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +builder_run_child_actions clean configure build test diff --git a/common/models/templates/package.json b/common/models/templates/package.json index b9b84c64924e93709ef369ecc6d1bacd28b6c820..67699e342a93ecf2ab13046640bc8472f87d5351 100644 --- a/common/models/templates/package.json +++ b/common/models/templates/package.json @@ -47,7 +47,7 @@ "@types/node": "^14.0.4", "chai": "^4.3.4", "mocha": "^10.0.0", - "typescript": "^4.5.4" + "typescript": "^4.9.5" }, "dependencies": { "@keymanapp/models-wordbreakers": "*" diff --git a/common/models/types/.build-builder b/common/models/types/.build-builder new file mode 100644 index 0000000000000000000000000000000000000000..6db097fddbbc34e18b27f6a6903f1daff40275e4 --- /dev/null +++ b/common/models/types/.build-builder @@ -0,0 +1 @@ +The presence of this file tells CI to use the new builder_ style parameters for build.sh. \ No newline at end of file diff --git a/common/models/types/build.sh b/common/models/types/build.sh index 018eef190f3265cf75fe7bae9c0212c0a7900040..aa495b8ede970b09212c95e8d3e8ee6a9449e981 100755 --- a/common/models/types/build.sh +++ b/common/models/types/build.sh @@ -8,103 +8,66 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE -EX_USAGE=64 - - -display_usage ( ) { - echo "Usage: $0 [-test] [-publish-to-npm]" - echo " $0 -help" - echo - echo " -help displays this screen and exits" - echo " -test runs tests" - echo " -publish-to-npm publishes the current version to the npm package index" - echo " -dry-run do test, etc, but don't actually publish" -} - -################################ Main script ################################ - -run_tests=0 -install_dependencies=1 -should_publish=0 -npm_dist_tag= -should_dry_run=0 - -# Process command-line arguments -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - -help|-h) - display_usage - exit - ;; - -dry-run) - should_dry_run=1 - ;; - -test) - run_tests=1 - install_dependencies=0 - ;; - -version) - echo "Warning: -version is now ignored" - ;; - -tier) - echo "Warning: -tier is now ignored" - ;; - -publish-to-npm) - should_publish=1 - ;; - *) - echo "$0: invalid option: $key" - display_usage - exit $EX_USAGE - esac - shift # past the processed argument -done - -# Dry run settings -if (( should_dry_run )); then - DRY_RUN=--dry-run -else - DRY_RUN= +cd "$THIS_SCRIPT_PATH" + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + + +builder_describe "Build Keyman model types package" \ + "clean" \ + "configure" \ + "build" \ + "test" \ + "pack build a local .tgz pack for testing" \ + "publish publish to npm" \ + "--dry-run,-n don't actually publish, just dry run" + +builder_describe_outputs \ + configure /node_modules \ + build /common/models/types/build/common/models/types/tsconfig.tsbuildinfo + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action clean; then + rm -rf ./build/ + builder_finish_action success clean fi -# Check that we're doing any task at all! -if (( !run_tests )) && (( !should_publish )); then - echo "$0: Must do at least one of: -test, -publish-npm" >&2 - display_usage - exit $EX_USAGE +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action configure; then + verify_npm_setup + builder_finish_action success configure fi -# Check if Node.JS/npm is installed. -type npm >/dev/null ||\ - fail "Build environment setup error detected! Please ensure Node.js is installed!" +#------------------------------------------------------------------------------------------------------------------- -if (( install_dependencies )) ; then - npm install || fail "Could not download dependencies." +if builder_start_action build; then + tsc --build + builder_finish_action success build fi -if (( run_tests )); then - npm test || fail "Tests failed" +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action test; then + npm test + builder_finish_action success test fi -if (( should_publish )); then - if [[ $TIER == stable ]]; then - npm_dist_tag=latest - else - npm_dist_tag=$TIER - fi - - set_npm_version - - # Note: In either case, npm publish MUST be given --access public to publish - # a package in the @keymanapp scope on the public npm package index. - # - # See `npm help publish` for more details. - echo "Publishing $DRY_RUN npm package with tag $npm_dist_tag" - npm publish $DRY_RUN --access public --tag $npm_dist_tag || fail "Could not publish $npm_dist_tag release." +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action publish; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_npm + builder_finish_action success publish +elif builder_start_action pack; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_pack + builder_finish_action success pack fi diff --git a/common/models/types/package.json b/common/models/types/package.json index 9cdff832318403c0f952025e852953d481dcb4f6..c3005a8eb5a7e82597d24589ec39ced2034e6cc1 100644 --- a/common/models/types/package.json +++ b/common/models/types/package.json @@ -29,7 +29,7 @@ }, "homepage": "https://github.com/keymanapp/keyman/tree/master/common/models/types#readme", "devDependencies": { - "typescript": "^4.5.4" + "typescript": "^4.9.5" }, "files": [ "README.md", diff --git a/common/models/wordbreakers/package.json b/common/models/wordbreakers/package.json index a4b97fc973917034a5980604ddfc943400da2afe..3c2eaa1028daaba061a82048b7d33d741770dc15 100644 --- a/common/models/wordbreakers/package.json +++ b/common/models/wordbreakers/package.json @@ -44,8 +44,8 @@ "@types/mocha": "^7.0.2", "chai": "^4.3.4", "mocha": "^10.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" }, "dependencies": { "@types/node": "^14.0.3" diff --git a/common/predictive-text/build.sh b/common/predictive-text/build.sh index cad512b32b0ac85134bf637d11e8f3c0e3cb3b8b..617eaa379b7707b07e138f7fe402c6c57a51902e 100755 --- a/common/predictive-text/build.sh +++ b/common/predictive-text/build.sh @@ -11,8 +11,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" @@ -28,8 +28,8 @@ cd "$(dirname "$THIS_SCRIPT")" # "@../models/wordbreakers" builder_describe "Builds the lm-layer module" \ - "@../web/keyman-version" \ - "@../web/lm-worker" \ + "@/common/web/keyman-version" \ + "@/common/web/lm-worker" \ "clean" \ "configure" \ "build" \ @@ -42,8 +42,8 @@ builder_describe_outputs \ configure /node_modules \ configure:headless /node_modules \ configure:browser /node_modules \ - build:headless build/headless.js \ - build:browser build/index.js + build:headless /common/predictive-text/build/headless.js \ + build:browser /common/predictive-text/build/index.js builder_parse "$@" diff --git a/common/predictive-text/package.json b/common/predictive-text/package.json index 1d9be13fc162d3edb4fa11748cf3da56ba60a05c..beb7c46615f64318676c8a980549ce0124a9c122 100644 --- a/common/predictive-text/package.json +++ b/common/predictive-text/package.json @@ -40,8 +40,8 @@ "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", "sinon": "^7.1.1", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" }, "dependencies": { "@keymanapp/models-templates": "*", diff --git a/common/predictive-text/testing/one-stage-embedded-webworker/build.sh b/common/predictive-text/testing/one-stage-embedded-webworker/build.sh index f319ad2c4c321797734b6ef5c32e9cb416e2d7cb..f1f727b8c031cea72aaafbf84cf9cd501a43ef0d 100755 --- a/common/predictive-text/testing/one-stage-embedded-webworker/build.sh +++ b/common/predictive-text/testing/one-stage-embedded-webworker/build.sh @@ -6,8 +6,8 @@ ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../../resources/build/build-utils.sh" . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" ## END STANDARD BUILD SCRIPT INCLUDE @@ -23,14 +23,14 @@ echo "Node.js + dependencies check" npm install --no-optional if [ $? -ne 0 ]; then - fail "Build environment setup error detected! Please ensure Node.js is installed!" + builder_die "Build environment setup error detected! Please ensure Node.js is installed!" fi # A nice, extensible method for -clean operations. Add to this as necessary. clean ( ) { rm -rf "./*.js" if [ $? -ne 0 ]; then - fail "Failed to erase the prior build." + builder_die "Failed to erase the prior build." fi } @@ -48,7 +48,7 @@ done npm run tsc -- -p $SOURCE/tsconfig.json if [ $? -ne 0 ]; then - fail "Compilation failed." + builder_die "Compilation failed." fi echo "Typescript compilation successful." \ No newline at end of file diff --git a/common/predictive-text/testing/two-stage-embedded-webworker/build.sh b/common/predictive-text/testing/two-stage-embedded-webworker/build.sh index 1a1c5eb347858e1f7189d07114d81f5ec69f7180..dd1854ec00b8b27fa782e28863dd597cff48c354 100755 --- a/common/predictive-text/testing/two-stage-embedded-webworker/build.sh +++ b/common/predictive-text/testing/two-stage-embedded-webworker/build.sh @@ -6,8 +6,8 @@ ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../../resources/build/build-utils.sh" . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" ## END STANDARD BUILD SCRIPT INCLUDE @@ -26,14 +26,14 @@ echo "Node.js + dependencies check" npm install --no-optional if [ $? -ne 0 ]; then - fail "Build environment setup error detected! Please ensure Node.js is installed!" + builder_die "Build environment setup error detected! Please ensure Node.js is installed!" fi # A nice, extensible method for -clean operations. Add to this as necessary. clean ( ) { rm -rf "./*.js" if [ $? -ne 0 ]; then - fail "Failed to erase the prior build." + builder_die "Failed to erase the prior build." fi } @@ -50,7 +50,7 @@ done npm run tsc -- -p $SOURCE/worker/tsconfig.json if [ $? -ne 0 ]; then - fail "Worker compilation failed." + builder_die "Worker compilation failed." fi rm $EMBEDDED_WORKER &> /dev/null @@ -62,7 +62,7 @@ echo "}" >> $EMBEDDED_WORKER npm run tsc -- -p $SOURCE/tsconfig.json if [ $? -ne 0 ]; then - fail "Final compilation failed." + builder_die "Final compilation failed." fi echo "Typescript compilation successful." \ No newline at end of file diff --git a/common/predictive-text/unit_tests/test.sh b/common/predictive-text/unit_tests/test.sh index 261a02f472479fd379b8374672e9a4fa356b7697..f1b49635f62081e6b61958dad39cfebed4ed809e 100755 --- a/common/predictive-text/unit_tests/test.sh +++ b/common/predictive-text/unit_tests/test.sh @@ -2,8 +2,8 @@ ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" @@ -23,13 +23,16 @@ builder_describe "Runs all tests for the language-modeling / predictive-text lay ":libraries Runs unit tests for in-repo libraries used by this module"\ ":headless Runs this module's headless user tests" \ ":browser Runs this module's browser-based user tests" \ - "--ci Uses CI-based test configurations & emits CI-friendly test reports" \ - "--debug,-d Activates developer-friendly debug mode for unit tests where applicable" + "--ci Uses CI-based test configurations & emits CI-friendly test reports" # TODO: consider dependencies? ideally this will be test.inc.sh? builder_parse "$@" +if builder_has_option --ci && builder_is_debug_build; then + builder_die "Options --ci and --debug are incompatible." +fi + if builder_start_action configure; then verify_npm_setup builder_finish_action success configure @@ -55,7 +58,7 @@ if builder_start_action test:libraries; then pushd "$KEYMAN_ROOT/common/models/templates" echo - echo "### Running $builder_term common/models/templates) tests" + echo "### Running $(builder_term common/models/templates) tests" if builder_has_option --ci; then npm run test -- -reporter mocha-teamcity-reporter else @@ -65,7 +68,7 @@ if builder_start_action test:libraries; then pushd "$KEYMAN_ROOT/common/models/types" echo - echo "### Running $builder_term common/models/types) tests" + echo "### Running $(builder_term common/models/types) tests" # Is not mocha-based; it's TSC-based instead, as we're just ensuring that the .d.ts # file is a proper TS declaration file. npm run test @@ -97,16 +100,16 @@ if [[ $VERSION_ENVIRONMENT == test ]] && builder_has_action test :browser; then if builder_pull_get_details; then if ! ([[ $builder_pull_title =~ \(web\) ]] || builder_pull_has_label test-browserstack); then - echo "Auto-skipping $builder_term test:browser) for unrelated CI test build" + echo "Auto-skipping $(builder_term test:browser) for unrelated CI test build" exit 0 fi fi fi get_browser_set_for_OS ( ) { - if [ $os_id = "mac" ]; then + if [[ $BUILDER_OS == mac ]]; then BROWSERS="--browsers Firefox,Chrome,Safari" - elif [ $os_id = "win" ]; then + elif [[ $BUILDER_OS == win ]]; then BROWSERS="--browsers Chrome" else BROWSERS="--browsers Firefox,Chrome" @@ -121,13 +124,9 @@ if builder_start_action test:browser; then KARMA_FLAGS="$KARMA_FLAGS --reporters teamcity,BrowserStack" KARMA_CONFIG="CI.conf.js" KARMA_INFO_LEVEL="--log-level=debug" - - if builder_has_option --debug; then - echo "$(builder_term --ci) option set; ignoring $(builder_term --debug) option" - fi else KARMA_CONFIG="manual.conf.js" - if builder_has_option --debug; then + if builder_is_debug_build; then KARMA_FLAGS="$KARMA_FLAGS --no-single-run" KARMA_CONFIG="manual.conf.js" KARMA_INFO_LEVEL="--log-level=debug" @@ -139,7 +138,6 @@ if builder_start_action test:browser; then fi if [[ KARMA_CONFIG == "manual.conf.js" ]]; then - get_builder_OS # return: os_id="linux"|"mac"|"win" get_browser_set_for_OS else BROWSERS= @@ -147,4 +145,4 @@ if builder_start_action test:browser; then npm run karma -- start $KARMA_INFO_LEVEL $KARMA_FLAGS $BROWSERS unit_tests/in_browser/$KARMA_CONFIG builder_finish_action success test:browser -fi \ No newline at end of file +fi diff --git a/common/schemas/keyman-touch-layout/keyman-touch-layout.clean.spec.json b/common/schemas/keyman-touch-layout/keyman-touch-layout.clean.spec.json index 0aec7c9d1c34729487bcf755915b48f933ad32df..8bdbf7f66ad466ee4dce03b68d44ce39284d8e12 100644 --- a/common/schemas/keyman-touch-layout/keyman-touch-layout.clean.spec.json +++ b/common/schemas/keyman-touch-layout/keyman-touch-layout.clean.spec.json @@ -86,7 +86,7 @@ "layer": { "$ref": "#/definitions/layer-id" }, "nextlayer": { "$ref": "#/definitions/layer-id" }, "font": { "$ref": "#/definitions/font-spec" }, - "fontsize": { "type": "string" }, + "fontsize": { "$ref": "#/definitions/fontsize-spec" }, "sp": { "$ref": "#/definitions/key-sp" }, "pad": { "$ref" : "#/definitions/key-pad" }, "width": { "$ref" : "#/definitions/key-width" }, @@ -141,7 +141,7 @@ "layer": { "$ref": "#/definitions/layer-id" }, "nextlayer": { "$ref": "#/definitions/layer-id" }, "font": { "$ref": "#/definitions/font-spec" }, - "fontsize": { "type": "string" }, + "fontsize": { "$ref": "#/definitions/fontsize-spec" }, "sp": { "$ref": "#/definitions/key-sp" }, "pad": { "$ref" : "#/definitions/key-pad" }, "width": { "$ref" : "#/definitions/key-width" } diff --git a/common/schemas/keyman-touch-layout/keyman-touch-layout.spec.json b/common/schemas/keyman-touch-layout/keyman-touch-layout.spec.json index a7fc1772dce9baafa1e4b0dc5a74dece4d5334b1..18dc8ef549ddc633b1baef45c0ba50918859e86c 100644 --- a/common/schemas/keyman-touch-layout/keyman-touch-layout.spec.json +++ b/common/schemas/keyman-touch-layout/keyman-touch-layout.spec.json @@ -88,7 +88,7 @@ "text": { "type": "string" }, "layer": { "$ref": "#/definitions/layer-id" }, "nextlayer": { "$ref": "#/definitions/layer-id" }, - "fontsize": { "type": "string" }, + "fontsize": { "$ref": "#/definitions/fontsize-spec" }, "font": { "$ref": "#/definitions/font-spec" }, "dk": { "type": "string" }, "sp": { "$ref" : "#/definitions/numeric" }, @@ -129,7 +129,7 @@ "sp": { "$ref" : "#/definitions/numeric" }, "pad": { "$ref" : "#/definitions/numeric" }, "width": { "$ref" : "#/definitions/numeric" }, - "fontsize": { "type": "string" }, + "fontsize": { "$ref": "#/definitions/fontsize-spec" }, "font": { "$ref": "#/definitions/font-spec" }, "dk": { "type": "string" } }, diff --git a/common/schemas/kpj/README.md b/common/schemas/kpj/README.md new file mode 100644 index 0000000000000000000000000000000000000000..533b672b659d1485e5334540ecdf6360ea7763bc --- /dev/null +++ b/common/schemas/kpj/README.md @@ -0,0 +1,13 @@ +# kpj.xsd + +**Note:** `KeymanDeveloperProject.Options.Version` is currently implicitly +always '1.0'. It will be required for version 2.0 and later of the format. + +## 2023-02-27 2.0 +* Version 2.0 makes 'Files' optional (internally, Files/File will be ignored, + deleted on load and populated from folder structure). Adds Options/SourcePath, + which defaults to '$PROJECTPATH/source', and Options/BuildPath now defaults to + '$PROJECTPATH/build'. + +## 2023-02-25 1.0 +* Initial version 1.0, based on Delphi classes Keyman.Developer.System.Project.* diff --git a/common/schemas/kpj/kpj.schema.json b/common/schemas/kpj/kpj.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..77721345f2882dc9cd285bcecf818faadc0cbe00 --- /dev/null +++ b/common/schemas/kpj/kpj.schema.json @@ -0,0 +1,127 @@ +{ + "title": "kpj.xsd", + "$schema": "http://json-schema.org/schema#", + "type": "object", + "properties": { + "KeymanDeveloperProject": { + "properties": { + "Options": { + "$ref": "#/definitions/Options" + }, + "Files": { + "$ref": "#/definitions/Files" + } + }, + "required": [ + "Options" + ], + "additionalProperties": false, + "type": "object" + } + }, + "required": [ + "KeymanDeveloperProject" + ], + "additionalProperties": false, + "definitions": { + "Options": { + "type": "object", + "properties": { + "BuildPath": { + "type": "string" + }, + "SourcePath": { + "type": "string" + }, + "CompilerWarningsAsErrors": { + "type": "string", + "pattern": "^(True|False)$" + }, + "WarnDeprecatedCode": { + "type": "string", + "pattern": "^(True|False)$" + }, + "CheckFilenameConventions": { + "type": "string", + "pattern": "^(True|False)$" + }, + "ProjectType": { + "type": "string", + "pattern": "^(keyboard|lexicalmodel)$" + }, + "Version": { + "type": "string", + "pattern": "^(1\\.0|2\\.0)$" + } + }, + "required": [ + ], + "additionalProperties": false + }, + "Files": { + "type": "object", + "properties": { + "File": { + "type": "array", + "items": { + "$ref": "#/definitions/File" + } + } + }, + "additionalProperties": false, + "required": [ + "File" + ] + }, + "File": { + "type": "object", + "properties": { + "ID": { + "type": "string" + }, + "Filename": { + "type": "string" + }, + "Filepath": { + "type": "string" + }, + "FileVersion": { + "type": "string" + }, + "FileType": { + "type": "string" + }, + "Details": { + "$ref": "#/definitions/FileDetails" + }, + "ParentFileID": { + "type": "string" + } + }, + "required": [ + "Filename" + ], + "additionalProperties": false + }, + "FileDetails": { + "type": "object", + "properties": { + "Name": { + "type": "string" + }, + "Copyright": { + "type": "string" + }, + "Message": { + "type": "string" + }, + "Version": { + "type": "string" + } + }, + "required": [ + ], + "additionalProperties": false + } + } +} \ No newline at end of file diff --git a/common/schemas/kps/README.md b/common/schemas/kps/README.md index 4322a28bf67e1b6c146a9b1881b0508487e0cec1..e4aacf97d8f2bc518d747693f015a52cb2a3b8b3 100644 --- a/common/schemas/kps/README.md +++ b/common/schemas/kps/README.md @@ -4,3 +4,6 @@ Master version: https://github.com/keymanapp/api.keyman.com/blob/master/schemas/ ## 2021-07-19 7.0 * Initial version 7.0 + +## 2023-04-21 7.0.1 +* Removes LexicalModel.Version, as it was never read or written diff --git a/common/schemas/kps/kps.xsd b/common/schemas/kps/kps.xsd index adbdc36178e79e76653eee3538d93f9c2b85276a..e6ee424e28d8a9b139143fb947ba57a27a30a2f3 100644 --- a/common/schemas/kps/kps.xsd +++ b/common/schemas/kps/kps.xsd @@ -126,7 +126,6 @@ - diff --git a/common/schemas/kvk/kvk.ksy b/common/schemas/kvk/kvk.ksy new file mode 100644 index 0000000000000000000000000000000000000000..11d8f2faa7745c15a341cedd63ad6df33789e5bb --- /dev/null +++ b/common/schemas/kvk/kvk.ksy @@ -0,0 +1,122 @@ +meta: + id: kvk + title: Keyman Visual Keyboard + file-extension: kvk + license: MIT + ks-version: 0.9 + endian: le + bit-endian: le +doc: | + KVK is the binary file format for Keyman Visual Keyboard + files. KVKS is the equivalent XML source file format +doc-ref: + - https://github.com/keymanapp/keyman/ +seq: + - id: header + type: header + - id: keys + type: keys +types: + header: + seq: + - id: identifier + contents: 'KVKF' + doc: Magic file identifier, always KVKF + - id: version + contents: [0, 6, 0, 0] + doc: Version number of KVK file format, always 0x00000600 + - id: flag + type: header_flags + - id: associated_keyboard + type: string + - id: ansi_font + type: font + - id: unicode_font + type: font + + header_flags: + seq: + - id: display_102 + type: b1 + doc: kvkh102, Keyboard should display 102nd key + - id: display_underlying + type: b1 + doc: kvkhDisplayUnderlying, Keyboard should display underlying characters + - id: use_underlying + type: b1 + doc: kvkhUseUnderlying, + - id: altgr + type: b1 + doc: kvkhAltGr, Keyboard should treat left/right Ctrl and Alt separately + + keys: + seq: + - id: count + type: u4 + - id: key + type: key + repeat: expr + repeat-expr: count + key: + seq: + - id: flags + type: key_flags + - id: modifiers + type: key_modifiers + - id: vkey + type: u2 + - id: text + type: string + - id: bitmap + type: u4 + + key_modifiers: + seq: + - id: shift + type: b1 + - id: ctrl + type: b1 + - id: alt + type: b1 + - id: lctrl + type: b1 + - id: rctrl + type: b1 + - id: lalt + type: b1 + - id: ralt + type: b1 + - id: padding + type: b1 + doc: reserved, + - id: zeropad + contents: [0] + + key_flags: + seq: + - id: bitmap + type: b1 + - id: unicode + type: b1 + - id: padding + type: b6 + + font: + seq: + - id: name + type: string + - id: size + type: u4 + - id: color + type: u4 + + string: + seq: + - id: len + type: u2 + - id: str + type: str + size: len*2 - 2 + encoding: utf-16 + - id: zero_terminator + contents: [0,0] diff --git a/common/schemas/kvks/README.md b/common/schemas/kvks/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fb4f2a8a68763e6d5735066f1dc7f1e2e63b3659 --- /dev/null +++ b/common/schemas/kvks/README.md @@ -0,0 +1,14 @@ +# .kvks schema + +This schema validates .kvks files, according to the reference implementation +from VisualKeyboardLoaderXML.pas. + +## Notes on conversion from xsd to json-schema + +Converted using xsd2json. Following structural changes: + +* kvk-version base type from km-version to string, copy km-version pattern in +* remove xs:all bracketing +* remove format:double from fontsize, change type to string +* encoding property changed type to array +* kvk-key added _ property for base text value \ No newline at end of file diff --git a/common/schemas/kvks/kvks.schema.json b/common/schemas/kvks/kvks.schema.json new file mode 100644 index 0000000000000000000000000000000000000000..357b28b60228fb173a50dbe8291cab118ed8c47e --- /dev/null +++ b/common/schemas/kvks/kvks.schema.json @@ -0,0 +1,182 @@ +{ + "title": "kvks.xsd", + "$schema": "http://json-schema.org/schema#", + "type": "object", + "properties": { + "visualkeyboard": { + "properties": { + "header": { + "$ref": "#/definitions/kvk-header" + }, + "encoding": { + "type": "array", + "items": { + "$ref": "#/definitions/kvk-encoding" + } + } + }, + "required": [ + "header" + ], + "additionalProperties": false, + "type": "object" + } + }, + "required": [ + "visualkeyboard" + ], + "additionalProperties": false, + "definitions": { + "kvk-header": { + "type": "object", + "properties": { + "version": { + "$ref": "#/definitions/kvk-version" + }, + "kbdname": { + "type": "string" + }, + "flags": { + "$ref": "#/definitions/kvk-header-flags" + }, + "layout": { + "type": "string" + } + }, + "required": [ + "version" + ], + "additionalProperties": false + }, + "kvk-header-flags": { + "type": "object", + "properties": { + "key102": { + "$ref": "#/definitions/km-empty" + }, + "displayunderlying": { + "$ref": "#/definitions/km-empty" + }, + "usealtgr": { + "$ref": "#/definitions/km-empty" + }, + "useunderlying": { + "$ref": "#/definitions/km-empty" + } + }, + "additionalProperties": false + }, + "kvk-encoding": { + "type": "object", + "properties": { + "layer": { + "type": "array", + "items": { + "$ref": "#/definitions/kvk-layer" + } + }, + "$": { + "type": "object", + "properties": { + "name": { + "$ref": "#/definitions/kvk-encoding-name" + }, + "fontname": { + "type": "string" + }, + "fontsize": { + "type": "string" + } + }, + "required": [ + "name" + ], + "additionalProperties": false + } + }, + "required": [ + "$" + ], + "additionalProperties": false + }, + "kvk-layer": { + "type": "object", + "properties": { + "key": { + "type": "array", + "items": { + "$ref": "#/definitions/kvk-key" + } + }, + "$": { + "type": "object", + "properties": { + "shift": { + "$ref": "#/definitions/kvk-layer-shift" + } + }, + "required": [ + "shift" + ], + "additionalProperties": false + } + }, + "required": [ + "$" + ], + "additionalProperties": false + }, + "kvk-key": { + "type": "object", + "properties": { + "bitmap": { + "type": "string" + }, + "$": { + "type": "object", + "properties": { + "vkey": { + "type": "string" + } + }, + "required": [ + "vkey" + ], + "additionalProperties": false + }, + "_": { + "type": "string" + } + }, + "required": [ + "$" + ], + "additionalProperties": false + }, + "km-empty": { + "type": "string" + }, + "kvk-encoding-name": { + "type": "string", + "enum": [ + "ansi", + "unicode" + ] + }, + "kvk-layer-shift": { + "type": "string", + "pattern": "S?(C|LC|RC)?(A|LA|RA)?" + }, + "kvk-version": { + "type": "string", + "pattern": "(\\d+\\.)+(\\d+)", + "enum": [ + "10.0" + ] + }, + "km-version": { + "type": "string", + "pattern": "(\\d+\\.)+(\\d+)" + } + } +} \ No newline at end of file diff --git a/common/schemas/kvks/kvks.xsd b/common/schemas/kvks/kvks.xsd new file mode 100644 index 0000000000000000000000000000000000000000..17056a5a57b903049989730fcf7a5921bf4e4664 --- /dev/null +++ b/common/schemas/kvks/kvks.xsd @@ -0,0 +1,92 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/common/test/keyboards/.gitignore b/common/test/keyboards/.gitignore index eab8a63166efa340f700a028136e731787b84319..5dda6d16d8af96edd60087dabcc4a8d1140de415 100644 --- a/common/test/keyboards/.gitignore +++ b/common/test/keyboards/.gitignore @@ -1,3 +1,4 @@ -*/build/ +baseline/kmp.json +**/build/ */*_source.zip index.html diff --git a/common/test/keyboards/baseline/README.md b/common/test/keyboards/baseline/README.md new file mode 100644 index 0000000000000000000000000000000000000000..cede107085160bc4cfbf00f9bba32a969c517d8c --- /dev/null +++ b/common/test/keyboards/baseline/README.md @@ -0,0 +1,24 @@ +# Keyboard baseline fixtures + +This folder contains a set of keyboards that are used by multiple projects to +verify behaviour, both for compilation, and for runtime tests. + +The following projects are known to use these keyboards: +* core -- .kmn files only, compiled with kmc during tests +* developer/kmcmplib -- .kmn files, compiled for tests, and .kmx as reference +* linux -- .kmn files for test steps only, .kmx files + +The .kmx files were built with kmcomp, not kmc, in order to ensure that +developer/kmcmplib gets a valid baseline reference. + +Once kmc is stable, it is possible that we will be able to use the kmc npm +module to build .kmx for all projects that need them. + +## Build parameters + +Keyboards were built with debug information and no compiler version embedded, +with kmcomp 16.0.138: + +```bat +for %d in (*.kmn) do kmcomp -no-compiler-version -d %d +``` diff --git a/common/test/keyboards/baseline/baseline.kpj b/common/test/keyboards/baseline/baseline.kpj new file mode 100644 index 0000000000000000000000000000000000000000..b98e7519fda1980e86dbcf6748de7b25dd576ce8 --- /dev/null +++ b/common/test/keyboards/baseline/baseline.kpj @@ -0,0 +1,327 @@ + + + + $PROJECTPATH\build + False + False + True + keyboard + + + + id_k_000___null_keyboard + k_000___null_keyboard.kmn + k_000___null_keyboard.kmn + 1.0 + .kmn + + + id_k_001___basic_input_unicodei + k_001___basic_input_unicodei.kmn + k_001___basic_input_unicodei.kmn + 1.0 + .kmn + + + id_k_002___basic_input_unicode + k_002___basic_input_unicode.kmn + k_002___basic_input_unicode.kmn + 1.0 + .kmn + + + id_k_003___nul + k_003___nul.kmn + k_003___nul.kmn + 1.0 + .kmn + + + id_k_004___basic_input__shift_2_ + k_004___basic_input__shift_2_.kmn + k_004___basic_input__shift_2_.kmn + 1.0 + .kmn + + + id_k_005___nul_with_initial_context + k_005___nul_with_initial_context.kmn + k_005___nul_with_initial_context.kmn + 1.0 + .kmn + + + id_k_006___vkey_input__shift_ctrl_ + k_006___vkey_input__shift_ctrl_.kmn + k_006___vkey_input__shift_ctrl_.kmn + 1.0 + .kmn + + + id_k_007___vkey_input__ctrl_alt_ + k_007___vkey_input__ctrl_alt_.kmn + k_007___vkey_input__ctrl_alt_.kmn + 1.0 + .kmn + + + id_k_008___vkey_input__ctrl_alt_2_ + k_008___vkey_input__ctrl_alt_2_.kmn + k_008___vkey_input__ctrl_alt_2_.kmn + 1.0 + .kmn + + + id_k_012___ralt + k_012___ralt.kmn + k_012___ralt.kmn + 1.0 + .kmn + + + id_k_013___deadkeys + k_013___deadkeys.kmn + k_013___deadkeys.kmn + 1.0 + .kmn + + + id_k_014___groups_and_virtual_keys + k_014___groups_and_virtual_keys.kmn + k_014___groups_and_virtual_keys.kmn + 1.0 + .kmn + + + id_k_015___ralt_2 + k_015___ralt_2.kmn + k_015___ralt_2.kmn + 1.0 + .kmn + + + id_k_017___space_mnemonic_kbd + k_017___space_mnemonic_kbd.kmn + k_017___space_mnemonic_kbd.kmn + 1.0 + .kmn + + + id_k_018___nul_testing + k_018___nul_testing.kmn + k_018___nul_testing.kmn + 1.0 + .kmn + + + id_k_019___multiple_deadkeys + k_019___multiple_deadkeys.kmn + k_019___multiple_deadkeys.kmn + 1.0 + .kmn + + + id_k_020___deadkeys_and_backspace + k_020___deadkeys_and_backspace.kmn + k_020___deadkeys_and_backspace.kmn + 1.0 + .kmn + + + id_k_021___options + k_021___options.kmn + k_021___options.kmn + 1.0 + .kmn + + + id_k_022___options_with_preset + k_022___options_with_preset.kmn + k_022___options_with_preset.kmn + 1.0 + .kmn + + + id_k_023___options_with_save + k_023___options_with_save.kmn + k_023___options_with_save.kmn + 1.0 + .kmn + + + id_k_024___options_with_save_and_preset + k_024___options_with_save_and_preset.kmn + k_024___options_with_save_and_preset.kmn + 1.0 + .kmn + + + id_k_025___options_with_reset + k_025___options_with_reset.kmn + k_025___options_with_reset.kmn + 1.0 + .kmn + + + id_k_026___system_stores + k_026___system_stores.kmn + k_026___system_stores.kmn + 1.0 + .kmn + + + id_k_027___system_stores_2 + k_027___system_stores_2.kmn + k_027___system_stores_2.kmn + 1.0 + .kmn + + + id_k_028___smp + k_028___smp.kmn + k_028___smp.kmn + 1.0 + .kmn + + + id_k_029___beep + k_029___beep.kmn + k_029___beep.kmn + 1.0 + .kmn + + + id_k_030___multiple_groups + k_030___multiple_groups.kmn + k_030___multiple_groups.kmn + 1.0 + .kmn + + + id_k_031___caps_lock + k_031___caps_lock.kmn + k_031___caps_lock.kmn + 1.0 + .kmn + + + id_k_032___caps_control + k_032___caps_control.kmn + k_032___caps_control.kmn + 1.0 + .kmn + + + id_k_033___caps_always_off + k_033___caps_always_off.kmn + k_033___caps_always_off.kmn + 1.0 + .kmn + + + id_k_034___options_double_set_reset + k_034___options_double_set_reset.kmn + k_034___options_double_set_reset.kmn + 1.0 + .kmn + + + id_k_035___options_double_set_staged + k_035___options_double_set_staged.kmn + k_035___options_double_set_staged.kmn + 1.0 + .kmn + + + id_k_036___options___double_reset_staged + k_036___options___double_reset_staged.kmn + k_036___options___double_reset_staged.kmn + 1.0 + .kmn + + + id_k_037___options___double_reset + k_037___options___double_reset.kmn + k_037___options___double_reset.kmn + 1.0 + .kmn + + + id_k_038___punctkeys + k_038___punctkeys.kmn + k_038___punctkeys.kmn + 1.0 + .kmn + + + id_k_039___generic_ctrlalt + k_039___generic_ctrlalt.kmn + k_039___generic_ctrlalt.kmn + 1.0 + .kmn + + + id_k_040___long_context + k_040___long_context.kmn + k_040___long_context.kmn + 1.0 + .kmn + + + id_k_041___long_context_and_deadkeys + k_041___long_context_and_deadkeys.kmn + k_041___long_context_and_deadkeys.kmn + 1.0 + .kmn + + + id_k_042___long_context_and_split_deadkeys + k_042___long_context_and_split_deadkeys.kmn + k_042___long_context_and_split_deadkeys.kmn + 1.0 + .kmn + + + id_k_043___output_and_keystroke + k_043___output_and_keystroke.kmn + k_043___output_and_keystroke.kmn + 1.0 + .kmn + + + id_k_044___if_and_context + k_044___if_and_context.kmn + k_044___if_and_context.kmn + 1.0 + .kmn + + + id_k_045___deadkey_and_context + k_045___deadkey_and_context.kmn + k_045___deadkey_and_context.kmn + 1.0 + .kmn + + + id_k_046___deadkey_and_contextex + k_046___deadkey_and_contextex.kmn + k_046___deadkey_and_contextex.kmn + 1.0 + .kmn + + + id_k_047___caps_always_off_initially_on + k_047___caps_always_off_initially_on.kmn + k_047___caps_always_off_initially_on.kmn + 1.0 + .kmn + + + id_k_048___modifier_keys_keep_context + k_048___modifier_keys_keep_context.kmn + k_048___modifier_keys_keep_context.kmn + 1.0 + .kmn + + + diff --git a/core/tests/unit/kmx/000 - null keyboard.kmn b/common/test/keyboards/baseline/k_000___null_keyboard.kmn similarity index 83% rename from core/tests/unit/kmx/000 - null keyboard.kmn rename to common/test/keyboards/baseline/k_000___null_keyboard.kmn index 75ad394bbb5944aa553ba998d2bda81d9a7617ea..b1304c20c8c89d7423199e27582b212fccdeb51d 100644 --- a/core/tests/unit/kmx/000 - null keyboard.kmn +++ b/common/test/keyboards/baseline/k_000___null_keyboard.kmn @@ -1,3 +1,4 @@ +store(&NAME) '000 - null keyboard' c Description: Tests null keyboard c keys: [K_A][RALT K_B][SHIFT K_C] c expected: aC @@ -8,4 +9,3 @@ store(&version) '6.0' begin Unicode > use(Main) group(Main) using keys - diff --git a/common/test/keyboards/baseline/k_000___null_keyboard.kmx b/common/test/keyboards/baseline/k_000___null_keyboard.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2a49864d0044876a4e4de92c762e54c6791ce423 Binary files /dev/null and b/common/test/keyboards/baseline/k_000___null_keyboard.kmx differ diff --git a/core/tests/unit/kmx/001 - basic input UnicodeI.kmn b/common/test/keyboards/baseline/k_001___basic_input_unicodei.kmn similarity index 88% rename from core/tests/unit/kmx/001 - basic input UnicodeI.kmn rename to common/test/keyboards/baseline/k_001___basic_input_unicodei.kmn index 79eb4dee700a7fca7a6f6bdaca228e388c240ee6..446c0e8f1d98e724009ec61447aac2614aceabff 100644 --- a/core/tests/unit/kmx/001 - basic input UnicodeI.kmn +++ b/common/test/keyboards/baseline/k_001___basic_input_unicodei.kmn @@ -1,3 +1,4 @@ +store(&NAME) '001 - basic input UnicodeI' c Description: Tests basic input with simple context rules, ANSI characters used only c keys: [SHIFT K_A][SHIFT K_B][SHIFT K_C][SHIFT K_SPACE][SHIFT K_D][SHIFT K_E][SHIFT K_F] c expected: abc def diff --git a/common/test/keyboards/baseline/k_001___basic_input_unicodei.kmx b/common/test/keyboards/baseline/k_001___basic_input_unicodei.kmx new file mode 100644 index 0000000000000000000000000000000000000000..82f60cd001d0ba9bf984253ea81e87a41d1a3df4 Binary files /dev/null and b/common/test/keyboards/baseline/k_001___basic_input_unicodei.kmx differ diff --git a/core/tests/unit/kmx/002 - basic input Unicode.kmn b/common/test/keyboards/baseline/k_002___basic_input_unicode.kmn similarity index 87% rename from core/tests/unit/kmx/002 - basic input Unicode.kmn rename to common/test/keyboards/baseline/k_002___basic_input_unicode.kmn index bcbcd718d8af640f5bd7c2971f09b31d09153e50..04c6df9f4a647292d322cbb60540cf5684c71aa5 100644 --- a/core/tests/unit/kmx/002 - basic input Unicode.kmn +++ b/common/test/keyboards/baseline/k_002___basic_input_unicode.kmn @@ -1,7 +1,8 @@ +store(&NAME) '002 - basic input Unicode' c Description: Tests basic input with simple context rules (Unicode) c keys: [SHIFT K_A][SHIFT K_B][SHIFT K_C][SHIFT K_SPACE][SHIFT K_D][SHIFT K_E][SHIFT K_F] c expected: \u0E01\u0E02\u0E03\u0020\u0E04\u0E05\u0E06 -c context: +c context: store(&version) '6.0' diff --git a/common/test/keyboards/baseline/k_002___basic_input_unicode.kmx b/common/test/keyboards/baseline/k_002___basic_input_unicode.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5f1497a29e0dd26ad493c5cf04d65c69f09cd7e9 Binary files /dev/null and b/common/test/keyboards/baseline/k_002___basic_input_unicode.kmx differ diff --git a/core/tests/unit/kmx/003 - nul.kmn b/common/test/keyboards/baseline/k_003___nul.kmn similarity index 89% rename from core/tests/unit/kmx/003 - nul.kmn rename to common/test/keyboards/baseline/k_003___nul.kmn index 935d34402fbe3331845ff302795c063f031c3be0..32f6e84839ab4dbd4734aec729850010bc15505e 100644 --- a/core/tests/unit/kmx/003 - nul.kmn +++ b/common/test/keyboards/baseline/k_003___nul.kmn @@ -1,3 +1,4 @@ +store(&NAME) '003 - nul' c Description: Tests nul context c keys: [K_A][K_A][K_A] c expected: cd diff --git a/common/test/keyboards/baseline/k_003___nul.kmx b/common/test/keyboards/baseline/k_003___nul.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9a5e835e04af55f0c3f11b84877e9e2d3df8e107 Binary files /dev/null and b/common/test/keyboards/baseline/k_003___nul.kmx differ diff --git a/core/tests/unit/kmx/004 - basic input (shift 2).kmn b/common/test/keyboards/baseline/k_004___basic_input__shift_2_.kmn similarity index 90% rename from core/tests/unit/kmx/004 - basic input (shift 2).kmn rename to common/test/keyboards/baseline/k_004___basic_input__shift_2_.kmn index be91d698c5fcef3f455b2699ee14b6c431e4d290..d87821442735f25e869300d66ba34e5b10a88929 100644 --- a/core/tests/unit/kmx/004 - basic input (shift 2).kmn +++ b/common/test/keyboards/baseline/k_004___basic_input__shift_2_.kmn @@ -1,3 +1,4 @@ +store(&NAME) '004 - basic input (shift 2)' c Description: Tests basic vkey input with shift only (Unicode) c keys: [SHIFT K_A][SHIFT K_B][SHIFT K_C][SHIFT K_SPACE][SHIFT K_D][SHIFT K_E][SHIFT K_F] c expected: \u0E01\u0E02\u0E03\u0020\u0E04\u0E05\u0E06 diff --git a/common/test/keyboards/baseline/k_004___basic_input__shift_2_.kmx b/common/test/keyboards/baseline/k_004___basic_input__shift_2_.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c465d596d5fc7f7f50881ad8b4377414a05458cf Binary files /dev/null and b/common/test/keyboards/baseline/k_004___basic_input__shift_2_.kmx differ diff --git a/core/tests/unit/kmx/005 - nul with initial context.kmn b/common/test/keyboards/baseline/k_005___nul_with_initial_context.kmn similarity index 83% rename from core/tests/unit/kmx/005 - nul with initial context.kmn rename to common/test/keyboards/baseline/k_005___nul_with_initial_context.kmn index d838c28c6dce18abab9c7d2aba2748944972ef3f..f59016cbe184d0dba78893794b8ca3ce663cfcf6 100644 --- a/core/tests/unit/kmx/005 - nul with initial context.kmn +++ b/common/test/keyboards/baseline/k_005___nul_with_initial_context.kmn @@ -1,3 +1,4 @@ +store(&NAME) '005 - nul with initial context' c Description: Tests nul context with an initial context supplied c keys: [K_A][K_A] c expected: xdd diff --git a/common/test/keyboards/baseline/k_005___nul_with_initial_context.kmx b/common/test/keyboards/baseline/k_005___nul_with_initial_context.kmx new file mode 100644 index 0000000000000000000000000000000000000000..53f9889b32f3e3fa150a9bbfb94fe118d5f532c2 Binary files /dev/null and b/common/test/keyboards/baseline/k_005___nul_with_initial_context.kmx differ diff --git a/core/tests/unit/kmx/006 - vkey input (shift ctrl).kmn b/common/test/keyboards/baseline/k_006___vkey_input__shift_ctrl_.kmn similarity index 90% rename from core/tests/unit/kmx/006 - vkey input (shift ctrl).kmn rename to common/test/keyboards/baseline/k_006___vkey_input__shift_ctrl_.kmn index 452e071ecb1211c6523ff4203dbd3bb3b0f7e1f4..9a966aa651db7c226640e720bb77b8b2693c7879 100644 --- a/core/tests/unit/kmx/006 - vkey input (shift ctrl).kmn +++ b/common/test/keyboards/baseline/k_006___vkey_input__shift_ctrl_.kmn @@ -1,3 +1,4 @@ +store(&NAME) '006 - vkey input (shift ctrl)' c Description: Tests basic vkey input with shift and control (Unicode) c keys: [LCTRL SHIFT K_A][SHIFT K_B][RCTRL SHIFT K_C][K_SPACE][SHIFT K_D][SHIFT K_E][SHIFT K_F] c expected: \u0E01\u0E02\u0E03\u0020\u0E04\u0E05\u0E06 diff --git a/common/test/keyboards/baseline/k_006___vkey_input__shift_ctrl_.kmx b/common/test/keyboards/baseline/k_006___vkey_input__shift_ctrl_.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6651a91b1962a3a7737a59686c1eea304ba0abf1 Binary files /dev/null and b/common/test/keyboards/baseline/k_006___vkey_input__shift_ctrl_.kmx differ diff --git a/core/tests/unit/kmx/007 - vkey input (ctrl alt).kmn b/common/test/keyboards/baseline/k_007___vkey_input__ctrl_alt_.kmn similarity index 90% rename from core/tests/unit/kmx/007 - vkey input (ctrl alt).kmn rename to common/test/keyboards/baseline/k_007___vkey_input__ctrl_alt_.kmn index bae07ea09152d61e00dbecc0273315ed53981947..3c2eb42bfe0092852ee150b12a9f86c34b859c14 100644 --- a/core/tests/unit/kmx/007 - vkey input (ctrl alt).kmn +++ b/common/test/keyboards/baseline/k_007___vkey_input__ctrl_alt_.kmn @@ -1,3 +1,4 @@ +store(&NAME) '007 - vkey input (ctrl alt)' c Description: Tests basic vkey input with control and alt (Unicode) c keys: [LCTRL LALT K_A][K_B][RCTRL RALT K_C][K_SPACE][K_D][K_E][LCTRL LALT K_F] c expected: \u0E01\u0E02\u0E03\u0020\u0E04\u0E05\u0E06 diff --git a/common/test/keyboards/baseline/k_007___vkey_input__ctrl_alt_.kmx b/common/test/keyboards/baseline/k_007___vkey_input__ctrl_alt_.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3000af8a8025e65bbe785fd9b97119b138509c13 Binary files /dev/null and b/common/test/keyboards/baseline/k_007___vkey_input__ctrl_alt_.kmx differ diff --git a/core/tests/unit/kmx/008 - vkey input (ctrl alt 2).kmn b/common/test/keyboards/baseline/k_008___vkey_input__ctrl_alt_2_.kmn similarity index 86% rename from core/tests/unit/kmx/008 - vkey input (ctrl alt 2).kmn rename to common/test/keyboards/baseline/k_008___vkey_input__ctrl_alt_2_.kmn index 43b81eab010053fbc3d60981ee2047a1d7d82cb0..ac267fa15b59080de405dbf80bd137645473ace5 100644 --- a/core/tests/unit/kmx/008 - vkey input (ctrl alt 2).kmn +++ b/common/test/keyboards/baseline/k_008___vkey_input__ctrl_alt_2_.kmn @@ -1,3 +1,4 @@ +store(&NAME) '008 - vkey input (ctrl alt 2)' c Description: Tests basic vkey input with control and alt (Unicode) c keys: [LCTRL LALT K_A][LCTRL LALT K_B][LCTRL LALT K_C] c expected: \u0E01\u0E03 diff --git a/common/test/keyboards/baseline/k_008___vkey_input__ctrl_alt_2_.kmx b/common/test/keyboards/baseline/k_008___vkey_input__ctrl_alt_2_.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0f7e29779eda3a9ac306e7fb2e3a750482163bbe Binary files /dev/null and b/common/test/keyboards/baseline/k_008___vkey_input__ctrl_alt_2_.kmx differ diff --git a/core/tests/unit/kmx/012 - ralt.kmn b/common/test/keyboards/baseline/k_012___ralt.kmn similarity index 87% rename from core/tests/unit/kmx/012 - ralt.kmn rename to common/test/keyboards/baseline/k_012___ralt.kmn index a4ed290ec84fd0d104d3c4f3bb7a6ffaa5722648..8e041ad99e004d959ad0a02607476b635eb0c200 100644 --- a/core/tests/unit/kmx/012 - ralt.kmn +++ b/common/test/keyboards/baseline/k_012___ralt.kmn @@ -1,3 +1,4 @@ +store(&NAME) '012 - ralt' c Description: Tests Right Alt processing: requires Ctrl+Alt simulation off. c env.simulate_altgr: 0 c keys: [RALT K_A][RALT K_O][LCTRL LALT K_A][LCTRL LALT K_O] @@ -13,4 +14,4 @@ group(main) using keys + [RAlt K_A] > U+05D6 + [RAlt K_O] > U+05E8 + [Ctrl Alt K_A] > "b" -+ [Ctrl Alt K_O] > "c" ++ [Ctrl Alt K_O] > "c" diff --git a/common/test/keyboards/baseline/k_012___ralt.kmx b/common/test/keyboards/baseline/k_012___ralt.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3ac57c165b517b5a530db05d20d0d257e07f8d9a Binary files /dev/null and b/common/test/keyboards/baseline/k_012___ralt.kmx differ diff --git a/core/tests/unit/kmx/013 - deadkeys.kmn b/common/test/keyboards/baseline/k_013___deadkeys.kmn similarity index 88% rename from core/tests/unit/kmx/013 - deadkeys.kmn rename to common/test/keyboards/baseline/k_013___deadkeys.kmn index e462491840375dd98be7c0d0f920f3a1af26a802..d0f4876455eeb00968bc562f575dccefb238444b 100644 --- a/core/tests/unit/kmx/013 - deadkeys.kmn +++ b/common/test/keyboards/baseline/k_013___deadkeys.kmn @@ -1,3 +1,4 @@ +store(&NAME) '013 - deadkeys' c Description: Tests a simple deadkey rule in Unicode c keys: [SHIFT K_6][K_A] c expected: \u00E2 diff --git a/common/test/keyboards/baseline/k_013___deadkeys.kmx b/common/test/keyboards/baseline/k_013___deadkeys.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7f93d7d9ae9f2ed3743e3ca997647b328c37481f Binary files /dev/null and b/common/test/keyboards/baseline/k_013___deadkeys.kmx differ diff --git a/core/tests/unit/kmx/014 - groups and virtual keys.kmn b/common/test/keyboards/baseline/k_014___groups_and_virtual_keys.kmn similarity index 93% rename from core/tests/unit/kmx/014 - groups and virtual keys.kmn rename to common/test/keyboards/baseline/k_014___groups_and_virtual_keys.kmn index 20db871043ecb90c85481bef9da7b97d163104cf..81e26763b6defd39f60cec01b39d1db9c0042d34 100644 --- a/core/tests/unit/kmx/014 - groups and virtual keys.kmn +++ b/common/test/keyboards/baseline/k_014___groups_and_virtual_keys.kmn @@ -1,3 +1,4 @@ +store(&NAME) '014 - groups and virtual keys' c Description: Tests multiple groups and virtual keys with mnemonic layout c keys: [K_A][SHIFT K_2][K_A][LCTRL K_2][K_A] c expected: \u03B1\u1FB0\u1FB1 diff --git a/common/test/keyboards/baseline/k_014___groups_and_virtual_keys.kmx b/common/test/keyboards/baseline/k_014___groups_and_virtual_keys.kmx new file mode 100644 index 0000000000000000000000000000000000000000..03bb1508a55ebf46c59d21379908465c37eba734 Binary files /dev/null and b/common/test/keyboards/baseline/k_014___groups_and_virtual_keys.kmx differ diff --git a/core/tests/unit/kmx/015 - ralt 2.kmn b/common/test/keyboards/baseline/k_015___ralt_2.kmn similarity index 88% rename from core/tests/unit/kmx/015 - ralt 2.kmn rename to common/test/keyboards/baseline/k_015___ralt_2.kmn index ee87dd6f6b9758ce6c4188b37840025c8de99093..631bea8d8d8e19b6cdad7289f84da320405bbd51 100644 --- a/core/tests/unit/kmx/015 - ralt 2.kmn +++ b/common/test/keyboards/baseline/k_015___ralt_2.kmn @@ -1,3 +1,4 @@ +store(&NAME) '015 - ralt 2' c Description: Tests Right Alt processing with non-US kbds. c keys: [K_A][K_B][K_C][RALT K_A] c expected: abcd @@ -9,4 +10,3 @@ begin Unicode > use(main) group(main) using keys 'c' + [RAlt K_A] > "cd" - diff --git a/common/test/keyboards/baseline/k_015___ralt_2.kmx b/common/test/keyboards/baseline/k_015___ralt_2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0a5e1bbf434b09618983f22e84b6f9fdc7c89d0f Binary files /dev/null and b/common/test/keyboards/baseline/k_015___ralt_2.kmx differ diff --git a/core/tests/unit/kmx/017 - space mnemonic kbd.kmn b/common/test/keyboards/baseline/k_017___space_mnemonic_kbd.kmn similarity index 91% rename from core/tests/unit/kmx/017 - space mnemonic kbd.kmn rename to common/test/keyboards/baseline/k_017___space_mnemonic_kbd.kmn index 33b21536ed2aa1f4d69ed28491d2aa2acecf111b..a66fac420a9c6c27ca5c64ec2538343e97e75597 100644 --- a/core/tests/unit/kmx/017 - space mnemonic kbd.kmn +++ b/common/test/keyboards/baseline/k_017___space_mnemonic_kbd.kmn @@ -1,3 +1,4 @@ +store(&NAME) '017 - space mnemonic kbd' c Description: Tests Space handling in mnemonic keyboards (failed with Win 98) c keys: [K_A][K_B][K_SPACE][K_C][K_SPACE][K_D][K_SPACE][K_D][K_E] c expected: XYZ diff --git a/common/test/keyboards/baseline/k_017___space_mnemonic_kbd.kmx b/common/test/keyboards/baseline/k_017___space_mnemonic_kbd.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0983bd248870a3724caea783d60d58875fc76173 Binary files /dev/null and b/common/test/keyboards/baseline/k_017___space_mnemonic_kbd.kmx differ diff --git a/core/tests/unit/kmx/018 - nul testing.kmn b/common/test/keyboards/baseline/k_018___nul_testing.kmn similarity index 88% rename from core/tests/unit/kmx/018 - nul testing.kmn rename to common/test/keyboards/baseline/k_018___nul_testing.kmn index 3c0cb24f2ae94816701f2bd4c293125418e76472..bc6e41206d521ec792c453ed797a8b8893ee75ce 100644 --- a/core/tests/unit/kmx/018 - nul testing.kmn +++ b/common/test/keyboards/baseline/k_018___nul_testing.kmn @@ -1,3 +1,4 @@ +store(&NAME) '018 - nul testing' c Description: Tests the processing of nul in LHS of rules c keys: [K_A][K_A] c expected: OKa @@ -12,4 +13,3 @@ group(Main) using keys nul + 'a' > 'OK' c EOF - diff --git a/common/test/keyboards/baseline/k_018___nul_testing.kmx b/common/test/keyboards/baseline/k_018___nul_testing.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bf15f3bc139270f242b4fbae8bbbd9b450bd32e6 Binary files /dev/null and b/common/test/keyboards/baseline/k_018___nul_testing.kmx differ diff --git a/core/tests/unit/kmx/019 - multiple deadkeys.kmn b/common/test/keyboards/baseline/k_019___multiple_deadkeys.kmn similarity index 94% rename from core/tests/unit/kmx/019 - multiple deadkeys.kmn rename to common/test/keyboards/baseline/k_019___multiple_deadkeys.kmn index c6b19700a035acaa03c2471dd5a83b6bc95bab5f..e70b30f08c5236a146d85e2bed3f92e52f949754 100644 --- a/core/tests/unit/kmx/019 - multiple deadkeys.kmn +++ b/common/test/keyboards/baseline/k_019___multiple_deadkeys.kmn @@ -1,3 +1,4 @@ +store(&NAME) '019 - multiple deadkeys' c Description: Tests deadkey scenarios c 1. One deadkey in context dk(1) + '1' c 2. One char and one deadkey in context 'a' dk(2) + '2' @@ -55,4 +56,4 @@ c [K_9] [K_X] [K_X] -> test that + '9' > '{' dk(9a) dk(9b) '}' dk(9c) dk(9d) dk(9b) '}' dk(9c) dk(9d) + 'x' > dk(9e) '}' dk(9f) dk(9g) -'{' dk(9a) dk(9e) '}' dk(9f) dk(9g) + 'x' > '9=OK' \ No newline at end of file +'{' dk(9a) dk(9e) '}' dk(9f) dk(9g) + 'x' > '9=OK' diff --git a/common/test/keyboards/baseline/k_019___multiple_deadkeys.kmx b/common/test/keyboards/baseline/k_019___multiple_deadkeys.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fe22a2819a535a56b6c8a43dd1239726e9575383 Binary files /dev/null and b/common/test/keyboards/baseline/k_019___multiple_deadkeys.kmx differ diff --git a/core/tests/unit/kmx/020 - deadkeys and backspace.kmn b/common/test/keyboards/baseline/k_020___deadkeys_and_backspace.kmn similarity index 95% rename from core/tests/unit/kmx/020 - deadkeys and backspace.kmn rename to common/test/keyboards/baseline/k_020___deadkeys_and_backspace.kmn index 0a3f97f4616694cbbefcb34eb2ecc7aad2f91218..cf83220f9c322ef546afc1a17e47694777903b8b 100644 --- a/core/tests/unit/kmx/020 - deadkeys and backspace.kmn +++ b/common/test/keyboards/baseline/k_020___deadkeys_and_backspace.kmn @@ -1,3 +1,4 @@ +store(&NAME) '020 - deadkeys and backspace' c Description: Tests deadkey backspacing c 1. One deadkey in context dk(1) + BKSP = nul c 2. One char and one deadkey in context 'a' dk(2) + BKSP = nul diff --git a/common/test/keyboards/baseline/k_020___deadkeys_and_backspace.kmx b/common/test/keyboards/baseline/k_020___deadkeys_and_backspace.kmx new file mode 100644 index 0000000000000000000000000000000000000000..149c2a4f97bb2bd48506ea090f64ee8594015a9e Binary files /dev/null and b/common/test/keyboards/baseline/k_020___deadkeys_and_backspace.kmx differ diff --git a/core/tests/unit/kmx/021 - options.kmn b/common/test/keyboards/baseline/k_021___options.kmn similarity index 91% rename from core/tests/unit/kmx/021 - options.kmn rename to common/test/keyboards/baseline/k_021___options.kmn index a6dbb7c1dd0e5d9a6bf1c9edc8feaf098ed3629f..3851896b84e49ca02cbc77c9e6b6c1f3e395bdb4 100644 --- a/core/tests/unit/kmx/021 - options.kmn +++ b/common/test/keyboards/baseline/k_021___options.kmn @@ -1,3 +1,4 @@ +store(&NAME) '021 - options' c Description: Tests basic option rules c keys: [K_A][K_1][K_A][K_0][K_A] c expected: no foo.foo.no foo. diff --git a/common/test/keyboards/baseline/k_021___options.kmx b/common/test/keyboards/baseline/k_021___options.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f35da34878adc50c677ebe1bc952d99bc916fc91 Binary files /dev/null and b/common/test/keyboards/baseline/k_021___options.kmx differ diff --git a/core/tests/unit/kmx/022 - options with preset.kmn b/common/test/keyboards/baseline/k_022___options_with_preset.kmn similarity index 91% rename from core/tests/unit/kmx/022 - options with preset.kmn rename to common/test/keyboards/baseline/k_022___options_with_preset.kmn index 878acc6fc0eda27f7d3d28933caff53c6c9c95ab..dbaad6e63c811f97763d6b4751174b65642430f8 100644 --- a/core/tests/unit/kmx/022 - options with preset.kmn +++ b/common/test/keyboards/baseline/k_022___options_with_preset.kmn @@ -1,3 +1,4 @@ +store(&NAME) '022 - options with preset' c Description: Tests basic option rules with a preset supplied c keys: [K_A][K_1][K_A][K_0][K_A] c expected: foo.foo.no foo. diff --git a/common/test/keyboards/baseline/k_022___options_with_preset.kmx b/common/test/keyboards/baseline/k_022___options_with_preset.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e681df83394f04ad7be451a4d82051d74924c8d4 Binary files /dev/null and b/common/test/keyboards/baseline/k_022___options_with_preset.kmx differ diff --git a/core/tests/unit/kmx/023 - options with save.kmn b/common/test/keyboards/baseline/k_023___options_with_save.kmn similarity index 86% rename from core/tests/unit/kmx/023 - options with save.kmn rename to common/test/keyboards/baseline/k_023___options_with_save.kmn index aa6c1389712075a259e0d389407485b5e87ebfe4..913bea076f345daf3cea3f9822953ed2978cf9e3 100644 --- a/core/tests/unit/kmx/023 - options with save.kmn +++ b/common/test/keyboards/baseline/k_023___options_with_save.kmn @@ -1,3 +1,4 @@ +store(&NAME) '023 - options with save' c Description: Tests basic option rules with save c keys: [K_A][K_1][K_A][K_0][K_A][K_2] c expected: no foo.foo.no foo. @@ -17,4 +18,4 @@ if(foo = '1') + 'a' > 'foo.' if(foo = '0') + 'a' > 'no foo.' + '1' > set(foo = '1') + '0' > set(foo = '0') -+ '2' > save(foo) \ No newline at end of file ++ '2' > save(foo) diff --git a/common/test/keyboards/baseline/k_023___options_with_save.kmx b/common/test/keyboards/baseline/k_023___options_with_save.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3668b7a066ef37d8ecd0334c9e3fdbd2eca1f944 Binary files /dev/null and b/common/test/keyboards/baseline/k_023___options_with_save.kmx differ diff --git a/core/tests/unit/kmx/024 - options with save and preset.kmn b/common/test/keyboards/baseline/k_024___options_with_save_and_preset.kmn similarity index 82% rename from core/tests/unit/kmx/024 - options with save and preset.kmn rename to common/test/keyboards/baseline/k_024___options_with_save_and_preset.kmn index e8ecd57944961be192d17607f72912cfcb53df86..0c3004c3e32a52d477b38fdced5812fa8f2abc86 100644 --- a/core/tests/unit/kmx/024 - options with save and preset.kmn +++ b/common/test/keyboards/baseline/k_024___options_with_save_and_preset.kmn @@ -1,3 +1,4 @@ +store(&NAME) '024 - options with save and preset' c Description: Tests basic option rules with save c keys: [K_A][K_1][K_A][K_0][K_A][K_2] c expected: foo.foo.no foo. @@ -18,4 +19,4 @@ if(foo = '1') + 'a' > 'foo.' if(foo = '0') + 'a' > 'no foo.' + '1' > set(foo = '1') + '0' > set(foo = '0') -if(foo = '0') + '2' > save(foo) +if(foo = '0') + '2' > save(foo) diff --git a/common/test/keyboards/baseline/k_024___options_with_save_and_preset.kmx b/common/test/keyboards/baseline/k_024___options_with_save_and_preset.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1fecdfac2131f0ebb90d36134ae99c5f0d5e1342 Binary files /dev/null and b/common/test/keyboards/baseline/k_024___options_with_save_and_preset.kmx differ diff --git a/core/tests/unit/kmx/025 - options with reset.kmn b/common/test/keyboards/baseline/k_025___options_with_reset.kmn similarity index 90% rename from core/tests/unit/kmx/025 - options with reset.kmn rename to common/test/keyboards/baseline/k_025___options_with_reset.kmn index 2fea1b0ac4b66f506e6f552e03cbabb6eb13323a..13a0d69283759787c8593009b6c419c6e354c5d8 100644 --- a/core/tests/unit/kmx/025 - options with reset.kmn +++ b/common/test/keyboards/baseline/k_025___options_with_reset.kmn @@ -1,3 +1,4 @@ +store(&NAME) '025 - options with reset' c Description: Tests basic option rules with reset c keys: [K_A][K_1][K_A][K_0][K_A][K_3] c expected: foo.foo.no foo. diff --git a/common/test/keyboards/baseline/k_025___options_with_reset.kmx b/common/test/keyboards/baseline/k_025___options_with_reset.kmx new file mode 100644 index 0000000000000000000000000000000000000000..028f81cb5feb143b688f8ea96ef43bcce6d86368 Binary files /dev/null and b/common/test/keyboards/baseline/k_025___options_with_reset.kmx differ diff --git a/core/tests/unit/kmx/026 - system stores.kmn b/common/test/keyboards/baseline/k_026___system_stores.kmn similarity index 95% rename from core/tests/unit/kmx/026 - system stores.kmn rename to common/test/keyboards/baseline/k_026___system_stores.kmn index a9f537e9320b3e67b4917a5e882a948b9cb03ce8..0538c51364bfb902d83590bbca6a070553c00f9e 100644 --- a/core/tests/unit/kmx/026 - system stores.kmn +++ b/common/test/keyboards/baseline/k_026___system_stores.kmn @@ -1,3 +1,4 @@ +store(&NAME) '026 - system stores' c Description: Tests platform and baselayout system store rules c keys: [K_1][K_2][K_3][K_4][K_A][K_B] c expected: windows.desktop.hardware.native.en-US.kbdus.dll. diff --git a/common/test/keyboards/baseline/k_026___system_stores.kmx b/common/test/keyboards/baseline/k_026___system_stores.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bb918cf1429b4e57b68ea4d8bd08e226d558426d Binary files /dev/null and b/common/test/keyboards/baseline/k_026___system_stores.kmx differ diff --git a/core/tests/unit/kmx/027 - system stores 2.kmn b/common/test/keyboards/baseline/k_027___system_stores_2.kmn similarity index 95% rename from core/tests/unit/kmx/027 - system stores 2.kmn rename to common/test/keyboards/baseline/k_027___system_stores_2.kmn index 8d96e999c4132921330f974da997732d4c84e9c9..95457c84639c049ee89335138799e6964b32c02a 100644 --- a/core/tests/unit/kmx/027 - system stores 2.kmn +++ b/common/test/keyboards/baseline/k_027___system_stores_2.kmn @@ -1,3 +1,4 @@ +store(&NAME) '027 - system stores 2' c Description: Tests platform and baselayout system store rules c keys: [K_1][K_2][K_3][K_4][K_A][K_B] c expected: linux.desktop.hardware.native.fr-FR.kbdfr.dll. diff --git a/common/test/keyboards/baseline/k_027___system_stores_2.kmx b/common/test/keyboards/baseline/k_027___system_stores_2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dac90ab985bd96e1b54a14967406fb4236e80d09 Binary files /dev/null and b/common/test/keyboards/baseline/k_027___system_stores_2.kmx differ diff --git a/core/tests/unit/kmx/028 - smp.kmn b/common/test/keyboards/baseline/k_028___smp.kmn similarity index 94% rename from core/tests/unit/kmx/028 - smp.kmn rename to common/test/keyboards/baseline/k_028___smp.kmn index 5bfbbe4bd267a5c556226fa7380bd484f7fdbbcb..7c1eaaba960bc3ec59220b5784ebfafe633bb084 100644 --- a/core/tests/unit/kmx/028 - smp.kmn +++ b/common/test/keyboards/baseline/k_028___smp.kmn @@ -1,3 +1,4 @@ +store(&NAME) '028 - smp' c Description: Tests SMP characters; see #4361 [1-4], #5561 [5] c keys: [K_1][K_2][K_3][K_4][K_5] c expected: \U0001F601yx diff --git a/common/test/keyboards/baseline/k_028___smp.kmx b/common/test/keyboards/baseline/k_028___smp.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f343f969e9bde1431c12375cf7a6c7c68dad0b26 Binary files /dev/null and b/common/test/keyboards/baseline/k_028___smp.kmx differ diff --git a/core/tests/unit/kmx/029 - beep.kmn b/common/test/keyboards/baseline/k_029___beep.kmn similarity index 85% rename from core/tests/unit/kmx/029 - beep.kmn rename to common/test/keyboards/baseline/k_029___beep.kmn index 76e51e620608bc1b4a336586c5518d30f27e5ded..65e650ee44bd82b2b9cf82172ed49943af0149fb 100644 --- a/core/tests/unit/kmx/029 - beep.kmn +++ b/common/test/keyboards/baseline/k_029___beep.kmn @@ -1,3 +1,4 @@ +store(&NAME) '029 - beep' c Description: Tests beep c keys: [K_1] c expected: \b diff --git a/common/test/keyboards/baseline/k_029___beep.kmx b/common/test/keyboards/baseline/k_029___beep.kmx new file mode 100644 index 0000000000000000000000000000000000000000..abf8b899836172c2802a5c5f3972aa85ee03ab52 Binary files /dev/null and b/common/test/keyboards/baseline/k_029___beep.kmx differ diff --git a/core/tests/unit/kmx/030 - multiple groups.kmn b/common/test/keyboards/baseline/k_030___multiple_groups.kmn similarity index 87% rename from core/tests/unit/kmx/030 - multiple groups.kmn rename to common/test/keyboards/baseline/k_030___multiple_groups.kmn index e29b7bd293efdd34bebb1bc805f6f67900760af9..b9148827bc8ebc3c01d3a7a58d7372886814a38c 100644 --- a/core/tests/unit/kmx/030 - multiple groups.kmn +++ b/common/test/keyboards/baseline/k_030___multiple_groups.kmn @@ -1,7 +1,8 @@ +store(&NAME) "030 - multiple groups" c Description: Tests multiple groups. Purpose here is to interleave output and backspaces from kmx processor to consumer c keys: [K_1][K_2] c expected: abc -c context: +c context: store(&version) '10.0' diff --git a/common/test/keyboards/baseline/k_030___multiple_groups.kmx b/common/test/keyboards/baseline/k_030___multiple_groups.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e27ee4dd08c08fc1f45267c54dbfb6dd1bfe5109 Binary files /dev/null and b/common/test/keyboards/baseline/k_030___multiple_groups.kmx differ diff --git a/core/tests/unit/kmx/031 - caps lock.kmn b/common/test/keyboards/baseline/k_031___caps_lock.kmn similarity index 93% rename from core/tests/unit/kmx/031 - caps lock.kmn rename to common/test/keyboards/baseline/k_031___caps_lock.kmn index 8a3f3468b1127e75be99a73c7e9efea22f6d089c..d14b8ad56ba95366082a4b60e51d90b080845e0b 100644 --- a/core/tests/unit/kmx/031 - caps lock.kmn +++ b/common/test/keyboards/baseline/k_031___caps_lock.kmn @@ -1,3 +1,4 @@ +store(&NAME) '031 - caps lock' c Description: Tests Caps Lock c keys: [K_1][SHIFT K_2][SHIFT K_3][K_A][SHIFT K_B] c expected: pass.pass.pass.pass.pass. diff --git a/common/test/keyboards/baseline/k_031___caps_lock.kmx b/common/test/keyboards/baseline/k_031___caps_lock.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5fe3e4fbd74b8e928a0acf7e052369c0de919bae Binary files /dev/null and b/common/test/keyboards/baseline/k_031___caps_lock.kmx differ diff --git a/core/tests/unit/kmx/032 - caps control.kmn b/common/test/keyboards/baseline/k_032___caps_control.kmn similarity index 96% rename from core/tests/unit/kmx/032 - caps control.kmn rename to common/test/keyboards/baseline/k_032___caps_control.kmn index 203026da36181afca8155d38381d9ddd91e4968a..884fb41a6d5b53f86295a628e7131d265745955e 100644 --- a/core/tests/unit/kmx/032 - caps control.kmn +++ b/common/test/keyboards/baseline/k_032___caps_control.kmn @@ -1,3 +1,4 @@ +store(&NAME) '032 - caps control' c Description: Tests Caps Lock env set c keys: [K_1][K_CAPS][K_2][SHIFT K_3][K_4][K_CAPS][K_5][K_CAPS][K_6][K_SHIFT][K_7] c expected: pass.pass.pass.pass.pass.pass.pass. diff --git a/common/test/keyboards/baseline/k_032___caps_control.kmx b/common/test/keyboards/baseline/k_032___caps_control.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1914d1954bb7186f7edb96a9a28e64df0ce182d6 Binary files /dev/null and b/common/test/keyboards/baseline/k_032___caps_control.kmx differ diff --git a/core/tests/unit/kmx/033 - caps always off.kmn b/common/test/keyboards/baseline/k_033___caps_always_off.kmn similarity index 91% rename from core/tests/unit/kmx/033 - caps always off.kmn rename to common/test/keyboards/baseline/k_033___caps_always_off.kmn index 056fcd895104635eb5b6c8e8d422dbf0fc684327..912f2c5ac0d6f3ed1d2dc5d76b0a78bef2630ba4 100644 --- a/core/tests/unit/kmx/033 - caps always off.kmn +++ b/common/test/keyboards/baseline/k_033___caps_always_off.kmn @@ -1,3 +1,4 @@ +store(&NAME) '033 - caps always off' c Description: Tests Caps Lock always off c keys: [K_1][K_CAPS][K_2][K_CAPS][K_3] c expected: pass.pass.pass. diff --git a/common/test/keyboards/baseline/k_033___caps_always_off.kmx b/common/test/keyboards/baseline/k_033___caps_always_off.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cb9a71a0460da245d17985bf76235ebdf6c93080 Binary files /dev/null and b/common/test/keyboards/baseline/k_033___caps_always_off.kmx differ diff --git a/core/tests/unit/kmx/034 - options double set reset.kmn b/common/test/keyboards/baseline/k_034___options_double_set_reset.kmn similarity index 90% rename from core/tests/unit/kmx/034 - options double set reset.kmn rename to common/test/keyboards/baseline/k_034___options_double_set_reset.kmn index 2e8e754b95a3d85fa91f688f505beca70df73836..3fe9225ecadb1d3f3f3c6320f194c4731bce003d 100644 --- a/core/tests/unit/kmx/034 - options double set reset.kmn +++ b/common/test/keyboards/baseline/k_034___options_double_set_reset.kmn @@ -1,3 +1,4 @@ +store(&NAME) '034 - options double set reset' c Description: Tests basic option rules with save reset+set+reset c keys: [K_A][K_A] c expected: foo.foo. diff --git a/common/test/keyboards/baseline/k_034___options_double_set_reset.kmx b/common/test/keyboards/baseline/k_034___options_double_set_reset.kmx new file mode 100644 index 0000000000000000000000000000000000000000..df8eb8062a535df0881c3e960f8b5232fdf6bc94 Binary files /dev/null and b/common/test/keyboards/baseline/k_034___options_double_set_reset.kmx differ diff --git a/core/tests/unit/kmx/035 - options double set staged.kmn b/common/test/keyboards/baseline/k_035___options_double_set_staged.kmn similarity index 90% rename from core/tests/unit/kmx/035 - options double set staged.kmn rename to common/test/keyboards/baseline/k_035___options_double_set_staged.kmn index e92e9bacac766a44fc902911ad276bf5e3ad1de8..75d1b81b89b7c09d42b29b0a488260b45e498c10 100644 --- a/core/tests/unit/kmx/035 - options double set staged.kmn +++ b/common/test/keyboards/baseline/k_035___options_double_set_staged.kmn @@ -1,3 +1,4 @@ +store(&NAME) '035 - options double set staged' c Description: Tests basic option rules with save reset+set+reset c keys: [K_A][K_B][K_C][K_B][K_A] c expected: foo.foo. diff --git a/common/test/keyboards/baseline/k_035___options_double_set_staged.kmx b/common/test/keyboards/baseline/k_035___options_double_set_staged.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e112a0740f57c46c61d5d72a322bfb0922edaf06 Binary files /dev/null and b/common/test/keyboards/baseline/k_035___options_double_set_staged.kmx differ diff --git a/core/tests/unit/kmx/036 - options - double reset staged.kmn b/common/test/keyboards/baseline/k_036___options___double_reset_staged.kmn similarity index 88% rename from core/tests/unit/kmx/036 - options - double reset staged.kmn rename to common/test/keyboards/baseline/k_036___options___double_reset_staged.kmn index 5a9144f3f7d444bd48c727f3c06c33966995ae54..53157b487d3004ebda8d63eac18dda74b76d0c5c 100644 --- a/core/tests/unit/kmx/036 - options - double reset staged.kmn +++ b/common/test/keyboards/baseline/k_036___options___double_reset_staged.kmn @@ -1,3 +1,4 @@ +store(&NAME) '036 - options - double reset staged' c Description: Tests basic option rules with save reset+reset c keys: [K_A][K_B][K_B][K_A] c expected: foo.foo. diff --git a/common/test/keyboards/baseline/k_036___options___double_reset_staged.kmx b/common/test/keyboards/baseline/k_036___options___double_reset_staged.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ccb05e04c1faa64a540ea3bf3307c988ddfd2e50 Binary files /dev/null and b/common/test/keyboards/baseline/k_036___options___double_reset_staged.kmx differ diff --git a/core/tests/unit/kmx/037 - options - double reset.kmn b/common/test/keyboards/baseline/k_037___options___double_reset.kmn similarity index 89% rename from core/tests/unit/kmx/037 - options - double reset.kmn rename to common/test/keyboards/baseline/k_037___options___double_reset.kmn index 5d2eb1d15ed14b7789122e933fd60e9ad1bd302a..05e5fe7b024d3b118e922f812ee8f37b379c39c1 100644 --- a/core/tests/unit/kmx/037 - options - double reset.kmn +++ b/common/test/keyboards/baseline/k_037___options___double_reset.kmn @@ -1,3 +1,4 @@ +store(&NAME) '037 - options - double reset' c Description: Tests basic option rules with save reset+reset c keys: [K_A][K_A] c expected: foo.foo. diff --git a/common/test/keyboards/baseline/k_037___options___double_reset.kmx b/common/test/keyboards/baseline/k_037___options___double_reset.kmx new file mode 100644 index 0000000000000000000000000000000000000000..eed688349c9217c488bedcd573382d937efc8fe4 Binary files /dev/null and b/common/test/keyboards/baseline/k_037___options___double_reset.kmx differ diff --git a/core/tests/unit/kmx/038 - punctkeys.kmn b/common/test/keyboards/baseline/k_038___punctkeys.kmn similarity index 95% rename from core/tests/unit/kmx/038 - punctkeys.kmn rename to common/test/keyboards/baseline/k_038___punctkeys.kmn index fc893993b4f85cb02286346a1f6ad83add81cd55..33f9c052973890a3c6d3abe0d65b8c2eb18281b3 100644 --- a/core/tests/unit/kmx/038 - punctkeys.kmn +++ b/common/test/keyboards/baseline/k_038___punctkeys.kmn @@ -1,3 +1,4 @@ +store(&NAME) '038 - punctkeys' c Description: Tests punctuation keys (Unicode) c keys: [K_A][K_COLON][K_A][K_EQUAL][K_A][K_COMMA][K_A][K_HYPHEN][K_A][K_PERIOD][K_A][K_SLASH][K_A][K_BKQUOTE][K_A][K_LBRKT][K_A][K_BKSLASH][K_A][K_RBRKT][K_A][K_QUOTE][K_A][K_oE2] c expected: efghijklmnop diff --git a/common/test/keyboards/baseline/k_038___punctkeys.kmx b/common/test/keyboards/baseline/k_038___punctkeys.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8166409f5f32d1c631f1cdaaeabb6f0a4d19a7d7 Binary files /dev/null and b/common/test/keyboards/baseline/k_038___punctkeys.kmx differ diff --git a/core/tests/unit/kmx/039 - generic ctrlalt.kmn b/common/test/keyboards/baseline/k_039___generic_ctrlalt.kmn similarity index 88% rename from core/tests/unit/kmx/039 - generic ctrlalt.kmn rename to common/test/keyboards/baseline/k_039___generic_ctrlalt.kmn index d5404138bf25a1ebc91031b638c3dc0c27adf848..1bbb1de66112c2deb47df970a9c707955fdf6210 100644 --- a/core/tests/unit/kmx/039 - generic ctrlalt.kmn +++ b/common/test/keyboards/baseline/k_039___generic_ctrlalt.kmn @@ -1,3 +1,4 @@ +store(&NAME) '039 - generic ctrlalt' c Description: Tests generic alt and control (Unicode) c keys: [K_A][K_A][LCTRL K_B][K_A][LALT K_C][K_A][RCTRL K_B][K_A][RALT K_C] c expected: abcbc diff --git a/common/test/keyboards/baseline/k_039___generic_ctrlalt.kmx b/common/test/keyboards/baseline/k_039___generic_ctrlalt.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1bf180a31c8c53250e335c5cd034092f41c99438 Binary files /dev/null and b/common/test/keyboards/baseline/k_039___generic_ctrlalt.kmx differ diff --git a/core/tests/unit/kmx/040 - long context.kmn b/common/test/keyboards/baseline/k_040___long_context.kmn similarity index 91% rename from core/tests/unit/kmx/040 - long context.kmn rename to common/test/keyboards/baseline/k_040___long_context.kmn index 994f38bede0d9ff4bdfd923d826675a16247948f..f570d2571082ef6577c6d5e34b71e80ce218102d 100644 --- a/core/tests/unit/kmx/040 - long context.kmn +++ b/common/test/keyboards/baseline/k_040___long_context.kmn @@ -1,3 +1,4 @@ +store(&NAME) '040 - long context' c Description: Tests context longer than 64 chars c keys: [K_SPACE][K_F] c expected: 012345678901234567890123456789012345678901234567890123456789012\u0020 diff --git a/common/test/keyboards/baseline/k_040___long_context.kmx b/common/test/keyboards/baseline/k_040___long_context.kmx new file mode 100644 index 0000000000000000000000000000000000000000..55a88a77abb2acf83872b6a12dc061dce250738f Binary files /dev/null and b/common/test/keyboards/baseline/k_040___long_context.kmx differ diff --git a/core/tests/unit/kmx/041 - long context and deadkeys.kmn b/common/test/keyboards/baseline/k_041___long_context_and_deadkeys.kmn similarity index 96% rename from core/tests/unit/kmx/041 - long context and deadkeys.kmn rename to common/test/keyboards/baseline/k_041___long_context_and_deadkeys.kmn index 9675485c96d7424821714fbce7d2678d7dae030d..455fa1c41cbc62d197edcee9042ffd08592077e3 100644 --- a/core/tests/unit/kmx/041 - long context and deadkeys.kmn +++ b/common/test/keyboards/baseline/k_041___long_context_and_deadkeys.kmn @@ -1,3 +1,4 @@ +store(&NAME) '041 - long context and deadkeys' c Description: Tests that we don't split a dk in context:set. Note that we start with a context c with length MAXCONTEXT-1 (abc...fgh is 60 characters/bytes long + 3 bytes for dk(1)). c keys: [K_Z][K_1][K_2][K_3][K_4] diff --git a/common/test/keyboards/baseline/k_041___long_context_and_deadkeys.kmx b/common/test/keyboards/baseline/k_041___long_context_and_deadkeys.kmx new file mode 100644 index 0000000000000000000000000000000000000000..de2b1d5020c9941e3a57d1734085ca1dd0abe11d Binary files /dev/null and b/common/test/keyboards/baseline/k_041___long_context_and_deadkeys.kmx differ diff --git a/core/tests/unit/kmx/042 - long context and split deadkeys.kmn b/common/test/keyboards/baseline/k_042___long_context_and_split_deadkeys.kmn similarity index 93% rename from core/tests/unit/kmx/042 - long context and split deadkeys.kmn rename to common/test/keyboards/baseline/k_042___long_context_and_split_deadkeys.kmn index 457dea34f675d8f34820357f2d3aa090b14ced7a..ce31d18e28228f0ae7542b5a54d9e836c448d072 100644 --- a/core/tests/unit/kmx/042 - long context and split deadkeys.kmn +++ b/common/test/keyboards/baseline/k_042___long_context_and_split_deadkeys.kmn @@ -1,3 +1,4 @@ +store(&NAME) '042 - long context and split deadkeys' c Description: Tests that we don't split a dk in context. Note that we start with a context with length MAXCONTEXT. c keys: [K_Z][K_SPACE][K_1][K_2] c context: @@ -20,4 +21,3 @@ dk(1) 'abcdefghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk' + ' ' > c Convert to a visible result: 'defghijklmnopqrstuvwxyzabcdefghijklmnopqrstuvwxyzabcdefghijk ' + '1' > 'def' dk(1) 'abcdef' + '2' > 'PASS' - diff --git a/common/test/keyboards/baseline/k_042___long_context_and_split_deadkeys.kmx b/common/test/keyboards/baseline/k_042___long_context_and_split_deadkeys.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fbe552d53b0f731852fd07a3aa5831d25cda51f8 Binary files /dev/null and b/common/test/keyboards/baseline/k_042___long_context_and_split_deadkeys.kmx differ diff --git a/core/tests/unit/kmx/043 - output and keystroke.kmn b/common/test/keyboards/baseline/k_043___output_and_keystroke.kmn similarity index 90% rename from core/tests/unit/kmx/043 - output and keystroke.kmn rename to common/test/keyboards/baseline/k_043___output_and_keystroke.kmn index 6a5d0c6085efec54b141b3780adc34119ca0c8d3..4c6409c1c7125c8c5ea2ce40851302b0b2815700 100644 --- a/core/tests/unit/kmx/043 - output and keystroke.kmn +++ b/common/test/keyboards/baseline/k_043___output_and_keystroke.kmn @@ -1,3 +1,4 @@ +store(&NAME) '043 - output and keystroke' c Description: Tests the 'emit default key' function by having an empty 'using keys' final group c keys: [K_1][K_2][K_3] c expected: abd3 diff --git a/common/test/keyboards/baseline/k_043___output_and_keystroke.kmx b/common/test/keyboards/baseline/k_043___output_and_keystroke.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a25aae26a641719fa2715c7c81d3bb9b575b42ca Binary files /dev/null and b/common/test/keyboards/baseline/k_043___output_and_keystroke.kmx differ diff --git a/core/tests/unit/kmx/044 - if and context.kmn b/common/test/keyboards/baseline/k_044___if_and_context.kmn similarity index 91% rename from core/tests/unit/kmx/044 - if and context.kmn rename to common/test/keyboards/baseline/k_044___if_and_context.kmn index 98f4bf98534b8fa00a41aa4acb14c619aee90d0c..352490325ccdfd0db93a101b8929026b3abbe9ea 100644 --- a/core/tests/unit/kmx/044 - if and context.kmn +++ b/common/test/keyboards/baseline/k_044___if_and_context.kmn @@ -1,3 +1,4 @@ +store(&NAME) '044 - if and context' c Description: Tests that context(x) takes if() statements into account. See #4275. c keys: [K_A][K_B] c expected: ex diff --git a/common/test/keyboards/baseline/k_044___if_and_context.kmx b/common/test/keyboards/baseline/k_044___if_and_context.kmx new file mode 100644 index 0000000000000000000000000000000000000000..60c0c6300a6b6337cf3f02886ffdcaffb26c0183 Binary files /dev/null and b/common/test/keyboards/baseline/k_044___if_and_context.kmx differ diff --git a/core/tests/unit/kmx/045 - deadkey and context.kmn b/common/test/keyboards/baseline/k_045___deadkey_and_context.kmn similarity index 90% rename from core/tests/unit/kmx/045 - deadkey and context.kmn rename to common/test/keyboards/baseline/k_045___deadkey_and_context.kmn index 09d276782804f0911bdeda177530d9d1c68276e6..c79953a05b8cfa7a0041a780429b0b4dde2493e5 100644 --- a/core/tests/unit/kmx/045 - deadkey and context.kmn +++ b/common/test/keyboards/baseline/k_045___deadkey_and_context.kmn @@ -1,3 +1,4 @@ +store(&NAME) '045 - deadkey and context' c Description: Tests that context emits deadkeys correctly. See #4275. c keys: [K_Y][K_Z][SHIFT K_SLASH] c expected: correct diff --git a/common/test/keyboards/baseline/k_045___deadkey_and_context.kmx b/common/test/keyboards/baseline/k_045___deadkey_and_context.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4b1e3bfb2aa31a9c5885a151a395d08e36c9a9fc Binary files /dev/null and b/common/test/keyboards/baseline/k_045___deadkey_and_context.kmx differ diff --git a/core/tests/unit/kmx/046 - deadkey and contextex.kmn b/common/test/keyboards/baseline/k_046___deadkey_and_contextex.kmn similarity index 89% rename from core/tests/unit/kmx/046 - deadkey and contextex.kmn rename to common/test/keyboards/baseline/k_046___deadkey_and_contextex.kmn index 390e01df2d43b9c5bb155d413950eb639eb46c90..48ad796c3e5002905f5dae54d4c0312bd5fa5c31 100644 --- a/core/tests/unit/kmx/046 - deadkey and contextex.kmn +++ b/common/test/keyboards/baseline/k_046___deadkey_and_contextex.kmn @@ -1,3 +1,4 @@ +store(&NAME) '046 - deadkey and contextex' c Description: Tests that context() emits deadkeys correctly. See #4275. c keys: [K_Y][SHIFT K_M][SHIFT K_SLASH] c expected: correct diff --git a/common/test/keyboards/baseline/k_046___deadkey_and_contextex.kmx b/common/test/keyboards/baseline/k_046___deadkey_and_contextex.kmx new file mode 100644 index 0000000000000000000000000000000000000000..618eefbf27fa97b51828277312f179cc1a9aecfd Binary files /dev/null and b/common/test/keyboards/baseline/k_046___deadkey_and_contextex.kmx differ diff --git a/core/tests/unit/kmx/047 - caps always off initially on.kmn b/common/test/keyboards/baseline/k_047___caps_always_off_initially_on.kmn similarity index 90% rename from core/tests/unit/kmx/047 - caps always off initially on.kmn rename to common/test/keyboards/baseline/k_047___caps_always_off_initially_on.kmn index 014a15d583edf384933ed665fd855bf9fca02dfa..4c0b69136583e1ff7a736bd2a9997a9caaae6ac9 100644 --- a/core/tests/unit/kmx/047 - caps always off initially on.kmn +++ b/common/test/keyboards/baseline/k_047___caps_always_off_initially_on.kmn @@ -1,3 +1,4 @@ +store(&NAME) '047 - caps always off initially on' c Description: Tests Caps Lock always off, entry to the test has Caps Lock c on to test that it is then switched off on first keystroke event. c keys: [K_1][K_CAPS][K_2][K_CAPS][K_3] diff --git a/common/test/keyboards/baseline/k_047___caps_always_off_initially_on.kmx b/common/test/keyboards/baseline/k_047___caps_always_off_initially_on.kmx new file mode 100644 index 0000000000000000000000000000000000000000..301fcddc0469177249bea6a3887abb6daae0cf5d Binary files /dev/null and b/common/test/keyboards/baseline/k_047___caps_always_off_initially_on.kmx differ diff --git a/core/tests/unit/kmx/048 - modifier keys keep context.kmn b/common/test/keyboards/baseline/k_048___modifier_keys_keep_context.kmn similarity index 85% rename from core/tests/unit/kmx/048 - modifier keys keep context.kmn rename to common/test/keyboards/baseline/k_048___modifier_keys_keep_context.kmn index 629b9b24221b93a1f8647f454f76195a9ab09b5d..bb0cfc4df5d2eca0b4e7734cde0337365cedc8ce 100644 --- a/core/tests/unit/kmx/048 - modifier keys keep context.kmn +++ b/common/test/keyboards/baseline/k_048___modifier_keys_keep_context.kmn @@ -1,3 +1,4 @@ +store(&NAME) '048 - modifier keys keep context' c Description: Tests that modifier keys don't reset context (#5591) c keys: [K_A][K_SHIFT][K_B][K_A][K_ALT][K_B][K_A][K_CAPS][K_B] c expected: pass.pass.pass. diff --git a/common/test/keyboards/baseline/k_048___modifier_keys_keep_context.kmx b/common/test/keyboards/baseline/k_048___modifier_keys_keep_context.kmx new file mode 100644 index 0000000000000000000000000000000000000000..98ca5a6dbe39d8e012c3f744a706235d18dbc689 Binary files /dev/null and b/common/test/keyboards/baseline/k_048___modifier_keys_keep_context.kmx differ diff --git a/common/test/keyboards/build.sh b/common/test/keyboards/build.sh index 925cc9cdef8c2b66a6b550cbe374aa6cbe8f303e..43562ffb13afdaf9688fd30ebf5eb7b07f16f0bb 100755 --- a/common/test/keyboards/build.sh +++ b/common/test/keyboards/build.sh @@ -5,8 +5,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" ## END STANDARD BUILD SCRIPT INCLUDE THIS_DIR="$(dirname "$THIS_SCRIPT")" @@ -29,7 +29,9 @@ display_usage() { for d in "$THIS_DIR/"*/; do d="$(basename "$d")" - echo " $d" + if [ "$d" != "invalid" ]; then + echo " $d" + fi done echo @@ -122,7 +124,9 @@ fi if [ ${#TARGETS[@]} == 0 ]; then for d in "$THIS_DIR/"*/; do d="$(basename "$d")" - TARGETS+=("$d") + if [ "$d" != "invalid" ] && [ "$d" != "issue" ]; then + TARGETS+=("$d") + fi done fi @@ -191,14 +195,14 @@ for TARGET in "${TARGETS[@]}"; do if $CLEAN; then if ! $QUIET; then echo - echo_heading "Cleaning target $TARGET" + builder_heading "Cleaning target $TARGET" echo fi clean "$TARGET" else if ! $QUIET; then echo - echo_heading "Building target $TARGET" + builder_heading "Building target $TARGET" echo fi build "$TARGET" diff --git a/common/test/keyboards/invalid/README.md b/common/test/keyboards/invalid/README.md new file mode 100644 index 0000000000000000000000000000000000000000..a1a1b5e3ab91e1230ed96f7c8e745f81967ad3cf --- /dev/null +++ b/common/test/keyboards/invalid/README.md @@ -0,0 +1,163 @@ +# **Tests for kmcompxtest()** +
+ +This folder contains several kmn-files that are used for testing resulting error codes. + +Most of these tests are copied from balochi_phonetic and contain alterations of the data to produce (at least) 1 error. +
+
+ +## Naming Convention of kmn-files for using with kmcompxtest() + + CERR_404D_balochi_phonetic.kmn + + +The naming convention of the files is as follows: + +* All Files **MUST** start with CERR_ followed by 4 characters and an underscore. + +* After the second underscore all combination of char can be used. + +* The 4 characters following CERR_ correspond to the last 4 digits of the error code which is expected to be produced by this file. + + ( e.g. CERR_404D_balochi_phonetic.kmn should produce error 0x0000404D). + +
+
+ +While running, kmcompxtest extracts those 4 characters from the Filename (e.g. 404D for CERR_404D_balochi_phonetic) and compares those to the actual error found. + +* If these 4 characters correspond to the actual error given, the test will be marked as OK. (Code 0) +
+* If these 4 characters signify an error but **no error** does occur, the test will be marked as FAILED (Code 1) +
+* If these 4 characters signify an error but this **specific error** does not occur, the test will be marked as FAILED (Code 4) +
+* If these 4 characters signify an error number that is **not correct**, the test will be marked as FAILED (Code 5) +
+* If more than 1 error is produced, only the error coded in the Filename will be detected + +
+
+ +### Tests are available for the following CERR_: + + +| | Error Number | CERR_ +| :-: | :-----------:| :------------------------------------- +| | 00000800 | CERR_LEXICAL_MODEL_MIN +| | 000008FF | CERR_LEXICAL_MODEL_MAX +| | 00000800 | CERR_LEXICAL_MODEL_MIN +| | 000008FF | CERR_LEXICAL_MODEL_MAX +| | 00000000 | CERR_None +| | 00000001 | CERR_EndOfFile +| | 00008002 | CERR_BadCallParams +| | 00008004 | CERR_CannotAllocateMemory +| | 00008005 | CERR_InfileNotExist +| | 00008006 | CERR_CannotCreateOutfile +| | 00008007 | CERR_UnableToWriteFully +| | 00008008 | CERR_CannotReadInfile +| | 00008009 | CERR_SomewhereIGotItWrong +|**X**| 0000400A | CERR_InvalidToken +| | 0000400B | CERR_InvalidBegin +| | 0000400C | CERR_InvalidName +|**X**| 0000400D | CERR_InvalidVersion +|**X**| 0000400E | CERR_InvalidLanguageLine +| | 0000400F | CERR_LayoutButNoLanguage +| | 00004010 | CERR_InvalidLayoutLine +| | 00004011 | CERR_NoVersionLine +| | 00004012 | CERR_InvalidGroupLine +|**X**| 00004013 | CERR_InvalidStoreLine +| | 00004014 | CERR_InvalidCodeInKeyPartOfRule +|**X**| 00004015 | CERR_InvalidDeadkey +|**X**| 00004016 | CERR_InvalidValue +|**X**| 00004017 | CERR_ZeroLengthString +| | 00004018 | CERR_TooManyIndexToKeyRefs +|**X**| 00004019 | CERR_UnterminatedString +| | 0000401A | CERR_StringInVirtualKeySection +| | 0000401B | CERR_AnyInVirtualKeySection +| | 0000401C | CERR_InvalidAny +|**X**| 0000401D | CERR_StoreDoesNotExist +| | 0000401E | CERR_BeepInVirtualKeySection +| | 0000401F | CERR_IndexInVirtualKeySection +| | 00004020 | CERR_InvalidIndex +| | 00004021 | CERR_OutsInVirtualKeySection +| | 00004022 | CERR_InvalidOuts +| | 00004024 | CERR_ContextInVirtualKeySection +| | 00004025 | CERR_InvalidUse +|**X**| 00004026 | CERR_GroupDoesNotExist +| | 00004027 | CERR_VirtualKeyNotAllowedHere +| | 00004028 | CERR_InvalidSwitch +|**X**| 00004029 | CERR_NoTokensFound +| | 0000402A | CERR_InvalidLineContinuation +|**X**| 0000402B | CERR_LineTooLong +| | 0000402C | CERR_InvalidCopyright +|**X**| 0000402D | CERR_CodeInvalidInThisSection +| | 0000402E | CERR_InvalidMessage +| | 0000402F | CERR_InvalidLanguageName +| | 00004030 | CERR_InvalidBitmapLine +|**X**| 00004031 | CERR_CannotReadBitmapFile +| | 00004032 | CERR_IndexDoesNotPointToAny +| | 00004033 | CERR_ReservedCharacter +|**X**| 00004034 | CERR_InvalidCharacter +| | 00004035 | CERR_InvalidCall +| | 00004036 | CERR_CallInVirtualKeySection +| | 00004037 | CERR_CodeInvalidInKeyStore +|**X**| 00004038 | CERR_CannotLoadIncludeFile +|**X**| 00004039 | CERR_60FeatureOnly_EthnologueCode +|**X**| 0000403A | CERR_60FeatureOnly_MnemonicLayout +| | 0000403B | CERR_60FeatureOnly_OldCharPosMatching +| | 0000403C | CERR_60FeatureOnly_NamedCodes +| | 0000403D | CERR_60FeatureOnly_Contextn +|**X**| 0000403E | CERR_501FeatureOnly_Call +| | 0000403F | CERR_InvalidNamedCode +|**X**| 00004040 | CERR_InvalidSystemStore +|**X**| 00004044 | CERR_60FeatureOnly_VirtualCharKey +|**X**| 00004045 | CERR_VersionAlreadyIncluded +|**X**| 00004046 | CERR_70FeatureOnly +|**X**| 00004047 | CERR_80FeatureOnly +| | 00004048 | CERR_InvalidInVirtualKeySection +|**X**| 00004049 | CERR_InvalidIf +|**X**| 0000404A | CERR_InvalidReset +|**X**| 0000404B | CERR_InvalidSet +|**X**| 0000404C | CERR_InvalidSave +|**X**| 0000404D | CERR_InvalidEthnologueCode +| | 0000804E | CERR_CannotCreateTempfile +|**X**| 0000404F | CERR_90FeatureOnly_IfSystemStores +| | 00004050 | CERR_IfSystemStore_NotFound +| | 00004051 | CERR_90FeatureOnly_SetSystemStores +| | 00004052 | CERR_SetSystemStore_NotFound +| | 00004053 | CERR_90FeatureOnlyVirtualKeyDictionary +| | 00004054 | CERR_NotSupportedInKeymanWebContext +| | 00004055 | CERR_NotSupportedInKeymanWebOutput +| | 00004056 | CERR_NotSupportedInKeymanWebStore +| | 00004057 | CERR_VirtualCharacterKeysNotSupportedInKeymanWeb +| | 00004058 | CERR_VirtualKeysNotValidForMnemonicLayouts +| | 00004059 | CERR_InvalidTouchLayoutFile +| | 0000405A | CERR_TouchLayoutInvalidIdentifier +| | 0000405B | CERR_InvalidKeyCode +|**X**| 0000405C | CERR_90FeatureOnlyLayoutFile +|**X**| 0000405D | CERR_90FeatureOnlyKeyboardVersion +|**X**| 0000405E | CERR_KeyboardVersionFormatInvalid +| | 0000405F | CERR_ContextExHasInvalidOffset +|**X**| 00004060 | CERR_90FeatureOnlyEmbedCSS +|**X**| 00004061 | CERR_90FeatureOnlyTargets +| | 00004062 | CERR_ContextAndIndexInvalidInMatchNomatch +| | 00004063 | CERR_140FeatureOnlyContextAndNotAnyWeb +|**X**| 00004064 | CERR_ExpansionMustFollowCharacterOrVKey +|**X**| 00004065 | CERR_VKeyExpansionMustBeFollowedByVKey +|**X**| 00004066 | CERR_CharacterExpansionMustBeFollowedByCharacter +|**X**| 00004067 | CERR_VKeyExpansionMustUseConsistentShift +|**X**| 00004068 | CERR_ExpansionMustBePositive +|**X**| 00004069 | CERR_CasedKeysMustContainOnlyVirtualKeys +|**X**| 0000406A | CERR_CasedKeysMustNotIncludeShiftStates +|**X**| 0000406B | CERR_CasedKeysNotSupportedWithMnemonicLayout +|**X**| 0000406C | CERR_CannotUseReadWriteGroupFromReadonlyGroup +| | 0000406D | CERR_StatementNotPermittedInReadonlyGroup +|**X**| 0000406E | CERR_OutputInReadonlyGroup +|**X**| 0000406F | CERR_NewContextGroupMustBeReadonly +|**X**| 00004070 | CERR_PostKeystrokeGroupMustBeReadonly +|**X**| 00004071 | CERR_DuplicateGroup +|**X**| 00004072 | CERR_DuplicateStore +|**X**| 00004073 | CERR_RepeatedBegin +|**X**| 000080C0 | CERR_BufferOverflow diff --git a/common/test/keyboards/invalid/source/CERR_400A_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_400A_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..0b7f2ffb0ad3bed4171714aa3780b49e7d5c158c --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_400A_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' +c ***** CERR_InvalidToken 0x0000400A ******************************** ++ [CTRL B10] > L'1234' +c ******************************************************************* ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' diff --git a/common/test/keyboards/invalid/source/CERR_400D_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_400D_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..ade9793ed428e853c7ccb122338987ab26fbf958 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_400D_balochi_phonetic.kmn @@ -0,0 +1,130 @@ + c ***** CERR_InvalidVersion 0x0000400D ***************************** +store(&VERSION) '127.0' +c ******************************************************************* +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_400E_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_400E_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..ced7892f0584f46db2fb7aecb5f358716f801392 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_400E_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + c ***** CERR_InvalidLanguageLine 0x0000400E ************************ +store(&LANGUAGE) 'abc123' +c ******************************************************************* +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4013_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4013_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..cd838e36826e9c77539658da95cad512dc20500e --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4013_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +c ***** CERR_InvalidStoreLine 0x00004013 *************************** +store(&VERSION '10.0' +c ****************************************************************** +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4015_k_014___groups_and_virtual_keys.kmn b/common/test/keyboards/invalid/source/CERR_4015_k_014___groups_and_virtual_keys.kmn new file mode 100644 index 0000000000000000000000000000000000000000..da26166e5c3b1707b580cfffc5210d5d9da2d4bd --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4015_k_014___groups_and_virtual_keys.kmn @@ -0,0 +1,30 @@ +store(&NAME) '014 - groups and virtual keys' +c Description: Tests multiple groups and virtual keys with mnemonic layout +c keys: [K_A][SHIFT K_2][K_A][LCTRL K_2][K_A] +c expected: \u03B1\u1FB0\u1FB1 + +store(&VERSION) '9.0' + +begin Unicode > use(UMain) + +store(&MnemonicLayout) "0" + +c ---------------------------------------------- + +group(UMain) using keys + + [K_A] > U+03B1 + +c ***** CERR_InvalidDeadkey 0x00004015 ****************************** + + [CTRL K_q] > deadkey('–') +c ******************************************************************* + + + [ALT K_2] > deadkey(MacronBug) + + [SHIFT K_2] > deadkey(BreveBug) + + match > use(DK1) + +c ---------------------------------------------- + +group(DK1) + deadkey(MacronBug) U+03B1 > U+1FB1 c won't work + deadkey(BreveBug) U+03B1 > U+1FB0 c works \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4016_k_014___groups_and_virtual_keys.kmn b/common/test/keyboards/invalid/source/CERR_4016_k_014___groups_and_virtual_keys.kmn new file mode 100644 index 0000000000000000000000000000000000000000..9a07e0b058d15ddb9a3cb1d210e6a3f60b53ca7c --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4016_k_014___groups_and_virtual_keys.kmn @@ -0,0 +1,29 @@ +store(&NAME) '014 - groups and virtual keys' +c Description: Tests multiple groups and virtual keys with mnemonic layout +c keys: [K_A][SHIFT K_2][K_A][LCTRL K_2][K_A] +c expected: \u03B1\u1FB0\u1FB1 + +store(&VERSION) '9.0' + +begin Unicode > use(UMain) + +store(&MnemonicLayout) "0" + +c ---------------------------------------------- + +group(UMain) using keys + + [K_A] > U+03B1 + + [CTRL K_2] > deadkey(MacronBug) + + [ALT K_2] > deadkey(MacronBug) + + [SHIFT K_2] > deadkey(BreveBug) + + match > use(DK1) + +c ---------------------------------------------- + +group(DK1) + deadkey(MacronBug) U+03B1 > U+1FB1 c won't work + + c ***** CERR_InvalidValue 0x00004016 ***************************** + deXadkey(BreveBug) U+03B1 > U+1FB0 c works +c ******************************************************************* \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4017_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4017_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..ddc33aeb05752fca68ef3e754acf260f9bb105a5 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4017_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.bmp' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' +c ***** CERR_ZeroLengthString 0x00004017 *************************** ++ [CTRL B10] > +c ****************************************************************** ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4019_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4019_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..48f978a1eb8e24ba1e45d7a80de5a67f51117552 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4019_balochi_phonetic.kmn @@ -0,0 +1,129 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +c ***** CERR_UnterminatedString 0x00004019 ************************* +store(&BITMAP)CERR__balochi_phonetic.ico' +c ****************************************************************** +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_401D_k_034___options_double_set_reset.kmn b/common/test/keyboards/invalid/source/CERR_401D_k_034___options_double_set_reset.kmn new file mode 100644 index 0000000000000000000000000000000000000000..31876eeeef42142fc7f5c0066b8859ce9952b610 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_401D_k_034___options_double_set_reset.kmn @@ -0,0 +1,22 @@ +store(&NAME) '034 - options double set reset' +c Description: Tests basic option rules with save reset+set+reset +c keys: [K_A][K_A] +c expected: foo.foo. +c context: +c option: foo=1 +c expected option: foo=1 + +store(&version) '10.0' + +store(foo) '0' + +begin Unicode > use(Main) + +group(Main) using keys + +c ***** CERR_StoreDoesNotExist 0x0000401D *********************************** +if(foo = '1') + 'a' > 'foo.' set(foo='2') reset(ffoo) set(foo='3') reset(foo) +c ******************************************************************* +if(foo = '2') + 'a' > 'bar.' +if(foo = '3') + 'a' > 'baz.' +if(foo = '0') + 'a' > 'no foo.' diff --git a/common/test/keyboards/invalid/source/CERR_4026_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4026_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..6fb2c649de3dd6b1990401ec62fb00a5f385a7bf --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4026_balochi_phonetic.kmn @@ -0,0 +1,17 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +c ***** CERR_GroupDoesNotExist 0x00004026 ************************** + +c ****************************************************************** \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4029_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4029_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..3d093c36d41c0a3283b4b3691ba1c7d058bebd41 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4029_balochi_phonetic.kmn @@ -0,0 +1,128 @@ +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +c ***** CERR_NoTokensFound 0x00004029 ******************************* +begin +c ******************************************************************* +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '§' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' diff --git a/common/test/keyboards/invalid/source/CERR_402B_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_402B_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..7da903abe354889807846d265c91abeaaf153a49 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_402B_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +c ***** CERR_LineTooLong 0x0000402B ******************************** +store(©RIGHT) '© 2017-2021 SIL InternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxInternationalxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx' +c ****************************************************************** +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_402D_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_402D_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..37755739b9baf7d766330ebb8093a8b3aa25a8a3 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_402D_balochi_phonetic.kmn @@ -0,0 +1,129 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) +c ***** CERR_CodeInvalidInThisSection 0x0000402D ******************* + +c ****************************************************************** ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4031_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4031_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..b9b62c3a42a34402a09aa4d4c0ae811a4b42fd9d --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4031_balochi_phonetic.kmn @@ -0,0 +1,129 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +c ***** CERR_CannotReadBitmapFile 0x00004031 *********************** +store(&BITMAP) 'balochi_phonetic.ico' +c ****************************************************************** +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4034_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4034_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..c5c8306d37ab0d5ca250a37da110fce3aa9b0aa4 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4034_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +c ***** CERR_InvalidCharacter 0x00004034 *************************** +store(©RIGHT) '© 2012 U+1234 -2020 SIL International' +c ****************************************************************** +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4038_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4038_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..7e6eaedb1f9c2097f13854e21ccaa9e2a7d6731c --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4038_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' +c ***** CERR_CannotLoadIncludeFile 0x00004038 ********************** +store(&INCLUDECODES) 'XX.txt' +c ****************************************************************** +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4039_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4039_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..7eb9571a143603baa4ca1c4b912bccadf32f1fe7 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4039_balochi_phonetic.kmn @@ -0,0 +1,137 @@ +c ***** This test will produce XXXX Error: *************************** +c ***** 1) it will be marked as FAIL when run in kmcompxtest ******* +c ***** as a XXXXXXX non-existing ErrorNr (0x00040733) is specified ***** +c ******************************************************************store(&VERSION) '10.0' + +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +c ***** CERR_60FeatureOnly_EthnologueCode 0x00004039 **************** +store(&version) '3.0' +store(ÐNOLOGUECODE) 'eng' +c ******************************************************************* + +begin Unicode > use(main) + +group (main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '§' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' diff --git a/common/test/keyboards/invalid/source/CERR_403A_014_groups_and_virtual_keys.kmn b/common/test/keyboards/invalid/source/CERR_403A_014_groups_and_virtual_keys.kmn new file mode 100644 index 0000000000000000000000000000000000000000..43981238d7b594f6a4a3ce079a640958b82a25c0 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_403A_014_groups_and_virtual_keys.kmn @@ -0,0 +1,34 @@ +c RegressionTest: Multiple groups and virtual keys +c Font: Arial Unicode MS +c Encoding: Unicode +c Description: Tests multiple groups and virtual keys -- bug Ixxx +c Procedure: Press A, Shift+2, A, Ctrl+2, A +c AutoProc: K_A S+ K_2 S- K_A C+ K_2 C- K_A +c FinalOutput: U+03B1 U+1FB0 U+1FB1 + +c ***** CERR_60FeatureOnly_MnemonicLayout 0x0000403A **************** +store(&VERSION) '3.0' +c ******************************************************************* + +NAME "AltGr Deadkeys Test" + +begin Unicode > use(UMain) c Substitute UMain1 or UMain2 + +c ***** CERR_60FeatureOnly_MnemonicLayout 0x0000403A **************** +store(&MnemonicLayout) "1" +c ******************************************************************* + + +c ---------------------------------------------- +group(UMain) using keys + + ['a'] > U+03B1 + + [CTRL '2'] > deadkey(MacronBug) + + [ALT '2'] > deadkey(MacronBug) + + [SHIFT '2'] > deadkey(BreveBug) + match > use(DK1) + +c ---------------------------------------------- + +group(DK1) + deadkey(MacronBug) U+03B1 > U+1FB1 c won't work + deadkey(BreveBug) U+03B1 > U+1FB0 c works diff --git a/common/test/keyboards/invalid/source/CERR_403E_imsample.kmn b/common/test/keyboards/invalid/source/CERR_403E_imsample.kmn new file mode 100644 index 0000000000000000000000000000000000000000..93c90cfcea9ad0d78fc964fc2fc109306f3d7d77 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_403E_imsample.kmn @@ -0,0 +1,17 @@ +c ***** CERR_501FeatureOnly_Call 0x0000403E ************************* +store(&VERSION) '3.0' +c ******************************************************************* +store(&NAME) 'IMTest' +store(DLLFunction) "imsample.dll:DF" + +begin Unicode > use(main) + +group(main) using keys + +c ***** CERR_501FeatureOnly_Call 0x0000403E ************************* + ++ [K_BKSP] > call(DLLFunction) ++ [K_ESC] > call(DLLFunction) + +nomatch > call(DLLFunction) +c ******************************************************************* \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4040_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4040_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..4e6e7b41e3690d06de24114c98218bde2d3eae5e --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4040_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +store(&VERSION) '10.0' +c ***** CERR_InvalidSystemStore 0x00004040 ************************* +store(&NXXAME) 'Balochi Phonetic' +c ****************************************************************** +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4044_014_groups_and_virtual_keys.kmn b/common/test/keyboards/invalid/source/CERR_4044_014_groups_and_virtual_keys.kmn new file mode 100644 index 0000000000000000000000000000000000000000..42a0f87ee027286e4a584a14949226ade314d2e2 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4044_014_groups_and_virtual_keys.kmn @@ -0,0 +1,33 @@ +c RegressionTest: Multiple groups and virtual keys +c Font: Arial Unicode MS +c Encoding: Unicode +c Description: Tests multiple groups and virtual keys -- bug Ixxx +c Procedure: Press A, Shift+2, A, Ctrl+2, A +c AutoProc: K_A S+ K_2 S- K_A C+ K_2 C- K_A +c FinalOutput: U+03B1 U+1FB0 U+1FB1 + +c ***** CERR_501FeatureOnly_Call 0x0000403E ************************* +store(&VERSION) '3.0' +c ******************************************************************* + +NAME "AltGr Deadkeys Test" + +begin Unicode > use(UMain) c Substitute UMain1 or UMain2 + +store(&MnemonicLayout) "1" + +c ---------------------------------------------- +c ***** CERR_60FeatureOnly_VirtualCharKey 0x00004044 **************** +group(UMain) using keys + + ['a'] > U+03B1 + + [CTRL '2'] > deadkey(MacronBug) + + [ALT '2'] > deadkey(MacronBug) + + [SHIFT '2'] > deadkey(BreveBug) +c ******************************************************************* + match > use(DK1) + +c ---------------------------------------------- + +group(DK1) + deadkey(MacronBug) U+03B1 > U+1FB1 c won't work + deadkey(BreveBug) U+03B1 > U+1FB0 c works diff --git a/common/test/keyboards/invalid/source/CERR_4045_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4045_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..b50a62ced3d79c202444d2e78ee72fc87f39c853 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4045_balochi_phonetic.kmn @@ -0,0 +1,134 @@ +store(&VERSION) '10.0' + +c ***** CERR_VersionAlreadyIncluded 0x00004045 ****************************** +store(&VERSION) '110.0' +c ******************************************************************* + +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' diff --git a/common/test/keyboards/invalid/source/CERR_4046_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4046_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..69b4ce96f60b103118c13352af0b9026ca5cb67b --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4046_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +c ***** CERR_70FeatureOnly 0x00004046 ****************************** +store(&VERSION) '4.0' +c ****************************************************************** +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4047_k_022___options_with_preset.kmn b/common/test/keyboards/invalid/source/CERR_4047_k_022___options_with_preset.kmn new file mode 100644 index 0000000000000000000000000000000000000000..174a768ee55235664cf2add63c231a9e71b12fc0 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4047_k_022___options_with_preset.kmn @@ -0,0 +1,26 @@ +store(&NAME) '022 - options with preset' +c Description: Tests basic option rules with a preset supplied +c keys: [K_A][K_1][K_A][K_0][K_A] +c expected: foo.foo.no foo. +c context: +c option: foo=1 +c expected option: foo=0 +c saved option: foo=0 + +c ***** CERR_80FeatureOnly 0x00004047 ******************************* +store(&VERSION) '3.0' +c ******************************************************************* + +store(foo) '0' + +begin Unicode > use(Main) + +group(Main) using keys + +if(foo = '1') + 'a' > 'foo.' +if(foo = '0') + 'a' > 'no foo.' + +c ***** CERR_80FeatureOnly 0x00004047 ******************************* ++ '1' > set(foo = '1') save(foo) ++ '0' > set(foo = '0') save(foo) +c ******************************************************************* \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4049_k_022___options_with_preset.kmn b/common/test/keyboards/invalid/source/CERR_4049_k_022___options_with_preset.kmn new file mode 100644 index 0000000000000000000000000000000000000000..ea423987a4fe8efe39549d7e2ad069fe322bdb61 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4049_k_022___options_with_preset.kmn @@ -0,0 +1,24 @@ +store(&NAME) '022 - options with preset' +c Description: Tests basic option rules with a preset supplied +c keys: [K_A][K_1][K_A][K_0][K_A] +c expected: foo.foo.no foo. +c context: +c option: foo=1 +c expected option: foo=0 +c saved option: foo=0 + +store(&VERSION) '8.0' + +store(foo) '0' + +begin Unicode > use(Main) + +group(Main) using keys + +c ***** CERR_InvalidIf 0x00004049 *********************************** +if(foo '1') + 'a' > 'foo.' +c ******************************************************************* +if(foo = '0') + 'a' > 'no foo.' + ++ '1' > set(foo = '1') save(foo) ++ '0' > set(foo = '0') save(foo) \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_404A_k_025___options_with_reset.kmn b/common/test/keyboards/invalid/source/CERR_404A_k_025___options_with_reset.kmn new file mode 100644 index 0000000000000000000000000000000000000000..9dea1a51e4a62961e7da2b88427758dcd5eca10b --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_404A_k_025___options_with_reset.kmn @@ -0,0 +1,23 @@ +store(&NAME) '025 - options with reset' +c Description: Tests basic option rules with reset +c keys: [K_A][K_1][K_A][K_0][K_A][K_3] +c expected: foo.foo.no foo. +c context: +c option: foo=1 +c expected option: foo=1 + +store(&version) '10.0' + +store(foo) '0' + +begin Unicode > use(Main) + +group(Main) using keys + +if(foo = '1') + 'a' > 'foo.' +if(foo = '0') + 'a' > 'no foo.' ++ '1' > set(foo = '1') ++ '0' > set(foo = '0') +c ***** CERR_InvalidReset 0x0000404A ******************************** ++ '3' > reset +c ******************************************************************* diff --git a/common/test/keyboards/invalid/source/CERR_404B_k_025___options_with_reset.kmn b/common/test/keyboards/invalid/source/CERR_404B_k_025___options_with_reset.kmn new file mode 100644 index 0000000000000000000000000000000000000000..70b534fc7ec6079a419d3bdad044d974bb2947b2 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_404B_k_025___options_with_reset.kmn @@ -0,0 +1,25 @@ +store(&NAME) '025 - options with reset' +c Description: Tests basic option rules with reset +c keys: [K_A][K_1][K_A][K_0][K_A][K_3] +c expected: foo.foo.no foo. +c context: +c option: foo=1 +c expected option: foo=1 + +store(&version) '10.0' + +store(foo) '0' + +begin Unicode > use(Main) + +group(Main) using keys + +if(foo = '1') + 'a' > 'foo.' +if(foo = '0') + 'a' > 'no foo.' + +c ***** CERR_InvalidReset 0x0000404B ******************************** ++ '1' > set( ++ '0' > set +c ******************************************************************* + ++ '3' > reset(foo) diff --git a/common/test/keyboards/invalid/source/CERR_404C_k_023___options_with_save.kmn b/common/test/keyboards/invalid/source/CERR_404C_k_023___options_with_save.kmn new file mode 100644 index 0000000000000000000000000000000000000000..a160ace737fe6e66a26c221582ba17e63a272981 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_404C_k_023___options_with_save.kmn @@ -0,0 +1,23 @@ +store(&NAME) '023 - options with save' +c Description: Tests basic option rules with save +c keys: [K_A][K_1][K_A][K_0][K_A][K_2] +c expected: no foo.foo.no foo. +c context: +c expected option: foo=0 +c saved option: foo=0 + +store(&version) '10.0' + +store(foo) '0' + +begin Unicode > use(Main) + +group(Main) using keys + +if(foo = '1') + 'a' > 'foo.' +if(foo = '0') + 'a' > 'no foo.' ++ '1' > set(foo = '1') ++ '0' > set(foo = '0') +c ***** CERR_InvalidSave 0x0000404C ********************************* ++ '2' > save +c ******************************************************************* diff --git a/common/test/keyboards/invalid/source/CERR_404D_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_404D_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..7aadf5567236c4ba363f4c10fd5131b7602c996e --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_404D_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' +c ***** CERR_InvalidEthnologueCode 0x0000404D ********************** +store(&EthnologueCode) "xxxx" +c ****************************************************************** +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_404F_k_026___system_stores.kmn b/common/test/keyboards/invalid/source/CERR_404F_k_026___system_stores.kmn new file mode 100644 index 0000000000000000000000000000000000000000..e336ac5d789c0ac505e235998838905724c58ab7 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_404F_k_026___system_stores.kmn @@ -0,0 +1,29 @@ +store(&NAME) '026 - system stores' +c Description: Tests platform and baselayout system store rules +c keys: [K_1][K_2][K_3][K_4][K_A][K_B] +c expected: windows.desktop.hardware.native.en-US.kbdus.dll. +c context: +c (default) option: &platform=windows desktop hardware native <-- ignored by test +c (default) option: &baseLayout=kbdus.dll <-- ignored by test +c (default) option: &baseLayoutAlt=en-US <-- ignored by test + +c ***** CERR_90FeatureOnly_IfSystemStores 0x0000404F **************** +store(&version) '3.0' +c ******************************************************************* + +store(digit) '1234567890' +store(letter) 'abcdefghij' + +begin Unicode > use(Main) + +group(Main) using keys + +platform('windows') + '1' > 'windows.' +platform('desktop') + '2' > 'desktop.' +platform('hardware') + '3' > 'hardware.' +platform('native') + '4' > 'native.' ++ any(digit) > 'platform-fail.' + +baselayout('en-US') + 'a' > 'en-US.' +baselayout('kbdus.dll') + 'b' > 'kbdus.dll.' ++ any(letter) > 'baselayout-fail.' diff --git a/common/test/keyboards/invalid/source/CERR_405C_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_405C_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..ad777616033d925f4feec7502e1b70666fafeafd --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_405C_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +c ***** CERR_90FeatureOnlyLayoutFile 0x0000405C ******************** +store(&VERSION) '4.0' +c ****************************************************************** +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_405D_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_405D_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..e1224961ddd0c80fffdcb53419ea3159c6212793 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_405D_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +c ***** CERR_90FeatureOnlyKeyboardVersion 0x0000405D *************** +store(&VERSION) '4.0' +c ****************************************************************** +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_405E_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_405E_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..c255c0f5e7c8ca1c3a58cab350ab2793c886d5b8 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_405E_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +c ***** CERR_KeyboardVersionFormatInvalid 0x0000405E *************** +store(&KEYBOARDVERSION) 'abc' +c ****************************************************************** +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4060_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4060_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..6fc5ebe1ae72fa40af46af5edef5583559953d51 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4060_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +store(&VERSION) '4.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' +c ***** CERR_90FeatureOnlyEmbedCSS 0x00004060 ********************** +store(&KMW_EMBEDCSS) 'naijatype.css' +c ****************************************************************** +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4061_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4061_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..47b224d2c6a281ef1ca6c84df6f3b9c51eb79317 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4061_balochi_phonetic.kmn @@ -0,0 +1,130 @@ +c ***** CERR_90FeatureOnlyTargets 0x00004061 *********************** +store(&VERSION) '4.0' +c ****************************************************************** +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' \ No newline at end of file diff --git a/common/test/keyboards/invalid/source/CERR_4064_caps_lock_layer_3620.kmn b/common/test/keyboards/invalid/source/CERR_4064_caps_lock_layer_3620.kmn new file mode 100644 index 0000000000000000000000000000000000000000..dbc3b65a80fd5e6a5305221ba5e811c99da7ab76 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4064_caps_lock_layer_3620.kmn @@ -0,0 +1,22 @@ +c caps_lock_layer_3620 generated from template at 2021-11-30 14:58:52 +c with name "Caps Lock Layer 3620" +store(&VERSION) '10.0' +store(&NAME) 'Caps Lock Layer 3620' +store(©RIGHT) '©' +store(&KEYBOARDVERSION) '1.0' +store(&TARGETS) 'any' +store(&VISUALKEYBOARD) 'caps_lock_layer_3620.kvks' +store(&LAYOUTFILE) 'caps_lock_layer_3620.keyman-touch-layout' + +begin Unicode > use(main) + +store(key) [K_A] .. [K_Z] [SHIFT K_A] .. [SHIFT K_Z] +c ***** CERR_ExpansionMustFollowCharacterOrVKey 0x00004064 ********** +store(out) .. 'z' 'A' .. 'Z' +c ******************************************************************* +store(&CasedKeys) [K_A] .. [K_Z] + +group(main) using keys + ++ any(key) > index(out, 1) + diff --git a/common/test/keyboards/invalid/source/CERR_4065_test_expansion_invalid.kmn b/common/test/keyboards/invalid/source/CERR_4065_test_expansion_invalid.kmn new file mode 100644 index 0000000000000000000000000000000000000000..b721946537f14c4f9ce0e21cd2b72303ab1b404c --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4065_test_expansion_invalid.kmn @@ -0,0 +1,34 @@ +c This file tests that invalid expansions are caught +store(&NAME) 'Test Invalid Expansions' +begin Unicode > use(main) + +group(main) using keys + +c Backward ranges + +store(char_range_backward) 'c' .. 'a' +store(key_range_backward) [K_E] .. [K_A] + +store(char_range_empty) 'c' .. 'c' +store(key_range_empty) [K_E] .. [K_E] + +c Incomplete ranges + +store(range_open) .. +store(char_range_open_end) 'a' .. +store(char_range_open_start) .. 'z' + +store(key_range_open_end) [K_A] .. +store(key_range_open_start) .. [K_Z] + +c Inconsistent ranges + +store(char_range_to_key) 'a' .. [K_Z] +store(key_range_to_char) [K_A] .. 'z' + +store(char_range_to_statement) 'a' .. nul +store(key_range_to_statement) [K_A] .. nul +store(char_range_from_statement) nul .. 'a' +store(key_range_from_statement) nul .. [K_A] + +store(key_range_shift_inconsistent) [SHIFT K_A] .. [K_Z] diff --git a/common/test/keyboards/invalid/source/CERR_4066_test_expansion_invalid.kmn b/common/test/keyboards/invalid/source/CERR_4066_test_expansion_invalid.kmn new file mode 100644 index 0000000000000000000000000000000000000000..b721946537f14c4f9ce0e21cd2b72303ab1b404c --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4066_test_expansion_invalid.kmn @@ -0,0 +1,34 @@ +c This file tests that invalid expansions are caught +store(&NAME) 'Test Invalid Expansions' +begin Unicode > use(main) + +group(main) using keys + +c Backward ranges + +store(char_range_backward) 'c' .. 'a' +store(key_range_backward) [K_E] .. [K_A] + +store(char_range_empty) 'c' .. 'c' +store(key_range_empty) [K_E] .. [K_E] + +c Incomplete ranges + +store(range_open) .. +store(char_range_open_end) 'a' .. +store(char_range_open_start) .. 'z' + +store(key_range_open_end) [K_A] .. +store(key_range_open_start) .. [K_Z] + +c Inconsistent ranges + +store(char_range_to_key) 'a' .. [K_Z] +store(key_range_to_char) [K_A] .. 'z' + +store(char_range_to_statement) 'a' .. nul +store(key_range_to_statement) [K_A] .. nul +store(char_range_from_statement) nul .. 'a' +store(key_range_from_statement) nul .. [K_A] + +store(key_range_shift_inconsistent) [SHIFT K_A] .. [K_Z] diff --git a/common/test/keyboards/invalid/source/CERR_4067_test_expansion_invalid.kmn b/common/test/keyboards/invalid/source/CERR_4067_test_expansion_invalid.kmn new file mode 100644 index 0000000000000000000000000000000000000000..b721946537f14c4f9ce0e21cd2b72303ab1b404c --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4067_test_expansion_invalid.kmn @@ -0,0 +1,34 @@ +c This file tests that invalid expansions are caught +store(&NAME) 'Test Invalid Expansions' +begin Unicode > use(main) + +group(main) using keys + +c Backward ranges + +store(char_range_backward) 'c' .. 'a' +store(key_range_backward) [K_E] .. [K_A] + +store(char_range_empty) 'c' .. 'c' +store(key_range_empty) [K_E] .. [K_E] + +c Incomplete ranges + +store(range_open) .. +store(char_range_open_end) 'a' .. +store(char_range_open_start) .. 'z' + +store(key_range_open_end) [K_A] .. +store(key_range_open_start) .. [K_Z] + +c Inconsistent ranges + +store(char_range_to_key) 'a' .. [K_Z] +store(key_range_to_char) [K_A] .. 'z' + +store(char_range_to_statement) 'a' .. nul +store(key_range_to_statement) [K_A] .. nul +store(char_range_from_statement) nul .. 'a' +store(key_range_from_statement) nul .. [K_A] + +store(key_range_shift_inconsistent) [SHIFT K_A] .. [K_Z] diff --git a/common/test/keyboards/invalid/source/CERR_4068_test_expansion_invalid.kmn b/common/test/keyboards/invalid/source/CERR_4068_test_expansion_invalid.kmn new file mode 100644 index 0000000000000000000000000000000000000000..b721946537f14c4f9ce0e21cd2b72303ab1b404c --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4068_test_expansion_invalid.kmn @@ -0,0 +1,34 @@ +c This file tests that invalid expansions are caught +store(&NAME) 'Test Invalid Expansions' +begin Unicode > use(main) + +group(main) using keys + +c Backward ranges + +store(char_range_backward) 'c' .. 'a' +store(key_range_backward) [K_E] .. [K_A] + +store(char_range_empty) 'c' .. 'c' +store(key_range_empty) [K_E] .. [K_E] + +c Incomplete ranges + +store(range_open) .. +store(char_range_open_end) 'a' .. +store(char_range_open_start) .. 'z' + +store(key_range_open_end) [K_A] .. +store(key_range_open_start) .. [K_Z] + +c Inconsistent ranges + +store(char_range_to_key) 'a' .. [K_Z] +store(key_range_to_char) [K_A] .. 'z' + +store(char_range_to_statement) 'a' .. nul +store(key_range_to_statement) [K_A] .. nul +store(char_range_from_statement) nul .. 'a' +store(key_range_from_statement) nul .. [K_A] + +store(key_range_shift_inconsistent) [SHIFT K_A] .. [K_Z] diff --git a/common/test/keyboards/invalid/source/CERR_4069_test_casedkeys_invalid_1.kmn b/common/test/keyboards/invalid/source/CERR_4069_test_casedkeys_invalid_1.kmn new file mode 100644 index 0000000000000000000000000000000000000000..8bc65cced65cdb06504bd374dc707866e88155cc --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4069_test_casedkeys_invalid_1.kmn @@ -0,0 +1,10 @@ +c Tests cased keys - invalid codes +store(&NAME) 'Test &CasedKeys' +begin Unicode > use(main) + +group(main) using keys + +store(&CasedKeys) U+1000 + ++ [K_A] > 'aaah' ++ [SHIFT K_A] > 'AAAH' diff --git a/common/test/keyboards/invalid/source/CERR_406A_test_casedkeys_invalid_2.kmn b/common/test/keyboards/invalid/source/CERR_406A_test_casedkeys_invalid_2.kmn new file mode 100644 index 0000000000000000000000000000000000000000..508466c07e53ddddd21139e25eaf115d3513dff3 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_406A_test_casedkeys_invalid_2.kmn @@ -0,0 +1,10 @@ +c Tests cased keys - invalid codes +store(&NAME) 'Test &CasedKeys' +begin Unicode > use(main) + +group(main) using keys + +store(&CasedKeys) [SHIFT K_1] + ++ [K_A] > 'aaah' ++ [SHIFT K_A] > 'AAAH' diff --git a/common/test/keyboards/invalid/source/CERR_406B_test_casedkeys_mnemonic_1.kmn b/common/test/keyboards/invalid/source/CERR_406B_test_casedkeys_mnemonic_1.kmn new file mode 100644 index 0000000000000000000000000000000000000000..40b0bbb9668283bea355f6babeb7dea0a5936dd3 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_406B_test_casedkeys_mnemonic_1.kmn @@ -0,0 +1,11 @@ +c Tests cased keys - invalid with mnemonic layout +store(&NAME) 'Test &CasedKeys' +store(&mnemoniclayout) '1' +begin Unicode > use(main) + +group(main) using keys + +store(&CasedKeys) [K_A] [K_E] [K_I] [K_O] [K_U] [K_1] .. [K_4] + ++ [K_A] > 'aaah' ++ [SHIFT K_A] > 'AAAH' diff --git a/common/test/keyboards/invalid/source/CERR_406C_test_5963_readonlygroup_usenonreadonly.kmn b/common/test/keyboards/invalid/source/CERR_406C_test_5963_readonlygroup_usenonreadonly.kmn new file mode 100644 index 0000000000000000000000000000000000000000..8ced461fc755ab4db76b43c9b5728d529b29b4ae --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_406C_test_5963_readonlygroup_usenonreadonly.kmn @@ -0,0 +1,12 @@ +c should fail to compile, readonly group uses() non-readonly group + +begin Unicode > use(main) + +group(main) using keys + +group(foo) readonly + +'a' > use(bar) + +group(bar) + diff --git a/common/test/keyboards/invalid/source/CERR_406E_test_5963_readonlygroup_misplacedcontext.kmn b/common/test/keyboards/invalid/source/CERR_406E_test_5963_readonlygroup_misplacedcontext.kmn new file mode 100644 index 0000000000000000000000000000000000000000..251a3d1033c7fa2593ed684cb35e8138db89fd64 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_406E_test_5963_readonlygroup_misplacedcontext.kmn @@ -0,0 +1,11 @@ +c Should fail to compile, `context` must be omitted or first statement in output + +begin Unicode > use(main) + +group(main) using keys + +group(foo) readonly + +'a' > use(bar) context + +group(bar) readonly diff --git a/common/test/keyboards/invalid/source/CERR_406F_test_5963_newcontext_2.kmn b/common/test/keyboards/invalid/source/CERR_406F_test_5963_newcontext_2.kmn new file mode 100644 index 0000000000000000000000000000000000000000..a2916de43a66b86bd2cdf3f158fca3a7da887094 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_406F_test_5963_newcontext_2.kmn @@ -0,0 +1,9 @@ +c Should fail to compile, group is not readonly + +begin Unicode > use(main) +begin NewContext > use(NewContext) + +group(NewContext) + +group(main) using keys + diff --git a/common/test/keyboards/invalid/source/CERR_4070_test_5963_postkeystroke_2.kmn b/common/test/keyboards/invalid/source/CERR_4070_test_5963_postkeystroke_2.kmn new file mode 100644 index 0000000000000000000000000000000000000000..12bb3661501c9feb86cd059ac063b5423379cc1f --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4070_test_5963_postkeystroke_2.kmn @@ -0,0 +1,8 @@ +c Should fail to compile, group is not readonly + +begin Unicode > use(main) +begin PostKeystroke > use(PostKeystroke) + +group(PostKeystroke) + +group(main) using keys diff --git a/common/test/keyboards/invalid/source/CERR_4071_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4071_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..68a8a542469eed6765306ba3e326bbf5384e7669 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4071_balochi_phonetic.kmn @@ -0,0 +1,131 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +c ***** CERR_DuplicateGroup 0x00004071 ****************************** +group(main) using keys +c ******************************************************************* +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' diff --git a/common/test/keyboards/invalid/source/CERR_4072_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4072_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..ca9f15d3f3a6f1afa98285e1b6944216b19538bd --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4072_balochi_phonetic.kmn @@ -0,0 +1,133 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' + +c ***** DuplicateStore 0x00004072 *********************************** +store(©RIGHT) '© ABC' +c ******************************************************************* + +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' diff --git a/common/test/keyboards/invalid/source/CERR_4073_balochi_phonetic.kmn b/common/test/keyboards/invalid/source/CERR_4073_balochi_phonetic.kmn new file mode 100644 index 0000000000000000000000000000000000000000..9483a2196dc4777083e3150d075fc34d983a6965 --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_4073_balochi_phonetic.kmn @@ -0,0 +1,132 @@ +store(&VERSION) '10.0' +store(&NAME) 'Balochi Phonetic' +store(&TARGETS) 'any' +store(&KMW_RTL) '1' +store(&LAYOUTFILE) 'balochi_phonetic.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.4.2' +store(©RIGHT) '© 2017-2021 SIL International' +store(&MESSAGE) 'The Balochi Phonetic keyboard is distributed under The MIT License (MIT).' +store(&KMW_HELPTEXT) 'This is a phonetically organized Balochi keyboard.' +store(&VISUALKEYBOARD) 'balochi_phonetic.kvks' +store(&BITMAP) 'CERR__balochi_phonetic.ico' + +begin Unicode > use(main) + +c ***** CERR_RepeatedBegin 0x00004073 ******************************* +begin Unicode > use(main) +c ******************************************************************* + +group(main) using keys ++ [CTRL B08] > '‎' ++ [CTRL B09] > '‏' ++ [CTRL B10] > '–' ++ [SHIFT CTRL E11] > '“' ++ [SHIFT CTRL E12] > '”' ++ [CTRL E11] > '‘' ++ [CTRL E12] > '’' ++ [CTRL K_K] > 'ء' ++ [CTRL K_D] > 'ذ' ++ [K_EQUAL] > '=' ++ [SHIFT K_8] > '*' ++ [SHIFT K_7] > '&' ++ [SHIFT K_5] > '%' ++ [SHIFT K_4] > '$' ++ [SHIFT K_3] > '#' ++ [SHIFT K_2] > '@' ++ [SHIFT K_1] > '!' ++ [SHIFT K_N] > 'ں' ++ [K_BKSLASH] > '۔' ++ [K_LBRKT] > ']' ++ [K_RBRKT] > '[' ++ [K_F] > 'َ' ++ [K_V] > 'ِ' ++ [K_X] > 'ش' ++ [SHIFT K_H] > 'ح' ++ [SHIFT K_G] > 'ص' ++ [SHIFT K_Y] > 'ي' ++ [CTRL K_0] > '۰' ++ [CTRL K_9] > '۹' ++ [CTRL K_8] > '۸' ++ [CTRL K_7] > '۷' ++ [CTRL K_6] > '۶' ++ [CTRL K_5] > '۵' ++ [CTRL K_4] > '۴' ++ [CTRL K_3] > '۳' ++ [CTRL K_2] > '۲' ++ [CTRL K_1] > '۱' ++ [K_SLASH] > '/' ++ [K_HYPHEN] > '-' ++ [SHIFT K_COLON] > ':' ++ [SHIFT K_QUOTE] > '"' ++ [K_QUOTE] > U+0027 ++ [K_O] > 'ُ' ++ [SHIFT K_O] > 'ْ' ++ [K_BKQUOTE] > 'ء' ++ [SHIFT K_W] > 'أ' ++ [SHIFT K_P] > 'ّ' ++ [SHIFT K_BKQUOTE] > 'ٔ' ++ [SHIFT K_J] > 'ض' ++ [SHIFT K_9] > ')' ++ [SHIFT K_RBRKT] > '{' ++ [SHIFT K_LBRKT] > '}' ++ [SHIFT K_0] > '(' ++ [SHIFT K_SLASH] > '؟' ++ [SHIFT K_K] > 'ع' ++ [SHIFT K_EQUAL] > '«' ++ [SHIFT K_HYPHEN] > '»' ++ [SHIFT K_I] > 'ً' + ++ [SHIFT K_PERIOD] > '‹' ++ [SHIFT K_COMMA] > '›' ++ [SHIFT K_L] > 'ـ' ++ [SHIFT K_U] > 'ۀ' ++ [SHIFT K_B] > 'ة' ++ [SHIFT K_M] > 'غ' ++ [SHIFT K_F] > 'ف' ++ [SHIFT K_E] > 'ۓ' ++ [SHIFT K_Q] > 'ق' ++ [K_0] > '0' ++ [K_9] > '9' ++ [K_8] > '8' ++ [K_7] > '7' ++ [K_6] > '6' ++ [K_5] > '5' ++ [K_4] > '4' ++ [K_3] > '3' ++ [K_2] > '2' ++ [K_1] > '1' ++ [K_I] > 'ێ' ++ [SHIFT K_D] > 'ڈ' ++ [K_G] > 'گ' ++ [K_U] > 'ۆ' ++ [SHIFT K_R] > 'ڑ' ++ [SHIFT K_6] > '‌' ++ [SHIFT K_T] > 'ٹ' ++ [SHIFT K_V] > 'ظ' ++ [SHIFT K_C] > 'ط' ++ [SHIFT K_X] > 'خ' ++ [SHIFT K_Z] > 'ژ' ++ [SHIFT K_S] > 'ث' ++ [SHIFT K_A] > 'آ' ++ [K_PERIOD] > '.' ++ [K_COMMA] > '،' ++ [K_M] > 'م' ++ [K_N] > 'ن' ++ [K_B] > 'ب' ++ [K_C] > 'چ' ++ [K_Z] > 'ز' ++ [K_P] > 'پ' ++ [K_Y] > 'ی' ++ [K_T] > 'ت' ++ [K_R] > 'ر' ++ [K_E] > 'ے' ++ [K_W] > 'و' ++ [K_Q] > 'ئ' ++ [K_COLON] > '؛' ++ [K_L] > 'ل' ++ [K_K] > 'ک' ++ [K_J] > 'ج' ++ [K_H] > 'ه' ++ [K_D] > 'د' ++ [K_S] > 'س' ++ [K_A] > 'ا' diff --git a/common/test/keyboards/invalid/source/CERR_80C0_test_expansion_absurd.kmn b/common/test/keyboards/invalid/source/CERR_80C0_test_expansion_absurd.kmn new file mode 100644 index 0000000000000000000000000000000000000000..905093bc87ba33ce886f45e6428289af0d0e281d --- /dev/null +++ b/common/test/keyboards/invalid/source/CERR_80C0_test_expansion_absurd.kmn @@ -0,0 +1,7 @@ +c This file tests absurdly long expansions +store(&NAME) 'Test Expansions' +begin Unicode > use(main) + +group(main) using keys + +store(schar_range) U+0020 .. U+10FFFF diff --git a/common/test/keyboards/invalid/source/CERR__balochi_phonetic.ico b/common/test/keyboards/invalid/source/CERR__balochi_phonetic.ico new file mode 100644 index 0000000000000000000000000000000000000000..3fc6a224294396c55920dba4f44210059df71bef Binary files /dev/null and b/common/test/keyboards/invalid/source/CERR__balochi_phonetic.ico differ diff --git a/common/test/keyboards/the_99/README.md b/common/test/keyboards/issue/6254-invalid-version-99/README.md similarity index 100% rename from common/test/keyboards/the_99/README.md rename to common/test/keyboards/issue/6254-invalid-version-99/README.md diff --git a/common/test/keyboards/the_99/build.sh b/common/test/keyboards/issue/6254-invalid-version-99/build.sh similarity index 85% rename from common/test/keyboards/the_99/build.sh rename to common/test/keyboards/issue/6254-invalid-version-99/build.sh index 8ea4680ada6f9fb4534d8d9c7c5c844c3431a2fe..68577d0dc9a798bd9b2f3467b49b439d22783736 100755 --- a/common/test/keyboards/the_99/build.sh +++ b/common/test/keyboards/issue/6254-invalid-version-99/build.sh @@ -5,8 +5,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../../../resources/build/build-utils.sh" # . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" ## END STANDARD BUILD SCRIPT INCLUDE THIS_DIR="$(dirname "$THIS_SCRIPT")" @@ -49,6 +49,8 @@ while [[ $# -gt 0 ]] ; do shift done +cd "$THIS_DIR" + if $CLEAN; then if ! $QUIET; then echo Cleaning the_99.kmp from build/ diff --git a/common/test/keyboards/the_99/the_99.kmp b/common/test/keyboards/issue/6254-invalid-version-99/the_99.kmp similarity index 100% rename from common/test/keyboards/the_99/the_99.kmp rename to common/test/keyboards/issue/6254-invalid-version-99/the_99.kmp diff --git a/common/test/resources/keyboards/options_with_save.js b/common/test/resources/keyboards/options_with_save.js index 301ae1c673b602780a26ed0c71215fae44ccfbf7..8252b5166041aeea7d27f8100e72267fd269543b 100644 --- a/common/test/resources/keyboards/options_with_save.js +++ b/common/test/resources/keyboards/options_with_save.js @@ -1,4 +1,4 @@ -// Original source may be found within the repo at /core/tests/unit/kmx/ as #023. +// Original source may be found within the repo at /common/tests/keyboards/baseline/k_023___options_with_save.kmn if(typeof keyman === 'undefined') { console.log('Keyboard requires KeymanWeb 10.0 or later'); diff --git a/common/test/resources/test_kill_browserstack.sh b/common/test/resources/test_kill_browserstack.sh index 59a75be6279dca27b21c5b2b86faa15132075e41..82e40f85cd7bcd22f07c2aebd69e49b44a2d304d 100755 --- a/common/test/resources/test_kill_browserstack.sh +++ b/common/test/resources/test_kill_browserstack.sh @@ -7,14 +7,12 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE -get_builder_OS -if [ ${os_id} == 'win' ]; then +if [[ $BUILDER_OS == win ]]; then # BrowserStackLocal may not exist, so always pass taskkill //f //im BrowserStackLocal.exe || true fi diff --git a/common/tools/hextobin/.gitignore b/common/tools/hextobin/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..567609b1234a9b8806c5a05da6c866e480aa148d --- /dev/null +++ b/common/tools/hextobin/.gitignore @@ -0,0 +1 @@ +build/ diff --git a/common/tools/hextobin/build.sh b/common/tools/hextobin/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..702e6610f010afb3731614c73f0fbc22bb598708 --- /dev/null +++ b/common/tools/hextobin/build.sh @@ -0,0 +1,42 @@ +#!/usr/bin/env bash +# +# Builds hextobin.js +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +# This script runs from its own folder +cd "$THIS_SCRIPT_PATH" + +################################ Main script ################################ + +builder_describe "Build hextobin" clean configure build +builder_describe_outputs \ + configure /node_modules \ + build build/index.js +builder_parse "$@" + +if builder_start_action clean; then + npm run clean + builder_finish_action success clean +fi + +if builder_start_action configure; then + verify_npm_setup + builder_finish_action success configure +fi + +if builder_start_action build; then + npm run build + builder_finish_action success build +fi + diff --git a/common/tools/hextobin/hextobin.ts b/common/tools/hextobin/hextobin.ts new file mode 100644 index 0000000000000000000000000000000000000000..7a184f95fb71edf660752ac709dc006566d5f8d3 --- /dev/null +++ b/common/tools/hextobin/hextobin.ts @@ -0,0 +1,47 @@ +#!/usr/bin/env node +import * as fs from 'fs'; +import * as rd from 'readline'; +import * as program from 'commander'; + +let inputFilename: string = ""; +let outputFilename: string = ""; + +program + .description( +`Will convert the input file which is a hex dump to the output file. Hex dump can contain +blank lines, offsets, commands and comments. File writing will start at zero, padding is +not currently supported. + +Format: + + # This is a comment + block(name) # each part of file must be defined as a block + 11 22 33 44 55 aa bb # inserts hex bytes + offset(block) # inserts 4 byte offset of block from BOF + sizeof(block[,divisor]) # inserts 4 byte size of block, optionally divided by divisor + diff(block1,block2) # inserts 4 byte offset diff between start of block1 and block2 + index(block1,block2[,divisor]) # inserts 4 byte index diff between block1 and block2, + # optionally divided by divisor + # block names are required, but if not referenced can be reused (e.g. block(x)) +` + ) + .arguments('') + .arguments('') + .action((infile:any, outfile:any) => { inputFilename = infile; outputFilename = outfile; }); + +program.parse(process.argv); + +if(!inputFilename || !outputFilename) { + exitDueToUsageError('Must provide an input and output filename.'); +} + +function exitDueToUsageError(message: string): never { + console.error(`${program._name}: ${message}`); + console.error(); + program.outputHelp(); + return process.exit(64); // SysExits.EX_USAGE +} + +import hextobin from './index'; + +hextobin(inputFilename, outputFilename, {silent: false}); diff --git a/common/tools/hextobin/index.ts b/common/tools/hextobin/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..db2094538398306ed24bbd8b53a4f81327a0f7c7 --- /dev/null +++ b/common/tools/hextobin/index.ts @@ -0,0 +1,229 @@ +import * as fs from 'fs'; +import * as rd from 'readline'; + +export default async function hextobin(inputFilename: string, outputFilename?: string, options?: {silent?: boolean}): Promise { + + options = {...options}; + options.silent = !!options.silent; + + let reader = rd.createInterface(fs.createReadStream(inputFilename)); + + type HexBlockRefType = + 'sizeof' | // gets the size of a block, optionally divided by divisor: sizeof(block,divisor) + 'offset' | // gets the offset of a block in bytes from start of file: offset(block) + 'diff' | // gets the offset of a block in bytes from start of a base block: offset(baseBlock,block) + 'index'; // gets the index of a block from a base block, optionally divided by divisor: index(baseBlock,block,divisor) + + interface HexBlockRef { + type: HexBlockRefType; + blockName: string; + blockName2?: string; // used only by diff, index + divisor?: number; // used only by sizeof, index + offset: number; // actual byte offset in hex data (i.e. offset in string is * 2) + }; + + interface HexBlock { + name: string; + offset: number; // calculated during reconciliation phase + hex: string; + refs: HexBlockRef[]; + }; + + let blocks: HexBlock[] = []; + + let currentLine = ''; + let currentLineNumber = 0; + + if(!await load()) { + return null; + } + + if(!reconciliation()) { + return null; + } + + return save(); + + function reportError(message: string) { + if(!options.silent) { + console.error(`Invalid input file: ${message} on line #${currentLineNumber}: "${currentLine}"`); + } + } + + function currentBlock(): HexBlock { + return blocks.length ? blocks[blocks.length-1] : null; + } + + function parseToken(token: string): { command: string, parameters: string[] } { + let m = /^([a-z]+)\((.+)\)$/.exec(token); + if(!m) { + if(!token.match(/^[a-fA-F0-9]{2}$/)) { + return null; + } + // hex byte + return { command: 'data', parameters: [token] }; + } + + // processing command + return { command: m[1], parameters: m[2].split(',') }; + } + + function token(token: string) { + const t = parseToken(token); + if(!t) { + reportError(`expected command or hex at token "${token}"`); + return false; + } + + if(t.command == 'block') { + blocks.push({name: t.parameters[0], offset: 0, hex: '', refs: []}); + return true; + } + + const b = currentBlock(); + if(!b) { + reportError(`expected block() before data`); + return false; + } + + switch(t.command) { + case 'offset': + b.refs.push({type: 'offset', blockName: t.parameters[0], offset: b.hex.length / 2}); + b.hex += "_".repeat(8); // always 4 bytes, placeholder will be filled in during reconciliation phase + break; + case 'sizeof': + // sizeof can take a second parameter, divisor + { + let divisor = t.parameters.length > 1 ? parseInt(t.parameters[1],10) : 1; + b.refs.push({type: 'sizeof', blockName: t.parameters[0], divisor: divisor, offset: b.hex.length / 2}); + b.hex += "_".repeat(8); // always 4 bytes, placeholder will be filled in during reconciliation phase + } + break; + case 'diff': + b.refs.push({type: 'diff', blockName: t.parameters[0], blockName2: t.parameters[1], offset: b.hex.length / 2}); + b.hex += "_".repeat(8); // always 4 bytes, placeholder will be filled in during reconciliation phase + break; + case 'index': + // index can take a third parameter, divisor + { + let divisor = t.parameters.length > 2 ? parseInt(t.parameters[2],10) : 1; + b.refs.push({type: 'index', blockName: t.parameters[0], blockName2: t.parameters[1], divisor: divisor, offset: b.hex.length / 2}); + b.hex += "_".repeat(8); // always 4 bytes, placeholder will be filled in during reconciliation phase + } + break; + case 'data': + b.hex += t.parameters[0]; + break; + default: + reportError(`unknown command ${t.command}`); + return false; + } + return true; + } + + async function load() { + for await (const l of reader) { + // Error reporting variables + currentLine = l; + currentLineNumber++; + + const tokens = l.split(/[ \t]+/); + for(let t of tokens) { + if(t.startsWith('#')) { + // comment, ignore all subsequent tokens to EOL + break; + } + if(t == '') { + continue; + } + if(!token(t)) { + return false; + } + } + } + return true; + } + + function dwordLeToHex(v: number): string { + // hacky but who cares + let h = v.toString(16); + h = "0".repeat(8-h.length) + h; + return h.substring(6,8) + h.substring(4, 6) + h.substring(2, 4) + h.substring(0, 2); + } + + function fillBlockPlaceholder(block: HexBlock, offset: number, value: number): void { + const hexvalue = dwordLeToHex(value); + block.hex = block.hex.substring(0, offset * 2) + hexvalue + block.hex.substring(offset * 2 + 8); + } + + function reconciliation(): boolean { + let offset = 0; + + // calculate block sizes + for(let b of blocks) { + b.offset = offset; + offset += b.hex.length / 2; + } + + // reconcile block offsets and sizes + for(let b of blocks) { + for(let r of b.refs) { + const v = blocks.find(q => q.name == r.blockName); + if(!v) { + reportError(`Could not find block ${r.blockName} when reconciling ${b.name}`); + return false; + } + switch(r.type) { + case 'diff': + { + const v2 = blocks.find(q => q.name == r.blockName2); + if(!v2) { + reportError(`Could not find block ${r.blockName2} when reconciling ${b.name}`); + return false; + } + fillBlockPlaceholder(b, r.offset, v2.offset - v.offset); + } + break; + case 'offset': + fillBlockPlaceholder(b, r.offset, v.offset); + break; + case 'sizeof': + fillBlockPlaceholder(b, r.offset, v.hex.length / 2 / r.divisor); + break; + case 'index': + { + const v2 = blocks.find(q => q.name == r.blockName2); + if(!v2) { + reportError(`Could not find block ${r.blockName2} when reconciling ${b.name}`); + return false; + } + fillBlockPlaceholder(b, r.offset, (blocks.indexOf(v2) - blocks.indexOf(v)) / r.divisor); + } + break; + default: + reportError(`Invalid ref ${r.type}`); + return false; + } + } + } + return true; + } + + function save(): Uint8Array { + let total = blocks.reduce((total: number, item: HexBlock) => Math.max(item.offset + item.hex.length/2, total), 0); + + if(!options.silent) { + console.log(`${currentLineNumber} lines read; ${blocks.length} sections to write. Total file size = ${total} bytes.` ); + } + let buffer = new Uint8Array(total); + blocks.forEach(item => { + let buf = Buffer.from(item.hex, 'hex'); + buffer.set(buf, item.offset); + }); + + if(outputFilename) { + fs.writeFileSync(outputFilename, buffer); + } + return buffer; + } +} \ No newline at end of file diff --git a/common/tools/hextobin/package.json b/common/tools/hextobin/package.json new file mode 100644 index 0000000000000000000000000000000000000000..155f8297597141334b4dc1ebce1bae8acfe03f59 --- /dev/null +++ b/common/tools/hextobin/package.json @@ -0,0 +1,28 @@ +{ + "name": "@keymanapp/hextobin", + "description": "hextobin conversion tool", + "keywords": [ + "keyman", + "hex", + "binary" + ], + "license": "MIT", + "dependencies": { + "commander": "^5.1.0" + }, + "main": "build/index.js", + "bin": { + "hextobin": "build/hextobin.js" + }, + "scripts": { + "clean": "tsc -b --clean", + "build": "tsc -b" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/keymanapp/keyman.git" + }, + "devDependencies": { + "@types/node": "^18.7.18" + } +} diff --git a/common/tools/hextobin/tsconfig.json b/common/tools/hextobin/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..e32831fe737a309a3b42a8484e59e819ddfb1fd9 --- /dev/null +++ b/common/tools/hextobin/tsconfig.json @@ -0,0 +1,19 @@ +{ + "extends": "../../../tsconfig-base.json", + "compilerOptions": { + "composite": true, + "declaration": true, + "target": "ES2020", + "module": "CommonJS", + "moduleResolution": "node", + "rootDir": ".", + "outDir": "build/", + }, + "exclude": [ + "node_modules" + ], + "files": [ + "index.ts", + "hextobin.ts" + ] +} diff --git a/common/tools/sourcemap-path-remapper/build.sh b/common/tools/sourcemap-path-remapper/build.sh index 1550cdd8720e01c0af99c75af51f9f57bcc346ae..16c5c76a673b9c23167cc51a63984cab1a87b6c1 100755 --- a/common/tools/sourcemap-path-remapper/build.sh +++ b/common/tools/sourcemap-path-remapper/build.sh @@ -6,8 +6,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" diff --git a/common/tools/sourcemap-path-remapper/package.json b/common/tools/sourcemap-path-remapper/package.json index 87697810a715b1a82a8030d7cb09e704119e98f6..552d60989b39bfd14b02e345a13b68e650eee9d6 100644 --- a/common/tools/sourcemap-path-remapper/package.json +++ b/common/tools/sourcemap-path-remapper/package.json @@ -23,8 +23,8 @@ "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", "sinon": "^7.1.1", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" }, "dependencies": { "convert-source-map": "^2.0.0" diff --git a/common/web/build.sh b/common/web/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..0ed50fb521923c7b418b88cd0ee511c7516f0a7c --- /dev/null +++ b/common/web/build.sh @@ -0,0 +1,34 @@ +#!/usr/bin/env bash +# +# Compiles and tests the common web modules +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +# +# TODO: future modules may include +# :lm-message-types \ +# :sentry-manager \ +# + +builder_describe "Keyman common web modules" \ + :keyman-version \ + :types \ + :utils \ + clean \ + configure \ + build \ + test + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +builder_run_child_actions clean configure build test diff --git a/common/web/eslint/eslintNoNodeImports.js b/common/web/eslint/eslintNoNodeImports.js new file mode 100644 index 0000000000000000000000000000000000000000..e9c022439a752f43dc10272df5b8cd048f284245 --- /dev/null +++ b/common/web/eslint/eslintNoNodeImports.js @@ -0,0 +1,13 @@ +module.exports = { + // Prevents use of Node's standard imports so we can make sure we can also run + // on web. Comes from eslint docs but not sure how reliable it is: + // https://eslint.org/docs/latest/rules/no-restricted-imports + // TODO: Consider moving to + // https://github.com/import-js/eslint-plugin-import/blob/main/docs/rules/no-nodejs-modules.md + // which uses https://npmjs.com/package/is-core-module + rules: { + "no-restricted-imports": ["error", + "assert","buffer","child_process","cluster","crypto","dgram","dns","domain","events","freelist","fs","http","https","module","net","os","path","punycode","querystring","readline","repl","smalloc","stream","string_decoder","sys","timers","tls","tracing","tty","url","util","vm","zlib" + ], + }, +}; diff --git a/common/web/input-processor/build.sh b/common/web/input-processor/build.sh index 0639772c0782791abd78e1e4a53cc316944a6da6..11efb33fbaa300f0329f019a0e54732efc7f4dbc 100755 --- a/common/web/input-processor/build.sh +++ b/common/web/input-processor/build.sh @@ -6,37 +6,31 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + # This script runs from its own folder -cd "$(dirname "$THIS_SCRIPT")" +cd "$THIS_SCRIPT_PATH" ################################ Main script ################################ -# TODO: for predictive-text, we only need :headless, perhaps we should be splitting modules? -# TODO: remove :tools once kmlmc is a dependency for test:module - builder_describe "Builds the standalone, headless form of Keyman Engine for Web's input-processor module" \ - "@../keyman-version" \ - "@../keyboard-processor" \ - "@../../predictive-text" \ + "@/common/web/keyman-version" \ + "@/common/web/keyboard-processor" \ + "@/common/predictive-text" \ + "@/developer/src/kmc-model test" \ "clean" \ "configure" \ "build" \ "test" \ - ":module A headless, Node-oriented version of the module useful for unit tests" \ - ":tools Related tools useful for development and testing of this module" \ "--ci Sets $(builder_term test) action to use CI-based test configurations & reporting" builder_describe_outputs \ configure /node_modules \ - configure:module /node_modules \ - configure:tools /node_modules \ - build:module build/index.js \ - build:tools /developer/src/kmlmc/dist/kmlmc.js # TODO: remove this once kmlmc is a dependency + build /common/web/input-processor/build/index.js builder_parse "$@" @@ -56,33 +50,23 @@ fi ### BUILD ACTIONS -if builder_start_action build:tools; then - # Used by test:module - # TODO: convert to a dependency once we have updated kmlmc to use builder script - pushd "$KEYMAN_ROOT/developer/src/kmlmc" - ./build.sh -S - popd - - builder_finish_action success build:tools -fi - -if builder_start_action build:module; then - npm run tsc -- -b src/tsconfig.json - builder_finish_action success build:module +if builder_start_action build; then + tsc --build src/tsconfig.json + builder_finish_action success build fi # TEST ACTIONS -if builder_start_action test:module; then +if builder_start_action test; then FLAGS= if builder_has_option --ci; then FLAGS="--reporter mocha-teamcity-reporter" fi # Build the leaf-style, bundled version of input-processor for use in testing. - npm run tsc -- -b src/tsconfig.bundled.json + tsc -b src/tsconfig.bundled.json - npm run mocha -- --recursive $FLAGS ./tests/cases/ + mocha --recursive $FLAGS ./tests/cases/ - builder_finish_action success test:module + builder_finish_action success test fi \ No newline at end of file diff --git a/common/web/input-processor/package.json b/common/web/input-processor/package.json index bf9e13cd41cb13f7c007c7283b484b15670b0367..6675574334dfd432dd20912a1eda3eb222a27849 100644 --- a/common/web/input-processor/package.json +++ b/common/web/input-processor/package.json @@ -17,14 +17,14 @@ }, "homepage": "https://github.com/keymanapp/keyman#readme", "devDependencies": { - "@keymanapp/lexical-model-compiler": "*", + "@keymanapp/kmc": "*", "@keymanapp/resources-gosh": "*", "@types/node": "^11.9.4", "chai": "^4.3.4", "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" }, "scripts": { "tsc": "tsc", diff --git a/common/web/input-processor/tests/cases/languageProcessor.js b/common/web/input-processor/tests/cases/languageProcessor.js index 13d98398119776e278c0e34633a34c354a298036..c3e02a97621023e13bc95d4d02f6750f8fdc6412 100644 --- a/common/web/input-processor/tests/cases/languageProcessor.js +++ b/common/web/input-processor/tests/cases/languageProcessor.js @@ -6,7 +6,8 @@ var vm = require("vm"); * Unit tests for the Dummy prediction model. */ -var LexicalModelCompiler = require('../../../../../developer/src/kmlmc/dist/lexical-model-compiler/lexical-model-compiler').default; +// TODO: this relies on esbuild output for lexical-model-compiler; later should use import +var LexicalModelCompiler = require('../../../../../developer/src/kmc-model/build/cjs-src/lexical-model-compiler.cjs').default; var path = require('path'); let InputProcessor = require('../../build/index.bundled.js'); @@ -49,7 +50,7 @@ describe('LanguageProcessor', function() { describe('.predict', function() { let compiler = new LexicalModelCompiler(); const MODEL_ID = 'example.qaa.trivial'; - const PATH = path.join(__dirname, '../../../../../developer/src/kmlmc/tests/fixtures', MODEL_ID); + const PATH = path.join(__dirname, '../../../../../developer/src/kmc-model/test/fixtures', MODEL_ID); describe('using angle brackets for quotes', function() { let modelCode = compiler.generateLexicalModelCode(MODEL_ID, { diff --git a/common/web/keyboard-processor/build.sh b/common/web/keyboard-processor/build.sh index d46cc5bc1bc87881dd305d84a66f153ffe4f7407..ebcab580ab5db576ff6face96206fcd2f95590ac 100755 --- a/common/web/keyboard-processor/build.sh +++ b/common/web/keyboard-processor/build.sh @@ -6,8 +6,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" @@ -19,9 +19,9 @@ cd "$THIS_SCRIPT_PATH" builder_describe \ "Compiles the web-oriented utility function module." \ - "@../recorder test" \ - "@../keyman-version" \ - "@../utils" \ + "@/common/web/recorder test" \ + "@/common/web/keyman-version" \ + "@/common/web/utils" \ configure \ clean \ build \ @@ -30,7 +30,7 @@ builder_describe \ builder_describe_outputs \ configure /node_modules \ - build build/index.js + build /common/web/keyboard-processor/build/index.js builder_parse "$@" @@ -45,14 +45,14 @@ if builder_start_action clean; then fi if builder_start_action build; then - npm run tsc -- --build "$THIS_SCRIPT_PATH/src/tsconfig.json" + tsc --build "$THIS_SCRIPT_PATH/src/tsconfig.json" builder_finish_action success build fi if builder_start_action test; then - npm run tsc -- --build "$THIS_SCRIPT_PATH/src/tsconfig.bundled.json" + tsc --build "$THIS_SCRIPT_PATH/src/tsconfig.bundled.json" - echo_heading "Running Keyboard Processor test suite" + builder_heading "Running Keyboard Processor test suite" FLAGS= if builder_has_option --ci; then @@ -60,7 +60,7 @@ if builder_start_action test; then FLAGS="$FLAGS --reporter mocha-teamcity-reporter" fi - npm run mocha -- --recursive $FLAGS ./tests/cases/ + mocha --recursive $FLAGS ./tests/cases/ builder_finish_action success test fi \ No newline at end of file diff --git a/common/web/keyboard-processor/package.json b/common/web/keyboard-processor/package.json index 437f358dbadd8dea522d14a071fed81c3b928f5b..c93d6f124d8de7285762bdd86c7d587b8fb3295f 100644 --- a/common/web/keyboard-processor/package.json +++ b/common/web/keyboard-processor/package.json @@ -21,8 +21,8 @@ "chai": "^4.3.4", "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" }, "scripts": { "tsc": "tsc", diff --git a/common/web/keyman-version/.gitignore b/common/web/keyman-version/.gitignore index 3e3464001b7e7c4a1e75a8748453d32a7835b029..7cedcbd35dd71e785f55363341e4aa8f829b9401 100644 --- a/common/web/keyman-version/.gitignore +++ b/common/web/keyman-version/.gitignore @@ -1,2 +1,5 @@ # version.inc.ts is generated during the build -version.inc.ts \ No newline at end of file +version.inc.ts + +# keyman-version.mts (esm clone of version.inc.ts) is generated during the build +keyman-version.mts \ No newline at end of file diff --git a/common/web/keyman-version/.npmignore b/common/web/keyman-version/.npmignore deleted file mode 100644 index c22b1d8223046f94c6cc19600a662e0ca0074413..0000000000000000000000000000000000000000 --- a/common/web/keyman-version/.npmignore +++ /dev/null @@ -1,5 +0,0 @@ -build/index.tsbuildinfo -build/tsconfig.esm.tsbuildinfo -build.sh -index.ts -tsconfig.json \ No newline at end of file diff --git a/common/web/keyman-version/build.sh b/common/web/keyman-version/build.sh index 85374a747ac319284c62b6e1a2b86170a4e04916..07fb6220601af5e32214e0bc8db292bbee3052f8 100755 --- a/common/web/keyman-version/build.sh +++ b/common/web/keyman-version/build.sh @@ -8,8 +8,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" @@ -23,12 +23,14 @@ builder_describe "Build the include script for current Keyman version" \ configure \ clean \ build \ - publish \ + "pack build a local .tgz pack for testing" \ + "publish publish to npm" \ + test \ --dry-run builder_describe_outputs \ configure "/node_modules" \ - build "build/index.js" + build "/common/web/keyman-version/build/keyman-version.mjs" builder_parse "$@" @@ -45,7 +47,24 @@ if builder_start_action clean; then fi if builder_start_action build; then - # Generate index.ts + # Generate keyman-version.mts + echo " + // Generated by common/web/keyman-version/build.sh + export default class KEYMAN_VERSION { + static readonly VERSION = \"$VERSION\"; + static readonly VERSION_RELEASE =\"$VERSION_RELEASE\"; + static readonly VERSION_MAJOR = \"$VERSION_MAJOR\"; + static readonly VERSION_MINOR = \"$VERSION_MINOR\"; + static readonly VERSION_PATCH = \"$VERSION_PATCH\"; + static readonly TIER =\"$TIER\"; + static readonly VERSION_TAG = \"$VERSION_TAG\"; + static readonly VERSION_WITH_TAG = \"$VERSION_WITH_TAG\"; + static readonly VERSION_ENVIRONMENT = \"$VERSION_ENVIRONMENT\"; + static readonly SENTRY_RELEASE = \"release-$VERSION_WITH_TAG\"; + } + " > ./keyman-version.mts + + # Generate version.inc.ts -- used by TypeScript code that isn't yet modular echo " // Generated by common/web/keyman-version/build.sh namespace com.keyman { @@ -66,9 +85,10 @@ if builder_start_action build; then # Note: in a dependency build, we'll expect keyman-version to be built by tsc -b if builder_is_dep_build; then - echo "[$THIS_SCRIPT_IDENTIFIER] skipping tsc -b; will be completed by $builder_dep_parent" + builder_echo "skipping tsc -b; will be completed by $builder_dep_parent" else - npm run build -- $builder_verbose + echo 'Building @keymanapp/keyman-version' + tsc -b $builder_verbose fi builder_finish_action success build @@ -78,4 +98,8 @@ if builder_start_action publish; then . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" builder_publish_to_npm builder_finish_action success publish +elif builder_start_action pack; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_pack + builder_finish_action success pack fi diff --git a/common/web/keyman-version/package.json b/common/web/keyman-version/package.json index 01cc5689c47c7e55613c19242bc35a82996f8db0..ef94e58750ad4187925ff01f19b54b702d56e426 100644 --- a/common/web/keyman-version/package.json +++ b/common/web/keyman-version/package.json @@ -2,13 +2,22 @@ "name": "@keymanapp/keyman-version", "description": "Keyman global version data", "main": "./build/index.js", - "exports": "./build/index.js", + "exports": { + ".": { + "import": "./build/keyman-version.mjs", + "require": "./build/index.js" + } + }, + "files": [ + "/build/" + ], "scripts": { "build": "echo 'Building @keymanapp/keyman-version' && tsc -b", "clean": "tsc -b --clean" }, "license": "MIT", "devDependencies": { - "typescript": "^4.5.4" + "@types/node": "^18.7.13", + "typescript": "^4.9.5" } } diff --git a/common/web/keyman-version/tsconfig.esm.json b/common/web/keyman-version/tsconfig.esm.json new file mode 100644 index 0000000000000000000000000000000000000000..1e72269873081357583fa68b418e2b4a7f674b3f --- /dev/null +++ b/common/web/keyman-version/tsconfig.esm.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../tsconfig-base.json", + + "compilerOptions": { + "allowJs": false, + "declaration": true, + "module": "es2020", + "outDir": "./build/", + "baseUrl": ".", + "rootDir": ".", + "sourceMap": true, + "lib": ["es6"], + "target": "es6", + }, + "include": [ + "keyman-version.mts" + ] +} diff --git a/common/web/lm-message-types/package.json b/common/web/lm-message-types/package.json index 1941d69ab31217ec2029879f77bb77b3a4e7511b..01e880c9b2242fb8a8f80c1a4b9f8567475adc6d 100644 --- a/common/web/lm-message-types/package.json +++ b/common/web/lm-message-types/package.json @@ -7,7 +7,7 @@ }, "license": "MIT", "devDependencies": { - "typescript": "^4.5.4" + "typescript": "^4.9.5" }, "files": [ "message.d.ts" diff --git a/common/web/lm-worker/build.sh b/common/web/lm-worker/build.sh index 57ba6abb036a34778ce0a9a264edcac1451dc8f6..59472b0f93351bd78aed7a3becb320ce359ba61b 100755 --- a/common/web/lm-worker/build.sh +++ b/common/web/lm-worker/build.sh @@ -11,8 +11,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" @@ -51,25 +51,25 @@ wrap-worker-code ( ) { # but also adds a lot more code the worker doesn't need to use. # Recommended by MDN while keeping the worker lean and efficient. # Needed for Android / Chromium browser pre-41. - cat "../../../node_modules/string.prototype.codepointat/codepointat.js" || die + cat "../../../node_modules/string.prototype.codepointat/codepointat.js" || builder_die # These two are straight from MDN - I didn't find any NPM ones that don't # use the node `require` statement for the second. They're also relatively # short and simple, which is good. - cat "src/polyfills/array.fill.js" || die # Needed for Android / Chromium browser pre-45. - cat "src/polyfills/array.findIndex.js" || die # Needed for Android / Chromium browser pre-45. - cat "src/polyfills/array.from.js" || die # Needed for Android / Chromium browser pre-45. - cat "src/polyfills/array.includes.js" || die # Needed for Android / Chromium browser pre-47. + cat "src/polyfills/array.fill.js" || builder_die # Needed for Android / Chromium browser pre-45. + cat "src/polyfills/array.findIndex.js" || builder_die # Needed for Android / Chromium browser pre-45. + cat "src/polyfills/array.from.js" || builder_die # Needed for Android / Chromium browser pre-45. + cat "src/polyfills/array.includes.js" || builder_die # Needed for Android / Chromium browser pre-47. # For Object.values, for iteration over object-based associate arrays. - cat "src/polyfills/object.values.js" || die # Needed for Android / Chromium browser pre-54. + cat "src/polyfills/object.values.js" || builder_die # Needed for Android / Chromium browser pre-54. # Needed to support Symbol.iterator, as used by the correction algorithm. - cat "src/polyfills/symbol-es6.min.js" || die # Needed for Android / Chromium browser pre-43. + cat "src/polyfills/symbol-es6.min.js" || builder_die # Needed for Android / Chromium browser pre-43. echo "" - cat "${js}" || die + cat "${js}" || builder_die printf "\n}\n" echo "// --END:LMLlayerWorkerCode" } @@ -78,12 +78,12 @@ wrap-worker-code ( ) { builder_describe \ "Compiles the Language Modeling Layer for common use in predictive text and autocorrective applications." \ - "@../keyman-version" \ + "@/common/web/keyman-version" \ configure clean build test builder_describe_outputs \ configure /node_modules \ - build build/index.js + build /common/web/lm-worker/build/index.js builder_parse "$@" @@ -113,20 +113,20 @@ if builder_start_action build; then fi # Build worker with tsc first - npm run build -- $builder_verbose || fail "Could not build worker." + tsc -b $builder_verbose || builder_die "Could not build worker." # Wrap the worker code and create embedded index.js. Must be run after the # worker is built echo "Wrapping worker in function LMLayerWorkerCode ${WORKER_OUTPUT_FILENAME}" # Note: We use intermediate.js for unit tests in predictive-text cp "${WORKER_OUTPUT_FILENAME}" "${WORKER_OUTPUT}/intermediate.js" - wrap-worker-code LMLayerWorkerCode "${WORKER_OUTPUT}/intermediate.js" > "${WORKER_OUTPUT_FILENAME}" || die - cp "${WORKER_OUTPUT_FILENAME}" "${WORKER_TEST_BUNDLE_TARGET_FILENAME}" || die + wrap-worker-code LMLayerWorkerCode "${WORKER_OUTPUT}/intermediate.js" > "${WORKER_OUTPUT_FILENAME}" || builder_die + cp "${WORKER_OUTPUT_FILENAME}" "${WORKER_TEST_BUNDLE_TARGET_FILENAME}" || builder_die builder_finish_action success build fi if builder_start_action test; then - npm test || fail "Tests failed" + npm test || builder_die "Tests failed" builder_finish_action success test fi diff --git a/common/web/lm-worker/package.json b/common/web/lm-worker/package.json index d7a3a1bfd31ad74092f40d97ea121d4f94e95be5..a25290d5d3a3b42bbbd9b4cb0cecb25c9a283587 100644 --- a/common/web/lm-worker/package.json +++ b/common/web/lm-worker/package.json @@ -32,8 +32,8 @@ "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", "sinon": "^7.1.1", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" }, "dependencies": { "@keymanapp/models-templates": "*", diff --git a/common/web/recorder/build.sh b/common/web/recorder/build.sh index fb566a18c8c5ab92eb9ed1973068e181275c39b2..b9e578e05476a529c290f1d5bb43080b0357d35f 100755 --- a/common/web/recorder/build.sh +++ b/common/web/recorder/build.sh @@ -8,8 +8,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" @@ -19,7 +19,7 @@ THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BA builder_describe \ "Compiles the web-oriented utility function module." \ - "@../keyman-version" \ + "@/common/web/keyman-version" \ configure \ clean \ build \ @@ -30,8 +30,8 @@ builder_describe_outputs \ configure "/node_modules" \ configure:module "/node_modules" \ configure:proctor "/node_modules" \ - build:module "build/index.js" \ - build:proctor "build/nodeProctor/index.js" + build:module "/common/web/recorder/build/index.js" \ + build:proctor "/common/web/recorder/build/nodeProctor/index.js" builder_parse "$@" @@ -41,21 +41,21 @@ if builder_start_action configure; then fi if builder_start_action clean:module; then - npm run tsc -- -b --clean "$THIS_SCRIPT_PATH/src/tsconfig.json" + tsc -b --clean "$THIS_SCRIPT_PATH/src/tsconfig.json" builder_finish_action success clean:module fi if builder_start_action clean:proctor; then - npm run tsc -- -b --clean "$THIS_SCRIPT_PATH/src/nodeProctor.tsconfig.json" + tsc -b --clean "$THIS_SCRIPT_PATH/src/nodeProctor.tsconfig.json" builder_finish_action success clean:proctor fi if builder_start_action build:module; then - npm run tsc -- --build "$THIS_SCRIPT_PATH/src/tsconfig.json" + tsc --build "$THIS_SCRIPT_PATH/src/tsconfig.json" builder_finish_action success build:module fi if builder_start_action build:proctor; then - npm run tsc -- --build "$THIS_SCRIPT_PATH/src/nodeProctor.tsconfig.json" + tsc --build "$THIS_SCRIPT_PATH/src/nodeProctor.tsconfig.json" builder_finish_action success build:proctor fi \ No newline at end of file diff --git a/common/web/recorder/package.json b/common/web/recorder/package.json index fe645fb57b5cd01c2a974b88c095a19ec60dc8cb..ecc8c438188c73208ebd5e4185bbc3ee48f1a5b6 100644 --- a/common/web/recorder/package.json +++ b/common/web/recorder/package.json @@ -24,6 +24,6 @@ "@types/node": "^11.9.4" }, "devDependencies": { - "typescript": "^4.5.4" + "typescript": "^4.9.5" } } diff --git a/common/web/sentry-manager/package.json b/common/web/sentry-manager/package.json index 2170a6a06c32f059cb05b1de722774667c47dfed..dd3ccdbaba71e97972cee23175dcb9b4d13e84d3 100644 --- a/common/web/sentry-manager/package.json +++ b/common/web/sentry-manager/package.json @@ -16,7 +16,7 @@ }, "homepage": "https://github.com/keymanapp/keyman#readme", "devDependencies": { - "typescript": "^4.5.4" + "typescript": "^4.9.5" }, "dependencies": { "@keymanapp/keyman-version": "*", diff --git a/common/web/sentry-manager/src/build.sh b/common/web/sentry-manager/src/build.sh index 7b67ead74708cf4326f2434e4cd99f3114945dd6..7f3775702ddf6312bd482c73594cb2501d2f825f 100755 --- a/common/web/sentry-manager/src/build.sh +++ b/common/web/sentry-manager/src/build.sh @@ -6,8 +6,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" @@ -44,10 +44,10 @@ done if [ $FETCH_DEPS = true ]; then verify_npm_setup # We need to build keyman-version with a script for now - "$KEYMAN_ROOT/common/web/keyman-version/build.sh" || fail "Could not build keyman-version" + "$KEYMAN_ROOT/common/web/keyman-version/build.sh" || builder_die "Could not build keyman-version" fi -npm run tsc -- --build "$THIS_SCRIPT_PATH/tsconfig.json" +tsc --build "$THIS_SCRIPT_PATH/tsconfig.json" if [ $? -ne 0 ]; then - fail "Compilation of package for Sentry integration with KeymanWeb failed." + builder_die "Compilation of package for Sentry integration with KeymanWeb failed." fi \ No newline at end of file diff --git a/common/web/types/.eslintrc.cjs b/common/web/types/.eslintrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..21618ea66ffe4d7d61edbe0b49aa076b60927417 --- /dev/null +++ b/common/web/types/.eslintrc.cjs @@ -0,0 +1,21 @@ +module.exports = { + parserOptions: { + project: ["./tsconfig.json", "./test/tsconfig.json"], + }, + ignorePatterns: [ + ".*/*", + "build/*", + "coverage/*", + "node_modules/*", + "test/fixtures/*", + ], + overrides: [ + { + files: "src/**/*.ts", + extends: ["../../../common/web/eslint/eslintNoNodeImports.js"], + }, + ], + rules: { + "prefer-const": "off", // TODO: enable this once infrastructure is in place and cleanup the problem cases + }, +}; diff --git a/common/web/types/build.sh b/common/web/types/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..eb983acec8514b873792f8ae4661b8b27c260470 --- /dev/null +++ b/common/web/types/build.sh @@ -0,0 +1,97 @@ +#!/usr/bin/env bash +# +# Compiles the common file types module +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +cd "$THIS_SCRIPT_PATH" + +builder_describe "Build Keyman common file types module" \ + "@/common/web/keyman-version" \ + "configure" \ + "build" \ + "clean" \ + "test" \ + "pack build a local .tgz pack for testing" \ + "publish publish to npm" \ + "--dry-run,-n don't actually publish, just dry run" +builder_describe_outputs \ + configure /node_modules \ + build /common/web/types/build/src/main.js + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action clean; then + rm -rf ./build/ ./tsconfig.tsbuildinfo + builder_finish_action success clean +fi + +function copy_schemas() { + # We need the schema files at runtime and bundled, so always copy it for all actions except `clean` + mkdir -p "$THIS_SCRIPT_PATH/build/src/" + cp "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json" "$THIS_SCRIPT_PATH/build/src/" + cp "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest.schema.json" "$THIS_SCRIPT_PATH/build/src/" + cp "$KEYMAN_ROOT/common/schemas/kvks/kvks.schema.json" "$THIS_SCRIPT_PATH/build/src/" + cp "$KEYMAN_ROOT/common/schemas/kpj/kpj.schema.json" "$THIS_SCRIPT_PATH/build/src/" + cp "$KEYMAN_ROOT/common/schemas/keyman-touch-layout/keyman-touch-layout.clean.spec.json" "$THIS_SCRIPT_PATH/build/src/" + # Store CLDR imports + # load all versions that have a cldr_info.json + for CLDR_INFO_PATH in "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/"*/cldr_info.json + do + # TODO-LDML: developer/src/inst/download.in.mak needs these also... + CLDR_PATH=$(dirname "$CLDR_INFO_PATH") + CLDR_VER=$(basename "$CLDR_PATH") + mkdir -p "$THIS_SCRIPT_PATH/build/src/import/$CLDR_VER" + # TODO-LDML: When these are copied, the DOCTYPE will break due to the wrong path. We don't use the DTD so it should be OK. + cp "$CLDR_INFO_PATH" "$CLDR_PATH/import/"*.xml "$THIS_SCRIPT_PATH/build/src/import/$CLDR_VER/" + done +} + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action configure; then + verify_npm_setup + builder_finish_action success configure +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action build; then + copy_schemas + npm run build + builder_finish_action success build +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action test; then + copy_schemas + npm test + builder_finish_action success test +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action publish; then + copy_schemas + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_npm + builder_finish_action success publish +elif builder_start_action pack; then + copy_schemas + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_pack + builder_finish_action success pack +fi diff --git a/common/web/types/package.json b/common/web/types/package.json new file mode 100644 index 0000000000000000000000000000000000000000..4cff8739a584ae8cd5c583b248a8b109a6bca330 --- /dev/null +++ b/common/web/types/package.json @@ -0,0 +1,61 @@ +{ + "name": "@keymanapp/common-types", + "description": "Keyman Developer keyboard file types", + "keywords": [ + "keyboard", + "keyman", + "ldml", + "unicode" + ], + "type": "module", + "exports": { + ".": "./build/src/main.js" + }, + "files": [ + "/build/src/" + ], + "scripts": { + "build": "tsc -b", + "lint": "eslint .", + "test": "npm run lint && cd test && tsc -b && cd .. && c8 --skip-full --reporter=lcov --reporter=text mocha", + "prepublishOnly": "npm run build" + }, + "author": "Marc Durdin (https://github.com/mcdurdin)", + "license": "MIT", + "bugs": { + "url": "https://github.com/keymanapp/keyman/issues" + }, + "dependencies": { + "@keymanapp/keyman-version": "*", + "ajv": "^8.11.0", + "restructure": "git+https://github.com/keymanapp/dependency-restructure.git#49d129cf0916d082a7278bb09296fb89cecfcc50", + "semver": "^7.3.7", + "xml2js": "git+https://github.com/keymanapp/dependency-node-xml2js#535fe732dc408d697e0f847c944cc45f0baf0829" + }, + "devDependencies": { + "@types/chai": "^4.1.7", + "@types/git-diff": "^2.0.3", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/semver": "^7.3.12", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "git-diff": "^2.0.6", + "hexy": "^0.3.4", + "mocha": "^8.4.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" + }, + "mocha": { + "spec": "build/test/**/test-*.js", + "require": [ + "source-map-support/register" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/keymanapp/keyman.git" + } +} diff --git a/common/web/types/src/consts/virtual-key-constants.ts b/common/web/types/src/consts/virtual-key-constants.ts new file mode 100644 index 0000000000000000000000000000000000000000..b14023f9cd2ec1b8119603cae59eedc3fef73616 --- /dev/null +++ b/common/web/types/src/consts/virtual-key-constants.ts @@ -0,0 +1,264 @@ + +// Define standard keycode numbers (exposed for use by other modules) +// TODO-LDML: merge with common\web\keyboard-processor\src\text\codes.ts + +/** + * May include non-US virtual key codes + */ +export const USVirtualKeyCodes = { + K_BKSP:8, + K_TAB:9, + K_ENTER:13, + K_SHIFT:16, + K_CONTROL:17, + K_ALT:18, + K_PAUSE:19, + K_CAPS:20, + K_ESC:27, + K_SPACE:32, + K_PGUP:33, + K_PGDN:34, + K_END:35, + K_HOME:36, + K_LEFT:37, + K_UP:38, + K_RIGHT:39, + K_DOWN:40, + K_SEL:41, + K_PRINT:42, + K_EXEC:43, + K_INS:45, + K_DEL:46, + K_HELP:47, + K_0:48, + K_1:49, + K_2:50, + K_3:51, + K_4:52, + K_5:53, + K_6:54, + K_7:55, + K_8:56, + K_9:57, + K_A:65, + K_B:66, + K_C:67, + K_D:68, + K_E:69, + K_F:70, + K_G:71, + K_H:72, + K_I:73, + K_J:74, + K_K:75, + K_L:76, + K_M:77, + K_N:78, + K_O:79, + K_P:80, + K_Q:81, + K_R:82, + K_S:83, + K_T:84, + K_U:85, + K_V:86, + K_W:87, + K_X:88, + K_Y:89, + K_Z:90, + K_NP0:96, + K_NP1:97, + K_NP2:98, + K_NP3:99, + K_NP4:100, + K_NP5:101, + K_NP6:102, + K_NP7:103, + K_NP8:104, + K_NP9:105, + K_NPSTAR:106, + K_NPPLUS:107, + K_SEPARATOR:108, + K_NPMINUS:109, + K_NPDOT:110, + K_NPSLASH:111, + K_F1:112, + K_F2:113, + K_F3:114, + K_F4:115, + K_F5:116, + K_F6:117, + K_F7:118, + K_F8:119, + K_F9:120, + K_F10:121, + K_F11:122, + K_F12:123, + K_NUMLOCK:144, + K_SCROLL:145, + K_LSHIFT:160, + K_RSHIFT:161, + K_LCONTROL:162, + K_RCONTROL:163, + K_LALT:164, + K_RALT:165, + K_COLON:186, + K_EQUAL:187, + K_COMMA:188, + K_HYPHEN:189, + K_PERIOD:190, + K_SLASH:191, + K_BKQUOTE:192, + K_LBRKT:219, + /** + * == K_OEM_5, 0xDC + */ + K_BKSLASH:220, + K_RBRKT:221, + K_QUOTE:222, + /** + * ISO B00, key to right of left shift, not on US keyboard, + * 0xE2, K_OEM_102 + */ + K_oE2:226, + K_OE2:226, + k_oC1:193, // ISO B11, ABNT-2 key to left of right shift, not on US keyboard + k_OC1:193, + /*K_LOPT:50001, + K_ROPT:50002, + K_NUMERALS:50003, + K_SYMBOLS:50004, + K_CURRENCIES:50005, + K_UPPER:50006, + K_LOWER:50007, + K_ALPHA:50008, + K_SHIFTED:50009, + K_ALTGR:50010, + K_TABBACK:50011, + K_TABFWD:50012*/ +}; + +const k = USVirtualKeyCodes; + +export type KeyMap = number[][]; + +export const USVirtualKeyMap: KeyMap = [ + // ` 1 2 3 4 5 6 7 8 9 0 - = [bksp] + [ k.K_BKQUOTE, k.K_1, k.K_2, k.K_3, k.K_4, k.K_5, k.K_6, k.K_7, k.K_8, k.K_9, k.K_0, k.K_HYPHEN, k.K_EQUAL ], + // [tab] Q W E R T Y U I O P [ ] \ + [ k.K_Q, k.K_W, k.K_E, k.K_R, k.K_T, k.K_Y, k.K_U, k.K_I, k.K_O, k.K_P, k.K_LBRKT, k.K_RBRKT, k.K_BKSLASH ], + // [caps] A S D F G H J K L ; ' [enter] + [ k.K_A, k.K_S, k.K_D, k.K_F, k.K_G, k.K_H, k.K_J, k.K_K, k.K_L, k.K_COLON, k.K_QUOTE ], + // [shift] Z X C V B N M , . / [shift] *=oE2 + [ k.K_Z, k.K_X, k.K_C, k.K_V, k.K_B, k.K_N, k.K_M, k.K_COMMA, k.K_PERIOD, k.K_SLASH ], + // space + [ k.K_SPACE ], +]; + +export const ISOVirtualKeyMap: KeyMap = [ + // ` 1 2 3 4 5 6 7 8 9 0 - = [bksp] + [ k.K_BKQUOTE, k.K_1, k.K_2, k.K_3, k.K_4, k.K_5, k.K_6, k.K_7, k.K_8, k.K_9, k.K_0, k.K_HYPHEN, k.K_EQUAL ], + // [tab] Q W E R T Y U I O P [ ] + [ k.K_Q, k.K_W, k.K_E, k.K_R, k.K_T, k.K_Y, k.K_U, k.K_I, k.K_O, k.K_P, k.K_LBRKT, k.K_RBRKT ], + // [caps] A S D F G H J K L ; ' \ [enter] + [ k.K_A, k.K_S, k.K_D, k.K_F, k.K_G, k.K_H, k.K_J, k.K_K, k.K_L, k.K_COLON, k.K_QUOTE, k.K_BKSLASH ], + // [shift] * Z X C V B N M , . / [shift] *=oE2 + [ k.K_oE2, k.K_Z, k.K_X, k.K_C, k.K_V, k.K_B, k.K_N, k.K_M, k.K_COMMA, k.K_PERIOD, k.K_SLASH ], + // space + [ k.K_SPACE ], +]; + +export const JISVirtualKeyMap: KeyMap = [ + // [Hankaku/Zenkaku] 1 2 3 4 5 6 7 8 9 0 - ^ ¥ [bksp] + [ k.K_1, k.K_2, k.K_3, k.K_4, k.K_5, k.K_6, k.K_7, k.K_8, k.K_9, k.K_0, k.K_HYPHEN, k.K_EQUAL, k.K_BKSLASH /* YEN */ ], + // [tab] Q W E R T Y U I O P @«`» [ [enter] + [ k.K_Q, k.K_W, k.K_E, k.K_R, k.K_T, k.K_Y, k.K_U, k.K_I, k.K_O, k.K_P, k.K_BKQUOTE, k.K_LBRKT ], + // [caps] A S D F G H J K L ; : ] [enter] + [ k.K_A, k.K_S, k.K_D, k.K_F, k.K_G, k.K_H, k.K_J, k.K_K, k.K_L, k.K_COLON, k.K_QUOTE, k.K_RBRKT ], + // [shift] Z X C V B N M , . / _ [shift] + [ k.K_Z, k.K_X, k.K_C, k.K_V, k.K_B, k.K_N, k.K_M, k.K_COMMA, k.K_PERIOD, k.K_SLASH, k.K_oE2 /* ろ */ ], + // space + [ k.K_SPACE ], +]; + +export const ABNT2VirtualKeyMap: KeyMap = [ + // ' 1 2 3 4 5 6 7 8 9 0 - = [bksp] + [ k.K_BKQUOTE, k.K_1, k.K_2, k.K_3, k.K_4, k.K_5, k.K_6, k.K_7, k.K_8, k.K_9, k.K_0, k.K_HYPHEN, k.K_EQUAL ], + // [tab] Q W E R T Y U I O P ´ [ + [ k.K_Q, k.K_W, k.K_E, k.K_R, k.K_T, k.K_Y, k.K_U, k.K_I, k.K_O, k.K_P, k.K_LBRKT, k.K_RBRKT ], + // [caps] A S D F G H J K L ç ~ ] [enter] + [ k.K_A, k.K_S, k.K_D, k.K_F, k.K_G, k.K_H, k.K_J, k.K_K, k.K_L, k.K_COLON, k.K_QUOTE, k.K_BKSLASH ], + // [shift] \ Z X C V B N M , . ; / [shift] + [ k.K_oE2, k.K_Z, k.K_X, k.K_C, k.K_V, k.K_B, k.K_N, k.K_M, k.K_COMMA, k.K_PERIOD, k.K_SLASH, k.k_oC1 /* ABNT2 */ ], + // space + [ k.K_SPACE ], +]; + +/** + * Map from a hardware constant to a keymap + * For the 'key' see constants.layr_list_hardware_map + */ +export const HardwareToKeymap: Map = new Map( + [ + ["us", USVirtualKeyMap], + ["iso", ISOVirtualKeyMap], + ["jis", JISVirtualKeyMap], + ["abnt2", ABNT2VirtualKeyMap], + ] +); + +/** + * Maps LDML VKey Names from CLDR VKey Enum in TR35 to Keyman virtual key codes + */ +export const LdmlVkeyNames: Record = { + 'SPACE': k.K_SPACE, // 0x20, // A03 + '0': k.K_0, // 0x30, // E10 + '1': k.K_1, // 0x31, // E01 + '2': k.K_2, // 0x32, // E02 + '3': k.K_3, // 0x33, // E03 + '4': k.K_4, // 0x34, // E04 + '5': k.K_5, // 0x35, // E05 + '6': k.K_6, // 0x36, // E06 + '7': k.K_7, // 0x37, // E07 + '8': k.K_8, // 0x38, // E08 + '9': k.K_9, // 0x39, // E09 + 'A': k.K_A, // 0x41, // C01 + 'B': k.K_B, // 0x42, // B05 + 'C': k.K_C, // 0x43, // B03 + 'D': k.K_D, // 0x44, // C03 + 'E': k.K_E, // 0x45, // D03 + 'F': k.K_F, // 0x46, // C04 + 'G': k.K_G, // 0x47, // C05 + 'H': k.K_H, // 0x48, // C06 + 'I': k.K_I, // 0x49, // D08 + 'J': k.K_J, // 0x4A, // C07 + 'K': k.K_K, // 0x4B, // C08 + 'L': k.K_L, // 0x4C, // C09 + 'M': k.K_M, // 0x4D, // B07 + 'N': k.K_N, // 0x4E, // B06 + 'O': k.K_O, // 0x4F, // D09 + 'P': k.K_P, // 0x50, // D10 + 'Q': k.K_Q, // 0x51, // D01 + 'R': k.K_R, // 0x52, // D04 + 'S': k.K_S, // 0x53, // C02 + 'T': k.K_T, // 0x54, // D05 + 'U': k.K_U, // 0x55, // D07 + 'V': k.K_V, // 0x56, // B05 + 'W': k.K_W, // 0x57, // D02 + 'X': k.K_X, // 0x58, // B02 + 'Y': k.K_Y, // 0x59, // D06 + 'Z': k.K_Z, // 0x5A, // B01 + 'SEMICOLON': k.K_COLON, // 0xBA, // C10 + 'EQUAL': k.K_EQUAL, // 0xBB, // E12 + 'COMMA': k.K_COMMA, // 0xBC, // B08 + 'HYPHEN': k.K_HYPHEN, // 0xBD, // E11 + 'PERIOD': k.K_PERIOD, // 0xBE, // B09 + 'SLASH': k.K_SLASH, // 0xBF, // B10 + 'GRAVE': k.K_BKQUOTE, // 0xC0, // E00 + 'LBRACKET': k.K_LBRKT, // 0xDB, // D11 + 'BACKSLASH': k.K_BKSLASH, // 0xDC, // D13 + 'RBRACKET': k.K_RBRKT, // 0xDD, // D12 + 'QUOTE': k.K_QUOTE, // 0xDE, // C11 + 'LESS-THAN': k.K_oE2, // 0xE2, // B00 102nd key on European layouts, right of left shift. + 'ABNT2': k.k_oC1, // 0xC1, // B11 Extra key, left of right-shift, ABNT2 +}; diff --git a/common/web/types/src/keyman-touch-layout/keyman-touch-layout-file-reader.ts b/common/web/types/src/keyman-touch-layout/keyman-touch-layout-file-reader.ts new file mode 100644 index 0000000000000000000000000000000000000000..f4c5e757bff15b06a5b94a545634af90992af50a --- /dev/null +++ b/common/web/types/src/keyman-touch-layout/keyman-touch-layout-file-reader.ts @@ -0,0 +1,81 @@ +import { default as AjvModule } from 'ajv'; +const Ajv = AjvModule.default; // The actual expected Ajv type. +import { TouchLayoutFile } from "./keyman-touch-layout-file.js"; + +export class TouchLayoutFileReader { + public read(source: Uint8Array): TouchLayoutFile { + const decoder = new TextDecoder('utf-8', {fatal:true, ignoreBOM: true}); + let sourceString: string; + try { + sourceString = decoder.decode(source); + /* c8 ignore next 7 */ + } catch(e) { + if(e instanceof TypeError) { + // TODO: Do we want to do something else with this? + throw e; + } + throw e; + } + + let result: TouchLayoutFile; + try { + result = JSON.parse(sourceString, function(key, value) { + // `row.id` should be number, but may have been stringified; we use + // presence of `key` property to recognise this as a `TouchLayoutRow`. + if(this.key && key == 'id' && typeof value == 'string') { + let newValue = parseInt(value, 10); + /* c8 ignore next 3 */ + if(isNaN(newValue)) { + throw new TypeError(`Invalid row.id: "${value}"`); + } + return newValue; + } + + // `key.width`, `key.pad`, `key.sp` should be number, but may have been + // stringified + if(key == 'width' || key == 'pad' || key == 'sp') { + if(value === '') { + // Empty string is equivalent to not present, so fall back to + // default value + return undefined; + } + + let newValue = parseInt(value, 10); + /* c8 ignore next 3 */ + if(isNaN(newValue)) { + throw new TypeError(`Invalid [sub]key.${key}: "${value}"`); + } + return newValue; + } + + if(Array.isArray(value) && value.length == 0) { + // Delete empty arrays + return undefined; + } + + return value; + }); + /* c8 ignore next 7 */ + } catch(e) { + if(e instanceof SyntaxError) { + // TODO: Do we want to do something else with this? + throw e; + } + throw e; + } + + return result; + } + + public validate(source: TouchLayoutFile, schemaBuffer: Buffer): void { + const schema = JSON.parse(schemaBuffer.toString('utf8')); + const ajv = new Ajv(); + if(!ajv.validate(schema, source)) + /* c8 ignore next 3 */ + { + throw new Error(ajv.errorsText()); + } + } + + +}; \ No newline at end of file diff --git a/common/web/types/src/keyman-touch-layout/keyman-touch-layout-file-writer.ts b/common/web/types/src/keyman-touch-layout/keyman-touch-layout-file-writer.ts new file mode 100644 index 0000000000000000000000000000000000000000..a86ed0441f71a189e2bfa4254f5aed26513f8280 --- /dev/null +++ b/common/web/types/src/keyman-touch-layout/keyman-touch-layout-file-writer.ts @@ -0,0 +1,84 @@ +import { TouchLayoutFile, TouchLayoutPlatform, TouchLayoutKey, TouchLayoutSubKey } from "./keyman-touch-layout-file.js"; + +export interface TouchLayoutFileWriterOptions { + formatted?: boolean; +}; + +export class TouchLayoutFileWriter { + + options: TouchLayoutFileWriterOptions; + + constructor(options?: TouchLayoutFileWriterOptions) { + this.options = {...options}; + } + + /** + * Writes the touch layout to a .keyman-touch-layout JSON file + * @param source TouchLayoutFile + * @returns Uint8Array, the .keyman-touch-layout file + */ + write(source: TouchLayoutFile): Uint8Array { + const output = JSON.stringify(source, null, this.options?.formatted ? 2 : undefined); + const encoder = new TextEncoder(); + return encoder.encode(output); + } + + /** + * Compiles the touch layout file into a KeymanWeb-compatible JSON-style + * object string. In the future, this may be optimized to remove unnecessary + * quoting of property names, and remove unused properties, as this string + * is embedded into .js code. + * @param source + * @returns string + */ + compile(source: TouchLayoutFile): string { + // Deep copy the source + source = JSON.parse(JSON.stringify(source)); + + // Fixup pad, width and sp to string types, as that's what KeymanWeb + // currently expects + + const fixupKey = (key: TouchLayoutKey | TouchLayoutSubKey) => { + if(Object.hasOwn(key, 'pad')) (key.pad as any) = key.pad.toString(); + if(Object.hasOwn(key, 'sp')) (key.sp as any) = key.sp.toString(); + if(Object.hasOwn(key, 'width')) (key.width as any) = key.width.toString(); + }; + + const fixupPlatform = (platform: TouchLayoutPlatform) => { + for(let layer of platform.layer) { + for(let row of layer.row) { + for(let key of row.key) { + fixupKey(key); + if(key.sk) { + for(let sk of key.sk) { + fixupKey(sk); + } + } + if(key.multitap) { + for(let sk of key.multitap) { + fixupKey(sk); + } + } + if(key.flick) { + for(let id of Object.keys(key.flick)) { + fixupKey((key.flick as any)[id] as TouchLayoutSubKey); + } + } + } + } + } + }; + + if(source.desktop) { + fixupPlatform(source.desktop); + } + if(source.phone) { + fixupPlatform(source.phone); + } + if(source.tablet) { + fixupPlatform(source.tablet); + } + + return JSON.stringify(source, null, this.options?.formatted ? 2 : undefined); + } +}; \ No newline at end of file diff --git a/common/web/types/src/keyman-touch-layout/keyman-touch-layout-file.ts b/common/web/types/src/keyman-touch-layout/keyman-touch-layout-file.ts new file mode 100644 index 0000000000000000000000000000000000000000..564bc12b6ee61cfbf7a74f8c70ee1110890d24b6 --- /dev/null +++ b/common/web/types/src/keyman-touch-layout/keyman-touch-layout-file.ts @@ -0,0 +1,87 @@ +// +// .keyman-touch-layout JSON format +// +// Follows /common/schemas/keyman-touch-layout/keyman-touch-layout.spec.json for +// reading and +// /common/schemas/keyman-touch-layout/keyman-touch-layout.clean.spec.json for +// writing +// + +export interface TouchLayoutFile { + tablet?: TouchLayoutPlatform; + phone?: TouchLayoutPlatform; + desktop?: TouchLayoutPlatform; +}; + +export type TouchLayoutFont = string; +export type TouchLayoutFontSize = string; +export type TouchLayoutDefaultHint = "none"|"dot"|"longpress"|"multitap"|"flick"|"flick-n"|"flick-ne"|"flick-e"|"flick-se"|"flick-s"|"flick-sw"|"flick-w"|"flick-nw"; + +export interface TouchLayoutPlatform { + font?: TouchLayoutFont; + fontsize?: TouchLayoutFontSize; + layer: TouchLayoutLayer[]; + displayUnderlying?: boolean; + defaultHint: TouchLayoutDefaultHint; +}; + +export type TouchLayoutLayerId = string; // pattern = /^[a-zA-Z0-9_-]+$/ + +export interface TouchLayoutLayer { + id: TouchLayoutLayerId; + row: TouchLayoutRow[]; +}; + +export type TouchLayoutRowId = number; + +export interface TouchLayoutRow { + id: TouchLayoutRowId; + key: TouchLayoutKey[]; +}; + +type Key_Type = 'T'|'K'|'U'|'t'|'k'|'u'; +type Key_Id = string; +export type TouchLayoutKeyId = `${Key_Type}_${Key_Id}`; // pattern = /^[TKUtku]_[a-zA-Z0-9_]+$/ + +export interface TouchLayoutKey { + id?: TouchLayoutKeyId; + text?: string; + layer?: TouchLayoutLayerId; + nextlayer?: TouchLayoutLayerId; + font?: TouchLayoutFont; + fontsize?: TouchLayoutFontSize; + sp?: TouchLayoutKeySp; + pad?: TouchLayoutKeyPad; + width?: TouchLayoutKeyWidth; + sk?: TouchLayoutSubKey[]; + flick?: TouchLayoutFlick; + multitap?: TouchLayoutSubKey[]; + hint?: string; +}; + +export enum TouchLayoutKeySp { normal=0, special=1, specialActive=2, deadkey=8, blank=9, spacer=10 }; +export type TouchLayoutKeyPad = number; // 0-100000 +export type TouchLayoutKeyWidth = number; // 0-100000 + +export interface TouchLayoutSubKey { + id: TouchLayoutKeyId; + text?: string; + layer?: TouchLayoutLayerId; + nextlayer?: TouchLayoutLayerId; + font?: TouchLayoutFont; + fontsize?: TouchLayoutFontSize; + sp?: TouchLayoutKeySp; + pad?: TouchLayoutKeyPad; + width?: TouchLayoutKeyWidth; +}; + +export interface TouchLayoutFlick { + n?: TouchLayoutSubKey; + s?: TouchLayoutSubKey; + e?: TouchLayoutSubKey; + w?: TouchLayoutSubKey; + ne?: TouchLayoutSubKey; + nw?: TouchLayoutSubKey; + se?: TouchLayoutSubKey; + sw?: TouchLayoutSubKey; +}; diff --git a/common/web/types/src/kmx/element-string.ts b/common/web/types/src/kmx/element-string.ts new file mode 100644 index 0000000000000000000000000000000000000000..581ab683cd10bd15fc0f48d7a6dd30efd8c163f4 --- /dev/null +++ b/common/web/types/src/kmx/element-string.ts @@ -0,0 +1,79 @@ +import { constants } from '@keymanapp/ldml-keyboard-constants'; +import { Strs, StrsItem } from './kmx-plus.js'; + +export enum ElemElementFlags { + none = 0, + unicode_set = constants.elem_flags_unicode_set, + tertiary_base = constants.elem_flags_tertiary_base, + prebase = constants.elem_flags_prebase +} +; + +export class ElemElement { + value: StrsItem; // UnicodeSet or UCS32LE character + order: number; // -128 to +127; used only by reorder element values + tertiary: number; // -128 to +127; used only by reorder element values + flags: ElemElementFlags; + isEqual(a: ElemElement) { + return a.value === this.value && + a.order === this.order && + a.tertiary === this.tertiary && + a.flags === this.flags; + } +} +; + +export class ElementString extends Array { + constructor(strs: Strs, source: string, order?: string, tertiary?: string, tertiary_base?: string, prebase?: string) { + super(); + //TODO-LDML: full UnicodeSet and parsing + if(!source) { + return; + } + + let items = source.split(""); + + let orders: Array = order ? order.split(" ") : []; + if(orders.length == 1) { + orders = Array(items.length).fill(orders[0]); + } + + let tertiaries: Array = tertiary ? tertiary.split(" ") : []; + if(tertiaries.length == 1) { + tertiaries = Array(items.length).fill(tertiaries[0]); + } + + let tertiary_bases: Array = tertiary_base ? tertiary_base.split(" ") : []; + if(tertiary_bases.length == 1) { + tertiary_bases = Array(items.length).fill(tertiary_bases[0]); + } + + let prebases: Array = prebase ? prebase.split(" ") : []; + if(prebases.length == 1) { + prebases = Array(items.length).fill(prebases[0]); + } + + for(let i = 0; i < items.length; i++) { + let elem = new ElemElement(); + elem.value = strs.allocString(items[i]); + elem.order = orders.length ? parseInt(orders[i], 10) : 0; + elem.tertiary = tertiaries.length ? parseInt(tertiaries[i], 10) : 0; + elem.flags = ElemElementFlags.none | + (tertiary_bases?.[i] == '1' /* TODO-LDML: or 'true'? */ ? ElemElementFlags.tertiary_base : 0) | + (prebases?.[i] == '1' /* TODO-LDML: or 'true'? */ ? ElemElementFlags.prebase : 0); + this.push(elem); + }; + } + isEqual(a: ElementString): boolean { + if (a.length != this.length) { + return false; + } + for (let i = 0; i < a.length; i++) { + if (!this[i].isEqual(a[i])) { + return false; + } + } + return true; + } +} +; diff --git a/common/web/types/src/kmx/kmx-builder.ts b/common/web/types/src/kmx/kmx-builder.ts new file mode 100644 index 0000000000000000000000000000000000000000..d89c7ba33ce8aaf77772c2f840b5a9ac06fa67fe --- /dev/null +++ b/common/web/types/src/kmx/kmx-builder.ts @@ -0,0 +1,227 @@ +import * as r from 'restructure'; +import { KMXFile, GROUP, KEY, STORE, BUILDER_COMP_KEYBOARD, BUILDER_COMP_KEYBOARD_KMXPLUSINFO, BUILDER_COMP_STORE, BUILDER_COMP_GROUP, BUILDER_COMP_KEY } from './kmx.js'; +import { KMXPlusFile } from './kmx-plus.js'; +import KMXPlusBuilder from './kmx-plus-builder/kmx-plus-builder.js'; + +export default class KMXBuilder { + file: KMXFile; + base_keyboard: number = 0; + base_kmxplus: number = 0; + comp_header: BUILDER_COMP_KEYBOARD; + comp_kmxplus: BUILDER_COMP_KEYBOARD_KMXPLUSINFO; + comp_stores: {base: number, store: STORE, obj: BUILDER_COMP_STORE}[] = []; + comp_groups: {base: number, group: GROUP, obj: BUILDER_COMP_GROUP, keys: {base: number, key: KEY, obj: BUILDER_COMP_KEY}[]}[] = []; + comp_kmxplus_data: Uint8Array; + writeDebug: boolean = false; + + constructor(file: KMXFile, writeDebug: boolean) { + this.file = file; + this.writeDebug = writeDebug; + } + + calculateStringOffsetAndSize(string: string, base: number, requireString: boolean = false) { + if(string.length == 0 && !requireString) { + // Zero length strings take up no space in the file, and + // are treated as a 'null string' + return [0, base]; + } + return [base, base + string.length * 2 + 2]; // include trailing zero + } + + private build() { + this.base_keyboard = 0; + this.base_kmxplus = 0; + + // Header + + this.comp_header = { + dwIdentifier: KMXFile.FILEID_COMPILED, + dwFileVersion: KMXFile.VERSION_160, + dwCheckSum: 0, // Deprecated in Keyman 16.0 + KeyboardID: 0, + IsRegistered: 1, + version: 0, + cxStoreArray: 0, + cxGroupArray: 0, + dpStoreArray: 0, + dpGroupArray: 0, + StartGroup_ANSI: 0xFFFFFFFF, + StartGroup_Unicode: 0xFFFFFFFF, + dwFlags: 0, + dwHotKey: 0, + dpBitmapOffset: 0, + dwBitmapSize: 0 + }; + + let size = KMXFile.COMP_KEYBOARD_SIZE; + + if(this.file instanceof KMXPlusFile) { + // Reserve space for KMXPlus header; we'll come back and fill in details + // once we know base kmx file size. + this.comp_header.dwFlags |= KMXFile.KF_KMXPLUS; + this.base_kmxplus = size; + size += KMXFile.COMP_KEYBOARD_KMXPLUSINFO_SIZE; + } + + // Stores + + this.comp_header.cxStoreArray = this.file.keyboard.stores.length; + this.comp_header.dpStoreArray = this.comp_header.cxStoreArray ? size : 0; + let storeBase = size; + size += this.file.keyboard.stores.length * KMXFile.COMP_STORE_SIZE; + for(let store of this.file.keyboard.stores) { + let comp_store: BUILDER_COMP_STORE = { + dwSystemID: store.dwSystemID, + dpName: 0, + dpString: 0 + }; + this.comp_stores.push({base: storeBase, store: store, obj: comp_store}); + if(this.writeDebug /*TODO: || store.isOption*/) { + [comp_store.dpName, size] = this.calculateStringOffsetAndSize(store.dpName, size); + } + + [comp_store.dpString, size] = this.calculateStringOffsetAndSize(store.dpString, size); + storeBase += KMXFile.COMP_STORE_SIZE; + } + + // Groups + + this.comp_header.cxGroupArray = this.file.keyboard.groups.length; + this.comp_header.dpGroupArray = this.comp_header.cxGroupArray ? size : 0; + let groupBase = size; + size += this.file.keyboard.groups.length * KMXFile.COMP_GROUP_SIZE; + for(let group of this.file.keyboard.groups) { + let comp_group: BUILDER_COMP_GROUP = { + dpName: 0, + dpKeyArray: 0, + dpMatch: 0, + dpNoMatch: 0, + cxKeyArray: group.keys.length, + fUsingKeys: group.fUsingKeys ? 1 : 0 + }; + + let comp_keys: {base: number, key: KEY, obj: BUILDER_COMP_KEY}[] = []; + + this.comp_groups.push({base: groupBase, group: group, obj: comp_group, keys: comp_keys}); + + if(this.writeDebug) { + [comp_group.dpName, size] = this.calculateStringOffsetAndSize(group.dpName, size); + } + [comp_group.dpMatch, size] = this.calculateStringOffsetAndSize(group.dpMatch, size); + [comp_group.dpNoMatch, size] = this.calculateStringOffsetAndSize(group.dpNoMatch, size); + + // Keys within a group + + comp_group.dpKeyArray = group.keys.length ? size : 0; + + let keyBase = size; + size += group.keys.length * KMXFile.COMP_KEY_SIZE; + for(let key of group.keys) { + let comp_key: BUILDER_COMP_KEY = { + Key: key.Key, + _padding: 0, + Line: key.Line, + ShiftFlags: key.ShiftFlags, + dpOutput: 0, + dpContext: 0 + }; + comp_keys.push({base: keyBase, key: key, obj: comp_key}); + [comp_key.dpOutput, size] = this.calculateStringOffsetAndSize(key.dpOutput, size, true); + [comp_key.dpContext, size] = this.calculateStringOffsetAndSize(key.dpContext, size, true); + keyBase += KMXFile.COMP_KEY_SIZE; + } + + groupBase += KMXFile.COMP_GROUP_SIZE; + } + + size += this.buildBitmap(); + size += this.buildKMXPlus(size); + + return size; + } + + buildBitmap() { + // TODO + return 0; + } + + buildKMXPlus(base: number) { + if(!(this.file instanceof KMXPlusFile)) { + return 0; + } + + const plusbuilder: KMXPlusBuilder = new KMXPlusBuilder(this.file, this.writeDebug); + this.comp_kmxplus_data = plusbuilder.compile(); + this.comp_kmxplus = { + dpKMXPlus: base, + dwKMXPlusSize: this.comp_kmxplus_data.length + }; + + return this.comp_kmxplus.dwKMXPlusSize; + } + + setString(file: Uint8Array, pos: number, str: string, requireString: boolean = false): void { + if(requireString && !str.length) { + // Just write zero terminator, as r.String for a zero-length string + // seems to fail. + let sbuf = r.uint16le; + file.set(sbuf.toBuffer(0), pos); + } + else if(pos && str.length) { + let sbuf = new r.String(null, 'utf16le'); // null-terminated string + file.set(sbuf.toBuffer(str), pos); + } + } + + compile(): Uint8Array { + const fileSize = this.build(); + + let file: Uint8Array = new Uint8Array(fileSize); + + // Write headers + + const header = this.file.COMP_KEYBOARD.toBuffer(this.comp_header); + file.set(header, this.base_keyboard); + + if(this.file instanceof KMXPlusFile) { + const kmxplus: Uint8Array = this.file.COMP_KEYBOARD_KMXPLUSINFO.toBuffer(this.comp_kmxplus); + file.set(kmxplus, this.base_kmxplus); + } + + // Write store array and data + + for(let store of this.comp_stores) { + file.set(this.file.COMP_STORE.toBuffer(store.obj), store.base); + if(this.writeDebug) { + this.setString(file, store.obj.dpName, store.store.dpName); + } + this.setString(file, store.obj.dpString, store.store.dpString); + } + + // Write group array and data + + for(let group of this.comp_groups) { + file.set(this.file.COMP_GROUP.toBuffer(group.obj), group.base); + if(this.writeDebug) { + this.setString(file, group.obj.dpName, group.group.dpName); + } + this.setString(file, group.obj.dpMatch, group.group.dpMatch); + this.setString(file, group.obj.dpNoMatch, group.group.dpNoMatch); + + for(let key of group.keys) { + file.set(this.file.COMP_KEY.toBuffer(key.obj), key.base); + // for back-compat reasons, these are never NULL strings + this.setString(file, key.obj.dpContext, key.key.dpContext, true); + this.setString(file, key.obj.dpOutput, key.key.dpOutput, true); + } + } + + // Write KMXPlus data stream + + if(this.file instanceof KMXPlusFile) { + file.set(this.comp_kmxplus_data, this.comp_kmxplus.dpKMXPlus); + } + + return file; + } +} \ No newline at end of file diff --git a/common/web/types/src/kmx/kmx-file-reader.ts b/common/web/types/src/kmx/kmx-file-reader.ts new file mode 100644 index 0000000000000000000000000000000000000000..46cfc8eb3926288329b739cb9f831af55c4328a9 --- /dev/null +++ b/common/web/types/src/kmx/kmx-file-reader.ts @@ -0,0 +1,44 @@ +import { KMXFile, BUILDER_COMP_KEYBOARD, KEYBOARD, STORE } from "./kmx.js"; +import * as r from 'restructure'; + +export class KmxFileReader { + private readonly rString = new r.String(null, 'utf16le'); + + private readString(source: Uint8Array, offset: number): string { + if(offset == 0) { + // the file has a null string here, which is not the same as an empty + // string ('') + return null; + } + return this.rString.fromBuffer(source.slice(offset)); + } + + public read(source: Uint8Array): KEYBOARD { + let binaryKeyboard: BUILDER_COMP_KEYBOARD; + let kmx = new KMXFile(); + binaryKeyboard = kmx.COMP_KEYBOARD.fromBuffer(source); + if(binaryKeyboard.dwIdentifier != KMXFile.FILEID_COMPILED) { + return null; + } + + // TODO: all header fields + + let result = new KEYBOARD(); + let offset = binaryKeyboard.dpStoreArray; + for(let i = 0; i < binaryKeyboard.cxStoreArray; i++) { + let binaryStore = kmx.COMP_STORE.fromBuffer(source.slice(offset)); + let store = new STORE(); + store.dwSystemID = binaryStore.dwSystemID; + store.dpName = this.readString(source, binaryStore.dpName); + store.dpString = this.readString(source, binaryStore.dpString); + result.stores.push(store); + offset += KMXFile.COMP_STORE_SIZE; + } + + // TODO: groups + + // TODO: KMXPlusFile + + return result; + } +}; \ No newline at end of file diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-disp.ts b/common/web/types/src/kmx/kmx-plus-builder/build-disp.ts new file mode 100644 index 0000000000000000000000000000000000000000..512bcca0b2f81d1a27a88ad1da1cb4b7b79451de --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-disp.ts @@ -0,0 +1,46 @@ +import { constants } from '@keymanapp/ldml-keyboard-constants'; +import { KMXPlusData } from "../kmx-plus.js"; +import { build_strs_index, BUILDER_STRS } from "./build-strs.js"; +import { BUILDER_SECTION } from './builder-section.js'; + +/* ------------------------------------------------------------------ + * disp section + ------------------------------------------------------------------ */ + +/** + * Builder for the 'disp' section + */ +interface BUILDER_DISP_ITEM { + to: number; + display: number; +}; + +export interface BUILDER_DISP extends BUILDER_SECTION { + count: number; + baseCharacter: number; + items: BUILDER_DISP_ITEM[]; +}; + +export function build_disp(kmxplus: KMXPlusData, sect_strs: BUILDER_STRS): BUILDER_DISP { + if(!kmxplus.disp.disps.length && !kmxplus.disp.baseCharacter.value) { + return null; + } + + let disp: BUILDER_DISP = { + ident: constants.hex_section_id(constants.section.disp), + size: constants.length_disp + constants.length_disp_item * kmxplus.disp.disps.length, + _offset: 0, + count: kmxplus.disp.disps.length, + baseCharacter: build_strs_index(sect_strs, kmxplus.disp.baseCharacter), + items: [] + }; + + for(let item of kmxplus.disp.disps) { + disp.items.push({ + to: build_strs_index(sect_strs, item.to), + display: build_strs_index(sect_strs, item.display), + }); + } + + return disp; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-elem.ts b/common/web/types/src/kmx/kmx-plus-builder/build-elem.ts new file mode 100644 index 0000000000000000000000000000000000000000..0c579037d72fe1c8c954299bd5be4ccee6d1d19b --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-elem.ts @@ -0,0 +1,103 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { ElementString } from "../element-string.js"; +import { Elem } from "../kmx-plus.js"; +import { build_strs_index, BUILDER_STRS } from "./build-strs.js"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/* ------------------------------------------------------------------ + * elem section + ------------------------------------------------------------------ */ + +interface BUILDER_ELEM_ELEMENT { + element: number; // str | UTF-32 char + flags: number; + _value: string; +}; + +interface BUILDER_ELEM_STRING { + offset: number; + length: number; + items: BUILDER_ELEM_ELEMENT[]; + _value: ElementString; +}; + +/** + * Builder for the 'elem' section + */ +export interface BUILDER_ELEM extends BUILDER_SECTION { + count: number; + strings: BUILDER_ELEM_STRING[]; +}; + +function binaryElemCompare(a: BUILDER_ELEM_STRING, b: BUILDER_ELEM_STRING): number { + for(let i = 0; i < a.items.length && i < b.items.length; i++) { + if(a.items[i]._value < b.items[i]._value) return -1; + if(a.items[i]._value > b.items[i]._value) return 1; + if(a.items[i].flags < b.items[i].flags) return -1; + if(a.items[i].flags > b.items[i].flags) return 1; + } + if(a.items.length < b.items.length) return -1; + if(a.items.length > b.items.length) return 1; + return 0; +} + +export function build_elem(source_elem: Elem, sect_strs: BUILDER_STRS): BUILDER_ELEM { + let result: BUILDER_ELEM = { + ident: constants.hex_section_id(constants.section.elem), + size: 0, // finalized below + _offset: 0, + count: source_elem.strings.length, + strings: [], // finalized below + }; + + // TODO: consider padding + result.strings = source_elem.strings.map(item => { + let res: BUILDER_ELEM_STRING = { + offset: 0, // finalized below + length: item.length, + items: [], + _value: item + }; + + res.items = item.map(v => { + return { + element: build_strs_index(sect_strs, v.value), + flags: constants.elem_flags_unicode_set | + v.flags | // + ((v.order ?? 0) << constants.elem_flags_order_bitshift) | // -128 to +127; used only by reorder element values + ((v.tertiary ?? 0) << constants.elem_flags_tertiary_bitshift), // -128 to +127; used only by reorder element values + _value: v.value.value + }; + }); + return res; + }); + result.strings.sort((a,b) => binaryElemCompare(a, b)); + + /* Calculate offsets and total size */ + + let offset = constants.length_elem + constants.length_elem_item * result.count; + for(let item of result.strings) { + if (item.length === 0) { + // no length gets a zero offset + item.offset = 0; + } else { + item.offset = offset; + offset += item.length * constants.length_elem_item_element; + } + } + + result.size = offset; + return result; +} + +export function build_elem_index(sect_elem: BUILDER_ELEM, value: ElementString) { + if(!(value instanceof ElementString)) { + throw new Error('unexpected value '+value); + } + + const result = sect_elem.strings.findIndex(v => value.isEqual(v._value)); + if(result < 0) { + throw new Error('unexpectedly missing StrsItem '+value); + } + return result; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-keys.ts b/common/web/types/src/kmx/kmx-plus-builder/build-keys.ts new file mode 100644 index 0000000000000000000000000000000000000000..0e9d38e90865e3f6d0c5cd8e8afe8953c158ca24 --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-keys.ts @@ -0,0 +1,175 @@ + +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KeysFlick, KMXPlusData, StrsItem } from "../kmx-plus.js"; +import { build_strs_index, BUILDER_STRS } from "./build-strs.js"; +import { build_list_index, BUILDER_LIST } from "./build-list.js"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/* ------------------------------------------------------------------ + * keys section + ------------------------------------------------------------------ */ + +/** + * This struct is a single in the keys keybag + */ +interface BUILDER_KEYS_KEY { + to: number; // str or single codepoint + flags: number; + id: number; // str with original key id + _id: string; // original key id, for sorting + switch: number; // str with layer of new l + width: number; // ceil((width||1)*10), so 12 for width 1.2 + longPress: number; // list of longPress sequences + longPressDefault: number; // str with the default longPress target + multiTap: number; // list of multiTap sequences + flicks: number; // index into the flicks[] subtable for this flick list +}; + +/** + * This is a , a list of elements. + */ +interface BUILDER_KEYS_FLICKS { + count: number; // number of BUILDER_KEYS_FLICK entries in this flick list + flick: number; // index into the flick[] subtable of the first flick in the list + id: number; // str with the original id of this flicks + _id: string; // copy of the flicks id, used for sorting during build + _flicks: KeysFlick[]; // temporary copy of KeysFlick object +}; + +/** + * This is a single element. + */ +interface BUILDER_KEYS_FLICK { + directions: number; // list of cardinal/intercardinal directions + flags: number; // + to: number; // str or single codepoint +}; + + +interface BUILDER_KEYS_KMAP { + vkey: number; + mod: number; + key: number; //index to keys.key +}; + +/** + * Builder for the 'keys' section + */ +export interface BUILDER_KEYS extends BUILDER_SECTION { + ident: number; + size: number; + keyCount: number; + flicksCount: number; + flickCount: number; + kmapCount: number; + keys: BUILDER_KEYS_KEY[]; + flicks: BUILDER_KEYS_FLICKS[]; + flick: BUILDER_KEYS_FLICK[]; + kmap: BUILDER_KEYS_KMAP[]; +}; + +export function build_keys(kmxplus: KMXPlusData, sect_strs: BUILDER_STRS, sect_list: BUILDER_LIST): BUILDER_KEYS { + if(kmxplus.keys.keys.length == 0 && + (kmxplus.keys.flicks.length <= 1)) { // if no keys and only the 'null' flick. + return null; + } + + let keys: BUILDER_KEYS = { + ident: constants.hex_section_id(constants.section.keys), + size: 0, + keyCount: kmxplus.keys.keys.length, + flicksCount: kmxplus.keys.flicks.length, + flickCount: 0, + kmapCount: kmxplus.keys.kmap.length, + keys: [], + flicks: [], + flick: [], + kmap: [], + _offset: 0, + }; + + // flicks first: the keys will need to index into the flicks table. + + // Note that per the Keys class and spec, there is always a flicks=0 meaning 'no flicks' + keys.flicks = kmxplus.keys.flicks.map((flicks) => { + let result : BUILDER_KEYS_FLICKS = { + count: flicks.flicks.length, + flick: keys.flick.length, // index of first flick + id: build_strs_index(sect_strs, flicks.id), + _id: flicks.id.value, + _flicks: flicks.flicks, + }; + return result; + }); + // Sort the flicks array by id + keys.flicks.sort((a, b) => StrsItem.binaryStringCompare(a._id, b._id)); + // now, allocate 'flick' entries for each 'flicks' + keys.flicks.forEach((flicks) => { + flicks._flicks.forEach((flick) => { + keys.flick.push({ + directions: build_list_index(sect_list, flick.directions), + flags: flick.flags, + to: build_strs_index(sect_strs, flick.to), + }); + keys.flickCount++; + }); + }); + + // now, keys + keys.keys = kmxplus.keys.keys.map((key) => { + let result : BUILDER_KEYS_KEY = { + to: build_strs_index(sect_strs, key.to), + flags: key.flags, + id: build_strs_index(sect_strs, key.id), + _id: key.id.value, + switch: build_strs_index(sect_strs, key.switch), + width: key.width, + longPress: build_list_index(sect_list, key.longPress), + longPressDefault: build_strs_index(sect_strs, key.longPressDefault), + multiTap: build_list_index(sect_list, key.multiTap), + flicks: keys.flicks.findIndex(v => v._id === (key.flicks || '')), // flicks id='' is the 'null' flicks + }; + // Make sure the flicks were found + if (result.flicks === -1) { + throw new Error(`Keys: Could not find flicks id=${key.flicks} for key=${key.id.value}`); + } + return result; + }); + // sort the keys by id + keys.keys.sort((a, b) => StrsItem.binaryStringCompare(a._id, b._id)); + + // finally, kmap + keys.kmap = kmxplus.keys.kmap.map(({vkey, mod, key}) => { + let result : BUILDER_KEYS_KMAP = { + vkey, + mod, + key: keys.keys.findIndex(k => k._id === key), + }; + // Make sure the key was found + if (result.key === -1) { + throw new Error(`Keys: Could not find keys.key id=${result.key} for keys.kmap.key=${key}`); + } + return result; + }); + + // Sort kmap by vkey, mod order, per C7043 + keys.kmap.sort((a,b) => { + let rc = 0; + if (rc === 0) { + rc = (a.vkey - b.vkey); + } + if (rc === 0) { + rc = (a.mod - b.mod); + } + return rc; + }); + + let offset = constants.length_keys + + (constants.length_keys_key * keys.keyCount) + + (constants.length_keys_flick_element * keys.flickCount) + + (constants.length_keys_flick_list * keys.flicksCount) + + (constants.length_keys_kmap * keys.kmapCount); + keys.size = offset; + + return keys; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-layr.ts b/common/web/types/src/kmx/kmx-plus-builder/build-layr.ts new file mode 100644 index 0000000000000000000000000000000000000000..da4e79f38f51e68c79b857eb49bd39184b57a5c1 --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-layr.ts @@ -0,0 +1,154 @@ + +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlusData, LayrEntry, LayrRow, StrsItem } from "../kmx-plus.js"; +import { build_strs_index, BUILDER_STRS } from "./build-strs.js"; +import { BUILDER_LIST } from "./build-list.js"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/* ------------------------------------------------------------------ + * layr section - + ------------------------------------------------------------------ */ + +/** + * List of layers, the element + */ +interface BUILDER_LAYR_LIST { + hardware: number; // hardware indicator + layer: number; // index of first layer in the list, in the + count: number; // number of layer entries in the list + minDeviceWidth: number; // width in millimeters + _layers: LayrEntry[]; // original layer entry, for in-memory only +}; + +/** + * element + */ +interface BUILDER_LAYR_LAYER { + id: number; // str of layer id + _id: string; // original layer id, for sorting + mod: number; // bitfield with modifier info + row: number; // row index into row subtable + _rows: LayrRow[]; // original rows, for in-memory only + count: number; // number of row entries +}; + +/** + * element + */ +interface BUILDER_LAYR_ROW { + key: number; // index into key subtable + count: number; // number of keys +}; + +/** + * portion of keys attribute of + */ +interface BUILDER_LAYR_KEY { + key: number; +}; + +/** + * Builder for the 'keys' section + */ +export interface BUILDER_LAYR extends BUILDER_SECTION { + listCount: number, // number of entries in lists subtable + layerCount: number, // number of entries in layers subtable + rowCount: number, // number of entries in rows subtable + keyCount: number, // number of entries in keys subtable + lists: BUILDER_LAYR_LIST[], // subtable of elements + layers: BUILDER_LAYR_LAYER[], // subtable of elements + rows: BUILDER_LAYR_ROW[], // subtable of elements + keys: BUILDER_LAYR_KEY[], // subtable of key entries +}; + +export function build_layr(kmxplus: KMXPlusData, sect_strs: BUILDER_STRS, sect_list: BUILDER_LIST): BUILDER_LAYR { + if (!kmxplus.layr?.lists) { + return null; // if there aren't any layers at all (which should be an invalid keyboard) + } + + let layr: BUILDER_LAYR = { + ident: constants.hex_section_id(constants.section.layr), + size: constants.length_layr, + _offset: 0, + listCount: kmxplus.layr.lists.length, + layerCount: 0, // calculated below + rowCount: 0, // calculated below + keyCount: 0, // calculated below + lists: [], + layers: [], + rows: [], + keys: [] + }; + + layr.lists = kmxplus.layr.lists.map((list) => { + const blist: BUILDER_LAYR_LIST = { + hardware: list.hardware, + layer: null, // to be set below + _layers: list.layers, + count: list.layers.length, + minDeviceWidth: list.minDeviceWidth, + }; + return blist; + }); + // now sort the lists + layr.lists.sort((a, b) => { + if (a.hardware < b.hardware) { + return -1; + } else if (a.hardware > b.hardware) { + return 1; + } + if (a.minDeviceWidth < b.minDeviceWidth) { + return -1; + } else if (a.minDeviceWidth > b.minDeviceWidth) { + return 1; + } else { + return 0; // same + } + }); + // Now allocate the layers, rows, and keys + layr.lists.forEach((list) => { + list.layer = layr.layers.length; // index to first layer in list + const blayers = list._layers.map((layer) => { + const blayer: BUILDER_LAYR_LAYER = { + _id: layer.id.value, // original id + id: build_strs_index(sect_strs, layer.id), + mod: layer.mod, + row: null, // row ID, to be filled in + _rows: layer.rows, // temporary + count: layer.rows.length, // number of rows + }; + return blayer; + }); + // sort the new layers + blayers.sort((a, b) => StrsItem.binaryStringCompare(a._id, b._id)); + blayers.forEach((layer) => { + layer.row = layr.rows.length; // index to first row in list + layer._rows.forEach((row) => { + const brow: BUILDER_LAYR_ROW = { + key: layr.keys.length, + count: row.keys.length, + }; + row.keys.forEach((key) => { + const bkey: BUILDER_LAYR_KEY = { + key: build_strs_index(sect_strs, key), + }; + layr.keys.push(bkey); + }); + layr.rows.push(brow); + }); + layr.layers.push(layer); + }); + }); + + layr.layerCount = layr.layers.length; + layr.rowCount = layr.rows.length; + layr.keyCount = layr.keys.length; + + let offset = constants.length_layr + + (constants.length_layr_list * layr.listCount) + + (constants.length_layr_entry * layr.layerCount) + + (constants.length_layr_row * layr.rowCount) + + (constants.length_layr_key * layr.keyCount); + layr.size = offset; + return layr; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-list.ts b/common/web/types/src/kmx/kmx-plus-builder/build-list.ts new file mode 100644 index 0000000000000000000000000000000000000000..a1ed950463212f14a4088499efb7998e100fdcac --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-list.ts @@ -0,0 +1,95 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { List, ListItem } from "../kmx-plus.js"; +import { build_strs_index, BUILDER_STRS } from "./build-strs.js"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/* ------------------------------------------------------------------ + * list section + ------------------------------------------------------------------ */ + +/** + * A list entry. + */ +interface BUILDER_LIST_LIST { + index: number; // index into indices[] subtable + count: number; // number of strings in this list + _value: ListItem; // for locating the list during finalization +}; + +interface BUILDER_LIST_INDEX { + str: number; // str for this string + _value: string; // for locating this string during finalization +}; + +/** + * Builder for the 'list' section + */ +export interface BUILDER_LIST extends BUILDER_SECTION { + listCount: number; // Number of lists total in the subtable + indexCount: number; // Total number of indices in the subtable + lists: BUILDER_LIST_LIST[]; + indices: BUILDER_LIST_INDEX[]; +}; + +export function build_list(source_list: List, sect_strs: BUILDER_STRS): BUILDER_LIST { + if(!source_list?.lists?.length) { + // there's always the null list + return null; + } + + let result: BUILDER_LIST = { + ident: constants.hex_section_id(constants.section.list), + size: 0, + _offset: 0, + listCount: source_list.lists.length, + indexCount: 0, + lists: [], + indices: [], + }; + + result.lists = source_list.lists.map(array => { + let list : BUILDER_LIST_LIST = { + index: result.indices.length, // the next indexcount + count: array.length, + _value: array + }; + array.forEach((i) => { + let index : BUILDER_LIST_INDEX = { + // Get the final string index + str: build_strs_index(sect_strs, i.value), + _value: i.value.value, // unwrap the actual string value + }; + result.indices.push(index); // increment the indexCount + result.indexCount++; + }); + return list; + }); + + // Sort the lists. + result.lists.sort((a,b) => a._value.compareTo(b._value)); + + let offset = constants.length_list + + (constants.length_list_item * result.listCount) + + (constants.length_list_index * result.indexCount); + result.size = offset; + + return result; +} + +/** + * Returns the index into the list, analagous to build_strs_index + * @param sect_strs + * @param value + * @returns + */ +export function build_list_index(sect_list: BUILDER_LIST, value: ListItem) { + if(!(value instanceof ListItem)) { + throw new Error('unexpected value '+ value); + } + + let result = sect_list.lists.findIndex(v => v._value === value); + if(result < 0) { + throw new Error('unexpectedly missing ListItem ' + value); // TODO-LDML: it's an array of strs + } + return result; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-loca.ts b/common/web/types/src/kmx/kmx-plus-builder/build-loca.ts new file mode 100644 index 0000000000000000000000000000000000000000..e7d3198fc279a42906838f12ef714d957d557442 --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-loca.ts @@ -0,0 +1,34 @@ + +/* ------------------------------------------------------------------ + * loca section + ------------------------------------------------------------------ */ + +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlusData } from "../kmx-plus.js"; +import { build_strs_index, BUILDER_STRS } from "./build-strs.js"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/** + * Builder for the 'loca' section + */ +export interface BUILDER_LOCA extends BUILDER_SECTION { + count: number; + items: number[]; //str[] +}; + +export function build_loca(kmxplus: KMXPlusData, sect_strs: BUILDER_STRS): BUILDER_LOCA { + let loca: BUILDER_LOCA = { + ident: constants.hex_section_id(constants.section.loca), + size: constants.length_loca + constants.length_loca_item * kmxplus.loca.locales.length, + _offset: 0, + count: kmxplus.loca.locales.length, + items: [] + }; + + for(let item of kmxplus.loca.locales) { + loca.items.push(build_strs_index(sect_strs, item)); + } + + return loca; +} + diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-meta.ts b/common/web/types/src/kmx/kmx-plus-builder/build-meta.ts new file mode 100644 index 0000000000000000000000000000000000000000..5c60472f356b586d1f4f2a023fe7b79772221a4f --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-meta.ts @@ -0,0 +1,37 @@ + +/* ------------------------------------------------------------------ + * meta section + ------------------------------------------------------------------ */ + +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlusData } from "../kmx-plus.js"; +import { build_strs_index, BUILDER_STRS } from "./build-strs.js"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/** + * Builder for the 'meta' section + */ +export interface BUILDER_META extends BUILDER_SECTION { + author: number; //str + conform: number; //str + layout: number; //str + normalization: number; //str + indicator: number; //str + version: number; //str + settings: number; //bitfield +}; + +export function build_meta(kmxplus: KMXPlusData, sect_strs: BUILDER_STRS): BUILDER_META { + return { + ident: constants.hex_section_id(constants.section.meta), + size: constants.length_meta, + _offset: 0, + author: build_strs_index(sect_strs, kmxplus.meta.author), + conform: build_strs_index(sect_strs, kmxplus.meta.conform), + layout: build_strs_index(sect_strs, kmxplus.meta.layout), + normalization: build_strs_index(sect_strs, kmxplus.meta.normalization), + indicator: build_strs_index(sect_strs, kmxplus.meta.indicator), + version: build_strs_index(sect_strs, kmxplus.meta.version), + settings: kmxplus.meta.settings ?? 0, + }; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-name.ts b/common/web/types/src/kmx/kmx-plus-builder/build-name.ts new file mode 100644 index 0000000000000000000000000000000000000000..9397ff0b0a643b1723a07256d7589063bda035db --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-name.ts @@ -0,0 +1,37 @@ + +/* ------------------------------------------------------------------ + * name section + ------------------------------------------------------------------ */ + +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlusData } from "../kmx-plus.js"; +import { build_strs_index, BUILDER_STRS } from "./build-strs.js"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/** + * Builder for the 'name' section + */ +export interface BUILDER_NAME extends BUILDER_SECTION { + count: number; + items: number[]; //str[] +}; + +export function build_name(kmxplus: KMXPlusData, sect_strs: BUILDER_STRS): BUILDER_NAME { + if(!kmxplus.name.names.length) { + return null; + } + + let name: BUILDER_NAME = { + ident: constants.hex_section_id(constants.section.name), + size: constants.length_name + constants.length_name_item * kmxplus.name.names.length, + _offset: 0, + count: kmxplus.name.names.length, + items: [] + }; + + for(let item of kmxplus.name.names) { + name.items.push(build_strs_index(sect_strs, item)); + } + + return name; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-ordr.ts b/common/web/types/src/kmx/kmx-plus-builder/build-ordr.ts new file mode 100644 index 0000000000000000000000000000000000000000..948bf769934ce0a00a8063c1191466fb74787d97 --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-ordr.ts @@ -0,0 +1,45 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlusData } from "../kmx-plus.js"; +import { build_elem_index, BUILDER_ELEM } from "./build-elem.js"; +import { BUILDER_STRS } from "./build-strs.js"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/* ------------------------------------------------------------------ +* ordr section + ------------------------------------------------------------------ */ + +interface BUILDER_ORDR_ITEM { + elements: number; //elem.string + before: number; //elem.string +}; + +export interface BUILDER_ORDR extends BUILDER_SECTION { + count: number; + items: BUILDER_ORDR_ITEM[]; +}; + +/** +* Builder for the 'ordr' section +*/ +export function build_ordr(kmxplus: KMXPlusData, sect_strs: BUILDER_STRS, sect_elem: BUILDER_ELEM): BUILDER_ORDR { + if(!kmxplus.ordr?.items.length) { + return null; + } + + let ordr: BUILDER_ORDR = { + ident: constants.hex_section_id(constants.section.ordr), + size: constants.length_ordr + constants.length_ordr_item * kmxplus.ordr.items.length, + _offset: 0, + count: kmxplus.ordr.items.length, + items: [] + }; + + for(let item of kmxplus.ordr.items) { + ordr.items.push({ + elements: build_elem_index(sect_elem, item.elements), + before: build_elem_index(sect_elem, item.before) + }); + } + + return ordr; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-sect.ts b/common/web/types/src/kmx/kmx-plus-builder/build-sect.ts new file mode 100644 index 0000000000000000000000000000000000000000..b97555d6de01a54cf28a0589579c0cc3e989eb75 --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-sect.ts @@ -0,0 +1,31 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/* ------------------------------------------------------------------ + * sect section + ------------------------------------------------------------------ */ + +interface BUILDER_SECT_ITEM { + sect: number; + offset: number; //? new r.VoidPointer(r.uint32le, {type: 'global'}) +}; + +/** + * Builder for the 'sect' (Section table of contents) section + */ +export interface BUILDER_SECT extends BUILDER_SECTION { + total: number; + count: number; + items: BUILDER_SECT_ITEM[]; + }; + +export function build_sect(): BUILDER_SECT { + return { + ident: constants.hex_section_id(constants.section.sect), + size: 0, // finalized later + _offset: 0, + total: 0, // finalized later + count: 0, // finalized later + items: [], // finalized later + }; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-strs.ts b/common/web/types/src/kmx/kmx-plus-builder/build-strs.ts new file mode 100644 index 0000000000000000000000000000000000000000..a8b9c91c75ce960d558503c688e9cadb479154ca --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-strs.ts @@ -0,0 +1,58 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { Strs, StrsItem } from "../kmx-plus.js"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/* ------------------------------------------------------------------ + * strs section + ------------------------------------------------------------------ */ + +interface BUILDER_STRS_ITEM { + // While we use length which is number of utf-16 code units excluding null terminator, + // we always write a null terminator, so we can get restructure to do that for us here + offset: number; //? new r.Pointer(r.uint32le, new r.String(null, 'utf16le')), + length: number; // in UTF-16 code units + _value: string +}; + +/** + * Builder for the 'strs' section + */ +export interface BUILDER_STRS extends BUILDER_SECTION { + count: number; + items: BUILDER_STRS_ITEM[]; +}; + +export function build_strs(source_strs: Strs): BUILDER_STRS { + let result: BUILDER_STRS = { + ident: constants.hex_section_id(constants.section.strs), + size: 0, // finalized later + _offset: 0, + count: source_strs.strings.length, + items: [], // filled below + }; + + result.items = source_strs.strings.map(item => { return {_value: item.value, length: item.value.length, offset: 0}; }); + result.items.sort((a,b) => StrsItem.binaryStringCompare(a._value, b._value)); + + let offset = constants.length_strs + constants.length_strs_item * result.count; + // TODO: consider padding + for(let item of result.items) { + item.offset = offset; + offset += item.length * 2 + 2; /* UTF-16 code units + sizeof null terminator */ + } + result.size = offset; + + return result; +} + +export function build_strs_index(sect_strs: BUILDER_STRS, value: StrsItem) { + if(!(value instanceof StrsItem)) { + throw new Error('unexpected value '+ value); + } + + let result = sect_strs.items.findIndex(v => v._value === value.value); + if(result < 0) { + throw new Error('unexpectedly missing StrsItem '+value.value); + } + return result; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-tran.ts b/common/web/types/src/kmx/kmx-plus-builder/build-tran.ts new file mode 100644 index 0000000000000000000000000000000000000000..c700d1ea085cddf8bd2a9827470fd3f8a24d040f --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-tran.ts @@ -0,0 +1,50 @@ + +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { Bksp, Finl, Tran } from "../kmx-plus.js"; +import { build_elem_index, BUILDER_ELEM } from "./build-elem.js"; +import { build_strs_index, BUILDER_STRS } from "./build-strs.js"; +import { BUILDER_SECTION } from "./builder-section.js"; + +/* ------------------------------------------------------------------ +* tran section + ------------------------------------------------------------------ */ + +interface BUILDER_TRAN_ITEM { + from: number; //elem.string + to: number; //str + before: number; //elem.string + flags: number; +}; + +export interface BUILDER_TRAN extends BUILDER_SECTION { + count: number; + items: BUILDER_TRAN_ITEM[]; +}; + +/** +* Builder for the 'tran', 'finl', and 'bksp' sections, all of which use the BUILDER_TRAN layout +*/ +export function build_tran(source_tran: Tran|Finl|Bksp, sect_strs: BUILDER_STRS, sect_elem: BUILDER_ELEM): BUILDER_TRAN { + if(!source_tran?.items.length) { + return null; + } + + let tran: BUILDER_TRAN = { + ident: constants.hex_section_id(source_tran.id), + size: constants.length_tran + constants.length_tran_item * source_tran.items.length, + _offset: 0, + count: source_tran.items.length, + items: [] + }; + + for(let item of source_tran.items) { + tran.items.push({ + from: build_elem_index(sect_elem, item.from), + to: build_strs_index(sect_strs, item.to), + before: build_elem_index(sect_elem, item.before), + flags: item.flags + }); + } + + return tran; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/build-vkey.ts b/common/web/types/src/kmx/kmx-plus-builder/build-vkey.ts new file mode 100644 index 0000000000000000000000000000000000000000..0a4863beabd65126cfb7151db671cacd34632c93 --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/build-vkey.ts @@ -0,0 +1,43 @@ +import { constants } from '@keymanapp/ldml-keyboard-constants'; +import { KMXPlusData } from "../kmx-plus.js"; +import { BUILDER_SECTION } from './builder-section.js'; + +/* ------------------------------------------------------------------ + * vkey section + ------------------------------------------------------------------ */ + +/** + * Builder for the 'vkey' section + */ +interface BUILDER_VKEY_ITEM { + vkey: number; + target: number; +}; + +export interface BUILDER_VKEY extends BUILDER_SECTION { + count: number; + items: BUILDER_VKEY_ITEM[]; +}; + +export function build_vkey(kmxplus: KMXPlusData): BUILDER_VKEY { + if(!kmxplus.vkey.vkeys.length) { + return null; + } + + let vkey: BUILDER_VKEY = { + ident: constants.hex_section_id(constants.section.vkey), + size: constants.length_vkey + constants.length_vkey_item * kmxplus.vkey.vkeys.length, + _offset: 0, + count: kmxplus.vkey.vkeys.length, + items: [] + }; + + for(let item of kmxplus.vkey.vkeys) { + vkey.items.push({ + vkey: item.vkey, + target: item.target + }); + } + + return vkey; +} diff --git a/common/web/types/src/kmx/kmx-plus-builder/builder-section.ts b/common/web/types/src/kmx/kmx-plus-builder/builder-section.ts new file mode 100644 index 0000000000000000000000000000000000000000..1a6108af4e63ab09d3a24ba5ad77a95654786641 --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/builder-section.ts @@ -0,0 +1,6 @@ +export interface BUILDER_SECTION { + ident: number; + size: number; + _offset: number; // used only for building the output +} +; diff --git a/common/web/types/src/kmx/kmx-plus-builder/kmx-plus-builder.ts b/common/web/types/src/kmx/kmx-plus-builder/kmx-plus-builder.ts new file mode 100644 index 0000000000000000000000000000000000000000..95a36a60f2f8bcec06a4f59c3ed1af50e5480d0d --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus-builder/kmx-plus-builder.ts @@ -0,0 +1,190 @@ +import * as r from 'restructure'; +import { KMXPlusFile } from "../kmx-plus.js"; +import { constants, SectionIdent } from '@keymanapp/ldml-keyboard-constants'; +import { BUILDER_SECTION } from './builder-section.js'; +import { BUILDER_SECT, build_sect } from './build-sect.js'; +import { BUILDER_DISP, build_disp } from './build-disp.js'; +import { BUILDER_ELEM, build_elem } from './build-elem.js'; +import { BUILDER_KEYS, build_keys } from './build-keys.js'; +import { BUILDER_LAYR, build_layr } from './build-layr.js'; +import { BUILDER_LIST, build_list } from './build-list.js'; +import { BUILDER_LOCA, build_loca } from './build-loca.js'; +import { BUILDER_META, build_meta } from './build-meta.js'; +import { BUILDER_NAME, build_name } from './build-name.js'; +import { BUILDER_ORDR, build_ordr } from './build-ordr.js'; +import { BUILDER_STRS, build_strs } from './build-strs.js'; +import { BUILDER_TRAN, build_tran } from './build-tran.js'; +import { BUILDER_VKEY, build_vkey } from './build-vkey.js'; + +type BUILDER_BKSP = BUILDER_TRAN; +type BUILDER_FINL = BUILDER_TRAN; + +type SectionBuilders = { + // [id in SectionIdent]: BUILDER_SECTION; + sect?: BUILDER_SECT; + bksp?: BUILDER_BKSP; + disp?: BUILDER_DISP; + elem?: BUILDER_ELEM; + finl?: BUILDER_FINL; + keys?: BUILDER_KEYS; + layr?: BUILDER_LAYR; + list?: BUILDER_LIST; + loca?: BUILDER_LOCA; + meta?: BUILDER_META; + name?: BUILDER_NAME; + ordr?: BUILDER_ORDR; + strs?: BUILDER_STRS; + tran?: BUILDER_TRAN; + vkey?: BUILDER_VKEY; +}; + +export default class KMXPlusBuilder { + private file: KMXPlusFile; + //private writeDebug: boolean; + + sect : SectionBuilders = { + + }; + + constructor(file: KMXPlusFile, _writeDebug: boolean) { + this.file = file; + //this.writeDebug = _writeDebug; + } + + public compile(): Uint8Array { + const fileSize = this.build(); + let file: Uint8Array = new Uint8Array(fileSize); + + this.emitSection(file, this.file.COMP_PLUS_SECT, this.sect.sect); + // Keep the rest of these in order. + this.emitSection(file, this.file.COMP_PLUS_BKSP, this.sect.bksp); + this.emitSection(file, this.file.COMP_PLUS_DISP, this.sect.disp); + this.emitSection(file, this.file.COMP_PLUS_ELEM, this.sect.elem); + this.emitElements(file); + this.emitSection(file, this.file.COMP_PLUS_FINL, this.sect.finl); + this.emitSection(file, this.file.COMP_PLUS_KEYS, this.sect.keys); + this.emitSection(file, this.file.COMP_PLUS_LAYR, this.sect.layr); + this.emitSection(file, this.file.COMP_PLUS_LIST, this.sect.list); + this.emitSection(file, this.file.COMP_PLUS_LOCA, this.sect.loca); + this.emitSection(file, this.file.COMP_PLUS_META, this.sect.meta); + this.emitSection(file, this.file.COMP_PLUS_NAME, this.sect.name); + this.emitSection(file, this.file.COMP_PLUS_ORDR, this.sect.ordr); + this.emitSection(file, this.file.COMP_PLUS_STRS, this.sect.strs); + this.emitStrings(file); + this.emitSection(file, this.file.COMP_PLUS_TRAN, this.sect.tran); + this.emitSection(file, this.file.COMP_PLUS_VKEY, this.sect.vkey); + + return file; + } + + private build() { + // Required sections: sect, strs, loca, meta + + // We must prepare the strs, list, and elem sections early so that other sections can + // reference them. However, they will be emitted in alpha order. + this.sect.strs = build_strs(this.file.kmxplus.strs); + this.sect.list = build_list(this.file.kmxplus.list, this.sect.strs); + this.sect.elem = build_elem(this.file.kmxplus.elem, this.sect.strs); + + const build_bksp = build_tran; + const build_finl = build_tran; + + this.sect.bksp = build_bksp(this.file.kmxplus.bksp, this.sect.strs, this.sect.elem); + this.sect.disp = build_disp(this.file.kmxplus, this.sect.strs); + this.sect.finl = build_finl(this.file.kmxplus.finl, this.sect.strs, this.sect.elem); + this.sect.keys = build_keys(this.file.kmxplus, this.sect.strs, this.sect.list); + this.sect.layr = build_layr(this.file.kmxplus, this.sect.strs, this.sect.list); + this.sect.loca = build_loca(this.file.kmxplus, this.sect.strs); + this.sect.meta = build_meta(this.file.kmxplus, this.sect.strs); + this.sect.name = build_name(this.file.kmxplus, this.sect.strs); + this.sect.ordr = build_ordr(this.file.kmxplus, this.sect.strs, this.sect.elem); + this.sect.tran = build_tran(this.file.kmxplus.tran, this.sect.strs, this.sect.elem); + this.sect.vkey = build_vkey(this.file.kmxplus); + + // Finalize the sect (index) section + + this.sect.sect = build_sect(); + this.finalize_sect(); // must be done last + return this.sect.sect.total; + } + + private finalize_sect() { + // 'sect' section + + this.sect.sect.count = 0; + + Object.keys(constants.section).forEach((sectstr : string) => { + const sect : SectionIdent = constants.section[sectstr]; + if(this.sect[sect] && sect !== 'sect') { + this.sect.sect.count++; + } + }); + + this.sect.sect.size = constants.length_sect + constants.length_sect_item * this.sect.sect.count; + + let offset = this.sect.sect.size; + // Note: in order! Everyone's here except 'sect' which is at offset 0 + offset = this.finalize_sect_item(this.sect.bksp, offset); + offset = this.finalize_sect_item(this.sect.disp, offset); + offset = this.finalize_sect_item(this.sect.elem, offset); + offset = this.finalize_sect_item(this.sect.finl, offset); + offset = this.finalize_sect_item(this.sect.keys, offset); + offset = this.finalize_sect_item(this.sect.layr, offset); + offset = this.finalize_sect_item(this.sect.list, offset); + offset = this.finalize_sect_item(this.sect.loca, offset); + offset = this.finalize_sect_item(this.sect.meta, offset); + offset = this.finalize_sect_item(this.sect.name, offset); + offset = this.finalize_sect_item(this.sect.ordr, offset); + offset = this.finalize_sect_item(this.sect.strs, offset); + offset = this.finalize_sect_item(this.sect.tran, offset); + offset = this.finalize_sect_item(this.sect.vkey, offset); + + this.sect.sect.total = offset; + } + + private finalize_sect_item(sect: BUILDER_SECTION, offset: number): number { + if(!sect) { + // Don't include null sections + return offset; + } + sect._offset = offset; + this.sect.sect.items.push({sect: sect.ident, offset: offset}); + return offset + sect.size; + } + + private emitSection(file: Uint8Array, comp: any, sect: BUILDER_SECTION) { + if(sect) { + const buf = comp.toBuffer(sect); + if (buf.length > sect.size) { + // buf.length may be < sect.size if there is a variable part (i.e. elem) + throw new RangeError(`Internal Error: Section ${constants.str_section_id(sect.ident)} claimed size ${sect.size} but produced buffer of size ${buf.length}.`); + } + file.set(buf, sect._offset); + } + } + + private emitStrings(file: Uint8Array) { + for(let item of this.sect.strs.items) { + if(item._value === '') { + // We have a special case for the zero-length string + let sbuf = r.uint16le; + file.set(sbuf.toBuffer(0), item.offset + this.sect.strs._offset); + } else { + let sbuf = new r.String(null, 'utf16le'); + file.set(sbuf.toBuffer(item._value), item.offset + this.sect.strs._offset); + } + } + } + + private emitElements(file: Uint8Array) { + if(this.sect.elem) { + for(let str of this.sect.elem.strings) { + if(str.items.length > 0) { + let COMP_PLUS_ELEM_ELEMENTS = new r.Array(this.file.COMP_PLUS_ELEM_ELEMENT, str.items.length); + file.set(COMP_PLUS_ELEM_ELEMENTS.toBuffer(str.items), str.offset + this.sect.elem._offset); + } + } + } + } + +} diff --git a/common/web/types/src/kmx/kmx-plus.ts b/common/web/types/src/kmx/kmx-plus.ts new file mode 100644 index 0000000000000000000000000000000000000000..d525d896af9070ced4405551345e8d8042e41fb7 --- /dev/null +++ b/common/web/types/src/kmx/kmx-plus.ts @@ -0,0 +1,692 @@ +import { constants } from '@keymanapp/ldml-keyboard-constants'; +import * as r from 'restructure'; +import { ElementString } from './element-string.js'; +import { ListItem } from './string-list.js'; +import { unescapeString } from '../util/util.js'; +import { KMXFile } from './kmx.js'; + +// Implementation of file structures from /core/src/ldml/C7043_ldml.md +// Writer in kmx-builder.ts +// Reader in kmx-loader.ts + +export class Section { +} + +export class GlobalSections { + // These sections are used by other sections during compilation + strs: Strs; + elem: Elem; + list: List; +} + +// 'sect' + +export class Sect extends Section {}; + +// 'bksp' -- see 'tran' + +// 'elem' + +export class Elem extends Section { + strings: ElementString[] = []; + constructor(strs: Strs) { + super(); + this.strings.push(new ElementString(strs, '')); // C7043: null element string + } + allocElementString(strs: Strs, source: string, order?: string, tertiary?: string, tertiary_base?: string, prebase?: string): ElementString { + let s = new ElementString(strs, source, order, tertiary, tertiary_base, prebase); + let result = this.strings.find(item => item.isEqual(s)); + if(result === undefined) { + result = s; + this.strings.push(result); + } + return result; + } +}; + +// 'finl' -- see 'tran' + +// 'keys' is now `keys2.kmap` + +// 'loca' + +export class Loca extends Section { + locales: StrsItem[] = []; +}; + +// 'meta' + +export enum KeyboardSettings { + none = 0, + fallback = constants.meta_settings_fallback_omit, + transformFailure = constants.meta_settings_transformFailure_omit, + transformPartial = constants.meta_settings_transformPartial_hide, +}; + +export enum Meta_NormalizationForm { NFC='NFC', NFD='NFD', other='other' }; + +export class Meta extends Section { + author: StrsItem; + conform: StrsItem; + layout: StrsItem; + normalization: StrsItem; + indicator: StrsItem; + version: StrsItem; // semver version string, defaults to "0" + settings: KeyboardSettings; +}; + +// 'name' + +export class Name extends Section { + names: StrsItem[] = []; +}; + +// 'ordr' + +export class OrdrItem { + elements: ElementString; + before: ElementString; +}; + +export class Ordr extends Section { + items: OrdrItem[] = []; +}; + +// 'strs' + +/** + * A string item in memory. This will be replaced with an index + * into the string table at finalization. + */ +export class StrsItem { + readonly value: string; + constructor(value: string) { + this.value = value; + } + compareTo(o: StrsItem): number { + return StrsItem.binaryStringCompare(this.value, o.value); + } + static binaryStringCompare(a: string, b: string): number { + // https://tc39.es/ecma262/multipage/abstract-operations.html#sec-islessthan + if(typeof a != 'string' || typeof b != 'string') { + throw new Error('binaryStringCompare: inputs must be strings'); + } + if(a < b) return -1; + if(a > b) return 1; + return 0; + } +}; + +export class Strs extends Section { + strings: StrsItem[] = [ new StrsItem('') ]; // C7043: The null string is always requierd + /** + * Allocate a StrsItem given the string, unescaping if necessary. + * @param s escaped string + * @returns + */ + allocAndUnescapeString(s?: string): StrsItem { + return this.allocString(unescapeString(s)); + } + /** + * Allocate a StrsItem given the string. + * @param s string + * @returns + */ + allocString(s?: string): StrsItem { + if(s === undefined || s === null) { + // undefined or null are always equivalent to empty string, see C7043 + s = ''; + } + + if(typeof s !== 'string') { + throw new Error('alloc_string: s must be a string, undefined, or null.'); + } + + let result = this.strings.find(item => item.value === s); + if(result === undefined) { + result = new StrsItem(s); + this.strings.push(result); + } + return result; + } +}; + +// 'tran' + +export enum TranItemFlags { + none = 0, + error = constants.tran_flags_error, +}; + +export class TranItem extends Section { + from: ElementString; + to: StrsItem; + before: ElementString; + flags: TranItemFlags; +}; + +export class Tran extends Section { + items: TranItem[] = []; + get id() { + return constants.section.tran; + } +}; + +// alias types for 'bksp', 'finl' + +export class Bksp extends Tran { + override get id() { + return constants.section.bksp; + } +}; +export class BkspItem extends TranItem {}; +export type BkspItemFlags = TranItemFlags; +export const BkspItemFlags = TranItemFlags; + +export class Finl extends Tran { + override get id() { + return constants.section.finl; + } +}; +export class FinlItem extends TranItem {}; +export type FinlItemFlags = TranItemFlags; +export const FinlItemFlags = TranItemFlags; + +// 'vkey' + +export class VkeyItem { + vkey: number; + target: number; +} + +export class Vkey extends Section { + vkeys: VkeyItem[] = []; +}; + +// 'disp' +export class DispItem { + to: StrsItem; + display: StrsItem; +}; + +export class Disp extends Section { + baseCharacter: StrsItem; + disps: DispItem[] = []; +}; + +// 'layr' + +/** + * In-memory `` + */ +export class LayrList { + hardware: number; + layers: LayrEntry[] = []; + minDeviceWidth: number; // millimeters +}; + +/** + * In-memory `` + */ + export class LayrEntry { + id: StrsItem; + mod: number; + rows: LayrRow[] = []; +}; + +/** + * In-memory `` + */ + export class LayrRow { + keys: StrsItem[] = []; +}; + +export class Layr extends Section { + lists: LayrList[] = []; +}; + +export class KeysKeys { + flags: number; + flicks: string; // for in-memory only + id: StrsItem; + longPress: ListItem; + longPressDefault: StrsItem; + multiTap: ListItem; + switch: StrsItem; + to: StrsItem; + width: number; +}; + + +export class KeysKmap { + vkey: number; + mod: number; + key: string; // for in-memory only +}; + +export class KeysFlicks { + flicks: KeysFlick[] = []; + id: StrsItem; + compareTo(b: KeysFlicks): number { + return this.id.compareTo(b.id); + } + constructor(id: StrsItem) { + this.id = id; + } +}; + +export class KeysFlick { + directions: ListItem; + flags: number; + to: StrsItem; +}; + +export class Keys extends Section { + keys: KeysKeys[] = []; + flicks: KeysFlicks[] = []; + kmap: KeysKmap[] = []; + constructor(strs: Strs) { + super(); + let nullFlicks = new KeysFlicks(strs.allocString('')); + this.flicks.push(nullFlicks); // C7043: null element string + } +}; + +export class List extends Section { + /** + * Allocate a list from a space-separated list of items. + * Note that passing undefined or null or `''` will + * end up being the same as the empty list `[]` + * @param strs Strs section for allocation + * @param s space-separated list of items + * @returns a List object + */ + allocListFromSpaces(strs: Strs, s?: string): ListItem { + s = s ?? ''; + return this.allocList(strs, s.split(' ')); + } + allocListFromEscapedSpaces(strs: Strs, s?: string): ListItem { + if(s === undefined || s === null) { + s = ''; + } + return this.allocList(strs, s.split(' ').map(unescapeString)); + } + /** + * Return a List object referring to the string list. + * Note that a falsy list, or a list containing only an empty string + * `['']` will be stored as an empty list `[]`. + * @param strs Strs section for allocation + * @param s string list to allocate + * @returns + */ + allocList(strs: Strs, s?: string[]): ListItem { + // Special case the 'null' list for [] or [''] + if (!s || (s.length === 1 && s[0] === '')) { + return this.lists[0]; + } + let result = this.lists.find(item => item.isEqual(s)); + if(result === undefined) { + // allocate a new ListItem + result = new ListItem(strs, s); + this.lists.push(result); + } + return result; + } + constructor(strs: Strs) { + super(); + this.lists.push(new ListItem(strs, [])); // C7043: null element string + } + lists: ListItem[] = []; +}; + +export { ListItem as ListItem }; + +export interface KMXPlusData { + sect?: Strs; // sect is ignored in-memory + bksp?: Bksp; + disp?: Disp; + elem?: Elem; // elem is ignored in-memory + finl?: Finl; + keys?: Keys; + layr?: Layr; + list?: List; // list is ignored in-memory + loca?: Loca; + meta?: Meta; + name?: Name; + ordr?: Ordr; + strs?: Strs; // strs is ignored in-memory + tran?: Tran; + vkey?: Vkey; +}; + +export class KMXPlusFile extends KMXFile { + + /* KMXPlus file structures */ + + public readonly COMP_PLUS_SECT_ITEM: any; + public readonly COMP_PLUS_SECT: any; + + // COMP_PLUS_BKSP == COMP_PLUS_TRAN + public readonly COMP_PLUS_BKSP_ITEM: any; + public readonly COMP_PLUS_BKSP: any; + + public readonly COMP_PLUS_DISP_ITEM: any; + public readonly COMP_PLUS_DISP: any; + + public readonly COMP_PLUS_ELEM_ELEMENT: any; + public readonly COMP_PLUS_ELEM_STRING: any; + public readonly COMP_PLUS_ELEM: any; + + // COMP_PLUS_FINL == COMP_PLUS_TRAN + public readonly COMP_PLUS_FINL_ITEM: any; + public readonly COMP_PLUS_FINL: any; + + // COMP_PLUS_KEYS is now COMP_PLUS_KEYS_KMAP + + public readonly COMP_PLUS_LAYR_ENTRY: any; + public readonly COMP_PLUS_LAYR_KEY: any; + public readonly COMP_PLUS_LAYR_LIST: any; + public readonly COMP_PLUS_LAYR_ROW: any; + public readonly COMP_PLUS_LAYR: any; + + public readonly COMP_PLUS_KEYS_FLICK: any; + public readonly COMP_PLUS_KEYS_FLICKS: any; + public readonly COMP_PLUS_KEYS_KEY: any; + public readonly COMP_PLUS_KEYS_KMAP: any; + public readonly COMP_PLUS_KEYS: any; + + public readonly COMP_PLUS_LIST_LIST: any; + public readonly COMP_PLUS_LIST_INDEX: any; + public readonly COMP_PLUS_LIST: any; + + public readonly COMP_PLUS_LOCA_ITEM: any; + public readonly COMP_PLUS_LOCA: any; + + public readonly COMP_PLUS_META: any; + + public readonly COMP_PLUS_NAME_ITEM: any; + public readonly COMP_PLUS_NAME: any; + + public readonly COMP_PLUS_ORDR_ITEM: any; + public readonly COMP_PLUS_ORDR: any; + + public readonly COMP_PLUS_STRS_ITEM: any; + public readonly COMP_PLUS_STRS: any; + + public readonly COMP_PLUS_TRAN_ITEM: any; + public readonly COMP_PLUS_TRAN: any; + + public readonly COMP_PLUS_VKEY_ITEM: any; + public readonly COMP_PLUS_VKEY: any; + + /* File in-memory data */ + + public kmxplus: KMXPlusData = { }; + + constructor() { + super(); + + + // Binary-correct structures matching kmx_plus.h + + // 'sect' + + this.COMP_PLUS_SECT_ITEM = new r.Struct({ + sect: r.uint32le, + offset: r.uint32le //? new r.VoidPointer(r.uint32le, {type: 'global'}) + }); + + this.COMP_PLUS_SECT = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + total: r.uint32le, + count: r.uint32le, + items: new r.Array(this.COMP_PLUS_SECT_ITEM, 'count') + }); + + // 'bksp' - see 'tran' + + // 'disp' + this.COMP_PLUS_DISP_ITEM = new r.Struct({ + to: r.uint32le, + display: r.uint32le, + }); + + this.COMP_PLUS_DISP = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + count: r.uint32le, + baseCharacter: r.uint32le, + items: new r.Array(this.COMP_PLUS_DISP_ITEM, 'count'), + }); + + // 'elem' + + this.COMP_PLUS_ELEM_ELEMENT = new r.Struct({ + element: r.uint32le, + flags: r.uint32le + }); + + this.COMP_PLUS_ELEM_STRING = new r.Struct({ + offset: r.uint32le, + length: r.uint32le + }); + + this.COMP_PLUS_ELEM = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + count: r.uint32le, + strings: new r.Array(this.COMP_PLUS_ELEM_STRING, 'count') + // + variable subtable: Element data (see KMXPlusBuilder.emitElements()) + }); + + // 'finl' - see 'tran' + + // 'keys' - see 'keys.kmap' + + // 'layr' + + this.COMP_PLUS_LAYR_ENTRY = new r.Struct({ + id: r.uint32le, // str + mod: r.uint32le, // bitfield + row: r.uint32le, // index into rows + count: r.uint32le, + }); + + this.COMP_PLUS_LAYR_KEY = new r.Struct({ + key: r.uint32le, // str: key id + }); + + this.COMP_PLUS_LAYR_LIST = new r.Struct({ + hardware: r.uint32le, //enum + layer: r.uint32le, // index into layers + count: r.uint32le, + minDeviceWidth: r.uint32le, // integer: millimeters + }); + + this.COMP_PLUS_LAYR_ROW = new r.Struct({ + key: r.uint32le, + count: r.uint32le, + }); + + this.COMP_PLUS_LAYR = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + listCount: r.uint32le, + layerCount: r.uint32le, + rowCount: r.uint32le, + keyCount: r.uint32le, + lists: new r.Array(this.COMP_PLUS_LAYR_LIST, 'listCount'), + layers: new r.Array(this.COMP_PLUS_LAYR_ENTRY, 'layerCount'), + rows: new r.Array(this.COMP_PLUS_LAYR_ROW, 'rowCount'), + keys: new r.Array(this.COMP_PLUS_LAYR_KEY, 'keyCount'), + }); + + this.COMP_PLUS_KEYS_FLICK = new r.Struct({ + directions: r.uint32le, // list + flags: r.uint32le, + to: r.uint32le, // str | codepoint + }); + + this.COMP_PLUS_KEYS_FLICKS = new r.Struct({ + count: r.uint32le, + flick: r.uint32le, + id: r.uint32le, // str + }); + + this.COMP_PLUS_KEYS_KEY = new r.Struct({ + to: r.uint32le, // str | codepoint + flags: r.uint32le, + id: r.uint32le, // str + switch: r.uint32le, // str + width: r.uint32le, // width*10 ( 1 = 0.1 keys) + longPress: r.uint32le, // list index + longPressDefault: r.uint32le, // str + multiTap: r.uint32le, // list index + flicks: r.uint32le, // index into flicks table + }); + + this.COMP_PLUS_KEYS_KMAP = new r.Struct({ + vkey: r.uint32le, + mod: r.uint32le, + key: r.uint32le, // index into 'keys' subtable + }); + + this.COMP_PLUS_KEYS = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + keyCount: r.uint32le, + flicksCount: r.uint32le, + flickCount: r.uint32le, + kmapCount: r.uint32le, + keys: new r.Array(this.COMP_PLUS_KEYS_KEY, 'keyCount'), + flicks: new r.Array(this.COMP_PLUS_KEYS_FLICKS, 'flicksCount'), + flick: new r.Array(this.COMP_PLUS_KEYS_FLICK, 'flickCount'), + kmap: new r.Array(this.COMP_PLUS_KEYS_KMAP, 'kmapCount'), + }); + + // 'list' + + this.COMP_PLUS_LIST_LIST = new r.Struct({ + index: r.uint32le, + count: r.uint32le, + }); + + this.COMP_PLUS_LIST_INDEX = new r.Struct({ + str: r.uint32le, // str + }); + + this.COMP_PLUS_LIST = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + listCount: r.uint32le, + indexCount: r.uint32le, + lists: new r.Array(this.COMP_PLUS_LIST_LIST, 'listCount'), + indices: new r.Array(this.COMP_PLUS_LIST_INDEX, 'indexCount'), + }); + + // 'loca' + + this.COMP_PLUS_LOCA_ITEM = r.uint32le; //str + + this.COMP_PLUS_LOCA = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + count: r.uint32le, + items: new r.Array(this.COMP_PLUS_LOCA_ITEM, 'count') + }); + + // 'meta' + + this.COMP_PLUS_META = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + author: r.uint32le, //str + conform: r.uint32le, //str + layout: r.uint32le, //str + normalization: r.uint32le, //str + indicator: r.uint32le, //str + version: r.uint32le, //str + settings: r.uint32le, //new r.Bitfield(r.uint32le, ['fallback', 'transformFailure', 'transformPartial']) + }); + + // 'name' + + this.COMP_PLUS_NAME_ITEM = r.uint32le; //str + + this.COMP_PLUS_NAME = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + count: r.uint32le, + items: new r.Array(this.COMP_PLUS_NAME_ITEM, 'count') + }); + + // 'ordr' + + this.COMP_PLUS_ORDR_ITEM = new r.Struct({ + elements: r.uint32le, //elem + before: r.uint32le //elem + }); + + this.COMP_PLUS_ORDR = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + count: r.uint32le, + items: new r.Array(this.COMP_PLUS_ORDR_ITEM, 'count') + }); + + // 'strs' + + this.COMP_PLUS_STRS_ITEM = new r.Struct({ + // While we use length which is number of utf-16 code units excluding null terminator, + // we always write a null terminator, so we can get restructure to do that for us here + offset: r.uint32le, //? new r.Pointer(r.uint32le, new r.String(null, 'utf16le')), + length: r.uint32le + }); + + this.COMP_PLUS_STRS = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + count: r.uint32le, + items: new r.Array(this.COMP_PLUS_STRS_ITEM, 'count') + // + variable subtable: String data (see KMXPlusBuilder.emitStrings()) + }); + + // 'tran' + + this.COMP_PLUS_TRAN_ITEM = new r.Struct({ + from: r.uint32le, //elem + to: r.uint32le, //str + before: r.uint32le, //elem + flags: r.uint32le //bitfield + }); + + this.COMP_PLUS_TRAN = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + count: r.uint32le, + items: new r.Array(this.COMP_PLUS_TRAN_ITEM, 'count') + }); + + // 'vkey' + + this.COMP_PLUS_VKEY_ITEM = new r.Struct({ + vkey: r.uint32le, + target: r.uint32le + }); + + this.COMP_PLUS_VKEY = new r.Struct({ + ident: r.uint32le, + size: r.uint32le, + count: r.uint32le, + items: new r.Array(this.COMP_PLUS_VKEY_ITEM, 'count') + }); + + // Aliases + + this.COMP_PLUS_BKSP_ITEM = this.COMP_PLUS_TRAN_ITEM; + this.COMP_PLUS_FINL_ITEM = this.COMP_PLUS_TRAN_ITEM; + this.COMP_PLUS_BKSP = this.COMP_PLUS_TRAN; + this.COMP_PLUS_FINL = this.COMP_PLUS_TRAN; + } +} diff --git a/common/web/types/src/kmx/kmx.ts b/common/web/types/src/kmx/kmx.ts new file mode 100644 index 0000000000000000000000000000000000000000..2f47bddcdd20942eb4cf971e84a625044a8a691c --- /dev/null +++ b/common/web/types/src/kmx/kmx.ts @@ -0,0 +1,418 @@ +import * as r from 'restructure'; + +/* Definitions from kmx_file.h. Must be kept in sync */ + +// TODO: split kmx-file from kmx in-memory, similar to what I've done for kvk (keep restructure decl + BUILDER_ interfaces together) + +// In memory representations of KMX structures +// kmx-builder will transform these to the corresponding COMP_xxxx + +export class KEYBOARD { + //TODO: additional header fields + groups: GROUP[] = []; + stores: STORE[] = []; +}; + +export class STORE { + dwSystemID: number; + dpName: string; + dpString: string; +}; + +export class GROUP { + dpName: string; + keys: KEY[]; + dpMatch: string; + dpNoMatch: string; + fUsingKeys: boolean; +}; + +export class KEY { + Key: number; + Line: number; + ShiftFlags: number; + dpOutput: string; + dpContext: string; +}; + +// These type-checking structures are here to ensure that +// we match the structures from kmx.ts in the generator +// +// They are used internally when reading and writing .kmx files + +export interface BUILDER_COMP_KEYBOARD { + dwIdentifier: number; + dwFileVersion: number; + dwCheckSum: number; + KeyboardID: number; + IsRegistered: number; + version: number; + + cxStoreArray: number; + cxGroupArray: number; + + dpStoreArray: number; + dpGroupArray: number; + + StartGroup_ANSI: number; + StartGroup_Unicode: number; + + dwFlags: number; + + dwHotKey: number; + + dpBitmapOffset: number; + dwBitmapSize: number; +}; + +export interface BUILDER_COMP_KEYBOARD_KMXPLUSINFO { + dpKMXPlus: number; + dwKMXPlusSize: number; +}; + +export interface BUILDER_COMP_STORE { + dwSystemID: number; + dpName: number; + dpString: number; +}; + +export interface BUILDER_COMP_KEY { + Key: number; + _padding: number; + Line: number; + ShiftFlags: number; + dpOutput: number; + dpContext: number; +}; + +export interface BUILDER_COMP_GROUP { + dpName: number; + dpKeyArray: number; + dpMatch: number; + dpNoMatch: number; + cxKeyArray: number; + fUsingKeys: number; +}; + +export class KMXFile { + + /* KMX file structures */ + + public readonly COMP_STORE: any; + public readonly COMP_KEY: any; + public readonly COMP_GROUP: any; + public readonly COMP_KEYBOARD_KMXPLUSINFO: any; + public readonly COMP_KEYBOARD: any; + + public static readonly FILEID_COMPILED = 0x5354584B; // 'KXTS' + + // + // File version identifiers (COMP_KEYBOARD.dwFileVersion) + // + + public static readonly VERSION_30 = 0x00000300; + public static readonly VERSION_31 = 0x00000301; + public static readonly VERSION_32 = 0x00000302; + public static readonly VERSION_40 = 0x00000400; + public static readonly VERSION_50 = 0x00000500; + public static readonly VERSION_501 = 0x00000501; + public static readonly VERSION_60 = 0x00000600; + public static readonly VERSION_70 = 0x00000700; + public static readonly VERSION_80 = 0x00000800; + public static readonly VERSION_90 = 0x00000900; + public static readonly VERSION_100 = 0x00000A00; + public static readonly VERSION_140 = 0x00000E00; + public static readonly VERSION_150 = 0x00000F00; + + public static readonly VERSION_160 = 0x00001000; + + public static readonly VERSION_MIN = this.VERSION_50; + public static readonly VERSION_MAX = this.VERSION_160; + + // + // Backspace types + // + + public static readonly BK_DEFAULT = 0; + public static readonly BK_DEADKEY = 1; + + // Different begin types (COMP_STORE.StartGroup_*) + + public static readonly BEGIN_ANSI = 0; + public static readonly BEGIN_UNICODE = 1; + + // + // System Store values (COMP_STORE.dwSystemID) + // + + public static readonly TSS_NONE = 0; + public static readonly TSS_BITMAP = 1; + public static readonly TSS_COPYRIGHT = 2; + public static readonly TSS_HOTKEY = 3; + public static readonly TSS_LANGUAGE = 4; + public static readonly TSS_LAYOUT = 5; + public static readonly TSS_MESSAGE = 6; + public static readonly TSS_NAME = 7; + public static readonly TSS_VERSION = 8; + public static readonly TSS_CAPSONONLY = 9; + public static readonly TSS_CAPSALWAYSOFF = 10; + public static readonly TSS_SHIFTFREESCAPS = 11; + public static readonly TSS_LANGUAGENAME = 12; + + public static readonly TSS_CALLDEFINITION = 13; + public static readonly TSS_CALLDEFINITION_LOADFAILED = 14; + + public static readonly TSS_ETHNOLOGUECODE = 15; + + public static readonly TSS_DEBUG_LINE = 16; + + public static readonly TSS_MNEMONIC = 17; + + public static readonly TSS_INCLUDECODES = 18; + + public static readonly TSS_OLDCHARPOSMATCHING = 19; + + public static readonly TSS_COMPILEDVERSION = 20; + public static readonly TSS_KEYMANCOPYRIGHT = 21; + + public static readonly TSS_CUSTOMKEYMANEDITION = 22; + public static readonly TSS_CUSTOMKEYMANEDITIONNAME = 23; + + /* Keyman 7.0 system stores */ + + public static readonly TSS__KEYMAN_60_MAX = 23; + + public static readonly TSS_VISUALKEYBOARD = 24; + public static readonly TSS_KMW_RTL = 25; + public static readonly TSS_KMW_HELPFILE = 26; + public static readonly TSS_KMW_HELPTEXT = 27; + public static readonly TSS_KMW_EMBEDJS = 28; + + public static readonly TSS_WINDOWSLANGUAGES = 29; + + public static readonly TSS__KEYMAN_70_MAX = 29; + + /* Keyman 8.0 system stores */ + + public static readonly TSS_COMPARISON = 30; + + public static readonly TSS__KEYMAN_80_MAX = 30; + + /* Keyman 9.0 system stores */ + + public static readonly TSS_PLATFORM = 31; + public static readonly TSS_BASELAYOUT = 32; + public static readonly TSS_LAYER = 33; + + public static readonly TSS_PLATFORM_NOMATCH = 0x8001; // Reserved for internal use - after platform statement is run, set to either TSS_PLATFORM_NOMATCH or TSS_PLATFORM_MATCH + public static readonly TSS_PLATFORM_MATCH = 0x8002; // Reserved for internal use - as the result will never change for the lifetime of the process. + + public static readonly TSS_VKDICTIONARY = 34; // Dictionary of virtual key names for v9 dynamic layouts + public static readonly TSS_LAYOUTFILE = 35; // Keyman 9 layer-based JSON OSK + public static readonly TSS_KEYBOARDVERSION = 36; // &keyboardversion system store // I4140 + public static readonly TSS_KMW_EMBEDCSS = 37; + + public static readonly TSS_TARGETS = 38; + + public static readonly TSS__KEYMAN_90_MAX = 38; + + /* Keyman 14.0 system stores */ + + public static readonly TSS_CASEDKEYS = 39; + + public static readonly TSS__KEYMAN_140_MAX = 39; + + /* Keyman 15.0 system stores */ + + public static readonly TSS_BEGIN_NEWCONTEXT = 40; + public static readonly TSS_BEGIN_POSTKEYSTROKE = 41; + public static readonly TSS_NEWLAYER = 42; + public static readonly TSS_OLDLAYER = 43; + + public static readonly TSS__KEYMAN_150_MAX = 43; + + public static readonly TSS__MAX = 43; + + + public static readonly UC_SENTINEL = 0xFFFF; + public static readonly UC_SENTINEL_EXTENDEDEND = 0x10; + + public static readonly U_UC_SENTINEL = "\uFFFF"; + + // + // VK__MAX defines the highest virtual key code defined in the system = 0xFF. Custom VK codes start at 256 + // + + public static readonly VK__MAX = 255; + + // + // Extended String CODE_ values + // + + public static readonly CODE_ANY = 0x01; + public static readonly CODE_INDEX = 0x02; + public static readonly CODE_CONTEXT = 0x03; + public static readonly CODE_NUL = 0x04; + public static readonly CODE_USE = 0x05; + public static readonly CODE_RETURN = 0x06; + public static readonly CODE_BEEP = 0x07; + public static readonly CODE_DEADKEY = 0x08; + // 0x09 = bkspace.-- we don't need to keep this separate though with UC_SENTINEL + public static readonly CODE_EXTENDED = 0x0A; + //public static readonly CODE_EXTENDEDEND = 0x0B; deprecated + public static readonly CODE_SWITCH = 0x0C; + public static readonly CODE_KEY = 0x0D; + public static readonly CODE_CLEARCONTEXT = 0x0E; + public static readonly CODE_CALL = 0x0F; + // UC_SENTINEL_EXTENDEDEND 0x10 + public static readonly CODE_CONTEXTEX = 0x11; + + public static readonly CODE_NOTANY = 0x12; + + public static readonly CODE_KEYMAN70_LASTCODE = 0x12; + + public static readonly CODE_SETOPT = 0x13; + public static readonly CODE_IFOPT = 0x14; + public static readonly CODE_SAVEOPT = 0x15; + public static readonly CODE_RESETOPT = 0x16; + + public static readonly CODE_KEYMAN80_LASTCODE = 0x16; + + /* Keyman 9.0 codes */ + + public static readonly CODE_IFSYSTEMSTORE = 0x17; + public static readonly CODE_SETSYSTEMSTORE = 0x18; + + public static readonly CODE_LASTCODE = 0x18; + + + public static readonly KF_SHIFTFREESCAPS = 0x0001; + public static readonly KF_CAPSONONLY = 0x0002; + public static readonly KF_CAPSALWAYSOFF = 0x0004; + public static readonly KF_LOGICALLAYOUT = 0x0008; + public static readonly KF_AUTOMATICVERSION = 0x0010; + + // 16.0: Support for LDML Keyboards in KMXPlus file format + public static readonly KF_KMXPLUS = 0x0020; + + public static readonly HK_ALT = 0x00010000; + public static readonly HK_CTRL = 0x00020000; + public static readonly HK_SHIFT = 0x00040000; + + public static readonly LCTRLFLAG = 0x0001; // Left Control flag + public static readonly RCTRLFLAG = 0x0002; // Right Control flag + public static readonly LALTFLAG = 0x0004; // Left Alt flag + public static readonly RALTFLAG = 0x0008; // Right Alt flag + public static readonly K_SHIFTFLAG = 0x0010; // Either shift flag + public static readonly K_CTRLFLAG = 0x0020; // Either ctrl flag + public static readonly K_ALTFLAG = 0x0040; // Either alt flag + //public static readonly K_METAFLAG = 0x0080; // Either Meta-key flag (tentative). Not usable in keyboard rules; + // Used internally (currently, only by KMW) to ensure Meta-key + // shortcuts safely bypass rules + // Meta key = Command key on macOS, Windows key on Windows + public static readonly CAPITALFLAG = 0x0100; // Caps lock on + public static readonly NOTCAPITALFLAG = 0x0200; // Caps lock NOT on + public static readonly NUMLOCKFLAG = 0x0400; // Num lock on + public static readonly NOTNUMLOCKFLAG = 0x0800; // Num lock NOT on + public static readonly SCROLLFLAG = 0x1000; // Scroll lock on + public static readonly NOTSCROLLFLAG = 0x2000; // Scroll lock NOT on + public static readonly ISVIRTUALKEY = 0x4000; // It is a Virtual Key Sequence + public static readonly VIRTUALCHARKEY = 0x8000; // Keyman 6.0: Virtual Key Cap Sequence NOT YET + + public static readonly K_MODIFIERFLAG = 0x007F; + public static readonly K_NOTMODIFIERFLAG = 0xFF00; // I4548 + + public static readonly COMP_KEYBOARD_SIZE = 64; + public static readonly COMP_KEYBOARD_KMXPLUSINFO_SIZE = 8; + public static readonly COMP_STORE_SIZE = 12; + public static readonly COMP_GROUP_SIZE = 24; + public static readonly COMP_KEY_SIZE = 20; + + /* In-memory representation of the keyboard */ + + public keyboard: KEYBOARD = { + groups: [], + stores: [] + }; + + constructor() { + + // Binary-correct structures matching kmx_file.h + + this.COMP_STORE = new r.Struct({ + dwSystemID: r.uint32le, + dpName: r.uint32le, + dpString: r.uint32le + }); + + if(this.COMP_STORE.size() != KMXFile.COMP_STORE_SIZE) { + throw "COMP_STORE size is "+this.COMP_STORE.size()+" but should be "+KMXFile.COMP_STORE_SIZE+" bytes"; + } + + this.COMP_KEY = new r.Struct({ + Key: r.uint16le, + _padding: new r.Reserved(r.uint16le), // padding + Line: r.uint32le, + ShiftFlags: r.uint32le, + dpOutput: r.uint32le, + dpContext: r.uint32le + }); + + if(this.COMP_KEY.size() != KMXFile.COMP_KEY_SIZE) { + throw "COMP_KEY size is "+this.COMP_KEY.size()+" but should be "+KMXFile.COMP_KEY_SIZE+" bytes"; + } + + this.COMP_GROUP = new r.Struct({ + dpName: r.uint32le, + dpKeyArray: r.uint32le, // [LPKEY] address of first item in key array + dpMatch: r.uint32le, + dpNoMatch: r.uint32le, + cxKeyArray: r.uint32le, // in array entries + fUsingKeys: r.uint32le // group(xx) [using keys] <-- specified or not + }); + + if(this.COMP_GROUP.size() != KMXFile.COMP_GROUP_SIZE) { + throw "COMP_GROUP size is "+this.COMP_GROUP.size()+" but should be "+KMXFile.COMP_GROUP_SIZE+" bytes"; + } + + this.COMP_KEYBOARD_KMXPLUSINFO = new r.Struct({ + dpKMXPlus: r.uint32le, // 0040 offset of KMXPlus data, header is first + dwKMXPlusSize: r.uint32le // 0044 size in bytes of entire KMXPlus data + }); + + if(this.COMP_KEYBOARD_KMXPLUSINFO.size() != KMXFile.COMP_KEYBOARD_KMXPLUSINFO_SIZE) { + throw "COMP_KEYBOARD_KMXPLUSINFO size is "+this.COMP_KEYBOARD_KMXPLUSINFO.size()+" but should be "+KMXFile.COMP_KEYBOARD_KMXPLUSINFO_SIZE+" bytes"; + } + + this.COMP_KEYBOARD = new r.Struct({ + dwIdentifier: r.uint32le, // 0000 Keyman compiled keyboard id + + dwFileVersion: r.uint32le, // 0004 Version of the file - Keyman 4.0 is 0x0400 + + dwCheckSum: r.uint32le, // 0008 As stored in keyboard + KeyboardID: r.uint32le, // 000C as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts + IsRegistered: r.uint32le, // 0010 + version: r.uint32le, // 0014 keyboard version + + cxStoreArray: r.uint32le, // 0018 in array entries + cxGroupArray: r.uint32le, // 001C in array entries + + dpStoreArray: r.uint32le, // 0020 [LPSTORE] address of first item in store array + dpGroupArray: r.uint32le, // 0024 [LPGROUP] address of first item in group array + + StartGroup_ANSI: r.uint32le, // 0028 index of starting ANSI group + StartGroup_Unicode: r.uint32le, // 0028 index of starting Unicode groups + + dwFlags: r.uint32le, // 0030 Flags for the keyboard file + + dwHotKey: r.uint32le, // 0034 standard windows hotkey (hiword=shift/ctrl/alt stuff, loword=vkey) + + dpBitmapOffset: r.uint32le, // 0038 offset of the bitmaps in the file + dwBitmapSize: r.uint32le // 003C size in bytes of the bitmaps + }); + + if(this.COMP_KEYBOARD.size() != KMXFile.COMP_KEYBOARD_SIZE) { + throw "COMP_KEYBOARD size is "+this.COMP_KEYBOARD.size()+" but should be "+KMXFile.COMP_KEYBOARD_SIZE+" bytes"; + } + } +} \ No newline at end of file diff --git a/common/web/types/src/kmx/string-list.ts b/common/web/types/src/kmx/string-list.ts new file mode 100644 index 0000000000000000000000000000000000000000..4b5716b85d7801e33287df7ce9d914be2745fd64 --- /dev/null +++ b/common/web/types/src/kmx/string-list.ts @@ -0,0 +1,74 @@ +import { Strs, StrsItem } from './kmx-plus.js'; + +/** + * A single entry in a ListItem. + * Contains a StrsItem as its value. + */ +export class ListIndex { + readonly value: StrsItem; // will become index into Strs table + constructor(value: StrsItem) { + this.value = value; + } + isEqual(a: ListIndex | string) { + // so we can compare this to a string + return a.toString() === this.toString(); + } + toString(): string { + return this.value.value; + } +}; + +/** + * A string list in memory. This will be replaced with an index + * into the string table at finalization. + */ +export class ListItem extends Array { + /** + * Construct a new list from an array of strings. + * Use List. This is meant to be called by the List.allocString*() functions. + * @param strs the Strs section is needed to construct this object. + * @param source array of strings + * @returns + */ + constructor(strs: Strs, source: Array) { + super(); + if(!source) { + return; + } + + for (const str of source) { + let index = new ListIndex(strs.allocString(str)); + this.push(index); + } + } + isEqual(a: ListItem | string[]): boolean { + if (a.length != this.length) { + return false; + } + for (let i = 0; i < a.length; i++) { + if (!this[i].isEqual(a[i])) { + return false; + } + } + return true; + } + compareTo(o: ListItem): number { + for (let i = 0; i < Math.min(this.length, o.length); i++) { + const r = this[i].value.compareTo(o[i].value); + if (r !== 0) { + return r; + } + } + // prefix is the same, so go by length: shortest is first. + if (this.length < o.length) { + return -1; + } else if (this.length > o.length) { + return 1; + } else { + return 0; + } + } + toString(): string { + return this.map(v => v.value.value).join(' '); + } +}; diff --git a/common/web/types/src/kpj/keyman-developer-project.ts b/common/web/types/src/kpj/keyman-developer-project.ts new file mode 100644 index 0000000000000000000000000000000000000000..fd4915a228204dd5ebb0d73528ce2483864961b1 --- /dev/null +++ b/common/web/types/src/kpj/keyman-developer-project.ts @@ -0,0 +1,155 @@ +// +// Version 1.0 of Keyman Developer Project .kpj file +// + +import { CompilerCallbacks } from '../util/compiler-interfaces.js'; + +export class KeymanDeveloperProject { + options: KeymanDeveloperProjectOptions; + files: KeymanDeveloperProjectFile[]; + projectPath: string = ''; + + constructor(private projectFilename: string, version: KeymanDeveloperProjectVersion, private callbacks: CompilerCallbacks) { + this.projectPath = this.callbacks.path.dirname(this.projectFilename); + this.options = new KeymanDeveloperProjectOptions(version); + this.files = []; + } + /** + * Adds .kmn, .xml, .kps to project based on options.sourcePath + * @param projectFilename Full path to project.kpj (even if the file doesn't exist) + */ + populateFiles() { + if(this.options.version != '2.0') { + throw new Error('populateFiles can only be called on a v2.0 project'); + } + let sourcePath = this.resolveProjectPath(this.options.sourcePath); + let files = this.callbacks.fs.readdirSync(sourcePath); + for(let filename of files) { + let fullPath = this.callbacks.path.join(sourcePath, filename); + if(filename.match(/\.xml$/i)) { + if(!this.callbacks.fs.readFileSync(fullPath, 'utf-8').match(/ldmlKeyboard\.dtd/)) { + // Skip this .xml because we assume it isn't really a keyboard .xml + continue; + } + } + if(filename.match(/\.(kmn|kps|xml|model\.ts)$/i)) { + let file = new KeymanDeveloperProjectFile20(fullPath, this.callbacks); + this.files.push(file); + } + } + } + + private resolveProjectPath(p: string): string { + // Replace placeholders in the target path + return p.replace('$PROJECTPATH', this.projectPath); + } + + resolveInputFilePath(file: KeymanDeveloperProjectFile): string { + return this.callbacks.resolveFilename(this.projectFilename, file.filePath); + } + + resolveOutputFilePath(file: KeymanDeveloperProjectFile, sourceExt: string, targetExt: string): string { + // Roughly corresponds to Delphi TProject.GetTargetFileName + let p = this.options.version == '1.0' ? + this.options.buildPath || '$SOURCEPATH' : + this.options.buildPath; + + // Replace placeholders in the target path + if(this.options.version == '1.0') { + // TODO: do we need to support $VERSION? + // $SOURCEPATH only supported in 1.0 projects + p = p.replace('$SOURCEPATH', this.callbacks.path.dirname(this.resolveInputFilePath(file))); + } + + p = this.resolveProjectPath(p); + + let f = file.filename.replace(new RegExp(`\\${sourceExt}$`, 'i'), targetExt); + return this.callbacks.path.normalize(this.callbacks.path.join(p, f)); + } + +}; + +export enum KeymanDeveloperProjectType { + Keyboard, + LexicalModel +}; + +export type KeymanDeveloperProjectVersion = + "1.0" | // Keyman Developer <17.0: All files referenced in .kpj + "2.0"; // Keyman Developer 17.0+: Files in sub-folders implicitly included + +export class KeymanDeveloperProjectOptions { + buildPath: string; + sourcePath: string; + compilerWarningsAsErrors: boolean = false; + warnDeprecatedCode: boolean = true; + checkFilenameConventions: boolean = true; + projectType: KeymanDeveloperProjectType = KeymanDeveloperProjectType.Keyboard; + readonly version: KeymanDeveloperProjectVersion; + constructor(version: KeymanDeveloperProjectVersion) { + this.version = version; + switch(version) { + case "1.0": + this.buildPath = ''; + this.sourcePath = ''; + break; + case "2.0": + this.buildPath = '$PROJECTPATH/build'; + this.sourcePath = '$PROJECTPATH/source'; + break; + default: + throw new Error('Invalid version'); + } + } +}; + +export type KeymanDeveloperProjectFile = KeymanDeveloperProjectFile10 | KeymanDeveloperProjectFile20; + +export class KeymanDeveloperProjectFile10 { + readonly id: string; // 1.0 only + readonly filename: string; + readonly filePath: string; + readonly fileVersion: string; // 1.0 only + readonly fileType: string; // file extension of filename, but .model.ts is technically not the ext because of 2 periods + details: KeymanDeveloperProjectFileDetail_Kmn & KeymanDeveloperProjectFileDetail_Kps; // 1.0 only + childFiles: KeymanDeveloperProjectFile[]; // 1.0 only + constructor(id: string, filename: string, filePath: string, fileVersion:string, fileType: string) { + this.details = {}; + this.childFiles = []; + this.id = id; + this.filename = filename; + this.filePath = filePath; + this.fileVersion = fileVersion; + this.fileType = fileType; + } +}; + +export type KeymanDeveloperProjectFileType20 = '.model.ts' | '.kmn' | '.xml' | '.kps'; + +export class KeymanDeveloperProjectFile20 { + readonly filename: string; + readonly filePath: string; + readonly fileType: string; // file extension of filename, but .model.ts is technically not the ext because of 2 periods + constructor(filePath: string, private callbacks: CompilerCallbacks) { + this.filename = this.callbacks.path.basename(filePath); + this.filePath = filePath; + if(this.filename.match(/\.model\.ts$/)) { + // .model.ts is a bit of a hassle... + this.fileType = '.model.ts'; + } else { + this.fileType = this.callbacks.path.extname(this.filename); + } + } +}; + +export class KeymanDeveloperProjectFileDetail_Kps { + name?: string; + copyright?: string; + version?: string; +}; + +export class KeymanDeveloperProjectFileDetail_Kmn { + name?: string; + copyright?: string; + message?: string; +}; diff --git a/common/web/types/src/kpj/kpj-file-reader.ts b/common/web/types/src/kpj/kpj-file-reader.ts new file mode 100644 index 0000000000000000000000000000000000000000..5f768c54f1ea159dccd318e1eb997be1d1d5e5c6 --- /dev/null +++ b/common/web/types/src/kpj/kpj-file-reader.ts @@ -0,0 +1,108 @@ +import * as xml2js from 'xml2js'; +import { KPJFile, KPJFileProject } from './kpj-file.js'; +import { default as AjvModule } from 'ajv'; +const Ajv = AjvModule.default; // The actual expected Ajv type. +import { boxXmlArray } from '../util/util.js'; +import { KeymanDeveloperProject, KeymanDeveloperProjectFile10, KeymanDeveloperProjectType } from './keyman-developer-project.js'; +import { CompilerCallbacks } from '../util/compiler-interfaces.js'; + +export class KPJFileReader { + constructor(private callbacks: CompilerCallbacks) { + + } + + public read(file: Uint8Array): KPJFile { + let data: KPJFile; + + const parser = new xml2js.Parser({ + explicitArray: false, + mergeAttrs: false, + includeWhiteChars: false, + normalize: false, + emptyTag: '' + }); + + parser.parseString(file, (e: unknown, r: unknown) => { data = r as KPJFile }); + data = this.boxArrays(data); + return data as KPJFile; + } + + public validate(source: KPJFile, schemaBuffer: Buffer): void { + const schema = JSON.parse(schemaBuffer.toString('utf8')); + const ajv = new Ajv(); + if(!ajv.validate(schema, source)) { + throw new Error(ajv.errorsText()); + } + } + + private boolFromString(value: string, def: boolean) { + value = (value || '').toLowerCase(); + if(value === 'true') return true; + if(value === 'false') return false; + return def; + } + + public transform(projectFilename: string, source: KPJFile): KeymanDeveloperProject { + // NOTE: at this point, the xml should have been validated + // and matched the schema result so we can assume the source + // is a valid shape + let project = source.KeymanDeveloperProject; + let result: KeymanDeveloperProject = new KeymanDeveloperProject(projectFilename, project.Options?.Version || "1.0", this.callbacks); + if(result.options.version == '2.0') { + result.options.buildPath = (project.Options?.BuildPath || result.options.buildPath).replace(/\\/g, '/'); + result.options.sourcePath = (project.Options?.SourcePath || result.options.sourcePath).replace(/\\/g, '/'); + } else { + result.options.buildPath = (project.Options?.BuildPath || '').replace(/\\/g, '/'); + } + result.options.checkFilenameConventions = this.boolFromString(project.Options?.CheckFilenameConventions, true); + result.options.compilerWarningsAsErrors = this.boolFromString(project.Options?.CompilerWarningsAsErrors, false); + result.options.warnDeprecatedCode = this.boolFromString(project.Options?.WarnDeprecatedCode, true); + result.options.projectType = + project.Options?.ProjectType == 'keyboard' ? KeymanDeveloperProjectType.Keyboard : + project.Options?.ProjectType == 'lexicalmodel' ? KeymanDeveloperProjectType.LexicalModel : + KeymanDeveloperProjectType.Keyboard; // Default is keyboard if missing + + if(result.options.version == '1.0') { + this.transformFilesVersion10(project, result); + } else { + result.populateFiles(); + } + + return result; + } + + private transformFilesVersion10(project: KPJFileProject, result: KeymanDeveloperProject) { + let ids: { [id: string]: KeymanDeveloperProjectFile10; } = {}; + for (let sourceFile of project.Files?.File) { + let file: KeymanDeveloperProjectFile10 = new KeymanDeveloperProjectFile10( + sourceFile.ID || '', + sourceFile.Filename || '', + (sourceFile.Filepath || '').replace(/\\/g, '/'), + sourceFile.FileVersion || '', + sourceFile.FileType || '' + ); + if (sourceFile.Details) { + file.details.copyright = sourceFile.Details.Copyright; + file.details.name = sourceFile.Details.Name; + file.details.message = sourceFile.Details.Message; + file.details.version = sourceFile.Details.Version; + } + if (sourceFile.ParentFileID && ids[sourceFile.ParentFileID]) { + ids[sourceFile.ParentFileID].childFiles.push(file); + } else { + result.files.push(file); + ids[file.id] = file; + } + } + } + + /** + * xml2js will not place single-entry objects into arrays. + * Easiest way to fix this is to box them ourselves as needed + * @param source KVKSourceFile + */ + private boxArrays(source: KPJFile) { + boxXmlArray(source.KeymanDeveloperProject?.Files, 'File'); + return source; + } +} \ No newline at end of file diff --git a/common/web/types/src/kpj/kpj-file.ts b/common/web/types/src/kpj/kpj-file.ts new file mode 100644 index 0000000000000000000000000000000000000000..3de41f7619c12b681f27a95a913a31e6afe7ab1b --- /dev/null +++ b/common/web/types/src/kpj/kpj-file.ts @@ -0,0 +1,52 @@ +/* + * Keyman Developer Project File + */ + + +// These interfaces match XML read by xml2js. Use `KeymanDeveloperProject` +// returned by `KPJFileReader.transform()` for all processing. + +export interface KPJFile { + KeymanDeveloperProject: KPJFileProject; +} + +export interface KPJFileProject { + Options?: KPJFileOptions; // Required + Files?: KPJFileFiles; // Required in 1.0, optional and always ignored in 2.0 +}; + +export interface KPJFileOptions { + BuildPath?: string; // default '' in 1.0, '$PROJECTPATH/build' in 2.0 + SourcePath?: string; // default '' in 1.0, '$PROJECTPATH/source' in 2.0 + CompilerWarningsAsErrors?: string; // default False + WarnDeprecatedCode?: string; // default True + CheckFilenameConventions?: string; // default True + ProjectType?: 'keyboard' | 'lexicalmodel'; // default 'keyboard' + Version?: '1.0' | '2.0'; // default 1.0 +}; + +export interface KPJFileFiles { + File?: KPJFileFile[]; +}; + +export interface KPJFileFile { + ID?: string; + Filename?: string; + Filepath?: string; + FileVersion?: string; + FileType?: string; + Details?: KPJFileFileDetail_Kmn & KPJFileFileDetail_Kps; + ParentFileID?: string; +}; + +export interface KPJFileFileDetail_Kmn { + Name?: string; + Copyright?: string; + Message?: string; +}; + +export interface KPJFileFileDetail_Kps { + Name?: string; + Copyright?: string; + Version?: string; +}; diff --git a/common/web/types/src/kvk/kvk-file-reader.ts b/common/web/types/src/kvk/kvk-file-reader.ts new file mode 100644 index 0000000000000000000000000000000000000000..c3ee89245068e263cd899abd87549ced01d0aa14 --- /dev/null +++ b/common/web/types/src/kvk/kvk-file-reader.ts @@ -0,0 +1,34 @@ +import KVKFile, { BUILDER_KVK_FILE, BUILDER_KVK_HEADER_IDENTIFIER, BUILDER_KVK_HEADER_VERSION } from "./kvk-file.js"; +import { VisualKeyboard, VisualKeyboardKey } from "./visual-keyboard.js"; + +export default class KvkFileReader { + public read(source: Uint8Array): VisualKeyboard { + let binary: BUILDER_KVK_FILE; + let kvk = new KVKFile(); + binary = kvk.KVK_FILE.fromBuffer(source); + if(binary.header.identifier != BUILDER_KVK_HEADER_IDENTIFIER || + binary.header.version != BUILDER_KVK_HEADER_VERSION) { + return null; + } + let result = new VisualKeyboard(); + result.header.version = binary.header.version; + result.header.flags = binary.header.flags; + result.header.associatedKeyboard = binary.header.associatedKeyboard.str; + result.header.ansiFont.color = binary.header.ansiFont.color; + result.header.ansiFont.name = binary.header.ansiFont.name.str; + result.header.ansiFont.size = binary.header.ansiFont.size; + result.header.unicodeFont.color = binary.header.unicodeFont.color; + result.header.unicodeFont.name = binary.header.unicodeFont.name.str; + result.header.unicodeFont.size = binary.header.unicodeFont.size; + for(let binaryKey of binary.keys) { + let key: VisualKeyboardKey = { + flags: binaryKey.flags, + vkey: binaryKey.vkey, + shift: binaryKey.shift, + text: binaryKey.text.str + }; + result.keys.push(key); + } + return result; + } +}; \ No newline at end of file diff --git a/common/web/types/src/kvk/kvk-file-writer.ts b/common/web/types/src/kvk/kvk-file-writer.ts new file mode 100644 index 0000000000000000000000000000000000000000..c2d65d7f2602e0081beecfc60ba5ce9af83e87b1 --- /dev/null +++ b/common/web/types/src/kvk/kvk-file-writer.ts @@ -0,0 +1,72 @@ +import KVKFile, { BUILDER_KVK_FILE, BUILDER_KVK_HEADER_IDENTIFIER, BUILDER_KVK_HEADER_VERSION, BUILDER_KVK_KEY, BUILDER_KVK_STRING } from "./kvk-file.js"; +import { VisualKeyboard } from "./visual-keyboard.js"; + +export default class KvkFileWriter { + /** + * Writes the visual keyboard to a binary .kvk format byte array. + * @param source VisualKeyboard + * @returns Uint8Array, the .kvk file + */ + write(source: VisualKeyboard): Uint8Array { + const binary = this.build(source); + const kvk = new KVKFile(); + const file: Uint8Array = new Uint8Array(kvk.KVK_FILE.size(binary)); + const data = kvk.KVK_FILE.toBuffer(binary); + file.set(data, 0); + return file; + } + + private build(source: VisualKeyboard) { + const binary: BUILDER_KVK_FILE = { + header: { + identifier: BUILDER_KVK_HEADER_IDENTIFIER, + version: BUILDER_KVK_HEADER_VERSION, + associatedKeyboard: {len:0,str:''}, + flags: source.header.flags, + ansiFont:{ + color: source.header.ansiFont.color, + size: source.header.ansiFont.size, + name: {len:0,str:''} + }, + unicodeFont:{ + color: source.header.unicodeFont.color, + size: source.header.unicodeFont.size, + name: {len:0,str:''} + }, + }, + keyCount: source.keys.length, + keys:[] + }; + + this.setString(binary.header.associatedKeyboard, source.header.associatedKeyboard); + this.setString(binary.header.ansiFont.name, source.header.ansiFont.name); + this.setString(binary.header.unicodeFont.name, source.header.unicodeFont.name); + + for(let sourceKey of source.keys) { + const binaryKey: BUILDER_KVK_KEY = { + flags: sourceKey.flags, + vkey: sourceKey.vkey, + shift: sourceKey.shift, + text: { len: 0, str: '' }, + bitmap: 0 + }; + this.setString(binaryKey.text, sourceKey.text || ''); + binary.keys.push(binaryKey); + } + + return binary; + } + + /** + * Fills a kvk string from a source string. Note that the format includes both + * a length word and zero termination. + * + * @param str + * @param value + * @returns number + */ + private setString(str: BUILDER_KVK_STRING, value: string): void { + str.len = value.length + 1; + str.str = value; + } +}; diff --git a/common/web/types/src/kvk/kvk-file.ts b/common/web/types/src/kvk/kvk-file.ts new file mode 100644 index 0000000000000000000000000000000000000000..b3075e5931afea5e6dfaa4295080f36e46bbc4e8 --- /dev/null +++ b/common/web/types/src/kvk/kvk-file.ts @@ -0,0 +1,123 @@ +import * as r from 'restructure'; +// +// Binary backing structures for .kvk format +// matching VisualKeyboardSaverBinary.pas +// + +export const BUILDER_KVK_HEADER_IDENTIFIER = 0x464B564B; // 'KVKF', little-endian +export const KVK_HEADER_IDENTIFIER_BYTES = [0x4B, 0x56, 0x4B, 0x46]; +export const BUILDER_KVK_HEADER_VERSION = 0x0600; // Keyman 6.0 + +export interface BUILDER_KVK_STRING { + len: number; + str: string; +}; + +export interface BUILDER_KVK_FONT { + name: BUILDER_KVK_STRING; // 0000, variable length + size: number; // 4 bytes + color: number; // 4 bytes +}; + +export const BUILDER_KVK_FONT_Size = 8; // size of fixed elements of BUILDER_KVK_FONT + +export const enum BUILDER_KVK_KEY_FLAGS { + kvkkBitmap = 0x01, + kvkkUnicode = 0x02 +}; + +export const enum BUILDER_KVK_SHIFT_STATE { + KVKS_NORMAL = 0, + KVKS_SHIFT = 1, + KVKS_CTRL = 2, + KVKS_ALT = 4, + KVKS_LCTRL = 8, + KVKS_RCTRL = 16, + KVKS_LALT = 32, + KVKS_RALT = 64 +}; + +export interface BUILDER_KVK_KEY { + flags: BUILDER_KVK_KEY_FLAGS; // 0000, 1 byte + shift: number; // 0001, 2 bytes + vkey: number; // 0003, 2 bytes + text: BUILDER_KVK_STRING; // 0005, variable length + bitmap: number; // always 0 // 4 bytes +}; + +export const BUILDER_KVK_KEY_Size = 9; // size of fixed elements of BUILDER_KVK_KEY + +export const enum BUILDER_KVK_HEADER_FLAGS { + kvkh102 = 0x01, + kvkhDisplayUnderlying = 0x02, + kvkhUseUnderlying = 0x04, + kvkhAltGr = 0x08 +}; + +export interface BUILDER_KVK_HEADER { + identifier: number; // 0000, 4 bytes + version: number; // 0004, 4 bytes + flags: BUILDER_KVK_HEADER_FLAGS; // 0008, 1 byte + associatedKeyboard: BUILDER_KVK_STRING; // 0009, variable length + ansiFont: BUILDER_KVK_FONT; // variable length + unicodeFont: BUILDER_KVK_FONT; // variable length +}; + +export const BUILDER_KVK_HEADER_Size = 9 + BUILDER_KVK_FONT_Size + BUILDER_KVK_FONT_Size; // size of fixed elements of BUILDER_KVK_HEADER + +export interface BUILDER_KVK_FILE { + header: BUILDER_KVK_HEADER; // variable length + keyCount: number; // 4 bytes + keys: BUILDER_KVK_KEY[]; // variable length +}; + +export default class KVKFile { + public KVK_HEADER: any; + public KVK_KEY: any; + public KVK_KEYS: any; + public KVK_FONT: any; + public KVK_FILE: any; + public KVK_STRING: any; + + constructor() { + // + // Binary restructure definitions matching VisualKeyboardSaverBinary.pas + // TODO: move binaries to separate kvk-file.ts + // + + this.KVK_STRING = new r.Struct({ + len: r.int16le, + str: new r.String(null, 'utf16le') + }); + + this.KVK_FONT = new r.Struct({ + name: this.KVK_STRING, + size: r.int32le, + color: r.uint32le + }); + + this.KVK_KEY = new r.Struct({ + flags: r.uint8, + shift: r.uint16le, + vkey: r.uint16le, + text: this.KVK_STRING, + bitmap: r.uint32le // always 00 00 00 00 for now + }); + + this.KVK_HEADER = new r.Struct({ + identifier: r.uint32le, // KVKF + version: r.uint32le, // 0x0600 + flags: r.uint8, + associatedKeyboard: this.KVK_STRING, + ansiFont: this.KVK_FONT, + unicodeFont: this.KVK_FONT + }); + + this.KVK_FILE = new r.Struct({ + header: this.KVK_HEADER, + keyCount: r.uint32le, + keys: new r.Array(this.KVK_KEY, 'keyCount') + }); + + } +}; \ No newline at end of file diff --git a/common/web/types/src/kvk/kvks-file-reader.ts b/common/web/types/src/kvk/kvks-file-reader.ts new file mode 100644 index 0000000000000000000000000000000000000000..1a4c5a8b056646a608b1868125d6d0e4a1d76663 --- /dev/null +++ b/common/web/types/src/kvk/kvks-file-reader.ts @@ -0,0 +1,164 @@ +import * as xml2js from 'xml2js'; +import KVKSourceFile from './kvks-file.js'; +import { default as AjvModule } from 'ajv'; +const Ajv = AjvModule.default; // The actual expected Ajv type. +import { boxXmlArray } from '../util/util.js'; +import { VisualKeyboard, VisualKeyboardHeaderFlags, VisualKeyboardKey, VisualKeyboardKeyFlags, VisualKeyboardLegalShiftStates, VisualKeyboardShiftState } from './visual-keyboard.js'; +import { USVirtualKeyCodes } from '../consts/virtual-key-constants.js'; +import { BUILDER_KVK_HEADER_VERSION } from './kvk-file.js'; + +export enum KVKSParseErrorType { invalidVkey }; +export class KVKSParseError extends Error { + public type: KVKSParseErrorType; + public vkey: string; +}; + +export default class KVKSFileReader { + public read(file: Uint8Array): KVKSourceFile { + let source: KVKSourceFile; + + const parser = new xml2js.Parser({ + explicitArray: false, + mergeAttrs: false, + includeWhiteChars: true, + normalize: false, + emptyTag: {} as any + // Why "as any"? xml2js is broken: + // https://github.com/Leonidas-from-XIV/node-xml2js/issues/648 means + // that an old version of `emptyTag` is used which doesn't support + // functions, but DefinitelyTyped is requiring use of function or a + // string. See also notes at + // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59259#issuecomment-1254405470 + // An alternative fix would be to pull xml2js directly from github + // rather than using the version tagged on npmjs.com. + }); + + parser.parseString(file, (e: unknown, r: unknown) => { source = r as KVKSourceFile }); + source = this.boxArrays(source); + this.cleanupUnderscore('visualkeyboard', source.visualkeyboard); + return source; + } + + /** + * The only element that allows spaces is . Remove + * all other empty whitespace-only values. + * @param root + * @param source + */ + private cleanupUnderscore(root: string, source: any) { + if(root != 'key') { + if(source?.['_']?.trim() === '') { + delete source['_']; + } + } + + for(let key of Object.keys(source)) { + if(Array.isArray(source[key])) { + for(let item of source[key]) { + if(typeof(item) === 'object') { + this.cleanupUnderscore(key, item); + } + } + } else if(typeof source[key] === 'object') { + this.cleanupUnderscore(key, source[key]); + } + } + } + + public validate(source: KVKSourceFile, schemaBuffer: Buffer): void { + const schema = JSON.parse(schemaBuffer.toString('utf8')); + const ajv = new Ajv(); + if(!ajv.validate(schema, source)) { + throw new Error(ajv.errorsText()); + } + } + + public transform(source: KVKSourceFile, errors?: KVKSParseError[]): VisualKeyboard { + // NOTE: at this point, the xml should have been validated + // and matched the schema result so we can assume properties exist + let result: VisualKeyboard = { + header: { + version: BUILDER_KVK_HEADER_VERSION, + flags: 0, + ansiFont: { name: "Arial", size: -12, color: 0xFF000008 }, // TODO-LDML: consider defaults + unicodeFont: { name: "Arial", size: -12, color: 0xFF000008 }, // TODO-LDML: consider defaults + associatedKeyboard: source.visualkeyboard?.header?.kbdname, + underlyingLayout: source.visualkeyboard?.header?.layout, + }, + keys: [] + }; + + if(source.visualkeyboard?.header?.flags?.displayunderlying !== undefined) { + result.header.flags |= VisualKeyboardHeaderFlags.kvkhDisplayUnderlying; + } + if(source.visualkeyboard?.header?.flags?.key102 !== undefined) { + result.header.flags |= VisualKeyboardHeaderFlags.kvkh102; + } + if(source.visualkeyboard?.header?.flags?.usealtgr !== undefined) { + result.header.flags |= VisualKeyboardHeaderFlags.kvkhAltGr; + } + if(source.visualkeyboard?.header?.flags?.useunderlying !== undefined) { + result.header.flags |= VisualKeyboardHeaderFlags.kvkhUseUnderlying; + } + + for(let encoding of source.visualkeyboard.encoding) { + let isUnicode = (encoding.$?.name == 'unicode'), + font = isUnicode ? result.header.unicodeFont : result.header.ansiFont; + font.name = encoding.$?.fontname; + font.size = parseInt(encoding.$?.fontsize,10); + for(let layer of encoding.layer) { + let shift = this.kvksShiftToKvkShift(layer.$?.shift); + for(let sourceKey of layer.key) { + let vkey = (USVirtualKeyCodes as any)[sourceKey.$?.vkey]; + if(!vkey) { + if(errors) { + let e = new KVKSParseError(); + e.type = KVKSParseErrorType.invalidVkey; + e.vkey = sourceKey.$?.vkey; + errors.push(e); + } + continue; + } + let key: VisualKeyboardKey = { + flags: isUnicode ? VisualKeyboardKeyFlags.kvkkUnicode : 0, // TODO-LDML: bitmap support + shift: shift, + text: sourceKey._ ?? '', + vkey: vkey + } + result.keys.push(key); + } + } + } + + return result; + } + + /** + * xml2js will not place single-entry objects into arrays. + * Easiest way to fix this is to box them ourselves as needed + * @param source KVKSourceFile + */ + private boxArrays(source: KVKSourceFile) { + boxXmlArray(source.visualkeyboard, 'encoding'); + for(let encoding of source.visualkeyboard.encoding) { + boxXmlArray(encoding, 'layer'); + for(let layer of encoding.layer) { + boxXmlArray(layer, 'key'); + } + } + return source; + } + + + public kvksShiftToKvkShift(shift: string): VisualKeyboardShiftState { + shift = shift.toUpperCase(); + + // TODO-LDML(lowpri): make a map of this? + for(let state of VisualKeyboardLegalShiftStates) { + if(state.name == shift) { + return state.shift; + } + } + return 0; + } +} \ No newline at end of file diff --git a/common/web/types/src/kvk/kvks-file-writer.ts b/common/web/types/src/kvk/kvks-file-writer.ts new file mode 100644 index 0000000000000000000000000000000000000000..613c6caa5108289ac9c99901ddc00a68383313dd --- /dev/null +++ b/common/web/types/src/kvk/kvks-file-writer.ts @@ -0,0 +1,113 @@ +import * as xml2js from 'xml2js'; +import KVKSourceFile, { KVKSEncoding, KVKSFlags, KVKSKey, KVKSLayer } from './kvks-file.js'; +import { VisualKeyboard, VisualKeyboardHeaderFlags, VisualKeyboardKeyFlags, VisualKeyboardLegalShiftStates, VisualKeyboardShiftState } from './visual-keyboard.js'; +import { USVirtualKeyCodes } from '../consts/virtual-key-constants.js'; + +export default class KVKSFileWriter { + public write(vk: VisualKeyboard): string { + + const builder = new xml2js.Builder({ + allowSurrogateChars: true, + attrkey: '$', + charkey: '_', + xmldec: { + version: '1.0', + encoding: 'UTF-8', + standalone: true + } + }) + + let flags: KVKSFlags = {}; + if(vk.header.flags & VisualKeyboardHeaderFlags.kvkhDisplayUnderlying) { + flags.displayunderlying = ''; + } + if(vk.header.flags & VisualKeyboardHeaderFlags.kvkh102) { + flags.key102 = ''; + } + if(vk.header.flags & VisualKeyboardHeaderFlags.kvkhAltGr) { + flags.usealtgr = ''; + } + if(vk.header.flags & VisualKeyboardHeaderFlags.kvkhUseUnderlying) { + flags.useunderlying = ''; + } + + + + let kvks: KVKSourceFile = { + visualkeyboard: { + header: { + version: '10.0', + kbdname: vk.header.associatedKeyboard, + flags: flags, + }, + encoding: [] + } + }; + + if(vk.header.underlyingLayout) kvks.visualkeyboard.header.layout = vk.header.underlyingLayout; + + let encodings: {ansi: {o: KVKSEncoding, l: {[name:string]:KVKSLayer}}, unicode: {o: KVKSEncoding, l: {[name:string]:KVKSLayer}}} = {ansi:null,unicode:null}; + + for(let key of vk.keys) { + const encoding = key.flags & VisualKeyboardKeyFlags.kvkkUnicode ? 'unicode' : 'ansi'; + const shift = this.kvkShiftToKvksShift(key.shift); + + if(!encodings[encoding]) { + encodings[encoding] = { + o: { + layer: [], + $: {name: encoding, + fontname: encoding == 'ansi' ? vk.header.ansiFont.name : vk.header.unicodeFont.name, + fontsize: (encoding == 'ansi' ? vk.header.ansiFont.size : vk.header.unicodeFont.size).toString(), + }, + }, + l: {} + }; + kvks.visualkeyboard.encoding.push(encodings[encoding].o); + } + let e = encodings[encoding]; + if(!e.l[shift]) { + e.l[shift] = { + key: [], + $: {shift: shift}, + }; + e.o.layer.push(e.l[shift]); + } + let l = e.l[shift]; + + // TODO-LDML: map + let vkeyName = ''; + for(let vkey of Object.keys(USVirtualKeyCodes)) { + if((USVirtualKeyCodes as any)[vkey] == key.vkey) { + vkeyName = vkey; + break; + } + } + + if(vkeyName == '') { + //TODO-LDML: warn + continue; + } + let k: KVKSKey = { + $: {vkey: vkeyName}, + _: key.text, + } + + l.key.push(k); + } + + // console.dir(kvks, {depth:8}); + let result = builder.buildObject(kvks); + return result; //Uint8Array.from(result); + } + + public kvkShiftToKvksShift(shift: VisualKeyboardShiftState): string { + // TODO-LDML(lowpri): make a map of this? + for(let state of VisualKeyboardLegalShiftStates) { + if(state.shift == shift) { + return state.name; + } + } + return ''; + } +} \ No newline at end of file diff --git a/common/web/types/src/kvk/kvks-file.ts b/common/web/types/src/kvk/kvks-file.ts new file mode 100644 index 0000000000000000000000000000000000000000..d3884d9a492abe34e60064f168cbc3da8c33c796 --- /dev/null +++ b/common/web/types/src/kvk/kvks-file.ts @@ -0,0 +1,53 @@ +// .kvks xml format +// See VisualKeyboardLoaderXML.pas, not the same as VisualKeyboardImportXML.pas! + +export default interface KVKSourceFile { + /** + * -- the root element. + */ + visualkeyboard: KVKSVisualKeyboard; +} + +export interface KVKSVisualKeyboard { + header?: KVKSHeader; + encoding?: KVKSEncoding[]; +}; + +export interface KVKSHeader { + version?: string; + kbdname?: string; + flags?: KVKSFlags; + layout?: string; +}; + +export interface KVKSFlags { + key102?: string; + displayunderlying?: string; + useunderlying?: string; + usealtgr?: string; +}; + +export interface KVKSEncoding { + $?: { + name?: string; + fontname?: string; + fontsize?: string; + }; + layer?: KVKSLayer[]; +}; + +export interface KVKSLayer { + $?: { + shift?: string; + }; + key?: KVKSKey[]; +}; + +export interface KVKSKey { + $?: { + vkey?: string; + } + bitmap?: string; + _?: string; +}; + diff --git a/common/web/types/src/kvk/visual-keyboard.ts b/common/web/types/src/kvk/visual-keyboard.ts new file mode 100644 index 0000000000000000000000000000000000000000..c1f1d5d7e92c7d7126a0e5569b01905e483399dd --- /dev/null +++ b/common/web/types/src/kvk/visual-keyboard.ts @@ -0,0 +1,80 @@ +// +// Visual Keyboard in-memory data +// +// Corresponds to .kvk / .kvks file data +// + +import { BUILDER_KVK_SHIFT_STATE, BUILDER_KVK_HEADER_FLAGS, BUILDER_KVK_KEY_FLAGS } from "./kvk-file.js"; + +export class VisualKeyboard { + header: VisualKeyboardHeader = {flags: 0, ansiFont:{}, unicodeFont:{}, underlyingLayout: undefined}; + keys: VisualKeyboardKey[] = []; +}; + +export { BUILDER_KVK_HEADER_FLAGS as VisualKeyboardHeaderFlags } from "./kvk-file.js"; + +export class VisualKeyboardHeader { + version?: number; // 0x0600 + flags: BUILDER_KVK_HEADER_FLAGS; + associatedKeyboard?: string; + ansiFont: VisualKeyboardFont; // generally unused + unicodeFont: VisualKeyboardFont; + underlyingLayout?: string; +}; + +export class VisualKeyboardFont { + name?: string; + size?: number; + color?: number; // unused +}; + +export { BUILDER_KVK_KEY_FLAGS as VisualKeyboardKeyFlags } from "./kvk-file.js"; + +export { BUILDER_KVK_SHIFT_STATE as VisualKeyboardShiftState } from "./kvk-file.js"; + +export class VisualKeyboardKey { + flags?: BUILDER_KVK_KEY_FLAGS; + shift?: BUILDER_KVK_SHIFT_STATE; + vkey?: number; + text?: string; + //bitmap: bitmap-image, unsupported in ldml keyboards; may include for round-tripabilty? +}; + +interface VisualKeyboardLegalShiftState { + desc: string; + name: string; + shift: number; + vkeys: number[]; +}; + +import { BUILDER_KVK_SHIFT_STATE as ss } from "./kvk-file.js"; +import { USVirtualKeyCodes as vk } from "../consts/virtual-key-constants.js"; + +export const VisualKeyboardLegalShiftStates: VisualKeyboardLegalShiftState[] = [ + {desc: 'Unshifted', name: '', shift: ss.KVKS_NORMAL, vkeys: []}, //1 + + {desc: 'Shift', name: 'S', shift: ss.KVKS_SHIFT, vkeys: [vk.K_SHIFT]}, + {desc: 'Ctrl', name: 'C', shift: ss.KVKS_CTRL, vkeys: [vk.K_CONTROL]}, + {desc: 'Alt', name: 'A', shift: ss.KVKS_ALT, vkeys: [vk.K_ALT]}, + {desc: 'Shift+Ctrl', name: 'SC', shift: ss.KVKS_SHIFT | ss.KVKS_CTRL, vkeys: [vk.K_SHIFT,vk.K_CONTROL]}, + {desc: 'Shift+Alt', name: 'SA', shift: ss.KVKS_SHIFT | ss.KVKS_ALT, vkeys: [vk.K_SHIFT,vk.K_ALT]}, + {desc: 'Ctrl+Alt', name: 'CA', shift: ss.KVKS_CTRL | ss.KVKS_ALT, vkeys: [vk.K_CONTROL,vk.K_ALT]}, + {desc: 'Shift+Ctrl+Alt', name: 'SCA', shift: ss.KVKS_SHIFT | ss.KVKS_CTRL | ss.KVKS_ALT, vkeys: [vk.K_SHIFT,vk.K_CONTROL,vk.K_ALT]}, //7 + + {desc: 'Left Ctrl', name: 'LC', shift: ss.KVKS_LCTRL, vkeys: [vk.K_LCONTROL]}, + {desc: 'Right Ctrl', name: 'RC', shift: ss.KVKS_RCTRL, vkeys: [vk.K_RCONTROL]}, + {desc: 'Left Alt', name: 'LA', shift: ss.KVKS_LALT, vkeys: [vk.K_LALT]}, + {desc: 'Right Alt', name: 'RA', shift: ss.KVKS_RALT, vkeys: [vk.K_RALT]}, + {desc: 'Shift+Left Ctrl', name: 'SLC', shift: ss.KVKS_SHIFT | ss.KVKS_LCTRL, vkeys: [vk.K_SHIFT,vk.K_LCONTROL]}, + {desc: 'Shift+Right Ctrl', name: 'SRC', shift: ss.KVKS_SHIFT | ss.KVKS_RCTRL, vkeys: [vk.K_SHIFT,vk.K_RCONTROL]}, + {desc: 'Shift+Left Alt', name: 'SLA', shift: ss.KVKS_SHIFT | ss.KVKS_LALT, vkeys: [vk.K_SHIFT,vk.K_LALT]}, + {desc: 'Shift+Right Alt', name: 'SRA', shift: ss.KVKS_SHIFT | ss.KVKS_RALT, vkeys: [vk.K_SHIFT,vk.K_RALT]}, + {desc: 'Left Ctrl+Left Alt', name: 'LCLA', shift: ss.KVKS_LCTRL | ss.KVKS_LALT, vkeys: [vk.K_LCONTROL,vk.K_LALT]}, + {desc: 'Left Ctrl+Right Alt', name: 'LCRA', shift: ss.KVKS_LCTRL | ss.KVKS_RALT, vkeys: [vk.K_LCONTROL,vk.K_RALT]}, + {desc: 'Right Ctrl+Left Alt', name: 'RCLA', shift: ss.KVKS_RCTRL | ss.KVKS_LALT, vkeys: [vk.K_RCONTROL,vk.K_LALT]}, + {desc: 'Right Ctrl+Right Alt', name: 'RCRA', shift: ss.KVKS_RCTRL | ss.KVKS_RALT, vkeys: [vk.K_RCONTROL,vk.K_RALT]}, + {desc: 'Shift+Left Ctrl+Left Alt', name: 'SLCLA', shift: ss.KVKS_SHIFT | ss.KVKS_LCTRL | ss.KVKS_LALT, vkeys: [vk.K_SHIFT, vk.K_LCONTROL,vk.K_LALT]}, + {desc: 'Shift+Left Ctrl+Right Alt', name: 'SLCRA', shift: ss.KVKS_SHIFT | ss.KVKS_LCTRL | ss.KVKS_RALT, vkeys: [vk.K_SHIFT, vk.K_LCONTROL,vk.K_RALT]}, + {desc: 'Shift+Right Ctrl+Left Alt', name: 'SRCLA', shift: ss.KVKS_SHIFT | ss.KVKS_RCTRL | ss.KVKS_LALT, vkeys: [vk.K_SHIFT, vk.K_RCONTROL,vk.K_LALT]}, + {desc: 'Shift+Right Ctrl+Right Alt', name: 'SRCRA', shift: ss.KVKS_SHIFT | ss.KVKS_RCTRL | ss.KVKS_RALT, vkeys: [vk.K_SHIFT, vk.K_RCONTROL,vk.K_RALT]}, //16 +]; diff --git a/common/web/types/src/ldml-keyboard/ldml-keyboard-testdata-xml.ts b/common/web/types/src/ldml-keyboard/ldml-keyboard-testdata-xml.ts new file mode 100644 index 0000000000000000000000000000000000000000..c0a5e9dd6d7289f1cc3c75848389615eea230556 --- /dev/null +++ b/common/web/types/src/ldml-keyboard/ldml-keyboard-testdata-xml.ts @@ -0,0 +1,74 @@ +// +// Conforms to techpreview +// +// The interfaces in this file are designed with reference to the mapped +// structures produced by xml2js when passed a LDML keyboard test data .xml file. +// +// Using prefix LKT for LDML Keyboard Test +// + +export interface LDMLKeyboardTestDataXMLSourceFile { + /** + * -- the root element. + */ + keyboardTest: LKTKeyboardTest; +} + +export interface LKTKeyboardTest { + conformsTo?: string; + info?: LKTInfo; + repertoire?: LKTRepertoire[]; + tests?: LKTTests[]; +}; + +export interface LKTInfo { + author?: string; + keyboard?: string; + name?: string; +}; + +export interface LKTRepertoire { + name?: string; + chars?: string; + type?: string; +}; + +export interface LKTTests { + name?: string; + test?: LKTTest[]; +}; + +export interface LKTTest { + name?: string; + startContext?: LKTStartContext; + actions?: LKTAction[]; // differs from XML, to represent order of actions +}; + +export interface LKTStartContext { + to?: string; +}; + +export interface LKTCheck { + result?: string; +}; + +export interface LKTEmit { + to?: string; +}; + +export interface LKTKeystroke { + key?: string; + flick?: string; + longPress?: string; + tapCount?: string; +}; + +/** + * Test Actions. + * The expectation is that each LKTAction object will have exactly one non-falsy field. + */ +export interface LKTAction { + check?: LKTCheck; + emit?: LKTEmit; + keystroke?: LKTKeystroke; +}; diff --git a/common/web/types/src/ldml-keyboard/ldml-keyboard-xml-reader.ts b/common/web/types/src/ldml-keyboard/ldml-keyboard-xml-reader.ts new file mode 100644 index 0000000000000000000000000000000000000000..35d7f627956417b508e9b358473ce019147afc80 --- /dev/null +++ b/common/web/types/src/ldml-keyboard/ldml-keyboard-xml-reader.ts @@ -0,0 +1,394 @@ +import * as xml2js from 'xml2js'; +import { LDMLKeyboardXMLSourceFile, LKImport } from './ldml-keyboard-xml.js'; +import { default as AjvModule } from 'ajv'; +const Ajv = AjvModule.default; // The actual expected Ajv type. +import { boxXmlArray } from '../util/util.js'; +import { CompilerCallbacks } from '../util/compiler-interfaces.js'; +import { constants } from '@keymanapp/ldml-keyboard-constants'; +import { CommonTypesMessages } from '../util/common-events.js'; +import { LDMLKeyboardTestDataXMLSourceFile, LKTTest, LKTTests } from './ldml-keyboard-testdata-xml.js'; + +interface NameAndProps { + '$'?: any; // content + '#name'?: string; // element name + '$$'?: any; // children +}; + +export default class LDMLKeyboardXMLSourceFileReader { + callbacks: CompilerCallbacks; + + constructor(callbacks : CompilerCallbacks) { + this.callbacks = callbacks; + } + + readImportFile(version: string, subpath: string): Buffer { + // TODO-LDML: sanitize input string + let importPath = new URL(`../import/${version}/${subpath}`, import.meta.url); + return this.callbacks.loadFile(importPath); + } + + /** + * xml2js will not place single-entry objects into arrays. + * Easiest way to fix this is to box them ourselves as needed + * @param source any + * @returns true on success, false on failure + */ + private boxArrays(source: any) : boolean { + if (source?.keyboard) { + if (!source.keyboard.keys) { + source.keyboard.keys = { + key: [], + flicks: [], + }; + } + if (!source.keyboard.keys.import) { + source.keyboard.keys.import = []; + } + } + boxXmlArray(source?.keyboard, 'layers'); + boxXmlArray(source?.keyboard?.displays, 'display'); + boxXmlArray(source?.keyboard?.names, 'name'); + boxXmlArray(source?.keyboard?.vkeys, 'vkey'); + boxXmlArray(source?.keyboard?.keys, 'key'); + boxXmlArray(source?.keyboard?.keys, 'flicks'); + boxXmlArray(source?.keyboard?.locales, 'locale'); + boxXmlArray(source?.keyboard, 'transforms'); + if(source?.keyboard?.layers) { + for(let layers of source?.keyboard?.layers) { + boxXmlArray(layers, 'layer'); + if(layers?.layer) { + for(let layer of layers?.layer) { + boxXmlArray(layer, 'row'); + } + } + } + } + if(source?.keyboard?.keys?.flicks) { + for(let flicks of source?.keyboard?.keys?.flicks) { + boxXmlArray(flicks, 'flick'); + } + } + if(source?.keyboard?.variables) { + boxXmlArray(source?.keyboard?.variables, 'set'); + boxXmlArray(source?.keyboard?.variables, 'string'); + boxXmlArray(source?.keyboard?.variables, 'unicodeSet'); + } + if(source?.keyboard?.transforms) { + for(let transforms of source.keyboard.transforms) { + boxXmlArray(transforms, 'transformGroup'); + for (let transformGroup of transforms.transformGroup) { + boxXmlArray(transformGroup, 'transform'); + boxXmlArray(transformGroup, 'reorder'); + } + } + } + return this.boxImportsAndSpecials(source, 'keyboard'); + } + + /** + * Recurse over object, boxing up any specials or imports + * @param obj any object to be traversed + * @param subtag the leafmost enclosing tag such as 'keyboard' + * @returns true on success, false on failure + */ + private boxImportsAndSpecials(obj: any, subtag: string) : boolean { + if (!obj) return true; + if (Array.isArray(obj)) { + for (const sub of obj) { + // retain the same subtag + if (!this.boxImportsAndSpecials(sub, subtag)) { + return false; + } + } + } else if(typeof obj === 'object') { + for (const key of Object.keys(obj)) { + if (key === 'special') { + boxXmlArray(obj, key); + } else if(key === 'import') { + // Need to 'box it up' first for processing + boxXmlArray(obj, key); + // Now, resolve the import + if (!this.resolveImports(obj, subtag)) { + return false; + } + // now delete the import array we so carefully constructed, the caller does not + // want to see it. + delete obj['import']; + } else { + if (!this.boxImportsAndSpecials(obj[key], key)) { + return false; + } + } + } + } + return true; + } + + /** + * + * @param obj object to be imported into + * @param subtag obj's element tag, e.g. `keys` + * @returns true on success, false on failure + */ + private resolveImports(obj: any, subtag: string) : boolean { + // These are in reverse order, because the imports insert at the beginning of the array. + // first, the explicit imports + for (const asImport of ([...obj['import'] as LKImport[]].reverse())) { + if (!this.resolveOneImport(obj, subtag, asImport)) { + return false; + } + } + // then, the implied imports + if (subtag === 'keys') { + // + if (!this.resolveOneImport(obj, subtag, { + base: constants.cldr_import_base, + path: constants.cldr_implied_keys_import + })) { + return false; + } + } + return true; + } + + /** + * @param obj the object being imported into + * @param subtag obj's element tag, e.g. `keys` + * @param asImport the import structure + * @returns true on success, false on failure + */ + private resolveOneImport(obj: any, subtag: string, asImport: LKImport) : boolean { + const { base, path } = asImport; + if (base !== constants.cldr_import_base) { + this.callbacks.reportMessage(CommonTypesMessages.Error_ImportInvalidBase({base, path, subtag})); + return false; + } + const paths = path.split('/'); + if (paths[0] == '' || paths[1] == '' || paths.length !== 2) { + this.callbacks.reportMessage(CommonTypesMessages.Error_ImportInvalidPath({base, path, subtag})); + return false; + } + const importData: Uint8Array = this.readImportFile(paths[0], paths[1]); + if (!importData || !importData.length) { + this.callbacks.reportMessage(CommonTypesMessages.Error_ImportReadFail({base, path, subtag})); + return false; + } + const importXml: any = this.loadUnboxed(importData); // TODO-LDML: have to load as any because it is an arbitrary part + const importRootNode = importXml[subtag]; // e.g. + + // importXml will have one property: the root element. + if (!importRootNode) { + this.callbacks.reportMessage(CommonTypesMessages.Error_ImportWrongRoot({base, path, subtag})); + return false; + } + // pull all children of importXml[subtag] into obj + for (const subsubtag of Object.keys(importRootNode).reverse()) { // e.g. + const subsubval = importRootNode[subsubtag]; + if (!Array.isArray(subsubval)) { + // This is somewhat of an internal error, indicating that a non-mergeable XML file was imported + // Not exercisable with the standard LDML imports. + this.callbacks.reportMessage(CommonTypesMessages.Error_ImportMergeFail({base, path, subtag, subsubtag})); + return false; + } + if (!obj[subsubtag]) { + obj[subsubtag] = []; // start with empty array + } + obj[subsubtag] = [...subsubval, ...obj[subsubtag]]; + } + return true; + } + + /** + * @returns true if valid, false if invalid + */ + public validate(source: LDMLKeyboardXMLSourceFile | LDMLKeyboardTestDataXMLSourceFile, schemaSource: Buffer): boolean { + const schema = JSON.parse(schemaSource.toString('utf8')); + const ajv = new Ajv(); + if(!ajv.validate(schema, source)) { + for (let err of ajv.errors) { + this.callbacks.reportMessage(CommonTypesMessages.Error_SchemaValidationError({ + instancePath: err.instancePath, + keyword: err.keyword, + message: err.message || 'Unknown AJV Error', // docs say 'message' is optional if 'messages:false' in options + params: Object.entries(err.params || {}).sort().map(([k,v])=>`${k}="${v}"`).join(' '), + })); + } + return false; + } + return true; + } + + loadUnboxed(file: Uint8Array): LDMLKeyboardXMLSourceFile { + let source = (() => { + let a: LDMLKeyboardXMLSourceFile; + let parser = new xml2js.Parser({ + explicitArray: false, + mergeAttrs: true, + includeWhiteChars: false, + emptyTag: {} as any + // Why "as any"? xml2js is broken: + // https://github.com/Leonidas-from-XIV/node-xml2js/issues/648 means + // that an old version of `emptyTag` is used which doesn't support + // functions, but DefinitelyTyped is requiring use of function or a + // string. See also notes at + // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59259#issuecomment-1254405470 + // An alternative fix would be to pull xml2js directly from github + // rather than using the version tagged on npmjs.com. + }); + parser.parseString(file, (e: unknown, r: unknown) => { a = r as LDMLKeyboardXMLSourceFile }); // TODO-LDML: isn't 'e' the error? + return a; + })(); + return source; + } + + /** + * @param file + * @returns source on success, otherwise null + */ + public load(file: Uint8Array): LDMLKeyboardXMLSourceFile | null { + if (!file) { + return null; + } + const source = this.loadUnboxed(file); + if(this.boxArrays(source)) { + return source; + } else { + return null; + } + } + + loadTestDataUnboxed(file: Uint8Array): any { + let source = (() => { + let a: any; + let parser = new xml2js.Parser({ + // explicitArray: false, + preserveChildrenOrder:true, // needed for test data + explicitChildren: true, // needed for test data + // mergeAttrs: true, + // includeWhiteChars: false, + // emptyTag: {} as any + // Why "as any"? xml2js is broken: + // https://github.com/Leonidas-from-XIV/node-xml2js/issues/648 means + // that an old version of `emptyTag` is used which doesn't support + // functions, but DefinitelyTyped is requiring use of function or a + // string. See also notes at + // https://github.com/DefinitelyTyped/DefinitelyTyped/pull/59259#issuecomment-1254405470 + // An alternative fix would be to pull xml2js directly from github + // rather than using the version tagged on npmjs.com. + }); + parser.parseString(file, (e: unknown, r: unknown) => { a = r as any }); // TODO-LDML: isn't 'e' the error? + return a; // Why 'any'? Because we need to box up the $'s into proper properties. + })(); + return source; + } + + /** + * Filter the obj array for a subtag + * @param source array of source objs + * @param subtag subtag to filter on + * @returns + */ + findSubtagArray(source: NameAndProps[], subtag: string): NameAndProps[] { + return source?.filter(o => o['#name'] === subtag); + } + + /** + * Get exactly one element + * @param source + * @param subtag + * @returns + */ + findSubtag(source: NameAndProps[], subtag: string): NameAndProps | null { + const r = this.findSubtagArray(source, subtag); + if (!r || r.length === 0) { + return null; + } else if (r.length === 1) { + return r[0]; + } else { + this.callbacks.reportMessage(CommonTypesMessages.Error_TestDataUnexpectedArray({subtag})); + return null; // ERROR + } + } + + /** + * The default test data stuffer. + * Just gets $ (the attrs) as the body. + * Override to use something more complex, such as including child nodes. + * @param o object to map + * @param r back ref to reader + */ + static readonly defaultMapper = ((o : NameAndProps, r: LDMLKeyboardXMLSourceFileReader) => o?.$); + + /** + * + * @param obj target object + * @param source array of $/#name strings + * @param subtag name to extract + * @param mapper custom mapper function + */ + stuffBoxes(obj: any, source: NameAndProps[], subtag: string, asArray?: boolean, mapper?: (v: NameAndProps, r: LDMLKeyboardXMLSourceFileReader) => any) { + if (!mapper) { + mapper = LDMLKeyboardXMLSourceFileReader.defaultMapper; + } + if (asArray) { + const r = this; + obj[subtag] = this.findSubtagArray(source, subtag)?.map((v) => mapper(v, r)); // extract contents only + } else { + obj[subtag] = mapper(this.findSubtag(source, subtag), this); // run the mapper once + } + } + + boxTestDataArrays(raw: any) : LDMLKeyboardTestDataXMLSourceFile | null { + if (!raw) return null; + const a : LDMLKeyboardTestDataXMLSourceFile = { + keyboardTest: { + conformsTo: raw?.keyboardTest?.$?.conformsTo, + } + }; + + const $$ : NameAndProps[] = raw?.keyboardTest?.$$; + + this.stuffBoxes(a.keyboardTest, $$, 'info'); + this.stuffBoxes(a.keyboardTest, $$, 'repertoire', true); + this.stuffBoxes(a.keyboardTest, $$, 'tests', true, (o, r) => { + // start with basic unpack + const tests : LKTTests = LDMLKeyboardXMLSourceFileReader.defaultMapper(o, r); + // add ingredients + r.stuffBoxes(tests, o.$$, 'test', true, (o, r) => { + // start with basic unpack + const test : LKTTest = LDMLKeyboardXMLSourceFileReader.defaultMapper(o, r); + // add ingredients + const $$ : NameAndProps[] = o.$$; + r.stuffBoxes(test, $$, 'startContext'); // singleton + // now the actions + test.actions = $$.map(v => { + const subtag = v['#name']; + const subv = LDMLKeyboardXMLSourceFileReader.defaultMapper(v, r); + switch(subtag) { + case 'keystroke': return { keystroke: subv }; + case 'check': return { check: subv }; + case 'emit': return { emit: subv }; + case 'startContext': return null; // handled above + default: this.callbacks.reportMessage(CommonTypesMessages.Error_TestDataUnexpectedAction({ subtag })); return null; + } + }).filter(v => v !== null); + return test; + }); + return tests; + }); + + return a; + } + + /** + * @param file test file + * @returns source on success, otherwise null + */ + public loadTestData(file: Uint8Array): LDMLKeyboardTestDataXMLSourceFile | null { + if (!file) { + return null; + } + const source = this.loadTestDataUnboxed(file); + return this.boxTestDataArrays(source); + } +} diff --git a/common/web/types/src/ldml-keyboard/ldml-keyboard-xml.ts b/common/web/types/src/ldml-keyboard/ldml-keyboard-xml.ts new file mode 100644 index 0000000000000000000000000000000000000000..80178c10a8be2c7925ad50f0f373c4e9e55aa912 --- /dev/null +++ b/common/web/types/src/ldml-keyboard/ldml-keyboard-xml.ts @@ -0,0 +1,177 @@ +// +// Conforms to techpreview +// +// The interfaces in this file are designed with reference to the mapped +// structures produced by xml2js when passed a LDML keyboard .xml file. +// +// Using prefix LK for LDML Keyboard +// + +export interface LDMLKeyboardXMLSourceFile { + /** + * -- the root element. + */ + keyboard: LKKeyboard; +} + +export interface LKKeyboard { + locale?: string; + conformsTo?: string; + + locales?: LKLocales; + version?: LKVersion; + info?: LKInfo; + names?: LKNames; + settings?: LKSettings; + keys?: LKKeys; + displays?: LKDisplays; + layers?: LKLayers[]; + vkeys?: LKVkeys; + transforms?: LKTransforms[]; + reorders?: LKReorders; +}; + +/** + * This is defined as an interface, but actually is resolved during the reading phase + */ +export interface LKImport { + /** + * import base, currently `cldr` is supported + */ + base: string; + /** + * path to imported resource, of the form `techpreview/*.xml` + */ + path: string; +}; + +export interface LKLocales { + locale: LKLocale[]; +}; + +export interface LKLocale { + id?: string; +}; + +export interface LKVersion { + number: string; // semver string +} + +export interface LKInfo { + author?: string; + indicator?: string; + layout?: string; + normalization?: string; +}; + +export interface LKNames { + name: LKName[]; +}; + +export interface LKName { + value?: string; +}; + +export interface LKSettings { + fallback: "omit"; + transformFailure: "omit"; + transformPartial: "hide"; +}; + +export interface LKKeys { + key: LKKey[]; + flicks: LKFlicks[]; +}; + +export interface LKKey { + id?: string; + flicks?: string; + to?: string; + gap?: boolean; + switch?: string; + longPress?: string; + longPressDefault?: string; + multiTap?: string; + transform?: "no"; + width?: number; +}; + +export interface LKFlicks { + id?: string; + flick?: LKFlick[]; +}; + +export interface LKFlick { + directions?: string; + to?: string; +}; + +export interface LKLayers { + /** + * `touch`, or hardware `us`, `iso`, `jis`, `abnt2` + */ + form?: string; + /** + * Minimum width in millimeters + */ + minDeviceWidth?: number; + layer?: LKLayer[]; +}; + +export interface LKLayer { + id?: string; + modifier?: string; + row?: LKRow[]; +}; + +export interface LKRow { + keys?: string; +}; + +export interface LKVkeys { + vkey?: LKVkey[]; +}; + +export interface LKVkey { + from?: string; + to?: string; +}; + +export interface LKTransforms { + type?: "simple" | "final"; + transform: LKTransform[]; +}; + +export interface LKTransform { + from?: string; + to?: string; + before?: string; + error?: "fail"; +}; + +export interface LKReorders { + reorder: LKReorder[]; +}; + +export interface LKReorder { + from?: string; + before?: string; + order?: string; + tertiary?: string; + tertiary_base?: string; + prebase?: string; +}; + +export interface LKDisplayOptions { + baseCharacter?: string; +}; + +export interface LKDisplay { + to?: string; + display?: string; +}; + +export interface LKDisplays { + display?: LKDisplay[]; + displayOptions?: LKDisplayOptions; +}; diff --git a/common/web/types/src/main.ts b/common/web/types/src/main.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e7755038403dc3b57ceecc96d2dbd9470a19aa9 --- /dev/null +++ b/common/web/types/src/main.ts @@ -0,0 +1,36 @@ + +export * as KMX from './kmx/kmx.js'; +export * as KMXPlus from './kmx/kmx-plus.js'; +export { default as KMXBuilder } from './kmx/kmx-builder.js'; +export { KmxFileReader } from './kmx/kmx-file-reader.js'; + +export * as VisualKeyboard from './kvk/visual-keyboard.js'; +export { default as KMXPlusBuilder} from './kmx/kmx-plus-builder/kmx-plus-builder.js'; +export { default as KvkFileReader } from './kvk/kvk-file-reader.js'; +export { default as KvksFileReader } from './kvk/kvks-file-reader.js'; +export { default as KvkFileWriter } from './kvk/kvk-file-writer.js'; +export * as KvkFile from './kvk/kvk-file.js'; +export * as KvksFile from './kvk/kvk-file.js'; + +export * as LDMLKeyboard from './ldml-keyboard/ldml-keyboard-xml.js'; +export { LDMLKeyboardTestDataXMLSourceFile } from './ldml-keyboard/ldml-keyboard-testdata-xml.js'; +export { default as LDMLKeyboardXMLSourceFileReader } from './ldml-keyboard/ldml-keyboard-xml-reader.js'; + +export * as Constants from './consts/virtual-key-constants.js'; + +export { CompilerCallbacks, CompilerSchema, CompilerEvent, CompilerErrorNamespace, CompilerErrorSeverity, CompilerPathCallbacks, CompilerFileSystemCallbacks, CompilerMessageSpec, compilerErrorSeverityName, compilerExceptionToString, compilerErrorFormatCode } from './util/compiler-interfaces.js'; +export { CommonTypesMessages } from './util/common-events.js'; + +export * as TouchLayout from './keyman-touch-layout/keyman-touch-layout-file.js'; +export { TouchLayoutFileReader } from './keyman-touch-layout/keyman-touch-layout-file-reader.js'; +export { TouchLayoutFileWriter, TouchLayoutFileWriterOptions } from './keyman-touch-layout/keyman-touch-layout-file-writer.js'; + +export * as KPJ from './kpj/kpj-file.js'; +export { KPJFileReader } from './kpj/kpj-file-reader.js'; +export { KeymanDeveloperProject } from './kpj/keyman-developer-project.js'; + +export * as KpsFile from './package/kps-file.js'; +export * as KmpJsonFile from './package/kmp-json-file.js'; + +export * as util from './util/util.js'; + diff --git a/developer/src/kmlmc/source/package-compiler/kmp-json-file.ts b/common/web/types/src/package/kmp-json-file.ts similarity index 73% rename from developer/src/kmlmc/source/package-compiler/kmp-json-file.ts rename to common/web/types/src/package/kmp-json-file.ts index 3eadb3dd1d91ec5a92ce8528d379ca84f27de408..97c560d1f66a93d638bde76b280b811c0e3a14bf 100644 --- a/developer/src/kmlmc/source/package-compiler/kmp-json-file.ts +++ b/common/web/types/src/package/kmp-json-file.ts @@ -1,4 +1,4 @@ -interface KmpJsonFile { +export interface KmpJsonFile { system: KmpJsonFileSystem; options: KmpJsonFileOptions; info?: KmpJsonFileInfo; @@ -9,12 +9,12 @@ interface KmpJsonFile { strings?: string[]; } -interface KmpJsonFileSystem { +export interface KmpJsonFileSystem { keymanDeveloperVersion: string; fileVersion: string; } -interface KmpJsonFileOptions { +export interface KmpJsonFileOptions { readmeFile?: string; graphicFile?: string; executeProgram?: string; @@ -22,7 +22,7 @@ interface KmpJsonFileOptions { msiOptions?: string; } -interface KmpJsonFileInfo { +export interface KmpJsonFileInfo { website?: KmpJsonFileInfoItem; version?: KmpJsonFileInfoItem; name?: KmpJsonFileInfoItem; @@ -30,29 +30,29 @@ interface KmpJsonFileInfo { author?: KmpJsonFileInfoItem; } -interface KmpJsonFileInfoItem { +export interface KmpJsonFileInfoItem { description: string; url?: string; } -interface KmpJsonFileContentFile { +export interface KmpJsonFileContentFile { name: string; description: string; copyLocation?: number; } -interface KmpJsonFileLexicalModel { +export interface KmpJsonFileLexicalModel { name: string; id: string; languages: KmpJsonFileLanguage[]; } -interface KmpJsonFileLanguage { +export interface KmpJsonFileLanguage { name: string; id: string; } -interface KmpJsonFileKeyboard { +export interface KmpJsonFileKeyboard { name: string; id: string; version: string; @@ -62,13 +62,13 @@ interface KmpJsonFileKeyboard { languages?: KmpJsonFileLanguage[]; } -interface KmpJsonFileStartMenu { +export interface KmpJsonFileStartMenu { folder?: string; addUninstallEntry?: boolean; items?: KmpJsonFileStartMenuItem[]; } -interface KmpJsonFileStartMenuItem { +export interface KmpJsonFileStartMenuItem { name: string; filename: string; arguments?: string; diff --git a/developer/src/kmlmc/source/package-compiler/kps-file.ts b/common/web/types/src/package/kps-file.ts similarity index 68% rename from developer/src/kmlmc/source/package-compiler/kps-file.ts rename to common/web/types/src/package/kps-file.ts index ab2774f3aafe6715f4087a131f6805ab8ef85441..3e9ff53bc443963e653241973cd64b92bb7a74f0 100644 --- a/developer/src/kmlmc/source/package-compiler/kps-file.ts +++ b/common/web/types/src/package/kps-file.ts @@ -13,14 +13,14 @@ // * Strings element is not yet checked to be correct // -interface KpsPackage { +export interface KpsPackage { /** * -- the root element. */ package: KpsFile; } -interface KpsFile { +export interface KpsFile { system: KpsFileSystem; options: KpsFileOptions; info?: KpsFileInfo; @@ -31,84 +31,84 @@ interface KpsFile { strings?: KpsFileStrings; } -interface KpsFileSystem { +export interface KpsFileSystem { keymanDeveloperVersion: string; fileVersion: string; } -interface KpsFileOptions { +export interface KpsFileOptions { followKeyboardVersion?: string; - readmeFile?: string; + readMeFile?: string; graphicFile?: string; executeProgram?: string; - msiFilename?: string; + msiFileName?: string; msiOptions?: string; } -interface KpsFileInfo { +export interface KpsFileInfo { name?: KpsFileInfoItem; copyright?: KpsFileInfoItem; author?: KpsFileInfoItem; - website?: KpsFileInfoItem; + webSite?: KpsFileInfoItem; version?: KpsFileInfoItem; } -interface KpsFileInfoItem { +export interface KpsFileInfoItem { _: string; $: { URL: string }; } -interface KpsFileContentFiles { +export interface KpsFileContentFiles { file: KpsFileContentFile[] | KpsFileContentFile; } -interface KpsFileContentFile { +export interface KpsFileContentFile { name: string; description: string; copyLocation: string; fileType: string; } -interface KpsFileLexicalModel { +export interface KpsFileLexicalModel { name: string; iD: string; languages: KpsFileLanguages; } -interface KpsFileLexicalModels { +export interface KpsFileLexicalModels { lexicalModel: KpsFileLexicalModel[] | KpsFileLexicalModel; } -interface KpsFileLanguages { +export interface KpsFileLanguages { language: KpsFileLanguage[] | KpsFileLanguage; } -interface KpsFileLanguage { +export interface KpsFileLanguage { _: string; $: { ID: string } } -interface KpsFileKeyboard { - name: string; - iD: string; +export interface KpsFileKeyboard { + name: string; /// the descriptive name of the keyboard + iD: string; /// the keyboard identifier, equal to the basename of the keyboard file sans extension version: string; - oskFont?: string; + oSKFont?: string; displayFont?: string; rtl?: boolean; languages?: KpsFileLanguages; } -interface KpsFileKeyboards { +export interface KpsFileKeyboards { keyboard: KpsFileKeyboard[] | KpsFileKeyboard; } -interface KpsFileStartMenu { +export interface KpsFileStartMenu { folder?: string; addUninstallEntry?: string; items?: KpsFileStartMenuItems; } -interface KpsFileStartMenuItem { +export interface KpsFileStartMenuItem { name: string; filename: string; arguments?: string; @@ -116,11 +116,11 @@ interface KpsFileStartMenuItem { location?: string; } -interface KpsFileStartMenuItems { +export interface KpsFileStartMenuItems { item: KpsFileStartMenuItem[] | KpsFileStartMenuItem; } -interface KpsFileStrings { +export interface KpsFileStrings { //TODO: validate this structure string: string[] | string; } diff --git a/common/web/types/src/restructure.d.ts b/common/web/types/src/restructure.d.ts new file mode 100644 index 0000000000000000000000000000000000000000..9750d24473a47d9671b3a4cdfa26ea9be0b139a7 --- /dev/null +++ b/common/web/types/src/restructure.d.ts @@ -0,0 +1,2 @@ +// TODO: consider defining more types? +declare module 'restructure'; \ No newline at end of file diff --git a/common/web/types/src/util/common-events.ts b/common/web/types/src/util/common-events.ts new file mode 100644 index 0000000000000000000000000000000000000000..b8b33005504cfab620efa0cf78716808a4e2070c --- /dev/null +++ b/common/web/types/src/util/common-events.ts @@ -0,0 +1,50 @@ +import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec as m } from './compiler-interfaces.js'; +import { constants } from '@keymanapp/ldml-keyboard-constants'; + +const CommonTypesErrMask = CompilerErrorNamespace.CommonTypes; +// const SevInfo = CompilerErrorSeverity.Info | CommonTypesErrMask; +// const SevHint = CompilerErrorSeverity.Hint | CommonTypesErrMask; +// const SevWarn = CompilerErrorSeverity.Warn | CommonTypesErrMask; +const SevError = CompilerErrorSeverity.Error | CommonTypesErrMask; +// const SevFatal = CompilerErrorSeverity.Fatal | CommonTypesErrMask; + +export class CommonTypesMessages { + // structured Ajv validation error + static Error_SchemaValidationError = (o:{instancePath:string, keyword:string, message: string, params: string}) => m(this.ERROR_SchemaValidationError, + `Error validating LDML XML file: ${o.instancePath}: ${o.keyword}: ${o.message} ${o.params}`); + static ERROR_SchemaValidationError = SevError | 0x0001; + + static Error_ImportInvalidBase = (o: { base: string, path: string, subtag: string }) => + m(this.ERROR_ImportInvalidBase, + `Import element with base ${o.base} is unsupported. Only ${constants.cldr_import_base} is supported.`); + static ERROR_ImportInvalidBase = SevError | 0x0002; + + static Error_ImportInvalidPath = (o: { base: string, path: string, subtag: string }) => + m(this.ERROR_ImportInvalidPath, + `Import element with invalid path ${o.path}: expected the form '${constants.cldr_version_latest}./*.xml`); + static ERROR_ImportInvalidPath = SevError | 0x0003; + + static Error_ImportReadFail = (o: { base: string, path: string, subtag: string }) => + m(this.ERROR_ImportReadFail, + `Import could not read data with path ${o.path}: expected the form '${constants.cldr_version_latest}./*.xml'`); + static ERROR_ImportReadFail = SevError | 0x0004; + + static Error_ImportWrongRoot = (o: { base: string, path: string, subtag: string }) => + m(this.ERROR_ImportWrongRoot, + `Invalid import file ${o.path}: expected ${o.subtag} as root element.`); + static ERROR_ImportWrongRoot = SevError | 0x0005; + + static Error_ImportMergeFail = (o: { base: string, path: string, subtag: string, subsubtag: string }) => + m(this.ERROR_ImportMergeFail, + `Problem importing ${o.path}: not sure how to handle non-array ${o.subtag}.${o.subsubtag}`); + static ERROR_ImportMergeFail = SevError | 0x0006; + + static Error_TestDataUnexpectedArray = (o: {subtag: string}) => + m(this.ERROR_TestDataUnexpectedArray, + `Problem reading test data: expected single ${o.subtag} element, found multiple`); + static ERROR_TestDataUnexpectedArray = SevError | 0x0007; + static Error_TestDataUnexpectedAction = (o: {subtag: string}) => + m(this.ERROR_TestDataUnexpectedAction, + `Problem reading test data: unexpected action element ${o.subtag}`); + static ERROR_TestDataUnexpectedAction = SevError | 0x0008; +}; diff --git a/common/web/types/src/util/compiler-interfaces.ts b/common/web/types/src/util/compiler-interfaces.ts new file mode 100644 index 0000000000000000000000000000000000000000..c7058b157854c100efeae32bea4d8503f16fb68d --- /dev/null +++ b/common/web/types/src/util/compiler-interfaces.ts @@ -0,0 +1,158 @@ +/** + * Abstract interface for compiler error and warning messages + */ +export interface CompilerEvent { + filename?: string; + line?: number; + code: number; + message: string; +}; + +export enum CompilerErrorSeverity { + Info = 0x000000, // Informational, not necessarily a problem + Hint = 0x100000, // Something the user might want to be aware of + Warn = 0x200000, // Warning: Not great, but we can keep going. + Error = 0x300000, // Severe error where we can't continue + Fatal = 0x400000, // OOM or should-not-happen internal problem + + Severity_Mask = 0xF00000, // includes reserved bits + Error_Mask = 0x0FFFFF, +}; + +export function compilerErrorSeverityName(code: number): string { + let severity = code & CompilerErrorSeverity.Severity_Mask; + switch(severity) { + case CompilerErrorSeverity.Info: return 'INFO'; + case CompilerErrorSeverity.Hint: return 'HINT'; + case CompilerErrorSeverity.Warn: return 'WARN'; + case CompilerErrorSeverity.Error: return 'ERROR'; + case CompilerErrorSeverity.Fatal: return 'FATAL'; + /* istanbul ignore next */ + default: return 'UNKNOWN'; + } +} + +/** + * Format the error code number + * example: "FATAL:0x03004" + */ +export function compilerErrorFormatCode(code: number): string { + const severity = code & CompilerErrorSeverity.Severity_Mask; + const severityName = compilerErrorSeverityName(severity); + const errorCode = code & CompilerErrorSeverity.Error_Mask; + const errorCodeString = Number(errorCode).toString(16).padStart(5,'0'); + return `${severityName}:0x${errorCodeString}`; +} + +/** + * Defines the error code ranges for various compilers. Once defined, these + * ranges must not be changed as external modules may depend on specific error + * codes. Individual errors are defined at a compiler level, for example, + * kmc-ldml/src/compiler/messages.ts. + */ +export enum CompilerErrorNamespace { + /** + * kmc-ldml errors between 0x0000…0x0FFF + */ + LdmlKeyboardCompiler = 0x0000, + /** + * common/web/types errors between 0x1000…0x1FFF + */ + CommonTypes = 0x1000, + /** + * kmc-kmn errors between 0x2000…0x2FFF; these map to + * the base codes found in kmn_compiler_errors.h, exclusive severity flags + */ + KmnCompiler = 0x2000, + /** + * kmc-model errors between 0x3000…0x3FFF + */ + ModelCompiler = 0x3000, + /** + * kmc-package errors between 0x4000…0x4FFF + */ + PackageCompiler = 0x4000, + /** + * kmc and related infrastructure errors between 0x5000…0x5FFF; + */ + Infrastructure = 0x5000, +}; + +export type CompilerSchema = + 'ldml-keyboard' | + 'ldml-keyboardtest' | + 'kvks' | + 'kpj'; + // | 'keyman-touch-layout.clean'; TODO this has the wrong name pattern, .spec.json instead of .schema.json + +/** + * A mapping for common path operations, maps to Node path module. This only + * defines the functions we are actually using, so that we can port more easily + * between different systems. + */ +export interface CompilerPathCallbacks { + dirname(name: string): string; + extname(name: string): string; + basename(name: string, ext?: string): string; + isAbsolute(name: string): boolean; + join(...paths: string[]): string; + normalize(p: string): string; +} + +/** + * A mapping for common filesystem operations, maps to Node fs module. This only + * defines the functions we are actually using, so that we can port more easily + * between different systems. + */ +export interface CompilerFileSystemCallbacks { + readdirSync(name: string): string[]; + readFileSync(path: string, options?: { encoding?: null; flag?: string; } | null): Uint8Array; + readFileSync(path: string, options: { encoding: string; flag?: string; } | string): string; + readFileSync(path: string, options?: { encoding?: string | null; flag?: string; } | string | null): string | Uint8Array; + + existsSync(name: string): boolean; +} + +/** + * Abstract interface for callbacks, to abstract out file i/o + */ +export interface CompilerCallbacks { + /** + * Attempt to load a file. Return falsy if not found. + * TODO: accept only string + * TODO: never return falsy, just throw if not found? + * TODO: Buffer is Node-only. + * @param baseFilename + * @param filename + */ + loadFile(filename: string | URL): Buffer; + + get path(): CompilerPathCallbacks; + get fs(): CompilerFileSystemCallbacks; + + /** + * Resolves a file path relative to the baseFilename + * @param baseFilename + * @param filename + */ + resolveFilename(baseFilename: string, filename: string): string; + + loadSchema(schema: CompilerSchema): Buffer; + reportMessage(event: CompilerEvent): void; + debug(msg: string): void; +}; + +/** + * Convenience function for constructing CompilerEvents + * @param code + * @param message + * @returns + */ +export const CompilerMessageSpec = (code: number, message: string) : CompilerEvent => { return { code, message } }; + +/** + * @param e Error-like + */ +export function compilerExceptionToString(e?: any) : string { + return `${(e ?? 'unknown error').toString()}\n\nCall stack:\n${(e instanceof Error ? e.stack : (new Error()).stack)}`; +} diff --git a/common/web/types/src/util/util.ts b/common/web/types/src/util/util.ts new file mode 100644 index 0000000000000000000000000000000000000000..7d70d001d4ca243ff210eeed28be6a661a84e527 --- /dev/null +++ b/common/web/types/src/util/util.ts @@ -0,0 +1,68 @@ +/** + * xml2js will not place single-entry objects into arrays. 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 + * @param x Name of element to box + */ +export function boxXmlArray(o: any, x: string): void { + if(typeof o == 'object' && !Array.isArray(o[x])) { + if(o[x] === null || o[x] === undefined) { + o[x] = []; + } + else { + o[x] = [o[x]]; + } + } +} + +// TODO-LDML: #7569 the below regex works, but captures more than it should +// (it would include \u{fffffffffffffffff } which +// is overlong and has a space at the end.) The second regex does not work yet. +const MATCH_HEX_ESCAPE = /\\u{([0-9a-fA-F ]{1,})}/g; +// const MATCH_HEX_ESCAPE = /\\u{((?:(?:[0-9a-fA-F]{1,5})|(?:10[0-9a-fA-F]{4})(?: (?!}))?)+)}/g; + +export class UnescapeError extends Error { +} + +/** + * Unescapes a string according to UTS#18§1.1, see + * @param s escaped string + * @returns + */ +export function unescapeString(s: string): string { + if(!s) { + return s; + } + try { + /** + * Unescape one codepoint + * @param hex one codepoint in hex, such as '0127' + * @returns the unescaped codepoint + */ + function unescapeOne(hex: string) : string { + const codepoint = Number.parseInt(hex, 16); + return String.fromCodePoint(codepoint); + } + /** + * process one regex match + * @param str ignored + * @param matched the entire match such as '0127' or '22 22' + * @returns the unescaped match + */ + function processMatch(str: string, matched: string) : string { + const codepoints = matched.split(' '); + const unescaped = codepoints.map(unescapeOne); + return unescaped.join(''); + } + s = s.replaceAll(MATCH_HEX_ESCAPE, processMatch); + } catch(e) { + if (e instanceof RangeError) { + throw new UnescapeError(`Out of range while unescaping '${s}': ${e.message}`, { cause: e }); + } else { + throw e; + } + } + + return s; +} diff --git a/common/web/types/test/fixtures/import-minimal.xml b/common/web/types/test/fixtures/import-minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..500367699d160340436437e850357c792b14a8ce --- /dev/null +++ b/common/web/types/test/fixtures/import-minimal.xml @@ -0,0 +1,8 @@ + + + + + + + + diff --git a/common/web/types/test/fixtures/import-minimal1.xml b/common/web/types/test/fixtures/import-minimal1.xml new file mode 100644 index 0000000000000000000000000000000000000000..439741d04159bf00e676d6d1d35cbcf5281b9876 --- /dev/null +++ b/common/web/types/test/fixtures/import-minimal1.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/common/web/types/test/fixtures/import-minimal2.xml b/common/web/types/test/fixtures/import-minimal2.xml new file mode 100644 index 0000000000000000000000000000000000000000..f04e32d6736acfc8a9559ef20d0c6ba22441a5e3 --- /dev/null +++ b/common/web/types/test/fixtures/import-minimal2.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/common/web/types/test/fixtures/import-symbols.xml b/common/web/types/test/fixtures/import-symbols.xml new file mode 100644 index 0000000000000000000000000000000000000000..9ca4638204bda784b58d935321f948cda98d68e5 --- /dev/null +++ b/common/web/types/test/fixtures/import-symbols.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + diff --git a/common/web/types/test/fixtures/invalid-conforms-to.xml b/common/web/types/test/fixtures/invalid-conforms-to.xml new file mode 100644 index 0000000000000000000000000000000000000000..e2fdf8e4229c3aaf00d9d3f82daf2d89763c6792 --- /dev/null +++ b/common/web/types/test/fixtures/invalid-conforms-to.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + diff --git a/common/web/types/test/fixtures/invalid-import-base.xml b/common/web/types/test/fixtures/invalid-import-base.xml new file mode 100644 index 0000000000000000000000000000000000000000..3b56f1feeb7235069377103c92dd85efb67d348c --- /dev/null +++ b/common/web/types/test/fixtures/invalid-import-base.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/common/web/types/test/fixtures/invalid-import-path.xml b/common/web/types/test/fixtures/invalid-import-path.xml new file mode 100644 index 0000000000000000000000000000000000000000..a9e670f8822c12687a9f809a2ce48d34d971ecbc --- /dev/null +++ b/common/web/types/test/fixtures/invalid-import-path.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/common/web/types/test/fixtures/invalid-import-readfail.xml b/common/web/types/test/fixtures/invalid-import-readfail.xml new file mode 100644 index 0000000000000000000000000000000000000000..e254b55350500d91826205a5213db7179eb61317 --- /dev/null +++ b/common/web/types/test/fixtures/invalid-import-readfail.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/common/web/types/test/fixtures/invalid-import-wrongroot.xml b/common/web/types/test/fixtures/invalid-import-wrongroot.xml new file mode 100644 index 0000000000000000000000000000000000000000..522e106e860ffd18ddcd2091a30688cdcd4cc998 --- /dev/null +++ b/common/web/types/test/fixtures/invalid-import-wrongroot.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/common/web/types/test/fixtures/invalid-structure-per-dtd.xml b/common/web/types/test/fixtures/invalid-structure-per-dtd.xml new file mode 100644 index 0000000000000000000000000000000000000000..be504fdbf9e15bc516aba102c2df7f68e7e1b6cc --- /dev/null +++ b/common/web/types/test/fixtures/invalid-structure-per-dtd.xml @@ -0,0 +1,8 @@ + + + + + diff --git a/common/web/types/test/fixtures/keyman-touch-layout/khmer_angkor.keyman-touch-layout b/common/web/types/test/fixtures/keyman-touch-layout/khmer_angkor.keyman-touch-layout new file mode 100644 index 0000000000000000000000000000000000000000..711f84900839ee67b03213427c5591a98e2a0080 --- /dev/null +++ b/common/web/types/test/fixtures/keyman-touch-layout/khmer_angkor.keyman-touch-layout @@ -0,0 +1,1950 @@ +{ + "tablet": { + "displayUnderlying": false, + "layer": [ + { + "id": "default", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "១" + }, + { + "id": "K_2", + "text": "២" + }, + { + "id": "K_3", + "text": "៣" + }, + { + "id": "K_4", + "text": "៤" + }, + { + "id": "K_5", + "text": "៥" + }, + { + "id": "K_6", + "text": "៦" + }, + { + "id": "K_7", + "text": "៧" + }, + { + "id": "K_8", + "text": "៨" + }, + { + "id": "K_9", + "text": "៩" + }, + { + "id": "K_0", + "text": "០" + }, + { + "id": "K_HYPHEN", + "text": "ឥ" + }, + { + "id": "K_EQUAL", + "text": "ឲ" + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_Q", + "text": "ឆ", + "pad": "75" + }, + { + "id": "K_W", + "text": "" + }, + { + "id": "K_E", + "text": "" + }, + { + "id": "K_R", + "text": "រ" + }, + { + "id": "K_T", + "text": "ត" + }, + { + "id": "K_Y", + "text": "យ" + }, + { + "id": "K_U", + "text": "" + }, + { + "id": "K_I", + "text": "" + }, + { + "id": "K_O", + "text": "" + }, + { + "id": "K_P", + "text": "ផ" + }, + { + "id": "K_LBRKT", + "text": "" + }, + { + "id": "K_RBRKT", + "text": "ឪ" + }, + { + "id": "T_new_138", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_BKQUOTE", + "text": "«" + }, + { + "id": "K_A", + "text": "" + }, + { + "id": "K_S", + "text": "ស" + }, + { + "id": "K_D", + "text": "ដ" + }, + { + "id": "K_F", + "text": "ថ" + }, + { + "id": "K_G", + "text": "ង" + }, + { + "id": "K_H", + "text": "ហ" + }, + { + "id": "K_J", + "text": "" + }, + { + "id": "K_K", + "text": "ក" + }, + { + "id": "K_L", + "text": "ល" + }, + { + "id": "K_COLON", + "text": "" + }, + { + "id": "K_QUOTE", + "text": "" + }, + { + "id": "K_BKSLASH", + "text": "ឮ" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_SHIFT", + "text": "*Shift*", + "width": "160", + "sp": "1", + "nextlayer": "shift" + }, + { + "id": "K_oE2", + "text": "" + }, + { + "id": "K_Z", + "text": "ឋ" + }, + { + "id": "K_X", + "text": "ខ" + }, + { + "id": "K_C", + "text": "ច" + }, + { + "id": "K_V", + "text": "វ" + }, + { + "id": "K_B", + "text": "ប" + }, + { + "id": "K_N", + "text": "ន" + }, + { + "id": "K_M", + "text": "ម" + }, + { + "id": "K_COMMA", + "text": "" + }, + { + "id": "K_PERIOD", + "text": "។" + }, + { + "id": "K_SLASH", + "text": "" + }, + { + "id": "T_new_164", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 5, + "key": [ + { + "id": "K_LCONTROL", + "text": "*AltGr*", + "width": "160", + "sp": "1", + "nextlayer": "rightalt" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "160", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "​", + "width": "930" + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "160", + "sp": "1" + } + ] + } + ] + }, + { + "id": "rightalt", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "‌" + }, + { + "id": "K_2", + "text": "@" + }, + { + "id": "K_3", + "text": "" + }, + { + "id": "K_4", + "text": "$" + }, + { + "id": "K_5", + "text": "€" + }, + { + "id": "K_6", + "text": "៙" + }, + { + "id": "K_7", + "text": "៚" + }, + { + "id": "K_8", + "text": "*" + }, + { + "id": "K_9", + "text": "{" + }, + { + "id": "K_0", + "text": "}" + }, + { + "id": "K_HYPHEN", + "text": "≈" + }, + { + "id": "K_EQUAL", + "text": "" + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_Q", + "text": "ៜ", + "pad": "75" + }, + { + "id": "K_W", + "text": "" + }, + { + "id": "K_E", + "text": "ឯ" + }, + { + "id": "K_R", + "text": "ឫ" + }, + { + "id": "K_T", + "text": "ឨ" + }, + { + "id": "K_Y", + "text": "[" + }, + { + "id": "K_U", + "text": "]" + }, + { + "id": "K_I", + "text": "ឦ" + }, + { + "id": "K_O", + "text": "ឱ" + }, + { + "id": "K_P", + "text": "ឰ" + }, + { + "id": "K_LBRKT", + "text": "ឩ" + }, + { + "id": "K_RBRKT", + "text": "ឳ" + }, + { + "id": "T_new_307", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_BKQUOTE", + "text": "‍" + }, + { + "id": "K_A", + "text": "+" + }, + { + "id": "K_S", + "text": "-" + }, + { + "id": "K_D", + "text": "×" + }, + { + "id": "K_F", + "text": "÷" + }, + { + "id": "K_G", + "text": ":" + }, + { + "id": "K_H", + "text": "‘" + }, + { + "id": "K_J", + "text": "’" + }, + { + "id": "K_K", + "text": "ឝ" + }, + { + "id": "K_L", + "text": "៘" + }, + { + "id": "K_COLON", + "text": "៖" + }, + { + "id": "K_QUOTE", + "text": "ៈ" + }, + { + "id": "K_BKSLASH", + "text": "\\" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_SHIFT", + "text": "*Shift*", + "width": "160", + "sp": "1", + "nextlayer": "shift" + }, + { + "id": "K_oE2", + "text": "" + }, + { + "id": "K_Z", + "text": "<" + }, + { + "id": "K_X", + "text": ">" + }, + { + "id": "K_C", + "text": "#" + }, + { + "id": "K_V", + "text": "&" + }, + { + "id": "K_B", + "text": "ឞ" + }, + { + "id": "K_N", + "text": ";" + }, + { + "id": "K_M", + "text": "" + }, + { + "id": "K_COMMA", + "text": "," + }, + { + "id": "K_PERIOD", + "text": "." + }, + { + "id": "K_SLASH", + "text": "/" + }, + { + "id": "T_new_333", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 5, + "key": [ + { + "id": "K_LCONTROL", + "text": "*AltGr*", + "width": "160", + "sp": "2", + "nextlayer": "default" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "160", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": " ", + "width": "930" + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "160", + "sp": "1" + } + ] + } + ] + }, + { + "id": "shift", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "!" + }, + { + "id": "K_2", + "text": "ៗ" + }, + { + "id": "K_3", + "text": "\"" + }, + { + "id": "K_4", + "text": "៛" + }, + { + "id": "K_5", + "text": "%" + }, + { + "id": "K_6", + "text": "" + }, + { + "id": "K_7", + "text": "" + }, + { + "id": "K_8", + "text": "" + }, + { + "id": "K_9", + "text": "(" + }, + { + "id": "K_0", + "text": ")" + }, + { + "id": "K_HYPHEN", + "text": "" + }, + { + "id": "K_EQUAL", + "text": "=" + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_Q", + "text": "ឈ", + "pad": "75" + }, + { + "id": "K_W", + "text": "" + }, + { + "id": "K_E", + "text": "" + }, + { + "id": "K_R", + "text": "ឬ" + }, + { + "id": "K_T", + "text": "ទ" + }, + { + "id": "K_Y", + "text": "" + }, + { + "id": "K_U", + "text": "" + }, + { + "id": "K_I", + "text": "" + }, + { + "id": "K_O", + "text": "" + }, + { + "id": "K_P", + "text": "ភ" + }, + { + "id": "K_LBRKT", + "text": "" + }, + { + "id": "K_RBRKT", + "text": "ឧ" + }, + { + "id": "T_new_364", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_BKQUOTE", + "text": "»" + }, + { + "id": "K_A", + "text": "" + }, + { + "id": "K_S", + "text": "" + }, + { + "id": "K_D", + "text": "ឌ" + }, + { + "id": "K_F", + "text": "ធ" + }, + { + "id": "K_G", + "text": "អ" + }, + { + "id": "K_H", + "text": "ះ" + }, + { + "id": "K_J", + "text": "ញ" + }, + { + "id": "K_K", + "text": "គ" + }, + { + "id": "K_L", + "text": "ឡ" + }, + { + "id": "K_COLON", + "text": "" + }, + { + "id": "K_QUOTE", + "text": "" + }, + { + "id": "K_BKSLASH", + "text": "ឭ" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_SHIFT", + "text": "*Shift*", + "width": "160", + "sp": "2", + "nextlayer": "default" + }, + { + "id": "K_oE2", + "text": "" + }, + { + "id": "K_Z", + "text": "ឍ" + }, + { + "id": "K_X", + "text": "ឃ" + }, + { + "id": "K_C", + "text": "ជ" + }, + { + "id": "K_V", + "text": "" + }, + { + "id": "K_B", + "text": "ព" + }, + { + "id": "K_N", + "text": "ណ" + }, + { + "id": "K_M", + "text": "" + }, + { + "id": "K_COMMA", + "text": "" + }, + { + "id": "K_PERIOD", + "text": "៕" + }, + { + "id": "K_SLASH", + "text": "?" + }, + { + "id": "T_new_390", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 5, + "key": [ + { + "id": "K_LCONTROL", + "text": "*AltGr*", + "width": "160", + "sp": "1", + "nextlayer": "rightalt" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "160", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "", + "width": "930" + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "160", + "sp": "1" + } + ] + } + ] + } + ], + "font": "Khmer Busra Kbd", + "fontsize": "0.8em" + }, + "phone": { + "layer": [ + { + "id": "default", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_Q", + "text": "ឆ", + "pad": "", + "sk": [ + { + "text": "ឈ", + "id": "K_Q", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1786" + }, + { + "text": "", + "id": "T_17D2_1788" + } + ] + }, + { + "id": "K_W", + "text": "", + "sk": [ + { + "text": "", + "id": "K_W", + "layer": "shift" + } + ] + }, + { + "id": "K_E", + "text": "", + "sk": [ + { + "text": "", + "id": "K_E", + "layer": "shift" + }, + { + "text": "", + "id": "K_S", + "layer": "shift" + }, + { + "text": "", + "id": "K_V", + "layer": "shift" + }, + { + "text": "ឯ", + "id": "U_17AF" + }, + { + "text": "ឰ", + "id": "U_17B0" + } + ] + }, + { + "id": "K_R", + "text": "រ", + "sk": [ + { + "text": "", + "id": "T_17D2_179A" + }, + { + "text": "ឫ", + "id": "U_17AB" + }, + { + "text": "ឬ", + "id": "U_17AC" + } + ] + }, + { + "id": "K_T", + "text": "ត", + "sk": [ + { + "text": "ទ", + "id": "K_T", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_178F" + }, + { + "text": "", + "id": "T_17D2_1791", + "layer": "default" + } + ] + }, + { + "id": "K_Y", + "text": "យ", + "sk": [ + { + "text": "", + "id": "T_17D2_1799" + } + ] + }, + { + "id": "K_U", + "text": "", + "sk": [ + { + "text": "", + "id": "K_U", + "layer": "shift" + }, + { + "text": "", + "id": "K_Y", + "layer": "shift" + }, + { + "text": "ឧ", + "id": "U_17A7" + }, + { + "text": "ឪ", + "id": "U_17AA", + "layer": "shift" + }, + { + "text": "ឩ", + "id": "U_17A9", + "layer": "shift" + }, + { + "text": "ឨ", + "id": "U_17A8" + } + ] + }, + { + "id": "K_I", + "text": "", + "sk": [ + { + "text": "", + "id": "K_I", + "layer": "shift" + }, + { + "text": "ឥ", + "id": "U_17A5" + }, + { + "text": "ឦ", + "id": "U_17A6", + "layer": "shift" + } + ] + }, + { + "id": "K_O", + "text": "", + "sk": [ + { + "text": "", + "id": "K_O", + "layer": "shift" + }, + { + "text": "", + "id": "K_LBRKT" + }, + { + "text": "", + "id": "K_LBRKT", + "layer": "shift" + }, + { + "text": "", + "id": "K_COLON", + "layer": "shift" + }, + { + "text": "ឱ", + "id": "U_17B1" + }, + { + "text": "ឲ", + "id": "U_17B2" + }, + { + "text": "ឳ", + "id": "U_17B3", + "layer": "shift" + } + ] + }, + { + "id": "K_P", + "text": "ផ", + "sk": [ + { + "text": "ភ", + "id": "K_P", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1795" + }, + { + "text": "", + "id": "T_17D2_1797", + "layer": "default" + } + ] + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_A", + "text": "", + "pad": "", + "width": "100", + "sk": [ + { + "text": "", + "id": "K_A", + "layer": "shift" + } + ] + }, + { + "id": "K_S", + "text": "ស", + "sk": [ + { + "text": "", + "id": "T_17D2_179F" + }, + { + "text": "ឝ", + "id": "U_179D" + }, + { + "text": "ឞ", + "id": "U_179E" + } + ] + }, + { + "id": "K_D", + "text": "ដ", + "sk": [ + { + "text": "ឌ", + "id": "K_D", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_178A" + }, + { + "text": "", + "id": "T_17D2_178C", + "layer": "default" + } + ] + }, + { + "id": "K_F", + "text": "ថ", + "sk": [ + { + "text": "ធ", + "id": "K_F", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1790" + }, + { + "text": "", + "id": "T_17D2_1792", + "layer": "default" + } + ] + }, + { + "id": "K_G", + "text": "ង", + "sk": [ + { + "text": "អ", + "id": "K_G", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1784" + }, + { + "text": "", + "id": "T_17D2_17A2", + "layer": "default" + } + ] + }, + { + "id": "K_H", + "text": "ហ", + "sk": [ + { + "text": "", + "id": "T_17D2_17A0" + }, + { + "text": "ះ", + "id": "K_H", + "layer": "shift" + }, + { + "text": "ៈ", + "id": "U_17C8" + } + ] + }, + { + "id": "K_J", + "text": "ញ", + "layer": "shift", + "sk": [ + { + "text": "", + "id": "T_17D2_1789" + } + ] + }, + { + "id": "K_K", + "text": "ក", + "sk": [ + { + "text": "គ", + "id": "K_K", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1780" + }, + { + "text": "", + "id": "T_17D2_1782" + } + ] + }, + { + "id": "K_L", + "text": "ល", + "sk": [ + { + "text": "ឡ", + "id": "K_L", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_179B" + }, + { + "text": "ឭ", + "id": "U_17AD" + }, + { + "text": "ឮ", + "id": "U_17AE" + } + ] + }, + { + "id": "K_COLON", + "text": "" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_Z", + "text": "ឋ", + "pad": "", + "width": "", + "sk": [ + { + "text": "ឍ", + "id": "K_Z", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_178B" + }, + { + "text": "", + "id": "T_17D2_178D", + "layer": "default" + } + ] + }, + { + "id": "K_X", + "text": "ខ", + "sk": [ + { + "text": "ឃ", + "id": "K_X", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1781" + }, + { + "text": "", + "id": "T_17D2_1783", + "layer": "default" + } + ] + }, + { + "id": "K_C", + "text": "ច", + "sk": [ + { + "text": "ជ", + "id": "K_C", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1785" + }, + { + "text": "", + "id": "T_17D2_1787", + "layer": "default" + } + ] + }, + { + "id": "K_V", + "text": "វ", + "sk": [ + { + "text": "", + "id": "T_17D2_179C" + } + ] + }, + { + "id": "K_B", + "text": "ប", + "sk": [ + { + "text": "ព", + "id": "K_B", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1794" + }, + { + "text": "", + "id": "T_17D2_1796", + "layer": "default" + } + ] + }, + { + "id": "K_N", + "text": "ន", + "sk": [ + { + "text": "ណ", + "id": "K_N", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1793" + }, + { + "text": "", + "id": "T_17D2_178E", + "layer": "default" + } + ] + }, + { + "id": "K_M", + "text": "ម", + "sk": [ + { + "text": "", + "id": "T_17D2_1798" + }, + { + "text": "", + "id": "K_M", + "layer": "shift" + } + ] + }, + { + "id": "K_COMMA", + "text": "", + "sk": [ + { + "text": "", + "id": "K_COMMA", + "layer": "shift" + }, + { + "text": "", + "id": "K_6", + "layer": "shift" + }, + { + "text": "", + "id": "K_7", + "layer": "shift" + }, + { + "text": "", + "id": "K_8", + "layer": "shift" + }, + { + "text": "", + "id": "K_HYPHEN", + "layer": "shift" + }, + { + "text": "", + "id": "U_17D1", + "layer": "shift" + }, + { + "text": "", + "id": "U_17DD", + "layer": "shift" + }, + { + "text": "", + "id": "U_17CE", + "layer": "shift" + } + ] + }, + { + "id": "K_QUOTE", + "text": "", + "width": "100", + "sk": [ + { + "text": "", + "id": "K_QUOTE", + "layer": "shift" + }, + { + "text": "", + "id": "K_SLASH" + } + ] + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_NUMLOCK", + "text": "១២៣", + "width": "140", + "sp": "1", + "nextlayer": "numeric" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "120", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "​", + "width": "555", + "sp": "0", + "sk": [ + { + "text": " ", + "id": "U_0020", + "layer": "default" + } + ] + }, + { + "id": "K_PERIOD", + "text": "។", + "width": "120", + "sk": [ + { + "text": "៕", + "id": "K_PERIOD", + "layer": "shift" + }, + { + "text": "!", + "id": "U_0021" + }, + { + "text": "?", + "id": "U_003F" + } + ] + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "140", + "sp": "1" + } + ] + } + ] + }, + { + "id": "numeric", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "១", + "pad": "", + "sk": [ + { + "text": "1", + "id": "U_0031" + } + ] + }, + { + "id": "K_2", + "text": "២", + "sk": [ + { + "text": "2", + "id": "U_0032" + } + ] + }, + { + "id": "K_3", + "text": "៣", + "sk": [ + { + "text": "3", + "id": "U_0033" + } + ] + }, + { + "id": "K_4", + "text": "៤", + "sk": [ + { + "text": "4", + "id": "U_0034" + } + ] + }, + { + "id": "K_5", + "text": "៥", + "sk": [ + { + "text": "5", + "id": "U_0035" + } + ] + }, + { + "id": "K_6", + "text": "៦", + "sk": [ + { + "text": "6", + "id": "U_0036" + } + ] + }, + { + "id": "K_7", + "text": "៧", + "sk": [ + { + "text": "7", + "id": "U_0037" + } + ] + }, + { + "id": "K_8", + "text": "៨", + "sk": [ + { + "text": "8", + "id": "U_0038" + } + ] + }, + { + "id": "K_9", + "text": "៩", + "sk": [ + { + "text": "9", + "id": "U_0039" + } + ] + }, + { + "id": "K_0", + "text": "០", + "sk": [ + { + "text": "0", + "id": "U_0030" + }, + { + "text": "", + "id": "U_17D3" + } + ] + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "U_0040", + "text": "@", + "pad": "", + "sk": [ + { + "text": "©", + "id": "U_00A9" + }, + { + "text": "®", + "id": "U_00AE" + } + ] + }, + { + "id": "U_0023", + "text": "#", + "sk": [ + { + "text": "№", + "id": "U_2116" + }, + { + "text": "~", + "id": "U_007E" + } + ] + }, + { + "id": "U_17DB", + "text": "៛", + "sk": [ + { + "text": "$", + "id": "U_0024" + }, + { + "text": "฿", + "id": "U_0E3F" + }, + { + "text": "¢", + "id": "U_00A2" + }, + { + "text": "£", + "id": "U_00A3" + }, + { + "text": "¥", + "id": "U_00A5" + } + ] + }, + { + "id": "U_0026", + "text": "&" + }, + { + "id": "U_0025", + "text": "%", + "sk": [ + { + "text": "‰", + "id": "U_2030" + }, + { + "text": "‱", + "id": "U_2031" + } + ] + }, + { + "id": "U_002B", + "text": "+", + "sk": [ + { + "text": "-", + "id": "U_002D" + }, + { + "text": "×", + "id": "U_00D7" + }, + { + "text": "÷", + "id": "U_00F7" + }, + { + "text": "±", + "id": "U_00B1" + } + ] + }, + { + "id": "U_003D", + "text": "=", + "sk": [ + { + "text": "_", + "id": "U_005F" + }, + { + "text": "≠", + "id": "U_2260" + } + ] + }, + { + "id": "U_002A", + "text": "*", + "sk": [ + { + "text": "^", + "id": "U_005E" + } + ] + }, + { + "id": "U_003F", + "text": "?", + "sk": [ + { + "text": "¿", + "id": "U_00BF" + } + ] + }, + { + "id": "U_0021", + "text": "!", + "sk": [ + { + "text": "¡", + "id": "U_00A1" + } + ] + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "U_2018", + "text": "‘", + "sk": [ + { + "text": "’", + "id": "U_2019" + } + ] + }, + { + "id": "U_201C", + "text": "“", + "sk": [ + { + "text": "”", + "id": "U_201D" + } + ] + }, + { + "id": "U_00AB", + "text": "«", + "pad": "", + "sk": [ + { + "text": "»", + "id": "U_00BB" + } + ] + }, + { + "id": "U_002F", + "text": "/", + "sk": [ + { + "text": "\\", + "id": "U_005C" + }, + { + "text": "|", + "id": "U_007C" + }, + { + "text": "¦", + "id": "U_00A6" + } + ] + }, + { + "id": "U_0028", + "text": "(", + "sk": [ + { + "text": ")", + "id": "U_0029" + }, + { + "text": "[", + "id": "U_005B" + }, + { + "text": "]", + "id": "U_005D" + }, + { + "text": "{", + "id": "U_007B" + }, + { + "text": "}", + "id": "U_007D" + } + ] + }, + { + "id": "U_17D9", + "text": "៙", + "sk": [ + { + "text": "៚", + "id": "U_17DA" + }, + { + "text": "ៜ", + "id": "U_17DC" + }, + { + "text": "§", + "id": "U_00A7" + }, + { + "text": "Ø", + "id": "U_00D8" + } + ] + }, + { + "id": "U_17D7", + "text": "ៗ" + }, + { + "id": "U_003C", + "text": "<", + "sk": [ + { + "text": "≤", + "id": "U_2264" + }, + { + "text": ">", + "id": "U_003E" + }, + { + "text": "≥", + "id": "U_2265" + } + ] + }, + { + "id": "U_17D6", + "text": "៖", + "sk": [ + { + "text": ":", + "id": "U_003A" + }, + { + "text": ";", + "id": "U_003B" + }, + { + "text": "…", + "id": "U_2026" + } + ] + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "", + "sp": "1" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_LCONTROL", + "text": "១២៣", + "width": "140", + "sp": "2", + "nextlayer": "default" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "120", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "​", + "width": "555", + "sp": "0", + "layer": "shift", + "sk": [] + }, + { + "id": "K_PERIOD", + "text": "។", + "width": "120", + "sk": [ + { + "text": "៕", + "id": "K_PERIOD", + "layer": "shift" + }, + { + "text": "!", + "id": "U_0021" + }, + { + "text": "?", + "id": "U_003F" + } + ] + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "140", + "sp": "1" + } + ] + } + ] + } + ], + "displayUnderlying": false, + "font": "Khmer Busra Kbd", + "fontsize": "0.8em" + } +} \ No newline at end of file diff --git a/common/web/types/test/fixtures/keyman-touch-layout/legacy.keyman-touch-layout b/common/web/types/test/fixtures/keyman-touch-layout/legacy.keyman-touch-layout new file mode 100644 index 0000000000000000000000000000000000000000..27b88076c4596a52c2a098b124f1cbef6081e3b9 --- /dev/null +++ b/common/web/types/test/fixtures/keyman-touch-layout/legacy.keyman-touch-layout @@ -0,0 +1,36 @@ +{ + "tablet": { + "layer": [ + { + "id": "default", + "row": [ + { + "id": "1", + "key": [ + { + "id": "K_BKSP", + "text": "*BkSp*", + "pad": "25", + "width": "100", + "sp": "1", + "sk": [ + { + "id": "K_BAM", + "text": "Bam", + "pad": "10", + "width": "25", + "sp": "8" + } + ] + }, + { + "id": "K_FOO", + "sk": [] + } + ] + } + ] + } + ] + } +} diff --git a/common/web/types/test/fixtures/kmx/khmer_angkor.kmx b/common/web/types/test/fixtures/kmx/khmer_angkor.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d8495d187c4ea369dfa0b608d8a630e196360f16 Binary files /dev/null and b/common/web/types/test/fixtures/kmx/khmer_angkor.kmx differ diff --git a/common/web/types/test/fixtures/kpj/khmer_angkor.kpj b/common/web/types/test/fixtures/kpj/khmer_angkor.kpj new file mode 100644 index 0000000000000000000000000000000000000000..4b239df20ceb3cffb7e0d01f655b119cc1e6149c --- /dev/null +++ b/common/web/types/test/fixtures/kpj/khmer_angkor.kpj @@ -0,0 +1,187 @@ + + + + $PROJECTPATH\build + True + True + False + keyboard + + + + id_f347675c33d2e6b1c705c787fad4941a + khmer_angkor.kmn + source\khmer_angkor.kmn + 1.3 + .kmn +
+ Khmer Angkor + © 2015-2022 SIL International + More than just a Khmer Unicode keyboard. +
+
+ + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + khmer_angkor.kps + source\khmer_angkor.kps + + .kps +
+ Khmer Angkor + © 2015-2022 SIL International +
+
+ + id_8a1efc7c4ab7cfece8aedd847679ca27 + khmer_angkor.ico + source\khmer_angkor.ico + + .ico + id_f347675c33d2e6b1c705c787fad4941a + + + id_8dc195db32d1fd0514de0ad51fff5df0 + khmer_angkor.js + source\..\build\khmer_angkor.js + + .js + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_10596632fcbf4138d24bcccf53e6ae01 + khmer_angkor.kvk + source\..\build\khmer_angkor.kvk + + .kvk + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_0a851f95ce553ecd62cbee6c32ced68f + khmer_angkor.kmx + source\..\build\khmer_angkor.kmx + + .kmx + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_d8b6eb05f4b7e2945c10e04c1f49e4c8 + keyboard_layout.png + source\welcome\keyboard_layout.png + + .png + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_724e5b4c63f10bc0abf7077f7c3172fc + welcome.htm + source\welcome\welcome.htm + + .htm + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_35857cb2b54f123612735ec948400082 + FONTLOG.txt + source\..\..\..\shared\fonts\khmer\mondulkiri\FONTLOG.txt + + .txt + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_7e3afe5bb59b888b08b48cd5817d8de4 + Mondulkiri-B.ttf + source\..\..\..\shared\fonts\khmer\mondulkiri\Mondulkiri-B.ttf + + .ttf + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_b9734e80f86c69ea5ae4dfa9f0083d09 + Mondulkiri-BI.ttf + source\..\..\..\shared\fonts\khmer\mondulkiri\Mondulkiri-BI.ttf + + .ttf + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_25abe4d2b0abc03a5be5b666a8de776e + Mondulkiri-I.ttf + source\..\..\..\shared\fonts\khmer\mondulkiri\Mondulkiri-I.ttf + + .ttf + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_b766568498108eee46ed1601ff69c47d + Mondulkiri-R.ttf + source\..\..\..\shared\fonts\khmer\mondulkiri\Mondulkiri-R.ttf + + .ttf + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_84544d04133cab3dbfc86b91ad1a4e17 + OFL.txt + source\..\..\..\shared\fonts\khmer\mondulkiri\OFL.txt + + .txt + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_0c33fbefd1c20f487b1bea2343b3bb2c + OFL-FAQ.txt + source\..\..\..\shared\fonts\khmer\mondulkiri\OFL-FAQ.txt + + .txt + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_a59d89fca36a310147645fa2604e521b + KAK_Documentation_EN.pdf + source\welcome\KAK_Documentation_EN.pdf + + .pdf + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_5643c4cd3933b3ada0b4af6579305ec4 + KAK_Documentation_KH.pdf + source\welcome\KAK_Documentation_KH.pdf + + .pdf + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_8da344c4cea6f467013357fe099006f5 + readme.htm + source\readme.htm + + .htm + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_acb0dd94c60e345d999670e999cbd159 + image002.png + source\welcome\image002.png + + .png + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_4edf70bc019f05b5ad39a2ea727ad547 + khmer_busra_kbd.ttf + source\..\..\..\shared\fonts\khmer\busrakbd\khmer_busra_kbd.ttf + + .ttf + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + + + id_bc823844e4399751e1867016801f7327 + splash.gif + source\splash.gif + + .gif + id_8d4eb765f80c9f2b0f769cf4e4aaa456 + +
+
diff --git a/common/web/types/test/fixtures/kvk/khmer_angkor.kvk b/common/web/types/test/fixtures/kvk/khmer_angkor.kvk new file mode 100644 index 0000000000000000000000000000000000000000..c64b3a5a544dc64ab3dcfd44a6875ea5f339b878 Binary files /dev/null and b/common/web/types/test/fixtures/kvk/khmer_angkor.kvk differ diff --git a/common/web/types/test/fixtures/kvk/khmer_angkor.kvks b/common/web/types/test/fixtures/kvk/khmer_angkor.kvks new file mode 100644 index 0000000000000000000000000000000000000000..e9c38a464ddd8d6d2c1732ebe06557abe083a5b8 --- /dev/null +++ b/common/web/types/test/fixtures/kvk/khmer_angkor.kvks @@ -0,0 +1,206 @@ + + +
+ 10.0 + khmer_angkor + + + +
+ + + ឞ + ឝ + ៈ + ឳ + ឨ + ឩ + ឰ + ឫ + ឦ + ឱ + ឯ + + + ៜ + + ៖ + ៙ + ៚ + + ៘ + ‌ + ‍ + ] + [ + / + . + ‘ + + + & + ’ + * + @ + \ + } + { + - + ÷ + : + , + ≈ + ; + < + # + > + × + $ + € +   + + + ៸ + ៰ + ៱ + ៲ + ៳ + ៴ + ៵ + ៶ + ៷ + ៹ + ᧿ + ᧾ + ᧪ + ᧫ + ᧶ + ᧵ + ᧬ + ᧷ + ᧥ + ᧸ + ᧡ + ᧻ + ᧹ + ᧮ + ᧢ + ᧯ + ᧰ + ᧦ + ᧱ + ᧤ + ᧭ + ᧣ + ᧧ + ᧠ + ᧺ + ᧲ + ᧳ + ᧴ + ᧩ + ᧨ + ᧼ + ᧽ + + + ​ + + + ឥ + ។ + + ០ + ១ + ២ + ៣ + ៤ + ៥ + ៦ + ៧ + ៨ + ៩ + + ឲ + + ឮ + ឪ + « + + ប + ច + ដ + + ថ + ង + ហ + + + ក + ល + ម + ន + + ផ + ឆ + រ + ស + ត + + វ + + ខ + យ + ឋ + + + + ! + + " + ៛ + % + + ( + ) + + = + + ៕ + ? + ៗ + + ព + ជ + ឌ + + ធ + អ + ះ + + ញ + គ + ឡ + + ណ + + ភ + ឈ + ឬ + + ទ + + + + ឃ + + ឍ + + + + ឭ + ឧ + » + + + +
diff --git a/common/web/types/test/fixtures/test-fr.xml b/common/web/types/test/fixtures/test-fr.xml new file mode 100644 index 0000000000000000000000000000000000000000..c97825385ad96a7df206fdea9e47c36f5cefc283 --- /dev/null +++ b/common/web/types/test/fixtures/test-fr.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/common/web/types/test/helpers/TestCompilerCallbacks.ts b/common/web/types/test/helpers/TestCompilerCallbacks.ts new file mode 100644 index 0000000000000000000000000000000000000000..596a731d58880a1fbf4d7dab95a81c795bf212e1 --- /dev/null +++ b/common/web/types/test/helpers/TestCompilerCallbacks.ts @@ -0,0 +1,62 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import { loadFile, loadSchema, resolveFilename } from '../helpers/index.js'; +import { CompilerCallbacks, CompilerEvent, CompilerFileSystemCallbacks, CompilerPathCallbacks, CompilerSchema } from '../../src/util/compiler-interfaces.js'; + +// This is related to developer/src/common/web/test-helpers/index.ts but has a slightly different API surface +// as this runs at a lower level than the compiler. +/** + * A CompilerCallbacks implementation for testing + */ +export class TestCompilerCallbacks implements CompilerCallbacks { + loadSchema(schema: CompilerSchema): Buffer { + switch (schema) { + case 'kpj': + throw new Error('loadKpjJsonSchema not implemented.'); // not needed for this test + case 'kvks': + throw new Error('loadKvksJsonSchema not implemented.'); + case 'ldml-keyboard': + return loadSchema(schema); + case 'ldml-keyboardtest': + return loadSchema(schema); + } + } + clear() { + this.messages = []; + } + debug(msg: string): void { + console.debug(msg); + } + + messages: CompilerEvent[] = []; + + get path(): CompilerPathCallbacks { + return path; + } + + get fs(): CompilerFileSystemCallbacks { + return fs; + } + + resolveFilename(baseFilename: string, filename: string): string { + return resolveFilename(baseFilename, filename); + } + + loadFile(filename: string | URL): Buffer { + // TODO: error management, does it belong here? + try { + return loadFile(filename); + } catch (e) { + if (e.code === 'ENOENT') { + return null; + } else { + throw e; + } + } + } + + reportMessage(event: CompilerEvent): void { + // console.log(event.message); + this.messages.push(event); + } +} diff --git a/common/web/types/test/helpers/index.ts b/common/web/types/test/helpers/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..58dc32dc9c1618da13acb027d39ad3a379a53394 --- /dev/null +++ b/common/web/types/test/helpers/index.ts @@ -0,0 +1,44 @@ +import path from "path"; +import fs from "fs"; +import { fileURLToPath } from "url"; +import { CompilerSchema } from "../../src/util/compiler-interfaces.js"; + +/** + * Builds a path to the fixture with the given path components. + * + * e.g., makePathToFixture('basic.xml') + * + * @param components One or more path components. + */ +export function makePathToFixture(...components: string[]): string { + return fileURLToPath(new URL(path.join('..', '..', '..', 'test', 'fixtures', ...components), import.meta.url)); +} + +export function loadKeymanTouchLayoutCleanJsonSchema(): Buffer { + // TODO: this has the Wrong Name Pattern! + return fs.readFileSync(new URL(path.join('..', '..', 'src', 'keyman-touch-layout.clean.spec.json'), import.meta.url)); +} + +export function loadFile(filename: string | URL): Buffer { + return fs.readFileSync(filename); +} + +export function loadSchema(schema: CompilerSchema): Buffer { + return fs.readFileSync(new URL(path.join('..', '..', 'src', schema + '.schema.json'), import.meta.url)); +} + +export function resolveFilename(baseFilename: string, filename: string) { + const basePath = path.dirname(baseFilename); + // Transform separators to platform separators -- we are agnostic + // in our use here but path prefers files may use + // either / or \, although older kps files were always \. + if(path.sep == '/') { + filename = filename.replace(/\\/g, '/'); + } else { + filename = filename.replace(/\//g, '\\'); + } + if(!path.isAbsolute(filename)) { + filename = path.resolve(basePath, filename); + } + return filename; +} diff --git a/common/web/types/test/helpers/reader-callback-test.ts b/common/web/types/test/helpers/reader-callback-test.ts new file mode 100644 index 0000000000000000000000000000000000000000..8c85a759acf270a8a99e5eb947faf8b51db8bb93 --- /dev/null +++ b/common/web/types/test/helpers/reader-callback-test.ts @@ -0,0 +1,160 @@ +import 'mocha'; +import {assert} from 'chai'; +import { loadFile, makePathToFixture, loadSchema } from '../helpers/index.js'; +import LDMLKeyboardXMLSourceFileReader from '../../src/ldml-keyboard/ldml-keyboard-xml-reader.js'; +import { CompilerEvent } from '../../src/util/compiler-interfaces.js'; +import { LDMLKeyboardXMLSourceFile } from '../../src/ldml-keyboard/ldml-keyboard-xml.js'; +import { LDMLKeyboardTestDataXMLSourceFile } from '../ldml-keyboard/ldml-keyboard-testdata-xml.js'; +import { TestCompilerCallbacks } from './TestCompilerCallbacks.js'; + +export interface CompilationCase { + /** + * If true, loading (validation) should fail + */ + loadfail?: boolean; + /** + * path to xml, such as 'sections/layr/invalid-case.xml' + */ + subpath: string; + /** + * expected error messages. If falsy, expected to succeed. All must be present to pass. + */ + errors?: CompilerEvent[]; + /** + * expected warning messages. All must be present to pass. + */ + warnings?: CompilerEvent[]; + /** + * optional callback with the section + */ + callback?: (data: Buffer, source: LDMLKeyboardXMLSourceFile, subpath: string, callbacks: TestCompilerCallbacks ) => void; + /** + * if present, expect compiler to throw (use .* to match all) + */ + throws?: RegExp; +} + + +export interface TestDataCase { + /** + * If true, loading (validation) should fail + */ + loadfail?: boolean; + /** + * path to xml, such as 'sections/layr/invalid-case.xml' + */ + subpath: string; + /** + * expected error messages. If falsy, expected to succeed. All must be present to pass. + */ + errors?: CompilerEvent[]; + /** + * expected warning messages. All must be present to pass. + */ + warnings?: CompilerEvent[]; + /** + * optional callback with the section + */ + callback?: (data: Buffer, source: LDMLKeyboardTestDataXMLSourceFile, subpath: string, callbacks: TestCompilerCallbacks ) => void; + /** + * if present, expect compiler to throw (use .* to match all) + */ + throws?: RegExp; +} + +/** + * Run a bunch of cases + * @param cases cases to run + * @param compiler argument to loadSectionFixture() + * @param callbacks argument to loadSectionFixture() + */ +export function testReaderCases(cases : CompilationCase[]) { + // we need our own callbacks rather than using the global so messages don't get mixed + const callbacks = new TestCompilerCallbacks(); + const reader = new LDMLKeyboardXMLSourceFileReader(callbacks); + for (let testcase of cases) { + const expectFailure = testcase.throws || !!(testcase.errors); // if true, we expect this to fail + const testHeading = expectFailure ? `should fail to load: ${testcase.subpath}`: + `should load: ${testcase.subpath}`; + it(testHeading, function () { + callbacks.clear(); + + const data = loadFile(makePathToFixture(testcase.subpath)); + assert.ok(data, `reading ${testcase.subpath}`); + const source = reader.load(data); + if (!testcase.loadfail) { + assert.ok(source, `loading ${testcase.subpath}`); + } else { + assert.notOk(source, `loading ${testcase.subpath} (expected failure)`); + } + // special case for an expected exception + if (testcase.throws) { + assert.throws(() => reader.validate(source, loadSchema('ldml-keyboard')), testcase.throws); + } else { + assert.doesNotThrow(() => reader.validate(source, loadSchema('ldml-keyboard')), `validating ${testcase.subpath}`); + // if we expected errors or warnings, show them + if (testcase.errors) { + assert.includeDeepMembers(callbacks.messages, testcase.errors, 'expected errors to be included'); + } + if (testcase.warnings) { + assert.includeDeepMembers(callbacks.messages, testcase.warnings, 'expected warnings to be included'); + } else if (!expectFailure) { + // no warnings, so expect zero messages + assert.strictEqual(callbacks.messages.length, 0, 'expected zero messages'); + } + + // run the user-supplied callback if any + if (testcase.callback) { + testcase.callback(data, source, testcase.subpath, callbacks); + } + } + }); + } +} + + +/** + * Run a bunch of cases + * @param cases cases to run + * @param compiler argument to loadSectionFixture() + * @param callbacks argument to loadSectionFixture() + */ +export function testTestdataReaderCases(cases : TestDataCase[]) { + // we need our own callbacks rather than using the global so messages don't get mixed + const callbacks = new TestCompilerCallbacks(); + const reader = new LDMLKeyboardXMLSourceFileReader(callbacks); + for (let testcase of cases) { + const expectFailure = testcase.throws || !!(testcase.errors); // if true, we expect this to fail + const testHeading = expectFailure ? `should fail to load: ${testcase.subpath}`: + `should load: ${testcase.subpath}`; + it(testHeading, function () { + callbacks.clear(); + + const data = loadFile(makePathToFixture(testcase.subpath)); + assert.ok(data, `reading ${testcase.subpath}`); + const source = reader.loadTestData(data); + if (!testcase.loadfail) { + assert.ok(source, `loading ${testcase.subpath}`); + } else { + assert.notOk(source, `loading ${testcase.subpath} (expected failure)`); + } + // special case for an expected exception + // TODO-LDML: no validation for now. + // if we expected errors or warnings, show them + if (testcase.errors) { + assert.includeDeepMembers(callbacks.messages, testcase.errors, 'expected errors to be included'); + } + if (testcase.warnings) { + assert.includeDeepMembers(callbacks.messages, testcase.warnings, 'expected warnings to be included'); + } else if (!expectFailure) { + // no warnings, so expect zero messages + assert.strictEqual(callbacks.messages.length, 0, 'expected zero messages but got ' +callbacks.messages.map(e => e.message).join(' ') ); + } + + // run the user-supplied callback if any + if (testcase.callback) { + testcase.callback(data, source, testcase.subpath, callbacks); + } + }); + } +} diff --git a/common/web/types/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.ts b/common/web/types/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.ts new file mode 100644 index 0000000000000000000000000000000000000000..35a3d8626d511170ff65aaa45a13a8c846bf5db2 --- /dev/null +++ b/common/web/types/test/keyman-touch-layout/test-keyman-touch-layout-file-reader.ts @@ -0,0 +1,71 @@ +import * as fs from 'fs'; +import 'mocha'; +import { assert } from 'chai'; +import { loadKeymanTouchLayoutCleanJsonSchema, makePathToFixture } from '../helpers/index.js'; +import { TouchLayoutFileReader } from "../../src/keyman-touch-layout/keyman-touch-layout-file-reader.js"; + +describe('TouchLayoutFileReader', function () { + it('should read a valid file', function() { + const path = makePathToFixture('keyman-touch-layout', 'khmer_angkor.keyman-touch-layout'); + const schema = loadKeymanTouchLayoutCleanJsonSchema(); + const input = fs.readFileSync(path); + const reader = new TouchLayoutFileReader(); + const layout = reader.read(input); + reader.validate(layout, schema); + + // We don't really need to validate the JSON parser. We'll do a handful of + // tests for object integrity and a couple of object members inside the file + // just as a sanity check + assert.hasAllKeys(layout, ['tablet', 'phone']); + assert.hasAllKeys(layout.tablet, ['layer', 'displayUnderlying', 'font', 'fontsize']); + assert.isFalse(layout.tablet.displayUnderlying); + assert.strictEqual(layout.tablet.font, 'Khmer Busra Kbd'); + assert.strictEqual(layout.tablet.fontsize, '0.8em'); + assert.isArray(layout.tablet.layer); + assert.strictEqual(layout.tablet.layer.length, 3); + assert.strictEqual(layout.tablet.layer[0].id, 'default'); + assert.isArray(layout.tablet.layer[0].row); + assert.isArray(layout.tablet.layer[0].row); + assert.strictEqual(layout.tablet.layer[0].row.length, 5); + assert.strictEqual(layout.tablet.layer[0].row[0].id, 1); + assert.isArray(layout.tablet.layer[0].row[0].key); + assert.strictEqual(layout.tablet.layer[0].row[0].key.length, 13); + assert.strictEqual(layout.tablet.layer[0].row[0].key[0].id, "K_1"); + assert.strictEqual(layout.tablet.layer[0].row[0].key[0].text, "១"); + }); + + it('should fixup numeric types in a valid legacy file', function() { + const path = makePathToFixture('keyman-touch-layout', 'legacy.keyman-touch-layout'); + const schema = loadKeymanTouchLayoutCleanJsonSchema(); + const input = fs.readFileSync(path); + const reader = new TouchLayoutFileReader(); + const layout = reader.read(input); + reader.validate(layout, schema); + + // row.id can be a string in legacy files + assert.strictEqual(layout.tablet.layer[0].row[0].id, 1); + + // key pad, width and sp can be a string in legacy files + assert.strictEqual(layout.tablet.layer[0].row[0].key[0].pad, 25); + assert.strictEqual(layout.tablet.layer[0].row[0].key[0].width, 100); + assert.strictEqual(layout.tablet.layer[0].row[0].key[0].sp, 1); + + // sk pad, width and sp can be a string in legacy files + assert.strictEqual(layout.tablet.layer[0].row[0].key[0].sk[0].pad, 10); + assert.strictEqual(layout.tablet.layer[0].row[0].key[0].sk[0].width, 25); + assert.strictEqual(layout.tablet.layer[0].row[0].key[0].sk[0].sp, 8); + }); + + it('should fixup remove empty arrays in a valid legacy file', function() { + const path = makePathToFixture('keyman-touch-layout', 'legacy.keyman-touch-layout'); + const schema = loadKeymanTouchLayoutCleanJsonSchema(); + const input = fs.readFileSync(path); + const reader = new TouchLayoutFileReader(); + const layout = reader.read(input); + reader.validate(layout, schema); + + // sk was defined as [] in legacy.keyman-touch-layout but we want to treat + // it as not present + assert.isUndefined(layout.tablet.layer[0].row[0].key[1].sk); + }); +}); diff --git a/common/web/types/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.ts b/common/web/types/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.ts new file mode 100644 index 0000000000000000000000000000000000000000..f6a09d08d3bfdba77ffd7abd094bd7ca9f16209a --- /dev/null +++ b/common/web/types/test/keyman-touch-layout/test-keyman-touch-layout-round-trip.ts @@ -0,0 +1,35 @@ +import * as fs from 'fs'; +import 'mocha'; +import { assert } from 'chai'; +import { makePathToFixture } from '../helpers/index.js'; +import { TouchLayoutFileReader } from "../../src/keyman-touch-layout/keyman-touch-layout-file-reader.js"; +import { TouchLayoutFileWriter } from "../../src/keyman-touch-layout/keyman-touch-layout-file-writer.js"; + +describe('TouchLayoutFile', function () { + it('should round-trip from TouchLayoutFileReader to TouchLayoutFileWriter', function() { + const path = makePathToFixture('keyman-touch-layout', 'khmer_angkor.keyman-touch-layout'); + const input = fs.readFileSync(path); + const reader = new TouchLayoutFileReader(); + const layout = reader.read(input); + const writer = new TouchLayoutFileWriter(); + + // We don't want to assert equality on formatting differences, or on the + // fixups that we do on input files (empty arrays, stringified numbers), so + // we'll re-read the output and compare it + let output = writer.write(layout); + let newLayout = reader.read(output); + assert.deepEqual(layout, newLayout); + + // And do the same without formatted output + output = writer.write(layout); + newLayout = reader.read(output); + assert.deepEqual(layout, newLayout); + + // And do the same without any options + let output2 = writer.write(layout); + assert.deepEqual(output, output2); + + newLayout = reader.read(output2); + assert.deepEqual(layout, newLayout); + }); +}); diff --git a/common/web/types/test/kmx/test-kmx-file.ts b/common/web/types/test/kmx/test-kmx-file.ts new file mode 100644 index 0000000000000000000000000000000000000000..b50521427c6f06cc5fd4c58d2e53dc0d1e9c8c7a --- /dev/null +++ b/common/web/types/test/kmx/test-kmx-file.ts @@ -0,0 +1,29 @@ +import * as fs from 'fs'; +import 'mocha'; +import { assert } from 'chai'; +import { makePathToFixture } from '../helpers/index.js'; +import { KmxFileReader } from "../../src/kmx/kmx-file-reader.js"; +import { KMXFile } from "../../src/kmx/kmx.js"; + +describe('kmx-file-reader', function () { + it('should read a valid file', function() { + const path = makePathToFixture('kmx', 'khmer_angkor.kmx'); + const input = fs.readFileSync(path); + const reader = new KmxFileReader(); + const kmx = reader.read(input); + + let store = kmx.stores.find(store => store.dwSystemID == KMXFile.TSS_VERSION); + assert.isObject(store); + assert.equal(store.dpString, '10.0'); + + store = kmx.stores.find(store => store.dwSystemID == KMXFile.TSS_NAME); + assert.isObject(store); + assert.equal(store.dpString, 'Khmer Angkor'); + + store = kmx.stores.find(store => store.dwSystemID == KMXFile.TSS_KEYBOARDVERSION); + assert.isObject(store); + assert.equal(store.dpString, '1.3'); + + // TODO: add header, group, key tests once we have added support in KmxFileReader + }); +}); diff --git a/common/web/types/test/kpj/test-kpj-file-reader.ts b/common/web/types/test/kpj/test-kpj-file-reader.ts new file mode 100644 index 0000000000000000000000000000000000000000..b7c2f710131db0d9bdf8be3f9190a267ee4a2ad5 --- /dev/null +++ b/common/web/types/test/kpj/test-kpj-file-reader.ts @@ -0,0 +1,126 @@ +import * as fs from 'fs'; +import 'mocha'; +import {assert} from 'chai'; +import { loadSchema, makePathToFixture } from '../helpers/index.js'; +import { KPJFileReader } from "../../src/kpj/kpj-file-reader.js"; +import { KeymanDeveloperProjectFile10, KeymanDeveloperProjectType } from '../../src/kpj/keyman-developer-project.js'; +import { TestCompilerCallbacks } from '../helpers/TestCompilerCallbacks.js'; + +const callbacks = new TestCompilerCallbacks(); + +describe('kpj-file-reader', function () { + it('kpj-file-reader should read a valid file', function() { + const kpjPath = 'khmer_angkor.kpj'; + const path = makePathToFixture('kpj', kpjPath); + const input = fs.readFileSync(path); + const reader = new KPJFileReader(callbacks); + const kpj = reader.read(input); + console.dir(kpj); + assert.doesNotThrow(() => { + reader.validate(kpj, loadSchema('kpj')); + }); + assert.equal(kpj.KeymanDeveloperProject.Options.BuildPath, '$PROJECTPATH\\build'); + assert.equal(kpj.KeymanDeveloperProject.Options.CheckFilenameConventions, 'False'); + assert.equal(kpj.KeymanDeveloperProject.Options.CompilerWarningsAsErrors, 'True'); + assert.equal(kpj.KeymanDeveloperProject.Options.ProjectType, 'keyboard'); + assert.equal(kpj.KeymanDeveloperProject.Options.WarnDeprecatedCode, 'True'); + assert.isUndefined(kpj.KeymanDeveloperProject.Options.Version); + + assert.lengthOf(kpj.KeymanDeveloperProject.Files.File, 21); + + // Test a representative set of files - kmn, kps, 2 child files + + let kf = kpj.KeymanDeveloperProject.Files.File[0]; + assert.equal(kf.ID, 'id_f347675c33d2e6b1c705c787fad4941a'); + assert.equal(kf.Filename, 'khmer_angkor.kmn'); + assert.equal(kf.Filepath, 'source\\khmer_angkor.kmn'); + assert.equal(kf.FileVersion, '1.3'); + assert.equal(kf.FileType, '.kmn'); + assert.equal(kf.Details.Name, 'Khmer Angkor'); + assert.equal(kf.Details.Copyright, '© 2015-2022 SIL International'); + assert.equal(kf.Details.Message, 'More than just a Khmer Unicode keyboard.'); + + kf = kpj.KeymanDeveloperProject.Files.File[1]; + assert.equal(kf.ID, 'id_8d4eb765f80c9f2b0f769cf4e4aaa456'); + assert.equal(kf.Filename, 'khmer_angkor.kps'); + assert.equal(kf.Filepath, 'source\\khmer_angkor.kps'); + assert.isEmpty(kf.FileVersion); + assert.equal(kf.FileType, '.kps'); + assert.equal(kf.Details.Name, 'Khmer Angkor'); + assert.equal(kf.Details.Copyright, '© 2015-2022 SIL International'); + + kf = kpj.KeymanDeveloperProject.Files.File[2]; + assert.equal(kf.ID, 'id_8a1efc7c4ab7cfece8aedd847679ca27'); + assert.equal(kf.Filename, 'khmer_angkor.ico'); + assert.equal(kf.Filepath, 'source\\khmer_angkor.ico'); + assert.isEmpty(kf.FileVersion); + assert.equal(kf.FileType, '.ico'); + assert.equal(kf.ParentFileID, 'id_f347675c33d2e6b1c705c787fad4941a'); + + kf = kpj.KeymanDeveloperProject.Files.File[3]; + assert.equal(kf.ID, 'id_8dc195db32d1fd0514de0ad51fff5df0'); + assert.equal(kf.Filename, 'khmer_angkor.js'); + assert.equal(kf.Filepath, 'source\\..\\build\\khmer_angkor.js'); + assert.isEmpty(kf.FileVersion); + assert.equal(kf.FileType, '.js'); + assert.equal(kf.ParentFileID, 'id_8d4eb765f80c9f2b0f769cf4e4aaa456'); + + // Test transform of .kpj into a KeymanDeveloperProject + + const project = reader.transform(kpjPath, kpj); + + assert.equal(project.options.buildPath, '$PROJECTPATH/build'); + assert.isFalse(project.options.checkFilenameConventions); + assert.isTrue(project.options.compilerWarningsAsErrors); + assert.equal(project.options.projectType, KeymanDeveloperProjectType.Keyboard); + assert.isTrue(project.options.warnDeprecatedCode); + assert.equal(project.options.version, '1.0'); + + assert.lengthOf(project.files, 2); + + let f: KeymanDeveloperProjectFile10 = project.files[0]; + console.dir(f); + assert.equal(f.id, 'id_f347675c33d2e6b1c705c787fad4941a'); + assert.equal(f.filename, 'khmer_angkor.kmn'); + assert.equal(f.filePath, 'source/khmer_angkor.kmn'); + assert.equal(f.fileVersion, '1.3'); + assert.equal(f.fileType, '.kmn'); + assert.equal(f.details.name, 'Khmer Angkor'); + assert.equal(f.details.copyright, '© 2015-2022 SIL International'); + assert.equal(f.details.message, 'More than just a Khmer Unicode keyboard.'); + assert.isUndefined(f.details.version); + assert.lengthOf(f.childFiles, 1); + + f = project.files[1]; + assert.equal(f.id, 'id_8d4eb765f80c9f2b0f769cf4e4aaa456'); + assert.equal(f.filename, 'khmer_angkor.kps'); + assert.equal(f.filePath, 'source/khmer_angkor.kps'); + assert.equal(f.fileVersion, ''); + assert.equal(f.fileType, '.kps'); + assert.equal(f.details.name, 'Khmer Angkor'); + assert.isUndefined(f.details.message); + assert.equal(f.details.copyright, '© 2015-2022 SIL International'); + assert.isUndefined(f.details.version); + assert.lengthOf(f.childFiles, 18); + + f = project.files[0]; + f = f.childFiles[0]; + assert.equal(f.id, 'id_8a1efc7c4ab7cfece8aedd847679ca27'); + assert.equal(f.filename, 'khmer_angkor.ico'); + assert.equal(f.filePath, 'source/khmer_angkor.ico'); + assert.equal(f.fileVersion, ''); + assert.equal(f.fileType, '.ico'); + assert.isEmpty(f.details); + assert.lengthOf(f.childFiles, 0); + + f = project.files[1]; + f = f.childFiles[0]; + assert.equal(f.id, 'id_8dc195db32d1fd0514de0ad51fff5df0'); + assert.equal(f.filename, 'khmer_angkor.js'); + assert.equal(f.filePath, 'source/../build/khmer_angkor.js'); + assert.equal(f.fileVersion, ''); + assert.equal(f.fileType, '.js'); + assert.isEmpty(f.details); + assert.lengthOf(f.childFiles, 0); + }); +}); diff --git a/common/web/types/test/kvk/test-kvk-file.ts b/common/web/types/test/kvk/test-kvk-file.ts new file mode 100644 index 0000000000000000000000000000000000000000..7578169eea79a8107cdf7da7ed8bdc47bc7cd039 --- /dev/null +++ b/common/web/types/test/kvk/test-kvk-file.ts @@ -0,0 +1,15 @@ +import * as fs from 'fs'; +import 'mocha'; +import { makePathToFixture } from '../helpers/index.js'; +import KvkFileReader from "../../src/kvk/kvk-file-reader.js"; +import { verify_khmer_angkor } from './test-kvk-utils.js'; + +describe('kvk-file-reader', function () { + it('kvk-file-reader should read a valid file', function() { + const path = makePathToFixture('kvk', 'khmer_angkor.kvk'); + const input = fs.readFileSync(path); + const reader = new KvkFileReader(); + const vk = reader.read(input); + verify_khmer_angkor(vk); + }); +}); diff --git a/common/web/types/test/kvk/test-kvk-round-trip.ts b/common/web/types/test/kvk/test-kvk-round-trip.ts new file mode 100644 index 0000000000000000000000000000000000000000..41dbe2dbc0cb25b553c790172998f006269c416b --- /dev/null +++ b/common/web/types/test/kvk/test-kvk-round-trip.ts @@ -0,0 +1,87 @@ +import * as fs from 'fs'; +import 'mocha'; +import {assert} from 'chai'; +import Hexy from 'hexy'; +import gitDiff from 'git-diff'; +const { hexy } = Hexy; +import { loadSchema, makePathToFixture } from '../helpers/index.js'; +import KvksFileReader, { KVKSParseError } from "../../src/kvk/kvks-file-reader.js"; +import KvkFileReader from "../../src/kvk/kvk-file-reader.js"; +import KvkFileWriter from "../../src/kvk/kvk-file-writer.js"; +import KvksFileWriter from "../../src/kvk/kvks-file-writer.js"; + +/** + * + * @param actual input buffer + * @param expected expected buffer + * @returns + */ +function assertBufferMatch(actual: Buffer, expected: Buffer) { + const sourceHex = hexy(actual); + const expectedHex = hexy(expected); + const diff = gitDiff(expectedHex, sourceHex); + + assert(!diff, 'Buffers did not match:\n' + diff); + assert.equal(actual.length, expected.length, 'Buffer lengths are not the same'); + assert.deepEqual(actual, expected); // double check buffers: hexy can return '' on failure +} + +describe('kvk-file-reader', function () { + it('kvk-file-reader should round-trip with kvk-file-writer', function() { + const path = makePathToFixture('kvk', 'khmer_angkor.kvk'); + const input = fs.readFileSync(path); + const reader = new KvkFileReader(); + const vk = reader.read(input); + const writer = new KvkFileWriter(); + const output = writer.write(vk); + assertBufferMatch(input, Buffer.from(output)); + + // and check the 2nd generation also + const vk2 = reader.read(output); + assert.deepEqual(vk2, vk); + }); +}); + +describe('kvks-file-reader', function () { + it('kvks-file-reader should compile with kvk-file-writer', function() { + const inputPath = makePathToFixture('kvk', 'khmer_angkor.kvks'); + const compiledPath = makePathToFixture('kvk', 'khmer_angkor.kvk'); + const input = fs.readFileSync(inputPath); + const compiled = fs.readFileSync(compiledPath); + const reader = new KvksFileReader(); + const kvks = reader.read(input); + assert.doesNotThrow(() => { + reader.validate(kvks, loadSchema('kvks')); + }); + const errors: KVKSParseError[] = []; + const vk = reader.transform(kvks, errors); + assert.isEmpty(errors); + const writer = new KvkFileWriter(); + const output = writer.write(vk); + assertBufferMatch(Buffer.from(output), compiled); + }); + + describe('kvks-file-writer', function() { + it('kvks-file-writer should match what kvk-file-reader reads', function() { + const kvkIn = makePathToFixture('kvk', 'khmer_angkor.kvk'); + const kvkBuf = fs.readFileSync(kvkIn); + const kvkReader = new KvkFileReader(); + const kvksReader = new KvksFileReader(); + const vk = kvkReader.read(kvkBuf); + const kvksWriter = new KvksFileWriter(); + const kvksOut = kvksWriter.write(vk); + + // Now, re-read kvk from the kvks + const kvks = kvksReader.read(Buffer.from(kvksOut)); + assert.doesNotThrow(() => { + kvksReader.validate(kvks, loadSchema('kvks')); + }); + const errors: KVKSParseError[] = []; + const vk2 = kvksReader.transform(kvks, errors); + assert.isEmpty(errors); + + // make sure the binary is the same + assert.deepEqual(vk2, vk); + }); + }); +}); diff --git a/common/web/types/test/kvk/test-kvk-utils.ts b/common/web/types/test/kvk/test-kvk-utils.ts new file mode 100644 index 0000000000000000000000000000000000000000..34cd841cfd8c5ac4c4b259b3a264cab4b09f56fb --- /dev/null +++ b/common/web/types/test/kvk/test-kvk-utils.ts @@ -0,0 +1,24 @@ +import 'mocha'; +import {assert} from 'chai'; +import { VisualKeyboard, VisualKeyboardHeaderFlags, VisualKeyboardKeyFlags, VisualKeyboardShiftState } from "../../src/kvk/visual-keyboard.js"; +import { USVirtualKeyCodes } from '../../src/consts/virtual-key-constants.js'; + +export function verify_khmer_angkor(vk: VisualKeyboard) { + assert.equal(vk.header.flags, VisualKeyboardHeaderFlags.kvkhAltGr); + assert.equal(vk.header.associatedKeyboard, 'khmer_angkor'); + assert.equal(vk.header.ansiFont.name, 'Arial'); + assert.equal(vk.header.ansiFont.size, -12); + assert.equal(vk.header.ansiFont.color, 0xFF000008); + assert.equal(vk.header.unicodeFont.name, 'Khmer Busra Kbd'); + assert.equal(vk.header.unicodeFont.size, 16); + assert.equal(vk.header.unicodeFont.color, 0xFF000008); + assert.equal(vk.keys.length, 186); + assert.equal(vk.keys[0].flags, VisualKeyboardKeyFlags.kvkkUnicode); + assert.equal(vk.keys[0].vkey, USVirtualKeyCodes.K_B); + assert.equal(vk.keys[0].shift, VisualKeyboardShiftState.KVKS_RALT); + assert.equal(vk.keys[0].text, 'ឞ'); + assert.equal(vk.keys[185].flags, VisualKeyboardKeyFlags.kvkkUnicode); + assert.equal(vk.keys[185].vkey, USVirtualKeyCodes.K_COMMA); + assert.equal(vk.keys[185].shift, VisualKeyboardShiftState.KVKS_SHIFT); + assert.equal(vk.keys[185].text, ''); +} diff --git a/common/web/types/test/kvk/test-kvks-file.ts b/common/web/types/test/kvk/test-kvks-file.ts new file mode 100644 index 0000000000000000000000000000000000000000..523bfaf54d618ce21da9f9137c67d9b04c39bd6a --- /dev/null +++ b/common/web/types/test/kvk/test-kvks-file.ts @@ -0,0 +1,45 @@ +import * as fs from 'fs'; +import 'mocha'; +import { loadSchema, makePathToFixture } from '../helpers/index.js'; +import KvksFileReader, { KVKSParseError } from "../../src/kvk/kvks-file-reader.js"; +import KvksFileWriter from "../../src/kvk/kvks-file-writer.js"; +import { verify_khmer_angkor } from './test-kvk-utils.js'; +import { assert } from 'chai'; + +describe('kvks-file-reader', function() { + it('should read a valid file', function() { + const path = makePathToFixture('kvk', 'khmer_angkor.kvks'); + const input = fs.readFileSync(path); + + const reader = new KvksFileReader(); + const kvks = reader.read(input); + assert.doesNotThrow(() => { + reader.validate(kvks, loadSchema('kvks')); + }); + const errors: KVKSParseError[] = []; + const vk = reader.transform(kvks, errors); + assert.isEmpty(errors); + verify_khmer_angkor(vk); + }); +}); + +describe('kvks-file-writer', function() { + it('should write a valid file', function() { + const path = makePathToFixture('kvk', 'khmer_angkor.kvks'); + const input = fs.readFileSync(path); + + const reader = new KvksFileReader(); + const kvksExpected = reader.read(input); + const errors: KVKSParseError[] = []; + const vk = reader.transform(kvksExpected, errors); + assert.isEmpty(errors); + + const writer = new KvksFileWriter(); + const output = writer.write(vk); + + // We compare the (re)loaded data, because there may be + // minor, irrelevant formatting differences in the emitted xml + const kvks = reader.read(Buffer.from(output, 'utf8')); + assert.deepEqual(kvks, kvksExpected); + }); +}); diff --git a/common/web/types/test/ldml-keyboard/test-ldml-keyboard-testdata-reader.ts b/common/web/types/test/ldml-keyboard/test-ldml-keyboard-testdata-reader.ts new file mode 100644 index 0000000000000000000000000000000000000000..6a789c74936fad8e91842c5eac6306ae29fdd49b --- /dev/null +++ b/common/web/types/test/ldml-keyboard/test-ldml-keyboard-testdata-reader.ts @@ -0,0 +1,51 @@ +import { constants } from '@keymanapp/ldml-keyboard-constants'; +import { assert } from 'chai'; +import 'mocha'; +import { testTestdataReaderCases } from '../helpers/reader-callback-test.js'; + +describe('ldml keyboard xml reader tests', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + testTestdataReaderCases([ + { + subpath: 'test-fr.xml', + callback: (data, source) => { + assert.ok(source); + assert.ok(source.keyboardTest); + assert.equal(source.keyboardTest.conformsTo, constants.cldr_version_latest); + + assert.deepEqual(source.keyboardTest.info, { + keyboard: 'fr-t-k0-azerty.xml', + author: 'Team Keyboard', + name: 'fr-test' + }); + + assert.sameDeepMembers(source.keyboardTest.repertoire, [ + { + name: 'simple-repertoire', + chars: '[a b c d e \\u{22}]', + type: 'simple' + }, + { name: 'chars-repertoire', chars: '[á é ó]', type: 'gesture' } + ]); + + assert.equal(1, source.keyboardTest.tests?.length); + assert.equal('key-tests', source.keyboardTest.tests[0].name); + assert.equal(1, source.keyboardTest.tests[0].test?.length); + const test0 = source.keyboardTest.tests[0].test[0]; + assert.equal('key-test', test0.name); + assert.equal('abc\\u0022...', test0.startContext?.to); + assert.sameDeepOrderedMembers([ + { keystroke: { key: 's' } }, + { check: { result: 'abc\\u0022...s' } }, + { keystroke: { key: 't' } }, + { check: { result: 'abc\\u0022...st' } }, + { keystroke: { key: 'u' } }, + { check: { result: 'abc\\u0022...stu' } }, + { emit: { to: 'v' } }, + { check: { result: 'abc\\u0022...stuv' } }, + ], test0.actions); + }, + } + ]); +}); diff --git a/common/web/types/test/ldml-keyboard/test-ldml-keyboard-xml-reader.ts b/common/web/types/test/ldml-keyboard/test-ldml-keyboard-xml-reader.ts new file mode 100644 index 0000000000000000000000000000000000000000..ac791dac33a3a9fcfa4cab38c9d3d45357ece8ea --- /dev/null +++ b/common/web/types/test/ldml-keyboard/test-ldml-keyboard-xml-reader.ts @@ -0,0 +1,131 @@ +import { LKKey } from './../../src/ldml-keyboard/ldml-keyboard-xml.js'; +import 'mocha'; +import {assert} from 'chai'; +import { CommonTypesMessages } from '../../src/util/common-events.js'; +import { testReaderCases } from '../helpers/reader-callback-test.js'; + +function pluckKeysFromKeybag(keys: LKKey[], ids: string[]) { + return keys.filter(({id}) => ids.indexOf(id) !== -1); +} + +describe('ldml keyboard xml reader tests', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + testReaderCases([ + { + subpath: 'invalid-structure-per-dtd.xml', + errors: [CommonTypesMessages.Error_SchemaValidationError({ + instancePath: '/keyboard', + keyword: 'required', + message: `must have required property 'names'`, + params: 'missingProperty="names"', + })], + }, + { + subpath: 'invalid-conforms-to.xml', + errors: [CommonTypesMessages.Error_SchemaValidationError({ + instancePath: '/keyboard/conformsTo', + keyword: 'enum', + message: `must be equal to one of the allowed values`, + params: 'allowedValues="techpreview"', + })], + }, + { + subpath: 'import-minimal.xml', + callback: (data, source, subpath, callbacks) => { + assert.ok(source?.keyboard?.keys); + const k = pluckKeysFromKeybag(source?.keyboard?.keys.key, ['a', 'b', 'c']); + assert.sameDeepOrderedMembers(k, [ + {id: 'a', to: 'a'}, + {id: 'b', to: 'b'}, + {id: 'c', to: 'c'}, + ]); + }, + }, + { + subpath: 'import-minimal1.xml', + callback: (data, source, subpath, callbacks) => { + assert.ok(source?.keyboard?.keys); + const k = pluckKeysFromKeybag(source?.keyboard?.keys.key, ['a', 'b', 'c']); + assert.sameDeepOrderedMembers(k, [ + {id: 'a', to: 'a'}, + {id: 'b', to: 'b'}, + {id: 'c', to: 'c'}, + ]); + }, + }, + { + subpath: 'import-minimal2.xml', + callback: (data, source, subpath, callbacks) => { + assert.ok(source?.keyboard?.keys); + const k = pluckKeysFromKeybag(source?.keyboard?.keys.key, ['a', 'b', 'c']); + assert.sameDeepOrderedMembers(k, [ + {id: 'a', to: 'a'}, + {id: 'b', to: 'b'}, + {id: 'c', to: 'c'}, + {id: 'a', to: 'å'}, // overridden + ]); + }, + }, + { + subpath: 'import-symbols.xml', + callback: (data, source, subpath, callbacks) => { + assert.ok(source?.keyboard?.keys); + const k = pluckKeysFromKeybag(source?.keyboard?.keys.key, ['a', 'b', 'c', 'zz', 'hash', 'hyphen']); + assert.sameDeepOrderedMembers(k, [ + {id: 'a', to: 'a'}, // implied + {id: 'b', to: 'b'}, + {id: 'c', to: 'c'}, + {id: 'hash', to: '#'}, // imported symbols + {id: 'hyphen', to: '-'}, + {id: 'zz', to: 'zz'}, // new key + {id: 'hash', to: '##'}, // override + ]); + }, + }, + { + subpath: 'invalid-import-base.xml', + loadfail: true, + errors: [ + CommonTypesMessages.Error_ImportInvalidBase({ + base: 'SOME_INVALID_BASE', + path: 'B', + subtag: 'C' + }), + ], + }, + { + subpath: 'invalid-import-path.xml', + loadfail: true, + errors: [ + CommonTypesMessages.Error_ImportInvalidPath({ + base: null, + path: 'techpreview/too/many/slashes/leading/to/nothing-Zxxx-does-not-exist.xml', + subtag: null, + }), + ], + }, + { + subpath: 'invalid-import-readfail.xml', + loadfail: true, + errors: [ + CommonTypesMessages.Error_ImportReadFail({ + base: null, + path: 'techpreview/none-Zxxx-does-not-exist.xml', + subtag: null, + }), + ], + }, + { + subpath: 'invalid-import-wrongroot.xml', + loadfail: true, + errors: [ + CommonTypesMessages.Error_ImportWrongRoot({ + base: null, + path: 'techpreview/keys-Zyyy-punctuation.xml', + subtag: 'names', + }), + ], + }, + ]); +}); diff --git a/common/web/types/test/tsconfig.json b/common/web/types/test/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..9c97b463afd01e2855a701a35ed22430b978ac90 --- /dev/null +++ b/common/web/types/test/tsconfig.json @@ -0,0 +1,21 @@ +{ + "extends": "../../../../tsconfig.esm-base.json", + + "compilerOptions": { + "rootDir": ".", + "rootDirs": ["./", "../src/"], + "outDir": "../build/test", + "baseUrl": ".", + "strictNullChecks": false, // TODO: get rid of this as some point + "allowSyntheticDefaultImports": true // for ajv + }, + "include": [ + "**/test-*.ts", + "./helpers/*.ts", + ], + "references": [ + { "path": "../../keyman-version/tsconfig.esm.json" }, + { "path": "../../../../core/include/ldml/"}, + { "path": "../" }, + ] +} diff --git a/common/web/types/test/util/test-unescape.ts b/common/web/types/test/util/test-unescape.ts new file mode 100644 index 0000000000000000000000000000000000000000..5708046a80d3f3389a6c161ff2e6eafb3151a681 --- /dev/null +++ b/common/web/types/test/util/test-unescape.ts @@ -0,0 +1,38 @@ +import 'mocha'; +import {assert} from 'chai'; +import {unescapeString, UnescapeError} from '../../src/util/util.js'; + +describe('test unescapeString()', function() { + it("should correctly handle multi strings", function() { + assert.equal(unescapeString('Sa\\u{0127 0127}a'), 'Saħħa'); + }); + + it("should pass through falsy strings", function() { + assert.equal(unescapeString(''), ''); + assert.equal(unescapeString(null), null); + }); + + it("should pass through non-escaped strings", function() { + assert.equal(unescapeString('abc'), 'abc'); + assert.equal(unescapeString('\\u{abc'), '\\u{abc'); + }); + + it("should correctly unescape strings", function() { + assert.equal(unescapeString('\\u{0127}'), 'ħ'); + assert.equal(unescapeString('\\u{0127}==\\u{0127}'), 'ħ==ħ'); + assert.equal(unescapeString('Q\\u{0127}'), 'Qħ'); + }); + + it("should correctly handle 1..6 char escapes", function() { + assert.equal(unescapeString('\\u{9}'), '\u{0009}'); // TAB + assert.equal(unescapeString('\\u{4a}'), '\u{004a}'); // J + assert.equal(unescapeString('\\u{3c8}'), '\u{03c8}'); // ψ + assert.equal(unescapeString('\\u{304B}'), '\u{304b}'); // か + assert.equal(unescapeString('\\u{1e109}'), '\u{1e109}'); // 𞄉 + assert.equal(unescapeString('\\u{10fff0}'), '\u{10fff0}'); // Plane 16 Private Use + }); + + it("should throw UnescapeError on invalid escapes", function() { + assert.throws(() => unescapeString('\\u{110000}'), UnescapeError); + }); +}); diff --git a/common/web/types/tsconfig.json b/common/web/types/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..a32b8e1ed7f7fd098b0cdc87b64517623f6503ad --- /dev/null +++ b/common/web/types/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../tsconfig.esm-base.json", + + "compilerOptions": { + "outDir": "build/src/", + "rootDir": "src/", + "baseUrl": ".", + "allowSyntheticDefaultImports": true // for ajv + }, + "include": [ + "src/**/*.ts" + ], + "references": [ + { "path": "../keyman-version/tsconfig.esm.json" }, + { "path": "../../../core/include/ldml/tsconfig.json"}, + ] +} diff --git a/common/web/utils/build.sh b/common/web/utils/build.sh index 9232703a850e8fe65dc145b433ab48f910036a48..012f6ad41e9ace13da34a665ec2048e52ff2d724 100755 --- a/common/web/utils/build.sh +++ b/common/web/utils/build.sh @@ -6,8 +6,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" @@ -18,12 +18,12 @@ cd "$THIS_SCRIPT_PATH" builder_describe \ "Compiles the web-oriented utility function module." \ - "@../keyman-version" \ - configure clean build + "@/common/web/keyman-version" \ + clean configure build test builder_describe_outputs \ configure "/node_modules" \ - build "build/index.js" + build "/common/web/utils/build/index.js" builder_parse "$@" @@ -40,9 +40,9 @@ fi if builder_start_action build; then # Note: in a dependency build, we'll expect utils to be built by tsc -b if builder_is_dep_build; then - echo "[$THIS_SCRIPT_IDENTIFIER] skipping tsc -b; will be completed by $builder_dep_parent" + builder_echo "skipping tsc -b; will be completed by $builder_dep_parent" else - npm run tsc -- --build "$THIS_SCRIPT_PATH/tsconfig.json" + tsc --build "$THIS_SCRIPT_PATH/tsconfig.json" fi builder_finish_action success build fi \ No newline at end of file diff --git a/common/web/utils/package.json b/common/web/utils/package.json index 01673ffeac4b514321afc7ba2182fc213a47af09..fbe518e2b8ae0a82bcc0df6e69311453cb18af9b 100644 --- a/common/web/utils/package.json +++ b/common/web/utils/package.json @@ -22,6 +22,6 @@ "@keymanapp/resources-gosh": "*", "@keymanapp/keyman-version": "*", "@types/node": "^14.0.5", - "typescript": "^4.5.4" + "typescript": "^4.9.5" } } diff --git a/common/windows/build.sh b/common/windows/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..65db064c5b202a395dfd31775d30151bbf2f3866 --- /dev/null +++ b/common/windows/build.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +if [[ $BUILDER_OS != windows ]]; then + builder_echo grey "Platform is not Windows; skipping common/windows" + exit 0 +fi + +# +# TODO: when we have windows-specific tests, add them here +# as child modules +# + +builder_describe "Keyman common Windows modules" \ + clean \ + configure \ + build \ + test + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +builder_run_child_actions clean configure build test diff --git a/common/windows/cef-checkout.sh b/common/windows/cef-checkout.sh index 645c44138c98b29a0e21adb25b036175d37361d7..b8326561b874c496362b6e5cc89c31c328d64cb6 100755 --- a/common/windows/cef-checkout.sh +++ b/common/windows/cef-checkout.sh @@ -12,8 +12,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" # . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" ## END STANDARD BUILD SCRIPT INCLUDE @@ -47,7 +47,7 @@ if [ ! -f ./libcef.dll ]; then rm "$zip" done - [ -f ./libcef.dll ] || die "File libcef.dll could not be found. Path $KEYMAN_CEF4DELPHI_ROOT may not be valid." + [ -f ./libcef.dll ] || builder_die "File libcef.dll could not be found. Path $KEYMAN_CEF4DELPHI_ROOT may not be valid." fi popd > /dev/null diff --git a/common/windows/cpp/include/.gitignore b/common/windows/cpp/include/.gitignore deleted file mode 100644 index 69ffc835cd58b37bb2f58058d770d2cf77c5ca15..0000000000000000000000000000000000000000 --- a/common/windows/cpp/include/.gitignore +++ /dev/null @@ -1 +0,0 @@ -keymanversion_build.h diff --git a/common/windows/cpp/include/keymansentry.h b/common/windows/cpp/include/keymansentry.h index bb65c37b5eb991439f8a12e7c4fadd78f93e40ac..4bc3c9e4cf5952239130af244453865897e457e5 100644 --- a/common/windows/cpp/include/keymansentry.h +++ b/common/windows/cpp/include/keymansentry.h @@ -1,5 +1,7 @@ #pragma once +#include + /* * Map of Sentry levels for events and breadcrumbs. */ @@ -26,7 +28,7 @@ int keyman_sentry_main(bool is_keyman_developer, const char *logger, int argc, c int keyman_sentry_wmain(bool is_keyman_developer, const char *logger, int argc, wchar_t *argv[], int(*run)(int, wchar_t**)); void keyman_sentry_setexceptionfilter(); -void keyman_sentry_report_message(keyman_sentry_level_t level, const char *message, bool includeStack = false); +sentry_uuid_t keyman_sentry_report_message(keyman_sentry_level_t level, const char *message, bool includeStack = false); void keyman_sentry_report_start(); // @@ -37,3 +39,4 @@ void keyman_sentry_report_start(); // d) privacy options are correctly checked // void keyman_sentry_test_crash(); +void keyman_sentry_test_message(); diff --git a/common/windows/cpp/include/keymanversion.h b/common/windows/cpp/include/keymanversion.h index a35421a2de09f5b7a3b2482dcc21b8f1524ee42b..e9d39defba2bbecd564c89f38ee0b980eb87f67c 100644 --- a/common/windows/cpp/include/keymanversion.h +++ b/common/windows/cpp/include/keymanversion.h @@ -1,7 +1,7 @@ #ifndef _KEYMANVERSION_H #define _KEYMANVERSION_H -#include "keymanversion_build.h" +#include "../../../include/keymanversion_build.h" // We should not need to add to these hard-coded version numbers for future versions, unless // we have a back-compat need to refer to a specific version. diff --git a/common/windows/cpp/include/legacy_kmx_file.h b/common/windows/cpp/include/legacy_kmx_file.h index 8e121be13f71da6ad1b50c14c6a13607aa7068e2..ae18543312f2303575ac276e1521c7bff9c20eb7 100644 --- a/common/windows/cpp/include/legacy_kmx_file.h +++ b/common/windows/cpp/include/legacy_kmx_file.h @@ -1,3 +1,5 @@ +// TODO: merge and replace with kmx_file.h from core + /* Name: legacy_kmx_file Copyright: Copyright (C) SIL International. @@ -71,9 +73,9 @@ #define VERSION_100 0x00000A00 #define VERSION_140 0x00000E00 #define VERSION_150 0x00000F00 - +#define VERSION_160 0x00001000 #define VERSION_MIN VERSION_50 -#define VERSION_MAX VERSION_150 +#define VERSION_MAX VERSION_160 /* Special flag for WM_CHAR/WM_KEY???/WM_SYSKEY???: says that key has been @@ -283,6 +285,9 @@ #define KF_LOGICALLAYOUT 0x0008 #define KF_AUTOMATICVERSION 0x0010 +// 16.0: Support for LDML Keyboards in KMXPlus file format +#define KF_KMXPLUS 0x0020 + #define HK_ALT 0x00010000 #define HK_CTRL 0x00020000 #define HK_SHIFT 0x00040000 @@ -341,6 +346,7 @@ static_assert(sizeof(COMP_STORE) == KEYBOARDFILESTORE_SIZE, "COMP_STORE must be struct COMP_KEY { WORD Key; + WORD _reserved; DWORD Line; DWORD ShiftFlags; DWORD dpOutput; @@ -365,7 +371,7 @@ struct COMP_KEYBOARD { DWORD dwFileVersion; // 0004 Version of the file - Keyman 4.0 is 0x0400 - DWORD dwCheckSum; // 0008 As stored in keyboard + DWORD dwCheckSum; // 0008 As stored in keyboard. DEPRECATED as of 16.0 DWORD KeyboardID; // 000C as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts DWORD IsRegistered; // 0010 DWORD version; // 0014 keyboard version @@ -399,9 +405,18 @@ typedef COMP_STORE *PCOMP_STORE; typedef COMP_KEY *PCOMP_KEY; typedef COMP_GROUP *PCOMP_GROUP; + +typedef struct _COMPILER_OPTIONS { + DWORD dwSize; + BOOL ShouldAddCompilerVersion; + BOOL UseKmcmpLib; +} COMPILER_OPTIONS; + +typedef COMPILER_OPTIONS *PCOMPILER_OPTIONS; + typedef int (CALLBACK *CompilerMessageProc)(int line, DWORD dwMsgCode, LPSTR szText); -extern "C" BOOL __declspec(dllexport) CompileKeyboardFile(PSTR pszInfile, PSTR pszOutfile, BOOL FSaveDebug, BOOL ACompilerWarningsAsErrors, BOOL AWarnDeprecatedCode, CompilerMessageProc pMsgProc); // I4865 // I4866 +//extern "C" BOOL __declspec(dllexport) CompileKeyboardFile(PSTR pszInfile, PSTR pszOutfile, BOOL FSaveDebug, BOOL ACompilerWarningsAsErrors, BOOL AWarnDeprecatedCode, CompilerMessageProc pMsgProc); // I4865 // I4866 #endif // _COMPILER_H diff --git a/common/windows/cpp/include/legacy_kmx_memory.h b/common/windows/cpp/include/legacy_kmx_memory.h index 0dd681c6a32f0459a02b6d3b544b6ce2baccf257..771a4d57ca9691d1879dc53391168a3cbf1beff4 100644 --- a/common/windows/cpp/include/legacy_kmx_memory.h +++ b/common/windows/cpp/include/legacy_kmx_memory.h @@ -34,7 +34,7 @@ typedef struct tagKEYBOARD DWORD dwFileVersion; // Version of the file - Keyman 4.0 is 0x0400 - DWORD dwCheckSum; // As stored in keyboard + DWORD dwCheckSum; // As stored in keyboard. DEPRECATED as of 16.0 DWORD xxkbdlayout; // as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts DWORD IsRegistered; // layout id, from same registry key DWORD version; // keyboard version diff --git a/common/windows/cpp/include/registry.h b/common/windows/cpp/include/registry.h index 4e2fe9ae35ba8bfe0e22e3597e83841e0ad32d6f..895f9e83becbbd3297c3375c5dcec036fd41d4b7 100644 --- a/common/windows/cpp/include/registry.h +++ b/common/windows/cpp/include/registry.h @@ -129,9 +129,6 @@ #define REGSZ_Flag_UseCachedHotkeyModifierState "Flag_UseCachedHotkeyModifierState" -/* REGSZ_Flag_UseKeymanCore DWORD: Turns on the common core - instead of windows core */ -#define REGSZ_Flag_UseKeymanCore "Flag_UseKeymanCore" - /* DWORD: Enable/disable deep TSF integration, default enabled; 0 = disabled, 1 = enabled, 2 = default */ #define REGSZ_DeepTSFIntegration "deep tsf integration" diff --git a/common/windows/cpp/include/vkeys.h b/common/windows/cpp/include/vkeys.h index 47a1daf3011df1e9d23adf6b1cc894d63494f6f0..6aa71cc497c0ce9eb0aaedf00737f632864509ed 100644 --- a/common/windows/cpp/include/vkeys.h +++ b/common/windows/cpp/include/vkeys.h @@ -1,4 +1,12 @@ #pragma once -extern PCWSTR VKeyNames[256]; -extern PCWSTR VKeyISO9995Names[256]; +#ifdef USE_CHAR16_T +#include +#define VKEY_CHAR KMX_UCHAR +#else +#define VKEY_CHAR WCHAR +#define lpuch(x) L ## x +#endif + +extern const VKEY_CHAR* VKeyNames[256]; +extern const VKEY_CHAR* VKeyISO9995Names[256]; diff --git a/common/windows/cpp/src/keymansentry.cpp b/common/windows/cpp/src/keymansentry.cpp index ce287723e1cfcfe4e77d0faeeb8cd2aee431a8cc..71f640a4a5b5b3294ee4fd3d5484d5a293a0bd2d 100644 --- a/common/windows/cpp/src/keymansentry.cpp +++ b/common/windows/cpp/src/keymansentry.cpp @@ -32,7 +32,7 @@ int keyman_sentry_init(bool is_keyman_developer, const char *logger) { // Set the sentry-db-directory to a writeable location - char szPath[MAX_PATH + 64]; // sufficient length for sentry-0.4.9-db etc + char szPath[MAX_PATH + 64]; // sufficient length for sentry-0.6.0-db etc LPITEMIDLIST pidl; if (SUCCEEDED(SHGetFolderLocation(0, CSIDL_LOCAL_APPDATA, NULL, 0, &pidl))) { @@ -43,7 +43,7 @@ int keyman_sentry_init(bool is_keyman_developer, const char *logger) { *p = 0; } - strcat_s(szPath, "sentry-0.4.9-db"); + strcat_s(szPath, "sentry-" SENTRY_SDK_VERSION "-db"); sentry_options_set_database_path(options, szPath); } ILFree(pidl); @@ -132,7 +132,7 @@ sentry_value_t CaptureStackTrace(PVOID TopAddr, DWORD FramesToSkip) { void keyman_sentry_report_exception(DWORD ExceptionCode, PVOID ExceptionAddress) { sentry_value_t event; const int FRAMES_TO_SKIP = 0; - + sentry_uuid_t uuid = { 0 }; char message[64]; wsprintfA(message, "Exception %x at %p", (unsigned int) ExceptionCode, ExceptionAddress); @@ -159,18 +159,22 @@ void keyman_sentry_report_exception(DWORD ExceptionCode, PVOID ExceptionAddress) sentry_value_set_by_key(event, "threads", threads); } - sentry_capture_event(event); + uuid = sentry_capture_event(event); } fputs(message, stderr); fputs("\n", stderr); if(g_report_exceptions) { fputs("This error has been automatically reported to the Keyman team.\n", stderr); + char uuid_string[37]; + sentry_uuid_as_string(&uuid, uuid_string); + fprintf(stderr, "Sentry uuid: %s\n", uuid_string); } } -void keyman_sentry_report_message(keyman_sentry_level_t level, const char *message, bool includeStack) { +sentry_uuid_t keyman_sentry_report_message(keyman_sentry_level_t level, const char *message, bool includeStack) { const int FRAMES_TO_SKIP = 0; + sentry_uuid_t uuid = { 0 }; if ((g_report_exceptions && (level == SENTRY_LEVEL_ERROR || level == SENTRY_LEVEL_DEBUG)) || g_report_messages) { sentry_value_t event; @@ -190,12 +194,15 @@ void keyman_sentry_report_message(keyman_sentry_level_t level, const char *messa } } - sentry_capture_event(event); + uuid = sentry_capture_event(event); } + + return uuid; } /* Wrappers for main, wmain */ +#define SENTRY_USE_LOCAL_FILTER #ifdef SENTRY_USE_LOCAL_FILTER LPTOP_LEVEL_EXCEPTION_FILTER LastFilter; @@ -236,6 +243,11 @@ int keyman_sentry_main(bool is_keyman_developer, const char *logger, int argc, c keyman_sentry_test_crash(); } + if (argc > 1 && !strcmp(argv[1], "-sentry-client-test-message")) { + // Undocumented test parameter + keyman_sentry_test_message(); + } + int res = run(argc, argv); keyman_sentry_shutdown(); @@ -253,6 +265,11 @@ int keyman_sentry_wmain(bool is_keyman_developer, const char *logger, int argc, keyman_sentry_test_crash(); } + if (argc > 1 && !wcscmp(argv[1], L"-sentry-client-test-message")) { + // Undocumented test parameter + keyman_sentry_test_message(); + } + int res = run(argc, argv); keyman_sentry_shutdown(); @@ -260,9 +277,19 @@ int keyman_sentry_wmain(bool is_keyman_developer, const char *logger, int argc, return res; } +void keyman_sentry_test_message() { + fputs("Testing Sentry reporting:\n", stderr); + auto uuid = keyman_sentry_report_message(KEYMAN_SENTRY_LEVEL_INFO, "Testing Sentry message reporting", true); + char uuid_string[37]; + sentry_uuid_as_string(&uuid, uuid_string); + fprintf(stderr, "Sentry uuid: %s\n", uuid_string); + exit(0); +} void keyman_sentry_test_crash() { - fputs("Testing exception reporting:\n", stderr); + fputs("Testing Sentry exception reporting:\n", stderr); RaiseException(0x0EA0BEEF, EXCEPTION_NONCONTINUABLE, 0, NULL); + fputs("Should not have gotten here\n", stderr); + exit(1); } /* Delay load sentry.dll from our subdirectory: #5166 */ @@ -274,12 +301,12 @@ void keyman_sentry_test_crash() { #else #define SENTRY_DLL SENTRY_BASE_DLL #endif -#define SENTRY_INSTALL_PATH "sentry-0.4.9\\" SENTRY_DLL +#define SENTRY_INSTALL_PATH "sentry-" SENTRY_SDK_VERSION "\\" SENTRY_DLL #define SENTRY_DEV_PATH "common\\windows\\delphi\\ext\\sentry\\" SENTRY_DLL #define ENV_KEYMAN_ROOT "KEYMAN_ROOT" HMODULE LoadSentryLibrary() { - //MAX_PATH + 64 chars leaves space for "\sentry-0.4.9\sentry.x64.dll" + //MAX_PATH + 64 chars leaves space for "\sentry-0.6.0\sentry.x64.dll" char buf[MAX_PATH + 64], keyman_root[MAX_PATH + 64]; int nsize = GetModuleFileNameA(0, buf, MAX_PATH); diff --git a/common/windows/cpp/src/vkeys.cpp b/common/windows/cpp/src/vkeys.cpp index 4b4710baa9f54db208a6680776bb406496141d15..5bf249b3dd7cf7e8c8ac83e8c20e55a0221246fc 100644 --- a/common/windows/cpp/src/vkeys.cpp +++ b/common/windows/cpp/src/vkeys.cpp @@ -17,10 +17,9 @@ */ #include "pch.h" +#include "../include/vkeys.h" -#define lpuch(x) L ## x - -PCWSTR VKeyNames[256] = { +const VKEY_CHAR* VKeyNames[256] = { // Key Codes lpuch("K_?00"), // &H0 lpuch("K_LBUTTON"), // &H1 @@ -292,7 +291,7 @@ PCWSTR VKeyNames[256] = { lpuch("K_?FF") // &HFF }; -PCWSTR VKeyISO9995Names[256] = { +const VKEY_CHAR* VKeyISO9995Names[256] = { // Key Codes lpuch(""), // lpuch("K_?00"), // &H0 lpuch(""), // lpuch("K_LBUTTON"), // &H1 diff --git a/common/windows/delphi/Makefile b/common/windows/delphi/Makefile index 6241b54379e710ee7338916e99622495a52b8f58..2a8258f07bb3a8fe900c5a7def02a10b29245757 100644 --- a/common/windows/delphi/Makefile +++ b/common/windows/delphi/Makefile @@ -1,10 +1,9 @@ !include Defines.mak global-versions: -# Build our root version.txt +# Build our root version.txt; TODO: replace with build.sh deps cd $(KEYMAN_ROOT)\common\windows - - $(MKVER_U) $(KEYMAN_ROOT)\common\windows\cpp\include\keymanversion_build.in $(KEYMAN_ROOT)\common\windows\cpp\include\keymanversion_build.h $(MKVER_U) $(KEYMAN_ROOT)\common\windows\delphi\general\keymanversion_build.in $(KEYMAN_ROOT)\common\windows\delphi\general\keymanversion_build.inc + $(GIT_BASH_FOR_KEYMAN) $(KEYMAN_ROOT)/common/include/build.sh clean configure build !include Target.mak \ No newline at end of file diff --git a/common/windows/delphi/components/common_components.identcache b/common/windows/delphi/components/common_components.identcache deleted file mode 100644 index e216a30819a0f9d8ffa0e9eec5cc52bdbb1d0041..0000000000000000000000000000000000000000 Binary files a/common/windows/delphi/components/common_components.identcache and /dev/null differ diff --git a/common/windows/delphi/ext/sentry.txt b/common/windows/delphi/ext/sentry.txt index 2463cd98f37cc1b926e8a374d8227ca94b18780a..29c5273516381da69b8f97f6e9520846a87d4b59 100644 --- a/common/windows/delphi/ext/sentry.txt +++ b/common/windows/delphi/ext/sentry.txt @@ -4,7 +4,7 @@ Keyman Third Party Package Readme: Sentry Name: Sentry Purpose: Sentry provides error reporting to a Sentry server Source: https://github.com/getsentry/sentry-native -Version: 0.4.9 +Version: 0.6.0 License: MIT Updated for: N/A Documentation: https://docs.sentry.io/platforms/native/ @@ -15,8 +15,8 @@ Include Paths: N/A Installation notes ------------------ -The original C++ version can be downloaded from site above. Source is -not included +The original C++ version can be downloaded from site above, and must be +built following the instructions below. Build notes ----------- @@ -27,6 +27,9 @@ team. This needs to be updated whenever Sentry is updated. Sentry.Client.pas is a wrapper of sentry.pas which provides a Delphi-style interface to Sentry. +Note: as of 0.6.0, performance SDKs are not included in Sentry.Client.pas, +because we are not currently using them. + build_sentry_for_keyman.bat should be copied into the sentry-native repo, and tweaked as required for updated versions of Sentry. Run: @@ -37,6 +40,11 @@ and tweaked as required for updated versions of Sentry. Run: install: prepare install folder in sentry-native deploy: copy the sentry.dll and related files into this repo +**Important:** ensure that the sentry folder name in all .wxs files is +updated to match the SENTRY_SDK_VERSION from sentry.h. Source C++ and .pas +files use the constant to refer to the location where the files may be +found. + License - MIT ------------- diff --git a/common/windows/delphi/ext/sentry/crashpad_handler.exe b/common/windows/delphi/ext/sentry/crashpad_handler.exe index 41e10b88e1ff4b00ecf92bf4df311ba4ccdc0583..76276e6bec9e55686b779c34801c42b0f05ecdf7 100644 Binary files a/common/windows/delphi/ext/sentry/crashpad_handler.exe and b/common/windows/delphi/ext/sentry/crashpad_handler.exe differ diff --git a/common/windows/delphi/ext/sentry/sentry.dll b/common/windows/delphi/ext/sentry/sentry.dll index 96d753e4cc128b04dd28fbdc563e3b7c340da6ea..86fbd12db6fcbc322631ee74979706ecf526fbea 100644 Binary files a/common/windows/delphi/ext/sentry/sentry.dll and b/common/windows/delphi/ext/sentry/sentry.dll differ diff --git a/common/windows/delphi/ext/sentry/sentry.h b/common/windows/delphi/ext/sentry/sentry.h index 91146520a959751f20f773dfb5ed3ed01374136f..b5381642dae2923dfd5737a8519060f2b4906ed3 100644 --- a/common/windows/delphi/ext/sentry/sentry.h +++ b/common/windows/delphi/ext/sentry/sentry.h @@ -23,8 +23,14 @@ extern "C" { #endif /* SDK Version */ -#define SENTRY_SDK_NAME "sentry.native" -#define SENTRY_SDK_VERSION "0.4.9" +#ifndef SENTRY_SDK_NAME +# ifdef __ANDROID__ +# define SENTRY_SDK_NAME "sentry.native.android" +# else +# define SENTRY_SDK_NAME "sentry.native" +# endif +#endif +#define SENTRY_SDK_VERSION "0.6.0" #define SENTRY_SDK_USER_AGENT SENTRY_SDK_NAME "/" SENTRY_SDK_VERSION /* common platform detection */ @@ -46,6 +52,10 @@ extern "C" { #elif defined(__linux) || defined(__linux__) # define SENTRY_PLATFORM_LINUX # define SENTRY_PLATFORM_UNIX +#elif defined(_AIX) +/* IBM i PASE is also counted as AIX */ +# define SENTRY_PLATFORM_AIX +# define SENTRY_PLATFORM_UNIX #else # error unsupported platform #endif @@ -189,7 +199,7 @@ SENTRY_API sentry_value_t sentry_value_new_int32(int32_t value); SENTRY_API sentry_value_t sentry_value_new_double(double value); /** - * Creates a new boolen value. + * Creates a new boolean value. */ SENTRY_API sentry_value_t sentry_value_new_bool(int value); @@ -399,8 +409,8 @@ SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_thread( * * See https://develop.sentry.dev/sdk/event-payloads/stacktrace/ * - * The returned object needs to be attached to either an exception - * event, or a thread object. + * The returned object must be attached to either an exception or thread + * object. * * If `ips` is NULL the current stack trace is captured, otherwise `len` * stack trace instruction pointers are attached to the event. @@ -408,6 +418,17 @@ SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_thread( SENTRY_EXPERIMENTAL_API sentry_value_t sentry_value_new_stacktrace( void **ips, size_t len); +/** + * Sets the Stack Trace conforming to the Stack Trace Interface in a value. + * + * The value argument must be either an exception or thread object. + * + * If `ips` is NULL the current stack trace is captured, otherwise `len` stack + * trace instruction pointers are attached to the event. + */ +SENTRY_EXPERIMENTAL_API void sentry_value_set_stacktrace( + sentry_value_t value, void **ips, size_t len); + /** * Adds an Exception to an Event value. * @@ -469,9 +490,12 @@ typedef struct sentry_ucontext_s { * * If the address is given in `addr` the stack is unwound form there. * Otherwise (NULL is passed) the current instruction pointer is used as - * start address. The stack trace is written to `stacktrace_out` with up to - * `max_len` frames being written. The actual number of unwound stackframes - * is returned. + * start address. + * Unwinding with a given `addr` is not supported on all platforms. + * + * The stack trace in the form of instruction-addresses, is written to the + * caller allocated `stacktrace_out`, with up to `max_len` frames being written. + * The actual number of unwound stackframes is returned. */ SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack( void *addr, void **stacktrace_out, size_t max_len); @@ -479,8 +503,12 @@ SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack( /** * Unwinds the stack from the given context. * - * The stack trace is written to `stacktrace_out` with up to `max_len` frames - * being written. The actual number of unwound stackframes is returned. + * The caller is responsible to construct an appropriate `sentry_ucontext_t`. + * Unwinding from a user context is not supported on all platforms. + * + * The stack trace in the form of instruction-addresses, is written to the + * caller allocated `stacktrace_out`, with up to `max_len` frames being written. + * The actual number of unwound stackframes is returned. */ SENTRY_EXPERIMENTAL_API size_t sentry_unwind_stack_from_ucontext( const sentry_ucontext_t *uctx, void **stacktrace_out, size_t max_len); @@ -543,13 +571,21 @@ typedef struct sentry_envelope_s sentry_envelope_t; SENTRY_API void sentry_envelope_free(sentry_envelope_t *envelope); /** - * Given an envelope returns the embedded event if there is one. + * Given an Envelope, returns the embedded Event if there is one. * - * This returns a borrowed value to the event in the envelope. + * This returns a borrowed value to the Event in the Envelope. */ SENTRY_API sentry_value_t sentry_envelope_get_event( const sentry_envelope_t *envelope); +/** + * Given an Envelope, returns the embedded Transaction if there is one. + * + * This returns a borrowed value to the Transaction in the Envelope. + */ +SENTRY_EXPERIMENTAL_API sentry_value_t sentry_envelope_get_transaction( + const sentry_envelope_t *envelope); + /** * Serializes the envelope. * @@ -571,7 +607,7 @@ SENTRY_API int sentry_envelope_write_to_file( /** * The Sentry Client Options. * - * See https://docs.sentry.io/error-reporting/configuration/ + * See https://docs.sentry.io/platforms/native/configuration/ */ struct sentry_options_s; typedef struct sentry_options_s sentry_options_t; @@ -595,13 +631,16 @@ typedef struct sentry_options_s sentry_options_t; * * `startup_func`: This hook will be called by sentry inside of `sentry_init` * and instructs the transport to initialize itself. Failures will bubble up * to `sentry_init`. + * * `flush_func`: Instructs the transport to flush its queue. + * This hook receives a millisecond-resolution `timeout` parameter and should + * return `0` if the transport queue is flushed within the timeout. * * `shutdown_func`: Instructs the transport to flush its queue and shut down. * This hook receives a millisecond-resolution `timeout` parameter and should - * return `true` when the transport was flushed and shut down successfully. - * In case of `false`, sentry will log an error, but continue with freeing the - * transport. + * return `0` if the transport is flushed and shut down successfully. + * In case of a non-zero return value, sentry will log an error, but continue + * with freeing the transport. * * `free_func`: Frees the transports `state`. This hook might be called even - * though `shutdown_func` returned `false` previously. + * though `shutdown_func` returned a failure code previously. * * The transport interface might be extended in the future with hooks to flush * its internal queue without shutting down, and to dump its internal queue to @@ -641,6 +680,16 @@ SENTRY_API void sentry_transport_set_free_func( SENTRY_API void sentry_transport_set_startup_func(sentry_transport_t *transport, int (*startup_func)(const sentry_options_t *options, void *state)); +/** + * Sets the transport flush hook. + * + * This hook will receive a millisecond-resolution timeout. + * It should return `0` if all the pending envelopes are + * sent within the timeout, or `1` if the timeout is hit. + */ +SENTRY_API void sentry_transport_set_flush_func(sentry_transport_t *transport, + int (*flush_func)(uint64_t timeout, void *state)); + /** * Sets the transport shutdown hook. * @@ -671,6 +720,20 @@ SENTRY_API void sentry_transport_free(sentry_transport_t *transport); SENTRY_API sentry_transport_t *sentry_new_function_transport( void (*func)(const sentry_envelope_t *envelope, void *data), void *data); +/** + * This represents an interface for user-defined backends. + * + * Backends are responsible to handle crashes. They are maintained at runtime + * via various life-cycle hooks from the sentry-core. + * + * At this point none of those interfaces are exposed in the API including + * creation and destruction. The main use-case of the backend in the API at this + * point is to disable it via `sentry_options_set_backend` at runtime before it + * is initialized. + */ +struct sentry_backend_s; +typedef struct sentry_backend_s sentry_backend_t; + /* -- Options APIs -- */ /** @@ -707,11 +770,28 @@ SENTRY_API void sentry_options_set_transport( * call `sentry_value_decref` on the provided event, and return a * `sentry_value_new_null()` instead. * + * If you have set an `on_crash` callback (independent of whether it discards or + * retains the event), `before_send` will no longer be invoked for crash-events, + * which allows you to better distinguish between crashes and all other events + * in client-side pre-processing. + * * This function may be invoked inside of a signal handler and must be safe for * that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. * On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see * the documentation on SEH (structured exception handling) for more information * https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling + * + * Up to version 0.4.18 the `before_send` callback wasn't invoked in case the + * event sampling discarded an event. In the current implementation the + * `before_send` callback is invoked even if the event sampling discards the + * event, following the cross-SDK session filter order: + * + * https://develop.sentry.dev/sdk/sessions/#filter-order + * + * On Windows the crashpad backend can capture fast-fail crashes which by-pass + * SEH. Since the `before_send` is called by a local exception-handler, it will + * not be invoked when such a crash happened, even though a minidump will be + * sent. */ typedef sentry_value_t (*sentry_event_function_t)( sentry_value_t event, void *hint, void *closure); @@ -724,6 +804,64 @@ typedef sentry_value_t (*sentry_event_function_t)( SENTRY_API void sentry_options_set_before_send( sentry_options_t *opts, sentry_event_function_t func, void *data); +/** + * Type of the `on_crash` callback. + * + * The `on_crash` callback replaces the `before_send` callback for crash events. + * The interface is analogous to `before_send` in that the callback takes + * ownership of the `event`, and should usually return that same event. In case + * the event should be discarded, the callback needs to call + * `sentry_value_decref` on the provided event, and return a + * `sentry_value_new_null()` instead. + * + * Only the `inproc` backend currently fills the passed-in event with useful + * data and processes any modifications to the return value. Since both + * `breakpad` and `crashpad` use minidumps to capture the crash state, the + * passed-in event is empty when using these backends, and they ignore any + * changes to the return value. + * + * If you set this callback in the options, it prevents a concurrently enabled + * `before_send` callback from being invoked in the crash case. This allows for + * better differentiation between crashes and other events and gradual migration + * from existing `before_send` implementations: + * + * - if you have a `before_send` implementation and do not define an `on_crash` + * callback your application will receive both normal and crash events as + * before + * - if you have a `before_send` implementation but only want to handle normal + * events with it, then you can define an `on_crash` callback that returns + * the passed-in event and does nothing else + * - if you are not interested in normal events, but only want to act on + * crashes (within the limits mentioned below), then only define an + * `on_crash` callback with the option to filter (on all backends) or enrich + * (only inproc) the crash event + * + * This function may be invoked inside of a signal handler and must be safe for + * that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. + * On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see + * the documentation on SEH (structured exception handling) for more information + * https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling + * + * Platform-specific behavior: + * + * - does not work with crashpad on macOS. + * - for breakpad on Linux the `uctx` parameter is always NULL. + * - on Windows the crashpad backend can capture fast-fail crashes which + * by-pass SEH. Since `on_crash` is called by a local exception-handler, it will + * not be invoked when such a crash happened, even though a minidump will be + * sent. + */ +typedef sentry_value_t (*sentry_crash_function_t)( + const sentry_ucontext_t *uctx, sentry_value_t event, void *closure); + +/** + * Sets the `on_crash` callback. + * + * See the `sentry_crash_function_t` typedef above for more information. + */ +SENTRY_API void sentry_options_set_on_crash( + sentry_options_t *opts, sentry_crash_function_t func, void *data); + /** * Sets the DSN. */ @@ -738,6 +876,19 @@ SENTRY_API const char *sentry_options_get_dsn(const sentry_options_t *opts); * Sets the sample rate, which should be a double between `0.0` and `1.0`. * Sentry will randomly discard any event that is captured using * `sentry_capture_event` when a sample rate < 1 is set. + * + * The sampling happens at the end of the event processing according to the + * following order: + * + * https://develop.sentry.dev/sdk/sessions/#filter-order + * + * Only items 3. to 6. are currently applicable to sentry-native. This means + * each processing step is executed even if the sampling discards the event + * before sending it to the backend. This is particularly relevant to users of + * the `before_send` callback. + * + * The above is in contrast to versions up to 0.4.18 where the sampling happened + * at the beginning of the processing/filter sequence. */ SENTRY_API void sentry_options_set_sample_rate( sentry_options_t *opts, double sample_rate); @@ -999,6 +1150,29 @@ SENTRY_API void sentry_options_set_database_pathw( SENTRY_API void sentry_options_set_system_crash_reporter_enabled( sentry_options_t *opts, int enabled); +/** + * Sets the maximum time (in milliseconds) to wait for the asynchronous tasks to + * end on shutdown, before attempting a forced termination. + */ +SENTRY_API void sentry_options_set_shutdown_timeout( + sentry_options_t *opts, uint64_t shutdown_timeout); + +/** + * Gets the maximum time (in milliseconds) to wait for the asynchronous tasks to + * end on shutdown, before attempting a forced termination. + */ +SENTRY_API uint64_t sentry_options_get_shutdown_timeout(sentry_options_t *opts); + +/** + * Sets a user-defined backend. + * + * Since creation and destruction of backends is not exposed in the API, this + * can only be used to set the backend to `NULL`, which disables the backend in + * the initialization. + */ +SENTRY_API void sentry_options_set_backend( + sentry_options_t *opts, sentry_backend_t *backend); + /* -- Global APIs -- */ /** @@ -1012,6 +1186,15 @@ SENTRY_API void sentry_options_set_system_crash_reporter_enabled( */ SENTRY_API int sentry_init(sentry_options_t *options); +/** + * Instructs the transport to flush its send queue. + * + * The `timeout` parameter is in milliseconds. + * + * Returns 0 on success, or a non-zero return value in case the timeout is hit. + */ +SENTRY_API int sentry_flush(uint64_t timeout); + /** * Shuts down the sentry client and forces transports to flush out. * @@ -1080,6 +1263,10 @@ SENTRY_API sentry_user_consent_t sentry_user_consent_get(void); /** * Sends a sentry event. + * + * If returns a nil UUID if the event being passed in is a transaction, and the + * transaction will not be sent nor consumed. `sentry_transaction_finish` should + * be used to send transactions. */ SENTRY_API sentry_uuid_t sentry_capture_event(sentry_value_t event); @@ -1155,14 +1342,46 @@ SENTRY_API void sentry_remove_fingerprint(void); SENTRY_API void sentry_set_transaction(const char *transaction); /** - * Removes the transaction. + * Sets the event level. */ -SENTRY_API void sentry_remove_transaction(void); +SENTRY_API void sentry_set_level(sentry_level_t level); /** - * Sets the event level. + * Sets the maximum number of spans that can be attached to a + * transaction. */ -SENTRY_API void sentry_set_level(sentry_level_t level); +SENTRY_EXPERIMENTAL_API void sentry_options_set_max_spans( + sentry_options_t *opts, size_t max_spans); + +/** + * Gets the maximum number of spans that can be attached to a + * transaction. + */ +SENTRY_EXPERIMENTAL_API size_t sentry_options_get_max_spans( + sentry_options_t *opts); + +/** + * Sets the sample rate for transactions. Should be a double between + * `0.0` and `1.0`. Transactions will be randomly discarded during + * `sentry_transaction_finish` when the sample rate is < 1.0. + */ +SENTRY_EXPERIMENTAL_API void sentry_options_set_traces_sample_rate( + sentry_options_t *opts, double sample_rate); + +/** + * Returns the sample rate for transactions. + */ +SENTRY_EXPERIMENTAL_API double sentry_options_get_traces_sample_rate( + sentry_options_t *opts); + +/* -- Session APIs -- */ + +typedef enum { + SENTRY_SESSION_STATUS_OK, + SENTRY_SESSION_STATUS_CRASHED, + SENTRY_SESSION_STATUS_ABNORMAL, + SENTRY_SESSION_STATUS_EXITED, +} sentry_session_status_t; /** * Starts a new session. @@ -1174,6 +1393,505 @@ SENTRY_API void sentry_start_session(void); */ SENTRY_API void sentry_end_session(void); +/** + * Ends a session with an explicit `status` code. + */ +SENTRY_EXPERIMENTAL_API void sentry_end_session_with_status( + sentry_session_status_t status); + +/* -- Performance Monitoring/Tracing APIs -- */ + +/** + * A sentry Transaction Context. + * + * See Transaction Interface under + * https://develop.sentry.dev/sdk/performance/#new-span-and-transaction-classes + */ +struct sentry_transaction_context_s; +typedef struct sentry_transaction_context_s sentry_transaction_context_t; + +/** + * A sentry Transaction. + * + * See https://develop.sentry.dev/sdk/event-payloads/transaction/ + */ +struct sentry_transaction_s; +typedef struct sentry_transaction_s sentry_transaction_t; + +/** + * A sentry Span. + * + * See https://develop.sentry.dev/sdk/event-payloads/span/ + */ +struct sentry_span_s; +typedef struct sentry_span_s sentry_span_t; + +/** + * Constructs a new Transaction Context. The returned value needs to be passed + * into `sentry_transaction_start` in order to be recorded and sent to sentry. + * + * See + * https://docs.sentry.io/platforms/native/enriching-events/transaction-name/ + * for an explanation of a Transaction's `name`, and + * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions + * around an `operation`'s value. + * + * Also see https://develop.sentry.dev/sdk/event-payloads/transaction/#anatomy + * for an explanation of `operation`, in addition to other properties and + * actions that can be performed on a Transaction. + * + * The returned value is not thread-safe. Users are expected to ensure that + * appropriate locking mechanisms are implemented over the Transaction Context + * if it needs to be mutated across threads. Methods operating on the + * Transaction Context will mention what kind of expectations they carry if they + * need to mutate or access the object in a thread-safe way. + */ +SENTRY_EXPERIMENTAL_API sentry_transaction_context_t * +sentry_transaction_context_new(const char *name, const char *operation); + +/** + * Sets the `name` on a Transaction Context, which will be used in the + * Transaction constructed off of the context. + * + * The Transaction Context should not be mutated by other functions while + * setting a name on it. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_name( + sentry_transaction_context_t *tx_cxt, const char *name); + +/** + * Sets the `operation` on a Transaction Context, which will be used in the + * Transaction constructed off of the context + * + * See https://develop.sentry.dev/sdk/performance/span-operations/ for + * conventions on `operation`s. + * + * The Transaction Context should not be mutated by other functions while + * setting an operation on it. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_operation( + sentry_transaction_context_t *tx_cxt, const char *operation); + +/** + * Sets the `sampled` field on a Transaction Context, which will be used in the + * Transaction constructed off of the context. + * + * When passed any value above 0, the Transaction will bypass all sampling + * options and always be sent to sentry. If passed 0, this Transaction and its + * child spans will never be sent to sentry. + * + * The Transaction Context should not be mutated by other functions while + * setting `sampled` on it. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_context_set_sampled( + sentry_transaction_context_t *tx_cxt, int sampled); + +/** + * Removes the `sampled` field on a Transaction Context, which will be used in + * the Transaction constructed off of the context. + * + * The Transaction will use the sampling rate as defined in `sentry_options`. + * + * The Transaction Context should not be mutated by other functions while + * removing `sampled`. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_context_remove_sampled( + sentry_transaction_context_t *tx_cxt); + +/** + * Update the Transaction Context with the given HTTP header key/value pair. + * + * This is used to propagate distributed tracing metadata from upstream + * services. Therefore, the headers of incoming requests should be fed into this + * function so that sentry is able to continue a trace that was started by an + * upstream service. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_context_update_from_header( + sentry_transaction_context_t *tx_cxt, const char *key, const char *value); + +/** + * Starts a new Transaction based on the provided context, restored from an + * external integration (i.e. a span from a different SDK) or manually + * constructed by a user. + * + * The second parameter is a custom Sampling Context to be used with a Traces + * Sampler to make a more informed sampling decision. The SDK does not currently + * support a custom Traces Sampler and this parameter is ignored for the time + * being but needs to be provided. + * + * Returns a Transaction, which is expected to be manually managed by the + * caller. Manual management involves ensuring that `sentry_transaction_finish` + * is invoked for the Transaction, and that the caller manually starts and + * finishes any child Spans as needed on the Transaction. + * + * Not invoking `sentry_transaction_finish` with the returned Transaction means + * it will be discarded, and will not be sent to sentry. + * + * To ensure that any Events or Message Events are associated with this + * Transaction while it is active, invoke and pass in the Transaction returned + * by this function to `sentry_set_transaction_object`. Further documentation on + * this can be found in `sentry_set_transaction_object`'s docstring. + * + * Takes ownership of `transaction_context`. A Transaction Context cannot be + * modified or re-used after it is used to start a Transaction. + * + * The returned value is not thread-safe. Users are expected to ensure that + * appropriate locking mechanisms are implemented over the Transaction if it + * needs to be mutated across threads. Methods operating on the Transaction will + * mention what kind of expectations they carry if they need to mutate or access + * the object in a thread-safe way. + */ +SENTRY_EXPERIMENTAL_API sentry_transaction_t *sentry_transaction_start( + sentry_transaction_context_t *tx_cxt, sentry_value_t sampling_ctx); + +/** + * Finishes and sends a Transaction to sentry. The event ID of the Transaction + * will be returned if this was successful; A nil UUID will be returned + * otherwise. + * + * Always takes ownership of `transaction`, regardless of whether the operation + * was successful or not. A Transaction cannot be modified or re-used after it + * is finished. + */ +SENTRY_EXPERIMENTAL_API sentry_uuid_t sentry_transaction_finish( + sentry_transaction_t *tx); + +/** + * Sets the Transaction so any Events sent while the Transaction + * is active will be associated with the Transaction. + * + * If the Transaction being passed in is unsampled, it will still be associated + * with any new Events. This will lead to some Events pointing to orphan or + * missing traces in sentry, see + * https://docs.sentry.io/product/sentry-basics/tracing/trace-view/#orphan-traces-and-broken-subtraces + * + * This increases the number of references pointing to the Transaction. Invoke + * `sentry_transaction_finish` to remove the Transaction set by this function as + * well as its reference by passing in the same Transaction as the one passed + * into this function. + */ +SENTRY_EXPERIMENTAL_API void sentry_set_transaction_object( + sentry_transaction_t *tx); + +/** + * Sets the Span so any Events sent while the Span + * is active will be associated with the Span. + * + * This increases the number of references pointing to the Span. Invoke + * `sentry_span_finish` to remove the Span set by this function as well + * as its reference by passing in the same Span as the one passed into + * this function. + */ +SENTRY_EXPERIMENTAL_API void sentry_set_span(sentry_span_t *span); + +/** + * Starts a new Span. + * + * The return value of `sentry_transaction_start` should be passed in as + * `parent`. + * + * Both `operation` and `description` can be null, but it is recommended to + * supply the former. See + * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions + * around operations. + * + * See https://develop.sentry.dev/sdk/event-payloads/span/ for a description of + * the created Span's properties and expectations for `operation` and + * `description`. + * + * Returns a value that should be passed into `sentry_span_finish`. Not + * finishing the Span means it will be discarded, and will not be sent to + * sentry. `sentry_value_null` will be returned if the child Span could not be + * created. + * + * To ensure that any Events or Message Events are associated with this + * Span while it is active, invoke and pass in the Span returned + * by this function to `sentry_set_span`. Further documentation on this can be + * found in `sentry_set_span`'s docstring. + * + * This increases the number of references pointing to the Transaction. + * + * The returned value is not thread-safe. Users are expected to ensure that + * appropriate locking mechanisms are implemented over the Span if it needs + * to be mutated across threads. Methods operating on the Span will mention what + * kind of expectations they carry if they need to mutate or access the object + * in a thread-safe way. + */ +SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_transaction_start_child( + sentry_transaction_t *parent, char *operation, char *description); + +/** + * Starts a new Span. + * + * The return value of `sentry_span_start_child` may be passed in as `parent`. + * + * Both `operation` and `description` can be null, but it is recommended to + * supply the former. See + * https://develop.sentry.dev/sdk/performance/span-operations/ for conventions + * around operations. + * + * See https://develop.sentry.dev/sdk/event-payloads/span/ for a description of + * the created Span's properties and expectations for `operation` and + * `description`. + * + * Returns a value that should be passed into `sentry_span_finish`. Not + * finishing the Span means it will be discarded, and will not be sent to + * sentry. `sentry_value_null` will be returned if the child Span could not be + * created. + * + * To ensure that any Events or Message Events are associated with this + * Span while it is active, invoke and pass in the Span returned + * by this function to `sentry_set_span`. Further documentation on this can be + * found in `sentry_set_span`'s docstring. + * + * The returned value is not thread-safe. Users are expected to ensure that + * appropriate locking mechanisms are implemented over the Span if it needs + * to be mutated across threads. Methods operating on the Span will mention what + * kind of expectations they carry if they need to mutate or access the object + * in a thread-safe way. + */ +SENTRY_EXPERIMENTAL_API sentry_span_t *sentry_span_start_child( + sentry_span_t *parent, char *operation, char *description); + +/** + * Finishes a Span. + * + * This takes ownership of `span`. A Span cannot be modified or re-used after it + * is finished. + * + * This will mutate the `span`'s containing Transaction, so the containing + * Transaction should also not be mutated by other functions when finishing a + * span. + */ +SENTRY_EXPERIMENTAL_API void sentry_span_finish(sentry_span_t *span); + +/** + * Sets a tag on a Transaction to the given string value. + * + * Tags longer than 200 bytes will be truncated. + * + * The Transaction should not be mutated by other functions while a tag is being + * set on it. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_set_tag( + sentry_transaction_t *transaction, const char *tag, const char *value); + +/** + * Removes a tag from a Transaction. + * + * The Transaction should not be mutated by other functions while a tag is being + * removed from it. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_tag( + sentry_transaction_t *transaction, const char *tag); + +/** + * Sets the given key in a Transaction's "data" section to the given value. + * + * The Transaction should not be mutated by other functions while data is being + * set on it. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_set_data( + sentry_transaction_t *transaction, const char *key, sentry_value_t value); + +/** + * Removes a key from a Transaction's "data" section. + * + * The Transaction should not be mutated by other functions while data is being + * removed from it. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_remove_data( + sentry_transaction_t *transaction, const char *key); + +/** + * Sets a tag on a Span to the given string value. + * + * Tags longer than 200 bytes will be truncated. + * + * The Span should not be mutated by other functions while a tag is being set on + * it. + */ +SENTRY_EXPERIMENTAL_API void sentry_span_set_tag( + sentry_span_t *span, const char *tag, const char *value); + +/** + * Removes a tag from a Span. + * + * The Span should not be mutated by other functions while a tag is being + * removed from it. + */ +SENTRY_EXPERIMENTAL_API void sentry_span_remove_tag( + sentry_span_t *span, const char *tag); + +/** + * Sets the given key in a Span's "data" section to the given value. + * + * The Span should not be mutated by other functions while data is being set on + * it. + */ +SENTRY_EXPERIMENTAL_API void sentry_span_set_data( + sentry_span_t *span, const char *key, sentry_value_t value); + +/** + * Removes a key from a Span's "data" section. + * + * The Span should not be mutated by other functions while data is being removed + * from it. + */ +SENTRY_EXPERIMENTAL_API void sentry_span_remove_data( + sentry_span_t *span, const char *key); + +/** + * Sets a Transaction's name. + * + * The Transaction should not be mutated by other functions while setting its + * name. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_set_name( + sentry_transaction_t *transaction, const char *name); + +/** + * The status of a Span or Transaction. + * + * See https://develop.sentry.dev/sdk/event-payloads/span/ for documentation. + */ +typedef enum { + // The operation completed successfully. + // HTTP status 100..299 + successful redirects from the 3xx range. + SENTRY_SPAN_STATUS_OK, + // The operation was cancelled (typically by the user). + SENTRY_SPAN_STATUS_CANCELLED, + // Unknown. Any non-standard HTTP status code. + // "We do not know whether the transaction failed or succeeded." + SENTRY_SPAN_STATUS_UNKNOWN, + // Client specified an invalid argument. 4xx. + // Note that this differs from FailedPrecondition. InvalidArgument + // indicates arguments that are problematic regardless of the + // state of the system. + SENTRY_SPAN_STATUS_INVALID_ARGUMENT, + // Deadline expired before operation could complete. + // For operations that change the state of the system, this error may be + // returned even if the operation has been completed successfully. + // HTTP redirect loops and 504 Gateway Timeout. + SENTRY_SPAN_STATUS_DEADLINE_EXCEEDED, + // 404 Not Found. Some requested entity (file or directory) was not found. + SENTRY_SPAN_STATUS_NOT_FOUND, + // Already exists (409) + // Some entity that we attempted to create already exists. + SENTRY_SPAN_STATUS_ALREADY_EXISTS, + // 403 Forbidden + // The caller does not have permission to execute the specified operation. + SENTRY_SPAN_STATUS_PERMISSION_DENIED, + // 429 Too Many Requests + // Some resource has been exhausted, perhaps a per-user quota or perhaps + // the entire file system is out of space. + SENTRY_SPAN_STATUS_RESOURCE_EXHAUSTED, + // Operation was rejected because the system is not in a state required for + // the operation's execution. + SENTRY_SPAN_STATUS_FAILED_PRECONDITION, + // The operation was aborted, typically due to a concurrency issue. + SENTRY_SPAN_STATUS_ABORTED, + // Operation was attempted past the valid range. + SENTRY_SPAN_STATUS_OUT_OF_RANGE, + // 501 Not Implemented + // Operation is not implemented or not enabled. + SENTRY_SPAN_STATUS_UNIMPLEMENTED, + // Other/generic 5xx + SENTRY_SPAN_STATUS_INTERNAL_ERROR, + // 503 Service Unavailable + SENTRY_SPAN_STATUS_UNAVAILABLE, + // Unrecoverable data loss or corruption + SENTRY_SPAN_STATUS_DATA_LOSS, + // 401 Unauthorized (actually does mean unauthenticated according to RFC + // 7235) + // Prefer PermissionDenied if a user is logged in. + SENTRY_SPAN_STATUS_UNAUTHENTICATED, +} sentry_span_status_t; + +/** + * Sets a Span's status. + * + * The Span should not be mutated by other functions while setting its status. + */ +SENTRY_EXPERIMENTAL_API void sentry_span_set_status( + sentry_span_t *span, sentry_span_status_t status); + +/** + * Sets a Transaction's status. + * + * The Transaction should not be mutated by other functions while setting its + * status. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_set_status( + sentry_transaction_t *tx, sentry_span_status_t status); + +/** + * Type of the `iter_headers` callback. + * + * The callback is being called with HTTP header key/value pairs. + * These headers can be attached to outgoing HTTP requests to propagate + * distributed tracing metadata to downstream services. + * + */ +typedef void (*sentry_iter_headers_function_t)( + const char *key, const char *value, void *userdata); + +/** + * Iterates the distributed tracing HTTP headers for the given span. + */ +SENTRY_EXPERIMENTAL_API void sentry_span_iter_headers(sentry_span_t *span, + sentry_iter_headers_function_t callback, void *userdata); + +/** + * Iterates the distributed tracing HTTP headers for the given transaction. + */ +SENTRY_EXPERIMENTAL_API void sentry_transaction_iter_headers( + sentry_transaction_t *tx, sentry_iter_headers_function_t callback, + void *userdata); + +/** + * Returns whether the application has crashed on the last run. + * + * Notes: + * * The underlying value is set by sentry_init() - it must be called first. + * * Call sentry_clear_crashed_last_run() to reset for the next app run. + * + * Possible return values: + * 1 = the last run was a crash + * 0 = no crash recognized + * -1 = sentry_init() hasn't been called yet + */ +SENTRY_EXPERIMENTAL_API int sentry_get_crashed_last_run(void); + +/** + * Clear the status of the "crashed-last-run". You should explicitly call + * this after sentry_init() if you're using sentry_get_crashed_last_run(). + * Otherwise, the same information is reported on any subsequent runs. + * + * Notes: + * * This doesn't change the value of sentry_get_crashed_last_run() yet. + * However, if sentry_init() is called again, the value will change. + * * This may only be called after sentry_init() and before sentry_close(). + * + * Returns 0 on success, 1 on error. + */ +SENTRY_EXPERIMENTAL_API int sentry_clear_crashed_last_run(void); + +/** + * Sentry SDK version. + */ +SENTRY_EXPERIMENTAL_API const char *sentry_sdk_version(void); + +/** + * Sentry SDK name. + */ +SENTRY_EXPERIMENTAL_API const char *sentry_sdk_name(void); + +/** + * Sentry SDK User-Agent. + */ +SENTRY_EXPERIMENTAL_API const char *sentry_sdk_user_agent(void); + #ifdef __cplusplus } #endif diff --git a/common/windows/delphi/ext/sentry/sentry.lib b/common/windows/delphi/ext/sentry/sentry.lib index f9c6b6671d38fcca76ed1d1a816452a5a11f2fd3..9858e8c0396ac850c46a7548266f17cf01c02c41 100644 Binary files a/common/windows/delphi/ext/sentry/sentry.lib and b/common/windows/delphi/ext/sentry/sentry.lib differ diff --git a/common/windows/delphi/ext/sentry/sentry.pas b/common/windows/delphi/ext/sentry/sentry.pas index 24e85c9b9abcd2617640b084646837f073e55a5c..af47eb383fb897b9300d3069631a06aa47a40752 100644 --- a/common/windows/delphi/ext/sentry/sentry.pas +++ b/common/windows/delphi/ext/sentry/sentry.pas @@ -1,35 +1,35 @@ -{$D-} // Don't include debug information -// Delphi translation of sentry.h -// Sentry Native API 0.4.9 -// https://github.com/getsentry/sentry-native -unit sentry; - -{ - * NOTE on encodings: - * - * Sentry will assume an encoding of UTF-8 for all string data that is captured - * and being sent to sentry as an Event. - * All the functions that are dealing with *paths* will assume an OS-specific - * encoding, typically ANSI on Windows, UTF-8 macOS, and the locale encoding on - * Linux; and they provide wchar-compatible alternatives on Windows which are - * preferred. -} - -interface - -{$DEFINE SENTRY_API} - -//{$ALIGN ON} -{$MINENUMSIZE 4} - -{$WARN SYMBOL_PLATFORM OFF} - -{$IF DEFINED(MSWINDOWS)} - -uses - Winapi.Windows; - -{$DEFINE SENTRY_UUID_WINDOWS} +{$D-} // Don't include debug information +// Delphi translation of sentry.h +// Sentry Native API 0.6.0 - ***excluding performance APIs*** +// https://github.com/getsentry/sentry-native +unit sentry; + +{ + * NOTE on encodings: + * + * Sentry will assume an encoding of UTF-8 for all string data that is captured + * and being sent to sentry as an Event. + * All the functions that are dealing with *paths* will assume an OS-specific + * encoding, typically ANSI on Windows, UTF-8 macOS, and the locale encoding on + * Linux; and they provide wchar-compatible alternatives on Windows which are + * preferred. +} + +interface + +{$DEFINE SENTRY_API} + +//{$ALIGN ON} +{$MINENUMSIZE 4} + +{$WARN SYMBOL_PLATFORM OFF} + +{$IF DEFINED(MSWINDOWS)} + +uses + Winapi.Windows; + +{$DEFINE SENTRY_UUID_WINDOWS} {$ELSEIF DEFINED(ANDROID)} @@ -45,15 +45,15 @@ uses {$ENDIF} const -{$IFDEF WIN64} +{$IFDEF WIN64} sentry_dll = 'sentry.x64.dll'; {$ELSE} sentry_dll = 'sentry.dll'; {$ENDIF} - + const SENTRY_SDK_NAME = 'sentry.native'; - SENTRY_SDK_VERSION = '0.4.9'; + SENTRY_SDK_VERSION = '0.6.0'; SENTRY_SDK_USER_AGENT = SENTRY_SDK_NAME + '/' + SENTRY_SDK_VERSION; {$IF DEFINED(MSWINDOWS)} @@ -62,32 +62,32 @@ const {$MESSAGE ERROR 'Unsupported platform'} {$ENDIF} -type - size_t = NativeUInt; - -// The library internally uses the system malloc and free functions to manage -// memory. It does not use realloc. The reason for this is that on unix -// platforms we fall back to a simplistic page allocator once we have -// encountered a SIGSEGV or other terminating signal as malloc is no longer -// safe to use. Since we cannot portably reallocate allocations made on the -// pre-existing allocator we're instead not using realloc. -// -// Note also that after SIGSEGV sentry_free() becomes a noop. - -// -// allocates memory with the underlying allocator -// -function sentry_malloc(size: size_t): Pointer; cdecl; external sentry_dll delayed; - -// -// releases memory allocated from the underlying allocator -procedure sentry_free(ptr: Pointer); cdecl; external sentry_dll delayed; - +type + size_t = NativeUInt; + +// The library internally uses the system malloc and free functions to manage +// memory. It does not use realloc. The reason for this is that on unix +// platforms we fall back to a simplistic page allocator once we have +// encountered a SIGSEGV or other terminating signal as malloc is no longer +// safe to use. Since we cannot portably reallocate allocations made on the +// pre-existing allocator we're instead not using realloc. +// +// Note also that after SIGSEGV sentry_free() becomes a noop. + +// +// allocates memory with the underlying allocator +// +function sentry_malloc(size: size_t): Pointer; cdecl; external sentry_dll delayed; + +// +// releases memory allocated from the underlying allocator +procedure sentry_free(ptr: Pointer); cdecl; external sentry_dll delayed; + // legacy function. Alias for `sentry_free`. procedure sentry_string_free(str: PAnsiChar); cdecl; - + // -- Protocol Value API -- - + // // Type of a sentry value. // @@ -102,7 +102,7 @@ type SENTRY_VALUE_TYPE_LIST, SENTRY_VALUE_TYPE_OBJECT ); - + // // Represents a sentry protocol value. // @@ -119,20 +119,20 @@ type // automatically happens for some shared values in the event payload like // the module list. // - -type - {sentry_value_u = record - case Integer of - 0: (_bits: UInt64); - 1: (_double: Double); - end; - + +type + {sentry_value_u = record + case Integer of + 0: (_bits: UInt64); + 1: (_double: Double); + end; + sentry_value_t = sentry_value_u;} sentry_value_t = UInt64; - + +// +// Increments the reference count on the value.\ // -// Increments the reference count on the value.\ -// procedure sentry_value_incref( value: sentry_value_t ); cdecl; external sentry_dll delayed; @@ -214,7 +214,7 @@ function sentry_value_new_object: sentry_value_t; cdecl; external sentry_dll de function sentry_value_get_type( value: sentry_value_t ): sentry_value_type_t; cdecl; external sentry_dll delayed; - + // // Sets a key to a value in the map. // @@ -234,8 +234,8 @@ function sentry_value_remove_by_key( value: sentry_value_t; const k: PAnsiChar ): Integer; cdecl; external sentry_dll delayed; - -// + +// // Appends a value to a list. // // This moves the ownership of the value into the list. The caller does not @@ -278,9 +278,12 @@ function sentry_value_get_by_key( const k: PAnsiChar ): sentry_value_t; cdecl; external sentry_dll delayed; - // - // Looks up a value in a map by key. If missing a null value is returned. - // The returned value is owned. + +// + +// Looks up a value in a map by key. If missing a null value is returned. + +// The returned value is owned. // // If the caller no longer needs the value it must be released with // `sentry_value_decref`. @@ -376,20 +379,20 @@ type sentry_level_e = ( sentry_level_t = sentry_level_e; // -// Creates a new empty Event value. -// -// See https://docs.sentry.io/platforms/native/enriching-events/ for how to -// further work with events, and https://develop.sentry.dev/sdk/event-payloads/ -// for a detailed overview of the possible properties of an Event. -// +// Creates a new empty Event value. +// +// See https://docs.sentry.io/platforms/native/enriching-events/ for how to +// further work with events, and https://develop.sentry.dev/sdk/event-payloads/ +// for a detailed overview of the possible properties of an Event. +// function sentry_value_new_event: sentry_value_t; cdecl; external sentry_dll delayed; // // Creates a new Message Event value. -// -// See https://develop.sentry.dev/sdk/event-payloads/message/ -// -// `logger` can be NULL to omit the logger value. +// +// See https://develop.sentry.dev/sdk/event-payloads/message/ +// +// `logger` can be NULL to omit the logger value. // function sentry_value_new_message_event( level: sentry_level_t; @@ -399,8 +402,8 @@ function sentry_value_new_message_event( // // Creates a new Breadcrumb with a specific type and message. -// -// See https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/ +// +// See https://develop.sentry.dev/sdk/event-payloads/breadcrumbs/ // function sentry_value_new_breadcrumb( const _type: PAnsiChar; @@ -408,73 +411,87 @@ function sentry_value_new_breadcrumb( ): sentry_value_t; cdecl; external sentry_dll delayed; // -// Creates a new Exception value. -// -// This is intended for capturing language-level exception, such as from a -// try-catch block. `type` and `value` here refer to the exception class and -// a possible description. -// -// See https://develop.sentry.dev/sdk/event-payloads/exception/ -// -// The returned value needs to be attached to an event via -// `sentry_event_add_exception`. -// -function {SENTRY_EXPERIMENTAL_API} sentry_value_new_exception( - const _type: PAnsiChar; - const value: PAnsiChar -): sentry_value_t; cdecl; external sentry_dll delayed; - -// -// Creates a new Thread value. -// -// See https://develop.sentry.dev/sdk/event-payloads/threads/ -// -// The returned value needs to be attached to an event via -// `sentry_event_add_thread`. -// -// `name` can be NULL. -// -function {SENTRY_EXPERIMENTAL_API} sentry_value_new_thread( - id: UInt64; - const name: PAnsiChar -): sentry_value_t; cdecl; external sentry_dll delayed; - -// -// Creates a new Stack Trace conforming to the Stack Trace Interface. -// -// See https://develop.sentry.dev/sdk/event-payloads/stacktrace/ -// -// The returned object needs to be attached to either an exception -// event, or a thread object. -// -// If `ips` is NULL the current stack trace is captured, otherwise `len` -// stack trace instruction pointers are attached to the event. -// -function {SENTRY_EXPERIMENTAL_API} sentry_value_new_stacktrace( - ips: PPVoid; - len: NativeUInt -): sentry_value_t; cdecl; external sentry_dll delayed; - -// -// Adds an Exception to an Event value. -// -// This takes ownership of the `exception`. -// -procedure {SENTRY_EXPERIMENTAL_API} sentry_event_add_exception( - event: sentry_value_t; - exception: sentry_value_t -); cdecl; external sentry_dll delayed; - -// -// Adds a Thread to an Event value. -// -// This takes ownership of the `thread`. -// -procedure {SENTRY_EXPERIMENTAL_API} sentry_event_add_thread( - event: sentry_value_t; - thread: sentry_value_t -); cdecl; external sentry_dll delayed; - +// Creates a new Exception value. +// +// This is intended for capturing language-level exception, such as from a +// try-catch block. `type` and `value` here refer to the exception class and +// a possible description. +// +// See https://develop.sentry.dev/sdk/event-payloads/exception/ +// +// The returned value needs to be attached to an event via +// `sentry_event_add_exception`. +// +function {SENTRY_EXPERIMENTAL_API} sentry_value_new_exception( + const _type: PAnsiChar; + const value: PAnsiChar +): sentry_value_t; cdecl; external sentry_dll delayed; + +// +// Creates a new Thread value. +// +// See https://develop.sentry.dev/sdk/event-payloads/threads/ +// +// The returned value needs to be attached to an event via +// `sentry_event_add_thread`. +// +// `name` can be NULL. +// +function {SENTRY_EXPERIMENTAL_API} sentry_value_new_thread( + id: UInt64; + const name: PAnsiChar +): sentry_value_t; cdecl; external sentry_dll delayed; + +// +// Creates a new Stack Trace conforming to the Stack Trace Interface. +// +// See https://develop.sentry.dev/sdk/event-payloads/stacktrace/ +// +// The returned object needs to be attached to either an exception +// event, or a thread object. +// +// If `ips` is NULL the current stack trace is captured, otherwise `len` +// stack trace instruction pointers are attached to the event. +// +function {SENTRY_EXPERIMENTAL_API} sentry_value_new_stacktrace( + ips: PPVoid; + len: NativeUInt +): sentry_value_t; cdecl; external sentry_dll delayed; + +// +// Sets the Stack Trace conforming to the Stack Trace Interface in a value. +// +// The value argument must be either an exception or thread object. +// +// If `ips` is NULL the current stack trace is captured, otherwise `len` stack +// trace instruction pointers are attached to the event. +// +procedure {SENTRY_EXPERIMENTAL_API} sentry_value_set_stacktrace( + value: sentry_value_t; + ips: PPVoid; + len: NativeUInt +); cdecl; external sentry_dll delayed; + +// +// Adds an Exception to an Event value. +// +// This takes ownership of the `exception`. +// +procedure {SENTRY_EXPERIMENTAL_API} sentry_event_add_exception( + event: sentry_value_t; + exception: sentry_value_t +); cdecl; external sentry_dll delayed; + +// +// Adds a Thread to an Event value. +// +// This takes ownership of the `thread`. +// +procedure {SENTRY_EXPERIMENTAL_API} sentry_event_add_thread( + event: sentry_value_t; + thread: sentry_value_t +); cdecl; external sentry_dll delayed; + // -- Experimental APIs -- // @@ -493,33 +510,35 @@ function sentry_value_to_msgpack( // Adds a stack trace to an event. // // The stack trace is added as part of a new thread object. -// This function is **deprecated** in favor of using -// `sentry_value_new_stacktrace` in combination with `sentry_value_new_thread` -// and `sentry_event_add_thread`. -// -// If `ips` is NULL the current stack trace is captured, otherwise `len` -// stack trace instruction pointers are attached to the event. +// This function is **deprecated** in favor of using +// `sentry_value_new_stacktrace` in combination with `sentry_value_new_thread` +// and `sentry_event_add_thread`. +// +// If `ips` is NULL the current stack trace is captured, otherwise `len` +// stack trace instruction pointers are attached to the event. // procedure sentry_event_value_add_stacktrace( event: sentry_value_t; ips: Pointer; len: Integer - ); cdecl; external sentry_dll delayed; - - // -// This represents the OS dependent user context in the case of a crash, and can -// be used to manually capture a crash. +); cdecl; external sentry_dll delayed; + + + +// +// This represents the OS dependent user context in the case of a crash, and can +// be used to manually capture a crash. // type sentry_ucontext_s = record -{$IF DEFINED(MSWINDOWS)} - exception_ptrs: EXCEPTION_POINTERS; -{$ELSE} - signum: Integer; - siginfo: siginfo_t; +{$IF DEFINED(MSWINDOWS)} + exception_ptrs: EXCEPTION_POINTERS; +{$ELSE} + signum: Integer; + siginfo: siginfo_t; user_context: ucontext_t; -{$ENDIF} +{$ENDIF} end; sentry_ucontext_t = sentry_ucontext_s; @@ -551,9 +570,10 @@ function sentry_unwind_stack_from_ucontext( max_len: size_t ): size_t; cdecl; external sentry_dll delayed; - - - // + + + +// // A UUID // type @@ -613,12 +633,12 @@ procedure sentry_uuid_as_string( type // -// A Sentry Envelope. -// -// The Envelope is an abstract type which represents a payload being sent to -// sentry. It can contain one or more items, typically an Event. -// See https://develop.sentry.dev/sdk/envelopes/ -// +// A Sentry Envelope. +// +// The Envelope is an abstract type which represents a payload being sent to +// sentry. It can contain one or more items, typically an Event. +// See https://develop.sentry.dev/sdk/envelopes/ +// sentry_envelope_s = record end; sentry_envelope_t = sentry_envelope_s; psentry_envelope_t = Pointer; @@ -626,9 +646,9 @@ type // // Frees an envelope. // -procedure sentry_envelope_free( - envelope: sentry_envelope_t -); cdecl; external sentry_dll delayed; +procedure sentry_envelope_free( + envelope: sentry_envelope_t +); cdecl; external sentry_dll delayed; // // Given an envelope returns the embedded event if there is one. @@ -639,6 +659,15 @@ function sentry_envelope_get_event( const envelope: psentry_envelope_t ): sentry_value_t; cdecl; external sentry_dll delayed; +// +// Given an Envelope, returns the embedded Transaction if there is one. +// +// This returns a borrowed value to the Transaction in the Envelope. +// +function {SENTRY_EXPERIMENTAL_API} sentry_envelope_get_transaction( + const envelope: psentry_envelope_t +): sentry_value_t; cdecl; external sentry_dll delayed; + // // Serializes the envelope // @@ -651,10 +680,10 @@ function sentry_envelope_serialize( // // Serializes the envelope into a file. -// -// `path` is assumed to be in platform-specific filesystem path encoding. -// -// Returns 0 on success. +// +// `path` is assumed to be in platform-specific filesystem path encoding. +// +// Returns 0 on success. // function sentry_envelope_write_to_file( const envelope: psentry_envelope_t; @@ -663,8 +692,8 @@ function sentry_envelope_write_to_file( // // The Sentry Client Options. -// -// See https://docs.sentry.io/error-reporting/configuration/ +// +// See https://docs.sentry.io/error-reporting/configuration/ // type sentry_options_s = record end; @@ -672,130 +701,161 @@ type psentry_options_t = ^sentry_options_t; // -// This represents an interface for user-defined transports. -// -// Transports are responsible for sending envelopes to sentry and are the last -// step in the event pipeline. -// -// Envelopes will be submitted to the transport in a _fire and forget_ fashion, -// and the transport must send those envelopes _in order_. -// -// A transport has the following hooks, all of which -// take the user provided `state` as last parameter. The transport state needs -// to be set with `sentry_transport_set_state` and typically holds handles and -// other information that can be reused across requests. -// -// * `send_func`: This function will take ownership of an envelope, and is -// responsible for freeing it via `sentry_envelope_free`. -// * `startup_func`: This hook will be called by sentry inside of `sentry_init` -// and instructs the transport to initialize itself. Failures will bubble up -// to `sentry_init`. -// * `shutdown_func`: Instructs the transport to flush its queue and shut down. -// This hook receives a millisecond-resolution `timeout` parameter and should -// return `true` when the transport was flushed and shut down successfully. -// In case of `false`, sentry will log an error, but continue with freeing the -// transport. -// * `free_func`: Frees the transports `state`. This hook might be called even -// though `shutdown_func` returned `false` previously. -// -// The transport interface might be extended in the future with hooks to flush -// its internal queue without shutting down, and to dump its internal queue to -// disk in case of a hard crash. -// +// This represents an interface for user-defined transports. +// +// Transports are responsible for sending envelopes to sentry and are the last +// step in the event pipeline. +// +// Envelopes will be submitted to the transport in a _fire and forget_ fashion, +// and the transport must send those envelopes _in order_. +// +// A transport has the following hooks, all of which +// take the user provided `state` as last parameter. The transport state needs +// to be set with `sentry_transport_set_state` and typically holds handles and +// other information that can be reused across requests. +// +// * `send_func`: This function will take ownership of an envelope, and is +// responsible for freeing it via `sentry_envelope_free`. +// * `startup_func`: This hook will be called by sentry inside of `sentry_init` +// and instructs the transport to initialize itself. Failures will bubble up +// to `sentry_init`. +// * `shutdown_func`: Instructs the transport to flush its queue and shut down. +// This hook receives a millisecond-resolution `timeout` parameter and should +// return `true` when the transport was flushed and shut down successfully. +// In case of `false`, sentry will log an error, but continue with freeing the +// transport. +// * `free_func`: Frees the transports `state`. This hook might be called even +// though `shutdown_func` returned `false` previously. +// +// The transport interface might be extended in the future with hooks to flush +// its internal queue without shutting down, and to dump its internal queue to +// disk in case of a hard crash. +// type sentry_transport_s = record end; psentry_transport_s = ^sentry_transport_s; sentry_transport_t = sentry_transport_s; - psentry_transport_t = ^sentry_transport_t; - - _sentry_transport_new_func = procedure(e: psentry_envelope_t; state: Pointer); cdecl; - _sentry_transport_free_func = procedure(state: Pointer); cdecl; - _sentry_transport_startup_func = function(const options: psentry_options_t; state: Pointer): Integer; cdecl; - _sentry_transport_shutdown_func = function(timeout: UInt64; state: Pointer): Integer; cdecl; - -// -// Creates a new transport with an initial `send_func`. -// -function sentry_transport_new( - send_func: _sentry_transport_new_func -): psentry_transport_t; cdecl; external sentry_dll delayed; - -// -// Sets the transport `state`. -// -// If the state is owned by the transport and needs to be freed, use -// `sentry_transport_set_free_func` to set an appropriate hook. -// -procedure sentry_transport_set_state( - transport: psentry_transport_t; - state: Pointer -); cdecl; external sentry_dll delayed; - -// -// Sets the transport hook to free the transport `state`. -// -procedure sentry_transport_set_free_func( - transport: psentry_transport_t; - free_func: _sentry_transport_free_func -); cdecl; external sentry_dll delayed; - -// -// Sets the transport startup hook. -// -// This hook is called from within `sentry_init` and will get a reference to the -// options which can be used to initialize a transports internal state. -// It should return `0` on success. A failure will bubble up to `sentry_init`. -// -procedure sentry_transport_set_startup_func( - transport: psentry_transport_t; - startup_func: _sentry_transport_startup_func -); cdecl; external sentry_dll delayed; - -// -// Sets the transport shutdown hook. -// -// This hook will receive a millisecond-resolution timeout. -// It should return `0` on success in case all the pending envelopes have been -// sent within the timeout, or `1` if the timeout was hit. -// -procedure sentry_transport_set_shutdown_func( - transport: psentry_transport_t; - shutdown_func: _sentry_transport_shutdown_func -); cdecl; external sentry_dll delayed; - -// -// Generic way to free a transport. -// -procedure sentry_transport_free( - transport: psentry_transport_t -); cdecl; external sentry_dll delayed; - -// -// Create a new function transport. -// -// It is a convenience function which works with a borrowed `data`, and will -// automatically free the envelope, so the user provided function does not need -// to do that. -// -// This function is *deprecated* and will be removed in a future version. -// It is here for backwards compatibility. Users should migrate to the -// `sentry_transport_new` API. -// -function sentry_new_function_transport( - func: _sentry_transport_new_func; - data: Pointer -): psentry_transport_t; cdecl; external sentry_dll delayed; - + psentry_transport_t = ^sentry_transport_t; + + _sentry_transport_new_func = procedure(e: psentry_envelope_t; state: Pointer); cdecl; + _sentry_transport_free_func = procedure(state: Pointer); cdecl; + _sentry_transport_startup_func = function(const options: psentry_options_t; state: Pointer): Integer; cdecl; + _sentry_transport_shutdown_func = function(timeout: UInt64; state: Pointer): Integer; cdecl; + _sentry_transport_flush_func = function(timeout: UInt64; state: Pointer): Integer; cdecl; + +// +// Creates a new transport with an initial `send_func`. +// +function sentry_transport_new( + send_func: _sentry_transport_new_func +): psentry_transport_t; cdecl; external sentry_dll delayed; + +// +// Sets the transport `state`. +// +// If the state is owned by the transport and needs to be freed, use +// `sentry_transport_set_free_func` to set an appropriate hook. +// +procedure sentry_transport_set_state( + transport: psentry_transport_t; + state: Pointer +); cdecl; external sentry_dll delayed; + +// +// Sets the transport hook to free the transport `state`. +// +procedure sentry_transport_set_free_func( + transport: psentry_transport_t; + free_func: _sentry_transport_free_func +); cdecl; external sentry_dll delayed; + +// +// Sets the transport startup hook. +// +// This hook is called from within `sentry_init` and will get a reference to the +// options which can be used to initialize a transports internal state. +// It should return `0` on success. A failure will bubble up to `sentry_init`. +// +procedure sentry_transport_set_startup_func( + transport: psentry_transport_t; + startup_func: _sentry_transport_startup_func +); cdecl; external sentry_dll delayed; + +// +// Sets the transport flush hook. +// +// This hook will receive a millisecond-resolution timeout. +// It should return `0` if all the pending envelopes are +// sent within the timeout, or `1` if the timeout is hit. +// +procedure {SENTRY_API} sentry_transport_set_flush_func( + transport: psentry_transport_t; + flush_func: _sentry_transport_flush_func +); cdecl; external sentry_dll delayed; + + + +// +// Sets the transport shutdown hook. +// +// This hook will receive a millisecond-resolution timeout. +// It should return `0` on success in case all the pending envelopes have been +// sent within the timeout, or `1` if the timeout was hit. +// +procedure sentry_transport_set_shutdown_func( + transport: psentry_transport_t; + shutdown_func: _sentry_transport_shutdown_func +); cdecl; external sentry_dll delayed; + +// +// Generic way to free a transport. +// +procedure sentry_transport_free( + transport: psentry_transport_t +); cdecl; external sentry_dll delayed; + +// +// Create a new function transport. +// +// It is a convenience function which works with a borrowed `data`, and will +// automatically free the envelope, so the user provided function does not need +// to do that. +// +// This function is *deprecated* and will be removed in a future version. +// It is here for backwards compatibility. Users should migrate to the +// `sentry_transport_new` API. +// +function sentry_new_function_transport( + func: _sentry_transport_new_func; + data: Pointer +): psentry_transport_t; cdecl; external sentry_dll delayed; + +// +// This represents an interface for user-defined backends. +// +// Backends are responsible to handle crashes. They are maintained at runtime +// via various life-cycle hooks from the sentry-core. +// +// At this point none of those interfaces are exposed in the API including +// creation and destruction. The main use-case of the backend in the API at this +// point is to disable it via `sentry_options_set_backend` at runtime before it +// is initialized. +// +type + sentry_backend_s = record end; + sentry_backend_t = sentry_backend_s; + psentry_backend_t = Pointer; + // -- Options APIs -- // -// The state of user consent. -// -type sentry_user_consent_t = ( - SENTRY_USER_CONSENT_UNKNOWN = -1, - SENTRY_USER_CONSENT_GIVEN = 1, - SENTRY_USER_CONSENT_REVOKED = 0 -); +// The state of user consent. +// +type sentry_user_consent_t = ( + SENTRY_USER_CONSENT_UNKNOWN = -1, + SENTRY_USER_CONSENT_GIVEN = 1, + SENTRY_USER_CONSENT_REVOKED = 0 +); // // Creates a new options struct. @@ -819,20 +879,20 @@ procedure sentry_options_set_transport( ); cdecl; external sentry_dll delayed; // -// Type of the `before_send` callback. -// -// The callback takes ownership of the `event`, and should usually return that -// same event. In case the event should be discarded, the callback needs to -// call `sentry_value_decref` on the provided event, and return a -// `sentry_value_new_null()` instead. -// -// This function may be invoked inside of a signal handler and must be safe for -// that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. -// On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see -// the documentation on SEH (structured exception handling) for more information -// https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling -// -type +// Type of the `before_send` callback. +// +// The callback takes ownership of the `event`, and should usually return that +// same event. In case the event should be discarded, the callback needs to +// call `sentry_value_decref` on the provided event, and return a +// `sentry_value_new_null()` instead. +// +// This function may be invoked inside of a signal handler and must be safe for +// that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. +// On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see +// the documentation on SEH (structured exception handling) for more information +// https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling +// +type sentry_event_function_t = function( event: sentry_value_t; hint: Pointer; @@ -841,15 +901,80 @@ type // // Sets the `before_send` callback. -// -// See the `sentry_event_function_t` typedef above for more information. -// +// +// See the `sentry_event_function_t` typedef above for more information. +// procedure sentry_options_set_before_send( opts: psentry_options_t; func: sentry_event_function_t; data: Pointer ); cdecl; external sentry_dll delayed; +// +// Type of the `on_crash` callback. +// +// The `on_crash` callback replaces the `before_send` callback for crash events. +// The interface is analogous to `before_send` in that the callback takes +// ownership of the `event`, and should usually return that same event. In case +// the event should be discarded, the callback needs to call +// `sentry_value_decref` on the provided event, and return a +// `sentry_value_new_null()` instead. +// +// Only the `inproc` backend currently fills the passed-in event with useful +// data and processes any modifications to the return value. Since both +// `breakpad` and `crashpad` use minidumps to capture the crash state, the +// passed-in event is empty when using these backends, and they ignore any +// changes to the return value. +// +// If you set this callback in the options, it prevents a concurrently enabled +// `before_send` callback from being invoked in the crash case. This allows for +// better differentiation between crashes and other events and gradual migration +// from existing `before_send` implementations: +// +// - if you have a `before_send` implementation and do not define an `on_crash` +// callback your application will receive both normal and crash events as +// before +// - if you have a `before_send` implementation but only want to handle normal +// events with it, then you can define an `on_crash` callback that returns +// the passed-in event and does nothing else +// - if you are not interested in normal events, but only want to act on +// crashes (within the limits mentioned below), then only define an +// `on_crash` callback with the option to filter (on all backends) or enrich +// (only inproc) the crash event +// +// This function may be invoked inside of a signal handler and must be safe for +// that purpose, see https://man7.org/linux/man-pages/man7/signal-safety.7.html. +// On Windows, it may be called from inside of a `UnhandledExceptionFilter`, see +// the documentation on SEH (structured exception handling) for more information +// https://docs.microsoft.com/en-us/windows/win32/debug/structured-exception-handling +// +// Platform-specific behavior: +// +// - does not work with crashpad on macOS. +// - for breakpad on Linux the `uctx` parameter is always NULL. +// - on Windows the crashpad backend can capture fast-fail crashes which +// by-pass SEH. Since `on_crash` is called by a local exception-handler, it will +// not be invoked when such a crash happened, even though a minidump will be +// sent. +// +type + sentry_crash_function_t = function( + const uctx: psentry_ucontext_t; + event: sentry_value_t; + closure: Pointer + ): sentry_value_t; cdecl; + +// +// Sets the `on_crash` callback. +// +// See the `sentry_crash_function_t` typedef above for more information. +// +procedure {SENTRY_API} sentry_options_set_on_crash( + opts: psentry_options_t; + func: sentry_crash_function_t; + data: Pointer +); cdecl; external sentry_dll delayed; + // // Sets the DSN. // @@ -866,21 +991,21 @@ function sentry_options_get_dsn( ): PAnsiChar; cdecl; external sentry_dll delayed; // -// Sets the sample rate, which should be a double between `0.0` and `1.0`. -// Sentry will randomly discard any event that is captured using -// `sentry_capture_event` when a sample rate < 1 is set. -// -procedure sentry_options_set_sample_rate( - opts: psentry_options_t; - sample_rate: double -); cdecl; external sentry_dll delayed; - -// -// Gets the sample rate. -// -function sentry_options_get_sample_rate( - const opts: psentry_options_t -): double; cdecl; external sentry_dll delayed; +// Sets the sample rate, which should be a double between `0.0` and `1.0`. +// Sentry will randomly discard any event that is captured using +// `sentry_capture_event` when a sample rate < 1 is set. +// +procedure sentry_options_set_sample_rate( + opts: psentry_options_t; + sample_rate: double +); cdecl; external sentry_dll delayed; + +// +// Gets the sample rate. +// +function sentry_options_get_sample_rate( + const opts: psentry_options_t +): double; cdecl; external sentry_dll delayed; // // Sets the release. @@ -961,20 +1086,20 @@ function sentry_options_get_ca_certs( ): PAnsiChar; cdecl; external sentry_dll delayed; // -// Configures the name of the http transport thread. -// -procedure sentry_options_set_transport_thread_name( - opts: psentry_options_t; - const name: PAnsiChar -); cdecl; external sentry_dll delayed; - -// -// Returns the configured http transport thread name. -// -function sentry_options_get_transport_thread_name( - const opts: psentry_options_t -): PAnsiChar; cdecl; external sentry_dll delayed; - +// Configures the name of the http transport thread. +// +procedure sentry_options_set_transport_thread_name( + opts: psentry_options_t; + const name: PAnsiChar +); cdecl; external sentry_dll delayed; + +// +// Returns the configured http transport thread name. +// +function sentry_options_get_transport_thread_name( + const opts: psentry_options_t +): PAnsiChar; cdecl; external sentry_dll delayed; + // // Enables or disables debug printing mode. // @@ -991,111 +1116,111 @@ function sentry_options_get_debug( ): Integer; cdecl; external sentry_dll delayed; // -// Sets the number of breadcrumbs being tracked and attached to events. -// -// Defaults to 100. -// -procedure sentry_options_set_max_breadcrumbs( - opts: psentry_options_t; - max_breadcrumbs: NativeUInt -); cdecl; external sentry_dll delayed; - -// -// Gets the number of breadcrumbs being tracked and attached to events. -// -function sentry_options_get_max_breadcrumbs( - const opts: psentry_options_t -): NativeUInt; cdecl; external sentry_dll delayed; - -// -// Type of the callback for logger function. -// -type - sentry_logger_function_t = procedure( - level: sentry_level_t; - const message: PAnsiChar; - args: va_list; - userdata: Pointer - ); cdecl; - -// -// Sets the sentry-native logger function. -// -// Used for logging debug events when the `debug` option is set to true. -// -procedure sentry_options_set_logger( - opts: psentry_options_t; - func: sentry_logger_function_t; - userdata: Pointer -); cdecl; external sentry_dll delayed; - -// -// Enables or disables automatic session tracking. -// -// Automatic session tracking is enabled by default and is equivalent to calling -// `sentry_start_session` after startup. -// There can only be one running session, and the current session will always be -// closed implicitly by `sentry_close`, when starting a new session with -// `sentry_start_session`, or manually by calling `sentry_end_session`. -// -procedure sentry_options_set_auto_session_tracking( - opts: psentry_options_t; - val: Integer -); cdecl; external sentry_dll delayed; - -// -// Returns true if automatic session tracking is enabled. -// -function sentry_options_get_auto_session_tracking( - const opts: psentry_options_t +// Sets the number of breadcrumbs being tracked and attached to events. +// +// Defaults to 100. +// +procedure sentry_options_set_max_breadcrumbs( + opts: psentry_options_t; + max_breadcrumbs: NativeUInt +); cdecl; external sentry_dll delayed; + +// +// Gets the number of breadcrumbs being tracked and attached to events. +// +function sentry_options_get_max_breadcrumbs( + const opts: psentry_options_t +): NativeUInt; cdecl; external sentry_dll delayed; + +// +// Type of the callback for logger function. +// +type + sentry_logger_function_t = procedure( + level: sentry_level_t; + const message: PAnsiChar; + args: va_list; + userdata: Pointer + ); cdecl; + +// +// Sets the sentry-native logger function. +// +// Used for logging debug events when the `debug` option is set to true. +// +procedure sentry_options_set_logger( + opts: psentry_options_t; + func: sentry_logger_function_t; + userdata: Pointer +); cdecl; external sentry_dll delayed; + +// +// Enables or disables automatic session tracking. +// +// Automatic session tracking is enabled by default and is equivalent to calling +// `sentry_start_session` after startup. +// There can only be one running session, and the current session will always be +// closed implicitly by `sentry_close`, when starting a new session with +// `sentry_start_session`, or manually by calling `sentry_end_session`. +// +procedure sentry_options_set_auto_session_tracking( + opts: psentry_options_t; + val: Integer +); cdecl; external sentry_dll delayed; + +// +// Returns true if automatic session tracking is enabled. +// +function sentry_options_get_auto_session_tracking( + const opts: psentry_options_t +): Integer; cdecl; external sentry_dll delayed; + +// +// Enables or disabled user consent requirements for uploads. +// +// This disables uploads until the user has given the consent to the SDK. +// Consent itself is given with `sentry_user_consent_give` and +// `sentry_user_consent_revoke`. +// +procedure sentry_options_set_require_user_consent( + opts: psentry_options_t; + val: Integer); cdecl; external sentry_dll delayed; + +// +// Returns true if user consent is required. +// +function sentry_options_get_require_user_consent( + const opts: psentry_options_t ): Integer; cdecl; external sentry_dll delayed; // -// Enables or disabled user consent requirements for uploads. -// -// This disables uploads until the user has given the consent to the SDK. -// Consent itself is given with `sentry_user_consent_give` and -// `sentry_user_consent_revoke`. -// -procedure sentry_options_set_require_user_consent( - opts: psentry_options_t; - val: Integer); cdecl; external sentry_dll delayed; - -// -// Returns true if user consent is required. -// -function sentry_options_get_require_user_consent( - const opts: psentry_options_t -): Integer; cdecl; external sentry_dll delayed; - -// -// Enables or disables on-device symbolication of stack traces. -// -// This feature can have a performance impact, and is enabled by default on -// Android. It is usually only needed when it is not possible to provide debug -// information files for system libraries which are needed for serverside -// symbolication. -// -procedure sentry_options_set_symbolize_stacktraces( - opts: psentry_options_t; - val: Integer -); cdecl; external sentry_dll delayed; - -// -// Returns true if on-device symbolication of stack traces is enabled. -// -function sentry_options_get_symbolize_stacktraces( - const opts: psentry_options_t -): Integer; cdecl; external sentry_dll delayed; - +// Enables or disables on-device symbolication of stack traces. +// +// This feature can have a performance impact, and is enabled by default on +// Android. It is usually only needed when it is not possible to provide debug +// information files for system libraries which are needed for serverside +// symbolication. +// +procedure sentry_options_set_symbolize_stacktraces( + opts: psentry_options_t; + val: Integer +); cdecl; external sentry_dll delayed; + +// +// Returns true if on-device symbolication of stack traces is enabled. +// +function sentry_options_get_symbolize_stacktraces( + const opts: psentry_options_t +): Integer; cdecl; external sentry_dll delayed; + // // Adds a new attachment to be sent along. // -// `path` is assumed to be in platform-specific filesystem path encoding. -// API Users on windows are encouraged to use `sentry_options_add_attachmentw` -// instead. -// +// `path` is assumed to be in platform-specific filesystem path encoding. +// API Users on windows are encouraged to use `sentry_options_add_attachmentw` +// instead. +// procedure sentry_options_add_attachment( opts: psentry_options_t; const path: PAnsiChar @@ -1105,15 +1230,15 @@ procedure sentry_options_add_attachment( // Sets the path to the crashpad handler if the crashpad backend is used. // // The path defaults to the `crashpad_handler`/`crashpad_handler.exe` -// executable, depending on platform, which is expected to be present in the -// same directory as the app executable. -// -// It is recommended that library users set an explicit handler path, depending +// executable, depending on platform, which is expected to be present in the +// same directory as the app executable. +// +// It is recommended that library users set an explicit handler path, depending // on the directory/executable structure of their app. // -// `path` is assumed to be in platform-specific filesystem path encoding. -// API Users on windows are encouraged to use `sentry_options_set_handler_pathw` -// instead. +// `path` is assumed to be in platform-specific filesystem path encoding. +// API Users on windows are encouraged to use `sentry_options_set_handler_pathw` +// instead. // procedure sentry_options_set_handler_path( opts: psentry_options_t; @@ -1122,33 +1247,33 @@ procedure sentry_options_set_handler_path( // // Sets the path to the Sentry Database Directory. -// -// Sentry will use this path to persist user consent, sessions, and other -// artifacts in case of a crash. This will also be used by the crashpad backend -// if it is configured. -// -// The directory is used for "cached" data, which needs to persist across -// application restarts to ensure proper flagging of release-health sessions, -// but might otherwise be safely purged regularly. -// -// It is roughly equivalent to the type of `AppData/Local` on Windows and -// `XDG_CACHE_HOME` on Linux, and equivalent runtime directories on other -// platforms. -// -// It is recommended that users set an explicit absolute path, depending -// on their apps runtime directory. The path will be created if it does not -// exist, and will be resolved to an absolute path inside of `sentry_init`. The -// directory should not be shared with other application data/configuration, as -// sentry-native will enumerate and possibly delete files in that directory. An -// example might be `$XDG_CACHE_HOME/your-app/sentry` -// -// If no explicit path it set, sentry-native will default to `.sentry-native` in -// the current working directory, with no specific platform-specific handling. -// -// `path` is assumed to be in platform-specific filesystem path encoding. -// API Users on windows are encouraged to use -// `sentry_options_set_database_pathw` instead. -// +// +// Sentry will use this path to persist user consent, sessions, and other +// artifacts in case of a crash. This will also be used by the crashpad backend +// if it is configured. +// +// The directory is used for "cached" data, which needs to persist across +// application restarts to ensure proper flagging of release-health sessions, +// but might otherwise be safely purged regularly. +// +// It is roughly equivalent to the type of `AppData/Local` on Windows and +// `XDG_CACHE_HOME` on Linux, and equivalent runtime directories on other +// platforms. +// +// It is recommended that users set an explicit absolute path, depending +// on their apps runtime directory. The path will be created if it does not +// exist, and will be resolved to an absolute path inside of `sentry_init`. The +// directory should not be shared with other application data/configuration, as +// sentry-native will enumerate and possibly delete files in that directory. An +// example might be `$XDG_CACHE_HOME/your-app/sentry` +// +// If no explicit path it set, sentry-native will default to `.sentry-native` in +// the current working directory, with no specific platform-specific handling. +// +// `path` is assumed to be in platform-specific filesystem path encoding. +// API Users on windows are encouraged to use +// `sentry_options_set_database_pathw` instead. +// procedure sentry_options_set_database_path( opts: psentry_options_t; const path: PAnsiChar @@ -1193,6 +1318,37 @@ procedure sentry_options_set_system_crash_reporter_enabled( enabled: Integer ); cdecl; external sentry_dll delayed; +// +// Sets the maximum time (in milliseconds) to wait for the asynchronous tasks to +// end on shutdown, before attempting a forced termination. +// +procedure {SENTRY_API} sentry_options_set_shutdown_timeout( + opts: psentry_options_t; + shutdown_timeout: UInt64 +); cdecl; external sentry_dll delayed; + +// +// Gets the maximum time (in milliseconds) to wait for the asynchronous tasks to +// end on shutdown, before attempting a forced termination. +// +function {SENTRY_API} sentry_options_get_shutdown_timeout( + opts: psentry_options_t +): UInt64; cdecl; external sentry_dll delayed; + +// +// Sets a user-defined backend. +// +// Since creation and destruction of backends is not exposed in the API, this +// can only be used to set the backend to `NULL`, which disables the backend in +// the initialization. +// +procedure {SENTRY_API} sentry_options_set_backend( + opts: psentry_options_t; + backend: psentry_backend_t +); cdecl; external sentry_dll delayed; + + + // -- Global APIs -- // @@ -1201,33 +1357,45 @@ procedure sentry_options_set_system_crash_reporter_enabled( // This takes ownership of the options. After the options have been set they // cannot be modified any more. // Depending on the configured transport and backend, this function might not be -// fully thread-safe. -// Returns 0 on success. +// fully thread-safe. +// Returns 0 on success. // function sentry_init( options: psentry_options_t ): Integer; cdecl; external sentry_dll delayed; +// +// Instructs the transport to flush its send queue. +// +// The `timeout` parameter is in milliseconds. +// +// Returns 0 on success, or a non-zero return value in case the timeout is hit. +// +function {SENTRY_API} sentry_flush( + timeout: UInt64 +): Integer; cdecl; external sentry_dll delayed; + + +// +// Shuts down the sentry client and forces transports to flush out. +// +// Returns 0 on success. +// +function sentry_close: Integer; cdecl; external sentry_dll delayed; + // // Shuts down the sentry client and forces transports to flush out. // -// Returns 0 on success. -// -function sentry_close: Integer; cdecl; external sentry_dll delayed; - -// -// Shuts down the sentry client and forces transports to flush out. -// -// This is a **deprecated** alias for `sentry_close`. -// -// Returns 0 on success. -// -function sentry_shutdown: Integer; cdecl; external sentry_dll delayed; - -// -// This will lazily load and cache a list of all the loaded libraries. -// -// Returns a new reference to an immutable, frozen list. +// This is a **deprecated** alias for `sentry_close`. +// +// Returns 0 on success. +// +function sentry_shutdown: Integer; cdecl; external sentry_dll delayed; + +// +// This will lazily load and cache a list of all the loaded libraries. +// +// Returns a new reference to an immutable, frozen list. // The reference must be released with `sentry_value_decref`. // function sentry_get_modules_list: sentry_value_t; cdecl; external sentry_dll delayed; @@ -1236,43 +1404,43 @@ function sentry_get_modules_list: sentry_value_t; cdecl; external sentry_dll de // Clears the internal module cache. // // For performance reasons, sentry will cache the list of loaded libraries when -// capturing events. This cache can get out-of-date when loading or unloading -// libraries at runtime. It is therefore recommended to call -// `sentry_clear_modulecache` when doing so, to make sure that the next call to +// capturing events. This cache can get out-of-date when loading or unloading +// libraries at runtime. It is therefore recommended to call +// `sentry_clear_modulecache` when doing so, to make sure that the next call to // `sentry_capture_event` will have an up-to-date module list. // procedure sentry_clear_modulecache; cdecl; external sentry_dll delayed; // // Re-initializes the Sentry backend. -// -// This is needed if a third-party library overrides the previously installed -// signal handler. Calling this function can be potentially dangerous and should -// only be done when necessary. -// -// Returns 0 on success. -// +// +// This is needed if a third-party library overrides the previously installed +// signal handler. Calling this function can be potentially dangerous and should +// only be done when necessary. +// +// Returns 0 on success. +// function sentry_reinstall_backend: Integer; cdecl; external sentry_dll delayed; // -// Gives user consent. -// -procedure sentry_user_consent_give; external sentry_dll delayed; - -// -// Revokes user consent. -// -procedure sentry_user_consent_revoke; external sentry_dll delayed; - -// -// Resets the user consent (back to unknown). -// -procedure sentry_user_consent_reset; external sentry_dll delayed; - -// -// Checks the current state of user consent. -// -function sentry_user_consent_get: sentry_user_consent_t; external sentry_dll delayed; +// Gives user consent. +// +procedure sentry_user_consent_give; external sentry_dll delayed; + +// +// Revokes user consent. +// +procedure sentry_user_consent_revoke; external sentry_dll delayed; + +// +// Resets the user consent (back to unknown). +// +procedure sentry_user_consent_reset; external sentry_dll delayed; + +// +// Checks the current state of user consent. +// +function sentry_user_consent_get: sentry_user_consent_t; external sentry_dll delayed; // // Sends a sentry event. @@ -1282,14 +1450,14 @@ function sentry_capture_event( ): sentry_uuid_t; cdecl; external sentry_dll delayed; // -// Captures an exception to be handled by the backend. -// -// This is safe to be called from a crashing thread and may not return. -// -procedure sentry_handle_exception( - const uctx: psentry_ucontext_t -); cdecl; external sentry_dll delayed; - +// Captures an exception to be handled by the backend. +// +// This is safe to be called from a crashing thread and may not return. +// +procedure sentry_handle_exception( + const uctx: psentry_ucontext_t +); cdecl; external sentry_dll delayed; + // // Adds the breadcrumb to be sent in case of an event. // @@ -1357,8 +1525,8 @@ procedure sentry_remove_context( // // Sets the event fingerprint. // -// This accepts a variable number of arguments, and needs to be terminated by a -// trailing `NULL`. +// This accepts a variable number of arguments, and needs to be terminated by a +// trailing `NULL`. // procedure sentry_set_fingerprint( const fingerprint: PAnsiChar @@ -1389,36 +1557,43 @@ procedure sentry_set_level( level: sentry_level_t ); cdecl; external sentry_dll delayed; - // -// Starts a new session. -// -procedure sentry_start_session; cdecl; external sentry_dll delayed; - -// -// Ends a session. -// -procedure sentry_end_session; cdecl; external sentry_dll delayed; - - // - // Sets the path to sentry.dll; this must - // be called before any other sentry apis - // - procedure sentry_set_library_path(const path: string); - - implementation - -uses - System.SysUtils; - -procedure sentry_set_library_path(const path: string); -begin - if LoadLibrary(PChar(path)) = 0 then - RaiseLastOSError; -end; - -procedure sentry_string_free(str: PAnsiChar); cdecl; -begin - sentry_free(str); -end; - -end. + +// +// Starts a new session. +// +procedure sentry_start_session; cdecl; external sentry_dll delayed; + +// +// Ends a session. +// +procedure sentry_end_session; cdecl; external sentry_dll delayed; + + +// + +// Sets the path to sentry.dll; this must + +// be called before any other sentry apis + +// + +procedure sentry_set_library_path(const path: string); + + +implementation + +uses + System.SysUtils; + +procedure sentry_set_library_path(const path: string); +begin + if LoadLibrary(PChar(path)) = 0 then + RaiseLastOSError; +end; + +procedure sentry_string_free(str: PAnsiChar); cdecl; +begin + sentry_free(str); +end; + +end. diff --git a/common/windows/delphi/ext/sentry/sentry.x64.dll b/common/windows/delphi/ext/sentry/sentry.x64.dll index 9737a5acc0c142bb7f0878c61bd323c22ac667d8..5587ebaa0c60a6dc3370110a3fc7291a4d6af7b4 100644 Binary files a/common/windows/delphi/ext/sentry/sentry.x64.dll and b/common/windows/delphi/ext/sentry/sentry.x64.dll differ diff --git a/common/windows/delphi/ext/sentry/sentry.x64.lib b/common/windows/delphi/ext/sentry/sentry.x64.lib index 1a9f57d57c02ae950edb4656636f493aec7a3e0e..31fe0927543615010591537ab95d8a1f2528c683 100644 Binary files a/common/windows/delphi/ext/sentry/sentry.x64.lib and b/common/windows/delphi/ext/sentry/sentry.x64.lib differ diff --git a/common/windows/delphi/ext/sentry/test/Sentry.Client.Test.SentryClientTestMain.pas b/common/windows/delphi/ext/sentry/test/Sentry.Client.Test.SentryClientTestMain.pas index c9f33f6533008375d2b1e1d303bcb56db6a2e93d..49fe1bc91c1e52a48e0913e9ce7d7abda8eea5de 100644 --- a/common/windows/delphi/ext/sentry/test/Sentry.Client.Test.SentryClientTestMain.pas +++ b/common/windows/delphi/ext/sentry/test/Sentry.Client.Test.SentryClientTestMain.pas @@ -7,6 +7,7 @@ procedure main; implementation uses + sentry, Sentry.Client, System.SysUtils; @@ -29,7 +30,7 @@ begin //o.DSN := 'https://7b1ff1dae2c8495b84f90dadcf512b84@sentry.io/4853461'; o.Release := 'keyman-14.0.22-alpha-local'; o.HandlerPath := 'c:\Projects\keyman\app\windows\src\ext\sentry\test\Win32\Release\crashpad_handler.exe'; - o.DatabasePath := '.\sentry-0.4.9-db'; + o.DatabasePath := '.\sentry-'+SENTRY_SDK_VERSION+'-db'; Result := TSentryClient.Create(o); end; diff --git a/common/windows/delphi/general/CRC32.pas b/common/windows/delphi/general/CRC32.pas deleted file mode 100644 index a7d4bd6d915f613edaaf053d5cc541cc76b9c87a..0000000000000000000000000000000000000000 --- a/common/windows/delphi/general/CRC32.pas +++ /dev/null @@ -1,129 +0,0 @@ -(* - Name: CRC32 - Copyright: Copyright (C) SIL International. - Documentation: - Description: - Create Date: 17 Aug 2012 - - Modified Date: 17 Aug 2012 - Authors: mcdurdin - Related Files: - Dependencies: - - Bugs: - Todo: - Notes: - History: 17 Aug 2012 - mcdurdin - I3310 - V9.0 - Unicode in Delphi fixes -*) -unit CRC32; - -interface - -uses - System.Classes, - System.SysUtils, - Winapi.Windows; - -function CalculateBufferCRC(Count: LongWord; p: PByte): LongWord; // I3310 -function CalculateStringCRC(const s: ansistring): LongWord; // I3310 -function Dehash(s: PByteArray; sz: Integer): string; -procedure Hash(s: string; sz: Integer; outbuf: PByteArray); - -function GetCRC32Xor(const filename: string; x: LongWord): LongWord; - -implementation - -{ - * Instead of performing a straightforward calculation of the 32 bit - * CRC using a series of logical operations, this program uses the - * faster table lookup method. This routine is called once when the - * program starts up to build the table which will be used later - * when calculating the CRC values. -} - -var - CRCTable: array[0..255] of LongWord; - TableBuilt: Boolean = False; - -const - CRC32_POLYNOMIAL: LongWord = $EDB88320; - -procedure BuildCRCTable; -var - i, j: Integer; - crc: LongWord; -begin - if not TableBuilt then - for i := 0 to 255 do - begin - crc := i; - - for j := 8 downto 1 do - if (crc and 1) = 1 then crc := (crc shr 1) xor CRC32_POLYNOMIAL else crc := crc shr 1; - - CRCTable[i] := crc; - end; -end; - - -{ - * This routine calculates the CRC for a block of data using the - * table lookup method. It accepts an original value for the crc, - * and returns the updated value. -} - -function CalculateBufferCRC(Count: LongWord; p: PByte): LongWord; // I3310 -var - temp1, temp2, crc: LongWord; -begin - crc := $FFFFFFFF; - - while Count <> 0 do - begin - temp1 := (crc shr 8) and $00FFFFFF; - temp2 := CRCTable[(Integer(crc) xor Integer(p^)) and $ff]; - crc := temp1 xor temp2; - Inc(p); - Dec(Count); - end; - - Result := crc; -end; - -function CalculateStringCRC(const s: ansistring): LongWord; // I3310 -begin - Result := CalculateBufferCRC(Length(s), PByte(PAnsiChar(s))); // I3310 -end; - -procedure Hash(s: string; sz: Integer; outbuf: PByteArray); -var - i: Integer; -begin - for i := 1 to sz do outbuf[i-1] := Ord(s[i]) xor $6D; -end; - -function Dehash(s: PByteArray; sz: Integer): string; -var - i: Integer; -begin - Result := ''; - for i := 0 to sz-1 do - Result := Result + Chr(s[i] xor $6D); -end; - - -function GetCRC32Xor(const filename: string; x: LongWord): LongWord; -begin - with TMemoryStream.Create do - try - LoadFromFile(filename); - Result := CalculateBufferCRC(Size, Memory) xor x; - finally - Free; - end; -end; - -initialization - BuildCRCTable; -end. - diff --git a/common/windows/delphi/general/Keyman.System.KeymanSentryClient.pas b/common/windows/delphi/general/Keyman.System.KeymanSentryClient.pas index 5504f66f9ec72384a9cb3292696fef5250f5abfb..8c195f059d80be5e4e42f65efb674e212b93571a 100644 --- a/common/windows/delphi/general/Keyman.System.KeymanSentryClient.pas +++ b/common/windows/delphi/general/Keyman.System.KeymanSentryClient.pas @@ -375,7 +375,7 @@ begin end; o.HandlerPath := ExtractFilePath(path) + 'crashpad_handler.exe'; - o.DatabasePath := TKeymanPaths.ErrorLogPath + 'sentry-0.4.9-db'; + o.DatabasePath := TKeymanPaths.ErrorLogPath + 'sentry-'+SENTRY_SDK_VERSION+'-db'; FClient := SentryClientClass.Create(o, ALogger, f); FClient.OnAfterEvent := ClientAfterEvent; diff --git a/common/windows/delphi/general/RegistryKeys.pas b/common/windows/delphi/general/RegistryKeys.pas index 78e2d2c0cf0168493008b4ba7a3426639b9c6e9c..5e61448789c507bf08860b403300a52fcac53519 100644 --- a/common/windows/delphi/general/RegistryKeys.pas +++ b/common/windows/delphi/general/RegistryKeys.pas @@ -393,6 +393,8 @@ const SRegValue_IDEOptAutoSaveBeforeCompiling = 'auto save before compiling'; // CU SRegValue_IDEOptOSKAutoSaveBeforeImporting = 'osk auto save before importing'; // CU + SRegValue_IDEOptUseLegacyCompiler = 'use legacy compiler'; // CU + // Note: keeping 'web host port' reg value name to ensure settings maintained // from version 14.0 and earlier of Keyman Developer. Other values are // new with Keyman Developer 15.0 diff --git a/common/windows/delphi/keyboards/kmxfile.pas b/common/windows/delphi/keyboards/kmxfile.pas index fe7311d879d7afc8b56e8264bb6f600f9221d6ad..1c658c2207724a5b870890f8a105e2448bb4a8f6 100644 --- a/common/windows/delphi/keyboards/kmxfile.pas +++ b/common/windows/delphi/keyboards/kmxfile.pas @@ -114,7 +114,7 @@ type TKeyboardFileHeader = packed record dwIdentifier: Dword; // Keyman compiled keyboard id dwFileVersion: Dword; // 0x0400 or 0x0500 - dwCheckSum: Dword; + dwCheckSum: Dword; // As stored in keyboard. DEPRECATED as of 16.0 KeyboardID: DWord; // as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts IsRegistered: DWord; // was layout id; version: DWord; // keyboard file version with VERSION keyword @@ -182,7 +182,6 @@ function HotkeyAsString(hotkey: DWord): string; implementation uses - crc32, KeyNames, utildir, utilfiletypes; @@ -195,8 +194,10 @@ const KF_CAPSONONLY = $0002; KF_CAPSALWAYSOFF = $0004; KF_LOGICALLAYOUT = $0008; + KF_AUTOMATICVERSION = $0010; - + // 16.0: Support for LDML Keyboards in KMXPlus file format + KF_KMXPLUS = $0020; function GetSystemStore(Memory: PByte; SystemID: DWord; var Buffer: WideString): Boolean; // I3310 var @@ -228,7 +229,6 @@ end; procedure GetKeyboardInfo(const FileName: string; FReturnDump: Boolean; var ki: TKeyboardInfo; FReturnBitmap: Boolean = False); var kfh: TKeyboardFileHeader; - cs: DWord; mem: TMemoryStream; ver: WideString; shver: string; @@ -251,15 +251,6 @@ begin Position := 0; Read(kfh, SizeOf(TKeyboardFileHeader)); - cs := kfh.dwCheckSum; - kfh.dwCheckSum := 0; - - Position := 0; - Write(kfh, SizeOf(TKeyboardFileHeader)); - - if CalculateBufferCRC(Size, Memory) <> cs then - raise EKMXError.CreateFmt(EKMX_InvalidKeyboardFile, 'The keyboard file %0:s is invalid', [ExtractFileName(FileName)]); - if kfh.dwIdentifier <> FILEID_COMPILED then raise EKMXError.CreateFmt(EKMX_InvalidKeyboardFile, 'The keyboard file %0:s is invalid', [ExtractFileName(FileName)]); diff --git a/common/windows/delphi/keyboards/kmxfileconsts.pas b/common/windows/delphi/keyboards/kmxfileconsts.pas index d302528847da5a6325e7d9ce43f92f04607fc3ec..e08feb65641300e2299ffab0ed0f80b125b893df 100644 --- a/common/windows/delphi/keyboards/kmxfileconsts.pas +++ b/common/windows/delphi/keyboards/kmxfileconsts.pas @@ -98,9 +98,10 @@ const VERSION_100 = $00000A00; VERSION_140 = $00000E00; VERSION_150 = $00000F00; + VERSION_160 = $00001000; VERSION_MIN = VERSION_50; - VERSION_MAX = VERSION_150; + VERSION_MAX = VERSION_160; VERSION_MASK_MINOR = $00FF; VERSION_MASK_MAJOR = $FF00; diff --git a/common/windows/delphi/packages/PackageInfo.pas b/common/windows/delphi/packages/PackageInfo.pas index dd4dbcd1106322240c4e8a0d574c54e7dad2a621..e468a9ceb741971a2d873096f8c19959b8173bef 100644 --- a/common/windows/delphi/packages/PackageInfo.pas +++ b/common/windows/delphi/packages/PackageInfo.pas @@ -459,7 +459,6 @@ const SXML_PackageLexicalModel = 'LexicalModel'; SXML_PackageLexicalModel_Name = 'Name'; SXML_PackageLexicalModel_ID = 'ID'; - SXML_PackageLexicalModel_Version = 'Version'; SXML_PackageLexicalModel_RTL = 'RTL'; SXML_PackageLexicalModel_Languages = 'Languages'; @@ -2213,7 +2212,7 @@ begin lexicalModel := TPackageLexicalModel.Create(Package); lexicalModel.Name := XmlVarToStr(ALexicalModel.ChildValues[SXML_PackageLexicalModel_Name]); lexicalModel.ID := XmlVarToStr(ALexicalModel.ChildValues[SXML_PackageLexicalModel_ID]); - lexicalModel.RTL := ANode.ChildNodes.IndexOf(SXML_PackageLexicalModel_RTL) >= 0; + lexicalModel.RTL := ALexicalModel.ChildNodes.IndexOf(SXML_PackageLexicalModel_RTL) >= 0; lexicalModel.Languages.LoadXML(ALexicalModel); Add(lexicalModel); end; diff --git a/common/windows/mkver.sh b/common/windows/mkver.sh index b5c82429f2b7b0ce9b1653017a2ce69a468e21b9..8ddb9e34ed7b17a3ee0eaf25a6ec96cc6a0f5c68 100755 --- a/common/windows/mkver.sh +++ b/common/windows/mkver.sh @@ -8,8 +8,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE display_usage() { diff --git a/configure-repo.sh b/configure-repo.sh index d729255b34e921944166f6d71a2e3688469668fe..5e7feed94a41e3a3993bc11d3f791b6030f3f7b5 100755 --- a/configure-repo.sh +++ b/configure-repo.sh @@ -10,7 +10,7 @@ if [[ -n "$WINDIR" ]]; then # https://stackoverflow.com/a/39160850/1836776 SCRIPT_DIR=$(cmd //C cd) else - SCRIPT_DIR="$(dirname "$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")")" + SCRIPT_DIR="$(dirname "$(readlink -f "${BASH_SOURCE[0]}")")" fi case $1 in diff --git a/core/.build-builder b/core/.build-builder new file mode 100644 index 0000000000000000000000000000000000000000..faf4c870a929938091d65d5ff781580fcf0a1459 --- /dev/null +++ b/core/.build-builder @@ -0,0 +1,4 @@ +The presence of this file tells CI to use the new builder_ style parameters for build.sh. + +Once all branches for 16.0+ are updated to merge the chore/core/7247-use-builder-for-build-sh branch, then we +can remove this file and the corresponding bash test branches in CI. diff --git a/core/.gitignore b/core/.gitignore index e71a856da391c0a9fe861bc905e6d2aa7704f614..b02aacc47369170f728d0bb46c2068c69d2d4314 100644 --- a/core/.gitignore +++ b/core/.gitignore @@ -1,6 +1,7 @@ .vs/ build/ configure/ +resources/ # cross-compile for meson wasm, built from wasm.build..in wasm.build @@ -10,8 +11,6 @@ TIER.md VERSION.md shellHelperFunctions.sh -src/rust/keyman_keyboard_processor/target/ - # The following files/subdirs are generated by autotools when building ibus-keyman. # They can be removed after we convert ibus-keyman to use meson. .deps/ diff --git a/core/build.bat b/core/build.bat index c720c94bffcd979f5900b00115451c94134164c4..5dd219e9f27f167ce1554f89ad29b46478bba9bd 100644 --- a/core/build.bat +++ b/core/build.bat @@ -15,14 +15,13 @@ goto help rem ---------------------------------- :help -echo Usage: %0 x86^|x64^|all debug^|release [build] [tests] +echo Usage: %0 x86^|x64^|all debug^|release [configure] [build] [test] [additional params for meson/ninja] echo or -echo Usage: %0 x86^|x64^|all -c +echo Usage: %0 x86^|x64 -c echo -c will leave your environment configured for Visual Studio for selected platform. -echo -c can be used only with x86 and x64 options echo. echo Otherwise, %0 is intended to be used by build.sh, not directly. -echo At least one of 'build' or 'tests' is required. +echo At least one of 'configure', 'build', or 'test' is required. goto :eof rem ---------------------------------- @@ -31,10 +30,10 @@ rem ---------------------------------- setlocal cd %KEYMAN_ROOT%\core -cmd /c build.bat x86 %2 %3 %4 %5 || exit !errorlevel! +cmd /c build.bat x86 %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! cd %KEYMAN_ROOT%\core -cmd /c build.bat x64 %2 %3 %4 %5 || exit !errorlevel! +cmd /c build.bat x64 %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! goto :eof @@ -42,15 +41,16 @@ rem ---------------------------------- :build -if "%2"=="-c" goto :setup - set ARCH=%1 +shift + +if "%1"=="-c" goto :setup echo === Locating Visual Studio === rem From https://github.com/microsoft/vswhere -for /f "usebackq tokens=*" %%i in (`..\resources\build\vswhere -latest -requires Microsoft.Component.MSBuild -find **\vcvarsall.bat`) do ( - set VCVARSALL="%%i" +for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do ( + set VsDevCmd_Path=%%a\Common7\Tools\VsDevCmd.bat ) if errorlevel 1 ( @@ -58,41 +58,50 @@ if errorlevel 1 ( exit /b !errorlevel! ) -if not exist "!VCVARSALL!" ( - echo Could not find vcvarsall.bat [!VCVARSALL!] +if not exist "!VsDevCmd_Path!" ( + echo Could not find vsdevcmd.bat [!VsDevCmd_Path!] exit /b 1 ) echo === Configuring VC++ === -call !VCVARSALL! !ARCH! || exit !errorlevel! +set VSCMD_SKIP_SENDTELEMETRY=1 +call "!VsDevCmd_Path!" -arch=!ARCH! -no_logo -startdir=none || exit !errorlevel! cd %KEYMAN_ROOT%\core -set BUILDTYPE=%2 +set BUILDTYPE=%1 +shift set STATIC_LIBRARY=--default-library both -if "%3" == "build" ( - echo === Calling meson build for Windows !ARCH! !BUILDTYPE! === +set COMMAND=%1 +shift + +if "!COMMAND!" == "configure" ( + echo === Configuring Keyman Core for Windows !ARCH! !BUILDTYPE! === if exist build\!ARCH!\!BUILDTYPE! rd /s/q build\!ARCH!\!BUILDTYPE! - meson build\!ARCH!\!BUILDTYPE! !STATIC_LIBRARY! --buildtype !BUILDTYPE! --werror || exit !errorlevel! + if "%1" == "--no-tests" ( + meson setup build\!ARCH!\!BUILDTYPE! !STATIC_LIBRARY! --buildtype !BUILDTYPE! -Dkeyman_core_tests=false --werror %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! + ) else ( + meson setup build\!ARCH!\!BUILDTYPE! !STATIC_LIBRARY! --buildtype !BUILDTYPE! --werror %1 %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! + ) + shift +) +if "!COMMAND!" == "build" ( echo === Building Keyman Core for Windows !ARCH! !BUILDTYPE! === cd build\!ARCH!\!BUILDTYPE! || exit !errorlevel! - - ninja || exit !errorlevel! + ninja %1 %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! cd ..\..\.. - shift ) -if "%3" == "tests" ( - cd build\!ARCH!/!BUILDTYPE! || exit !errorlevel! - - echo === Running tests for Windows !ARCH! !BUILDTYPE! === - meson test --print-errorlogs || exit !errorlevel! - +if "!COMMAND!" == "test" ( + echo === Testing Keyman Core for Windows !ARCH! !BUILDTYPE! === + cd build\!ARCH!\!BUILDTYPE! || exit !errorlevel! + meson test --print-errorlogs %1 %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! cd ..\..\.. + shift ) goto :eof @@ -105,10 +114,12 @@ rem Standalone build, so we'll make the environment available to the caller rem Also setup rem Note: Visual Studio 2022 doesn't provide vcvarsall.bat, so we'll have to find a different solution endlocal -for /f "usebackq tokens=*" %%i in (`..\resources\build\vswhere -version [15^,17^) -latest -requires Microsoft.Component.MSBuild -find **\vcvarsall.bat`) do ( - set VCVARSALL="%%i" +for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do ( + set VsDevCmd_Path=%%a\Common7\Tools\VsDevCmd.bat ) -%VCVARSALL% %1 + +set VSCMD_SKIP_SENDTELEMETRY=1 +"!VsDevCmd_Path!" -arch=!ARCH! -no_logo -startdir=none goto :eof rem ---------------------------------- diff --git a/core/build.sh b/core/build.sh index 83e0e478ea96d6c928c5887e0a32ed19dac4cf15..9779419202915c6031fe0ff0c1a039eac58344d3 100755 --- a/core/build.sh +++ b/core/build.sh @@ -5,300 +5,179 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" + ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" +. "$THIS_SCRIPT_PATH/commands.inc.sh" -display_usage() { - echo "usage: build.sh [build options] [targets] [-- options to pass to c++ configure]" - echo - echo "Build options:" - echo " --debug, -d Debug build" - echo " --target, -t Target path (linux,macos only, default build/)" - echo " --platform, -p Platform to build (wasm or native, default native)" - echo - echo "Targets (all except install if not specified):" - echo " clean Clean target path" - echo " configure Configure libraries (linux,macos only)" - echo " build Build all libraries" - echo " build-cpp Build c++ libraries" - echo " tests Run all tests" - echo " tests-cpp Run c++ tests" - echo " install Install all libraries" - echo " install-cpp Install c++ libraries" - echo " uninstall Uninstall all libraries" - echo " uninstall-cpp Uninstall c++ libraries" - echo - echo "C++ libraries will be in: TARGETPATH///src" - echo "WASM libraries will be in: TARGETPATH/wasm//src" - echo "On Windows, will be 'x86' or 'x64'; elsewhere it is 'arch'" - exit 0 -} - -get_builder_OS - -MESON_TARGET=release -HAS_TARGET=false -CLEAN=false -CONFIGURE=false -BUILD_CPP=false -TESTS_CPP=false -INSTALL_CPP=false -UNINSTALL_CPP=false -QUIET=false -TARGET_PATH="$THIS_SCRIPT_PATH/build" -ADDITIONAL_ARGS= -PLATFORM=native - -# Parse args -shopt -s nocasematch - -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - --debug|-d) - MESON_TARGET=debug - ;; - --help|-\?) - display_usage - ;; - --target|-t) - TARGET_PATH=$(readlink -f "$2") - shift - ;; - --platform|-p) - PLATFORM="$2" - shift - ;; - configure) - HAS_TARGET=true - CONFIGURE=true - ;; - clean) - HAS_TARGET=true - CLEAN=true - ;; - build) - HAS_TARGET=true - BUILD_CPP=true - ;; - *-rust) - echo "$key: Rust was removed in " - ;; - build-cpp) - HAS_TARGET=true - BUILD_CPP=true - ;; - tests) - HAS_TARGET=true - TESTS_CPP=true - ;; - tests-cpp) - HAS_TARGET=true - TESTS_CPP=true - ;; - install) - HAS_TARGET=true - INSTALL_CPP=true - ;; - install-cpp) - HAS_TARGET=true - INSTALL_CPP=true - ;; - uninstall) - HAS_TARGET=true - # ninja records the files it installs, so unless we install first we don't know - # what to uninstall. Installing will overwrite the existing files, if we then - # then uninstall the files get removed - unless previously we had additional files. - INSTALL_CPP=true - UNINSTALL_CPP=true - ;; - uninstall-cpp) - HAS_TARGET=true - INSTALL_CPP=true - UNINSTALL_CPP=true - ;; - --) - shift - ADDITIONAL_ARGS=$@ - break - ;; - *) - fail "Invalid parameters. Use --help for help" - esac - shift -done - -if ! $HAS_TARGET; then - if [ ! -f "$TARGET_PATH" ]; then - CONFIGURE=true - fi - BUILD_CPP=true - TESTS_CPP=true -fi +cd "$THIS_SCRIPT_PATH" -if [[ $PLATFORM == wasm ]]; then - MESON_PATH="$TARGET_PATH/wasm/$MESON_TARGET" -else - MESON_PATH="$TARGET_PATH/arch/$MESON_TARGET" -fi +################################ Main script ################################ -displayInfo "" \ - "VERSION: $VERSION" \ - "TIER: $TIER" \ - "PLATFORM: $PLATFORM" \ - "CONFIGURE: $CONFIGURE" \ - "CLEAN: $CLEAN" \ - "BUILD_CPP: $BUILD_CPP" \ - "TESTS_CPP: $TESTS_CPP" \ - "INSTALL_CPP: $INSTALL_CPP" \ - "UNINSTALL_CPP: $UNINSTALL_CPP" \ - "MESON_TARGET: $MESON_TARGET" \ - "TARGET_PATH: $TARGET_PATH" \ - "" - -clean() { - rm -rf "$TARGET_PATH/" -} +cleanup_visual_studio_path -path_remove() { - # Delete path by parts so we can never accidentally remove sub paths - PATH=${PATH//":$1:"/":"} # delete any instances in the middle - PATH=${PATH/#"$1:"/} # delete any instance at the beginning - PATH=${PATH/%":$1"/} # delete any instance in the at the end -} +MESON_LOW_VERSION=false -build_windows() { - # Build targets for Windows - - # Build the meson targets, both x86 and x64 also - # We need to use a batch file here so we can get - # the Visual Studio build environment with vcvarsall.bat - # TODO: if PATH is the only variable required, let's try and - # eliminate this difference in the build process - - if $BUILD_CPP; then - if $TESTS_CPP; then - echo_heading "======= Building and Testing C++ library for Windows (x86, x64) =======" - cmd //C build.bat all $MESON_TARGET build tests - else - echo_heading "======= Building C++ library for Windows (x86, x64) =======" - cmd //C build.bat all $MESON_TARGET build - fi - elif $TESTS_CPP; then - echo_heading "======= Testing C++ library for Windows (x86, x64) =======" - cmd //C build.bat all $MESON_TARGET tests - fi -} - -build_standard() { - local BUILD_PLATFORM="$1" - local ARCH="$2" - local RUSTARCH=${3:-} - # RUSTARCH is not currently used. - if [ $# -gt 3 ]; then - shift 3 - local STANDARD_MESON_ARGS="$*" - else - local STANDARD_MESON_ARGS= - fi - - # Build meson targets - if $CONFIGURE; then - echo_heading "======= Configuring C++ library for $BUILD_PLATFORM =======" - pushd "$THIS_SCRIPT_PATH" > /dev/null - meson setup "$MESON_PATH" --werror --buildtype $MESON_TARGET $STANDARD_MESON_ARGS $ADDITIONAL_ARGS - popd > /dev/null - fi - - if $BUILD_CPP; then - echo_heading "======= Building C++ library for $BUILD_PLATFORM =======" - pushd "$MESON_PATH" > /dev/null - ninja - popd > /dev/null - fi - - if $TESTS_CPP; then - echo_heading "======= Testing C++ library for $BUILD_PLATFORM =======" - pushd "$MESON_PATH" > /dev/null - meson test --print-errorlogs - popd > /dev/null - fi - - if $INSTALL_CPP; then - echo_heading "======= Installing C++ libraries for $BUILD_PLATFORM =======" - pushd "$MESON_PATH" > /dev/null - ninja install - popd > /dev/null - fi - - if $UNINSTALL_CPP; then - echo_heading "======= Uninstalling C++ libraries for $BUILD_PLATFORM =======" - pushd "$MESON_PATH" > /dev/null - ninja uninstall - popd > /dev/null - fi -} +if [[ `meson --version` < 0.54 ]]; then + MESON_LOW_VERSION=true +fi # -# We don't want to rely on emcc being on the path, because Emscripten puts far -# too many things onto the path (in particular for us, node). -# -# The following comment suggests that we don't need emcc on the path. -# https://github.com/emscripten-core/emscripten/issues/4848#issuecomment-1097357775 +# Restrict available targets to those that can be built on the current system # -# So we try and locate emcc in common locations ourselves. The search pattern -# is: + +archtargets=(":wasm WASM build") + +case $BUILDER_OS in + win) + archtargets+=( + ":x86 32-bit Windows (x86) build" + ":x64 64-bit Windows (x64) build" + ) + ;; + mac) + archtargets+=( + ":mac Mac all architectures fat library build" + ":mac-x86_64 Mac Intel build" + ":mac-arm64 Mac arm64 (M1) build" + ) + ;; + linux) + archtargets+=( + ":arch Linux build -- current architecture" + ) + ;; +esac + +# TODO: consider using "linux" instead of "arch"? +# ":linux Build for current Linux architecture" + +builder_describe \ +"Build Keyman Core + +Libraries will be built in 'build///src'. + * : 'debug' or 'release' (see --debug flag) + * All parameters after '--' are passed to meson or ninja \ +" \ + "@/common/tools/hextobin" \ + "@/common/web/keyman-version" \ + "@/developer/src/kmc" \ + "clean" \ + "configure" \ + "build" \ + "test" \ + "install install libraries to current system" \ + "uninstall uninstall libraries from current system" \ + "${archtargets[@]}" \ + "--no-tests do not configure tests (used by other projects)" \ + "--test=opt_tests,-t test[s] to run (space separated)" + +builder_parse "$@" + # -# 1. Look for $EMSCRIPTEN_BASE (our primary emscripten variable), which should -# point to the folder that emcc is located in -# 2. Look for $EMCC which should point to the emcc executable -# 3. Look for emcc on the path +# meson forces us to configure tests, including building compilers, even +# if we don't plan to run them, for example when doing a dependency build +# in CI # -locate_emscripten() { - if [[ -z ${EMSCRIPTEN_BASE+x} ]]; then - if [[ -z ${EMCC+x} ]]; then - local EMCC=`which emcc` - [[ -z $EMCC ]] && fail "locate_emscripten: Could not locate emscripten (emcc) on the path or with \$EMCC or \$EMSCRIPTEN_BASE" - fi - [[ -x $EMCC ]] || fail "locate_emscripten: Variable EMCC ($EMCC) does not point to a valid executable emcc" - EMSCRIPTEN_BASE="$(dirname "$EMCC")" - fi - - [[ -x ${EMSCRIPTEN_BASE}/emcc ]] || fail "locate_emscripten: Variable EMSCRIPTEN_BASE ($EMSCRIPTEN_BASE) does not point to emcc's folder" -} +MESON_OPTION_keyman_core_tests= +BUILD_BAT_keyman_core_tests= + +if builder_is_dep_build || builder_has_option --no-tests; then + MESON_OPTION_keyman_core_tests="-Dkeyman_core_tests=false" + BUILD_BAT_keyman_core_tests=--no-tests + builder_remove_dep /common/tools/hextobin + builder_remove_dep /common/web/keyman-version + builder_remove_dep /developer/src/kmc +fi + +# 'mac' target builds both x86_64 and arm architectures and +# generates a 'fat' library from them. +builder_describe_internal_dependency \ + build:mac build:mac-x86_64 \ + build:mac build:mac-arm64 + +builder_describe_outputs \ + configure:x86 /core/build/x86/$BUILDER_CONFIGURATION/build.ninja \ + configure:x64 /core/build/x64/$BUILDER_CONFIGURATION/build.ninja \ + configure:mac /core/build/mac/$BUILDER_CONFIGURATION/ \ + configure:mac-x86_64 /core/build/mac-x86_64/$BUILDER_CONFIGURATION/build.ninja \ + configure:mac-arm64 /core/build/mac-arm64/$BUILDER_CONFIGURATION/build.ninja \ + configure:arch /core/build/arch/$BUILDER_CONFIGURATION/build.ninja \ + configure:wasm /core/build/wasm/$BUILDER_CONFIGURATION/build.ninja \ + build:x86 /core/build/x86/$BUILDER_CONFIGURATION/src/libkmnkbp0.a \ + build:x64 /core/build/x64/$BUILDER_CONFIGURATION/src/libkmnkbp0.a \ + build:mac /core/build/mac/$BUILDER_CONFIGURATION/libkmnkbp0.a \ + build:mac-x86_64 /core/build/mac-x86_64/$BUILDER_CONFIGURATION/src/libkmnkbp0.a \ + build:mac-arm64 /core/build/mac-arm64/$BUILDER_CONFIGURATION/src/libkmnkbp0.a \ + build:arch /core/build/arch/$BUILDER_CONFIGURATION/src/libkmnkbp0.a \ + build:wasm /core/build/wasm/$BUILDER_CONFIGURATION/src/libkmnkbp0.a + +# Import our standard compiler defines; this is copied from +# /resources/build/meson/standard.meson.build by build.sh, because meson doesn't +# allow us to reference a file outside its root +if builder_has_action configure; then + mkdir -p "$THIS_SCRIPT_PATH/resources" + cp "$KEYMAN_ROOT/resources/build/meson/standard.meson.build" "$THIS_SCRIPT_PATH/resources/meson.build" +fi -build_meson_cross_file_for_wasm() { - if [ $os_id == win ]; then - local R=$(cygpath -w $(echo $EMSCRIPTEN_BASE) | sed 's_\\_\\\\_g') - else - local R=$(echo $EMSCRIPTEN_BASE | sed 's_/_\\/_g') - fi - sed -e "s/\$EMSCRIPTEN_BASE/$R/g" wasm.build.$os_id.in > wasm.build +# Iterate through all possible targets; note that targets that cannot be built +# on the current platform have already been excluded through the archtargets +# settings above +targets=(wasm x86 x64 mac-x86_64 mac-arm64 arch) + +do_action() { + local action_function=do_$1 + for target in "${targets[@]}"; do + MESON_PATH="$KEYMAN_ROOT/core/build/$target/$BUILDER_CONFIGURATION" + $action_function $target + done } -### +# ------------------------------------------------------------------------------- + +do_action clean + +# ------------------------------------------------------------------------------- + +do_action configure + +# After we have built the necessary internal dependencies, then we can go +# ahead and build a fat library for external consumption +if builder_start_action configure:mac; then + mkdir -p "$KEYMAN_ROOT/core/build/mac/$BUILDER_CONFIGURATION" + builder_finish_action success configure:mac +fi + +# ------------------------------------------------------------------------------- -if $CLEAN; then - clean +do_action build + +if builder_start_action build:mac; then + lipo -create \ + "$KEYMAN_ROOT/core/build/mac-x86_64/$BUILDER_CONFIGURATION/src/libkmnkbp0.a" \ + "$KEYMAN_ROOT/core/build/mac-arm64/$BUILDER_CONFIGURATION/src/libkmnkbp0.a" \ + -output "$KEYMAN_ROOT/core/build/mac/$BUILDER_CONFIGURATION/libkmnkbp0.a" + builder_finish_action success build:mac fi -if [[ $PLATFORM == native ]]; then - case $os_id in - "linux") - build_standard $os_id arch - ;; - "mac") - build_standard $os_id arch - ;; - "win") - build_windows - ;; - esac -else - locate_emscripten - build_meson_cross_file_for_wasm - build_standard wasm wasm wasm32-unknown-unknown --cross-file wasm.defs.build --cross-file wasm.build --default-library static +# ------------------------------------------------------------------------------- + +do_action test + +if builder_start_action test:mac; then + # We can only run the tests for the current architecture; we can + # assume that build:mac has run so both architectures will be + # available + target=mac-`uname -m` + MESON_PATH="$KEYMAN_ROOT/core/build/$target/$BUILDER_CONFIGURATION" + meson test -C "$MESON_PATH" "${builder_extra_params[@]}" + builder_finish_action success test:mac fi + +# ------------------------------------------------------------------------------- + +do_action install +do_action uninstall diff --git a/core/commands.inc.sh b/core/commands.inc.sh new file mode 100644 index 0000000000000000000000000000000000000000..2e5fb9e7b9ffda235b6d665e250d27e69fc760f1 --- /dev/null +++ b/core/commands.inc.sh @@ -0,0 +1,173 @@ +#!/usr/bin/env bash + +# ---------------------------------------------------------------------------- +# clean +# ---------------------------------------------------------------------------- + +do_clean() { + # clean: note build/ will be left, but build// should be gone + local target=$1 + builder_start_action clean:$target || return 0 + rm -rf "$MESON_PATH" + builder_finish_action success clean:$target +} + +# ---------------------------------------------------------------------------- +# configure +# ---------------------------------------------------------------------------- + +do_configure() { + local target=$1 + builder_start_action configure:$target || return 0 + + local STANDARD_MESON_ARGS="$MESON_OPTION_keyman_core_tests --default-library both" + local MESON_CROSS_FILE= + + if [[ -f "$THIS_SCRIPT_PATH/cross-$target.build" ]]; then + MESON_CROSS_FILE="--cross-file cross-$target.build" + fi + + builder_heading "======= Configuring $target =======" + + if [[ $target == wasm ]]; then + # do_configure_wasm + locate_emscripten + build_meson_cross_file_for_wasm + STANDARD_MESON_ARGS="$STANDARD_MESON_ARGS --cross-file wasm.defs.build --cross-file wasm.build --default-library static" + fi + + if [[ $target =~ ^(x86|x64)$ ]]; then + cmd //C build.bat $target $BUILDER_CONFIGURATION configure $BUILD_BAT_keyman_core_tests "${builder_extra_params[@]}" + else + pushd "$THIS_SCRIPT_PATH" > /dev/null + # Additional arguments are used by Linux build, e.g. -Dprefix=${INSTALLDIR} + meson setup "$MESON_PATH" $MESON_CROSS_FILE --werror --buildtype $BUILDER_CONFIGURATION $STANDARD_MESON_ARGS "${builder_extra_params[@]}" + popd > /dev/null + fi + + builder_finish_action success configure:$target +} + +# ---------------------------------------------------------------------------- +# build +# ---------------------------------------------------------------------------- + +do_build() { + local target=$1 + builder_start_action build:$target || return 0 + if [[ $target =~ ^(x86|x64)$ ]]; then + cmd //C build.bat $target $BUILDER_CONFIGURATION build "${builder_extra_params[@]}" + elif $MESON_LOW_VERSION; then + pushd "$MESON_PATH" > /dev/null + ninja + popd + else + meson compile -C "$MESON_PATH" + fi + builder_finish_action success build:$target +} + +# ---------------------------------------------------------------------------- +# test +# ---------------------------------------------------------------------------- + +do_test() { + local target=$1 + builder_start_action test:$target || return 0 + if [[ $target =~ ^(x86|x64)$ ]]; then + cmd //C build.bat $target $BUILDER_CONFIGURATION test "${builder_extra_params[@]}" + else + meson test -C "$MESON_PATH" "${builder_extra_params[@]}" + fi + builder_finish_action success test:$target +} + +# ---------------------------------------------------------------------------- +# install and uninstall +# ---------------------------------------------------------------------------- + +do_install() { + local target=$1 + builder_start_action install:$target || return 0 + if $MESON_LOW_VERSION; then + pushd "$MESON_PATH" > /dev/null + ninja install + popd > /dev/null + else + meson install -C "$MESON_PATH" + fi + builder_finish_action success install:$target +} + +do_uninstall() { + local target=$1 + builder_start_action uninstall:$target || return 0 + pushd "$MESON_PATH" > /dev/null + # Note: there is no meson uninstall command, which means + # this probably won't work on Windows + ninja uninstall + popd > /dev/null + builder_finish_action success uninstall:$target +} + +# ---------------------------------------------------------------------------- +# utility functions +# ---------------------------------------------------------------------------- + +# +# We don't want to rely on emcc being on the path, because Emscripten puts far +# too many things onto the path (in particular for us, node). +# +# The following comment suggests that we don't need emcc on the path. +# https://github.com/emscripten-core/emscripten/issues/4848#issuecomment-1097357775 +# +# So we try and locate emcc in common locations ourselves. The search pattern +# is: +# +# 1. Look for $EMSCRIPTEN_BASE (our primary emscripten variable), which should +# point to the folder that emcc is located in +# 2. Look for $EMCC which should point to the emcc executable +# 3. Look for emcc on the path +# +locate_emscripten() { + if [[ -z ${EMSCRIPTEN_BASE+x} ]]; then + if [[ -z ${EMCC+x} ]]; then + local EMCC=`which emcc` + [[ -z $EMCC ]] && builder_die "locate_emscripten: Could not locate emscripten (emcc) on the path or with \$EMCC or \$EMSCRIPTEN_BASE" + fi + [[ -x $EMCC ]] || builder_die "locate_emscripten: Variable EMCC ($EMCC) does not point to a valid executable emcc" + EMSCRIPTEN_BASE="$(dirname "$EMCC")" + fi + + [[ -x ${EMSCRIPTEN_BASE}/emcc ]] || builder_die "locate_emscripten: Variable EMSCRIPTEN_BASE ($EMSCRIPTEN_BASE) does not point to emcc's folder" +} + +build_meson_cross_file_for_wasm() { + if [ $BUILDER_OS == win ]; then + local R=$(cygpath -w $(echo $EMSCRIPTEN_BASE) | sed 's_\\_\\\\_g') + else + local R=$(echo $EMSCRIPTEN_BASE | sed 's_/_\\/_g') + fi + sed -e "s/\$EMSCRIPTEN_BASE/$R/g" wasm.build.$BUILDER_OS.in > wasm.build +} + +# +# Remove Visual Studio from the path so that meson goes looking for it rather than +# assuming that it's all available. If we don't do this, we get an error with link.exe: +# +# meson.build:8:0: ERROR: Found GNU link.exe instead of MSVC link.exe in C:\Program Files\Git\usr\bin\link.EXE. +# This link.exe is not a linker. +# You may need to reorder entries to your %PATH% variable to resolve this. +# + +cleanup_visual_studio_path() { + local _split_path _new_path="" + IFS=':' read -ra _split_path <<<"$PATH" + for p in "${_split_path[@]}"; do + if ! [[ $p =~ Visual\ Studio ]]; then + _new_path="$_new_path:$p" + fi + done + PATH="${_new_path:1}" + unset VSINSTALLDIR +} diff --git a/core/cross-mac-arm64.build b/core/cross-mac-arm64.build new file mode 100644 index 0000000000000000000000000000000000000000..720e9f31007b1cd60414791c6a73dca9f42913fd --- /dev/null +++ b/core/cross-mac-arm64.build @@ -0,0 +1,16 @@ +[host_machine] +system = 'darwin' +cpu_family = 'aarch64' +cpu = 'arm64' +endian = 'little' + +[binaries] +c = ['clang', '-arch', 'arm64'] +objc = ['clang', '-arch', 'arm64'] +cpp = ['clang++', '-arch', 'arm64'] +ar = 'ar' +ld = 'ld' +strip = 'strip' +lipo = 'lipo' +ranlib = 'ranlib' +pkgconfig = 'pkg-config' diff --git a/core/cross-mac-x86_64.build b/core/cross-mac-x86_64.build new file mode 100644 index 0000000000000000000000000000000000000000..2ab2c62a600f3f552f30a93d807dad22594e716d --- /dev/null +++ b/core/cross-mac-x86_64.build @@ -0,0 +1,16 @@ +[host_machine] +system = 'darwin' +cpu_family = 'x86_64' +cpu = 'x86_64' +endian = 'little' + +[binaries] +c = ['clang', '-arch', 'x86_64'] +objc = ['clang', '-arch', 'x86_64'] +cpp = ['clang++', '-arch', 'x86_64'] +ar = 'ar' +ld = 'ld' +strip = 'strip' +lipo = 'lipo' +ranlib = 'ranlib' +pkgconfig = 'pkg-config' diff --git a/core/getversion.sh b/core/getversion.sh index 294d292445307b334e2b82ee0d918a8c15b8cf87..4d436285a3540dee3cd17c6d773c931a01b8f561 100755 --- a/core/getversion.sh +++ b/core/getversion.sh @@ -1,7 +1,3 @@ #!/usr/bin/env bash # Get the version number from VERSION.md -# When building from a Linux source package, `VERSION.md` is in the -# same directory as this script. -VERSIONFILE=VERSION.md -[ -f ../VERSION.md ] && VERSIONFILE=../VERSION.md -cat $VERSIONFILE +cat ../VERSION.md diff --git a/core/include/keyman/keyboardprocessor.h b/core/include/keyman/keyboardprocessor.h index 6ea047035063015fb8ba9cc76e615985fa7a277c..3513cdede2e88223e47ada46547975b3d3bc856a 100644 --- a/core/include/keyman/keyboardprocessor.h +++ b/core/include/keyman/keyboardprocessor.h @@ -1041,6 +1041,13 @@ enum km_kbp_tech_value { KM_KBP_TECH_LDML = 1 << 2 }; +/** + * Bit flags to be used with the event_flags parameter of km_kbp_process_event + */ +enum km_kbp_event_flags { + KM_KBP_EVENT_FLAG_DEFAULT = 0, // default value: hardware + KM_KBP_EVENT_FLAG_TOUCH = 1, // set if the event is touch, otherwise hardware +}; /* ``` @@ -1081,6 +1088,7 @@ state is passed. - __modifier_state__: The combinations of modifier keys set at the time key `vk` was pressed, bitmask from the `km_kbp_modifier_state` enum. +- __event_flags__: Event level flags, see km_kbp_event_flags ```c */ @@ -1089,7 +1097,8 @@ km_kbp_status km_kbp_process_event(km_kbp_state *state, km_kbp_virtual_key vk, uint16_t modifier_state, - uint8_t is_key_down); + uint8_t is_key_down, + uint16_t event_flags); /* ``` diff --git a/core/include/ldml/.gitignore b/core/include/ldml/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..3e39f0a46057108fc9ac9aea84353f11290a6582 --- /dev/null +++ b/core/include/ldml/.gitignore @@ -0,0 +1 @@ +ldml-const-builder/ \ No newline at end of file diff --git a/core/include/ldml/build.sh b/core/include/ldml/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..2f4b76ab8edd3591119689609dd8a65aa63b4c8a --- /dev/null +++ b/core/include/ldml/build.sh @@ -0,0 +1,73 @@ +#!/usr/bin/env bash +# +# Packages the @keymanapp/ldml-keyboard-constants package. +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +cd "$THIS_SCRIPT_PATH" + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +builder_describe "Build Keyman ldml-keyboard-constants package" \ + "@/common/web/keyman-version" \ + "clean" \ + "configure" \ + "build" \ + "test" \ + "pack build a local .tgz pack for testing" \ + "publish publish to npm" \ + "--dry-run,-n don't actually publish, just dry run" + +builder_describe_outputs \ + configure /node_modules \ + build /core/include/ldml/build/keyboardprocessor_ldml.js + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action clean; then + rm -rf ./build/ + builder_finish_action success clean +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action configure; then + verify_npm_setup + builder_finish_action success configure +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action build; then + tsc --build + builder_finish_action success build +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action test; then + # no tests at this time + builder_finish_action success test +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action publish; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_npm + builder_finish_action success publish +elif builder_start_action pack; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_pack + builder_finish_action success pack +fi diff --git a/core/include/ldml/keyboardprocessor_ldml.h b/core/include/ldml/keyboardprocessor_ldml.h new file mode 100644 index 0000000000000000000000000000000000000000..2922a8fb033995a7184f7804812437957d4336b6 --- /dev/null +++ b/core/include/ldml/keyboardprocessor_ldml.h @@ -0,0 +1,122 @@ + +/* + Copyright: Copyright (C) 2022-2023 SIL International. + Authors: srl295 + This file provides constants for the KMX Plus (LDML support) binary format, + to be shared between TypeScript and C++ via the generator (below) +*/ + +// +// Generated File - do not edit +// +// This file is generated by core/tools/ldml-const-builder/build.sh +// based on core/include/ldml/keyboardprocessor_ldml.ts +// + +#pragma once + +#define LDML_BKSP_FLAGS_ERROR 0x1 +#define LDML_CLDR_IMPLIED_KEYS_IMPORT "techpreview/keys-Latn-implied.xml" +#define LDML_CLDR_IMPORT_BASE "cldr" +#define LDML_CLDR_VERSION_LATEST "techpreview" +#define LDML_CLDR_VERSION_TECHPREVIEW "techpreview" +#define LDML_ELEM_FLAGS_ORDER_BITSHIFT 0x10 +#define LDML_ELEM_FLAGS_ORDER_MASK 0xFF0000 +#define LDML_ELEM_FLAGS_PREBASE 0x4 +#define LDML_ELEM_FLAGS_TERTIARY_BASE 0x2 +#define LDML_ELEM_FLAGS_TERTIARY_BITSHIFT 0x18 +#define LDML_ELEM_FLAGS_TERTIARY_MASK 0xFF000000 +#define LDML_ELEM_FLAGS_UNICODE_SET 0x1 +#define LDML_FINL_FLAGS_ERROR 0x1 +#define LDML_KEYS_FLICK_FLAGS_EXTEND 0x1 +#define LDML_KEYS_KEY_FLAGS_EXTEND 0x1 +#define LDML_KEYS_KEY_FLAGS_GAP 0x2 +#define LDML_KEYS_KEY_FLAGS_NOTRANSFORM 0x4 +#define LDML_KEYS_MOD_ALL 0x17F +#define LDML_KEYS_MOD_ALT 0x40 +#define LDML_KEYS_MOD_ALTL 0x4 +#define LDML_KEYS_MOD_ALTR 0x8 +#define LDML_KEYS_MOD_CAPS 0x100 +#define LDML_KEYS_MOD_CTRL 0x20 +#define LDML_KEYS_MOD_CTRLL 0x1 +#define LDML_KEYS_MOD_CTRLR 0x2 +#define LDML_KEYS_MOD_NONE 0x0 +#define LDML_KEYS_MOD_SHIFT 0x10 +#define LDML_LAYR_LIST_HARDWARE_ABNT2 0x1 +#define LDML_LAYR_LIST_HARDWARE_ISO 0x2 +#define LDML_LAYR_LIST_HARDWARE_JIS 0x3 +#define LDML_LAYR_LIST_HARDWARE_TOUCH 0x0 +#define LDML_LAYR_LIST_HARDWARE_US 0x4 +#define LDML_LENGTH_BKSP 0xC +#define LDML_LENGTH_BKSP_ITEM 0x10 +#define LDML_LENGTH_DISP 0x10 +#define LDML_LENGTH_DISP_ITEM 0x8 +#define LDML_LENGTH_ELEM 0xC +#define LDML_LENGTH_ELEM_ITEM 0x8 +#define LDML_LENGTH_ELEM_ITEM_ELEMENT 0x8 +#define LDML_LENGTH_FINL 0x8 +#define LDML_LENGTH_FINL_ITEM 0x10 +#define LDML_LENGTH_HEADER 0x8 +#define LDML_LENGTH_KEYS 0x18 +#define LDML_LENGTH_KEYS_FLICK_ELEMENT 0xC +#define LDML_LENGTH_KEYS_FLICK_LIST 0xC +#define LDML_LENGTH_KEYS_KEY 0x24 +#define LDML_LENGTH_KEYS_KMAP 0xC +#define LDML_LENGTH_LAYR 0x18 +#define LDML_LENGTH_LAYR_ENTRY 0x10 +#define LDML_LENGTH_LAYR_KEY 0x4 +#define LDML_LENGTH_LAYR_LIST 0x10 +#define LDML_LENGTH_LAYR_ROW 0x8 +#define LDML_LENGTH_LIST 0x10 +#define LDML_LENGTH_LIST_INDEX 0x4 +#define LDML_LENGTH_LIST_ITEM 0x8 +#define LDML_LENGTH_LOCA 0xC +#define LDML_LENGTH_LOCA_ITEM 0x4 +#define LDML_LENGTH_META 0x24 +#define LDML_LENGTH_NAME 0xC +#define LDML_LENGTH_NAME_ITEM 0x4 +#define LDML_LENGTH_ORDR 0xC +#define LDML_LENGTH_ORDR_ITEM 0x8 +#define LDML_LENGTH_SECT 0x10 +#define LDML_LENGTH_SECT_ITEM 0x8 +#define LDML_LENGTH_STRS 0xC +#define LDML_LENGTH_STRS_ITEM 0x8 +#define LDML_LENGTH_TRAN 0xC +#define LDML_LENGTH_TRAN_ITEM 0x10 +#define LDML_LENGTH_VKEY 0xC +#define LDML_LENGTH_VKEY_ITEM 0x8 +#define LDML_META_SETTINGS_FALLBACK_OMIT 0x1 +#define LDML_META_SETTINGS_TRANSFORMFAILURE_OMIT 0x2 +#define LDML_META_SETTINGS_TRANSFORMPARTIAL_HIDE 0x4 +#define LDML_SECTIONID_BKSP 0x70736B62 /* "bksp" */ +#define LDML_SECTIONNAME_BKSP "bksp" +#define LDML_SECTIONID_DISP 0x70736964 /* "disp" */ +#define LDML_SECTIONNAME_DISP "disp" +#define LDML_SECTIONID_ELEM 0x6D656C65 /* "elem" */ +#define LDML_SECTIONNAME_ELEM "elem" +#define LDML_SECTIONID_FINL 0x6C6E6966 /* "finl" */ +#define LDML_SECTIONNAME_FINL "finl" +#define LDML_SECTIONID_KEYS 0x7379656B /* "keys" */ +#define LDML_SECTIONNAME_KEYS "keys" +#define LDML_SECTIONID_LAYR 0x7279616C /* "layr" */ +#define LDML_SECTIONNAME_LAYR "layr" +#define LDML_SECTIONID_LIST 0x7473696C /* "list" */ +#define LDML_SECTIONNAME_LIST "list" +#define LDML_SECTIONID_LOCA 0x61636F6C /* "loca" */ +#define LDML_SECTIONNAME_LOCA "loca" +#define LDML_SECTIONID_META 0x6174656D /* "meta" */ +#define LDML_SECTIONNAME_META "meta" +#define LDML_SECTIONID_NAME 0x656D616E /* "name" */ +#define LDML_SECTIONNAME_NAME "name" +#define LDML_SECTIONID_ORDR 0x7264726F /* "ordr" */ +#define LDML_SECTIONNAME_ORDR "ordr" +#define LDML_SECTIONID_SECT 0x74636573 /* "sect" */ +#define LDML_SECTIONNAME_SECT "sect" +#define LDML_SECTIONID_STRS 0x73727473 /* "strs" */ +#define LDML_SECTIONNAME_STRS "strs" +#define LDML_SECTIONID_TRAN 0x6E617274 /* "tran" */ +#define LDML_SECTIONNAME_TRAN "tran" +#define LDML_SECTIONID_VKEY 0x79656B76 /* "vkey" */ +#define LDML_SECTIONNAME_VKEY "vkey" +#define LDML_TRAN_FLAGS_ERROR 0x1 +#define LDML_VERSION "1.0" diff --git a/core/include/ldml/keyboardprocessor_ldml.ts b/core/include/ldml/keyboardprocessor_ldml.ts new file mode 100644 index 0000000000000000000000000000000000000000..db9ef7a41ff4637177512b4f71a4c37f09cf1b27 --- /dev/null +++ b/core/include/ldml/keyboardprocessor_ldml.ts @@ -0,0 +1,566 @@ +/* + Copyright: Copyright (C) 2022 SIL International. + Authors: srl295, mcdurdin + This file provides constants for the KMX Plus (LDML support) binary format, + to be shared between TypeScript and C++ via the generator (below) +*/ + + +// NOTICE! +// +// If you update this file, you *must* be sure to re-run +// +// core/tools/ldml-const-builder/build.sh clean build run +// +// To update keyboardprocessor_ldml.h, and commit the result. +// +// It is not updated automatically. + + +/** + * Defines the section identifiers and ensures that we include each and every + * one of them in the `sections` block and gives us a type which we can iterate + * through. + */ +export type SectionIdent = +// Keep this sorted, but with `sect` as the first entry. + 'sect' | + 'bksp' | + 'disp' | + 'elem' | + 'finl' | + 'keys' | + 'layr' | + 'list' | + 'loca' | + 'meta' | + 'name' | + 'ordr' | + 'strs' | + 'tran' | + 'vkey'; + + +type SectionMap = { + [id in SectionIdent]: SectionIdent; +} + +// TODO-LDML: namespace com.keyman.core.ldml { +/** + * Constants for the KMXPlus data format + * These are shared between the data access layer and the compiler. + * Note that the section IDs (section_keys etc.) are 32 bit hex + * values that are designed to appear as text when written in little endian + * format, so 0x7379656b = 'keys' + */ +class Constants { + /** + * The version of the LDML processor + */ + readonly version = '1.0'; + /** + * The techpreview CLDR version + */ + readonly cldr_version_techpreview = 'techpreview'; + /** + * The latest CLDR version + */ + readonly cldr_version_latest = this.cldr_version_techpreview; + /** + * import base + */ + readonly cldr_import_base = 'cldr'; + /** + * implied keys file + */ + readonly cldr_implied_keys_import = `${this.cldr_version_techpreview}/keys-Latn-implied.xml`; + /** + * Length of a raw section header, in bytes + */ + readonly length_header = 8; + + /* ------------------------------------------------------------------ + * sect section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'sect' section, not including entries + */ + readonly length_sect = 16; + /** + * Length of each item in the 'sect' section variable part + */ + readonly length_sect_item = 8; + + /* ------------------------------------------------------------------ + * bksp section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'bksp' section, not including entries + */ + readonly length_bksp = 12; + /** + * Length of each item in the 'bksp' section variable part + */ + readonly length_bksp_item = 16; + /** + * bitwise or value for error="fail" in transform + */ + readonly bksp_flags_error = 0x0001; + + /* ------------------------------------------------------------------ + * disp section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'disp' section, not including entries + */ + readonly length_disp = 16; + /** + * Length of each entry in the 'disp' variable part + */ + readonly length_disp_item = 8; + + /* ------------------------------------------------------------------ + * elem section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'elem' section, not including entries + */ + readonly length_elem = 12; + /** + * Length of each elem string in the 'elem' section variable part + */ + readonly length_elem_item = 8; + /** + * Length of each element in an elem string + */ + readonly length_elem_item_element = 8; + + /** + * bitwise or value for unicode_set in elem[elemstr][element].flags. + * If bit is 1, then 'element' is a UnicodeSet string. + * If bit is 0, then 'element' is a UTF-32LE codepoint + * + * `unicode_set = flags & elem_flags_unicode_set` + */ + readonly elem_flags_unicode_set = 0x00000001; + + /** + * bitwise or value for tertiary_base in elem[elemstr][element].flags. + * If bit is 1, then tertiary_base is true. + * If bit is 0, then tertiary_base is false. + * + * Used only for `ordr`-type element strings. + * + * `tertiary_base = flags & elem_flags_tertiary_base` + */ + readonly elem_flags_tertiary_base = 0x00000002; + + /** + * bitwise or value for tertiary_base in elem[elemstr][element].flags. + * If bit is 1, then prebase is true. + * If bit is 0, then prebase is false. + * + * Used only for `ordr`-type element strings. + * + * `prebase = flags & elem_flags_prebase` + */ + readonly elem_flags_prebase = 0x00000004; + + /** + * bitwise mask for order in elem[elemstr][element].flags. + * + * Used only for `ordr`-type element strings. 1 byte signed integer. + * + * `order = (flags & elem_flags_order_mask) >> elem_flags_order_bitshift` + */ + readonly elem_flags_order_mask = 0x00FF0000; + + /** + * bit shift for order in elem[elemstr][element].flags. + * + * Used only for `ordr`-type element strings. + * + * `order = (flags & elem_flags_order_mask) >> elem_flags_order_bitshift` + */ + readonly elem_flags_order_bitshift = 16; + + /** + * bitwise mask for tertiary sort in elem[elemstr][element].flags. + * + * Used only for `ordr`-type element strings. 1 byte signed integer. + * + * `tertiary = (flags & elem_flags_tertiary_mask) >> elem_flags_tertiary_bitshift` + */ + readonly elem_flags_tertiary_mask = 0xFF000000; + + /** + * bit shift for tertiary sort in elem[elemstr][element].flags. + * + * Used only for `ordr`-type element strings. 1 byte signed integer. + * + * `order = (flags & elem_flags_tertiary_mask) >> elem_flags_tertiary_bitshift` + */ + readonly elem_flags_tertiary_bitshift = 24; + + /* ------------------------------------------------------------------ + * finl section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'finl' section, not including entries + */ + readonly length_finl = 8; + /** + * Length of each item in the 'finl' section variable part + */ + readonly length_finl_item = 16; + /** + * bitwise or value for error="fail" in transform + */ + readonly finl_flags_error = 0x0001; + + /* ------------------------------------------------------------------ + * keys section is now keys.kmap + ------------------------------------------------------------------ */ + + /** + * Constant for no modifiers + */ + readonly keys_mod_none = 0x0000; + /** + * bitmask for Left Alt modifier key + */ + readonly keys_mod_altL = 0x0004; + /** + * bitmask for Right Alt (AltGr) modifier key + */ + readonly keys_mod_altR = 0x0008; + /** + * bitmask for either Alt (Windows) or Option (Apple) modifier keys + */ + readonly keys_mod_alt = 0x0040; + /** + * bitmask for Caps modifier key + */ + readonly keys_mod_caps = 0x0100; + /** + * bitmask for Left control modifier key + */ + readonly keys_mod_ctrlL = 0x0001; + /** + * bitmask for Right control modifier key + */ + readonly keys_mod_ctrlR = 0x0002; + /** + * bitmask for either Control modifier key + */ + readonly keys_mod_ctrl = 0x0020; + /** + * bitmask for either shift. + */ + readonly keys_mod_shift = 0x0010; + + /** + * Convenience map for modifiers + */ + readonly keys_mod_map: Map = new Map( + [ + ["none", this.keys_mod_none], + ["alt", this.keys_mod_alt], + ["altL", this.keys_mod_altL], + ["altR", this.keys_mod_altR], + ["caps", this.keys_mod_caps], + ["ctrl", this.keys_mod_ctrl], + ["ctrlL", this.keys_mod_ctrlL], + ["ctrlR", this.keys_mod_ctrlR], + ["shift", this.keys_mod_shift], + ] + ); + + /** + * a mask combining all valid modifier bits + */ + readonly keys_mod_all: number = Array.from(this.keys_mod_map.values()).reduce((p, v) => (p | v), this.keys_mod_none); + + /* ------------------------------------------------------------------ + * keys section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'keys' section not including variable parts + */ + readonly length_keys = 24; + /** + * Length of each item in the 'keys' keys sub-table + */ + readonly length_keys_key = 36; + /** + * Length of each item in the 'keys' flick lists sub-table + */ + readonly length_keys_flick_list = 12; + /** + * Length of each item in the 'keys' flick elements sub-table + */ + readonly length_keys_flick_element = 12; + /** + * Length of each item in the 'keys.kmap' key map subtable + */ + readonly length_keys_kmap = 12; + + /** + * 0 if to is a char, 1 if it is a string + */ + readonly keys_key_flags_extend = 0x00000001; + + /** + * 1 if the key is a gap + */ + readonly keys_key_flags_gap = 0x00000002; + + /** + * 1 if the key is transform=no + */ + readonly keys_key_flags_notransform = 0x00000004; + + /** + * 0 if to is a char, 1 if it is a string + */ + readonly keys_flick_flags_extend = 0x00000001; + + /* ------------------------------------------------------------------ + * layr section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'layr' section not including variable parts + */ + readonly length_layr = 24; + /** + * Length of each layer list in the 'layr' section variable part + */ + readonly length_layr_list = 16; + /** + * for the 'hardware' field indicating a touch keyboard, non-hardware + */ + readonly layr_list_hardware_touch = 0; + /** + * for the 'hardware' field indicating an abnt2 layout + */ + readonly layr_list_hardware_abnt2 = 1; + /** + * for the 'hardware' field indicating an iso layout + */ + readonly layr_list_hardware_iso = 2; + /** + * for the 'hardware' field indicating a jis layout + */ + readonly layr_list_hardware_jis = 3; + /** + * for the 'hardware' field indicating a us layout + */ + readonly layr_list_hardware_us = 4; + /** + * Convenience map of layr_list_hardware field values + */ + readonly layr_list_hardware_map: Map = new Map( + [ + ["touch", this.layr_list_hardware_touch], + ["abnt2", this.layr_list_hardware_abnt2], + ["iso", this.layr_list_hardware_iso], + ["jis", this.layr_list_hardware_jis], + ["us", this.layr_list_hardware_us], + ] + ); + /** + * Length of each layer entry in the 'layr' section variable part + */ + readonly length_layr_entry = 16; + /** + * Length of each row entry in the 'layr' section variable part + */ + readonly length_layr_row = 8; + /** + * Length of each key entry in the 'layr' section variable part + */ + readonly length_layr_key = 4; + + /* ------------------------------------------------------------------ + * list section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'list' section not including variable parts + */ + readonly length_list = 16; + /** + * Length of each list item in the 'list' list section variable part + */ + readonly length_list_item = 8; + /** + * Length of each list item in the 'list' indices section variable part + */ + readonly length_list_index = 4; + + /* ------------------------------------------------------------------ + * loca section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'loca' section not including variable parts + */ + readonly length_loca = 12; + /** + * Length of each item in the 'loca' section variable part + */ + readonly length_loca_item = 4; + + /* ------------------------------------------------------------------ + * meta section + ------------------------------------------------------------------ */ + + /** + * length of the 'meta' section + */ + readonly length_meta = 36; + /** + * bitwise or value for fallback=omit in meta.settings + */ + readonly meta_settings_fallback_omit = 1; + /** + * bitwise or value for transformFailure=omit in meta.settings + */ + readonly meta_settings_transformFailure_omit = 2; + /** + * bitwise or value for transformPartial=hide in meta.settings + */ + readonly meta_settings_transformPartial_hide = 4; + + /* ------------------------------------------------------------------ + * name section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'name' section not including variable parts + */ + readonly length_name = 12; + /** + * Length of each item in the 'name' section variable part + */ + readonly length_name_item = 4; + + /* ------------------------------------------------------------------ + * ordr section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'ordr' section, not including entries + */ + readonly length_ordr = 12; + /** + * Length of each item in the 'ordr' section variable part + */ + readonly length_ordr_item = 8; + + /* ------------------------------------------------------------------ + * strs section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'strs' section not including variable parts + */ + readonly length_strs = 12; + /** + * Length of each item in the 'strs' section variable part + */ + readonly length_strs_item = 8; + + /* ------------------------------------------------------------------ + * tran section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'tran' section, not including entries + */ + readonly length_tran = 12; + /** + * Length of each item in the 'tran' section variable part + */ + readonly length_tran_item = 16; + /** + * bitwise or value for error="fail" in transform + */ + readonly tran_flags_error = 0x0001; + + /* ------------------------------------------------------------------ + * vkey section + ------------------------------------------------------------------ */ + + /** + * Minimum length of the 'vkey' section not including variable parts + */ + readonly length_vkey = 12; + /** + * Length of each item in the 'vkey' section variable part + */ + readonly length_vkey_item = 8; + + /** + * All section IDs. + */ + readonly section: SectionMap = { + // keep this sorted + bksp: 'bksp', + disp: 'disp', + elem: 'elem', + finl: 'finl', + keys: 'keys', + layr: 'layr', + list: 'list', + loca: 'loca', + meta: 'meta', + name: 'name', + ordr: 'ordr', + sect: 'sect', + strs: 'strs', + tran: 'tran', + vkey: 'vkey', + }; + + /** + * Use to convert 4-char string into hex + * @param id section id such as 'sect' + * @returns hex ID such as 0x74636573 + */ + hex_section_id(id:string) { + if(!id || typeof id !== 'string' || !id.match(/^[a-z0-9]{4}$/)) { + throw Error(`hex_section_id(${id}) - need a 4-character alphanumeric lower-case string`); + } + let r = 0; + for (let i = 3; i>=0; i--) { + r = (r << 8 | id.charCodeAt(i)); + } + return r; + }; + + /** + * Use to convert hex into 4-char string + * @param hex section ID such as 0x74636573 + * @returns string such as 'sect' + */ + str_section_id(hex:number) : string { + let chars : string[] = []; + for (let i = 3; i>=0; i--) { + chars.push(String.fromCharCode(hex & 0xFF)); + hex >>= 8; + } + return chars.join(''); + } +}; + +export const constants = new Constants(); + +// } diff --git a/core/include/ldml/ldml-const-builder.ts b/core/include/ldml/ldml-const-builder.ts new file mode 100644 index 0000000000000000000000000000000000000000..c08e74dddc6761a79ddc7b415974dc6b5ee3a489 --- /dev/null +++ b/core/include/ldml/ldml-const-builder.ts @@ -0,0 +1,65 @@ +/* + Copyright: Copyright (C) 2022 SIL International. + Authors: srl295 + This tool generates a .h version of the keyboardprocessor_ldml.ts file +*/ + +import { constants } from './keyboardprocessor_ldml.js'; + +const keys = Object.keys(constants); +keys.sort(); +console.log(` +/* + Copyright: Copyright (C) 2022-2023 SIL International. + Authors: srl295 + This file provides constants for the KMX Plus (LDML support) binary format, + to be shared between TypeScript and C++ via the generator (below) +*/ + +// +// Generated File - do not edit +// +// This file is generated by core/tools/ldml-const-builder/build.sh +// based on core/include/ldml/keyboardprocessor_ldml.ts +// + +#pragma once +`); + +let errs = 0; + +for (const key of keys) { + const value: any = constants[key as keyof typeof constants]; + const upkey = key.toUpperCase(); + const type = typeof value; + if (type === 'number') { + console.log(`#define LDML_${upkey} 0x${value.toString(16).toUpperCase()}`); + } else if (type === 'string') { + console.log(`#define LDML_${upkey} "${value}"`); + } else if (key === 'section') { + // handle section table + const subkeys = Object.keys(value); + subkeys.sort(); + for (const subkey of subkeys) { + const upsubkey = subkey.toUpperCase(); + const subvalue = value[subkey]; + if (subvalue !== subkey) { + // "can't happen" because tsc would complain + console.error(`In the SectionMap: ${subkey}: '${subvalue}' - expected key and value to match.`); + errs++; + } + const asnum = constants.hex_section_id(subkey); + console.log(`#define LDML_${upkey}ID_${upsubkey} 0x${asnum.toString(16).toUpperCase()} /* "${subkey}" */`); + console.log(`#define LDML_${upkey}NAME_${upsubkey} "${subkey}"`); + } + } else if (key.endsWith('_map') || type === 'function') { + // ignored + } else { + console.error(`Don’t know what to do with constants[${key}] of type ${type}`); + errs++; + } +} + +if (errs != 0) { + throw Error(`Fail: ${errs} error(s), see above.`); +} diff --git a/core/include/ldml/package.json b/core/include/ldml/package.json new file mode 100644 index 0000000000000000000000000000000000000000..76da479930bbbb520111e5f8076f50a4829ca59e --- /dev/null +++ b/core/include/ldml/package.json @@ -0,0 +1,20 @@ +{ + "name": "@keymanapp/ldml-keyboard-constants", + "description": "Keyman LDML keyboard constants", + "keywords": [ + "keyboard", + "keyman", + "ldml", + "unicode" + ], + "files": [ + "/build/keyboardprocessor_ldml.*" + ], + "license": "MIT", + "type": "module", + "main": "build/keyboardprocessor_ldml.js", + "repository": { + "type": "git", + "url": "git+https://github.com/keymanapp/keyman.git" + } +} diff --git a/core/include/ldml/tsconfig.build.json b/core/include/ldml/tsconfig.build.json new file mode 100644 index 0000000000000000000000000000000000000000..17c809a857abf413c134c879e1d297417e245007 --- /dev/null +++ b/core/include/ldml/tsconfig.build.json @@ -0,0 +1,16 @@ +{ + "extends": "../../../tsconfig.esm-base.json", + "compilerOptions": { + "composite": true, + "declaration": true, + "rootDir": ".", + "outDir": "ldml-const-builder/", + }, + "exclude": [ + "node_modules" + ], + "files": [ + "keyboardprocessor_ldml.ts", + "ldml-const-builder.ts" + ] +} diff --git a/core/include/ldml/tsconfig.json b/core/include/ldml/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..b89c96a01812a63618ae93d6b32d6873d768753a --- /dev/null +++ b/core/include/ldml/tsconfig.json @@ -0,0 +1,17 @@ +{ + "extends": "../../../tsconfig-base.json", + "compilerOptions": { + "composite": true, + "declaration": true, + "module": "es2020", + "moduleResolution": "node", + "rootDir": ".", + "outDir": "build/", + }, + "exclude": [ + "node_modules" + ], + "files": [ + "keyboardprocessor_ldml.ts" + ] +} diff --git a/core/meson.build b/core/meson.build index 5f530aae3ddfed3c82beec9a36f6bf3e77c4774e..81d994124c466e7d7a1f932fae32b1ef62b30f4e 100644 --- a/core/meson.build +++ b/core/meson.build @@ -6,7 +6,7 @@ # project('keyboardprocessor', 'cpp', 'c', - version: run_command(find_program('getversion.bat', 'getversion.sh')).stdout().strip(), + version: run_command(find_program('getversion.bat', 'getversion.sh'), check:true).stdout().strip(), license: 'MIT', default_options : ['buildtype=release', 'cpp_std=c++14', @@ -14,29 +14,26 @@ project('keyboardprocessor', 'cpp', 'c', 'warning_level=2'], meson_version: '>=0.53.0') -compiler = meson.get_compiler('cpp') +# Import our standard compiler defines; this is copied from +# /resources/build/standard.meson.build by build.sh, because +# meson doesn't allow us to reference a file outside its root +subdir('resources') lib_version = '0.0.0' py = import('python') python = py.find_installation() -# Once we can assume meson 0.60 we can delete this -# (https://mesonbuild.com/Release-notes-for-0-60-0.html#msvc-compiler-now-assumes-utf8-source-code-by-default) -if compiler.get_id() == 'msvc' - add_global_arguments('/source-charset:utf-8', language: ['c', 'cpp']) -endif - -message('host_machine.system(): ' + host_machine.system()) -message('compiler.get_id(): ' + compiler.get_id()) - -cc = meson.get_compiler('c') - # TODO: Shared includes may use namespaces, etc which need future tidyup. # For now, we use KMN_KBP to inject the km::kbp::kmx namespace -defns = ['-DKMN_KBP'] +defns += ['-DKMN_KBP'] + +# #define DEBUG when we are on a debug build +if get_option('buildtype') == 'debug' + add_global_arguments('-DDEBUG', language : 'cpp') +endif subdir('doc') subdir('include') subdir('src') -subdir('tests') +subdir('tests') \ No newline at end of file diff --git a/core/meson_options.txt b/core/meson_options.txt new file mode 100644 index 0000000000000000000000000000000000000000..a4ef5ef3e54a98b9903c9228cb2f3e6a2cb7c7a6 --- /dev/null +++ b/core/meson_options.txt @@ -0,0 +1 @@ +option('keyman_core_tests', type: 'boolean', value: true) \ No newline at end of file diff --git a/core/src/debuglog.cpp b/core/src/debuglog.cpp new file mode 100644 index 0000000000000000000000000000000000000000..dc3dd95cd5986e3e7cadd171426254ad7da881ff --- /dev/null +++ b/core/src/debuglog.cpp @@ -0,0 +1,465 @@ +/* + Copyright: Copyright (C) 2003-2018 SIL International. + Authors: mcdurdin +*/ +#include +#include +#include +#include +#include "debuglog.h" + +namespace km { +namespace kbp { +namespace kmx { + +#define TAB "\t" +#define NL "\n" + +/** + * \def MEDIUM_BUF_SIZ not too big, not too small +*/ +#define MEDIUM_BUF_SIZ (128 * 7) + + +#ifdef _MSC_VER +#define _USE_WINDOWS +#endif + +#ifdef _USE_WINDOWS +#define DECLSPEC_IMPORT __declspec(dllimport) +#define WINBASEAPI DECLSPEC_IMPORT +#define VOID void +#define WINAPI __stdcall + +extern "C" +__declspec(dllimport) +void +__stdcall +OutputDebugStringA( + char *lpOutputString +); + +#else + #include +#endif + +const struct modifier_names s_modifier_names[] = { + {"LCTRL", 0x0001}, // Left Control flag + {"RCTRL", 0x0002}, // Right Control flag + {"LALT", 0x0004}, // Left Alt flag + {"RALT", 0x0008}, // Right Alt flag + {"SHIFT", 0x0010}, // Either shift flag + {"CTRL-do-not-use", 0x0020}, // Either ctrl flag -- don't use this for inputs + {"ALT-do-not-use", 0x0040}, // Either alt flag -- don't use this for inputs + {"CAPS", 0x0100}, // Caps lock on + {"NCAPS", 0x0200}, // Caps lock NOT on + {"NUMLOCK", 0x0400}, // Num lock on + {"NNUMLOCK", 0x0800}, // Num lock NOT on + {"SCROLL", 0x1000}, // Scroll lock on + {"NSCROLL", 0x2000}, // Scroll lock NOT on + {NULL, 0} +}; + +const char *s_key_names[] = { + // Key Codes + "K_?00", // &H0 + "K_LBUTTON", // &H1 + "K_RBUTTON", // &H2 + "K_CANCEL", // &H3 + "K_MBUTTON", // &H4 + "K_?05", // &H5 + "K_?06", // &H6 + "K_?07", // &H7 + "K_BKSP", // &H8 + "K_TAB", // &H9 + "K_?0A", // &HA + "K_?0B", // &HB + "K_KP5", // &HC + "K_ENTER", // &HD + "K_?0E", // &HE + "K_?0F", // &HF + "K_SHIFT", // &H10 + "K_CONTROL", // &H11 + "K_ALT", // &H12 + "K_PAUSE", // &H13 + "K_CAPS", // &H14 + "K_KANJI?15", // &H15 + "K_KANJI?16", // &H16 + "K_KANJI?17", // &H17 + "K_KANJI?18", // &H18 + "K_KANJI?19", // &H19 + "K_?1A", // &H1A + "K_ESC", // &H1B + "K_KANJI?1C", // &H1C + "K_KANJI?1D", // &H1D + "K_KANJI?1E", // &H1E + "K_KANJI?1F", // &H1F + "K_SPACE", // &H20 + "K_PGUP", // &H21 + "K_PGDN", // &H22 + "K_END", // &H23 + "K_HOME", // &H24 + "K_LEFT", // &H25 + "K_UP", // &H26 + "K_RIGHT", // &H27 + "K_DOWN", // &H28 + "K_SEL", // &H29 + "K_PRINT", // &H2A + "K_EXEC", // &H2B + "K_PRTSCN", // &H2C + "K_INS", // &H2D + "K_DEL", // &H2E + "K_HELP", // &H2F + "K_0", // &H30 + "K_1", // &H31 + "K_2", // &H32 + "K_3", // &H33 + "K_4", // &H34 + "K_5", // &H35 + "K_6", // &H36 + "K_7", // &H37 + "K_8", // &H38 + "K_9", // &H39 + "K_?3A", // &H3A + "K_?3B", // &H3B + "K_?3C", // &H3C + "K_?3D", // &H3D + "K_?3E", // &H3E + "K_?3F", // &H3F + "K_?40", // &H40 + + "K_A", // &H41 + "K_B", // &H42 + "K_C", // &H43 + "K_D", // &H44 + "K_E", // &H45 + "K_F", // &H46 + "K_G", // &H47 + "K_H", // &H48 + "K_I", // &H49 + "K_J", // &H4A + "K_K", // &H4B + "K_L", // &H4C + "K_M", // &H4D + "K_N", // &H4E + "K_O", // &H4F + "K_P", // &H50 + "K_Q", // &H51 + "K_R", // &H52 + "K_S", // &H53 + "K_T", // &H54 + "K_U", // &H55 + "K_V", // &H56 + "K_W", // &H57 + "K_X", // &H58 + "K_Y", // &H59 + "K_Z", // &H5A + "K_?5B", // &H5B + "K_?5C", // &H5C + "K_?5D", // &H5D + "K_?5E", // &H5E + "K_?5F", // &H5F + "K_NP0", // &H60 + "K_NP1", // &H61 + "K_NP2", // &H62 + "K_NP3", // &H63 + "K_NP4", // &H64 + "K_NP5", // &H65 + "K_NP6", // &H66 + "K_NP7", // &H67 + "K_NP8", // &H68 + "K_NP9", // &H69 + "K_NPSTAR", // &H6A + "K_NPPLUS", // &H6B + "K_SEPARATOR", // &H6C + "K_NPMINUS", // &H6D + "K_NPDOT", // &H6E + "K_NPSLASH", // &H6F + "K_F1", // &H70 + "K_F2", // &H71 + "K_F3", // &H72 + "K_F4", // &H73 + "K_F5", // &H74 + "K_F6", // &H75 + "K_F7", // &H76 + "K_F8", // &H77 + "K_F9", // &H78 + "K_F10", // &H79 + "K_F11", // &H7A + "K_F12", // &H7B + "K_F13", // &H7C + "K_F14", // &H7D + "K_F15", // &H7E + "K_F16", // &H7F + "K_F17", // &H80 + "K_F18", // &H81 + "K_F19", // &H82 + "K_F20", // &H83 + "K_F21", // &H84 + "K_F22", // &H85 + "K_F23", // &H86 + "K_F24", // &H87 + + "K_?88", // &H88 + "K_?89", // &H89 + "K_?8A", // &H8A + "K_?8B", // &H8B + "K_?8C", // &H8C + "K_?8D", // &H8D + "K_?8E", // &H8E + "K_?8F", // &H8F + + "K_NUMLOCK", // &H90 + "K_SCROLL", // &H91 + + "K_?92", // &H92 + "K_?93", // &H93 + "K_?94", // &H94 + "K_?95", // &H95 + "K_?96", // &H96 + "K_?97", // &H97 + "K_?98", // &H98 + "K_?99", // &H99 + "K_?9A", // &H9A + "K_?9B", // &H9B + "K_?9C", // &H9C + "K_?9D", // &H9D + "K_?9E", // &H9E + "K_?9F", // &H9F + "K_?A0", // &HA0 + "K_?A1", // &HA1 + "K_?A2", // &HA2 + "K_?A3", // &HA3 + "K_?A4", // &HA4 + "K_?A5", // &HA5 + "K_?A6", // &HA6 + "K_?A7", // &HA7 + "K_?A8", // &HA8 + "K_?A9", // &HA9 + "K_?AA", // &HAA + "K_?AB", // &HAB + "K_?AC", // &HAC + "K_?AD", // &HAD + "K_?AE", // &HAE + "K_?AF", // &HAF + "K_?B0", // &HB0 + "K_?B1", // &HB1 + "K_?B2", // &HB2 + "K_?B3", // &HB3 + "K_?B4", // &HB4 + "K_?B5", // &HB5 + "K_?B6", // &HB6 + "K_?B7", // &HB7 + "K_?B8", // &HB8 + "K_?B9", // &HB9 + + "K_COLON", // &HBA + "K_EQUAL", // &HBB + "K_COMMA", // &HBC + "K_HYPHEN", // &HBD + "K_PERIOD", // &HBE + "K_SLASH", // &HBF + "K_BKQUOTE", // &HC0 + + "K_?C1", // &HC1 + "K_?C2", // &HC2 + "K_?C3", // &HC3 + "K_?C4", // &HC4 + "K_?C5", // &HC5 + "K_?C6", // &HC6 + "K_?C7", // &HC7 + "K_?C8", // &HC8 + "K_?C9", // &HC9 + "K_?CA", // &HCA + "K_?CB", // &HCB + "K_?CC", // &HCC + "K_?CD", // &HCD + "K_?CE", // &HCE + "K_?CF", // &HCF + "K_?D0", // &HD0 + "K_?D1", // &HD1 + "K_?D2", // &HD2 + "K_?D3", // &HD3 + "K_?D4", // &HD4 + "K_?D5", // &HD5 + "K_?D6", // &HD6 + "K_?D7", // &HD7 + "K_?D8", // &HD8 + "K_?D9", // &HD9 + "K_?DA", // &HDA + + "K_LBRKT", // &HDB + "K_BKSLASH", // &HDC + "K_RBRKT", // &HDD + "K_QUOTE", // &HDE + "K_oDF", // &HDF + "K_oE0", // &HE0 + "K_oE1", // &HE1 + "K_oE2", // &HE2 + "K_oE3", // &HE3 + "K_oE4", // &HE4 + + "K_?E5", // &HE5 + + "K_oE6", // &HE6 + + "K_?E7", // &HE7 + "K_?E8", // &HE8 + + "K_oE9", // &HE9 + "K_oEA", // &HEA + "K_oEB", // &HEB + "K_oEC", // &HEC + "K_oED", // &HED + "K_oEE", // &HEE + "K_oEF", // &HEF + "K_oF0", // &HF0 + "K_oF1", // &HF1 + "K_oF2", // &HF2 + "K_oF3", // &HF3 + "K_oF4", // &HF4 + "K_oF5", // &HF5 + + "K_?F6", // &HF6 + "K_?F7", // &HF7 + "K_?F8", // &HF8 + "K_?F9", // &HF9 + "K_?FA", // &HFA + "K_?FB", // &HFB + "K_?FC", // &HFC + "K_?FD", // &HFD + "K_?FE", // &HFE + "K_?FF" // &HFF +}; + +// simulation of Windows GetTickCount() +unsigned long +GetTickCount() +{ + using namespace std::chrono; + return (unsigned long) duration_cast(steady_clock::now().time_since_epoch()).count(); +} + +int DebugLog_1(const char *file, int line, const char *function, const char *fmt, ...) +{ + char fmtbuf[256]; + + va_list vars; + va_start(vars, fmt); + vsnprintf(fmtbuf, sizeof(fmtbuf) / sizeof(fmtbuf[0]), fmt, vars); // I2248 // I3547 + fmtbuf[255] = 0; + va_end(vars); + + if (!g_debug_KeymanLog) + return 0; + + char windowinfo[1024]; + snprintf(windowinfo, 1024, + "%ld" TAB //"TickCount" TAB + "%s:%d" TAB //"SourceFile" TAB + "%s" TAB //"Function" + "%s" NL, //"Message" + + GetTickCount(), //"TickCount" TAB + file, line, //"SourceFile" TAB + function, //"Function" TAB + fmtbuf); //"Message" + + if (g_debug_ToConsole) { // I3951 + ::std::cout << windowinfo << ::std::endl; // OutputDebugStringA(windowinfo); + } else { +#ifdef _USE_WINDOWS + ::std::cout << windowinfo << ::std::endl; // OutputDebugStringA(windowinfo); +#else + syslog(LOG_DEBUG, "%s", windowinfo); +#endif + } + + return 0; +} + +const char *Debug_ModifierName(KMX_UINT modifiers) { +#ifdef _MSC_VER + __declspec(thread) +#endif + static char buf[256]; + buf[0] = 0; + for(int i = 0; s_modifier_names[i].name; i++) + if (modifiers & s_modifier_names[i].modifier) { + strcat(buf, " "); + strcat(buf, s_modifier_names[i].name); + } + + if (*buf) return buf + 1; + return "Unmodified"; +} + +const char *Debug_VirtualKey(KMX_WORD vk) { +#ifdef _MSC_VER + __declspec(thread) +#endif + static char buf[256]; + if (!ShouldDebug()) { + return ""; + } + + if (vk < 256) { + snprintf(buf, 256, "['%s' 0x%x]", s_key_names[vk], vk); + } + else { + snprintf(buf, 256, "[0x%x]", vk); + } + return buf; +} + +const char *Debug_UnicodeString(PKMX_WCHAR s, int x) { + if (!ShouldDebug()) { + return ""; + } +#ifdef _MSC_VER + __declspec(thread) +#endif + static char bufout[2][MEDIUM_BUF_SIZ]; + KMX_WCHAR *p; + char *q; + bufout[x][0] = 0; + for (p = s, q = bufout[x]; *p && (p - s < 128); p++) + { + snprintf(q, MEDIUM_BUF_SIZ - (q - bufout[x]), "U+%4.4X ", *p); + q = strchr(q, 0); + } + //WideCharToMultiByte(CP_ACP, 0, buf, -1, bufout, 128, NULL, NULL); + return bufout[x]; +} + +const char *Debug_UnicodeString(::std::u16string s, int x) { + if (!ShouldDebug()) { + return ""; + } +#ifdef _MSC_VER + __declspec(thread) +#endif + static char bufout[2][MEDIUM_BUF_SIZ]; + auto p = s.begin(); + char *q; + bufout[x][0] = 0; + for (q = bufout[x]; (intptr_t)(q-bufout[x]) < (128*7) && p != s.end(); p++) + { + snprintf(q, MEDIUM_BUF_SIZ - (q - bufout[x]), "U+%4.4X ", *p); + q = strchr(q, 0); + } + return bufout[x]; +} + +void write_console(KMX_BOOL error, const wchar_t *fmt, ...) { + if (!g_silent || error) { + va_list vars; + va_start(vars, fmt); + vwprintf(fmt, vars); + va_end(vars); + } +} + +} +} +} diff --git a/core/src/debuglog.h b/core/src/debuglog.h new file mode 100644 index 0000000000000000000000000000000000000000..16fba4642854a8359bf5530da2d50ff3c93dcd81 --- /dev/null +++ b/core/src/debuglog.h @@ -0,0 +1,53 @@ +/* Debugging */ + +#include + +namespace km { +namespace kbp { +namespace kmx { + +extern KMX_BOOL g_debug_ToConsole, g_debug_KeymanLog, g_silent; + +struct modifier_names { + const char *name; + uint16_t modifier; +}; + +extern const struct modifier_names s_modifier_names[]; +extern const char *s_key_names[]; + +#ifdef _MSC_VER +#define DebugLog(msg,...) (km::kbp::kmx::ShouldDebug() ? km::kbp::kmx::DebugLog_1(__FILE__, __LINE__, __FUNCTION__, (msg),__VA_ARGS__) : 0) +#define console_error(msg,...) write_console(TRUE, (msg), __VA_ARGS__) +#define console_log(msg,...) write_console(FALSE, (msg), __VA_ARGS__) +#else +#define DebugLog(msg,...) (km::kbp::kmx::ShouldDebug() ? km::kbp::kmx::DebugLog_1(__FILE__, __LINE__, __FUNCTION__, (msg), ##__VA_ARGS__) : 0) +#define console_error(msg,...) write_console(TRUE, (msg), ##__VA_ARGS__) +#define console_log(msg,...) write_console(FALSE, (msg), ##__VA_ARGS__) +#endif + +int DebugLog_1(const char *file, int line, const char *function, const char *fmt, ...); +const char *Debug_VirtualKey(KMX_WORD vk); +/** + * @param s PKMX_WCHAR to output + * @param x temporary buffer (0 or 1) to write to + * @return pointer to temporary buffer + */ +const char *Debug_UnicodeString(PKMX_WCHAR s, int x = 0); +/** + * @param s std::u16string to output + * @param x temporary buffer (0 or 1) to write to + * @return pointer to temporary buffer + */ +const char *Debug_UnicodeString(std::u16string s, int x = 0); +const char *Debug_ModifierName(KMX_UINT modifiers); + +inline KMX_BOOL ShouldDebug() { + return g_debug_KeymanLog; +} + +void write_console(KMX_BOOL error, const wchar_t *fmt, ...); + +} +} +} diff --git a/core/src/km_kbp_keyboard_api.cpp b/core/src/km_kbp_keyboard_api.cpp index 759385dcf268e207ea5638e691a4486233badf94..13f3cafc45c4d189974d4c5018e2d49bfd3d5488 100644 --- a/core/src/km_kbp_keyboard_api.cpp +++ b/core/src/km_kbp_keyboard_api.cpp @@ -9,21 +9,28 @@ into keyboard.hpp */ #include +#include #include #include "keyboard.hpp" #include "processor.hpp" #include "kmx/kmx_processor.hpp" +#include "ldml/ldml_processor.hpp" #include "mock/mock_processor.hpp" using namespace km::kbp; namespace { - abstract_processor * processor_factory(path const & kb_path) - { + abstract_processor * processor_factory(path const & kb_path) { // Some legacy packages may include upper-case file extensions + // TODO-LDML: move file io out of core and into engine if (kb_path.suffix() == ".kmx" || kb_path.suffix() == ".KMX") { + std::vector buf; + if(ldml_processor::is_kmxplus_file(kb_path, buf)) { + abstract_processor * result = new ldml_processor(kb_path, buf); + return result; + } return new kmx_processor(kb_path); } else if (kb_path.suffix() == ".mock") { diff --git a/core/src/km_kbp_processevent_api.cpp b/core/src/km_kbp_processevent_api.cpp index 57b9310754ee908515c2d7ace7bac5a19e8d29df..63c1833e877a526f09ca911f7a2104f5ff23f447 100644 --- a/core/src/km_kbp_processevent_api.cpp +++ b/core/src/km_kbp_processevent_api.cpp @@ -43,12 +43,13 @@ km_kbp_status km_kbp_process_event(km_kbp_state *state, km_kbp_virtual_key vk, uint16_t modifier_state, - uint8_t is_key_down) { + uint8_t is_key_down, + uint16_t event_flags) { assert(state != nullptr); if(state == nullptr) { return KM_KBP_STATUS_INVALID_ARGUMENT; } - return state->processor().process_event(state, vk, modifier_state, is_key_down); + return state->processor().process_event(state, vk, modifier_state, is_key_down, event_flags); } km_kbp_status diff --git a/core/src/kmx/kmx_actions.cpp b/core/src/kmx/kmx_actions.cpp index ef944a6cdb66001f57404a716b482db256222c1e..dabf8f429a10edf528dec4eede3fc913aa460d8f 100644 --- a/core/src/kmx/kmx_actions.cpp +++ b/core/src/kmx/kmx_actions.cpp @@ -45,11 +45,12 @@ KMX_BOOL KMX_Actions::QueueAction(int ItemType, KMX_DWORD dwData) break; case QIT_CHAR: - if(Uni_IsSMP(dwData)) { - m_context->Add(Uni_UTF32ToSurrogate1(dwData)); - m_context->Add(Uni_UTF32ToSurrogate2(dwData)); - } else { - m_context->Add((KMX_WORD) dwData); + { + char16_single buf; + int len = Utf32CharToUtf16(dwData, buf); + for(int i=0; iAdd(buf.ch[i]); + } } break; diff --git a/core/src/kmx/kmx_base.h b/core/src/kmx/kmx_base.h index 562998472cab5aea5b4c67a578bc2f3a26dd8cbb..7fc335cfc464b6fd352cf43eb2f08433a1781b58 100644 --- a/core/src/kmx/kmx_base.h +++ b/core/src/kmx/kmx_base.h @@ -49,7 +49,7 @@ typedef struct tagKEYBOARD KMX_DWORD dwFileVersion; // Version of the file - Keyman 4.0 is 0x0400 - KMX_DWORD dwCheckSum; // As stored in keyboard + KMX_DWORD dwCheckSum; // As stored in keyboard. DEPRECATED as of 16.0 KMX_DWORD xxkbdlayout; // as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts KMX_DWORD IsRegistered; // layout id, from same key KMX_DWORD version; // keyboard version diff --git a/core/src/kmx/kmx_consts.cpp b/core/src/kmx/kmx_consts.cpp index 199e3ff45ad0fc9f524cb77469effee749f68523..26457469498c12790ad5198a36f4de64424f02be 100644 --- a/core/src/kmx/kmx_consts.cpp +++ b/core/src/kmx/kmx_consts.cpp @@ -6,7 +6,7 @@ namespace kbp { namespace kmx { const struct char_to_vkey s_char_to_vkey[] = { - {KM_KBP_VKEY_SPACE, 0, 0}, // + {KM_KBP_VKEY_SPACE, 0, 0}, // {'1', 1, 0}, // ! {KM_KBP_VKEY_QUOTE, 1, 0}, // " {'3', 1, 0}, // # @@ -104,295 +104,6 @@ const struct char_to_vkey s_char_to_vkey[] = { {0, 0, 0} }; -const char *s_key_names[] = { - // Key Codes - "K_?00", // &H0 - "K_LBUTTON", // &H1 - "K_RBUTTON", // &H2 - "K_CANCEL", // &H3 - "K_MBUTTON", // &H4 - "K_?05", // &H5 - "K_?06", // &H6 - "K_?07", // &H7 - "K_BKSP", // &H8 - "K_TAB", // &H9 - "K_?0A", // &HA - "K_?0B", // &HB - "K_KP5", // &HC - "K_ENTER", // &HD - "K_?0E", // &HE - "K_?0F", // &HF - "K_SHIFT", // &H10 - "K_CONTROL", // &H11 - "K_ALT", // &H12 - "K_PAUSE", // &H13 - "K_CAPS", // &H14 - "K_KANJI?15", // &H15 - "K_KANJI?16", // &H16 - "K_KANJI?17", // &H17 - "K_KANJI?18", // &H18 - "K_KANJI?19", // &H19 - "K_?1A", // &H1A - "K_ESC", // &H1B - "K_KANJI?1C", // &H1C - "K_KANJI?1D", // &H1D - "K_KANJI?1E", // &H1E - "K_KANJI?1F", // &H1F - "K_SPACE", // &H20 - "K_PGUP", // &H21 - "K_PGDN", // &H22 - "K_END", // &H23 - "K_HOME", // &H24 - "K_LEFT", // &H25 - "K_UP", // &H26 - "K_RIGHT", // &H27 - "K_DOWN", // &H28 - "K_SEL", // &H29 - "K_PRINT", // &H2A - "K_EXEC", // &H2B - "K_PRTSCN", // &H2C - "K_INS", // &H2D - "K_DEL", // &H2E - "K_HELP", // &H2F - "K_0", // &H30 - "K_1", // &H31 - "K_2", // &H32 - "K_3", // &H33 - "K_4", // &H34 - "K_5", // &H35 - "K_6", // &H36 - "K_7", // &H37 - "K_8", // &H38 - "K_9", // &H39 - "K_?3A", // &H3A - "K_?3B", // &H3B - "K_?3C", // &H3C - "K_?3D", // &H3D - "K_?3E", // &H3E - "K_?3F", // &H3F - "K_?40", // &H40 - - "K_A", // &H41 - "K_B", // &H42 - "K_C", // &H43 - "K_D", // &H44 - "K_E", // &H45 - "K_F", // &H46 - "K_G", // &H47 - "K_H", // &H48 - "K_I", // &H49 - "K_J", // &H4A - "K_K", // &H4B - "K_L", // &H4C - "K_M", // &H4D - "K_N", // &H4E - "K_O", // &H4F - "K_P", // &H50 - "K_Q", // &H51 - "K_R", // &H52 - "K_S", // &H53 - "K_T", // &H54 - "K_U", // &H55 - "K_V", // &H56 - "K_W", // &H57 - "K_X", // &H58 - "K_Y", // &H59 - "K_Z", // &H5A - "K_?5B", // &H5B - "K_?5C", // &H5C - "K_?5D", // &H5D - "K_?5E", // &H5E - "K_?5F", // &H5F - "K_NP0", // &H60 - "K_NP1", // &H61 - "K_NP2", // &H62 - "K_NP3", // &H63 - "K_NP4", // &H64 - "K_NP5", // &H65 - "K_NP6", // &H66 - "K_NP7", // &H67 - "K_NP8", // &H68 - "K_NP9", // &H69 - "K_NPSTAR", // &H6A - "K_NPPLUS", // &H6B - "K_SEPARATOR", // &H6C - "K_NPMINUS", // &H6D - "K_NPDOT", // &H6E - "K_NPSLASH", // &H6F - "K_F1", // &H70 - "K_F2", // &H71 - "K_F3", // &H72 - "K_F4", // &H73 - "K_F5", // &H74 - "K_F6", // &H75 - "K_F7", // &H76 - "K_F8", // &H77 - "K_F9", // &H78 - "K_F10", // &H79 - "K_F11", // &H7A - "K_F12", // &H7B - "K_F13", // &H7C - "K_F14", // &H7D - "K_F15", // &H7E - "K_F16", // &H7F - "K_F17", // &H80 - "K_F18", // &H81 - "K_F19", // &H82 - "K_F20", // &H83 - "K_F21", // &H84 - "K_F22", // &H85 - "K_F23", // &H86 - "K_F24", // &H87 - - "K_?88", // &H88 - "K_?89", // &H89 - "K_?8A", // &H8A - "K_?8B", // &H8B - "K_?8C", // &H8C - "K_?8D", // &H8D - "K_?8E", // &H8E - "K_?8F", // &H8F - - "K_NUMLOCK", // &H90 - "K_SCROLL", // &H91 - - "K_?92", // &H92 - "K_?93", // &H93 - "K_?94", // &H94 - "K_?95", // &H95 - "K_?96", // &H96 - "K_?97", // &H97 - "K_?98", // &H98 - "K_?99", // &H99 - "K_?9A", // &H9A - "K_?9B", // &H9B - "K_?9C", // &H9C - "K_?9D", // &H9D - "K_?9E", // &H9E - "K_?9F", // &H9F - "K_?A0", // &HA0 - "K_?A1", // &HA1 - "K_?A2", // &HA2 - "K_?A3", // &HA3 - "K_?A4", // &HA4 - "K_?A5", // &HA5 - "K_?A6", // &HA6 - "K_?A7", // &HA7 - "K_?A8", // &HA8 - "K_?A9", // &HA9 - "K_?AA", // &HAA - "K_?AB", // &HAB - "K_?AC", // &HAC - "K_?AD", // &HAD - "K_?AE", // &HAE - "K_?AF", // &HAF - "K_?B0", // &HB0 - "K_?B1", // &HB1 - "K_?B2", // &HB2 - "K_?B3", // &HB3 - "K_?B4", // &HB4 - "K_?B5", // &HB5 - "K_?B6", // &HB6 - "K_?B7", // &HB7 - "K_?B8", // &HB8 - "K_?B9", // &HB9 - - "K_COLON", // &HBA - "K_EQUAL", // &HBB - "K_COMMA", // &HBC - "K_HYPHEN", // &HBD - "K_PERIOD", // &HBE - "K_SLASH", // &HBF - "K_BKQUOTE", // &HC0 - - "K_?C1", // &HC1 - "K_?C2", // &HC2 - "K_?C3", // &HC3 - "K_?C4", // &HC4 - "K_?C5", // &HC5 - "K_?C6", // &HC6 - "K_?C7", // &HC7 - "K_?C8", // &HC8 - "K_?C9", // &HC9 - "K_?CA", // &HCA - "K_?CB", // &HCB - "K_?CC", // &HCC - "K_?CD", // &HCD - "K_?CE", // &HCE - "K_?CF", // &HCF - "K_?D0", // &HD0 - "K_?D1", // &HD1 - "K_?D2", // &HD2 - "K_?D3", // &HD3 - "K_?D4", // &HD4 - "K_?D5", // &HD5 - "K_?D6", // &HD6 - "K_?D7", // &HD7 - "K_?D8", // &HD8 - "K_?D9", // &HD9 - "K_?DA", // &HDA - - "K_LBRKT", // &HDB - "K_BKSLASH", // &HDC - "K_RBRKT", // &HDD - "K_QUOTE", // &HDE - "K_oDF", // &HDF - "K_oE0", // &HE0 - "K_oE1", // &HE1 - "K_oE2", // &HE2 - "K_oE3", // &HE3 - "K_oE4", // &HE4 - - "K_?E5", // &HE5 - - "K_oE6", // &HE6 - - "K_?E7", // &HE7 - "K_?E8", // &HE8 - - "K_oE9", // &HE9 - "K_oEA", // &HEA - "K_oEB", // &HEB - "K_oEC", // &HEC - "K_oED", // &HED - "K_oEE", // &HEE - "K_oEF", // &HEF - "K_oF0", // &HF0 - "K_oF1", // &HF1 - "K_oF2", // &HF2 - "K_oF3", // &HF3 - "K_oF4", // &HF4 - "K_oF5", // &HF5 - - "K_?F6", // &HF6 - "K_?F7", // &HF7 - "K_?F8", // &HF8 - "K_?F9", // &HF9 - "K_?FA", // &HFA - "K_?FB", // &HFB - "K_?FC", // &HFC - "K_?FD", // &HFD - "K_?FE", // &HFE - "K_?FF" // &HFF -}; - -const struct modifier_names s_modifier_names[] = { - {"LCTRL", 0x0001}, // Left Control flag - {"RCTRL", 0x0002}, // Right Control flag - {"LALT", 0x0004}, // Left Alt flag - {"RALT", 0x0008}, // Right Alt flag - {"SHIFT", 0x0010}, // Either shift flag - {"CTRL-do-not-use", 0x0020}, // Either ctrl flag -- don't use this for inputs - {"ALT-do-not-use", 0x0040}, // Either alt flag -- don't use this for inputs - {"CAPS", 0x0100}, // Caps lock on - {"NCAPS", 0x0200}, // Caps lock NOT on - {"NUMLOCK", 0x0400}, // Num lock on - {"NNUMLOCK", 0x0800}, // Num lock NOT on - {"SCROLL", 0x1000}, // Scroll lock on - {"NSCROLL", 0x2000}, // Scroll lock NOT on - {NULL, 0} -}; - } // namespace kmx } // namespace kbp } // namespace km diff --git a/core/src/kmx/kmx_debug.cpp b/core/src/kmx/kmx_debug.cpp deleted file mode 100644 index fcff8f272da211f8c26fd2d298d083c1c0b52d0f..0000000000000000000000000000000000000000 --- a/core/src/kmx/kmx_debug.cpp +++ /dev/null @@ -1,169 +0,0 @@ -/* - Copyright: Copyright (C) 2003-2018 SIL International. - Authors: mcdurdin -*/ -#include "kmx_processevent.h" -#include -#include - -using namespace km::kbp; -using namespace kmx; - -#define TAB "\t" -#define NL "\n" - -#include - -/** - * \def MEDIUM_BUFFER_SIZE not too big, not too small - */ - #define MEDIUM_BUFFER_SIZE (128 * 7) - -#ifdef _MSC_VER -#define _USE_WINDOWS -#endif - -#ifdef _USE_WINDOWS -#define DECLSPEC_IMPORT __declspec(dllimport) -#define WINBASEAPI DECLSPEC_IMPORT -#define VOID void -#define WINAPI __stdcall - -extern "C" -__declspec(dllimport) -void -__stdcall -OutputDebugStringA( - char *lpOutputString -); - -#else - #include -#endif - -// simulation of Windows GetTickCount() -unsigned long -GetTickCount() -{ - using namespace std::chrono; - return (unsigned long) duration_cast(steady_clock::now().time_since_epoch()).count(); -} - -int km::kbp::kmx::DebugLog_1(const char *file, int line, const char *function, const char *fmt, ...) -{ - char fmtbuf[256]; - - va_list vars; - va_start(vars, fmt); - vsnprintf(fmtbuf, sizeof(fmtbuf) / sizeof(fmtbuf[0]), fmt, vars); // I2248 // I3547 - fmtbuf[255] = 0; - va_end(vars); - - if (!g_debug_KeymanLog) - return 0; - - char windowinfo[1024]; - snprintf(windowinfo, 1024, - "%ld" TAB //"TickCount" TAB - "%s:%d" TAB //"SourceFile" TAB - "%s" TAB //"Function" - "%s" NL, //"Message" - - GetTickCount(), //"TickCount" TAB - file, line, //"SourceFile" TAB - function, //"Function" TAB - fmtbuf); //"Message" - - if (g_debug_ToConsole) { // I3951 - std::cout << windowinfo << std::endl; // OutputDebugStringA(windowinfo); - } else { -#ifdef _USE_WINDOWS - std::cout << windowinfo << std::endl; // OutputDebugStringA(windowinfo); -#else - syslog(LOG_DEBUG, "%s", windowinfo); -#endif - } - - return 0; -} - -const char *km::kbp::kmx::Debug_ModifierName(KMX_UINT modifiers) { -#ifdef _MSC_VER - __declspec(thread) -#endif - static char buf[256]; - buf[0] = 0; - for(int i = 0; s_modifier_names[i].name; i++) - if (modifiers & s_modifier_names[i].modifier) { - strcat(buf, " "); - strcat(buf, s_modifier_names[i].name); - } - - if (*buf) return buf + 1; - return "Unmodified"; -} - -const char *km::kbp::kmx::Debug_VirtualKey(KMX_WORD vk) { -#ifdef _MSC_VER - __declspec(thread) -#endif - static char buf[256]; - if (!ShouldDebug()) { - return ""; - } - - if (vk < 256) { - snprintf(buf, 256, "['%s' 0x%x]", s_key_names[vk], vk); - } - else { - snprintf(buf, 256, "[0x%x]", vk); - } - return buf; -} - -const char *km::kbp::kmx::Debug_UnicodeString(PKMX_WCHAR s, int x) { - if (!ShouldDebug()) { - return ""; - } -#ifdef _MSC_VER - __declspec(thread) -#endif - static char bufout[2][128 * 7]; - KMX_WCHAR *p; - char *q; - bufout[x][0] = 0; - for (p = s, q = bufout[x]; *p && (p - s < 128); p++) - { - snprintf(q, MEDIUM_BUFFER_SIZE, "U+%4.4X ", *p); - q = strchr(q, 0); - } - //WideCharToMultiByte(CP_ACP, 0, buf, -1, bufout, 128, NULL, NULL); - return bufout[x]; -} - -const char *km::kbp::kmx::Debug_UnicodeString(std::u16string s, int x) { - if (!ShouldDebug()) { - return ""; - } -#ifdef _MSC_VER - __declspec(thread) -#endif - static char bufout[2][128 * 7]; - auto p = s.begin(); - char *q; - bufout[x][0] = 0; - for (q = bufout[x]; (intptr_t)(q-bufout[x]) < (128*7) && p != s.end(); p++) - { - snprintf(q, MEDIUM_BUFFER_SIZE, "U+%4.4X ", *p); q = strchr(q, 0); - } - return bufout[x]; -} - -void km::kbp::kmx::write_console(KMX_BOOL error, const wchar_t *fmt, ...) { - if (!g_silent || error) { - va_list vars; - va_start(vars, fmt); - vwprintf(fmt, vars); - va_end(vars); - } -} diff --git a/core/src/kmx/kmx_file.cpp b/core/src/kmx/kmx_file.cpp index defdc63e781b226751dc69892368d5cc66ccaa1b..527b7d5c3a20ba995f7efbc443ad8fcc9f5681bd 100644 --- a/core/src/kmx/kmx_file.cpp +++ b/core/src/kmx/kmx_file.cpp @@ -4,6 +4,7 @@ */ #include "kmx_processevent.h" #include +#include "kmx_file_validator.hpp" using namespace km::kbp; using namespace kmx; @@ -50,61 +51,7 @@ const int km::kbp::kmx::CODE__SIZE[] = { // Ensure that all CODE_### sizes are defined static_assert(sizeof(CODE__SIZE) / sizeof(CODE__SIZE[0]) == (CODE_LASTCODE + 1), "Size of array CODE__SIZE not correct"); -const unsigned long CRCTable[256] = { - 0x00000000, 0x77073096, 0xee0e612c, 0x990951ba, 0x076dc419, 0x706af48f, 0xe963a535, 0x9e6495a3, - 0x0edb8832, 0x79dcb8a4, 0xe0d5e91e, 0x97d2d988, 0x09b64c2b, 0x7eb17cbd, 0xe7b82d07, 0x90bf1d91, - 0x1db71064, 0x6ab020f2, 0xf3b97148, 0x84be41de, 0x1adad47d, 0x6ddde4eb, 0xf4d4b551, 0x83d385c7, - 0x136c9856, 0x646ba8c0, 0xfd62f97a, 0x8a65c9ec, 0x14015c4f, 0x63066cd9, 0xfa0f3d63, 0x8d080df5, - 0x3b6e20c8, 0x4c69105e, 0xd56041e4, 0xa2677172, 0x3c03e4d1, 0x4b04d447, 0xd20d85fd, 0xa50ab56b, - 0x35b5a8fa, 0x42b2986c, 0xdbbbc9d6, 0xacbcf940, 0x32d86ce3, 0x45df5c75, 0xdcd60dcf, 0xabd13d59, - 0x26d930ac, 0x51de003a, 0xc8d75180, 0xbfd06116, 0x21b4f4b5, 0x56b3c423, 0xcfba9599, 0xb8bda50f, - 0x2802b89e, 0x5f058808, 0xc60cd9b2, 0xb10be924, 0x2f6f7c87, 0x58684c11, 0xc1611dab, 0xb6662d3d, - 0x76dc4190, 0x01db7106, 0x98d220bc, 0xefd5102a, 0x71b18589, 0x06b6b51f, 0x9fbfe4a5, 0xe8b8d433, - 0x7807c9a2, 0x0f00f934, 0x9609a88e, 0xe10e9818, 0x7f6a0dbb, 0x086d3d2d, 0x91646c97, 0xe6635c01, - 0x6b6b51f4, 0x1c6c6162, 0x856530d8, 0xf262004e, 0x6c0695ed, 0x1b01a57b, 0x8208f4c1, 0xf50fc457, - 0x65b0d9c6, 0x12b7e950, 0x8bbeb8ea, 0xfcb9887c, 0x62dd1ddf, 0x15da2d49, 0x8cd37cf3, 0xfbd44c65, - 0x4db26158, 0x3ab551ce, 0xa3bc0074, 0xd4bb30e2, 0x4adfa541, 0x3dd895d7, 0xa4d1c46d, 0xd3d6f4fb, - 0x4369e96a, 0x346ed9fc, 0xad678846, 0xda60b8d0, 0x44042d73, 0x33031de5, 0xaa0a4c5f, 0xdd0d7cc9, - 0x5005713c, 0x270241aa, 0xbe0b1010, 0xc90c2086, 0x5768b525, 0x206f85b3, 0xb966d409, 0xce61e49f, - 0x5edef90e, 0x29d9c998, 0xb0d09822, 0xc7d7a8b4, 0x59b33d17, 0x2eb40d81, 0xb7bd5c3b, 0xc0ba6cad, - 0xedb88320, 0x9abfb3b6, 0x03b6e20c, 0x74b1d29a, 0xead54739, 0x9dd277af, 0x04db2615, 0x73dc1683, - 0xe3630b12, 0x94643b84, 0x0d6d6a3e, 0x7a6a5aa8, 0xe40ecf0b, 0x9309ff9d, 0x0a00ae27, 0x7d079eb1, - 0xf00f9344, 0x8708a3d2, 0x1e01f268, 0x6906c2fe, 0xf762575d, 0x806567cb, 0x196c3671, 0x6e6b06e7, - 0xfed41b76, 0x89d32be0, 0x10da7a5a, 0x67dd4acc, 0xf9b9df6f, 0x8ebeeff9, 0x17b7be43, 0x60b08ed5, - 0xd6d6a3e8, 0xa1d1937e, 0x38d8c2c4, 0x4fdff252, 0xd1bb67f1, 0xa6bc5767, 0x3fb506dd, 0x48b2364b, - 0xd80d2bda, 0xaf0a1b4c, 0x36034af6, 0x41047a60, 0xdf60efc3, 0xa867df55, 0x316e8eef, 0x4669be79, - 0xcb61b38c, 0xbc66831a, 0x256fd2a0, 0x5268e236, 0xcc0c7795, 0xbb0b4703, 0x220216b9, 0x5505262f, - 0xc5ba3bbe, 0xb2bd0b28, 0x2bb45a92, 0x5cb36a04, 0xc2d7ffa7, 0xb5d0cf31, 0x2cd99e8b, 0x5bdeae1d, - 0x9b64c2b0, 0xec63f226, 0x756aa39c, 0x026d930a, 0x9c0906a9, 0xeb0e363f, 0x72076785, 0x05005713, - 0x95bf4a82, 0xe2b87a14, 0x7bb12bae, 0x0cb61b38, 0x92d28e9b, 0xe5d5be0d, 0x7cdcefb7, 0x0bdbdf21, - 0x86d3d2d4, 0xf1d4e242, 0x68ddb3f8, 0x1fda836e, 0x81be16cd, 0xf6b9265b, 0x6fb077e1, 0x18b74777, - 0x88085ae6, 0xff0f6a70, 0x66063bca, 0x11010b5c, 0x8f659eff, 0xf862ae69, 0x616bffd3, 0x166ccf45, - 0xa00ae278, 0xd70dd2ee, 0x4e048354, 0x3903b3c2, 0xa7672661, 0xd06016f7, 0x4969474d, 0x3e6e77db, - 0xaed16a4a, 0xd9d65adc, 0x40df0b66, 0x37d83bf0, 0xa9bcae53, 0xdebb9ec5, 0x47b2cf7f, 0x30b5ffe9, - 0xbdbdf21c, 0xcabac28a, 0x53b39330, 0x24b4a3a6, 0xbad03605, 0xcdd70693, 0x54de5729, 0x23d967bf, - 0xb3667a2e, 0xc4614ab8, 0x5d681b02, 0x2a6f2b94, 0xb40bbe37, 0xc30c8ea1, 0x5a05df1b, 0x2d02ef8d -}; -/* - * This routine calculates the CRC for a block of data using the - * table lookup method. It accepts an original value for the crc, - * and returns the updated value. - */ - -static unsigned long CalculateBufferCRC(size_t count, KMX_BYTE *p) -{ - unsigned long temp1; - unsigned long temp2; - unsigned long crc = 0xFFFFFFFFL; - while (count-- != 0) - { - temp1 = ( crc >> 8 ) & 0x00FFFFFFL; - temp2 = CRCTable[((int) crc ^ *p++) & 0xff]; - crc = temp1 ^ temp2; - } - - return crc; -} KMX_BOOL KMX_ProcessEvent::LoadKeyboard(km_kbp_path_name fileName, LPKEYBOARD *lpKeyboard) { @@ -346,48 +293,53 @@ LPKEYBOARD KMX_ProcessEvent::FixupKeyboard(PKMX_BYTE bufp, PKMX_BYTE base) #endif -KMX_BOOL KMX_ProcessEvent::VerifyChecksum(PKMX_BYTE buf, size_t sz) -{ - KMX_DWORD tempcs; - PCOMP_KEYBOARD ckbp; - ckbp = (PCOMP_KEYBOARD) buf; - - tempcs = ckbp->dwCheckSum; - ckbp->dwCheckSum = 0; +KMX_BOOL KMX_ProcessEvent::VerifyKeyboard(PKMX_BYTE filebase, size_t sz) +{ + KMX_FileValidator *ckbp = reinterpret_cast(filebase); - return tempcs == CalculateBufferCRC(sz, buf); + return ckbp->VerifyKeyboard(sz); } -KMX_BOOL KMX_ProcessEvent::VerifyKeyboard(PKMX_BYTE filebase, size_t sz) + +KMX_BOOL KMX_FileValidator::VerifyKeyboard(std::size_t _kmn_unused(sz)) const { KMX_DWORD i; - PCOMP_KEYBOARD ckbp = (PCOMP_KEYBOARD) filebase; PCOMP_STORE csp; + const PKMX_BYTE filebase = (KMX_BYTE*)this; /* Check file version */ - if(ckbp->dwFileVersion < VERSION_MIN || - ckbp->dwFileVersion > VERSION_MAX) + if(dwFileVersion < VERSION_MIN || + dwFileVersion > VERSION_MAX) { /* Old or new version -- identify the desired program version */ - if(VerifyChecksum(filebase, sz)) - { - for(csp = (PCOMP_STORE)(filebase + ckbp->dpStoreArray), i = 0; i < ckbp->cxStoreArray; i++, csp++) - if(csp->dwSystemID == TSS_COMPILEDVERSION) - { - if(csp->dpString == 0) - DebugLog("errWrongFileVersion:NULL"); - else - DebugLog("errWrongFileVersion:%10.10ls", StringOffset(filebase, csp->dpString)); - return FALSE; - } + for(csp = (PCOMP_STORE)(filebase + dpStoreArray), i = 0; i < cxStoreArray; i++, csp++) { + if(csp->dwSystemID == TSS_COMPILEDVERSION) + { + if(csp->dpString == 0) + DebugLog("errWrongFileVersion:NULL"); + else + DebugLog("errWrongFileVersion:%10.10ls", KMX_ProcessEvent::StringOffset(filebase, csp->dpString)); + return FALSE; + } } DebugLog("errWrongFileVersion"); return FALSE; } - if(!VerifyChecksum(filebase, sz)) { DebugLog("errBadChecksum"); return FALSE; } + // Verify file structure + + if(StartGroup[0] != 0xFFFFFFFF && StartGroup[0] >= cxGroupArray) { + DebugLog("Invalid ANSI start group index"); + return FALSE; + } + if(StartGroup[1] != 0xFFFFFFFF && StartGroup[1] >= cxGroupArray) { + DebugLog("Invalid Unicode start group index"); + return FALSE; + } + + // TODO: verify many other offsets such as stores, groups, keys, strings! return TRUE; } diff --git a/core/src/kmx/kmx_file_validator.hpp b/core/src/kmx/kmx_file_validator.hpp new file mode 100644 index 0000000000000000000000000000000000000000..0f6582ad2c97dd823425b2723fc07c0a3f470a8e --- /dev/null +++ b/core/src/kmx/kmx_file_validator.hpp @@ -0,0 +1,34 @@ +#pragma once + +#include + +#include + +#include + +#ifdef KMN_KBP +// TODO: move this to a common namespace keyman::common::kmx_file or similar in the future +namespace km { +namespace kbp { +namespace kmx { +#endif + + +class KMX_FileValidator : public COMP_KEYBOARD { +public: + /** + * @brief Return TRUE if keyboard is OK, otherwise FALSE + * Non const because the checksum gets cleared + * + * @param sz total size of keyboard structure + * @return KMX_BOOL + */ + KMX_BOOL VerifyKeyboard(std::size_t sz) const; +}; + + +#ifdef KMN_KBP +} // namespace kmx +} // namespace kbp +} // namespace km +#endif diff --git a/core/src/kmx/kmx_plus.cpp b/core/src/kmx/kmx_plus.cpp new file mode 100644 index 0000000000000000000000000000000000000000..68dd5bacb0756b96248be9848b535b010611bd3e --- /dev/null +++ b/core/src/kmx/kmx_plus.cpp @@ -0,0 +1,916 @@ +/* + Copyright: Copyright (C) 2022 SIL International. + Authors: srl295 + Implementation for the KMX Plus utilities +*/ + +#include +#include +#include +#include + +#include "kmx_processevent.h" // for debug functions +#include "ldml/keyboardprocessor_ldml.h" + +#include + +namespace km { +namespace kbp { +namespace kmx { + +// double check these modifier mappings +static_assert(LCTRLFLAG == LDML_KEYS_MOD_CTRLL, "LDML modifier bitfield vs. kmx_file.h #define mismatch"); +static_assert(RCTRLFLAG == LDML_KEYS_MOD_CTRLR, "LDML modifier bitfield vs. kmx_file.h #define mismatch"); +static_assert(K_CTRLFLAG == LDML_KEYS_MOD_CTRL, "LDML modifier bitfield vs. kmx_file.h #define mismatch"); +static_assert(RALTFLAG == LDML_KEYS_MOD_ALTR, "LDML modifier bitfield vs. kmx_file.h #define mismatch"); +static_assert(LALTFLAG == LDML_KEYS_MOD_ALTL, "LDML modifier bitfield vs. kmx_file.h #define mismatch"); +static_assert(K_ALTFLAG == LDML_KEYS_MOD_ALT, "LDML modifier bitfield vs. kmx_file.h #define mismatch"); +static_assert(CAPITALFLAG == LDML_KEYS_MOD_CAPS, "LDML modifier bitfield vs. kmx_file.h #define mismatch"); +static_assert(K_SHIFTFLAG == LDML_KEYS_MOD_SHIFT, "LDML modifier bitfield vs. kmx_file.h #define mismatch"); // "either" shift + +/** + * \def LDML_IS_VALID_MODIFIER_BITS test whether x is a valid modifier bitfield + * i.e. contains no bits outside of LDML_KEYS_MOD_ALL + */ +#define LDML_IS_VALID_MODIFIER_BITS(x) ((LDML_KEYS_MOD_ALL & x) == x) + +static_assert(LDML_IS_VALID_MODIFIER_BITS(0), "LDML_IS_VALID_MODIFIER_BITS test"); +static_assert(!LDML_IS_VALID_MODIFIER_BITS(0xFFFFFF), "LDML_IS_VALID_MODIFIER_BITS(0xFFFFFF) should be 0"); +static_assert(LDML_IS_VALID_MODIFIER_BITS(LDML_KEYS_MOD_CAPS), "LDML_IS_VALID_MODIFIER_BITS test"); + +/** + * \def _DEBUG_IDENT_SAFE for use by DEBUG_IDENT + */ +#define _DEBUG_IDENT_SAFE(x,b) (((x)>>b)&0x7F)<0x20?'?':(((x)>>b)&0x7F) + +/** + * \def DEBUG_IDENT + * Expands to four chars: a,b,c,d + * for purposes of debug logging a hex identifier + */ +#define DEBUG_IDENT(x) \ + _DEBUG_IDENT_SAFE(x,0), \ + _DEBUG_IDENT_SAFE(x,8), \ + _DEBUG_IDENT_SAFE(x,16), \ + _DEBUG_IDENT_SAFE(x,24) + +/** + * @brief Validate (and print out) a section name dword + * + * @param ident the hex dword + * @return true if valid + * @return false if invalid + */ +static bool +validate_section_name(KMX_DWORD ident) { + for (int i = 0; i < 4; i++) { + unsigned char ch = ident & 0xFF; + if (ch < 0x20 || ch > 0x7F) { + DebugLog("Invalid section name %c%c%c%c (0x%X)", DEBUG_IDENT(ident), ident); + assert(false); + return false; + } + ident >>= 8; + } + return true; +} + +/** + * @brief cast to a COMP_KMXPLUS_HEADER from bytes + * + * @param data + * @param length + * @param ident + * @return const kmx::COMP_KMXPLUS_HEADER* + */ +static const kmx::COMP_KMXPLUS_HEADER * +header_from_bytes(const uint8_t *data, KMX_DWORD length, uint32_t ident) { + if (!data) { + DebugLog("!data"); + assert(false); + return nullptr; + } + if (length < LDML_LENGTH_HEADER) { + DebugLog("length < LDML_LENGTH_HEADER"); + assert(false); + return nullptr; + } + const COMP_KMXPLUS_HEADER *all = reinterpret_cast(data); + if (!all->valid(length)) { + DebugLog("header failed validation"); + assert(false); + return nullptr; + } + if (all->ident != ident) { + DebugLog("header had wrong section id"); + assert(false); + return nullptr; + } + return all; +} + +/** + * @brief Accessor for a section based on bytes + * + * @tparam T + * @param data + * @param length + * @return const T* + */ +template +const T *section_from_bytes(const uint8_t *data, KMX_DWORD length) { + if (length < sizeof(T)) { // Does not include dynamic data. First check. + DebugLog("length < sizeof(section)"); + assert(false); + return nullptr; + } + const COMP_KMXPLUS_HEADER *header = header_from_bytes(data, length, T::IDENT); + const T *section = reinterpret_cast(header); + if (section != nullptr && section->valid(length)) { + return section; + } else { + assert(false); + return nullptr; + } +} + +template +const T *section_from_sect(const COMP_KMXPLUS_SECT* sect) { + const uint8_t *rawbytes = reinterpret_cast(sect); + if (rawbytes == nullptr) { + DebugLog("section_from_sect(nullptr) == nullptr"); + assert(false); + return nullptr; + } + KMX_DWORD offset = sect->find(T::IDENT); + if (!offset) { + DebugLog("section_from_sect() - not found. section %c%c%c%c (0x%X)", DEBUG_IDENT(T::IDENT), T::IDENT); + return nullptr; + } + KMX_DWORD entrylength = sect->total - offset; + return section_from_bytes(rawbytes+offset, entrylength); +} + +bool +COMP_KMXPLUS_HEADER::valid(KMX_DWORD length) const { + DebugLog("%c%c%c%c: (%X) size 0x%X\n", DEBUG_IDENT(ident), ident, size); + if (size < LDML_LENGTH_HEADER) { + DebugLog("size < LDML_LENGTH_HEADER"); + assert(false); + return false; + } + if (size > length) { + DebugLog("size > length"); + assert(false); + return false; + } + if (!validate_section_name(ident)) { + return false; + } + DebugLog(" (header OK)"); // newline after section name + return true; +} + +bool +COMP_KMXPLUS_LOCA::valid(KMX_DWORD _kmn_unused(length)) const { + if (header.size < sizeof(*this)+(sizeof(entries[0])*count)) { + DebugLog("header.size < expected size"); + assert(false); + return false; + } + for(KMX_DWORD i=0; i0x%X", i, entries[i].vkey, entries[i].target); + if (entries[i].vkey > 0xFF || entries[i].target > 0xFF) { + DebugLog("vkey source or target out of range [0x00…0xFF]"); + assert(false); + return false; + } + } + return true; +} + +bool +COMP_KMXPLUS_DISP::valid(KMX_DWORD _kmn_unused(length)) const { + DebugLog("disp: count 0x%X\n", count); + if (header.size < sizeof(*this)+(sizeof(entries[0])*count)) { + DebugLog("header.size < expected size"); + assert(false); + return false; + } + if (baseCharacter != 0) { + DebugLog("disp: baseCharacter str#0x%X", baseCharacter); + } + for (KMX_DWORD i=0; i str0x%X", i, entries[i].to, entries[i].display); + if (entries[i].to == 0 || entries[i].display == 0) { + DebugLog("disp to: or display: has a zero string"); + assert(false); + return false; + } + } + return true; +} + +bool +COMP_KMXPLUS_STRS::valid(KMX_DWORD _kmn_unused(length)) const { + DebugLog("strs: count 0x%X\n", count); + if (header.size < sizeof(*this)+(sizeof(entries[0])*count)) { + DebugLog("header.size < expected size"); + assert(false); + return false; + } + for (KMX_DWORD i=0; i header.size) { + DebugLog("#0x%X: expected end of string past header.size", i); + assert(false); + return false; + } + const uint8_t* thisptr = reinterpret_cast(this); + const KMX_WCHAR* start = reinterpret_cast(thisptr+offset); + if(start[length] != 0) { + DebugLog("#0x%X: String of length 0x%x not null terminated", i, length); + assert(start[length] == 0); + return false; + } + // TODO-LDML: validate valid UTF-16LE? + DebugLog("#0x%X: '%s'", i, Debug_UnicodeString(start)); + } + return true; +} + +bool +COMP_KMXPLUS_SECT::valid(KMX_DWORD length) const { + DebugLog("sect: total 0x%X\n", total); + DebugLog("sect: count 0x%X\n", count); + if (header.size < sizeof(*this)+(sizeof(entries[0])*count)) { + DebugLog("header.size < expected size"); + assert(false); + return false; + } + + // now validate each component + bool overall_valid = true; + for (KMX_DWORD i = 0; i < count; i++) { + const COMP_KMXPLUS_SECT_ENTRY& entry = entries[i]; + DebugLog("%c%c%c%c #%d: %X @ %X\n", DEBUG_IDENT(entry.sect), i, entry.sect, entry.offset); + if(!validate_section_name(entry.sect)) { + return false; + } + if (entry.sect == LDML_SECTIONID_SECT) { + DebugLog("Invalid nested 'sect'"); + overall_valid = false; + continue; + } + const uint8_t* data = reinterpret_cast(this); + const uint8_t* entrydata = data + entry.offset; + KMX_DWORD entrylength = length - entry.offset; + // just validate header + if(header_from_bytes(entrydata, entrylength, entry.sect) == nullptr) { + DebugLog("Invalid header %X", entry.sect); + assert(false); + overall_valid = false; + continue; + } + } + return overall_valid; +} + +// ---- transform related fcns +bool +COMP_KMXPLUS_ELEM::valid(KMX_DWORD _kmn_unused(length)) const { + if (header.size < sizeof(*this)+(sizeof(entries[0])*count)) { + DebugLog("header.size 0x%X < expected size"); + return false; + } + const COMP_KMXPLUS_ELEM_ENTRY &firstEntry = entries[0]; + if (firstEntry.length != 0 || firstEntry.offset != 0) { + DebugLog("ERROR: elem[0].length=0x%x, elem[0].offset=0x%x, both should be zero", + firstEntry.length, firstEntry.offset); + return false; + } + for (KMX_DWORD e = 1; e < count; e++) { + // Don't need to recheck the first entry hbere. + KMX_DWORD listLength; + if (getElementList(e, listLength) == nullptr) { + return false; + } + if (listLength == 0) { // only the first element should have length zero + DebugLog("ERROR: elem[0x%x].length == 0", e); + return false; + } + } + return true; +} + +const COMP_KMXPLUS_ELEM_ELEMENT * +COMP_KMXPLUS_ELEM::getElementList(KMX_DWORD elementNumber, KMX_DWORD &length) const { + if (elementNumber >= count) { + DebugLog("ERROR: COMP_KMXPLUS_ELEM::getElementList(%d) >= count %d", elementNumber, count); + assert(false); + return nullptr; + } + const COMP_KMXPLUS_ELEM_ENTRY &entry = entries[elementNumber]; + length = entry.length; + if (length == 0) { + return nullptr; // Normal case for first element + } + if (entry.offset + (entry.length * sizeof(COMP_KMXPLUS_ELEM_ELEMENT)) > header.size) { + DebugLog("ERROR: !! COMP_KMXPLUS_ELEM::getElementList(%d) would be off end of data area", elementNumber); + assert(false); + return nullptr; + } + // pointer to beginning of elem section + const uint8_t *rawdata = reinterpret_cast(this); + // pointer to specified entry + return reinterpret_cast(rawdata + entry.offset); +} + +std::u16string +COMP_KMXPLUS_ELEM_ELEMENT::get_string() const { + assert(!(flags & LDML_ELEM_FLAGS_UNICODE_SET)); // should not be called. + char16_single buf; + const int len = Utf32CharToUtf16(element, buf); + return std::u16string(buf.ch, len); +} + +bool +COMP_KMXPLUS_TRAN::valid(KMX_DWORD _kmn_unused(length)) const { + if (header.size < sizeof(*this)+(sizeof(entries[0])*count)) { + DebugLog("header.size < expected size"); + assert(false); + return false; + } + // TODO-LDML + DebugLog("!! More to do here."); + return true; +} + +bool +COMP_KMXPLUS_LAYR::valid(KMX_DWORD _kmn_unused(length)) const { + if (header.size < sizeof(*this) + + (listCount * sizeof(COMP_KMXPLUS_LAYR_LIST)) + + (layerCount * sizeof(COMP_KMXPLUS_LAYR_ENTRY)) + + (rowCount * sizeof(COMP_KMXPLUS_LAYR_ROW)) + + (keyCount * sizeof(COMP_KMXPLUS_LAYR_KEY))) { + DebugLog("header.size < expected size"); + assert(false); + return false; + } + DebugLog("layr header is valid"); + // Note: We only do minimal validation here because of the + // dynamic structure. See COMP_KMXPLUS_LAYR_Helper.setLayr() (below) + // all remaining checks + return true; +} + +COMP_KMXPLUS_LAYR_Helper::COMP_KMXPLUS_LAYR_Helper() : layr(nullptr), is_valid(false) { +} + +bool +COMP_KMXPLUS_LAYR_Helper::setLayr(const COMP_KMXPLUS_LAYR *newLayr) { + DebugLog("validating newLayr=%p", newLayr); + is_valid = true; + if (newLayr == nullptr) { + // null = invalid + is_valid = false; + // No assert here: just a missing layer + return false; + } + layr = newLayr; + const uint8_t *rawdata = reinterpret_cast(newLayr); + rawdata += LDML_LENGTH_LAYR; // skip past non-dynamic portion + // lists + if (layr->listCount > 0) { + lists = reinterpret_cast(rawdata); + } else { + lists = nullptr; + is_valid = false; + assert(is_valid); + } + rawdata += sizeof(COMP_KMXPLUS_LAYR_LIST) * layr->listCount; + // entries + if (layr->layerCount > 0) { + entries = reinterpret_cast(rawdata); + } else { + entries = nullptr; + is_valid = false; + assert(is_valid); + } + rawdata += sizeof(COMP_KMXPLUS_LAYR_ENTRY) * layr->layerCount; + // rows + if (layr->rowCount > 0) { + rows = reinterpret_cast(rawdata); + } else { + rows = nullptr; + is_valid = false; + assert(is_valid); + } + rawdata += sizeof(COMP_KMXPLUS_LAYR_ROW) * layr->rowCount; + // keys + if (layr->keyCount > 0) { + keys = reinterpret_cast(rawdata); + } else { + keys = nullptr; + is_valid = false; + assert(is_valid); + } + + // Now, validate offsets by walking + if (is_valid) { + for(KMX_DWORD i = 0; is_valid && i < layr->listCount; i++) { + const COMP_KMXPLUS_LAYR_LIST &list = lists[i]; + // is the count off the end? + DebugLog( + " %d: hardware s#0x%X, layers %d..%d, minDeviceWidth %.1fmm", i, list.hardware, list.layer, + list.layer + list.count - 1, list.minDeviceWidth * (double)0.1); + if ((list.layer >= layr->layerCount) || (list.layer + list.count > layr->layerCount)) { + DebugLog("COMP_KMXPLUS_LAYR_Helper: list[%d] would access layer %d+%d, > count %d", + i, list.layer, list.count, layr->layerCount); + is_valid = false; + assert(is_valid); + } + } + for(KMX_DWORD i = 0; is_valid && i < layr->layerCount; i++) { + const COMP_KMXPLUS_LAYR_ENTRY &entry = entries[i]; + // is the count off the end? + DebugLog( + " %d: id s#0x%X, rows %d..%d, modifier=0x%X", i, entry.id, entry.row, entry.row+entry.count-1, entry.mod); + if ((entry.row >= layr->rowCount) || (entry.row + entry.count > layr->rowCount)) { + DebugLog("COMP_KMXPLUS_LAYR_Helper: entry[%d] would access row %d+%d, > count %d", + i, entry.row, entry.count, layr->rowCount); + is_valid = false; + assert(is_valid); + } + if (!LDML_IS_VALID_MODIFIER_BITS(entry.mod)) { + DebugLog("Invalid modifier value"); + assert(false); + return false; + } + } + for(KMX_DWORD i = 0; is_valid && i < layr->rowCount; i++) { + const COMP_KMXPLUS_LAYR_ROW &row = rows[i]; + // is the count off the end? + if ((row.key >= layr->keyCount) || (row.key + row.count > layr->keyCount)) { + DebugLog("COMP_KMXPLUS_LAYR_Helper: row[%d] would access key %d+%d, > count %d", + i, row.key, row.count, layr->keyCount); + is_valid = false; + assert(is_valid); + } + } + } + // Return results + DebugLog("COMP_KMXPLUS_LAYR_Helper.setLayr(): %s", is_valid ? "valid" : "invalid"); + assert(is_valid); + return is_valid; +} + +bool COMP_KMXPLUS_LAYR_Helper::valid() const { + return is_valid; +} + +const COMP_KMXPLUS_LAYR_LIST * +COMP_KMXPLUS_LAYR_Helper::getList(KMX_DWORD list) const { + if (!valid() || list >= layr->listCount) { + assert(false); + return nullptr; + } + return lists + list; +} + +const COMP_KMXPLUS_LAYR_ENTRY * +COMP_KMXPLUS_LAYR_Helper::getEntry(KMX_DWORD entry) const { + if (!valid() || entry >= layr->layerCount) { + assert(false); + return nullptr; + } + return entries + entry; +} + +const COMP_KMXPLUS_LAYR_ROW * +COMP_KMXPLUS_LAYR_Helper::getRow(KMX_DWORD row) const { + if (!valid() || row >= layr->rowCount) { + assert(false); + return nullptr; + } + return rows + row; +} + +const COMP_KMXPLUS_LAYR_KEY * +COMP_KMXPLUS_LAYR_Helper::getKey(KMX_DWORD key) const { + if (!valid() || key >= layr->keyCount) { + assert(false); + return nullptr; + } + return keys + key; +} + +bool +COMP_KMXPLUS_KEYS::valid(KMX_DWORD _kmn_unused(length)) const { + if (header.size < sizeof(*this) + + (keyCount * sizeof(COMP_KMXPLUS_KEYS_KEY)) + + (flicksCount * sizeof(COMP_KMXPLUS_KEYS_FLICK_LIST)) + + (flickCount * sizeof(COMP_KMXPLUS_KEYS_FLICK_ELEMENT)) + + (kmapCount * sizeof(COMP_KMXPLUS_KEYS_KMAP))) { + DebugLog("header.size < expected size"); + assert(false); + return false; + } + // further validation in the COMP_KMXPLUS_KEYS_Helper helper obj + return true; +} + + +COMP_KMXPLUS_KEYS_Helper::COMP_KMXPLUS_KEYS_Helper() : key2(nullptr), is_valid(false) { +} + +bool +COMP_KMXPLUS_KEYS_Helper::setKeys(const COMP_KMXPLUS_KEYS *newKeys) { + DebugLog("validating newKeys=%p", newKeys); + is_valid = true; + if (newKeys == nullptr) { + // null = invalid + is_valid = false; + // No assert here: just a missing layer + return false; + } + key2 = newKeys; + const uint8_t *rawdata = reinterpret_cast(newKeys); + rawdata += LDML_LENGTH_KEYS; // skip past non-dynamic portion + // keys + if (key2->keyCount > 0) { + keys = reinterpret_cast(rawdata); + } else { + keys = nullptr; + is_valid = false; + assert(is_valid); + } + rawdata += sizeof(COMP_KMXPLUS_KEYS_KEY) * key2->keyCount; + // flicks + if (key2->flicksCount > 0) { + flickLists = reinterpret_cast(rawdata); + } else { + flickLists = nullptr; // not an error + } + rawdata += sizeof(COMP_KMXPLUS_KEYS_FLICK_LIST) * key2->flicksCount; + // flick + if (key2->flickCount > 0) { + flickElements = reinterpret_cast(rawdata); + } else { + flickElements = nullptr; // not an error + } + rawdata += sizeof(COMP_KMXPLUS_KEYS_FLICK_ELEMENT) * key2->flickCount; + // kmap + if (key2->kmapCount > 0) { + kmap = reinterpret_cast(rawdata); + } else { + kmap = nullptr; // not an error + } + + // Now, validate offsets by walking + if (is_valid) { + for(KMX_DWORD i = 0; is_valid && i < key2->keyCount; i++) { + const auto &key = keys[i]; + // is the count off the end? + DebugLog( " id=0x%X, to=0x%X, flicks=%d", i, key.id, key.to, key.flicks); // TODO-LDML: could dump more fields here + if (key.flicks >0 && key.flicks >= key2->flicksCount) { + DebugLog("key[%d] has invalid flicks index %d", i, key.flicks); + is_valid = false; + assert(is_valid); + } + } + for(KMX_DWORD i = 0; is_valid && i < key2->flicksCount; i++) { + const auto &e = flickLists[i]; + // is the count off the end? + DebugLog(" %d: index %d, count %d", i, e.flick, e.count); + if (i == 0) { + if (e.flick != 0 || e.count != 0) { + DebugLog("Error: Invalid Flick #0"); + is_valid = false; + assert(is_valid); + } + } else if ((e.flick >= key2->flickCount) || (e.flick + e.count > key2->flickCount)) { + DebugLog("flicks[%d] would access flick %d+%d, > count %d", i, e.flick, e.count, key2->flickCount); + is_valid = false; + assert(is_valid); + } + } + for(KMX_DWORD i = 0; is_valid && i < key2->flickCount; i++) { + const auto &e = flickElements[i]; + // is the count off the end? + DebugLog(" %d: to=0x%X, directions=0x%X, flags=0x%X", i, e.to, e.directions, e.flags); + } + // now the kmap + DebugLog(" kmap count: #0x%X\n", key2->kmapCount); + for (KMX_DWORD i = 0; i < key2->kmapCount; i++) { + DebugLog(" #0x%d\n", i); + auto &entry = kmap[i]; + DebugLog(" vkey\t0x%X\n", entry.vkey); + DebugLog(" mod\t0x%X\n", entry.mod); + DebugLog(" key\t#0x%X\n", entry.key); + if (!LDML_IS_VALID_MODIFIER_BITS(entry.mod)) { + DebugLog("Invalid modifier value"); + assert(false); + is_valid = false; + } + if (entry.key >= key2->keyCount) { + // preposterous key # + DebugLog("kmap[0x%X].key = #0x%X, but that is >= keyCount 0x%X", i, entry.key, key2->keyCount); + assert(false); + is_valid = false; + } + } + } + // Return results + DebugLog("COMP_KMXPLUS_KEYS_Helper.setKeys(): %s", is_valid ? "valid" : "invalid"); + assert(is_valid); + return is_valid; +} + +const COMP_KMXPLUS_KEYS_KEY * +COMP_KMXPLUS_KEYS_Helper::getKeys(KMX_DWORD i) const { + if (!valid() || i >= key2->keyCount) { + assert(false); + return nullptr; + } + return keys + i; +} + +const COMP_KMXPLUS_KEYS_KEY* +COMP_KMXPLUS_KEYS_Helper::findKeyByStringId(KMX_DWORD strId, KMX_DWORD &i) const { + for (; i < key2->keyCount; i++) { + if (keys[i].id == strId) { + return &keys[i]; + } + } + return nullptr; +} + +const COMP_KMXPLUS_KEYS_KEY* +COMP_KMXPLUS_KEYS_Helper::findKeyByStringTo(KMX_DWORD strId, KMX_DWORD &i) const { + for (; i < key2->keyCount; i++) { + if (keys[i].to == strId) { + return &keys[i]; + } + } + return nullptr; +} + +const COMP_KMXPLUS_KEYS_FLICK_LIST * +COMP_KMXPLUS_KEYS_Helper::getFlickLists(KMX_DWORD i) const { + if (!valid() || i >= key2->flicksCount) { + assert(false); + return nullptr; + } + return flickLists + i; +} + +const COMP_KMXPLUS_KEYS_FLICK_ELEMENT * +COMP_KMXPLUS_KEYS_Helper::getFlickElements(KMX_DWORD i) const { + if (!valid() || i >= key2->flickCount) { + assert(false); + return nullptr; + } + return flickElements + i; +} + +const COMP_KMXPLUS_KEYS_KMAP * +COMP_KMXPLUS_KEYS_Helper::getKmap(KMX_DWORD i) const { + if (!valid() || i >= key2->kmapCount) { + assert(false); + return nullptr; + } + return kmap + i; +} + +std::u16string +COMP_KMXPLUS_KEYS_KEY::get_string() const { + assert(!(flags & LDML_KEYS_KEY_FLAGS_EXTEND)); // should not be called. + char16_single buf; + const int len = Utf32CharToUtf16(to, buf); + return std::u16string(buf.ch, len); +} + +// LIST + +bool +COMP_KMXPLUS_LIST::valid(KMX_DWORD _kmn_unused(length)) const { + if (header.size < sizeof(*this) + + (listCount * sizeof(COMP_KMXPLUS_LIST_ITEM)) + + (indexCount * sizeof(COMP_KMXPLUS_LIST_INDEX))) { + DebugLog("header.size < expected size"); + assert(false); + return false; + } + return true; +} + + +COMP_KMXPLUS_LIST_Helper::COMP_KMXPLUS_LIST_Helper() : list(nullptr), is_valid(false) { +} + +bool +COMP_KMXPLUS_LIST_Helper::setList(const COMP_KMXPLUS_LIST *newList) { + DebugLog("validating newList=%p", newList); + is_valid = true; + if (newList == nullptr) { + // null = invalid + is_valid = false; + // No assert here: just a missing layer + return false; + } + list = newList; + const uint8_t *rawdata = reinterpret_cast(newList); + rawdata += LDML_LENGTH_LIST; // skip past non-dynamic portion + // lists + if (list->listCount > 0) { + lists = reinterpret_cast(rawdata); + } else { + lists = nullptr; + // not invalid, just empty. + } + rawdata += sizeof(COMP_KMXPLUS_LIST_ITEM) * list->listCount; + // entries + if (list->indexCount > 0) { + indices = reinterpret_cast(rawdata); + } else { + indices = nullptr; + } + // rawdata += sizeof(COMP_KMXPLUS_LIST_INDEX) * list->indexCount; + + // Now, validate offsets by walking + if (is_valid) { + for (KMX_DWORD i = 0; is_valid && i < list->listCount; i++) { + const auto &e = lists[i]; + // is the count off the end? + DebugLog("list 0x%X: index %d, count %d", i, e.index, e.count); + if (i == 0) { + if (e.index != 0 || e.count != 0) { + DebugLog("Error: Invalid List #0"); + is_valid = false; + assert(is_valid); + } + } else if ((e.index >= list->indexCount) || (e.index + e.count > list->indexCount)) { + DebugLog("list[%d] would access index %d+%d, > count %d", i, e.index, e.count, list->indexCount); + is_valid = false; + assert(is_valid); + } + } + for (KMX_DWORD i = 0; is_valid && i < list->indexCount; i++) { + const auto &e = indices[i]; + DebugLog(" index %d: str 0x%X", i, e); + } + } + // Return results + DebugLog("COMP_KMXPLUS_LIST_Helper.setList(): %s", is_valid ? "valid" : "invalid"); + assert(is_valid); + return is_valid; +} + +const COMP_KMXPLUS_LIST_ITEM * +COMP_KMXPLUS_LIST_Helper::getList(KMX_DWORD i) const { + if (!valid() || i >= list->listCount) { + assert(false); + return nullptr; + } + return lists + i; +} + +const COMP_KMXPLUS_LIST_INDEX * +COMP_KMXPLUS_LIST_Helper::getIndex(KMX_DWORD i) const { + if (!valid() || i >= list->indexCount) { + assert(false); + return nullptr; + } + return indices + i; +} + +// ---- constructor + +kmx_plus::kmx_plus(const COMP_KEYBOARD *keyboard, size_t length) + : loca(nullptr), meta(nullptr), + sect(nullptr), strs(nullptr), vkey(nullptr), valid(false) { + + DebugLog("kmx_plus(): Got a COMP_KEYBOARD at %p\n", keyboard); + if (!(keyboard->dwFlags & KF_KMXPLUS)) { + DebugLog("Err: flags COMP_KEYBOARD.dwFlags did not have KF_KMXPLUS set"); + valid = false; + assert(valid); + return; + } + const COMP_KEYBOARD_EX* ex = reinterpret_cast(keyboard); + + DebugLog("kmx_plus(): KMXPlus offset 0x%X, KMXPlus size 0x%X\n", ex->kmxplus.dpKMXPlus, ex->kmxplus.dwKMXPlusSize); + if (ex->kmxplus.dpKMXPlus < sizeof(kmx::COMP_KEYBOARD_EX)) { + DebugLog("dwKMXPlus is not past the end of COMP_KEYBOARD_EX"); + valid = false; + assert(valid); + return; + } + if ( ex->kmxplus.dpKMXPlus + ex->kmxplus.dwKMXPlusSize > length) { + DebugLog("dpKMXPlus + dwKMXPlusSize is past the end of the file"); + valid = false; + assert(valid); + return; + } + + const uint8_t* rawdata = reinterpret_cast(keyboard); + + sect = section_from_bytes(rawdata+ex->kmxplus.dpKMXPlus, ex->kmxplus.dwKMXPlusSize); + if (sect == nullptr) { + DebugLog("kmx_plus(): 'sect' did not validate"); + valid = false; + } else { + valid = true; + // load other sections, validating as we go + // these will be nullptr if they don't validate + disp = section_from_sect(sect); + elem = section_from_sect(sect); + key2 = section_from_sect(sect); + layr = section_from_sect(sect); + list = section_from_sect(sect); + loca = section_from_sect(sect); + meta = section_from_sect(sect); + strs = section_from_sect(sect); + tran = section_from_sect(sect); + vkey = section_from_sect(sect); + + // calculate and validate the dynamic parts + (void)key2Helper.setKeys(key2); + (void)layrHelper.setLayr(layr); + (void)listHelper.setList(list); + } +} + +KMX_DWORD COMP_KMXPLUS_SECT::find(KMX_DWORD ident) const { + for (KMX_DWORD i = 0; i < count; i++) { + if (ident == entries[i].sect) { + return entries[i].offset; + } + } + return 0; +} + +std::u16string +COMP_KMXPLUS_STRS::get(KMX_DWORD entry) const { + assert(entry < count); + if (entry >= count) { + return std::u16string(); // Fallback: empty string + } + const KMX_DWORD offset = entries[entry].offset; + const KMX_DWORD length = entries[entry].length; + assert(offset+((length+1)*2) <= header.size); // assert not out of bounds + const uint8_t* thisptr = reinterpret_cast(this); + const KMX_WCHAR* start = reinterpret_cast(thisptr+offset); + return std::u16string(start, length); +} + +KMX_DWORD COMP_KMXPLUS_STRS::find(const std::u16string& s) const { + if (s.empty()) { + return 0; // shortcut + } + // TODO-LDML: suboptimal, but currently only run from the test runner. Could be a binary search since the strings are already in codepoint order. + for (KMX_DWORD i = 0; i +#include +#include +#include +#include + +namespace km { +namespace kbp { +namespace kmx { + +/** + * Using C99 flexible array initializers: entries[] + * https://docs.microsoft.com/en-us/cpp/error-messages/compiler-warnings/compiler-warning-levels-2-and-4-c4200 + */ +#if defined(_WIN32) +#pragma warning ( disable : 4200 ) +#endif + +/** + * Indicates an offset into the strs table (0 = zero length) + */ +typedef KMX_DWORD KMXPLUS_STR; +/** + * Indicates an offset into the list table (0 = zero length) +*/ +typedef KMX_DWORD KMXPLUS_LIST; +/** + * Indicates an offset into the elem table (0 = zero length) +*/ +typedef KMX_DWORD KMXPLUS_ELEM; + +// forward declarations +struct COMP_KMXPLUS_TRAN_ENTRY; +struct COMP_KMXPLUS_TRAN; + +struct COMP_KMXPLUS_HEADER { + KMX_DWORD ident; // 0000 Section name + KMX_DWORD size; // 0004 Section length + bool valid(KMX_DWORD length) const; +}; + +// Assert that the length matches the declared length +static_assert(sizeof(struct COMP_KMXPLUS_HEADER) == LDML_LENGTH_HEADER, "mismatched size of section header"); + +/* ------------------------------------------------------------------ + * sect section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_SECT_ENTRY { + KMX_DWORD sect; // 0010+ Section identity + KMX_DWORD offset; // 0014+ Section offset relative to dpKMXPlus of section +}; + +struct COMP_KMXPLUS_SECT { + static const KMX_DWORD IDENT = LDML_SECTIONID_SECT; + COMP_KMXPLUS_HEADER header; + KMX_DWORD total; // 0008 KMXPlus entire length + KMX_DWORD count; // 000C number of section headers + COMP_KMXPLUS_SECT_ENTRY entries[]; // 0010 section entries + /** + * @brief Get the offset of a section, or 0 + * + * @param ident section id such as 'strs'. Never 'sect' + * @return KMX_DWORD offset from beginning of kmxplus + */ + KMX_DWORD find(KMX_DWORD ident) const; + /** + * @brief True if section is valid. + * Does not validate the entire file. + */ + bool valid(KMX_DWORD length) const; +}; + +// Assert that the length matches the declared length +static_assert(sizeof(struct COMP_KMXPLUS_SECT) == LDML_LENGTH_SECT, "mismatched size of section sect"); +static_assert(sizeof(struct COMP_KMXPLUS_SECT) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); + +/* ------------------------------------------------------------------ + * bksp section + ------------------------------------------------------------------ */ + +typedef COMP_KMXPLUS_TRAN_ENTRY COMP_KMXPLUS_BKSP_ENTRY; +typedef COMP_KMXPLUS_TRAN COMP_KMXPLUS_BKSP; + +/* ------------------------------------------------------------------ + * elem section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_ELEM_ELEMENT { + KMX_DWORD element; // str: output string or UTF-32LE codepoint + KMX_DWORD flags; // flag and order values + /** + * @brief Get the 'to' as a string, if flags&LDML_ELEM_FLAGS_UNICODE_SET is not set + * + * @return std::u16string + */ + std::u16string get_string() const; +}; + +struct COMP_KMXPLUS_ELEM_ENTRY { + KMX_DWORD offset; // 0010+ offset from this blob + KMX_DWORD length; // 0014+ str length (ELEMENT units) +}; + +struct COMP_KMXPLUS_ELEM { + static const KMX_DWORD IDENT = LDML_SECTIONID_ELEM; + COMP_KMXPLUS_HEADER header; + KMX_DWORD count; // 0008 count of str entries + COMP_KMXPLUS_ELEM_ENTRY entries[]; // 000C+ entries + + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; + /** + * @param elementNumber element number, 0..count-1 + * @param length fillin: length of list + * @return pointer to first element of list of length length. or nullptr + */ + const COMP_KMXPLUS_ELEM_ELEMENT *getElementList(KMX_DWORD elementNumber, + KMX_DWORD &length) const; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_ELEM) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_ELEM) == LDML_LENGTH_ELEM, "mismatched size of section elem"); + +/* ------------------------------------------------------------------ + * finl section + ------------------------------------------------------------------ */ + +// TODO-LDML: IDENT +typedef COMP_KMXPLUS_TRAN_ENTRY COMP_KMXPLUS_FINL_ENTRY; + +// TODO-LDML: IDENT +typedef COMP_KMXPLUS_TRAN COMP_KMXPLUS_FINL; + +/* ------------------------------------------------------------------ + * keys section is now key2.kmap + ------------------------------------------------------------------ */ + +/* ------------------------------------------------------------------ + * loca section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_LOCA_ENTRY { + KMXPLUS_STR locale; // 0010+ locale string entry +}; + +struct COMP_KMXPLUS_LOCA { + static const KMX_DWORD IDENT = LDML_SECTIONID_LOCA; + COMP_KMXPLUS_HEADER header; + KMX_DWORD count; // 0008 number of locales + COMP_KMXPLUS_LOCA_ENTRY entries[]; + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_LOCA) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_LOCA) == LDML_LENGTH_LOCA, "mismatched size of section loca"); + +/* ------------------------------------------------------------------ + * meta section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_META { + static const KMX_DWORD IDENT = LDML_SECTIONID_META; + COMP_KMXPLUS_HEADER header; + KMXPLUS_STR author; + KMXPLUS_STR conform; + KMXPLUS_STR layout; + KMXPLUS_STR normalization; + KMXPLUS_STR indicator; + KMXPLUS_STR version; + KMX_DWORD settings; + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_META) == LDML_LENGTH_META, "mismatched size of section meta"); + +/* ------------------------------------------------------------------ + * name section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_NAME_ENTRY { + KMXPLUS_STR name; +}; + +struct COMP_KMXPLUS_NAME { + static const KMX_DWORD IDENT = LDML_SECTIONID_NAME; + COMP_KMXPLUS_HEADER header; + KMX_DWORD count; + COMP_KMXPLUS_NAME_ENTRY entries[]; + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_NAME) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_NAME) == LDML_LENGTH_NAME, "mismatched size of section name"); + +/* ------------------------------------------------------------------ + * ordr section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_ORDR_ENTRY { + KMXPLUS_ELEM elements; + KMXPLUS_ELEM before; +}; + +struct COMP_KMXPLUS_ORDR { + static const KMX_DWORD IDENT = LDML_SECTIONID_ORDR; + COMP_KMXPLUS_HEADER header; + KMX_DWORD count; + COMP_KMXPLUS_ORDR_ENTRY entries[]; + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_ORDR) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_ORDR) == LDML_LENGTH_ORDR, "mismatched size of section ordr"); + +/* ------------------------------------------------------------------ + * strs section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_STRS_ENTRY { + KMX_DWORD offset; // 0010+ offset from this blob + KMX_DWORD length; // 0014+ str length (UTF-16LE units) +}; + +struct COMP_KMXPLUS_STRS { + static const KMX_DWORD IDENT = LDML_SECTIONID_STRS; + COMP_KMXPLUS_HEADER header; + KMX_DWORD count; // 0008 count of str entries + COMP_KMXPLUS_STRS_ENTRY entries[]; // 0010+ entries + + /** + * @brief Get a string entry + * + * @param entry entry number + * @param buf output buffer + * @param bufsiz buffer size in bytes + * @return nullptr or a pointer to the output buffer + */ + std::u16string get(KMX_DWORD entry) const; + + /** + * Slow search + */ + KMX_DWORD find(const std::u16string&) const; + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_STRS) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_STRS) == LDML_LENGTH_STRS, "mismatched size of section strs"); + +/* ------------------------------------------------------------------ + * tran section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_TRAN_ENTRY { + KMXPLUS_ELEM from; + KMXPLUS_STR to; + KMXPLUS_ELEM before; + KMX_DWORD flags; +}; + + +struct COMP_KMXPLUS_TRAN { + static const KMX_DWORD IDENT = LDML_SECTIONID_TRAN; + COMP_KMXPLUS_HEADER header; + KMX_DWORD count; + COMP_KMXPLUS_TRAN_ENTRY entries[]; + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_TRAN) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_TRAN) == LDML_LENGTH_TRAN, "mismatched size of section tran"); + +/* ------------------------------------------------------------------ + * vkey section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_VKEY_ENTRY { + KMX_DWORD vkey; + KMX_DWORD target; +}; + +struct COMP_KMXPLUS_VKEY { + static const KMX_DWORD IDENT = LDML_SECTIONID_VKEY; + COMP_KMXPLUS_HEADER header; + KMX_DWORD count; + COMP_KMXPLUS_VKEY_ENTRY entries[]; + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_VKEY) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_VKEY) == LDML_LENGTH_VKEY, "mismatched size of section vkey"); + + +/* ------------------------------------------------------------------ + * disp section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_DISP_ENTRY { + KMX_DWORD to; + KMX_DWORD display; +}; + +struct COMP_KMXPLUS_DISP { + static const KMX_DWORD IDENT = LDML_SECTIONID_DISP; + COMP_KMXPLUS_HEADER header; + KMX_DWORD count; + KMXPLUS_STR baseCharacter; + COMP_KMXPLUS_DISP_ENTRY entries[]; + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_DISP) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_DISP) == LDML_LENGTH_DISP, "mismatched size of section disp"); + + + +/* ------------------------------------------------------------------ + * layr section + ------------------------------------------------------------------ */ + +struct COMP_KMXPLUS_LAYR_LIST { + KMX_DWORD hardware; + KMX_DWORD layer; + KMX_DWORD count; + KMX_DWORD minDeviceWidth; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_LAYR_LIST) == LDML_LENGTH_LAYR_LIST, "mismatched size of COMP_KMXPLUS_LAYR_LIST"); + +struct COMP_KMXPLUS_LAYR_ENTRY { + KMXPLUS_STR id; + KMX_DWORD mod; + KMX_DWORD row; + KMX_DWORD count; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_LAYR_ENTRY) == LDML_LENGTH_LAYR_ENTRY, "mismatched size of COMP_KMXPLUS_LAYR_ENTRY"); + +struct COMP_KMXPLUS_LAYR_ROW { + KMX_DWORD key; + KMX_DWORD count; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_LAYR_ROW) == LDML_LENGTH_LAYR_ROW, "mismatched size of COMP_KMXPLUS_LAYR_ROW"); + + +struct COMP_KMXPLUS_LAYR_KEY { + KMX_DWORD key; // index into key2 section +}; + +static_assert(sizeof(struct COMP_KMXPLUS_LAYR_KEY) == LDML_LENGTH_LAYR_KEY, "mismatched size of COMP_KMXPLUS_LAYR_KEY"); + +struct COMP_KMXPLUS_LAYR { + static const KMX_DWORD IDENT = LDML_SECTIONID_LAYR; + COMP_KMXPLUS_HEADER header; + KMX_DWORD listCount; + KMX_DWORD layerCount; + KMX_DWORD rowCount; + KMX_DWORD keyCount; + // entries, rows, and keys have a dynamic offset + // use COMP_KMXPLUS_LAYR_Helper to access. + // + // COMP_KMXPLUS_LAYR_LIST lists[]; + // COMP_KMXPLUS_LAYR_ENTRY entries[]; + // COMP_KMXPLUS_LAYR_ROW rows[]; + // COMP_KMXPLUS_LAYR_KEY keys[]; + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +/** + * Helper accessor for the dynamic part of a layr section. + */ +class COMP_KMXPLUS_LAYR_Helper { +public: + COMP_KMXPLUS_LAYR_Helper(); + /** + * Initialize the helper to point at a layr section. + * @return true if valid + */ + bool setLayr(const COMP_KMXPLUS_LAYR *newLayr); + bool valid() const; + + const COMP_KMXPLUS_LAYR_LIST *getList(KMX_DWORD list) const; + const COMP_KMXPLUS_LAYR_ENTRY *getEntry(KMX_DWORD entry) const; + const COMP_KMXPLUS_LAYR_ROW *getRow(KMX_DWORD row) const; + const COMP_KMXPLUS_LAYR_KEY *getKey(KMX_DWORD key) const; + +private: + const COMP_KMXPLUS_LAYR *layr; + bool is_valid; + const COMP_KMXPLUS_LAYR_LIST *lists; + const COMP_KMXPLUS_LAYR_ENTRY *entries; + const COMP_KMXPLUS_LAYR_ROW *rows; + const COMP_KMXPLUS_LAYR_KEY *keys; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_LAYR) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_LAYR) == LDML_LENGTH_LAYR, "mismatched size of section layr"); + +/* ------------------------------------------------------------------ + * key2 section + ------------------------------------------------------------------ */ +struct COMP_KMXPLUS_KEYS { + static const KMX_DWORD IDENT = LDML_SECTIONID_KEYS; + COMP_KMXPLUS_HEADER header; + KMX_DWORD keyCount; + KMX_DWORD flicksCount; + KMX_DWORD flickCount; + KMX_DWORD kmapCount; + // see helper for: keys sub-table + // see helper for: flick lists sub-table + // see helper for: flick elements sub-table + // see helper for: kmap sub-table + + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +struct COMP_KMXPLUS_KEYS_FLICK_ELEMENT { + KMXPLUS_LIST directions; + KMX_DWORD flags; + KMXPLUS_STR to; // string or codepoint +}; + +struct COMP_KMXPLUS_KEYS_FLICK_LIST { + KMX_DWORD count; + KMX_DWORD flick; // flick index + KMXPLUS_STR id; +}; + +struct COMP_KMXPLUS_KEYS_KEY { + KMXPLUS_STR to; + KMX_DWORD flags; + KMXPLUS_STR id; + KMXPLUS_STR switchId; // switch + KMX_DWORD width; // unit: 0.1 keys + KMXPLUS_LIST longPress; + KMXPLUS_STR longPressDefault; + KMXPLUS_LIST multiTap; + KMX_DWORD flicks; // index + + std::u16string get_string() const; +}; + +struct COMP_KMXPLUS_KEYS_KMAP { + KMX_DWORD vkey; + KMX_DWORD mod; + KMX_DWORD key; // index into key subtable +}; + +class COMP_KMXPLUS_KEYS_Helper { +public: + COMP_KMXPLUS_KEYS_Helper(); + /** + * Initialize the helper to point at a layr section. + * @return true if valid + */ + bool setKeys(const COMP_KMXPLUS_KEYS *newKeys); + inline bool valid() const { return is_valid; } + + const COMP_KMXPLUS_KEYS_KEY *getKeys(KMX_DWORD key) const; + const COMP_KMXPLUS_KEYS_FLICK_LIST *getFlickLists(KMX_DWORD list) const; + const COMP_KMXPLUS_KEYS_FLICK_ELEMENT *getFlickElements(KMX_DWORD element) const; + const COMP_KMXPLUS_KEYS_KMAP *getKmap(KMX_DWORD element) const; + + /** + * Search for a key by string id. + * @param strID id to search for + * @param index on entry, id to start with such as 0. On exit, index of item if found. Undefined otherwise. + * @return pointer to key or nullptr + */ + const COMP_KMXPLUS_KEYS_KEY *findKeyByStringId(KMX_DWORD strId, KMX_DWORD &index) const; + /** + * Search for a key by 'to' string id + * @param strID id to search for + * @param index on entry, id to start with such as 0. On exit, index of item if found. Undefined otherwise. + * @return pointer to key or nullptr + */ + const COMP_KMXPLUS_KEYS_KEY *findKeyByStringTo(KMX_DWORD strId, KMX_DWORD &index) const; + +private: + const COMP_KMXPLUS_KEYS *key2; + bool is_valid; + const COMP_KMXPLUS_KEYS_KEY *keys; + const COMP_KMXPLUS_KEYS_FLICK_LIST *flickLists; + const COMP_KMXPLUS_KEYS_FLICK_ELEMENT *flickElements; + const COMP_KMXPLUS_KEYS_KMAP *kmap; +}; + +static_assert(sizeof(struct COMP_KMXPLUS_KEYS_KEY) == LDML_LENGTH_KEYS_KEY, "mismatched size of key2.key"); +static_assert(sizeof(struct COMP_KMXPLUS_KEYS_FLICK_ELEMENT) == LDML_LENGTH_KEYS_FLICK_ELEMENT, "mismatched size of key2.flick"); +static_assert(sizeof(struct COMP_KMXPLUS_KEYS_FLICK_LIST) == LDML_LENGTH_KEYS_FLICK_LIST, "mismatched size of key2.flicks"); +static_assert(sizeof(struct COMP_KMXPLUS_KEYS_KMAP) == LDML_LENGTH_KEYS_KMAP, "mismatched size of key2.kmap"); +static_assert(sizeof(struct COMP_KMXPLUS_KEYS) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_KEYS) == LDML_LENGTH_KEYS, "mismatched size of section key2"); + +/* ------------------------------------------------------------------ + * list section + ------------------------------------------------------------------ */ +struct COMP_KMXPLUS_LIST { + static const KMX_DWORD IDENT = LDML_SECTIONID_LIST; + COMP_KMXPLUS_HEADER header; + KMX_DWORD listCount; + KMX_DWORD indexCount; + // see helper for: lists sub-table + // see helper for: indices sub-table + + /** + * @brief True if section is valid. + */ + bool valid(KMX_DWORD length) const; +}; + +/** + * list.list subtable + */ +struct COMP_KMXPLUS_LIST_ITEM { + KMX_DWORD index; + KMX_DWORD count; +}; + +/** + * list.index + */ +typedef KMX_DWORD COMP_KMXPLUS_LIST_INDEX; + + +class COMP_KMXPLUS_LIST_Helper { +public: + COMP_KMXPLUS_LIST_Helper(); + /** + * Initialize the helper to point at a layr section. + * @return true if valid + */ + bool setList(const COMP_KMXPLUS_LIST *newList); + inline bool valid() const { return is_valid; } + + const COMP_KMXPLUS_LIST_ITEM *getList(KMX_DWORD list) const; + const COMP_KMXPLUS_LIST_INDEX *getIndex(KMX_DWORD index) const; + +private: + const COMP_KMXPLUS_LIST *list; + bool is_valid; + const COMP_KMXPLUS_LIST_ITEM *lists; + const COMP_KMXPLUS_LIST_INDEX *indices; +}; + + +static_assert(sizeof(struct COMP_KMXPLUS_LIST) % 0x4 == 0, "Structs prior to variable part should align to 32-bit boundary"); +static_assert(sizeof(struct COMP_KMXPLUS_LIST) == LDML_LENGTH_LIST, "mismatched size of section list"); +static_assert(sizeof(struct COMP_KMXPLUS_LIST_ITEM) == LDML_LENGTH_LIST_ITEM, "mismatched size of section list.lists subtable"); +static_assert(sizeof(COMP_KMXPLUS_LIST_INDEX) == LDML_LENGTH_LIST_INDEX, "mismatched size of section list.indices subtable"); + +/** + * @brief helper accessor object for KMX Plus data + * + */ +class kmx_plus { + public: + /** + * @brief Construct a new kmx_plus object. + * Caller must preserve the keyboard file memory + * until after this object is destroyed. + * + * @param keyboard the KMX data + * @param length length of the entire KMX file + */ + kmx_plus(const COMP_KEYBOARD *keyboard, size_t length); + // keep the next elements sorted + const COMP_KMXPLUS_DISP *disp; + const COMP_KMXPLUS_ELEM *elem; + const COMP_KMXPLUS_KEYS *key2; + const COMP_KMXPLUS_LAYR *layr; + const COMP_KMXPLUS_LIST *list; + const COMP_KMXPLUS_LOCA *loca; + const COMP_KMXPLUS_META *meta; + const COMP_KMXPLUS_SECT *sect; + const COMP_KMXPLUS_STRS *strs; + const COMP_KMXPLUS_TRAN *tran; + const COMP_KMXPLUS_VKEY *vkey; + inline bool is_valid() { return valid; } + COMP_KMXPLUS_LAYR_Helper layrHelper; + COMP_KMXPLUS_LIST_Helper listHelper; + COMP_KMXPLUS_KEYS_Helper key2Helper; + private: + bool valid; // true if valid +}; + +/** + * See above - undo workaround for variable arrays + */ +#if defined(_WIN32) +#pragma warning ( default : 4200 ) +#endif + +} // namespace kmx +} // namespace kbp +} // namespace km diff --git a/core/src/kmx/kmx_processevent.h b/core/src/kmx/kmx_processevent.h index ef799bb9fd125829499ffb928fa666e03b0bd43c..a7fd9235395521d842f8875765a7ff79630a886d 100644 --- a/core/src/kmx/kmx_processevent.h +++ b/core/src/kmx/kmx_processevent.h @@ -12,6 +12,7 @@ #include #include #include +#include "debuglog.h" #include "kmx_base.h" #include "kmx_file.h" #include "kmx_context.h" @@ -29,7 +30,6 @@ namespace km { namespace kbp { namespace kmx { - /* Utility */ #define GLOBAL_ContextStackSize 80 @@ -57,7 +57,6 @@ private: KMX_BOOL LoadKeyboard(km_kbp_path_name fileName, LPKEYBOARD *lpKeyboard); KMX_BOOL VerifyKeyboard(PKMX_BYTE filebase, size_t sz); KMX_BOOL VerifyChecksum(PKMX_BYTE buf, size_t sz); - PKMX_WCHAR StringOffset(PKMX_BYTE base, KMX_DWORD offset); #ifdef KMX_64BIT LPKEYBOARD CopyKeyboard(PKMX_BYTE bufp, PKMX_BYTE base); #else @@ -108,6 +107,10 @@ public: KMX_Environment *GetEnvironment(); KMX_Environment const *GetEnvironment() const; INTKEYBOARDINFO const *GetKeyboard() const; + + // Utility function +public: + static PKMX_WCHAR StringOffset(PKMX_BYTE base, KMX_DWORD offset); }; inline KMX_BOOL KMX_ProcessEvent::IsCapsLockOn(KMX_DWORD modifiers) { @@ -121,41 +124,7 @@ struct char_to_vkey { bool shifted, caps; }; -struct modifier_names { - const char *name; - uint16_t modifier; -}; - extern const struct char_to_vkey s_char_to_vkey[]; -extern const char *s_key_names[]; -extern const struct modifier_names s_modifier_names[]; - -/* Debugging */ - -extern KMX_BOOL g_debug_ToConsole, g_debug_KeymanLog, g_silent; - -#ifdef _MSC_VER -#define DebugLog(msg,...) (km::kbp::kmx::ShouldDebug() ? km::kbp::kmx::DebugLog_1(__FILE__, __LINE__, __FUNCTION__, (msg),__VA_ARGS__) : 0) -#define console_error(msg,...) write_console(TRUE, (msg), __VA_ARGS__) -#define console_log(msg,...) write_console(FALSE, (msg), __VA_ARGS__) -#else -#define DebugLog(msg,...) (ShouldDebug() ? DebugLog_1(__FILE__, __LINE__, __FUNCTION__, (msg), ##__VA_ARGS__) : 0) -#define console_error(msg,...) write_console(TRUE, (msg), ##__VA_ARGS__) -#define console_log(msg,...) write_console(FALSE, (msg), ##__VA_ARGS__) -#endif - -int DebugLog_1(const char *file, int line, const char *function, const char *fmt, ...); -const char *Debug_VirtualKey(KMX_WORD vk); -const char *Debug_UnicodeString(PKMX_WCHAR s, int x = 0); -const char *Debug_UnicodeString(std::u16string s, int x = 0); -const char *Debug_ModifierName(KMX_UINT modifiers); - -inline KMX_BOOL ShouldDebug() { - return g_debug_KeymanLog; -} - - -void write_console(KMX_BOOL error, const wchar_t *fmt, ...); } // namespace kmx } // namespace kbp diff --git a/core/src/kmx/kmx_processor.cpp b/core/src/kmx/kmx_processor.cpp index 30cc942671eb9718437072d5236a0ac8ba64cdca..81da199c9cc76234bc606093ef464ea1ba86c668 100644 --- a/core/src/kmx/kmx_processor.cpp +++ b/core/src/kmx/kmx_processor.cpp @@ -249,7 +249,8 @@ kmx_processor::process_event( km_kbp_state *state, km_kbp_virtual_key vk, uint16_t modifier_state, - uint8_t is_key_down + uint8_t is_key_down, + uint16_t /* event_flags */ ) { // Construct a context buffer from the items std::u16string ctxt; @@ -257,11 +258,10 @@ kmx_processor::process_event( for (auto c = cp.begin(); c != cp.end(); c++) { switch (c->type) { case KM_KBP_CT_CHAR: - if (Uni_IsSMP(c->character)) { - ctxt += Uni_UTF32ToSurrogate1(c->character); - ctxt += Uni_UTF32ToSurrogate2(c->character); - } else { - ctxt += (km_kbp_cp)c->character; + { + km::kbp::kmx::char16_single buf; + const int len = km::kbp::kmx::Utf32CharToUtf16(c->character, buf); + ctxt.append(buf.ch, len); } break; case KM_KBP_CT_MARKER: diff --git a/core/src/kmx/kmx_processor.hpp b/core/src/kmx/kmx_processor.hpp index 0107d45f8595a675a07d6962f8935fc7de50207c..124feb3a3b8e28dccdded6444f5c457d12fc8f9c 100644 --- a/core/src/kmx/kmx_processor.hpp +++ b/core/src/kmx/kmx_processor.hpp @@ -36,7 +36,8 @@ namespace kbp km_kbp_state *state, km_kbp_virtual_key vk, uint16_t modifier_state, - uint8_t is_key_down + uint8_t is_key_down, + uint16_t event_flags ) override; km_kbp_attr const & attributes() const override; diff --git a/core/src/kmx/kmx_xstring.h b/core/src/kmx/kmx_xstring.h index cc85c934f2d6152b9d6cced883307b9a30568712..fafa277ed79faddb87643d18267958e13ac2d5f0 100644 --- a/core/src/kmx/kmx_xstring.h +++ b/core/src/kmx/kmx_xstring.h @@ -6,15 +6,57 @@ namespace km { namespace kbp { namespace kmx { +/** + * @brief True if a lead surrogate + * \def Uni_IsSurrogate1 + */ #define Uni_IsSurrogate1(ch) ((ch) >= 0xD800 && (ch) <= 0xDBFF) +/** + * @brief True if a trail surrogate + * \def Uni_IsSurrogate2 + */ #define Uni_IsSurrogate2(ch) ((ch) >= 0xDC00 && (ch) <= 0xDFFF) -#define Uni_IsSMP(ch) ((ch) >= 0x10000) +/** + * @brief Returns true if BMP (Plane 0) + * \def Uni_IsBMP + */ +#define Uni_IsBMP(ch) ((ch) < 0x10000) + +/** + * @brief Convert two UTF-16 surrogates into one UTF-32 codepoint + * @param ch lead surrogate - Uni_IsSurrogate1(ch) must == true + * @param cl trail surrogate - Uni_IsSurrogate2(cl) must == true + * \def Uni_SurrogateToUTF + */ #define Uni_SurrogateToUTF32(ch, cl) (((ch) - 0xD800) * 0x400 + ((cl) - 0xDC00) + 0x10000) +/** + * @brief Convert UTF-32 BMP to UTF-16 BMP + * @param ch codepoint - Uni_IsBMP(ch) must == true + * \def Uni_UTF32BMPToUTF16 + */ +#define Uni_UTF32BMPToUTF16(ch) (ch & 0xFFFF) + #define Uni_UTF32ToSurrogate1(ch) (char16_t)(((ch) - 0x10000) / 0x400 + 0xD800) #define Uni_UTF32ToSurrogate2(ch) (char16_t)(((ch) - 0x10000) % 0x400 + 0xDC00) +/** + * char16_t array big enough to hold a single Unicode codepoint, + * including trailing null. + */ +typedef struct { + char16_t ch[3]; +} char16_single; + +/** + * Convert a UTF-32 codepoint to UTF-16 code unit(s). + * @param ch32 input codepoint + * @param ch16 output buffer + * @return int length returned (not including null). Will return 1 (BMP) or 2 + */ +int Utf32CharToUtf16(const KMX_DWORD ch32, char16_single& ch16); + PKMX_WCHAR incxstr(PKMX_WCHAR p); PKMX_WCHAR decxstr(PKMX_WCHAR p, PKMX_WCHAR pStart); int xstrlen(PKMX_WCHAR p); @@ -38,6 +80,59 @@ km_kbp_cp *u16dup(km_kbp_cp *src); //KMX_BOOL MapUSCharToVK(KMX_WORD ch, PKMX_WORD puKey, PKMX_DWORD puShiftFlags); +// --- implementation --- + +inline int +Utf32CharToUtf16(const KMX_DWORD ch32, char16_single &ch16) { + int len; + if (Uni_IsBMP(ch32)) { + len = 1; + ch16.ch[0] = Uni_UTF32BMPToUTF16(ch32); + ch16.ch[1] = 0; + } else { + len = 2; + ch16.ch[0] = Uni_UTF32ToSurrogate1(ch32); + ch16.ch[1] = Uni_UTF32ToSurrogate2(ch32); + ch16.ch[2] = 0; + } + return len; +} + +/** + * Convert a u16 string to a u32 string. + * Mismatched surrogates or sliced surrogates are replaced with U+FFFD (replacement character). + * @param source UTF-16 string + * @return a UTF-32 string + */ +inline std::u32string +u16string_to_u32string(const std::u16string &source) { + std::u32string out; + + for (auto ptr = source.begin(); ptr < source.end(); ptr++) { + const char16_t lead = *ptr; + if (Uni_IsSurrogate1(lead)) { + ptr++; + if (ptr == source.end()) { + // DebugLog("End of string during surrogate pair"); + out.push_back(0xFFFD); // error + return out; + } + const char16_t trail = *ptr; + if (!Uni_IsSurrogate2(trail)) { + out.push_back(0xFFFD); // error, mismatched lead surrogate + ptr--; // reprocess remaining char + } else { + out.push_back(Uni_SurrogateToUTF32(lead, trail)); + } + } else if (Uni_IsSurrogate2(lead)) { + out.push_back(0xFFFD); // error - mismatched trail surrogate + } else { + out.push_back(lead); + } + } + return out; +} + } // namespace kmx } // namespace kbp } // namespace km diff --git a/core/src/ldml/C7043_ldml.md b/core/src/ldml/C7043_ldml.md new file mode 100644 index 0000000000000000000000000000000000000000..16849985fb54a2574296db28aba31a1a9878ad5a --- /dev/null +++ b/core/src/ldml/C7043_ldml.md @@ -0,0 +1,531 @@ +# KMX Plus Binary Format #7043 + +- copied from + +- Authors: MD SL + +## C7043.0 Introduction + +This document discusses the binary format for KMXPlus, which contains keyboards +converted from source LDML data. + +Draft spec PR: + +## C7043.1 Principles + +- The data described here is located at byte offset `dpKMXPlus`. +- All integer values are unsigned 32-bit little-endian unless otherwise + specified. +- All strings are UTF-16LE unless otherwise specified. (See the `strs` section.) + String data items are identified with `str:`, indicating a 32 bit index into + the `strs` table. +- All offsets are 32-bit little-endian values. For all sections except for the + `'sect'` section (which see), offsets are relative to the beginning of each + section. + +## C7043.2 Sections + +- Data is divided into several sections. The very first section is the `'sect'` + section which is the table of contents. +- All sections begin with a 32-bit (four character) section identifier, and a + 32-bit section size. +- Other than the `sect` table itself, the rest of the sections follow in binary + order in the file. In other words, the binary ordering of the section + identifiers determines the order of the file layout. +- All sections other than the `sect` table are optional + +### C7043.2.1 `sect`—Section Table of contents + +The very first section is a table of contents listing the rest of the sections. +The table of contents does not list itself. + +This is the only section where all byte offsets are relative to the value of +`dpKMXPlus`. + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +| 0 | 32 | ident | `sect` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | total | int: KMXPlus entire length | +|12 | 32 | count | int: Number of following section headers | + +Then for `count` repetitions: + +| ∆ | Bits | Name | Description | +|---|------|---------|---------------------------------------------------| +|16+| 32 | sect | Section identity, e.g. `loca` | +|20+| 32 | offset | off: offset relative to `dpKMXPlus` of section | + +This list is in sorted order based on the `sect` identifier. + +### C7043.2.2 `bksp`—Backspace transform + +See [C7043.2.11](#c7043211-tran-finl-and-bksptransforms). + +### C7043.2.3 `elem`—Transform and Reorder element strings + +| ∆ | Bits | Name | Description | +|---|------|----------|------------------------------------------| +| 0 | 32 | ident | `elem` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | count | int: Number of element string entries | + +Then for each element string: + +| ∆ | Bits | Name | Description | +|---|------|---------------|-----------------------------------------------| +|16+| 32 | offset | off: Offset to element string | +|20+| 32 | length | int: Number of elements in element string | + +The first entry in the element string list MUST be the null element string, +which has zero length and zero offset. + +Each element string is made up of elements with the following item structure: + +| ∆ | Bits | Name | Description | +|---|------|-----------|----------------------------------------------------------| +| 0 | 32 | element | str: output string OR UTF-32LE codepoint | +| 4 | 32 | flags | flags and order values | + +- `element`: either a UnicodeSet stored in a `strs` section entry, or a UTF-32LE + codepoint; see also `unicode_set` flag. +- `flags`: a 32-bit bitfield defined as below: + + | Bit position | Meaning | Description | + |--------------|---------------|----------------------------------| + | 0 | unicode_set | `element` is 0: UTF-32LE, 1: str | + | 1 | tertiary_base | 1: tertiary_base is true | + | 2 | prebase | 1: prebase is true | + | 3-15 | reserved | reserved | + | 16-23 | order | signed int: -128 to +127 | + | 24-31 | tertiary | signed int: -128 to +127 | + + For transforms, only `flags.unicode_set` will be used. The remaining flags are + used for reorders, `from` attribute only. + +### C7043.2.4 `finl`—Final transform + +See [C7043.2.11](#c7043211-tran-finl-and-bksptransforms). + +### C7043.2.5 Removed: `keys` + +_this section has been merged into the new `keys.kmap`_ + +### C7043.2.6 `loca`—Locales + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +| 0 | 32 | ident | `loca` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | count | int: Number of locales | + +`count` is always ≥1, because a keyboard always has a primary locale identifier. + +For each locale ID in `count` + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +|16+| 32 | locale | str: Locale ID in BCP47 format | + +The first locale ID is always the primary locale identifier. The rest of the +locale IDs (starting at offset 16) are in sorted binary order. + +### C7043.2.7 `meta`—Metadata + +| ∆ | Bits | Name | Description | +|---|------|---------------|-------------------------------------| +| 0 | 32 | ident | `meta` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | author | str: Keyboard author | +|12 | 32 | conform | str: CLDR 'conformsTo' version | +|16 | 32 | layout | str: layout type | +|20 | 32 | normalization | str: normalization mode | +|24 | 32 | indicator | str: indicator | +|28 | 32 | settings | int: keyboard settings | + +The `settings` is a 32-bit bitfield as below: + +| Bit position | Meaning | Description | +|--------------|------------------|------------------------------| +| 0 | fallback | fallback=omit | +| 1 | transformFailure | transformFailure=omit | +| 2 | transformPartial | transformPartial=hide | + +### C7043.2.8 `name`—Names + +Defines the names of the keyboard as found in the source `` element. +While this section is optional in the binary format, in practice it will always +be present, as the source format requires at least one name. + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +| 0 | 32 | ident | `name` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | count | int: Number of names | + +Note that `count` is always ≥1, as the source format requires at least one name. + +For each name in `count`: + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +|16+| 32 | name | str: A name for the keyboard | + +Names are stored in source file order, and the semantic meaning of each name is +not defined here. + +### C7043.2.9 `ordr`—Reorders + +| ∆ | Bits | Name | Description | +|---|------|----------|------------------------------------------| +| 0 | 32 | ident | `ordr` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | count | int: Number of reorders | + +For each reorder item: + +| ∆ | Bits | Name | Description | +|---|------|----------|----------------------------------------------------------| +|16+| 32 | elements | elem: string of elements, index into `elem` section | +|20+| 32 | before | elem: look-behind required match, index into `elem` | + +- `elements`: index into the `elem` section, coding `from`, `order`, `tertiary`, + `tertiary_base`, and `prebase` properties. +- `before`: follows `transform/@before` + +### C7043.2.10 `strs`—Strings + +All strings are stored in the Strings section. + +| ∆ | Bits | Name | Description | +|---|------|---------------|-------------------------------------| +| 0 | 32 | ident | `strs` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | count | int: Number of strings | + +Then for each string: + +| ∆ | Bits | Name | Description | +|---|------|---------------|-----------------------------------------------| +|16+| 32 | offset | off: Offset to string | +|20+| 32 | length | int: Length of string in UTF-16LE code units | + +After the string offset table comes the actual UTF-16LE data. There is a null +(\u0000) after each string, which is _not_ included in the string length. + +The string offset table, and then strings themselves, are sorted according to a +binary codepoint sort, not including the null. + +The first string in the string table MUST always be the zero-length string. A +zero-length string is considered the same as a null string. For metadata fields, +references to this zero-length string will have the dword index value 0, which +can safely be interpreted as "not set". There may be other locations which have +required strings, but for which a zero-length string is permissible, and this +index value of 0 can be used for that purpose. + +A distinction between zero-length string and optional should be avoided (e.g. +the difference between "" and null in Javascript). If this is truly required, a +separate flag field must be used to denote the difference. + +### C7043.2.11 `tran`, `finl`, and `bksp`—Transforms + +All three of these tables have the same format. and differ only in their +identity. The simple transform table has the ident `tran`; the final transform +table has the ident `finl`, and the backspaces table has the ident `bksp`. + + +| ∆ | Bits | Name | Description | +|---|------|----------|------------------------------------------| +| 0 | 32 | ident | `tran` / `finl` / `bksp` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | count | int: Number of transforms | + + +The transforms are sorted in binary order based on the `from` field. + +For each transform: + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +|16+| 32 | from | elem: combination of characters | +|20+| 32 | to | str: output text | +|24+| 32 | before | elem: look-behind text (0 = omitted) | +|28+| 32 | flags | int: per-transform flags | + +- `from`: the source text, index into `elem` section. +- `to`: sequence of Unicode codepoints that replace `from`. May be the null + string for `bksp` entries. +- `before`: optional look-behind text occurring before `from`, index into `elem` + section +- `flags`: a 32-bit bitfield defined as below: + + | Bit position | Meaning | Description | + |--------------|----------|----------------------| + | 0 | error | 1: `error="fail"` | + +### C7043.2.12 `vkey`—VKey Map + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +| 0 | 32 | ident | `vkey` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | count | int: Number of vkeys | + +The keys are sorted in binary order based on the `vkey` field. + +For each key: + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +|16+| 32 | vkey | int: source vkey ID (0…255) | +|20+| 32 | target | int: target vkey ID (0…255) | + +- `vkey`: Is the standard vkey, 0-255 +- `target`: Is the target (resolved) vkey, 0-255. + +### C7043.2.13 `layr`—Layers list + +Represents layers on the keyboard. +- Each key entry corresponds to a key on the row + +| ∆ | Bits | Name | Description | +|---|------|------------|------------------------------------------| +| 0 | 32 | ident | `layr` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | listCount | int: Number of layer lists | +|12 | 32 | layerCount | int: number of layer entries | +|16 | 32 | rowCount | int: number of row entries | +|20 | 32 | keyCount | int: number of key entries | +|24 | var | lists | layer list sub-table | +| - | var | layers | layers sub-table | +| - | var | rows | rows sub-table | +| - | var | keys | keys sub-table | + +### `layr.lists` subtable + +Each layer list corresponds to one `` element. +There are `listCount` total lists. + +| ∆ | Bits | Name | Description | +|---|------|------------------|--------------------------------------------| +| 0+| 32 | hardware | int: enumeration for hardware layout | +| 4+| 32 | layer | int: index to first layer element | +| 8+| 32 | count | int: number of layer elements in this list | +|12+| 32 | minDeviceWidth | int: min device width in millimeters, or 0 | + +- `hardware`: an enumeration with the following values: + - 0: `touch` (non-hardware) + - 1: `abnt2` + - 2: `iso` + - 3: `jis` + - 4: `us` + +See UTS #35 section 7 for details about these values. + +Layer lists are sorted by `hardware` enum, then minDeviceWidth ascending. + +### `layr.layers` subtable + +Each layer entry corresponds to one `` element +There are `layerCount` total layer entries. + +| ∆ | Bits | Name | Description | +|---|------|------------|------------------------------------------------| +| 0+| 32 | id | str: layer id such as `base` or `shift` | +| 4+| 32 | mod | int: modifier key flags | +| 8+| 32 | row | int: index into rows area (next section) | +|12+| 32 | count | int: number of `rows` elements for this layer | + +- for `mod` see `keys.key.mod` + +### `layr.rows` subtable + +Each row entry corresponds to one `` element +There are `rowCount` total row entries. + +| ∆ | Bits | Name | Description | +|---|------|------------|----------------------------------------| +| 0+| 32 | key | int: index into key element | +| 4+| 32 | count | int: count of key elements in this row | + +### `layr.keys` subtable + +Each key entry corresponds to a key in the row. +There are `keyCount` total key entries. + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +| 0+| 32 | key | str: key id | + +### C7043.2.14 `disp`—Display list + +| ∆ | Bits | Name | Description | +|---|------|---------------|------------------------------------------| +| 0 | 32 | ident | `disp` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | count | int: Total number of disp elements | +|12 | 32 | baseCharacter | str: If non-null, default base. | + +The default `baseCharacter` is U+25CC, if `baseCharacter` is null. + +For each element: + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +|32+| 32 | to | str: to string | +|36+| 32 | display | str: output display string | + +Entries are sorted in a binary codepoint sort on the `to` field. + +### C7043.2.15 `key2`—Extended keybag + +| ∆ | Bits | Name | Description | +|---|------|-------------|------------------------------------------| +| 0 | 32 | ident | `key2` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | keyCount | int: Number of keys | +|12 | 32 | flicksCount | int: Number of flick lists | +|16 | 32 | flickCount | int: Number of flick elements | +|20 | 32 | kmapCount | int: Number of kmap elements | +|24 | var | keys | keys sub-table | +| - | var | flicks | flick lists sub-table | +| - | var | flick | flick elements sub-table | +| - | var | kmap | key map sub-table | + +#### `key2.keys` subtable + +For each key: + +| ∆ | Bits | Name | Description | +|---|------|---------------- |----------------------------------------------------------| +| 0+| 32 | to | str: output string OR UTF-32LE codepoint | +| 4+| 32 | flags | int: per-key flags | +| 8+| 32 | id | str: key id | +|12+| 32 | switch | str: layer id to switch to | +|16+| 32 | width | int: key width*10 (supports 0.1 as min width) | +|20+| 32 | longPress | list: index into `list` section with longPress list or 0 | +|24+| 32 | longPressDefault | str: default longpress target or 0 | +|28+| 32 | multiTap | list: index into `list` section with multiTap list or 0 | +|32+| 32 | flicks | int: index into `key2.flicks` subtable | + +- `id`: The original string id from XML. This may be 0 to save space (i.e. omit the string id). +- `flags`: Flags is a 32-bit bitfield defined as below: + +| Bit position | Meaning | Description | +|--------------|-----------|---------------------------------------------| +| 0 | extend | 0: `to` is a char, 1: `to` is a string | +| 1 | gap | 1 if the key is a gap | +| 2 | transform | 1 if the key is transform=no | + +- `to`: If `extend` is 0, `to` is a UTF-32LE codepoint. If `extend` is 1, `to` + is a 32 bit index into the `strs` table. The string may be zero-length. + +#### `key2.flicks` flick list subtable + +For each flicks in the flick list: + +| ∆ | Bits | Name | Description | +|---|------|---------------- |----------------------------------------------------------| +| 0+| 32 | count | int: number of flick elements in this flick | +|12+| 32 | flick | int: index into `flick` subtable for first flick element | +|16+| 32 | id | str: flick id | + +- `id`: The original string id from XML. This may be 0 to save space (i.e. omit the string id). + +Elements are ordered by the string id. + +If this section is present, it must have a 'flicks' in the list at position zero with count=0, index=0 and id=0 meaning 'no flicks'. +#### `key2.flick` flick element subtable + +For each flick element: + +| ∆ | Bits | Name | Description | +|---|------|---------------- |----------------------------------------------------------| +| 0+| 32 | directions | list: index into `list` section with direction list | +| 8+| 32 | flags | int: per-key flags | +|12+| 32 | to | str: output string, or ucs32: output char, see flags | + +If this section is present, it must have a 'flick element' at position zero with directions=0, flags=0, and to=0 meaning 'no flick'. + +There is not a 'null' flick element at the end of each list. + +Elements are ordered by the `flicks.id`, and secondarily by the directions list id. + +- `flags`: Flags is a 32-bit bitfield defined as below: + +| Bit position | Meaning | Description | +|--------------|-----------|---------------------------------------------| +| 0 | extend | 0: `to` is a char, 1: `to` is a string | + +#### `key2.kmap` key map subtable + +This table (formerly the `keys` section) +The keys are sorted in ascending order based on the `vkey`, `mod` fields. + +For each key: + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +|16+| 32 | vkey | int: vkey ID | +|20+| 32 | mod | int: modifier key flags | +|24+| 32 | key | int: index into `key` sibling subtable | + +- `vkey`: If this is 0-255, it is the resolved standard/predefined vkey (K_A, + etc.). It is resolved because the `vkeyMap` from LDML has already been + applied. If this is 256 or above, it is a custom touch layout vkey generated + by the compiler. +- `mod`: 32-bit bitfield defined as below. Little endian values. + +| Value | Meaning |`kmx_file.h` | Comment | +|----------|----------|---------------|---------------------------------------------| +| 0x0000 | `none` | | All zeros = no modifiers | +| 0x0001 | `ctrlL` | `LCTRLFLAG` | Left Control | +| 0x0002 | `ctrlR` | `RCTRLFLAG` | Right Control | +| 0x0004 | `altL` | `LALTFLAG` | Left Alt | +| 0x0008 | `altR` | `RALTFLAG` | Right Alt | +| 0x0010 | `shift` | `K_SHIFTFLAG` | Either Shift | +| 0x0020 | `ctrl` | `K_CTRLFLAG` | Either Control | +| 0x0040 | `alt` | `K_ALTFLAG` | Either Alt | +| 0x0100 | `caps` | `CAPITALFLAG` | Caps lock | + +TODO-LDML: Note that conforming to other keyman values, left versus right shift +cannot be distinguished. + +### C7043.2.16 `list`—String lists + +| ∆ | Bits | Name | Description | +|---|------|---------------|------------------------------------------| +| 0 | 32 | ident | `list` | +| 4 | 32 | size | int: Length of section | +| 8 | 32 | listCount | int: Total number of lists elements | +|12 | 32 | indexCount | int: Total number of index elements | +|16 | var | lists | list sub-table | +| - | var | indices | index sub-table | + +#### `list.lists` sub-table + +The lists entry at location 0 is defined to have index=0 and count=0, +representing a 0-length list. + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +| 0+| 32 | index | int: Index into 'indices' subtable | +| 4+| 32 | count | int: Number of indices in this list | + +This data should be sorted in binary lexical order of the substrings. + +#### `list.indices` sub-table + +The index entry at location 0 is defined to have str=0, +representing a 0-length string. + +| ∆ | Bits | Name | Description | +|---|------|---------|------------------------------------------| +| 0+| 32 | str | str: string index into `strs` table | + +These indices are a pool of indexes into the string table. +The strings order are significant. There is not a 'null' string at the end of each list. + +## TODO-LDML: various things that need to be completed here or fixed in-spec +> * UnicodeSets +> * spec: ABNT2 key has hex value 0xC1 (even if kbdus.dll doesn't produce that) diff --git a/core/src/ldml/C7532_ldml_updating.md b/core/src/ldml/C7532_ldml_updating.md new file mode 100644 index 0000000000000000000000000000000000000000..168d205cea3ff959ee5a8f36e3dbceb5182c1d79 --- /dev/null +++ b/core/src/ldml/C7532_ldml_updating.md @@ -0,0 +1,77 @@ +# How to update KMXPlus sections + +A diary. +By Steven R. Loomis + +Keyman Section Update Journal + +working on ‘layr’, using ‘disp’ as a model from https://github.com/keymanapp/keyman/pull/7568 + +## Constants and Scaffolding + +- *Edit/Commit*: `core/include/ldml/keyboardprocessor_ldml.ts` + - update `SectionIdent` and keep in order + - update `SectionMap` and keep in order + - add a comment block in order `layr section` + - add `length_layr` with the nonvariable length + - add a `length_layr_*` for each subitem + - add parameters for each flag/bitfield + - Check indentation, check for copypasta errs! +- Run: `./core/tools/ldml-const-builder/build.sh clean build run` +- Verify/Commit: `core/include/ldml/keyboardprocessor_ldml.h` + +## XML changes + +- `resources/standards-data/ldml-keyboards/techpreview/` : update / reimport / fix fixup script if needed +- E/C: `common/web/types/src/ldml-keyboard/ldml-keyboard-xml.ts` + - add to `LKKeyboard` and subproperties as needed to support the structure on the XML side +- Now would be a good time to stop and make sure everything compiles. It didn’t, there was an unrelated issue with snprintf! + +## In-memory data: Phase 1 + +- `common/web/types/src/kmx/kmx-plus.ts` + - update `KMXPlusData` to include new section + - add the new section and any in-memory data for the compiler + - It’s enough temporarily to add `export class Sect extends Section{ /* TODO-LDML */};` for now so that it compiles, and come back to it +- `core/src/kmx/kmx_plus.h` + - add new structs +- `core/src/kmx/kmx_plus.cpp` + - add validate implementation for the section and any new structs + - update `kmx_plus::kmx_plus()` to include the loader +- `common/web/types/src/kmx/kmx-plus.ts` + - Also update class KMXPlusFile to include the actual binary format (coordinate with `kmx_plus.h`) +- E/C `common/web/types/src/ldml-keyboard/ldml-keyboard-xml-reader.ts` if there’s any changing to the boxing needed + - By the way, you might get errors such as “Error validating LDML XML file: /keyboard/transforms/0: additionalProperties: must NOT have additional properties additionalProperty="transform"” if the boxing functions don't match the schema. `boxArrays()` might be trying to add empty objects/arrays that aren't (anymore) legal per schema + +## In-memory data: Phase 2 + +- first the compiler tests + - add a section in `developer/src/kmc-ldml/test/fixtures/sections` if needed + - add a test case such as `developer/src/kmc-ldml/test/test-key2.ts` +- add a compiler + - `developer/src/kmc-ldml/compiler/key2.ts` + - link it in to `developer/src/kmc-ldml/src/compiler/compiler.ts` + - add the import + - add to `SECTION_COMPILERS` + + - Note: the in-memory compiler can affect `basic.kmx` even _before_ you add the section writing code. How? Simple… `Strs.allocString()` is called for the in-memory structures, so the string table will start growing even before those strings are actually used by the new sections. This is why it's fine to ignore the basic failure until you actually do the KMXPlus write. + +## Writing out + +- The moment you've been waiting for! Crack open `common/web/types/src/kmx/kmx-plus-builder/kmx-plus-builder.ts` and do it. + - Add `import { BUILDER_DISP, build_disp } from './build-disp.js';` to the top (and a new file to go with it) — and, in order + - Add `private sect_disp: BUILDER_DISP` to `class KMXPlusBuilder {` — and, in order + - add `this.sect_disp = build_disp(this.file.kmxplus, this.sect_strs);` to the `build()` function. Include any other sections that need to be cross referenced. + - Update `finalize_sect` and add `offset = this.finalize_sect_item(this.sect_disp, offset);` + - Finally, add `this.emitSection(file, this.file.COMP_PLUS_DISP, this.sect_disp);` to `compile()` — and, in order. + - Note that some variable length parts (such as the actual text data in `strs`) are sometimes in a separate emit function. Anything that's not in the `COMP_PLUS_STRS` `r.Struct` definition needs one of these. + - Also note that restructure will happily ignore (write zeros for) any fields where the BUILDER_* fields don't match the COMP_PLUS_* fields. + +- update basic.xml and basic.txt + - Tweak `eveloper/src/kmc-ldml/test/fixtures/basic.xml` as needed + - You can use `developer/src/kmc-ldml/build.sh build-fixtures` which will generate these. The two .kmx files are supposed to match: if not, fix `basic.txt` or fix other bugs. + - `developer/src/kmc-ldml/build/test/fixtures/basic-txt.kmx` - KMX generated from basic.txt. + - `developer/src/kmc-ldml/build/test/fixtures/basic-xml.kmx` - KMX generated from basic.xml. + - `developer/src/kmc-ldml/build/test/fixtures/basic-xml.kvk` - KVK generated from basic.xml. + +## more to come diff --git a/core/src/ldml/ldml_processor.cpp b/core/src/ldml/ldml_processor.cpp new file mode 100644 index 0000000000000000000000000000000000000000..8f1f02d4b0b051fe994fad4e7153a1de7af5e876 --- /dev/null +++ b/core/src/ldml/ldml_processor.cpp @@ -0,0 +1,349 @@ +/* + Copyright: © SIL International. + Description: This is an implementation of the LDML keyboard spec 3.0. + Create Date: 5 Aug 2022 + Authors: Marc Durdin (MD) +*/ + +#include +#include "ldml/ldml_processor.hpp" +#include "state.hpp" +#include "kmx_file.h" +#include "kmx/kmx_plus.h" +#include "kmx/kmx_xstring.h" +#include "ldml/keyboardprocessor_ldml.h" +#include "kmx/kmx_file_validator.hpp" +#include "debuglog.h" +#include + +namespace { + constexpr km_kbp_attr const engine_attrs = { + 256, + KM_KBP_LIB_CURRENT, + KM_KBP_LIB_AGE, + KM_KBP_LIB_REVISION, + KM_KBP_TECH_LDML, + "SIL International" + }; +} + +// using km::kbp::kmx::ShouldDebug; // for DebugLog + +namespace km { +namespace kbp { + + +ldml_processor::ldml_processor(path const & kb_path, const std::vector &data) +: abstract_processor( + keyboard_attributes(kb_path.stem(), KM_KBP_LMDL_PROCESSOR_VERSION, kb_path.parent(), {}) + ), _valid(false), transforms(), keys() +{ + + if(data.size() <= sizeof(kmx::COMP_KEYBOARD_EX)) { + DebugLog("data.size %zu too small", data.size()); + return; + } + +// // Locate the structs here, but still retain ptrs to the raw structs. + kmx::KMX_FileValidator* comp_keyboard = (kmx::KMX_FileValidator*)data.data(); + + // Perform the standard validation + if(!comp_keyboard->VerifyKeyboard(data.size())) { + DebugLog("VerifyKeyboard() returned false"); + return; + } + + kmx::kmx_plus kplus(comp_keyboard, data.size()); // slices to a COMP_KEYBOARD + + if(!kplus.is_valid()) { + DebugLog("kmx_plus.is_valid is false"); + return; + } + + // Now, if we have keys, use them. + if (kplus.key2 != nullptr) { + // read all keys into array + for (KMX_DWORD i=0; ikmapCount; i++) { + std::u16string str; + auto kmapEntry = kplus.key2Helper.getKmap(i); + assert(kmapEntry != nullptr); + // now look up the key + auto keyEntry = kplus.key2Helper.getKeys(kmapEntry->key); + assert(keyEntry != nullptr); + + if (keyEntry->flags && LDML_KEYS_KEY_FLAGS_EXTEND) { + if (nullptr == kplus.strs) { + DebugLog("for keys: kplus.strs == nullptr"); // need a string table to get strings + assert(false); + return; + } + str = kplus.strs->get(keyEntry->to); + } else { + str = keyEntry->get_string(); + } + keys.add((km_kbp_virtual_key)kmapEntry->vkey, (uint16_t)kmapEntry->mod, str); + } + } // else: no keys! but still valid. Just, no keys. + if (kplus.tran != nullptr) { + if (nullptr == kplus.elem) { + DebugLog("for tran: kplus.elem == nullptr"); + assert(false); + return; + } + if (nullptr == kplus.strs) { + DebugLog("for tran: kplus.strs == nullptr"); // need a string table to get strings + assert(false); + return; + } + for (KMX_DWORD i = 0; i < kplus.tran->count; i++) { + const kmx::COMP_KMXPLUS_TRAN_ENTRY &entry = kplus.tran->entries[i]; + // 'to' is always a string, unlike keys + const std::u16string tostr = kplus.strs->get(entry.to); + // now, fetch the 'from' + ldml::string_list list; + + // TODO-LDML: before= + // TODO-LDML: error= + + // process From + const KMX_DWORD elemNo = entry.from; + if (elemNo >= kplus.elem->count) { + DebugLog("tran[%d].from = %d, out of range for elem->count=%d", i, elemNo, kplus.elem->count); + assert(false); + return; + } + + // TODO-LDML: refactor this + KMX_DWORD elemListLength = 0; + const kmx::COMP_KMXPLUS_ELEM_ELEMENT *elemList = kplus.elem->getElementList(elemNo, elemListLength); + if (elemList == nullptr) { + DebugLog("tran[%d].from = %d, could not load element list", i, elemNo); + assert(false); + return; + } + if (elemListLength == 0) { + DebugLog("tran[%d].from = %d, element list has 0 length", i, elemNo); + assert(false); + return; + } + + // now we have an array of elements + for (KMX_DWORD e = 0; e < elemListLength; e++) { + const kmx::COMP_KMXPLUS_ELEM_ELEMENT &element = elemList[e]; + std::u16string str; + if (element.flags && LDML_ELEM_FLAGS_UNICODE_SET) { + str = kplus.strs->get(element.element); + // TODO-LDML: actually a UnicodeSet here + } else { + str = element.get_string(); // Get single UTF-16 + } + list.push_back(str); // add the string to the end + } + // Now, add the list to the map + transforms.add(list, tostr); + } + } + // Only valid if we reach here + DebugLog("_valid = true"); + _valid = true; +} + +bool ldml_processor::is_kmxplus_file(path const & kb_path, std::vector& data) { +// TODO-LDML: we should refactor all the core components to delegate file loading +// to the Engine, which requires an API change, but this makes delivery +// of keyboard files more flexible under more WASM. + + std::ifstream file(static_cast(kb_path), std::ios::binary | std::ios::ate); + if(!file.good()) { + return false; + } + const std::streamsize size = file.tellg(); + if(size >= KMX_MAX_ALLOWED_FILE_SIZE) { + return false; + } + + file.seekg(0, std::ios::beg); + + data.resize((size_t)size); + if(!file.read((char *) data.data(), size)) { + return false; + } + + file.close(); + + const kmx::PCOMP_KEYBOARD comp_keyboard = (kmx::PCOMP_KEYBOARD)data.data(); + + if(comp_keyboard->dwIdentifier != KMX_DWORD(FILEID_COMPILED)) { + return false; + } + + if(comp_keyboard->dwFileVersion < VERSION_160 || (comp_keyboard->dwFlags & KF_KMXPLUS) == 0) { + return false; + } + + // A KMXPlus file is in the buffer (although more validation is required and will + // be done in the constructor) + return true; +} + +km_kbp_status +ldml_processor::process_queued_actions( + km_kbp_state *state +) { + assert(state); + if (!state) + return KM_KBP_STATUS_INVALID_ARGUMENT; + // TODO Implement + return KM_KBP_STATUS_OK; +} + +bool ldml_processor::queue_action( + km_kbp_state * state, + km_kbp_action_item const* action_item +) +{ + assert(state); + assert(action_item); + if ((!state) || (!action_item)) + return false; + return false; +} + +km_kbp_status +ldml_processor::process_event( + km_kbp_state *state, + km_kbp_virtual_key vk, + uint16_t modifier_state, + uint8_t is_key_down, + uint16_t /*event_flags*/ // TODO-LDML: unused... for now... +) { + assert(state); + if (!state) + return KM_KBP_STATUS_INVALID_ARGUMENT; + + if (!is_key_down) { + // TODO: Implement caps lock handling + state->actions().clear(); + state->actions().commit(); + return KM_KBP_STATUS_OK; + } + + try { + // At the start of every process_event always clear the action_items + state->actions().clear(); + + switch (vk) { + case KM_KBP_VKEY_BKSP: + { + KMX_DWORD last_char = 0UL; + // attempt to get the last char + auto end = state->context().rbegin(); + if(end != state->context().rend()) { + if((*end).type == KM_KBP_CT_CHAR) { + last_char = (*end).character; + } + } + if (last_char == 0UL) { + state->actions().push_backspace(KM_KBP_BT_UNKNOWN); + } else { + state->actions().push_backspace(KM_KBP_BT_CHAR, last_char); + } + state->context().pop_back(); + } + break; + default: + // from kmx_processor.cpp + // Construct a context buffer from the items up until the last KM_KBP_CT_MARKER marker + ldml::string_list ctxt; + auto cp = state->context(); + // We're only interested in as much of the context as is a KM_KBP_CT_CHAR. + // This will stop at the KM_KBP_CT_MARKER type. + uint8_t last_type = KM_KBP_BT_UNKNOWN; + for (auto c = cp.rbegin(); c != cp.rend(); c++) { + last_type = c->type; + if (last_type != KM_KBP_BT_CHAR) { + break; + } + km::kbp::kmx::char16_single buf; + const int len = km::kbp::kmx::Utf32CharToUtf16(c->character, buf); + const std::u16string str(buf.ch, len); + ctxt.push_front(str); // prepend to string + } + if (last_type != KM_KBP_BT_MARKER) { + // There was no beginning-of-translation marker. + //Add one. + state->context().push_marker(0x0); + state->actions().push_marker(0x0); + } + // Look up the key + const std::u16string str = keys.lookup(vk, modifier_state); + if (str.empty()) { + // not found + state->actions().commit(); // finish up and + return KM_KBP_STATUS_OK; // Nothing to do- no key + } + const std::u32string str32 = kmx::u16string_to_u32string(str); + for(size_t i=0; icontext().push_character(str32[i]); + state->actions().push_character(str32[i]); + } + // add the newly added char + ctxt.push_back(str); + // Now process transforms + std::u16string outputString; + // Process the transforms + const size_t matchedContext = transforms.matchContext(ctxt, outputString); + + if (matchedContext > 0) { + // Found something. + // Now, clear out the old context + for (size_t i = 0; i < matchedContext; i++) { + state->context().pop_back(); // Pop off last + auto deletedChar = ctxt[ctxt.size() - i - 1][0]; + state->actions().push_backspace(KM_KBP_BT_CHAR, deletedChar); // Cause prior char to be removed + } + // Now, add in the updated text + const std::u32string outstr32 = kmx::u16string_to_u32string(outputString); + for (size_t i = 0; i < outstr32.length(); i++) { + state->context().push_character(outstr32[i]); + state->actions().push_character(outstr32[i]); + } + // Add a marker so we don't retransform this text. + state->context().push_marker(0x0); + state->actions().push_marker(0x0); + } + } + state->actions().commit(); + } catch (std::bad_alloc &) { + state->actions().clear(); + return KM_KBP_STATUS_NO_MEM; + } + + return KM_KBP_STATUS_OK; +} + +km_kbp_attr const & ldml_processor::attributes() const { + return engine_attrs; +} + +km_kbp_keyboard_key * ldml_processor::get_key_list() const { + km_kbp_keyboard_key* key_list = new km_kbp_keyboard_key(KM_KBP_KEYBOARD_KEY_LIST_END); + return key_list; +} + +km_kbp_keyboard_imx * ldml_processor::get_imx_list() const { + km_kbp_keyboard_imx* imx_list = new km_kbp_keyboard_imx(KM_KBP_KEYBOARD_IMX_END); + return imx_list; +} + +km_kbp_context_item * ldml_processor::get_intermediate_context() { + km_kbp_context_item *citems = new km_kbp_context_item(KM_KBP_CONTEXT_ITEM_END); + return citems; +} + +km_kbp_status ldml_processor::validate() const { + return _valid ? KM_KBP_STATUS_OK : KM_KBP_STATUS_INVALID_KEYBOARD; +} + +} // namespace kbp +} // namespace km diff --git a/core/src/ldml/ldml_processor.hpp b/core/src/ldml/ldml_processor.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8a4dfb02e6d8f5f839fdb76571b23e49c1d76533 --- /dev/null +++ b/core/src/ldml/ldml_processor.hpp @@ -0,0 +1,87 @@ +/* + Copyright: © SIL International. + Description: Internal keyboard class and adaptor class for the LDML Keyboard Processor. + Create Date: 6 Aug 2022 + Authors: Marc Durdin +*/ + +#pragma once + +#include +#include +#include +#include +#include +#include +#include "processor.hpp" +#include "option.hpp" +#include "ldml_vkeys.hpp" +#include "ldml_transforms.hpp" + +namespace km { +namespace kbp { + +#define KM_KBP_LMDL_PROCESSOR_VERSION u"1.0" + + class ldml_processor : public abstract_processor { + private: + bool _valid; + ldml::transforms transforms; + ldml::vkeys keys; + public: + ldml_processor( + path const & kb_path, + const std::vector & data + ); + +// ~ldml_processor() override; + + static bool is_kmxplus_file( + path const & kb_path, + std::vector& data + ); + + km_kbp_status + process_event( + km_kbp_state *state, + km_kbp_virtual_key vk, + uint16_t modifier_state, + uint8_t is_key_down, + uint16_t event_flags + ) override; + + virtual km_kbp_attr const & attributes() const override; + km_kbp_status validate() const override; + + char16_t const * + lookup_option( + km_kbp_option_scope _kmn_unused(scope), + std::u16string const & _kmn_unused(key) + ) const override { + return nullptr; + } + + option + update_option( + km_kbp_option_scope _kmn_unused(scope), + std::u16string const & _kmn_unused(key), + std::u16string const & _kmn_unused(value) + ) override { + return option(); + } + + km_kbp_status process_queued_actions(km_kbp_state *state) override; + + bool queue_action( + km_kbp_state * state, + km_kbp_action_item const* action_item + ) override; + + km_kbp_context_item * get_intermediate_context() override; + + km_kbp_keyboard_key * get_key_list() const override; + + km_kbp_keyboard_imx * get_imx_list() const override; + }; +} // namespace kbp +} // namespace km diff --git a/core/src/ldml/ldml_transforms.cpp b/core/src/ldml/ldml_transforms.cpp new file mode 100644 index 0000000000000000000000000000000000000000..86982c79726fd1342fbdf9a66089781351f671e2 --- /dev/null +++ b/core/src/ldml/ldml_transforms.cpp @@ -0,0 +1,69 @@ +/* + Copyright: © SIL International. + Description: This is an implementation of the LDML keyboard spec 3.0. + Create Date: 7 Oct 2022 + Authors: Steven R. Loomis +*/ + +#include "ldml_transforms.hpp" + +namespace km { +namespace kbp { +namespace ldml { + +transforms::transforms() : simple() { +} + +void +transforms::add(const string_list &list, const std::u16string &tostr) { + simple.insert({list, tostr}); +} + +size_t +transforms::matchContext(const string_list &ctxt, std::u16string &outputString) const { + if (simple.size() == 0) { + return 0; // no transforms, no match + } + + // int longest_index = -1; // index to longest match in simple_transforms + size_t longest_length = 0; // length of longest match + // auto i = 0; // counter + // TODO-LDML: need to handle partial matches. + // bool partial = false; // true if the longest was a partial match + for (auto it = simple.begin(); it != simple.end(); it++ /*,i++*/) { + auto list = it->first; + // see if it matches + if (longest_length >= list.size()) { + continue; // already have a longer match + } + if (list.size() > ctxt.size()) { + continue; // not enough ctxt for a match (TODO-LDML: partial match.) + } + // Now, check for match + bool is_match = true; + for (size_t j = 0; j < list.size(); j++) { + const auto found = ctxt.at(ctxt.size() - j - 1); + const auto expect = list.at(list.size() - j - 1); + if (found != expect) { + // mismatch, break + is_match = false; + break; + } + } + if (!is_match) { + continue; + } + // Found a match + longest_length = list.size(); + // longest_index = i; + outputString = it->second; + } + + return longest_length; + // TODO-LDML: reorder + // TODO-LDML: final +} + +} // namespace ldml +} // namespace kbp +} // namespace km diff --git a/core/src/ldml/ldml_transforms.hpp b/core/src/ldml/ldml_transforms.hpp new file mode 100644 index 0000000000000000000000000000000000000000..c3edff1f14ef3c54dd26159a7220b6fd951d1aba --- /dev/null +++ b/core/src/ldml/ldml_transforms.hpp @@ -0,0 +1,54 @@ +/* + Copyright: © SIL International. + Description: Internal functions for LDML transforms + Create Date: 6 Oct 2022 + Authors: Steven R. Loomis +*/ + +#pragma once + +#include +#include +#include +#include +#include + +namespace km { +namespace kbp { +namespace ldml { + +/** + * An ordered list of strings. + */ +typedef std::deque string_list; +/** + * map from transform list to string + */ +typedef std::map simple_transforms; + +class transforms { +private: + simple_transforms simple; + +public: + transforms(); + + /** + * Add a simple transform rule + * @param match list of matching string elements + * @param output output string for this rule + */ + void add(const string_list &match, const std::u16string &output); + + /** + * Check for any matching transform rules + * @param ctxt context array for matching + * @param output fillin: will contain the output string for this rule, if there is a match + * @return 0 if no match, or the length of the ctxt string matched, starting at the end + */ + size_t matchContext(const string_list &ctxt, std::u16string &output) const; +}; + +} // namespace ldml +} // namespace kbp +} // namespace km diff --git a/core/src/ldml/ldml_vkeys.cpp b/core/src/ldml/ldml_vkeys.cpp new file mode 100644 index 0000000000000000000000000000000000000000..461c6227c9cbb5cd9f21e4eaedaaef743bc5c43d --- /dev/null +++ b/core/src/ldml/ldml_vkeys.cpp @@ -0,0 +1,82 @@ +/* + Copyright: © SIL International. + Description: Implementation for LDML Vkeys + Create Date: 6 Oct 2022 + Authors: Steven R. Loomis +*/ + +#include "ldml_vkeys.hpp" +#include "kmx_file.h" + +namespace km { +namespace kbp { +namespace ldml { + +vkeys::vkeys() : vkey_to_string() { +} + +void +vkeys::add(km_kbp_virtual_key vk, uint16_t modifier_state, std::u16string output) { + // construct key + const vkey_id id(vk, modifier_state); + // assign the string + vkey_to_string[id] = output; +} + +static const uint16_t BOTH_ALT = LALTFLAG | RALTFLAG; +static const uint16_t BOTH_CTRL = LCTRLFLAG | RCTRLFLAG; + +std::u16string +vkeys::lookup(km_kbp_virtual_key vk, uint16_t modifier_state) const { + const vkey_id id(vk, modifier_state); + + // try exact match first + std::u16string ret = lookup(id); + if (!ret.empty()) { + return ret; + } + + const bool have_ctrl = modifier_state & BOTH_CTRL; + const bool have_alt = modifier_state & BOTH_ALT; + + // look for a layer with "alt" (either) + if (have_alt) { + const vkey_id id_alt(vk, (modifier_state & ~(BOTH_ALT)) | K_ALTFLAG); + ret = lookup(id_alt); + if (!ret.empty()) { + return ret; + } + } + // look for a layer with "ctrl" (either) + if (have_ctrl) { + const vkey_id id_ctrl(vk, (modifier_state & ~(BOTH_CTRL)) | K_CTRLFLAG); + ret = lookup(id_ctrl); + if (!ret.empty()) { + return ret; + } + } + // look for a layer with "alt ctrl" (either) + if (have_ctrl && have_alt) { + const vkey_id id_ctrl_alt(vk, (modifier_state & ~(BOTH_ALT | BOTH_CTRL)) | K_CTRLFLAG | K_ALTFLAG); + ret = lookup(id_ctrl_alt); + if (!ret.empty()) { + return ret; + } + } + + // default: return failure. + return ret; +} + +std::u16string +vkeys::lookup(const vkey_id& id) const { + const auto key = vkey_to_string.find(id); + if (key == vkey_to_string.end()) { + return std::u16string(); // TODO-LDML: optimize object construction? + } + return key->second; +} + +} // namespace ldml +} // namespace kbp +} // namespace km diff --git a/core/src/ldml/ldml_vkeys.hpp b/core/src/ldml/ldml_vkeys.hpp new file mode 100644 index 0000000000000000000000000000000000000000..bfab902b0fa3649d3a9b45cf4540c845c3565a9e --- /dev/null +++ b/core/src/ldml/ldml_vkeys.hpp @@ -0,0 +1,59 @@ +/* + Copyright: © SIL International. + Description: Internal functions for LDML vkeys + Create Date: 6 Oct 2022 + Authors: Steven R. Loomis +*/ + +#pragma once + +#include +#include +#include +#include +#include + +#include + +namespace km { +namespace kbp { +namespace ldml { + +/** + * identifier for keybag lookup + */ +typedef std::pair vkey_id; + +/** + * LDML Class to manage all things key related: vkey remapping and vkey to string + */ +class vkeys { +private: + // TODO-LDML: store transform=no state + std::map vkey_to_string; + +public: + vkeys(); + + /** + * add a vkey to the bag + */ + void add(km_kbp_virtual_key vk, uint16_t modifier_state, std::u16string output); + + /** + * Lookup a vkey, returns an empty string if not found + */ + std::u16string + lookup(km_kbp_virtual_key vk, uint16_t modifier_state) const; + +private: + /** + * Non-recursive internal lookup of a specific ID + */ + std::u16string + lookup(const vkey_id &id) const; +}; + +} // namespace ldml +} // namespace kbp +} // namespace km diff --git a/core/src/meson.build b/core/src/meson.build index 79f06a970670ba3b478c12fce6b7b6218585b14f..97b929164647288845817f40f6824a8aa1b17caf 100644 --- a/core/src/meson.build +++ b/core/src/meson.build @@ -4,73 +4,51 @@ # Authors: Tim Eves (TSE) # -defns += ['-DKMN_KBP_EXPORTING'] version_res = [] -if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang' - warns = [ - '-Wctor-dtor-privacy', - '-Wdouble-promotion', - '-Wendif-labels', - '-Wno-unknown-pragmas', - '-Wno-missing-field-initializers', - '-Wnon-virtual-dtor', - '-Wshadow' - ] - flags = [ - '-fvisibility=hidden', - '-fvisibility-inlines-hidden' - ] - links = [] - - if compiler.get_id() == 'clang' - warns += [ - '-Wimplicit-fallthrough', - '-Wno-double-promotion', - '-Wshorten-64-to-32' - ] - endif - - if host_machine.system() == 'darwin' - warns += ['-Wno-ctor-dtor-privacy', '-Wno-non-virtual-dtor'] - endif -endif - -if compiler.get_id() == 'msvc' - warns = [] - flags = [] - defns += [ - '-D_SCL_SECURE_NO_WARNINGS', - '-D_CRT_SECURE_NO_WARNINGS', - '-DUNICODE' - ] - links = [] +# TODO: shouldn't this be defined only for dylib and not static lib? +defns += ['-DKMN_KBP_EXPORTING'] +if cpp_compiler.get_id() == 'msvc' + defns += ['-DUNICODE'] # /n = append null # /c65001 = utf-8 file format version_res += import('windows').compile_resources('version.rc', args:['/n','/c65001']) endif -if compiler.get_id() == 'emscripten' - warns = [] - flags = [] - defns = ['-DKMN_KBP'] - links = [] +if cpp_compiler.get_id() == 'emscripten' + # TODO: why do we need this defn here? + defns += ['-DKMN_KBP'] endif kmx_files = files( + 'option.cpp', + 'keyboard.cpp', + 'state.cpp', + 'debuglog.cpp', + 'km_kbp_context_api.cpp', + 'km_kbp_keyboard_api.cpp', + 'km_kbp_options_api.cpp', + 'km_kbp_state_api.cpp', + 'km_kbp_debug_api.cpp', + 'km_kbp_processevent_api.cpp', + 'jsonpp.cpp', + 'ldml/ldml_processor.cpp', + 'ldml/ldml_transforms.cpp', + 'ldml/ldml_vkeys.cpp', + 'mock/mock_processor.cpp', 'kmx/kmx_consts.cpp', 'kmx/kmx_processevent.cpp', 'kmx/kmx_actions.cpp', 'kmx/kmx_capslock.cpp', 'kmx/kmx_context.cpp', 'kmx/kmx_conversion.cpp', - 'kmx/kmx_debug.cpp', 'kmx/kmx_debugger.cpp', 'kmx/kmx_environment.cpp', 'kmx/kmx_file.cpp', 'kmx/kmx_modifiers.cpp', 'kmx/kmx_options.cpp', + 'kmx/kmx_plus.cpp', 'kmx/kmx_processor.cpp', 'kmx/kmx_xstring.cpp', ) @@ -109,22 +87,6 @@ lib = library('kmnkbp0', pic: true, install: true) -if host_machine.system() == 'linux' - # on Linux we need the static lib for ibus-keyman tests - static_library('kmnkbp0-static', - api_files, - core_files, - kmx_files, - mock_files, - version_res, - cpp_args: defns + warns + flags, - link_args: links, - include_directories: inc, - pic: true, - install: false - ) -endif - headerdirs = [ '.', 'keyman' ] # subdirectories of ${prefix}/include to add to header path kmnkbp = declare_dependency(link_with: lib, include_directories: inc) diff --git a/core/src/mock/mock_processor.cpp b/core/src/mock/mock_processor.cpp index e2673d83430a30243f050f17671e3836e4832033..183e095b4e47d5d1c8075d6af666e779105a517c 100644 --- a/core/src/mock/mock_processor.cpp +++ b/core/src/mock/mock_processor.cpp @@ -135,7 +135,8 @@ namespace km { km_kbp_state *state, km_kbp_virtual_key vk, uint16_t modifier_state, - uint8_t is_key_down + uint8_t is_key_down, + uint16_t /* event_flags */ ) { assert(state); if (!state) diff --git a/core/src/mock/mock_processor.hpp b/core/src/mock/mock_processor.hpp index a8aa3f1acc360a8a54e06c30215f964250098005..e5a72cba4a94b44199cecb51ff5abc2fef610684 100644 --- a/core/src/mock/mock_processor.hpp +++ b/core/src/mock/mock_processor.hpp @@ -31,7 +31,8 @@ namespace kbp km_kbp_state *state, km_kbp_virtual_key vk, uint16_t modifier_state, - uint8_t is_key_down + uint8_t is_key_down, + uint16_t event_flags ) override; virtual km_kbp_attr const & attributes() const override; diff --git a/core/src/path.hpp b/core/src/path.hpp index e13360248ee0c4f13c3bf1bb392239614fd45a0d..9bb8145d7413c614ab84ff71f410e7a165687a51 100644 --- a/core/src/path.hpp +++ b/core/src/path.hpp @@ -59,22 +59,33 @@ namespace kbp template path(C const * p): path(std::basic_string(p)) {} - + /** + * @return the enclosing directory's path + */ path parent() const { auto i = _path.find_last_of(parent_separator); return _path.substr(0, i == string_type::npos ? 0UL : i); } + /** + * @return just the filename, such as "angkor.kmx" + */ path name() const { auto i = _path.find_last_of(parent_separator); return _path.substr(i == string_type::npos ? 0UL : i+1); } + /** + * @return the suffix of the file, such as ".kmx" + */ path suffix() const { auto i = _path.find_last_of(suffix_separator); return _path.substr(i == string_type::npos ? _path.size() : i); } + /** + * @return just the child filename, such as "angkor" for "angkor.kmx" + */ path stem() const { auto psep = _path.find_last_of(parent_separator), ssep = _path.find_last_of(suffix_separator); @@ -82,6 +93,10 @@ namespace kbp ssep == string_type::npos ? _path.size() : ssep); } + /** + * Mutate the path to change the extension + * @param replacement new suffix, such as ".kmp". default is to remove the suffix + */ void replace_extension(path const & replacment = path()) { _path.resize(std::min(_path.find_last_of(suffix_separator), _path.size())); _path += replacment; diff --git a/core/src/processor.hpp b/core/src/processor.hpp index 7041a721005b190a6b2624b064db01ca8a544e9a..39edb120d2da374f71a65f491ed047bf7c2a1f25 100644 --- a/core/src/processor.hpp +++ b/core/src/processor.hpp @@ -41,7 +41,8 @@ namespace kbp km_kbp_state *, km_kbp_virtual_key, uint16_t modifier_state, - uint8_t is_key_down + uint8_t is_key_down, + uint16_t event_flags ) = 0; virtual km_kbp_status diff --git a/core/subprojects/.gitignore b/core/subprojects/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..99479aa952cd339f9d98c7bab6dd21ad9700355e --- /dev/null +++ b/core/subprojects/.gitignore @@ -0,0 +1,4 @@ +/icu +/*.zip +/*.tgz +/packagecache diff --git a/core/subprojects/README.md b/core/subprojects/README.md new file mode 100644 index 0000000000000000000000000000000000000000..4ff961beae35499e112566da1e855c2e9f8d7e62 --- /dev/null +++ b/core/subprojects/README.md @@ -0,0 +1,12 @@ +# core/subprojects + +## What's this? What _is_ this? + +- These are subprojects accessible to the `core` meson project. + +## icu + +- When building for Linux, [ICU](https://icu.unicode.org) must already be installed. The system ICU will be used instead of the subproject. +- Patches for icu (i.e. meson build files) are in [`packagefiles/icu`](./packagefiles/icu/) +- It would be preferable to use meson's [wrapdb](https://mesonbuild.com/Wrapdb-projects.html), and in fact the patchfiles here are sourced from that project. +- However, having our own patchfiles allows for slimming down ICU, at least until the wrapdb version is more configurable [mesonbuild/wrapdb#950](https://github.com/mesonbuild/wrapdb/issues/950) diff --git a/core/subprojects/icu-minimal.wrap b/core/subprojects/icu-minimal.wrap new file mode 100644 index 0000000000000000000000000000000000000000..fe509b48e03851337605ed10c56a8b5d137dd4bf --- /dev/null +++ b/core/subprojects/icu-minimal.wrap @@ -0,0 +1,14 @@ +[wrap-file] +directory = icu +source_url = https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz +source_filename = icu4c-73_1-src.tgz +source_hash = a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45 +## TODO-LDML: Note, need meson 0.55.0 to use patch_directory +patch_directory = icu + +# Based on: wrapdb_version = 72.1-3 + +[provide] +icu-uc = icuuc_dep +# TODO-LDML: not including i18n at present +#icu-i18n = icui18n_dep diff --git a/core/subprojects/packagefiles/icu/LICENSE.meson b/core/subprojects/packagefiles/icu/LICENSE.meson new file mode 100644 index 0000000000000000000000000000000000000000..b59833dedbe2e4a84304431f4acca5dc4599cec7 --- /dev/null +++ b/core/subprojects/packagefiles/icu/LICENSE.meson @@ -0,0 +1,19 @@ +Copyright (c) 2021 The Meson development team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/core/subprojects/packagefiles/icu/meson.build b/core/subprojects/packagefiles/icu/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..32bc209139eaa12d2dceb70bd805754dc696a9c4 --- /dev/null +++ b/core/subprojects/packagefiles/icu/meson.build @@ -0,0 +1,98 @@ +project( + 'icu', + 'c', + 'cpp', + version: '73.1', + meson_version: '>=0.57.0', # TODO-LDML: Too high for debian + default_options: [ 'cpp_std=c++17' ], +) + +U_ICU_VERSION = meson.project_version() +PACKAGE_ICU_DESCRIPTION = 'International Components for Unicode' +PACKAGE_ICU_URL = 'http://icu-project.org' + +cpp = meson.get_compiler('cpp') +# cpp_native = meson.get_compiler('cpp', native: true) + +have_elf_h = cpp.has_header('elf.h') + +if host_machine.system() == 'windows' + add_project_arguments('-DU_PLATFORM_USES_ONLY_WIN32_API', language: 'cpp') + add_project_arguments('-DWIN32', '-DWIN64', '-D_MBCS', language: 'cpp') + add_project_arguments('-DU_PLATFORM_USES_ONLY_WIN32_API', language: 'c') + add_project_arguments('-DWIN32', '-DWIN64', '-D_MBCS', language: 'c') +endif + + +# per icudefs.mk.in: +# "U_ATTRIBUTE_DEPRECATED is defined to hide warnings about deprecated API warnings." +add_project_arguments('-DU_ATTRIBUTE_DEPRECATED=', '-DUCONFIG_USE_LOCAL=1', language: 'c') + +add_project_arguments('-DU_NOEXCEPT=', language: 'c') + +uconfig = configuration_data() + +uconfig.set('U_ENABLE_DYLOAD', 0) # no DLL +uconfig.set('U_CHECK_DYLOAD', 0) # no DLL +uconfig.set('UCONFIG_NO_FILE_IO', 1) +uconfig.set('UCONFIG_NO_LEGACY_CONVERSION', 1) # turn off file based codepage conversion +uconfig.set('UCONFIG_NO_NORMALIZATION', 1) # TODO-LDML: may want this +uconfig.set('UCONFIG_NO_BREAK_ITERATION', 1) # TODO-LDML: may want this +uconfig.set('UCONFIG_NO_IDNA', 1) +uconfig.set('UCONFIG_NO_COLLATION', 1) +uconfig.set('UCONFIG_NO_FORMATTING', 1) +uconfig.set('UCONFIG_NO_TRANSLITERATION', 1) +uconfig.set('UCONFIG_NO_REGULAR_EXPRESSIONS', 1) # TODO-LDML: Will probably want this for transforms #7375 +uconfig.set('UCONFIG_NO_SERVICE', 1) + + +uconfig_local = configure_file( + configuration : uconfig, + # dir : 'source/common/unicode', + output : 'uconfig_local.h', +) + + +if cpp.get_argument_syntax() == 'msvc' +# TODO-LDML: cl : Command line error D8016 : '/utf-8' and '/source-charset:utf-8' command-line options are incompatible +# see note in core/meson.build + # add_project_arguments('/utf-8', language: 'cpp') + # add_project_arguments('/utf-8', language: 'c') +endif + +# TODO-LDML: skip this check +# if meson.version().version_compare('>= 0.62') +# dl_dep = dependency('dl', required: false) +# dl_native_dep = dependency('dl', required: false, native: true) +# else +# dl_dep = cpp.find_library('dl', required: false) +# dl_native_dep = cpp_native.find_library('dl', required: false, native: true) +# endif + +windows = import('windows') +pkg = import('pkgconfig') + +# Compiler flags the users of this library must use. +usage_args = [] + +if get_option('default_library') == 'static' + add_project_arguments('-DU_STATIC_IMPLEMENTATION', language: 'c') + add_project_arguments('-DU_STATIC_IMPLEMENTATION', language: 'cpp') + usage_args = ['-DU_STATIC_IMPLEMENTATION'] + if cpp.get_argument_syntax() == 'msvc' + library_prefix = '' + library_suffix = '' + else + library_prefix = 's' + if get_option('buildtype') == 'debug' + library_suffix = 'd' + else + library_suffix = '' + endif + endif +else + library_prefix = '' + library_suffix = '' +endif + +subdir('source') diff --git a/core/subprojects/packagefiles/icu/source/common/meson.build b/core/subprojects/packagefiles/icu/source/common/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..4653d88383c163221bc5417dbd973673c41ccaec --- /dev/null +++ b/core/subprojects/packagefiles/icu/source/common/meson.build @@ -0,0 +1,358 @@ +sources = files( + 'appendable.cpp', + 'bmpset.cpp', + 'brkeng.cpp', + 'brkiter.cpp', + 'bytesinkutil.cpp', + 'bytestream.cpp', + 'bytestrie.cpp', + 'bytestriebuilder.cpp', + 'bytestrieiterator.cpp', + 'caniter.cpp', + 'characterproperties.cpp', + 'chariter.cpp', + 'charstr.cpp', + 'cmemory.cpp', + 'cstr.cpp', + 'cstring.cpp', + 'cwchar.cpp', + 'dictbe.cpp', + 'dictionarydata.cpp', + 'dtintrv.cpp', + 'edits.cpp', + 'emojiprops.cpp', + 'errorcode.cpp', + 'filteredbrk.cpp', + 'filterednormalizer2.cpp', + 'icudataver.cpp', + 'icuplug.cpp', + 'loadednormalizer2impl.cpp', + 'localebuilder.cpp', + 'locavailable.cpp', + 'locbased.cpp', + 'locdispnames.cpp', + 'locdspnm.cpp', + 'locid.cpp', + 'loclikely.cpp', + 'locmap.cpp', + 'locresdata.cpp', + 'locutil.cpp', + 'lstmbe.cpp', + 'messagepattern.cpp', + 'normalizer2.cpp', + 'normalizer2impl.cpp', + 'normlzr.cpp', + 'parsepos.cpp', + 'patternprops.cpp', + 'propname.cpp', + 'propsvec.cpp', + 'punycode.cpp', + 'putil.cpp', + 'rbbi.cpp', + 'rbbi_cache.cpp', + 'rbbidata.cpp', + 'rbbinode.cpp', + 'rbbirb.cpp', + 'rbbiscan.cpp', + 'rbbisetb.cpp', + 'rbbistbl.cpp', + 'rbbitblb.cpp', + 'resbund.cpp', + 'resbund_cnv.cpp', + 'resource.cpp', + 'ruleiter.cpp', + 'schriter.cpp', + 'serv.cpp', + 'servlk.cpp', + 'servlkf.cpp', + 'servls.cpp', + 'servnotf.cpp', + 'servrbf.cpp', + 'servslkf.cpp', + 'sharedobject.cpp', + 'simpleformatter.cpp', + 'static_unicode_sets.cpp', + 'stringpiece.cpp', + 'stringtriebuilder.cpp', + 'uarrsort.cpp', + 'ubidi.cpp', + 'ubidi_props.cpp', + 'ubidiln.cpp', + 'ubidiwrt.cpp', + 'ubrk.cpp', + 'ucase.cpp', + 'ucasemap.cpp', + 'ucasemap_titlecase_brkiter.cpp', + 'ucat.cpp', + 'uchar.cpp', + 'ucharstrie.cpp', + 'ucharstriebuilder.cpp', + 'ucharstrieiterator.cpp', + 'uchriter.cpp', + 'ucln_cmn.cpp', + 'ucmndata.cpp', + 'ucnv.cpp', + 'ucnv2022.cpp', + 'ucnv_bld.cpp', + 'ucnv_cb.cpp', + 'ucnv_cnv.cpp', + 'ucnv_ct.cpp', + 'ucnv_err.cpp', + 'ucnv_ext.cpp', + 'ucnv_io.cpp', + 'ucnv_lmb.cpp', + 'ucnv_set.cpp', + 'ucnv_u16.cpp', + 'ucnv_u32.cpp', + 'ucnv_u7.cpp', + 'ucnv_u8.cpp', + 'ucnvbocu.cpp', + 'ucnvdisp.cpp', + 'ucnvhz.cpp', + 'ucnvisci.cpp', + 'ucnvlat1.cpp', + 'ucnvmbcs.cpp', + 'ucnvscsu.cpp', + 'ucnvsel.cpp', + 'ucol_swp.cpp', + 'ucptrie.cpp', + 'ucurr.cpp', + 'udata.cpp', + 'udatamem.cpp', + 'udataswp.cpp', + 'uenum.cpp', + 'uhash.cpp', + 'uhash_us.cpp', + 'uidna.cpp', + 'uinit.cpp', + 'uinvchar.cpp', + 'uiter.cpp', + 'ulist.cpp', + 'uloc.cpp', + 'uloc_keytype.cpp', + 'uloc_tag.cpp', + 'umapfile.cpp', + 'umath.cpp', + 'umutablecptrie.cpp', + 'umutex.cpp', + 'unames.cpp', + 'unifiedcache.cpp', + 'unifilt.cpp', + 'unifunct.cpp', + 'uniset.cpp', + 'uniset_closure.cpp', + 'uniset_props.cpp', + 'unisetspan.cpp', + 'unistr.cpp', + 'unistr_case.cpp', + 'unistr_case_locale.cpp', + 'unistr_cnv.cpp', + 'unistr_props.cpp', + 'unistr_titlecase_brkiter.cpp', + 'unorm.cpp', + 'unormcmp.cpp', + 'uobject.cpp', + 'uprops.cpp', + 'ures_cnv.cpp', + 'uresbund.cpp', + 'uresdata.cpp', + 'usc_impl.cpp', + 'uscript.cpp', + 'uscript_props.cpp', + 'uset.cpp', + 'uset_props.cpp', + 'usetiter.cpp', + 'ushape.cpp', + 'usprep.cpp', + 'ustack.cpp', + 'ustr_cnv.cpp', + 'ustr_titlecase_brkiter.cpp', + 'ustr_wcs.cpp', + 'ustrcase.cpp', + 'ustrcase_locale.cpp', + 'ustrenum.cpp', + 'ustrfmt.cpp', + 'ustring.cpp', + 'ustrtrns.cpp', + 'utext.cpp', + 'utf_impl.cpp', + 'util.cpp', + 'util_props.cpp', + 'utrace.cpp', + 'utrie.cpp', + 'utrie2.cpp', + 'utrie2_builder.cpp', + 'utrie_swap.cpp', + 'uts46.cpp', + 'utypes.cpp', + 'uvector.cpp', + 'uvectr32.cpp', + 'uvectr64.cpp', + 'wintz.cpp', +) + +if host_machine.system() == 'windows' + sources += windows.compile_resources('common.rc', include_directories: incdir) +endif + +icuuc_name = '@0@icuuc@1@'.format(library_prefix, library_suffix) + +common_lib = library( + icuuc_name, + sources, + include_directories: [incdir,'../..'], + c_args: '-DU_COMMON_IMPLEMENTATION', + cpp_args: '-DU_COMMON_IMPLEMENTATION', + link_with: stubdata_lib, + # dependencies: dl_dep, + version: U_ICU_VERSION, + install: true, +) + +# if meson.can_run_host_binaries() + common_native_lib = common_lib +# else +# common_native_lib = library( +# '@0@-native'.format(icuuc_name), +# sources, +# include_directories: incdir, +# c_args: '-DU_COMMON_IMPLEMENTATION', +# cpp_args: '-DU_COMMON_IMPLEMENTATION', +# link_with: stubdata_native_lib, +# # dependencies: dl_native_dep, +# version: U_ICU_VERSION, +# native: true, +# ) +# endif + +icuuc_dep = declare_dependency( + link_with: common_lib, + compile_args: usage_args, + include_directories: incdir, + # dependencies: dl_dep, +) + +# icuuc_native_dep = declare_dependency( +# link_with: common_native_lib, +# compile_args: usage_args, +# include_directories: incdir, +# dependencies: dl_native_dep, +# ) + +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('icu-uc', icuuc_dep) +endif + +headers = files( + 'unicode/appendable.h', + 'unicode/brkiter.h', + 'unicode/bytestream.h', + 'unicode/bytestrie.h', + 'unicode/bytestriebuilder.h', + 'unicode/caniter.h', + 'unicode/casemap.h', + 'unicode/char16ptr.h', + 'unicode/chariter.h', + 'unicode/dbbi.h', + 'unicode/docmain.h', + 'unicode/dtintrv.h', + 'unicode/edits.h', + 'unicode/enumset.h', + 'unicode/errorcode.h', + 'unicode/filteredbrk.h', + 'unicode/icudataver.h', + 'unicode/icuplug.h', + 'unicode/idna.h', + 'unicode/localebuilder.h', + 'unicode/localematcher.h', + 'unicode/localpointer.h', + 'unicode/locdspnm.h', + 'unicode/locid.h', + 'unicode/messagepattern.h', + 'unicode/normalizer2.h', + 'unicode/normlzr.h', + 'unicode/parseerr.h', + 'unicode/parsepos.h', + 'unicode/platform.h', + 'unicode/ptypes.h', + 'unicode/putil.h', + 'unicode/rbbi.h', + 'unicode/rep.h', + 'unicode/resbund.h', + 'unicode/schriter.h', + 'unicode/simpleformatter.h', + 'unicode/std_string.h', + 'unicode/strenum.h', + 'unicode/stringoptions.h', + 'unicode/stringpiece.h', + 'unicode/stringtriebuilder.h', + 'unicode/symtable.h', + 'unicode/ubidi.h', + 'unicode/ubiditransform.h', + 'unicode/ubrk.h', + 'unicode/ucasemap.h', + 'unicode/ucat.h', + 'unicode/uchar.h', + 'unicode/ucharstrie.h', + 'unicode/ucharstriebuilder.h', + 'unicode/uchriter.h', + 'unicode/uclean.h', + 'unicode/ucnv.h', + 'unicode/ucnv_cb.h', + 'unicode/ucnv_err.h', + 'unicode/ucnvsel.h', + 'unicode/uconfig.h', + 'unicode/ucpmap.h', + 'unicode/ucptrie.h', + 'unicode/ucurr.h', + 'unicode/udata.h', + 'unicode/udisplaycontext.h', + 'unicode/uenum.h', + 'unicode/uidna.h', + 'unicode/uiter.h', + 'unicode/uldnames.h', + 'unicode/uloc.h', + 'unicode/umachine.h', + 'unicode/umisc.h', + 'unicode/umutablecptrie.h', + 'unicode/unifilt.h', + 'unicode/unifunct.h', + 'unicode/unimatch.h', + 'unicode/uniset.h', + 'unicode/unistr.h', + 'unicode/unorm.h', + 'unicode/unorm2.h', + 'unicode/uobject.h', + 'unicode/urename.h', + 'unicode/urep.h', + 'unicode/ures.h', + 'unicode/uscript.h', + 'unicode/uset.h', + 'unicode/usetiter.h', + 'unicode/ushape.h', + 'unicode/usprep.h', + 'unicode/ustring.h', + 'unicode/ustringtrie.h', + 'unicode/utext.h', + 'unicode/utf.h', + 'unicode/utf16.h', + 'unicode/utf32.h', + 'unicode/utf8.h', + 'unicode/utf_old.h', + 'unicode/utrace.h', + 'unicode/utypes.h', + 'unicode/uvernum.h', + 'unicode/uversion.h', +) + +install_headers( + headers, + subdir: 'unicode', +) + +pkg.generate( + common_lib, + name: 'icu-uc', + description: '@0@: Common and Data libraries'.format(PACKAGE_ICU_DESCRIPTION), + url: PACKAGE_ICU_URL, +) diff --git a/core/subprojects/packagefiles/icu/source/data/export_module.py b/core/subprojects/packagefiles/icu/source/data/export_module.py new file mode 100644 index 0000000000000000000000000000000000000000..d29b1c898da773b663e7140f783f1e48a7c55c7b --- /dev/null +++ b/core/subprojects/packagefiles/icu/source/data/export_module.py @@ -0,0 +1,17 @@ +#!/usr/bin/env python3 +# SPDX-FileCopyrightText: 2022 L. E. Segovia +# SPDX-License-Identifier: MIT + +from argparse import ArgumentParser, FileType +from sys import stdout + +if __name__ == '__main__': + parser = ArgumentParser() + parser.add_argument('symbol', type=str, help='Symbol to export') + parser.add_argument('outfile', nargs='?', type=FileType('w', encoding='utf-8'), + default=stdout, help='Module definition file') + args = parser.parse_args() + + with args.outfile as f: + f.write("EXPORTS\n") + f.write(f"\t{args.symbol}\n") diff --git a/core/subprojects/packagefiles/icu/source/data/meson.build b/core/subprojects/packagefiles/icu/source/data/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..80fd51ba6c0e110f9862328904231f581d9bdca9 --- /dev/null +++ b/core/subprojects/packagefiles/icu/source/data/meson.build @@ -0,0 +1,84 @@ +U_ICUDATA_NAME = 'icudt@0@'.format(U_ICU_VERSION.split('.')[0]) + +icudata_command = [ + genccode_native_exe, + '-d', + '@OUTDIR@', + '-e', + U_ICUDATA_NAME, + '-f', + U_ICUDATA_NAME, + '@CURRENT_SOURCE_DIR@/in/@0@l.dat'.format(U_ICUDATA_NAME), +] + +if host_machine.system() == 'windows' and get_option('default_library') == 'static' + icudata_command += ['--skip-dll-export'] +endif + +if cpp.get_argument_syntax() == 'msvc' + ## Uncomment if you want to use MASM (>= 0.64), but be aware + ## it is Very Slow to build. + # if add_languages('masm', required: false) + # icudata_asm_output = '@0@.masm'.format(U_ICUDATA_NAME) + # icudata_command += ['-a', 'masm'] + # else + icudata_asm_output = '@0@.c'.format(U_ICUDATA_NAME) + # endif +elif host_machine.system() == 'cygwin' + icudata_asm_output = '@0@.S'.format(U_ICUDATA_NAME) + icudata_command += ['-a', 'gcc-cygwin'] +elif host_machine.system() == 'darwin' + icudata_asm_output = '@0@.S'.format(U_ICUDATA_NAME) + icudata_command += ['-a', 'gcc-darwin'] +elif cpp.get_id() == 'gcc' or cpp.get_id() == 'clang' + icudata_asm_output = '@0@.S'.format(U_ICUDATA_NAME) + if host_machine.system() == 'windows' + icudata_command += ['-a', 'gcc-mingw64'] + else + icudata_command += ['-a', 'gcc'] + endif +else + icudata_asm_output = '@0@.c'.format(U_ICUDATA_NAME) +endif + +icudata_asm = custom_target( + 'icudata_asm', + command: icudata_command, + output: icudata_asm_output, +) + +sources = [icudata_asm] + +python_exe = import('python').find_installation('python3') + +icudata_exports = custom_target( + 'icudata_exports', + command: [python_exe, '@INPUT@', '@0@_dat'.format(U_ICUDATA_NAME), '@OUTDIR@/module.def'], + input: 'export_module.py', + output: 'module.def', +) + +if host_machine.system() == 'windows' + sources += windows.compile_resources('misc/icudata.rc', include_directories: incdir) +endif + +if cpp.get_id() != 'msvc' + icudata = library( + icudata_name, + sources, + include_directories: incdir, + version: U_ICU_VERSION, + vs_module_defs: icudata_exports, + install: true, + ) + + icudata_dep = declare_dependency( + link_with: icudata, + include_directories: incdir, + compile_args: usage_args, + ) + + if meson.version().version_compare('>=0.54.0') + meson.override_dependency('icu-data', icudata_dep) + endif +endif diff --git a/core/subprojects/packagefiles/icu/source/i18n/meson.build b/core/subprojects/packagefiles/icu/source/i18n/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..787afe339049813d5d9a93b2dd69888b42e475da --- /dev/null +++ b/core/subprojects/packagefiles/icu/source/i18n/meson.build @@ -0,0 +1,408 @@ +sources = files( + 'alphaindex.cpp', + 'anytrans.cpp', + 'astro.cpp', + 'basictz.cpp', + 'bocsu.cpp', + 'brktrans.cpp', + 'buddhcal.cpp', + 'calendar.cpp', + 'casetrn.cpp', + 'cecal.cpp', + 'chnsecal.cpp', + 'choicfmt.cpp', + 'coleitr.cpp', + 'coll.cpp', + 'collation.cpp', + 'collationbuilder.cpp', + 'collationcompare.cpp', + 'collationdata.cpp', + 'collationdatabuilder.cpp', + 'collationdatareader.cpp', + 'collationdatawriter.cpp', + 'collationfastlatin.cpp', + 'collationfastlatinbuilder.cpp', + 'collationfcd.cpp', + 'collationiterator.cpp', + 'collationkeys.cpp', + 'collationroot.cpp', + 'collationrootelements.cpp', + 'collationruleparser.cpp', + 'collationsets.cpp', + 'collationsettings.cpp', + 'collationtailoring.cpp', + 'collationweights.cpp', + 'compactdecimalformat.cpp', + 'coptccal.cpp', + 'cpdtrans.cpp', + 'csdetect.cpp', + 'csmatch.cpp', + 'csr2022.cpp', + 'csrecog.cpp', + 'csrmbcs.cpp', + 'csrsbcs.cpp', + 'csrucode.cpp', + 'csrutf8.cpp', + 'curramt.cpp', + 'currfmt.cpp', + 'currpinf.cpp', + 'currunit.cpp', + 'dangical.cpp', + 'datefmt.cpp', + 'dayperiodrules.cpp', + 'dcfmtsym.cpp', + 'decContext.cpp', + 'decNumber.cpp', + 'decimfmt.cpp', + 'displayoptions.cpp', + 'double-conversion-bignum-dtoa.cpp', + 'double-conversion-bignum.cpp', + 'double-conversion-cached-powers.cpp', + 'double-conversion-double-to-string.cpp', + 'double-conversion-fast-dtoa.cpp', + 'double-conversion-string-to-double.cpp', + 'double-conversion-strtod.cpp', + 'dtfmtsym.cpp', + 'dtitvfmt.cpp', + 'dtitvinf.cpp', + 'dtptngen.cpp', + 'dtrule.cpp', + 'erarules.cpp', + 'esctrn.cpp', + 'ethpccal.cpp', + 'fmtable.cpp', + 'fmtable_cnv.cpp', + 'format.cpp', + 'formatted_string_builder.cpp', + 'formattedval_iterimpl.cpp', + 'formattedval_sbimpl.cpp', + 'formattedvalue.cpp', + 'fphdlimp.cpp', + 'fpositer.cpp', + 'funcrepl.cpp', + 'gender.cpp', + 'gregocal.cpp', + 'gregoimp.cpp', + 'hebrwcal.cpp', + 'indiancal.cpp', + 'inputext.cpp', + 'islamcal.cpp', + 'japancal.cpp', + 'listformatter.cpp', + 'measfmt.cpp', + 'measunit.cpp', + 'measunit_extra.cpp', + 'measure.cpp', + 'msgfmt.cpp', + 'name2uni.cpp', + 'nfrs.cpp', + 'nfrule.cpp', + 'nfsubs.cpp', + 'nortrans.cpp', + 'nultrans.cpp', + 'number_affixutils.cpp', + 'number_asformat.cpp', + 'number_capi.cpp', + 'number_compact.cpp', + 'number_currencysymbols.cpp', + 'number_decimalquantity.cpp', + 'number_decimfmtprops.cpp', + 'number_fluent.cpp', + 'number_formatimpl.cpp', + 'number_formatimpl.cpp', + 'number_grouping.cpp', + 'number_integerwidth.cpp', + 'number_longnames.cpp', + 'number_mapper.cpp', + 'number_modifiers.cpp', + 'number_multiplier.cpp', + 'number_notation.cpp', + 'number_output.cpp', + 'number_padding.cpp', + 'number_patternmodifier.cpp', + 'number_patternstring.cpp', + 'number_rounding.cpp', + 'number_scientific.cpp', + 'number_skeletons.cpp', + 'number_symbolswrapper.cpp', + 'number_usageprefs.cpp', + 'number_utils.cpp', + 'numfmt.cpp', + 'numparse_affixes.cpp', + 'numparse_compositions.cpp', + 'numparse_currency.cpp', + 'numparse_decimal.cpp', + 'numparse_impl.cpp', + 'numparse_parsednumber.cpp', + 'numparse_scientific.cpp', + 'numparse_symbols.cpp', + 'numparse_validators.cpp', + 'numrange_capi.cpp', + 'numrange_fluent.cpp', + 'numrange_impl.cpp', + 'numsys.cpp', + 'olsontz.cpp', + 'persncal.cpp', + 'pluralranges.cpp', + 'plurfmt.cpp', + 'plurrule.cpp', + 'quant.cpp', + 'quantityformatter.cpp', + 'rbnf.cpp', + 'rbt.cpp', + 'rbt_data.cpp', + 'rbt_pars.cpp', + 'rbt_rule.cpp', + 'rbt_set.cpp', + 'rbtz.cpp', + 'regexcmp.cpp', + 'regeximp.cpp', + 'regexst.cpp', + 'regextxt.cpp', + 'region.cpp', + 'reldatefmt.cpp', + 'reldtfmt.cpp', + 'rematch.cpp', + 'remtrans.cpp', + 'repattrn.cpp', + 'rulebasedcollator.cpp', + 'scientificnumberformatter.cpp', + 'scriptset.cpp', + 'search.cpp', + 'selfmt.cpp', + 'sharedbreakiterator.cpp', + 'simpletz.cpp', + 'smpdtfmt.cpp', + 'smpdtfst.cpp', + 'sortkey.cpp', + 'standardplural.cpp', + 'string_segment.cpp', + 'strmatch.cpp', + 'strrepl.cpp', + 'stsearch.cpp', + 'taiwncal.cpp', + 'timezone.cpp', + 'titletrn.cpp', + 'tmunit.cpp', + 'tmutamt.cpp', + 'tmutfmt.cpp', + 'tolowtrn.cpp', + 'toupptrn.cpp', + 'translit.cpp', + 'transreg.cpp', + 'tridpars.cpp', + 'tzfmt.cpp', + 'tzgnames.cpp', + 'tznames.cpp', + 'tznames_impl.cpp', + 'tzrule.cpp', + 'tztrans.cpp', + 'ucal.cpp', + 'ucln_in.cpp', + 'ucol.cpp', + 'ucol_res.cpp', + 'ucol_sit.cpp', + 'ucoleitr.cpp', + 'ucsdet.cpp', + 'udat.cpp', + 'udateintervalformat.cpp', + 'udatpg.cpp', + 'ufieldpositer.cpp', + 'uitercollationiterator.cpp', + 'ulistformatter.cpp', + 'ulocdata.cpp', + 'umsg.cpp', + 'unesctrn.cpp', + 'uni2name.cpp', + 'units_complexconverter.cpp', + 'units_converter.cpp', + 'units_data.cpp', + 'units_router.cpp', + 'unum.cpp', + 'unumsys.cpp', + 'upluralrules.cpp', + 'uregex.cpp', + 'uregexc.cpp', + 'uregion.cpp', + 'usearch.cpp', + 'uspoof.cpp', + 'uspoof_build.cpp', + 'uspoof_conf.cpp', + 'uspoof_impl.cpp', + 'utf16collationiterator.cpp', + 'utf8collationiterator.cpp', + 'utmscale.cpp', + 'utrans.cpp', + 'vtzone.cpp', + 'vzone.cpp', + 'windtfmt.cpp', + 'winnmfmt.cpp', + 'wintzimpl.cpp', + 'zonemeta.cpp', + 'zrule.cpp', + 'ztrans.cpp', + # 'decimalformatpattern.cpp', + # 'ucurr.cpp', + # 'digitlst.cpp', + # 'uspoof_wsconf.cpp', + # 'decfmtst.cpp', + # 'locdspnm.cpp', + # 'identifier_info.cpp', + # 'filteredbrk.cpp', +) + +if host_machine.system() == 'windows' + sources += windows.compile_resources('i18n.rc', include_directories: incdir) +endif + +if host_machine.system() == 'windows' + i18n_name = '@0@icuin@1@'.format(library_prefix, library_suffix) +else + i18n_name = '@0@icui18n@1@'.format(library_prefix, library_suffix) +endif + +i18n_lib = library( + i18n_name, + sources, + dependencies: icuuc_dep, + c_args: '-DU_I18N_IMPLEMENTATION', + cpp_args: '-DU_I18N_IMPLEMENTATION', + version: U_ICU_VERSION, + install: true, +) + +# if meson.can_run_host_binaries() + i18n_native_lib = i18n_lib +# else +# i18n_native_lib = library( +# '@0@-native'.format(i18n_name), +# sources, +# dependencies: icuuc_native_dep, +# c_args: '-DU_I18N_IMPLEMENTATION', +# cpp_args: '-DU_I18N_IMPLEMENTATION', +# version: U_ICU_VERSION, +# native: true, +# ) +# endif + +i18ninc = include_directories('.') + +icui18n_dep = declare_dependency( + include_directories: i18ninc, + link_with: i18n_lib, + dependencies: icuuc_dep, +) + +# icui18n_native_dep = declare_dependency( +# include_directories: i18ninc, +# link_with: i18n_native_lib, +# dependencies: icuuc_native_dep, +# ) + +if meson.version().version_compare('>=0.54.0') + meson.override_dependency('icu-i18n', icui18n_dep) +endif + +headers = files( + 'unicode/alphaindex.h', + 'unicode/basictz.h', + 'unicode/calendar.h', + 'unicode/choicfmt.h', + 'unicode/coleitr.h', + 'unicode/coll.h', + 'unicode/compactdecimalformat.h', + 'unicode/curramt.h', + 'unicode/currpinf.h', + 'unicode/currunit.h', + 'unicode/datefmt.h', + 'unicode/dcfmtsym.h', + 'unicode/decimfmt.h', + 'unicode/displayoptions.h', + 'unicode/dtfmtsym.h', + 'unicode/dtitvfmt.h', + 'unicode/dtitvinf.h', + 'unicode/dtptngen.h', + 'unicode/dtrule.h', + 'unicode/fieldpos.h', + 'unicode/fmtable.h', + 'unicode/format.h', + 'unicode/formattedvalue.h', + 'unicode/fpositer.h', + 'unicode/gender.h', + 'unicode/gregocal.h', + 'unicode/listformatter.h', + 'unicode/measfmt.h', + 'unicode/measunit.h', + 'unicode/measure.h', + 'unicode/msgfmt.h', + 'unicode/nounit.h', + 'unicode/numberformatter.h', + 'unicode/numberrangeformatter.h', + 'unicode/numfmt.h', + 'unicode/numsys.h', + 'unicode/plurfmt.h', + 'unicode/plurrule.h', + 'unicode/rbnf.h', + 'unicode/rbtz.h', + 'unicode/regex.h', + 'unicode/region.h', + 'unicode/reldatefmt.h', + 'unicode/scientificnumberformatter.h', + 'unicode/search.h', + 'unicode/selfmt.h', + 'unicode/simpletz.h', + 'unicode/smpdtfmt.h', + 'unicode/sortkey.h', + 'unicode/stsearch.h', + 'unicode/tblcoll.h', + 'unicode/timezone.h', + 'unicode/tmunit.h', + 'unicode/tmutamt.h', + 'unicode/tmutfmt.h', + 'unicode/translit.h', + 'unicode/tzfmt.h', + 'unicode/tznames.h', + 'unicode/tzrule.h', + 'unicode/tztrans.h', + 'unicode/ucal.h', + 'unicode/ucol.h', + 'unicode/ucoleitr.h', + 'unicode/ucsdet.h', + 'unicode/udat.h', + 'unicode/udateintervalformat.h', + 'unicode/udatpg.h', + 'unicode/udisplayoptions.h', + 'unicode/ufieldpositer.h', + 'unicode/uformattable.h', + 'unicode/uformattedvalue.h', + 'unicode/ugender.h', + 'unicode/ulistformatter.h', + 'unicode/ulocdata.h', + 'unicode/umsg.h', + 'unicode/unirepl.h', + 'unicode/unum.h', + 'unicode/unumberformatter.h', + 'unicode/unumberrangeformatter.h', + 'unicode/unumsys.h', + 'unicode/upluralrules.h', + 'unicode/uregex.h', + 'unicode/uregion.h', + 'unicode/ureldatefmt.h', + 'unicode/usearch.h', + 'unicode/uspoof.h', + 'unicode/utmscale.h', + 'unicode/utrans.h', + 'unicode/vtzone.h', +) + +install_headers( + headers, + subdir: 'unicode', +) + +pkg.generate( + i18n_lib, + name: 'icu-i18n', + description: '@0@: Internationalization library'.format(PACKAGE_ICU_DESCRIPTION), + url: PACKAGE_ICU_URL, +) diff --git a/core/subprojects/packagefiles/icu/source/meson.build b/core/subprojects/packagefiles/icu/source/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..7d08a1e3cb1ba362501e3e4c4221e9470a2d6163 --- /dev/null +++ b/core/subprojects/packagefiles/icu/source/meson.build @@ -0,0 +1,22 @@ +incdir = include_directories('..', 'common') + +if host_machine.system() == 'windows' + icudata_name = '@0@icudt@1@'.format(library_prefix, library_suffix) +else + icudata_name = '@0@icudata@1@'.format(library_prefix, library_suffix) +endif + +subdir('stubdata') +subdir('common') + +# TODO-LDML: Not used now, will need for regex +# subdir('i18n') + +## Note: The following subdirs are not used by Keyman (at present) + +# subdir('data') +# subdir('io') +# subdir('layout') +# subdir('layoutex') +# subdir('test') +# subdir('tools') diff --git a/core/subprojects/packagefiles/icu/source/stubdata/meson.build b/core/subprojects/packagefiles/icu/source/stubdata/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..f5ee86712aa4a543b99de6c4ac7a2ff469b85ce3 --- /dev/null +++ b/core/subprojects/packagefiles/icu/source/stubdata/meson.build @@ -0,0 +1,26 @@ +sources = files( + 'stubdata.cpp', +) + +stubdata_lib = library( + icudata_name, + sources, + c_args: '-DSTUBDATA_BUILD', + cpp_args: '-DSTUBDATA_BUILD', + include_directories: incdir, + version: U_ICU_VERSION, +) + +# if meson.can_run_host_binaries() + stubdata_native_lib = stubdata_lib +# else +# stubdata_native_lib = library( +# '@0@-native'.format(icudata_name), +# sources, +# c_args: '-DSTUBDATA_BUILD', +# cpp_args: '-DSTUBDATA_BUILD', +# include_directories: incdir, +# version: U_ICU_VERSION, +# native: true, +# ) +# endif diff --git a/core/tests/unit/kmx/kmx_test_source.cpp b/core/tests/kmx_test_source/kmx_test_source.cpp similarity index 100% rename from core/tests/unit/kmx/kmx_test_source.cpp rename to core/tests/kmx_test_source/kmx_test_source.cpp diff --git a/core/tests/unit/kmx/kmx_test_source.hpp b/core/tests/kmx_test_source/kmx_test_source.hpp similarity index 100% rename from core/tests/unit/kmx/kmx_test_source.hpp rename to core/tests/kmx_test_source/kmx_test_source.hpp diff --git a/core/tests/kmx_test_source/meson.build b/core/tests/kmx_test_source/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..691839047f82f7995ec23b79682eb698ff9e0e92 --- /dev/null +++ b/core/tests/kmx_test_source/meson.build @@ -0,0 +1,25 @@ + +# TODO -- why are these differing from the standard.meson.build flags? +if cpp_compiler.get_id() == 'gcc' or cpp_compiler.get_id() == 'clang' or cpp_compiler.get_id() == 'emscripten' + warns = [ + '-Wno-missing-field-initializers', + '-Wno-unused-parameter' + ] +else + warns = [] +endif + +coretest_files = files( + 'kmx_test_source.cpp', +) + +kmx_test_source_lib = static_library('kmnkbp-tests', + coretest_files, + cpp_args: defns + warns + flags, + include_directories: [inc, libsrc], + link_args: links, + objects: lib.extract_all_objects(recursive: false), + pic: true, + install: false +) + diff --git a/core/tests/meson.build b/core/tests/meson.build index be58e6975c4d31a2c8400f356a5b8f31e6f2eda2..e2e29975822dcf9918f41d98ca64ca629289f625 100644 --- a/core/tests/meson.build +++ b/core/tests/meson.build @@ -12,13 +12,23 @@ stnds = join_paths(meson.current_source_dir(), 'standards') libsrc = include_directories(join_paths('../', 'src')) -if get_option('default_library') != 'static' - ctypes_void_p_size = ['-c', 'import ctypes; print(ctypes.sizeof(ctypes.c_void_p))'] - r = run_command(python, ctypes_void_p_size) - python_ctypes_compatible = r.stdout().to_int() == compiler.sizeof('void *') - if not python_ctypes_compatible - message('Python ctypes is incompatible with built shared object. Disabling some tests.') +# kmx_test_source is required for linux builds, so always enable it even when we +# disable all other tests +subdir('kmx_test_source') + +if get_option('keyman_core_tests') + message('option "keyman_core_tests" is true, enabling tests') + + if get_option('default_library') != 'static' + ctypes_void_p_size = ['-c', 'import ctypes; print(ctypes.sizeof(ctypes.c_void_p))'] + r = run_command(python, ctypes_void_p_size) + python_ctypes_compatible = r.stdout().to_int() == cpp_compiler.sizeof('void *') + if not python_ctypes_compatible + message('Python ctypes is incompatible with built shared object. Disabling some tests.') + endif endif -endif -subdir('unit') + subdir('unit') +else + message('option "keyman_core_tests" is false, disabling tests') +endif diff --git a/core/tests/unit/emscripten_filesystem.cpp b/core/tests/unit/emscripten_filesystem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c5e180f6beabf67d14f0d526f76b83718a4d564a --- /dev/null +++ b/core/tests/unit/emscripten_filesystem.cpp @@ -0,0 +1,72 @@ + + +#ifdef __EMSCRIPTEN__ + +#include +#include +#include + +const std::string get_wasm_file_path(const std::string& filename) { + // Verify that we are passing a fully-qualified path + // TODO: we need to support relative paths based on CWD +#if _DEBUG_FOPEN + std::cout << "get_wasm_file_path ENTER (" << filename << ")" << std::endl; +#endif + + assert( + (filename.length() > 0 && filename.at(0) == '/') || + (filename.length() > 1 && filename.at(1) == ':') + ); + +#if _DEBUG_FOPEN + std::cout << "get_wasm_file_path assert passed " << std::endl; +#endif + + EM_ASM_({ + //console.log('EM_ASM enter'); + let path = Module.UTF8ToString($0); + const isWin32Path = path.match(/^[a-zA-Z]:/); + + //console.log('EM_ASM path = '+path); + let root = '/nodefs-mount'; + if(!FS.analyzePath(root).exists) { + //console.log('EM_ASM mkdir '+root); + FS.mkdir(root); + if(!isWin32Path) { + //console.log('EM_ASM mount '+root); + FS.mount(NODEFS, {root : '/'}, root); + } + } + + if(isWin32Path) { + // Win32 path, one mount per drive + root += "/" + path.charAt(0); + if(!FS.analyzePath(root).exists) { + //console.log('EM_ASM mkdir '+root); + FS.mkdir(root); + //console.log('EM_ASM mount '+root); + FS.mount(NODEFS, {root : path.substr(0,3) }, root); + } + } + }, filename.c_str()); + +#if _DEBUG_FOPEN + std::cout << "get_wasm_file_path EM_ASM_ passed " << std::endl; +#endif + + std::string f = std::string("/nodefs-mount"); + + if(filename.length() > 2 && filename.at(1) == ':') { + f += std::string("/") + filename.at(0) + filename.substr(2); + } else { + f += filename; + } + +#if _DEBUG_FOPEN + std::cout << "get_wasm_file_path opening virtual path: " << f << std::endl; +#endif + + return f; +} + +#endif diff --git a/core/tests/unit/emscripten_filesystem.h b/core/tests/unit/emscripten_filesystem.h new file mode 100644 index 0000000000000000000000000000000000000000..c5fb8e016a077464ca17c72cbf760c293a8deee1 --- /dev/null +++ b/core/tests/unit/emscripten_filesystem.h @@ -0,0 +1,8 @@ +#pragma once + +#ifdef __EMSCRIPTEN__ +#include + +const std::string get_wasm_file_path(const std::string& filename); + +#endif \ No newline at end of file diff --git a/core/tests/unit/json/meson.build b/core/tests/unit/json/meson.build index 42106976cd27d5864751950d24c06e0fd120cb6a..6289d7db0cb1f6bba414e7ff816a80615600a2e9 100644 --- a/core/tests/unit/json/meson.build +++ b/core/tests/unit/json/meson.build @@ -4,7 +4,7 @@ # Authors: Tim Eves (TSE) # -if compiler.get_id() == 'emscripten' +if cpp_compiler.get_id() == 'emscripten' tests_flags = ['-lnodefs.js'] else tests_flags = [] diff --git a/core/tests/unit/kmnkbd/action_items.hpp b/core/tests/unit/kmnkbd/action_items.hpp index 676e904eed15482e09611a606ee36162f06bbc21..253b8c740a5aea83f74a796cee69f2380704a189 100644 --- a/core/tests/unit/kmnkbd/action_items.hpp +++ b/core/tests/unit/kmnkbd/action_items.hpp @@ -2,7 +2,7 @@ #include #include -#include "../test_assert.h" +#include namespace { diff --git a/core/tests/unit/kmnkbd/debug_api.cpp b/core/tests/unit/kmnkbd/debug_api.cpp index 51dcba904c1ea4bfee5e28da6745a4dc270cbaf9..b4cfae6ab39494a095978f0ebf4a9c16e1a98420 100644 --- a/core/tests/unit/kmnkbd/debug_api.cpp +++ b/core/tests/unit/kmnkbd/debug_api.cpp @@ -18,7 +18,8 @@ #include "action_items.hpp" #include "debug_items.hpp" -#include "../test_assert.h" +#include +#include "../emscripten_filesystem.h" using namespace km::kbp::kmx; @@ -30,7 +31,7 @@ km_kbp_option_item test_env_opts[] = km_kbp_keyboard * test_kb = nullptr; km_kbp_state * test_state = nullptr; km_kbp_context_item * citems = nullptr; -char * arg_path; +std::string arg_path; void teardown() { if(citems) { @@ -71,9 +72,9 @@ void setup(const char *keyboard) { * Test 1: Start with debugging disabled */ void test_debugging_disabled() { - setup("000 - null keyboard.kmx"); + setup("k_000___null_keyboard.kmx"); try_status(km_kbp_state_debug_set(test_state, 0)); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_S, KM_KBP_MODIFIER_SHIFT, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_S, KM_KBP_MODIFIER_SHIFT, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_END} })); @@ -88,10 +89,10 @@ void test_debugging_disabled() { * Test 2: Debugging enabled, no rule match */ void test_debugging_no_rule_match() { - setup("000 - null keyboard.kmx"); + setup("k_000___null_keyboard.kmx"); DEBUG_GROUP gp = {u"Main"}; try_status(km_kbp_state_debug_set(test_state, 1)); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_S, KM_KBP_MODIFIER_SHIFT, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_S, KM_KBP_MODIFIER_SHIFT, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_S, KM_KBP_MODIFIER_SHIFT, 'S'}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -109,10 +110,10 @@ void test_debugging_no_rule_match() { * Test 3: Debugging enabled, function key pressed, no rule match */ void test_debugging_function_key() { - setup("000 - null keyboard.kmx"); + setup("k_000___null_keyboard.kmx"); DEBUG_GROUP gp = {u"Main"}; try_status(km_kbp_state_debug_set(test_state, 1)); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_F1, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_F1, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_F1, 0, 0}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -131,14 +132,14 @@ void test_debugging_function_key() { * Test 4: basic rule match */ void test_basic_rule_matches() { - setup("002 - basic input Unicode.kmx"); + setup("k_002___basic_input_unicode.kmx"); DEBUG_GROUP gp = {u"Main"}; - DEBUG_KEY kp = { 'F', /*line*/16, /*shift*/0 }; // vkey is a char + DEBUG_KEY kp = { 'F', /*line*/17, /*shift*/0 }; // vkey is a char try_status(km_kbp_state_debug_set(test_state, 1)); // 'DE' + 'F' > U+0E04 U+0E05 U+0E06 - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_D, KM_KBP_MODIFIER_SHIFT, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_D, KM_KBP_MODIFIER_SHIFT, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_D, KM_KBP_MODIFIER_SHIFT, 'D'}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -151,7 +152,7 @@ void test_basic_rule_matches() { {KM_KBP_IT_END} })); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_E, KM_KBP_MODIFIER_SHIFT, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_E, KM_KBP_MODIFIER_SHIFT, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_E, KM_KBP_MODIFIER_SHIFT, 'E'}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -164,7 +165,7 @@ void test_basic_rule_matches() { {KM_KBP_IT_END} })); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_F, KM_KBP_MODIFIER_SHIFT, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_F, KM_KBP_MODIFIER_SHIFT, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_F, KM_KBP_MODIFIER_SHIFT, 'F'}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -197,18 +198,18 @@ void test_basic_rule_matches() { * Test 5: Multiple groups */ void test_multiple_groups() { - setup("030 - multiple groups.kmx"); + setup("k_030___multiple_groups.kmx"); DEBUG_GROUP gp = {u"Main"}, gpa = {u"a"}, gpb = {u"b"}; - DEBUG_KEY kp1 = { KM_KBP_VKEY_1, /*line*/12, /*shift*/KM_KBP_MODIFIER_VIRTUALKEY }, - kp2 = { KM_KBP_VKEY_2, /*line*/13, /*shift*/KM_KBP_MODIFIER_VIRTUALKEY }, - kpa = { 0, /*line*/19, /*shift*/0 }, - kpb = { 0, /*line*/23, /*shift*/0 }; + DEBUG_KEY kp1 = { KM_KBP_VKEY_1, /*line*/13, /*shift*/KM_KBP_MODIFIER_VIRTUALKEY }, + kp2 = { KM_KBP_VKEY_2, /*line*/14, /*shift*/KM_KBP_MODIFIER_VIRTUALKEY }, + kpa = { 0, /*line*/20, /*shift*/0 }, + kpb = { 0, /*line*/24, /*shift*/0 }; try_status(km_kbp_state_debug_set(test_state, 1)); // '12' -> 'abc' - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_1, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_1, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_1, 0, '1'}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -238,7 +239,7 @@ void test_multiple_groups() { {KM_KBP_IT_END} })); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_2, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_2, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_2, 0, '2'}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -278,16 +279,16 @@ void test_multiple_groups() { * Test 6: store offsets */ void test_store_offsets() { - setup("044 - if and context.kmx"); + setup("k_044___if_and_context.kmx"); DEBUG_GROUP gp = {u"Main"}; - DEBUG_KEY kpa = { 'a', /*line*/15, }, - kpb = { 'b', /*line*/19, }; + DEBUG_KEY kpa = { 'a', /*line*/16, }, + kpb = { 'b', /*line*/20, }; try_status(km_kbp_state_debug_set(test_state, 1)); // 'ab' -> 'ex' - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_A, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_A, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_A, 0, 'a'}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -307,7 +308,7 @@ void test_store_offsets() { {KM_KBP_IT_END} })); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_B, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_B, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_B, 0, 'b'}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -352,16 +353,16 @@ void test_store_offsets() { * Test 7: set option */ void test_set_option() { - setup("021 - options.kmx"); + setup("k_021___options.kmx"); DEBUG_GROUP gp = {u"Main"}; - DEBUG_KEY kp1 = { '1', /*line*/16, }; + DEBUG_KEY kp1 = { '1', /*line*/17, }; DEBUG_STORE sp = {0, u"foo", u"1"}; try_status(km_kbp_state_debug_set(test_state, 1)); // '1' -> set_option - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_1, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_1, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_1, 0, '1'}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -379,9 +380,9 @@ void test_set_option() { * Test 8: save option */ void test_save_option() { - setup("023 - options with save.kmx"); + setup("k_023___options_with_save.kmx"); DEBUG_GROUP gp = {u"Main"}; - DEBUG_KEY kp1 = { '2', /*line*/19, }; + DEBUG_KEY kp1 = { '2', /*line*/21, }; // DEBUG_STORE sp = {0, u"foo", u"0"}; km_kbp_option_item opt = {u"foo", u"0", KM_KBP_OPT_KEYBOARD}; @@ -389,7 +390,7 @@ void test_save_option() { // '2' -> save_option - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_2, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_2, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_2, 0, '2'}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -412,7 +413,7 @@ void test_save_option() { * an 'unknown' backspace because we are at start-of-context */ void test_backspace_markers() { - setup("000 - null keyboard.kmx"); + setup("k_000___null_keyboard.kmx"); km_kbp_context_item marker_context[] = { {KM_KBP_CT_MARKER, {0,}, {1}}, {KM_KBP_CT_MARKER, {0,}, {1}}, @@ -424,7 +425,7 @@ void test_backspace_markers() { try_status(km_kbp_state_debug_set(test_state, 1)); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_BKSP, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_BKSP, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(debug_items(test_state, { km_kbp_state_debug_item{KM_KBP_DEBUG_BEGIN, KM_KBP_DEBUG_FLAG_UNICODE, {KM_KBP_VKEY_BKSP, 0, 0}}, km_kbp_state_debug_item{KM_KBP_DEBUG_GROUP_ENTER, 0, {}, {u"", &gp}}, @@ -496,7 +497,11 @@ int main(int argc, char *argv []) { } console_color::enabled = console_color::isaterminal() || arg_color; +#ifdef __EMSCRIPTEN__ + arg_path = get_wasm_file_path(argv[arg_color ? 2 : 1]); +#else arg_path = argv[arg_color ? 2 : 1]; +#endif test_debugging_disabled(); test_debugging_no_rule_match(); diff --git a/core/tests/unit/kmnkbd/debug_items.hpp b/core/tests/unit/kmnkbd/debug_items.hpp index 137325d7315b2e228ac690c5e90bad64f45eb115..95703005c45e573a8e57bd955dbac2396de5bf48 100644 --- a/core/tests/unit/kmnkbd/debug_items.hpp +++ b/core/tests/unit/kmnkbd/debug_items.hpp @@ -4,7 +4,7 @@ #include "kmx/kmx_base.h" #include "kmx/kmx_xstring.h" -#include "../test_assert.h" +#include using namespace km::kbp::kmx; diff --git a/core/tests/unit/kmnkbd/meson.build b/core/tests/unit/kmnkbd/meson.build index 4cdaa91186edf912f8e8738df9d0d17691cde1ec..049770fa2f7bebf3786cc24b042abcb0c8fcf8bf 100644 --- a/core/tests/unit/kmnkbd/meson.build +++ b/core/tests/unit/kmnkbd/meson.build @@ -4,7 +4,8 @@ # Authors: Tim Eves (TSE) # -if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang' or compiler.get_id() == 'emscripten' +# TODO -- why are these differing from the standard.meson.build flags? +if cpp_compiler.get_id() == 'gcc' or cpp_compiler.get_id() == 'clang' or cpp_compiler.get_id() == 'emscripten' warns = [ '-Wno-missing-field-initializers', '-Wno-unused-parameter' @@ -13,7 +14,7 @@ else warns = [] endif -defns+=['-DKMN_KBP_STATIC'] +local_defns = ['-DKMN_KBP_STATIC'] tests = [ ['context-api', 'context_api.cpp'], ['keyboard-api', 'keyboard_api.cpp'], @@ -24,22 +25,19 @@ tests = [ ['kmx_context', 'test_kmx_context.cpp'], ] -if compiler.get_id() == 'emscripten' - tests_flags = ['--embed-file', join_paths(meson.current_source_dir(),'..','kmx','@/')] - source_path = '/' - test_path = '/' -else - tests_flags = [] - source_path = meson.current_source_dir() - test_path = join_paths(meson.current_source_dir(), '..', 'kmx') +test_path = join_paths(meson.current_build_dir(), '..', 'kmx') +tests_flags = [] + +if cpp_compiler.get_id() == 'emscripten' + tests_flags += ['-lnodefs.js', '-sEXPORTED_RUNTIME_METHODS=[\'UTF8ToString\']'] endif foreach t : tests - bin = executable(t[0], t[1], - cpp_args: defns + warns, + bin = executable(t[0], [t[1], '../emscripten_filesystem.cpp'], + cpp_args: local_defns + defns + warns, include_directories: [inc, libsrc], link_args: links + tests_flags, - objects: lib.extract_all_objects()) + objects: lib.extract_all_objects(recursive: false)) test(t[0], bin, args: ['--color', test_path]) endforeach diff --git a/core/tests/unit/kmnkbd/state_api.cpp b/core/tests/unit/kmnkbd/state_api.cpp index 4e338fb21bea987ea30aba0e07344fb9fe9fc157..3ae446541c0f2a97d9ab6e6dd77ade78fc92cd18 100644 --- a/core/tests/unit/kmnkbd/state_api.cpp +++ b/core/tests/unit/kmnkbd/state_api.cpp @@ -15,7 +15,7 @@ #include "state.hpp" #include "action_items.hpp" -#include "../test_assert.h" +#include #if defined(__GNUC__) || defined(__clang__) #define PRAGMA(X) _Pragma(#X) @@ -156,20 +156,20 @@ int main(int argc, char * argv[]) DISABLE_WARNING_POP try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_S, - KM_KBP_MODIFIER_SHIFT, 1)); + KM_KBP_MODIFIER_SHIFT, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(action_items(test_state, {{KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('S')}}, {KM_KBP_IT_END}})); try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_I, - KM_KBP_MODIFIER_SHIFT, 1)); + KM_KBP_MODIFIER_SHIFT, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(action_items(test_state, {{KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('I')}}, {KM_KBP_IT_END}})); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_L, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_L, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(action_items(test_state, {{KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('l')}}, {KM_KBP_IT_END}})); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_BKSP, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_BKSP, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(action_items(test_state, {{KM_KBP_IT_BACK, {0,}, {0}}, {KM_KBP_IT_END}})); try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_L, - KM_KBP_MODIFIER_SHIFT, 1)); + KM_KBP_MODIFIER_SHIFT, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(action_items(test_state, {{KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('L')}}, {KM_KBP_IT_END}})); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_F2, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_F2, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(action_items(test_state, {{KM_KBP_IT_PERSIST_OPT, {0,}, {uintptr_t(&expected_persist_opt)}}, {KM_KBP_IT_END}})); diff --git a/core/tests/unit/kmnkbd/test_kmx_context.cpp b/core/tests/unit/kmnkbd/test_kmx_context.cpp index a05dfed543b070aec5c0ca939659775bf7120210..1023d1611e3244eee02b25f48667b9d7f73f30cb 100644 --- a/core/tests/unit/kmnkbd/test_kmx_context.cpp +++ b/core/tests/unit/kmnkbd/test_kmx_context.cpp @@ -13,7 +13,7 @@ #include "../../../src/kmx/kmx_context.h" #include "../../../src/kmx/kmx_processevent.h" // for Debug_UnicodeString #include "../../../src/kmx/kmx_xstring.h" -#include "../test_assert.h" +#include using namespace km::kbp::kmx; using namespace std; diff --git a/core/tests/unit/kmnkbd/test_kmx_xstring.cpp b/core/tests/unit/kmnkbd/test_kmx_xstring.cpp index 104851b7c59e88ca1736bcd601ef9010b86266bb..d578fa7e3813aa0e86e64a8855a360d5c78a5988 100644 --- a/core/tests/unit/kmnkbd/test_kmx_xstring.cpp +++ b/core/tests/unit/kmnkbd/test_kmx_xstring.cpp @@ -19,7 +19,7 @@ #include #include "../../../src/kmx/kmx_xstring.h" #include -#include "../test_assert.h" +#include using namespace km::kbp::kmx; using namespace std; @@ -1236,6 +1236,97 @@ test_xstrlen_ignoreifopt() { assert_equal(xstrlen_ignoreifopt((PKMX_WCHAR) U_1F609_WINKING_FACE u"a"), 2); } +void +test_utf32() { + const KMX_DWORD u295 = 0x0127; // ħ + + assert(Uni_IsBMP(u295)); + + const char16_t hmaqtugha = Uni_UTF32BMPToUTF16(u295); + assert(hmaqtugha == 0x0127); + + char16_single c0; + int l0 = Utf32CharToUtf16(u295, c0); + assert(l0 == 1); + assert(c0.ch[0] == 0x0127); + assert(c0.ch[1] == 0); + std::u16string s0 = std::u16string(c0.ch, l0); + assert(s0 == std::u16string(u"ħ")); + assert_equal(s0.at(0), 0x0127); + + const KMX_DWORD scat = 0x0001F640; // 🙀 + assert(!Uni_IsBMP(scat)); + char16_single c1; + int l1 = Utf32CharToUtf16(scat, c1); + assert(l1 == 2); + assert_equal(c1.ch[0], 0xD83D); + assert_equal(c1.ch[1], 0xDE40); + assert_equal(c1.ch[2], 0); + std::u16string s1 = std::u16string(c1.ch, l1); + assert_equal(s1.at(0), 0xD83D); + assert_equal(s1.at(1), 0xDE40); + assert(s1 == std::u16string(u"🙀")); +} + +void +test_u16string_to_u32string() { + // normal cases + { + const std::u32string str = u16string_to_u32string(u""); + assert_equal(str.length(), 0); + } + { + const std::u32string str = u16string_to_u32string(u"e"); + assert_equal(str.length(), 1); + assert_equal(str.at(0), 0x0065); + } + { + const std::u32string str = u16string_to_u32string(u"🙀"); + assert_equal(str.length(), 1); + assert_equal(str.at(0), 0x0001F640); + } + { + const std::u32string str = u16string_to_u32string(u"Ω🙀"); + assert_equal(str.length(), 2); + assert_equal(str.at(0), u'Ω'); + assert_equal(str.at(1), 0x0001F640); + } + + // error cases + { + std::u16string half_cat; + half_cat.push_back(0xD83D); // mismatched lead surrogate + const std::u32string str = u16string_to_u32string(half_cat); + assert_equal(str.length(), 1); + assert_equal(str.at(0), 0xFFFD); + } + { + std::u16string half_cat; + half_cat.push_back(0xD83D); // mismatched lead surrogate + half_cat.push_back(u'Ω'); // with following text + const std::u32string str = u16string_to_u32string(half_cat); + assert_equal(str.length(), 2); + assert_equal(str.at(0), 0xFFFD); + assert_equal(str.at(1), u'Ω'); + } + { + std::u16string half_cat; + half_cat.push_back(0xDE40); // mismatched trail surrogate + const std::u32string str = u16string_to_u32string(half_cat); + assert_equal(str.length(), 1); + assert_equal(str.at(0), 0xFFFD); + } + { + std::u16string no_cat; + no_cat.push_back(0xDE40); + no_cat.push_back(0xD83D); + const std::u32string str = u16string_to_u32string(no_cat); + assert_equal(str.length(), 2); + assert_equal(str.at(0), 0xFFFD); + assert_equal(str.at(1), 0xFFFD); + } +} + constexpr const auto help_str = u"\ test_kmx_xstring [--color]\n\ \n\ @@ -1256,6 +1347,8 @@ int main(int argc, char *argv []) { test_decxstr(); test_xstrlen(); test_xstrlen_ignoreifopt(); + test_utf32(); + test_u16string_to_u32string(); return 0; } diff --git a/core/tests/unit/kmx/000 - null keyboard.kmx b/core/tests/unit/kmx/000 - null keyboard.kmx deleted file mode 100644 index f0e9da6bcc360f9316a509cccb5cc1efad7d2718..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/000 - null keyboard.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/001 - basic input UnicodeI.kmx b/core/tests/unit/kmx/001 - basic input UnicodeI.kmx deleted file mode 100644 index fc59fa6a2d6ac3b030a34a8f49d555e87921c20e..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/001 - basic input UnicodeI.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/002 - basic input Unicode.kmx b/core/tests/unit/kmx/002 - basic input Unicode.kmx deleted file mode 100644 index 0d2539a641a2f064f9670526ef56c6903486ace3..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/002 - basic input Unicode.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/003 - nul.kmx b/core/tests/unit/kmx/003 - nul.kmx deleted file mode 100644 index 79046c521a884a372174b08c1cef5814648fcd9b..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/003 - nul.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/004 - basic input (shift 2).kmx b/core/tests/unit/kmx/004 - basic input (shift 2).kmx deleted file mode 100644 index a31840fa2432fb62870858a2cb01dd1582792eff..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/004 - basic input (shift 2).kmx and /dev/null differ diff --git a/core/tests/unit/kmx/005 - nul with initial context.kmx b/core/tests/unit/kmx/005 - nul with initial context.kmx deleted file mode 100644 index 79046c521a884a372174b08c1cef5814648fcd9b..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/005 - nul with initial context.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/006 - vkey input (shift ctrl).kmx b/core/tests/unit/kmx/006 - vkey input (shift ctrl).kmx deleted file mode 100644 index 5320c4405c43259e98b48c703396d92a8b0e09d5..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/006 - vkey input (shift ctrl).kmx and /dev/null differ diff --git a/core/tests/unit/kmx/007 - vkey input (ctrl alt).kmx b/core/tests/unit/kmx/007 - vkey input (ctrl alt).kmx deleted file mode 100644 index a76e77d6d4f3826d54902938a897a709427896a0..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/007 - vkey input (ctrl alt).kmx and /dev/null differ diff --git a/core/tests/unit/kmx/008 - vkey input (ctrl alt 2).kmx b/core/tests/unit/kmx/008 - vkey input (ctrl alt 2).kmx deleted file mode 100644 index c197fa727a4accf5354be51c45ab050b7f967a45..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/008 - vkey input (ctrl alt 2).kmx and /dev/null differ diff --git a/core/tests/unit/kmx/012 - ralt.kmx b/core/tests/unit/kmx/012 - ralt.kmx deleted file mode 100644 index cbab878a8a91bcbc1fc0bfdfbd5217843ce73df6..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/012 - ralt.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/013 - deadkeys.kmx b/core/tests/unit/kmx/013 - deadkeys.kmx deleted file mode 100644 index 68d8f4a313dd749435ea44f965d33f73d5e2f867..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/013 - deadkeys.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/014 - groups and virtual keys.kmx b/core/tests/unit/kmx/014 - groups and virtual keys.kmx deleted file mode 100644 index 5a24d0909e5de0e01a61f54b55e6a4b2b6aa8f5d..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/014 - groups and virtual keys.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/015 - ralt 2.kmx b/core/tests/unit/kmx/015 - ralt 2.kmx deleted file mode 100644 index f565b4fee44512c9a04ca4241c6e9cc0625f2576..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/015 - ralt 2.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/017 - space mnemonic kbd.kmx b/core/tests/unit/kmx/017 - space mnemonic kbd.kmx deleted file mode 100644 index 797014bda1e64c5e00a8458fb0450cb3a7fda348..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/017 - space mnemonic kbd.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/018 - nul testing.kmx b/core/tests/unit/kmx/018 - nul testing.kmx deleted file mode 100644 index 13204ad251e30822fec75021ef01248bd8b14688..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/018 - nul testing.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/019 - multiple deadkeys.kmx b/core/tests/unit/kmx/019 - multiple deadkeys.kmx deleted file mode 100644 index 44113e2d350ffba99dc565b5a32717b810f9d0c2..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/019 - multiple deadkeys.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/020 - deadkeys and backspace.kmx b/core/tests/unit/kmx/020 - deadkeys and backspace.kmx deleted file mode 100644 index 3c245041b06b12ae74bc6dc6be8af2275805597e..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/020 - deadkeys and backspace.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/021 - options.kmx b/core/tests/unit/kmx/021 - options.kmx deleted file mode 100644 index c5550c1018678e1bbc9710042d906831e8a75f34..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/021 - options.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/022 - options with preset.kmx b/core/tests/unit/kmx/022 - options with preset.kmx deleted file mode 100644 index 57f3720de7a20f83ab4cdf0f40c0c7bc0dd563c7..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/022 - options with preset.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/023 - options with save.kmx b/core/tests/unit/kmx/023 - options with save.kmx deleted file mode 100644 index f6689ce47ee12a3dc9a4f9253ba049a7f568d15d..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/023 - options with save.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/024 - options with save and preset.kmx b/core/tests/unit/kmx/024 - options with save and preset.kmx deleted file mode 100644 index 029a136f7881af7758744280096d116ed0c57dd6..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/024 - options with save and preset.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/025 - options with reset.kmx b/core/tests/unit/kmx/025 - options with reset.kmx deleted file mode 100644 index e1595c84667399496c72de3a8f6afc2baf926f77..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/025 - options with reset.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/026 - system stores.kmx b/core/tests/unit/kmx/026 - system stores.kmx deleted file mode 100644 index da2e0b30c091ee33aff3a38498015793bd8d10cf..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/026 - system stores.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/027 - system stores 2.kmx b/core/tests/unit/kmx/027 - system stores 2.kmx deleted file mode 100644 index 43d58aaa2bcd557f66e55ab294e582e5dde9c0ba..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/027 - system stores 2.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/028 - smp.kmx b/core/tests/unit/kmx/028 - smp.kmx deleted file mode 100644 index da89544b3e99343683c943c08c0dc690632990be..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/028 - smp.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/029 - beep.kmx b/core/tests/unit/kmx/029 - beep.kmx deleted file mode 100644 index 1e809bdb338e230c2397218ec049c5f8ca4254d1..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/029 - beep.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/030 - multiple groups.kmx b/core/tests/unit/kmx/030 - multiple groups.kmx deleted file mode 100644 index 9b75bfca40c4ba3ec248c47f42e4ecc0f2e982a2..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/030 - multiple groups.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/031 - caps lock.kmx b/core/tests/unit/kmx/031 - caps lock.kmx deleted file mode 100644 index e317f13349c7e2582fea5f7b1cd91b59e30820a3..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/031 - caps lock.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/032 - caps control.kmx b/core/tests/unit/kmx/032 - caps control.kmx deleted file mode 100644 index 67d7ac2102871d8273f32634bb3929be43f3562e..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/032 - caps control.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/033 - caps always off.kmx b/core/tests/unit/kmx/033 - caps always off.kmx deleted file mode 100644 index 08bd6521fe6c458c83b95fb857eff1a91ff6eba6..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/033 - caps always off.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/034 - options double set reset.kmx b/core/tests/unit/kmx/034 - options double set reset.kmx deleted file mode 100644 index 92ef0da0ad6ebd1a189e6447dad159ee0e0e8341..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/034 - options double set reset.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/035 - options double set staged.kmx b/core/tests/unit/kmx/035 - options double set staged.kmx deleted file mode 100644 index 61970709ea2fa70ccd38d8ec89a5cd1cd8cfd90b..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/035 - options double set staged.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/036 - options - double reset staged.kmx b/core/tests/unit/kmx/036 - options - double reset staged.kmx deleted file mode 100644 index 2cc4b21993b47a726ce8dd160c1cefc403e4b336..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/036 - options - double reset staged.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/037 - options - double reset.kmx b/core/tests/unit/kmx/037 - options - double reset.kmx deleted file mode 100644 index 2e8120f6e501b4f97829be0c99eacb2cafa5cb51..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/037 - options - double reset.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/038 - punctkeys.kmx b/core/tests/unit/kmx/038 - punctkeys.kmx deleted file mode 100644 index 2b892d51b8a326d45a3c6592df2b08a9de5ee489..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/038 - punctkeys.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/039 - generic ctrlalt.kmx b/core/tests/unit/kmx/039 - generic ctrlalt.kmx deleted file mode 100644 index 897c02624daf5dbdb092a801d23c61267060a617..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/039 - generic ctrlalt.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/040 - long context.kmx b/core/tests/unit/kmx/040 - long context.kmx deleted file mode 100644 index c6025add0a57e2deb6a66f062c75836a74de1dac..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/040 - long context.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/041 - long context and deadkeys.kmx b/core/tests/unit/kmx/041 - long context and deadkeys.kmx deleted file mode 100644 index d92dbb46ee67632f241d64f62efea1ef663d961e..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/041 - long context and deadkeys.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/042 - long context and split deadkeys.kmx b/core/tests/unit/kmx/042 - long context and split deadkeys.kmx deleted file mode 100644 index 49b539ffb104000a192767736f40a4bfc8d123d1..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/042 - long context and split deadkeys.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/043 - output and keystroke.kmx b/core/tests/unit/kmx/043 - output and keystroke.kmx deleted file mode 100644 index 120b42e2bc5539e3b825d750deba5a6ab9c5e345..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/043 - output and keystroke.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/044 - if and context.kmx b/core/tests/unit/kmx/044 - if and context.kmx deleted file mode 100644 index ae70c6ab81338650ff8173175ab3a36b0c78ed37..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/044 - if and context.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/045 - deadkey and context.kmx b/core/tests/unit/kmx/045 - deadkey and context.kmx deleted file mode 100644 index 2ae9ff2eb60e6cff911968f99f5b84bac19ad41f..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/045 - deadkey and context.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/046 - deadkey and contextex.kmx b/core/tests/unit/kmx/046 - deadkey and contextex.kmx deleted file mode 100644 index 8a1a97b556a1404c36b29fab22b1119efc920633..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/046 - deadkey and contextex.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/047 - caps always off initially on.kmx b/core/tests/unit/kmx/047 - caps always off initially on.kmx deleted file mode 100644 index a890017c4cd0de5589a95a9b974bee5972773a4d..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/047 - caps always off initially on.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/048 - modifier keys keep context.kmx b/core/tests/unit/kmx/048 - modifier keys keep context.kmx deleted file mode 100644 index 52c70f61e048f18e841e18d1137ba6a7c988e63b..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/048 - modifier keys keep context.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/README.md b/core/tests/unit/kmx/README.md index a1ced307f9b68198ec1df22c5f03900af6b7d3ce..909d891f7da9dbe7b894c1592cdaf46572afa173 100644 --- a/core/tests/unit/kmx/README.md +++ b/core/tests/unit/kmx/README.md @@ -65,12 +65,12 @@ Alternatively it's possible to run a single test with: ```bash cd core -build/arch/debug/tests/unit/kmx/kmx 'tests/unit/kmx/038 - punctkeys.kmn' 'tests/unit/kmx/038 - punctkeys.kmx' +build/arch/debug/tests/unit/kmx/kmx '../common/test/keyboards/baseline/k_038___punctkeys.kmn' '../common/test/keyboards/baseline/k_038___punctkeys.kmx' ``` or shorter: ```bash cd core -build/arch/debug/tests/unit/kmx/kmx 'tests/unit/kmx/038 - punctkeys'.km{n,x} +build/arch/debug/tests/unit/kmx/kmx '../common/test/keyboards/baseline/k_038___punctkeys'.km{n,x} ``` diff --git a/core/tests/unit/kmx/fixtures/binary/b_000_zero_checksum.kmn b/core/tests/unit/kmx/fixtures/binary/b_000_zero_checksum.kmn new file mode 100644 index 0000000000000000000000000000000000000000..ef18008b88c1d31f0930e2be8cf77511fea47b62 --- /dev/null +++ b/core/tests/unit/kmx/fixtures/binary/b_000_zero_checksum.kmn @@ -0,0 +1,7 @@ +c Description: see b_000_zero_checksum.txt +c keys: abc +c expected: abc +c context: + +begin Unicode > use(main) +group(main) using keys \ No newline at end of file diff --git a/core/tests/unit/kmx/fixtures/binary/b_000_zero_checksum.txt b/core/tests/unit/kmx/fixtures/binary/b_000_zero_checksum.txt new file mode 100644 index 0000000000000000000000000000000000000000..c8c6084447cbe59471667c787cc723fc5a665416 --- /dev/null +++ b/core/tests/unit/kmx/fixtures/binary/b_000_zero_checksum.txt @@ -0,0 +1,43 @@ +# +# b_000_zero_checksum.txt is a version 16.0 file with a zero checksum, to verify +# that Keyman Core loads it successfully. +# + +block(kmxheader) # struct COMP_KEYBOARD { + 4b 58 54 53 # KMX_DWORD dwIdentifier; // 0000 Keyman compiled keyboard id + + 00 10 00 00 # KMX_DWORD dwFileVersion; // 0004 Version of the file - Keyman 4.0 is 0x0400 + + 00 00 00 00 # KMX_DWORD dwCheckSum; // 0008 As stored in keyboard + 00 00 00 00 # KMX_DWORD KeyboardID; // 000C as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts + 01 00 00 00 # KMX_DWORD IsRegistered; // 0010 + 00 00 00 00 # KMX_DWORD version; // 0014 keyboard version + + 00 00 00 00 # KMX_DWORD cxStoreArray; // 0018 in array entries + 01 00 00 00 # KMX_DWORD cxGroupArray; // 001C in array entries + + 00 00 00 00 # KMX_DWORD dpStoreArray; // 0020 [LPSTORE] address of first item in store array + 40 00 00 00 # KMX_DWORD dpGroupArray; // 0024 [LPGROUP] address of first item in group array + + ff ff ff ff # KMX_DWORD StartGroup[2]; // 0028 index of starting groups [2 of them] + 00 00 00 00 # + + 00 00 00 00 # KMX_DWORD dwFlags; // 0030 Flags for the keyboard file + + 00 00 00 00 # KMX_DWORD dwHotKey; // 0034 standard windows hotkey (hiword=shift/ctrl/alt stuff, loword=vkey) + + 00 00 00 00 # KMX_DWORD dpBitmapOffset; // 0038 offset of the bitmaps in the file + 00 00 00 00 # KMX_DWORD dwBitmapSize; // 003C size in bytes of the bitmaps + # }; + +block(groupmain) + # struct COMP_GROUP { + 00 00 00 00 # KMX_DWORD dpName; + 00 00 00 00 # KMX_DWORD dpKeyArray; // [LPKEY] address of first item in key array + 00 00 00 00 # KMX_DWORD dpMatch; + 00 00 00 00 # KMX_DWORD dpNoMatch; + 00 00 00 00 # KMX_DWORD cxKeyArray; // in array entries + 01 00 00 00 # KMX_BOOL fUsingKeys; // group(xx) [using keys] <-- specified or not + # }; + +block(eof) # end of file \ No newline at end of file diff --git a/core/tests/unit/kmx/fixtures/binary/meson.build b/core/tests/unit/kmx/fixtures/binary/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..fb01836edeb241fba410be0e60d57e4f7d04a94a --- /dev/null +++ b/core/tests/unit/kmx/fixtures/binary/meson.build @@ -0,0 +1,38 @@ +# Copyright: © 2018 SIL International. +# Description: Cross platform build script to compile libkmnkbp API unit tests. +# Create Date: 19 Oct 2018 +# Authors: Marc Durdin, Tim Eves (TSE) +# History: 19 Oct 2018 - TSE - Added test for context API functions. +# + +# binary file unit tests + +# Build all binary test keyboards + +binary_test_path = meson.current_build_dir() + +binary_tests = [ + 'b_000_zero_checksum' +] + +foreach kbd : binary_tests + configure_file( + command: copy_cmd + ['@INPUT@', '@OUTPUT@'], + input: kbd + '.kmn', + output: kbd + '.kmn' + ) + + configure_file( + command: hextobin_cmd + ['@INPUT@', '@OUTPUT@'], + output: kbd + '.kmx', + input: kbd + '.txt' + ) +endforeach + +# Load all binary test keyboards + +foreach kbd : binary_tests + kbd_src = join_paths(binary_test_path, kbd) + '.kmn' + kbd_obj = join_paths(binary_test_path, kbd) + '.kmx' + test(kbd, kmx, args: [kbd_src, kbd_obj]) +endforeach diff --git a/core/tests/unit/kmx/fixtures/meson.build b/core/tests/unit/kmx/fixtures/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..e40c30ad462e803d0e2f5c5deda6497c5f3841a9 --- /dev/null +++ b/core/tests/unit/kmx/fixtures/meson.build @@ -0,0 +1,6 @@ +if node.found() + # Note: if node is not available, we cannot build the keyboards; build.sh + # emits a warning that the 'ldml' keyboard tests will be skipped; that + # includes these tests for now + subdir('binary') +endif \ No newline at end of file diff --git a/core/tests/unit/kmx/kmx.cpp b/core/tests/unit/kmx/kmx.cpp index 09397639f57e86b79c1f3588e8fb24ee7fa73bf6..a0c8eaa1b2cba2c5e61732df15c4128ec5419247 100644 --- a/core/tests/unit/kmx/kmx.cpp +++ b/core/tests/unit/kmx/kmx.cpp @@ -24,8 +24,9 @@ #include "state.hpp" #include "utfcodec.hpp" -#include "../test_assert.h" -#include "../test_color.h" +#include +#include +#include "../emscripten_filesystem.h" #include "kmx_test_source.hpp" @@ -78,11 +79,12 @@ apply_action( 0, }, {act.character}}); - if (Uni_IsSMP(act.character)) { - text_store.push_back(Uni_UTF32ToSurrogate1(act.character)); - text_store.push_back(Uni_UTF32ToSurrogate2(act.character)); - } else { - text_store.push_back((char16_t)act.character); + { + km::kbp::kmx::char16_single buf; + const int len = km::kbp::kmx::Utf32CharToUtf16(act.character, buf); + for(int i=0; i +#include +#include "../emscripten_filesystem.h" #include -#include -#include +#include +#include /** This test will test the infrastructure around IMX third party librays * and callback. The functions tested are: @@ -31,10 +32,10 @@ km_kbp_option_item test_env_opts[] = KM_KBP_OPTIONS_END }; -std::map expected_imx_map { {4, "imsample.dll:DF"}, - {5, "imsample.dll:func2"}, - {6, "another.dll:func3"}, - {7, "another.dll:func4"}, +std::map expected_imx_map { {3, "imsample.dll:DF"}, + {4, "imsample.dll:func2"}, + {5, "another.dll:func3"}, + {6, "another.dll:func4"}, }; std::map g_extract_imx_map; @@ -97,7 +98,9 @@ uint8_t test_imx_callback(km_kbp_state *state, uint32_t imx_id, void *callback_o std::cout << "test_imx_callback function name: " << it->second << std::endl; km_kbp_action_item *a_items = new km_kbp_action_item[10]; switch (imx_id) { - case 4: + // this corresponds to store index; if these change, the values + // here will need updating + case 3: a_items[0].type = KM_KBP_IT_CHAR; a_items[0].character = km_kbp_usv('X'); @@ -105,7 +108,7 @@ uint8_t test_imx_callback(km_kbp_state *state, uint32_t imx_id, void *callback_o a_items[2].type = KM_KBP_IT_END; km_kbp_state_queue_action_items(state, a_items); break; - case 5: + case 4: a_items[0].type = KM_KBP_IT_CHAR; a_items[0].character = km_kbp_usv('Y'); @@ -116,7 +119,7 @@ uint8_t test_imx_callback(km_kbp_state *state, uint32_t imx_id, void *callback_o a_items[3].type = KM_KBP_IT_END; km_kbp_state_queue_action_items(state, a_items); break; - case 6: + case 5: a_items[0].type = KM_KBP_IT_BACK; a_items[0].backspace.expected_type = KM_KBP_BT_CHAR; a_items[0].backspace.expected_value = km_kbp_usv('A'); @@ -125,7 +128,7 @@ uint8_t test_imx_callback(km_kbp_state *state, uint32_t imx_id, void *callback_o a_items[2].type = KM_KBP_IT_END; km_kbp_state_queue_action_items(state, a_items); break; - case 7: { + case 6: { a_items[0].type = KM_KBP_IT_INVALIDATE_CONTEXT; a_items[1].type = KM_KBP_IT_END; km_kbp_state_queue_action_items(state, a_items); @@ -214,26 +217,26 @@ void test_queue_actions (const km::kbp::path &source_keyboard) { km_kbp_state_imx_register_callback(test_state, test_imx_callback, (void*)&g_extract_imx_map); // Key Press that doesn't trigger a call back - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_S,KM_KBP_MODIFIER_SHIFT, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_S,KM_KBP_MODIFIER_SHIFT, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(action_items(test_state, {{KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('S')}}, {KM_KBP_IT_END}})); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_BKSP, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_BKSP, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(action_items(test_state, {{KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('X')}}, {KM_KBP_IT_ALERT, {0,}, {0}}, {KM_KBP_IT_END}})); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_ESC, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_ESC, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(action_items(test_state, { {KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('Y')}}, {KM_KBP_IT_MARKER, {0,}, {1}}, {KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('A')}}, {KM_KBP_IT_END}})); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_1, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_1, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); km_kbp_action_item bksp_a = {KM_KBP_IT_BACK}; bksp_a.backspace.expected_type = KM_KBP_BT_CHAR; bksp_a.backspace.expected_value = 'A'; assert(action_items(test_state, {bksp_a,{KM_KBP_IT_CHAR, {0,}, {km_kbp_usv('Z')}}, {KM_KBP_IT_END}})); - try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_2, 0, 1)); + try_status(km_kbp_process_event(test_state, KM_KBP_VKEY_2, 0, 1, KM_KBP_EVENT_FLAG_DEFAULT)); assert(action_items(test_state, {{KM_KBP_IT_INVALIDATE_CONTEXT, {0,}, {0}}, {KM_KBP_IT_END}})); km_kbp_state_imx_deregister_callback(test_state); @@ -260,7 +263,14 @@ int main(int argc, char *argv []) { } console_color::enabled = console_color::isaterminal() || arg_color; km::kbp::kmx::g_debug_ToConsole = TRUE; + +#ifdef __EMSCRIPTEN__ + test_imx_list(get_wasm_file_path(argv[first_arg])); + test_queue_actions(get_wasm_file_path(argv[first_arg])); +#else test_imx_list(argv[first_arg]); test_queue_actions(argv[first_arg]); +#endif + return 0; } diff --git a/core/tests/unit/kmx/kmx_key_list.cpp b/core/tests/unit/kmx/kmx_key_list.cpp index 0bd2bce2483c0971f57537030422aeff8de760b8..d4750c44d3a9a1a6448d3715647640a16b68a685 100644 --- a/core/tests/unit/kmx/kmx_key_list.cpp +++ b/core/tests/unit/kmx/kmx_key_list.cpp @@ -12,8 +12,9 @@ #include "state.hpp" #include -#include "../test_assert.h" -#include "../test_color.h" +#include +#include +#include "../emscripten_filesystem.h" using namespace km::kbp::kmx; @@ -107,7 +108,11 @@ int main(int argc, char *argv []) { } console_color::enabled = console_color::isaterminal() || arg_color; +#ifdef __EMSCRIPTEN__ + test_key_list(get_wasm_file_path(argv[first_arg])); +#else test_key_list(argv[first_arg]); +#endif return 0; } diff --git a/core/tests/unit/kmx/kmx_key_list.kmx b/core/tests/unit/kmx/kmx_key_list.kmx deleted file mode 100644 index efb6540fcec6057653b03180095b2da757b0c222..0000000000000000000000000000000000000000 Binary files a/core/tests/unit/kmx/kmx_key_list.kmx and /dev/null differ diff --git a/core/tests/unit/kmx/meson.build b/core/tests/unit/kmx/meson.build index c347b2e8fd8e7f4ca028880bd9e479467fc1c869..7e4b9f8a77c349935debb0dd4febb62eac1e0d0f 100644 --- a/core/tests/unit/kmx/meson.build +++ b/core/tests/unit/kmx/meson.build @@ -5,7 +5,8 @@ # History: 19 Oct 2018 - TSE - Added test for context API functions. # -if compiler.get_id() == 'gcc' or compiler.get_id() == 'clang' or compiler.get_id() == 'emscripten' +# TODO -- why are these differing from the standard.meson.build flags? +if cpp_compiler.get_id() == 'gcc' or cpp_compiler.get_id() == 'clang' or cpp_compiler.get_id() == 'emscripten' warns = [ '-Wno-missing-field-initializers', '-Wno-unused-parameter' @@ -14,128 +15,94 @@ else warns = [] endif +source_path = meson.current_source_dir() +test_path = meson.current_build_dir() +tests_flags = [] +common_test_keyboards_baseline = source_path / '../../../../common/test/keyboards/baseline' -if compiler.get_id() == 'emscripten' - tests_flags = ['--embed-file', join_paths(meson.current_source_dir(),'@/')] - source_path = '/' - test_path = '/' -else - tests_flags = [] - source_path = meson.current_source_dir() - test_path = meson.current_build_dir() +if cpp_compiler.get_id() == 'emscripten' + # TODO: we will move the tests to ES6 in the future + # '-sMODULARIZE', '-sEXPORT_ES6', + tests_flags += ['-lnodefs.js', '-sEXPORTED_RUNTIME_METHODS=[\'UTF8ToString\']'] endif -coretest_files = files( - 'kmx_test_source.cpp', -) - kmx = executable('kmx', - 'kmx.cpp', - coretest_files, + ['kmx.cpp', '../emscripten_filesystem.cpp'], cpp_args: defns + warns, - include_directories: [inc, libsrc], + include_directories: [inc, libsrc, '../../kmx_test_source'], link_args: links + tests_flags, - objects: lib.extract_all_objects()) - -test_lib = static_library('kmnkbp-tests', - coretest_files, - cpp_args: defns + warns + flags, - include_directories: [inc, libsrc], - link_args: links + tests_flags, - objects: lib.extract_all_objects(), - pic: true, - install: false -) + objects: [lib.extract_all_objects(recursive: false), kmx_test_source_lib.extract_all_objects(recursive: false)]) tests = [ - '000 - null keyboard', - '001 - basic input UnicodeI', - '002 - basic input Unicode', - '003 - nul', - '004 - basic input (shift 2)', - '005 - nul with initial context', - '006 - vkey input (shift ctrl)', - '007 - vkey input (ctrl alt)', - '008 - vkey input (ctrl alt 2)', - '012 - ralt', - '013 - deadkeys', - '014 - groups and virtual keys', - '015 - ralt 2', - '017 - space mnemonic kbd', - '018 - nul testing', - '019 - multiple deadkeys', - '020 - deadkeys and backspace', - - '021 - options', - '022 - options with preset', - '023 - options with save', - '024 - options with save and preset', - '025 - options with reset', - - '026 - system stores', - '027 - system stores 2', - - '028 - smp', - '029 - beep', + 'k_000___null_keyboard', + 'k_001___basic_input_unicodei', + 'k_002___basic_input_unicode', + 'k_003___nul', + 'k_004___basic_input__shift_2_', + 'k_005___nul_with_initial_context', + 'k_006___vkey_input__shift_ctrl_', + 'k_007___vkey_input__ctrl_alt_', + 'k_008___vkey_input__ctrl_alt_2_', + 'k_012___ralt', + 'k_013___deadkeys', + 'k_014___groups_and_virtual_keys', + 'k_015___ralt_2', + 'k_017___space_mnemonic_kbd', + 'k_018___nul_testing', + 'k_019___multiple_deadkeys', + 'k_020___deadkeys_and_backspace', + 'k_021___options', + 'k_022___options_with_preset', + 'k_023___options_with_save', + 'k_024___options_with_save_and_preset', + 'k_025___options_with_reset', + 'k_026___system_stores', + 'k_027___system_stores_2', + 'k_028___smp', + 'k_029___beep', + 'k_030___multiple_groups', + 'k_031___caps_lock', + 'k_032___caps_control', + 'k_033___caps_always_off', + 'k_034___options_double_set_reset', + 'k_035___options_double_set_staged', + 'k_036___options___double_reset_staged', + 'k_037___options___double_reset', + 'k_038___punctkeys', + 'k_039___generic_ctrlalt', + 'k_040___long_context', + 'k_041___long_context_and_deadkeys', + 'k_042___long_context_and_split_deadkeys', + 'k_043___output_and_keystroke', + 'k_044___if_and_context', + 'k_045___deadkey_and_context', + 'k_046___deadkey_and_contextex', + 'k_047___caps_always_off_initially_on', + 'k_048___modifier_keys_keep_context' +] - '030 - multiple groups', - '031 - caps lock', - '032 - caps control', - '033 - caps always off', - '034 - options double set reset', - '035 - options double set staged', - '036 - options - double reset staged', - '037 - options - double reset', - '038 - punctkeys', - '039 - generic ctrlalt', - '040 - long context', - '041 - long context and deadkeys', - '042 - long context and split deadkeys', - '043 - output and keystroke', +node = find_program('node', required: true) - '044 - if and context', - '045 - deadkey and context', - '046 - deadkey and contextex', - '047 - caps always off initially on', - '048 - modifier keys keep context' -] +kmc_root = meson.current_source_dir() / '../../../../developer/src/kmc/build/src/kmc.js' +kmc_cmd = [node, kmc_root] if build_machine.system() == 'windows' - kmcomp = find_program(join_paths(meson.current_source_dir(),'..','..','..','..','windows','bin','developer','kmcomp.exe'), 'kmcomp.exe', required: false) - kmcomp_cmd = [kmcomp] copy_cmd = [find_program('cmd.exe', required: true), '/c', 'copy'] cat_cmd = [find_program('cmd.exe', required: true), '/c', 'type'] else - kmcomp = find_program('kmcomp', required: false) - kmcomp_cmd = [kmcomp] - if not kmcomp.found() - wine = find_program('wine', required: false) - kmcomp = find_program('kmcomp.exe', required: false) - kmcomp_cmd = [wine, kmcomp] - if not wine.found() - kmcomp = disabler() - endif - endif copy_cmd = [find_program('cp', required: true)] cat_cmd = [find_program('cat', required: true)] endif -if compiler.get_id() == 'emscripten' - # The .kmx files are linked in to the unit test, - # so kmcomp is too late here - kmcomp = disabler() -endif - test_keyboards = '' foreach kbd : tests if test_keyboards.startswith('{') test_keyboards += ''', ''' endif - kbd_basename = 'k_' + kbd.underscorify().to_lower() test_keyboards += '''{ - "name": "''' + kbd_basename + '''", - "id": "''' + kbd_basename + '''", + "name": "''' + kbd + '''", + "id": "''' + kbd + '''", "version": "0.0", "languages": [ { @@ -144,18 +111,6 @@ foreach kbd : tests } ] }''' - if not kmcomp.found() - configure_file( - command: copy_cmd + ['@INPUT@', '@OUTPUT@'], - input: kbd + '.kmn', - output: kbd_basename + '.kmn' - ) - configure_file( - command: copy_cmd + ['@INPUT@', '@OUTPUT@'], - input: kbd + '.kmx', - output: kbd_basename + '.kmx' - ) - endif endforeach cfg = configuration_data() @@ -166,70 +121,51 @@ configure_file( output: 'kmp.json' ) -if kmcomp.found() - foreach kbd : tests - kbd_basename = 'k_' + kbd.underscorify().to_lower() - - content = run_command( - cat_cmd, files(kbd + '.kmn'), - ).stdout().strip() - - cfg = configuration_data() - cfg.set('keyboard', kbd) - cfg.set('keyboard_underscore', kbd_basename) - cfg.set('id1', 'id_' + kbd_basename + '_1') - cfg.set('id2', 'id_' + kbd_basename + '_2') - cfg.set('id3', 'id_' + kbd_basename + '_3') - cfg.set('build_dir', meson.current_build_dir()) - cfg.set('NAME', kbd) - cfg.set('CONTENT', content) - - kbd_kmn = configure_file( - configuration: cfg, - input: join_paths('template', 'keyboard.kmn.in'), - output: kbd_basename + '.kmn' - ) - kbd_kpj = configure_file( - configuration: cfg, - input: join_paths('template', 'keyboard.kpj.in'), - output: kbd_basename + '.kpj' - ) - kbd_kps = configure_file( - configuration: cfg, - input: join_paths('template', 'keyboard.kps.in'), - output: kbd_basename + '.kps' - ) - kbd_kmp = custom_target(kbd_basename + '.kmp', - input: kbd_kpj, - output: [kbd_basename + '.kmp', kbd_basename + '.kmx'], - depend_files: [kbd_kps, kbd_kmn], - depfile: kbd_basename + '.dep', - command: kmcomp_cmd + ['-s', '-d', '@INPUT@']) - - kbd_src = files(join_paths(test_path, kbd_basename) + '.kmn') - kbd_obj = join_paths(test_path, kbd_basename) + '.kmx' - # kbd_log = custom_target(kbd.underscorify() + '.kmx', - # output: kbd + '.log', - # input: kbd_src, - # command: kmcomp_cmd + ['-s', '-d', '@INPUT@', kbd_obj, '@OUTPUT@'] - # ) - - test(kbd, kmx, depends: [kbd_kmp], args: [kbd_src, kbd_obj]) - endforeach -else - foreach kbd : tests - if compiler.get_id() == 'emscripten' - kbd_basename = kbd - else - kbd_basename = 'k_' + kbd.underscorify().to_lower() - endif - kbd_src = join_paths(test_path, kbd_basename) + '.kmn' - kbd_obj = join_paths(test_path, kbd_basename) + '.kmx' +foreach kbd : tests + kbd_src_path = common_test_keyboards_baseline / kbd + '.kmn' + + content = run_command( + cat_cmd, files(kbd_src_path), + ).stdout().strip() + + cfg = configuration_data() + cfg.set('keyboard', kbd) + cfg.set('keyboard_underscore', kbd) + cfg.set('id1', 'id_' + kbd + '_1') + cfg.set('id2', 'id_' + kbd + '_2') + cfg.set('id3', 'id_' + kbd + '_3') + cfg.set('build_dir', meson.current_build_dir()) + cfg.set('NAME', kbd) + cfg.set('CONTENT', content) + + kbd_kmn = configure_file( + copy: true, + input: kbd_src_path, + output: kbd + '.kmn' + ) + kbd_kpj = configure_file( + configuration: cfg, + input: join_paths('template', 'keyboard.kpj.in'), + output: kbd + '.kpj' + ) + kbd_kps = configure_file( + configuration: cfg, + input: join_paths('template', 'keyboard.kps.in'), + output: kbd + '.kps' + ) + kbd_kmp = custom_target(kbd + '.kmp', + input: kbd_kpj, + output: [kbd + '.kmp', kbd + '.kmx'], + depend_files: [kbd_kps, kbd_kmn], + depfile: kbd + '.dep', + command: kmc_cmd + ['build', '--debug', '--no-compiler-version', '@INPUT@']) + + test(kbd, kmx, depends: [kbd_kmp], args: [test_path / kbd + '.kmn', test_path / kbd + '.kmx']) +endforeach - test(kbd, kmx, args: [kbd_src, kbd_obj]) - endforeach -endif +# binary file unit tests +subdir('fixtures') # test for km_kbp_keyboard_get_key_list @@ -238,48 +174,37 @@ endif # should work for Linux, macOS, and WASM. test_path = source_path -key_e = executable('key_list', 'kmx_key_list.cpp', +key_e = executable('key_list', ['kmx_key_list.cpp', '../emscripten_filesystem.cpp'], cpp_args: defns + warns, include_directories: [inc, libsrc], link_args: links + tests_flags, - objects: lib.extract_all_objects()) + objects: lib.extract_all_objects(recursive: false)) test_kbd = 'kmx_key_list' -if kmcomp.found() - kbd_src = files(test_kbd + '.kmn') - kbd_obj = join_paths(meson.current_source_dir(), test_kbd) + '.kmx' - kbd_log = custom_target(test_kbd + '.kmx'.underscorify(), - output: test_kbd + '.log', - input: kbd_src, - command: kmcomp_cmd + ['-s', '-d', '@INPUT@', kbd_obj, '@OUTPUT@'] - ) - test('key_list', key_e, depends: kbd_log, args: [kbd_obj] ) -else - kbd_obj = join_paths(test_path, test_kbd) + '.kmx' - test('key_list', key_e, args: [kbd_obj] ) -endif + +kbd_src = files(test_kbd + '.kmn') +kbd_obj = join_paths(meson.current_build_dir(), test_kbd) + '.kmx' +kbd_log = custom_target(test_kbd + '.kmx'.underscorify(), + output: test_kbd + '.log', + input: kbd_src, + command: kmc_cmd + ['build', '--debug', '--no-compiler-version', '@INPUT@', '--out-file', kbd_obj] +) +test('key_list', key_e, depends: kbd_log, args: [kbd_obj] ) # test for imx list -imx_e = executable('imx_list', 'kmx_imx.cpp', +imx_e = executable('imx_list', ['kmx_imx.cpp', '../emscripten_filesystem.cpp'], cpp_args: defns + warns, include_directories: [inc, libsrc], link_args: links + tests_flags, - objects: lib.extract_all_objects()) + objects: lib.extract_all_objects(recursive: false)) test_kbd = 'kmx_imsample' -if kmcomp.found() - kbd_src = files(test_kbd + '.kmn') - kbd_obj = join_paths(meson.current_source_dir(), test_kbd) + '.kmx' - kbd_log = custom_target(test_kbd + '.kmx'.underscorify(), - output: test_kbd + '.log', - input: kbd_src, - command: kmcomp_cmd + ['-s', '-d', '@INPUT@', kbd_obj, '@OUTPUT@'] - ) - test('imx_list', imx_e, depends: kbd_log, args: [kbd_obj] ) -else - kbd_obj = join_paths(test_path, test_kbd) + '.kmx' - test('imx_list', imx_e, args: [kbd_obj] ) -endif - - +kbd_src = files(test_kbd + '.kmn') +kbd_obj = join_paths(meson.current_build_dir(), test_kbd) + '.kmx' +kbd_log = custom_target(test_kbd + '.kmx'.underscorify(), + output: test_kbd + '.log', + input: kbd_src, + command: kmc_cmd + ['build', '--debug', '--no-compiler-version', '@INPUT@', '--out-file', kbd_obj] +) + test('imx_list', imx_e, depends: kbd_log, args: [kbd_obj] ) diff --git a/core/tests/unit/kmx/template/keyboard.kpj.in b/core/tests/unit/kmx/template/keyboard.kpj.in index ba612eccaaa73de22774bdd6a0a1e93b45526fce..4c49cfe418d1dcc868fe36ce66c3eaa0b6f8b225 100644 --- a/core/tests/unit/kmx/template/keyboard.kpj.in +++ b/core/tests/unit/kmx/template/keyboard.kpj.in @@ -2,9 +2,9 @@ $PROJECTPATH - false - false - false + False + False + False keyboard diff --git a/core/tests/unit/ldml/README.md b/core/tests/unit/ldml/README.md new file mode 100644 index 0000000000000000000000000000000000000000..fbbfc53788f5562ee85091f3c012f05fac4b3af0 --- /dev/null +++ b/core/tests/unit/ldml/README.md @@ -0,0 +1,63 @@ +# LDML unit tests + +This directory contains unit tests that test the LDML keyboard processing. + +The driver (`ldml.cpp`) loads and executes the tests. Each test consist of a +Keyman keyboard source file (`*.xml`) and the compiled KMXPlus keyboard. +The source file contains rules and defines the setup, input and expected results. + +## Defining tests in the `.xml` file + +Somewhere near the top of the file, an XML comment contains lines that +define the setup, input and expected results. + +### Setup + +- **description**: this is just for commenting what we test here + +```text +@@description: Tests Caps Lock env set +``` + +- **capsLock**: allows to set the caps lock state. The example below turns + caps-lock on at the start of the test. `[K_CAPS]` in the **keys** comment + allows toggling of caps lock. + +```text +@@capsLock: 1 +``` + +- **context**: allows to setup a string which serves as context + +```text +@@context: +``` + +### Input + +- **keys**: defines one or more virtual keys that will be processed one after the + other + +```text +@@keys: [K_1][K_CAPS][K_2][SHIFT K_3][K_4][K_CAPS][K_5][K_CAPS][K_6] +``` + +### Expected Result + +- **expected**: the resulting string of processing the input keys. In the example + below each key press is expected to output the string `'pass.'`. + +```text +@@expected: pass.pass.pass.pass.pass.pass. +``` + +## Running the tests + +All tests can be run at once with `./build.sh --debug tests`. + +Alternatively it's possible to run a single test with: + +```bash +cd core +build/arch/debug/tests/unit/ldml/ldml 'tests/unit/ldml/000_test_zero.xml' 'tests/unit/ldml/000_test_zero.kmx' +``` diff --git a/core/tests/unit/ldml/invalid-keyboards/ik_000_null_invalid.txt b/core/tests/unit/ldml/invalid-keyboards/ik_000_null_invalid.txt new file mode 100644 index 0000000000000000000000000000000000000000..8daf206c7397b246a7cd4e978a05e47fea2c9c85 --- /dev/null +++ b/core/tests/unit/ldml/invalid-keyboards/ik_000_null_invalid.txt @@ -0,0 +1,41 @@ + +block(kmx) # struct COMP_KEYBOARD { + 4b 58 54 53 # KMX_DWORD dwIdentifier; // 0000 Keyman compiled keyboard id + + 00 10 00 00 # KMX_DWORD dwFileVersion; // 0004 Version of the file - Keyman 4.0 is 0x0400 + + 00 00 00 00 # KMX_DWORD dwCheckSum; // 0008 As stored in keyboard + 00 00 00 00 # KMX_DWORD KeyboardID; // 000C as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts + 00 00 00 00 # KMX_DWORD IsRegistered; // 0010 + 00 00 00 00 # KMX_DWORD version; // 0014 keyboard version + + 00 00 00 00 # KMX_DWORD cxStoreArray; // 0018 in array entries + 00 00 00 00 # KMX_DWORD cxGroupArray; // 001C in array entries + + 00 00 00 00 # KMX_DWORD dpStoreArray; // 0020 [LPSTORE] address of first item in store array + 00 00 00 00 # KMX_DWORD dpGroupArray; // 0024 [LPGROUP] address of first item in group array + + 00 00 00 00 # KMX_DWORD StartGroup[2]; // 0028 index of starting groups [2 of them] + 00 00 00 00 # + + 20 00 00 00 # KMX_DWORD dwFlags; // 0030 Flags for the keyboard file + + 00 00 00 00 # KMX_DWORD dwHotKey; // 0034 standard windows hotkey (hiword=shift/ctrl/alt stuff, loword=vkey) + + 00 00 00 00 # KMX_DWORD dpBitmapOffset; // 0038 offset of the bitmaps in the file + 00 00 00 00 # KMX_DWORD dwBitmapSize; // 003C size in bytes of the bitmaps + # }; + + +block(kmxplus) # struct COMP_KEYBOARD_KMXPLUSINFO { + 00 00 00 00 # KMX_DWORD dpKMXPlus; // 0040 offset of KMXPlus data, header is first + 00 00 00 00 # KMX_DWORD dwKMXPlusSize; // 0044 size in bytes of entire KMXPlus data + #}; + +block(kmxplusdata) + 23 20 54 68 69 73 20 69 73 20 6e 6f 74 20 79 65 # # This is not ye + 74 20 61 20 76 61 6c 69 64 20 2e 6b 6d 78 20 66 # t a valid .kmx f + 69 6c 65 2e 20 48 61 6e 64 20 67 65 6e 65 72 61 # ile. Hand genera + 74 65 64 20 74 6f 20 73 65 74 20 74 68 65 20 30 # ted to set the 0 + 78 32 30 20 76 61 6c 75 65 20 69 6e 20 64 77 46 # x20 value in dwF + 6c 61 67 73 # lags diff --git a/core/tests/unit/ldml/invalid-keyboards/ik_000_null_invalid.xml b/core/tests/unit/ldml/invalid-keyboards/ik_000_null_invalid.xml new file mode 100644 index 0000000000000000000000000000000000000000..85b7023d5a3294b8e483c7749fb8b8a7903644f1 --- /dev/null +++ b/core/tests/unit/ldml/invalid-keyboards/ik_000_null_invalid.xml @@ -0,0 +1,10 @@ + + diff --git a/core/tests/unit/ldml/invalid-keyboards/meson.build b/core/tests/unit/ldml/invalid-keyboards/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..da8fb85ad0a66b5d974c3b88e238ed90167f8220 --- /dev/null +++ b/core/tests/unit/ldml/invalid-keyboards/meson.build @@ -0,0 +1,31 @@ +# Copyright: © SIL International. +# Description: Cross platform build script to copy invalid keyboards for unit tests. +# Create Date: 5 Aug 2022 +# Authors: Marc Durdin +# + +invalid_tests = [ + 'ik_000_null_invalid' +] + +if build_machine.system() == 'windows' + copy_cmd = [find_program('cmd.exe', required: true), '/c', 'copy'] +else + copy_cmd = [find_program('cp', required: true)] +endif + +# Build all keyboards in output folder + +foreach kbd : invalid_tests + configure_file( + command: copy_cmd + ['@INPUT@', '@OUTPUT@'], + input: kbd + '.xml', + output: kbd + '.xml' + ) + + configure_file( + command: hextobin_cmd + ['@INPUT@', '@OUTPUT@'], + output: kbd + '.kmx', + input: kbd + '.txt' + ) +endforeach diff --git a/core/tests/unit/ldml/keyboards/fr-t-k0-azerty-test.xml b/core/tests/unit/ldml/keyboards/fr-t-k0-azerty-test.xml new file mode 100644 index 0000000000000000000000000000000000000000..21f9d64cc4f6611afa51f339a671c7cde48d8cd7 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/fr-t-k0-azerty-test.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/fr-t-k0-azerty.xml b/core/tests/unit/ldml/keyboards/fr-t-k0-azerty.xml new file mode 100644 index 0000000000000000000000000000000000000000..8a634bda65d786574e1e21c6fdfdd9eaaa686d22 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/fr-t-k0-azerty.xml @@ -0,0 +1,197 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_000_null_keyboard.xml b/core/tests/unit/ldml/keyboards/k_000_null_keyboard.xml new file mode 100644 index 0000000000000000000000000000000000000000..516c336b247d96d9658a78e5f443e567a220e31d --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_000_null_keyboard.xml @@ -0,0 +1,10 @@ + + diff --git a/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml b/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml new file mode 100644 index 0000000000000000000000000000000000000000..63fba5778a79dbeba25bedc5ebe45ab4e368faa6 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_001_tiny-test.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_001_tiny.xml b/core/tests/unit/ldml/keyboards/k_001_tiny.xml new file mode 100644 index 0000000000000000000000000000000000000000..65bf21ea51a521c69fd709e9d06be536aa977001 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_001_tiny.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_002_tinyu32.xml b/core/tests/unit/ldml/keyboards/k_002_tinyu32.xml new file mode 100644 index 0000000000000000000000000000000000000000..85d5f7d94320ef6e950968cbea519cd0b9c7cd12 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_002_tinyu32.xml @@ -0,0 +1,28 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_003_transform.xml b/core/tests/unit/ldml/keyboards/k_003_transform.xml new file mode 100644 index 0000000000000000000000000000000000000000..577b0e314d5990d322022ec74453268d6b0e3005 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_003_transform.xml @@ -0,0 +1,50 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_004_tinyshift.xml b/core/tests/unit/ldml/keyboards/k_004_tinyshift.xml new file mode 100644 index 0000000000000000000000000000000000000000..212e41d8fe1f0300e9ada8889c54093d19cec826 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_004_tinyshift.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_005_modbittest.xml b/core/tests/unit/ldml/keyboards/k_005_modbittest.xml new file mode 100644 index 0000000000000000000000000000000000000000..8d1a934016e5fb12802ef96501d7a2f071d1751d --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_005_modbittest.xml @@ -0,0 +1,45 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_010_mt.xml b/core/tests/unit/ldml/keyboards/k_010_mt.xml new file mode 100644 index 0000000000000000000000000000000000000000..c0734ac18092c531f792a3663b71833c2823f968 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_010_mt.xml @@ -0,0 +1,96 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_011_mt_iso.xml b/core/tests/unit/ldml/keyboards/k_011_mt_iso.xml new file mode 100644 index 0000000000000000000000000000000000000000..f572bac9ec6ad8694118cebd62f75f0bdf53d532 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_011_mt_iso.xml @@ -0,0 +1,93 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_100_keytest.xml b/core/tests/unit/ldml/keyboards/k_100_keytest.xml new file mode 100644 index 0000000000000000000000000000000000000000..80766204949ec5d18a1af62d0bf0a873e2c34177 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_100_keytest.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_101_keytest.xml b/core/tests/unit/ldml/keyboards/k_101_keytest.xml new file mode 100644 index 0000000000000000000000000000000000000000..f3ef3fbdceb723f23d93138af7461573d6c618da --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_101_keytest.xml @@ -0,0 +1,29 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/k_102_keytest.xml b/core/tests/unit/ldml/keyboards/k_102_keytest.xml new file mode 100644 index 0000000000000000000000000000000000000000..f541fbfd7ba2c8ab08334a879aa3b138d45744f8 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/k_102_keytest.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + diff --git a/core/tests/unit/ldml/keyboards/meson.build b/core/tests/unit/ldml/keyboards/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..367e0056d92ad415f82286cecc8403c82d3aaf67 --- /dev/null +++ b/core/tests/unit/ldml/keyboards/meson.build @@ -0,0 +1,91 @@ +# Copyright: © SIL International. +# Description: Cross platform build script to compile kmkbpldml API unit tests. +# Create Date: 5 Aug 2022 +# Authors: Marc Durdin +# + + +# keyboards in resources/standards-data/ldml-keyboards/techpreview/3.0/ +# tests in resources/standards-data/ldml-keyboards/techpreview/test/ +tests_from_cldr = [ + 'ja-Latn', + 'pt-k0-abnt2', + # 'fr-t-k0-azerty', # vkey issues +] + +tests_without_testdata = [ +# disabling 000 until we have updates to core or to the keyboard so that it passes +# 'k_000_null_keyboard', + 'k_002_tinyu32', + 'k_003_transform', + 'k_004_tinyshift', + 'k_005_modbittest', + 'k_010_mt', + 'k_011_mt_iso', + 'k_100_keytest', + 'k_101_keytest', + 'k_102_keytest', +] + +# These tests have a k_001_tiny-test.xml file as well. +tests_with_testdata = [ + 'k_001_tiny', + 'fr-t-k0-azerty', # TODO-LDML: move to cldr above (fix vkey) +] + +tests = tests_without_testdata +tests += tests_with_testdata +tests_needing_copy = tests # not including cldr + +tests += tests_from_cldr + +# Setup kmc + +kmc_root = join_paths(meson.source_root(),'..','developer','src','kmc') +ldml_root = join_paths(meson.source_root(),'..','resources','standards-data','ldml-keyboards','techpreview') +ldml_data = join_paths(ldml_root, '3.0') +ldml_testdata = join_paths(ldml_root, 'test') +kmc_cmd = [node, kmc_root] + +# Build all keyboards in output folder + +foreach kbd : tests_needing_copy + configure_file( + copy: true, + input: kbd + '.xml', + output: kbd + '.xml' + ) + + configure_file( + command: kmc_cmd + ['build', '@INPUT@', '--out-file', '@OUTPUT@'], + input: kbd + '.xml', + output: kbd + '.kmx', + ) +endforeach + +foreach kbd : tests_with_testdata + configure_file( + command: kmc_cmd + ['build-test-data', '@INPUT@', '--out-file', '@OUTPUT@'], + input: kbd + '-test.xml', + output: kbd + '-test.json', + ) +endforeach + + +foreach kbd : tests_from_cldr + configure_file( + copy: true, + input: ldml_data / kbd + '.xml', + output: kbd + '.xml' + ) + configure_file( + command: kmc_cmd + ['build', '@INPUT@', '--out-file', '@OUTPUT@'], + input: join_paths(ldml_data, kbd + '.xml'), + output: kbd + '.kmx', + ) + configure_file( + command: kmc_cmd + ['build-test-data', '@INPUT@', '--out-file', '@OUTPUT@'], + input: join_paths(ldml_testdata, kbd + '-test.xml'), + output: kbd + '-test.json', + ) +endforeach diff --git a/core/tests/unit/ldml/ldml.cpp b/core/tests/unit/ldml/ldml.cpp new file mode 100644 index 0000000000000000000000000000000000000000..bf78d0093655cffb6c6064fcfed2775622b7f5d6 --- /dev/null +++ b/core/tests/unit/ldml/ldml.cpp @@ -0,0 +1,409 @@ +/* + Copyright: © SIL International. + Description: Tests for LDML keyboard integration + Create Date: 5 Aug 2022 + Authors: Marc Durdin (MD) + + Note: Exit codes will be 100*LINE + ERROR CODE, e.g. 25005 is code 5 on line 250 +*/ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "path.hpp" +#include "state.hpp" +#include "utfcodec.hpp" + +#include +#include + +#include // for surrogate pair macros + +#include "ldml_test_source.hpp" + +namespace { + +bool g_beep_found = false; + +km_kbp_option_item test_env_opts[] = +{ + KM_KBP_OPTIONS_END +}; + +std::string +string_to_hex(const std::u16string &input) { + std::ostringstream result; + result << std::setfill('0') << std::hex << std::uppercase; + + for (size_t i = 0; i < input.length(); i++) { + unsigned int ch = input[i]; + if (i < input.length() - 1 && Uni_IsSurrogate1(input[i]) && Uni_IsSurrogate2(input[i + 1])) { + ch = Uni_SurrogateToUTF32(input[i], input[i + 1]); + i++; + } + + result << "U+" << std::setw(4) << ch << " "; + } + return result.str(); +} + +void +apply_action( + km_kbp_state const *, + km_kbp_action_item const &act, + std::u16string &text_store, + std::vector &context, + km::tests::LdmlTestSource &test_source) { + switch (act.type) { + case KM_KBP_IT_END: + assert(false); + break; + case KM_KBP_IT_ALERT: + g_beep_found = true; + // std::cout << "beep" << std::endl; + break; + case KM_KBP_IT_CHAR: + context.push_back(km_kbp_context_item{ + KM_KBP_CT_CHAR, + { + 0, + }, + {act.character}}); + { + km::kbp::kmx::char16_single buf; + const int len = km::kbp::kmx::Utf32CharToUtf16(act.character, buf); + for(int i=0; i 0) { + assert(!context.empty() && !text_store.empty()); + km_kbp_usv ch = text_store.back(); + text_store.pop_back(); + if (text_store.length() > 0 && Uni_IsSurrogate2(ch)) { + auto ch1 = text_store.back(); + if (Uni_IsSurrogate1(ch1)) { + // We'll only pop the next character off it is actually a + // surrogate pair + ch = Uni_SurrogateToUTF32(ch1, ch); + text_store.pop_back(); + } + } + assert(ch == act.backspace.expected_value); + + assert(context.back().type == KM_KBP_CT_CHAR); + assert(context.back().character == ch); + context.pop_back(); + } + break; + case KM_KBP_IT_PERSIST_OPT: + break; + case KM_KBP_IT_INVALIDATE_CONTEXT: + std::cout << "action: context invalidated (markers cleared)" << std::endl; + break; + case KM_KBP_IT_EMIT_KEYSTROKE: + std::cout << "action: emit keystroke" << std::endl; + break; + case KM_KBP_IT_CAPSLOCK: + std::cout << "action: capsLock " << act.capsLock << std::endl; + test_source.set_caps_lock_on(act.capsLock); + break; + default: + assert(false); // NOT SUPPORTED + break; + } +} + +/** + * verify the current context +*/ +void +verify_context(std::u16string& text_store, km_kbp_state* &test_state, std::vector &test_context) { + // Compare context and text store at each step - should be identical + size_t n = 0; + km_kbp_context_item* citems = nullptr; + try_status(km_kbp_context_get(km_kbp_state_context(test_state), &citems)); + try_status(km_kbp_context_items_to_utf16(citems, nullptr, &n)); + km_kbp_cp *buf = new km_kbp_cp[n]; + try_status(km_kbp_context_items_to_utf16(citems, buf, &n)); + std::cout << "context : " << string_to_hex(buf) << " [" << buf << "]" << std::endl; + + // Verify that both our local test_context and the core's test_state.context have + // not diverged + auto ci = citems; + for (auto test_ci = test_context.begin(); ci->type != KM_KBP_CT_END || test_ci != test_context.end(); ci++, test_ci++) { + assert(ci->type != KM_KBP_CT_END && test_ci != test_context.end()); // Verify that both lists are same length + assert(test_ci->type == ci->type && test_ci->marker == ci->marker); + } + + km_kbp_context_items_dispose(citems); + if (text_store != buf) { + std::cerr << "text store has diverged from buf" << std::endl; + std::cerr << "text store: " << string_to_hex(text_store) << " [" << text_store << "]" << std::endl; + assert(false); + } + delete [] buf; + +} + +int +run_test(const km::kbp::path &source, const km::kbp::path &compiled, km::tests::LdmlTestSource& test_source) { + km_kbp_keyboard * test_kb = nullptr; + km_kbp_state * test_state = nullptr; + + const km_kbp_status expect_load_status = test_source.get_expected_load_status(); + assert_equal(km_kbp_keyboard_load(compiled.c_str(), &test_kb), expect_load_status); + + if (expect_load_status != KM_KBP_STATUS_OK) { + std::cout << "Keyboard was expected to be invalid, so exiting " << std::endl; + return 0; + } + + // Setup state, environment + try_status(km_kbp_state_create(test_kb, test_env_opts, &test_state)); + + // Setup context + km_kbp_context_item *citems = nullptr; + try_status(km_kbp_context_items_from_utf16(test_source.get_context().c_str(), &citems)); + try_status(km_kbp_context_set(km_kbp_state_context(test_state), citems)); + + // Make a copy of the setup context for the test + std::vector test_context; + for(km_kbp_context_item *ci = citems; ci->type != KM_KBP_CT_END; ci++) { + test_context.emplace_back(*ci); + } + km_kbp_context_items_dispose(citems); + + // Setup baseline text store + std::u16string text_store = test_source.get_context(); + + km::tests::ldml_action action; + + // verify at beginning + verify_context(text_store, test_state, test_context); + + // Run through actions, applying output for each event + for (test_source.next_action(action); action.type != km::tests::LDML_ACTION_DONE; test_source.next_action(action)) { + if (action.type == km::tests::LDML_ACTION_KEY_EVENT) { + auto &p = action.k; + std::cout << "- key action: 0x" << std::hex << p.vk << "/modifier 0x" << p.modifier_state << std::dec << std::endl; + // Because a normal system tracks caps lock state itself, + // we mimic that in the tests. We assume caps lock state is + // updated on key_down before the processor receives the + // event. + if (p.vk == KM_KBP_VKEY_CAPS) { + test_source.toggle_caps_lock_state(); + } + + for (auto key_down = 1; key_down >= 0; key_down--) { + // expected error only applies to key down + try_status(km_kbp_process_event(test_state, p.vk, p.modifier_state | test_source.caps_lock_state(), key_down, KM_KBP_EVENT_FLAG_DEFAULT)); // TODO-LDML: for now. Should send touch and hardware events. + + for (auto act = km_kbp_state_action_items(test_state, nullptr); act->type != KM_KBP_IT_END; act++) { + apply_action(test_state, *act, text_store, test_context, test_source); + } + } + verify_context(text_store, test_state, test_context); + } else if (action.type == km::tests::LDML_ACTION_EMIT_STRING) { + std::cout << "- string emit action: " << action.string << std::endl; + std::cerr << "TODO-LDML: note, LDML_ACTION_EMIT_STRING is NOT going through keyboard, transforms etc." << std::endl; + text_store.append(action.string); // TODO-LDML: not going through keyboard + // Now, update context? + km_kbp_context_item *nitems = nullptr; + try_status(km_kbp_context_items_from_utf16(action.string.c_str(), &nitems)); + try_status(km_kbp_context_append(km_kbp_state_context(test_state), nitems)); + // update the test_context also. + for (km_kbp_context_item *ci = nitems; ci->type != KM_KBP_CT_END; ci++) { + test_context.emplace_back(*ci); + } + km_kbp_context_items_dispose(nitems); + + verify_context(text_store, test_state, test_context); + } else if (action.type == km::tests::LDML_ACTION_CHECK_EXPECTED) { + std::cout << "- check expected" << std::endl; + std::cout << "expected : " << string_to_hex(action.string) << " [" << action.string << "]" << std::endl; + std::cout << "text store: " << string_to_hex(text_store) << " [" << text_store << "]" << std::endl; + // Compare internal context with expected result + if (text_store != action.string) return __LINE__; + } else if (action.type == km::tests::LDML_ACTION_FAIL) { + // test requested failure + std::cout << "- FAIL: " << action.string << std::endl; + return __LINE__; + } else { + std::cerr << " Err: unhandled action type " << action.type << std::endl; + return __LINE__; + } + } + std::cout << "- DONE" << std::endl; + + // Test if the beep action was as expected + if (g_beep_found != test_source.get_expected_beep()) + return __LINE__; + + + // re-verify at end. + verify_context(text_store, test_state, test_context); + + // Verify that both our local test_context and the core's test_state.context have + // not diverged + try_status(km_kbp_context_get(km_kbp_state_context(test_state), &citems)); + auto ci = citems; + for(auto test_ci = test_context.begin(); ci->type != KM_KBP_CT_END || test_ci != test_context.end(); ci++, test_ci++) { + assert(ci->type != KM_KBP_CT_END && test_ci != test_context.end()); // Verify that both lists are same length + assert(test_ci->type == ci->type && test_ci->marker == ci->marker); + } + + km_kbp_context_items_dispose(citems); + + // Destroy them + km_kbp_state_dispose(test_state); + km_kbp_keyboard_dispose(test_kb); + + return 0; +} + +/** + * Run all tests for this keyboard + */ +int run_all_tests(const km::kbp::path &source, const km::kbp::path &compiled) { + std::cout << "source file = " << source << std::endl + << "compiled file = " << compiled << std::endl; + + km::tests::LdmlEmbeddedTestSource embedded_test_source; + + std::vector failures; // track failures for summary + + int embedded_result = embedded_test_source.load_source(source); + + if (embedded_result == 0) { + // embedded loaded OK, try it + std::cout << "TEST: " << source.name() << " (embedded)" << std::endl; + embedded_result = run_test(source, compiled, embedded_test_source); + if (embedded_result != 0) { + failures.push_back("in-XML (@@ comment) embedded test failed"); + } + } else { + // Not an error in itself, if JSON is present. + embedded_result = -1; // load failed + } + + km::tests::LdmlJsonTestSourceFactory json_factory; + // adjust path + + const auto json_path = km::tests::LdmlJsonTestSourceFactory::kmx_to_test_json(compiled); + int json_result = json_factory.load(compiled, json_path); + if (json_result != -1) { + const km::tests::JsonTestMap& json_tests = json_factory.get_tests(); + + assert(json_tests.size() > 0); + // Loop over all tests + for (const auto& n : json_tests) { + std::cout << "TEST: " << json_path.stem() << "/" << n.first << std::endl; + int sub_test = run_test(source, compiled, *n.second); + if (sub_test != 0) { + std::cout << " FAIL: " << json_path.stem() << "/" << n.first << std::endl; + failures.push_back(json_path.stem() + "/" + n.first); + json_result = sub_test; // set to last failure + } else { + std::cout << " PASS: " << json_path.stem() << "/" << n.first << std::endl; + } + } + std::cout << " " << json_tests.size() << " JSON test(s) in " << json_path.stem() << std::endl; + } + + + // OK. + if (embedded_result == -1) { + std::cout << "Note: No embedded test." << std::endl; + } + if (json_result == -1) { + std::cout << "Note: No json test." << std::endl; + } + + // if both are missing, that's an error in itself. + if (embedded_result == -1 && json_result == -1) { + // Can't both be missing. + failures.push_back("Error: Need either embedded test (@@ directives) or json test"); + } + + // recap the failures + if (failures.size() > 0) { + for (const auto& f : failures) { + std::cerr << "failure summary: " << f << std::endl; + } + return -1; + } else { + std::cout << "run_all_tests passed" << std::endl; + return 0; + } +} + + + +constexpr const auto help_str = + "\ +ldml [--color] \n\ +help:\n\ +\tKMN_FILE:\tThe ldml test file for the keyboard under test.\n\ +\tKMX_FILE:\tThe corresponding compiled kmx file.\n"; + +} // namespace + +int error_args() { + std::cerr << "ldml: Not enough arguments." << std::endl; + std::cout << help_str; + return 1; +} + +int main(int argc, char *argv[]) { + int first_arg = 1; + + if (argc < 3) { + return error_args(); + } + + auto arg_color = std::string(argv[1]) == "--color"; + if(arg_color) { + first_arg++; + if(argc < 4) { + return error_args(); + } + } + console_color::enabled = console_color::isaterminal() || arg_color; + + int rc = run_all_tests(argv[first_arg], argv[first_arg + 1]); + if (rc != EXIT_SUCCESS) { + std::cerr << "FAILED" << std::endl; + rc = EXIT_FAILURE; + } + return rc; +} diff --git a/core/tests/unit/ldml/ldml_test_source.cpp b/core/tests/unit/ldml/ldml_test_source.cpp new file mode 100644 index 0000000000000000000000000000000000000000..614a4606888876ff499fdd3e2d9b4c730786ef42 --- /dev/null +++ b/core/tests/unit/ldml/ldml_test_source.cpp @@ -0,0 +1,739 @@ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#if 0 +// TODO-LDML If we need to avoid exceptions in JSON +#define JSON_TRY_USER if(true) +#define JSON_CATCH_USER(exception) if(false) +#define JSON_THROW_USER(exception) { return __LINE__; } // get out +#endif + +#include + +#include // for char to vk mapping tables +#include // for surrogate pair macros +#include +#include "ldml/keyboardprocessor_ldml.h" +#include "ldml/ldml_processor.hpp" + + +#include "path.hpp" +#include "state.hpp" +#include "utfcodec.hpp" + +#include "ldml_test_source.hpp" +#include "ldml_test_utils.hpp" + +#if defined(HAVE_ICU4C) +// TODO-LDML: Needed this for some compiler warnings +#define U_FALLTHROUGH +#include "unicode/uniset.h" +#include "unicode/usetiter.h" +#else +#error icu4c is required for this test +#endif + +#define assert_or_return(expr) if(!(expr)) { \ + std::wcerr << __FILE__ << ":" << __LINE__ << ": " << \ + console_color::fg(console_color::BRIGHT_RED) \ + << "warning: " << (#expr) \ + << console_color::reset() \ + << std::endl; \ + return __LINE__; \ +} + +#define TEST_JSON_SUFFIX "-test.json" +namespace km { +namespace tests { + +#include + + +LdmlTestSource::LdmlTestSource() { +} + + +LdmlTestSource::~LdmlTestSource() { + +} + +km_kbp_status LdmlTestSource::get_expected_load_status() { + return KM_KBP_STATUS_OK; +} + +bool LdmlTestSource::get_expected_beep() const { + return false; +} + +// String trim functions from https://stackoverflow.com/a/217605/1836776 +// trim from start (in place) +static inline void +ltrim(std::string &s) { + s.erase(s.begin(), std::find_if(s.begin(), s.end(), [](int ch) { return !std::isspace(ch); })); +} + +// trim from end (in place) +static inline void +rtrim(std::string &s) { + s.erase(std::find_if(s.rbegin(), s.rend(), [](int ch) { return !std::isspace(ch); }).base(), s.end()); +} + +// trim from both ends (in place) +static inline void +trim(std::string &s) { + ltrim(s); + rtrim(s); +} + +LdmlEmbeddedTestSource::LdmlEmbeddedTestSource() { + +} + +LdmlEmbeddedTestSource::~LdmlEmbeddedTestSource() { + +} + +std::u16string +LdmlTestSource::parse_source_string(std::string const &s) { + std::u16string t; + for (auto p = s.begin(); p != s.end(); p++) { + if (*p == '\\') { + p++; + km_kbp_usv v; + assert(p != s.end()); + if (*p == 'u' || *p == 'U') { + // Unicode value + p++; + size_t n; + std::string s1 = s.substr(p - s.begin(), 8); + v = std::stoul(s1, &n, 16); + // Allow deadkey_number (U+0001) characters and onward + assert(v >= 0x0001 && v <= 0x10FFFF); + p += n - 1; + if (v < 0x10000) { + t += km_kbp_cp(v); + } else { + t += km_kbp_cp(Uni_UTF32ToSurrogate1(v)); + t += km_kbp_cp(Uni_UTF32ToSurrogate2(v)); + } + } else if (*p == 'd') { + // Deadkey + // TODO, not yet supported + assert(false); + } + } else { + t += *p; + } + } + return t; +} + +std::u16string +LdmlTestSource::parse_u8_source_string(std::string const &u8s) { + // convert from utf-8 to utf-16 first + std::u16string s = std::wstring_convert, char16_t>{}.from_bytes(u8s); + std::u16string t; + for (auto p = s.begin(); p != s.end(); p++) { + if (*p == '\\') { + p++; + km_kbp_usv v; + assert(p != s.end()); + if (*p == 'u' || *p == 'U') { + // Unicode value + p++; + size_t n; + std::u16string s1 = s.substr(p - s.begin(), 8); + // TODO-LDML: convert back first? + std::string s1b = std::wstring_convert, char16_t>{}.to_bytes(s1); + v = std::stoul(s1b, &n, 16); + // Allow deadkey_number (U+0001) characters and onward + assert(v >= 0x0001 && v <= 0x10FFFF); + p += n - 1; + if (v < 0x10000) { + t += km_kbp_cp(v); + } else { + t += km_kbp_cp(Uni_UTF32ToSurrogate1(v)); + t += km_kbp_cp(Uni_UTF32ToSurrogate2(v)); + } + } else if (*p == 'd') { + // Deadkey + // TODO, not yet supported + assert(false); + } + } else { + t += *p; + } + } + return t; +} + +bool +LdmlEmbeddedTestSource::is_token(const std::string token, std::string &line) { + if (line.compare(0, token.length(), token) == 0) { + line = line.substr(token.length()); + trim(line); + return true; + } + return false; +} + +int +LdmlEmbeddedTestSource::load_source( const km::kbp::path &path ) { + const std::string s_keys = "@@keys: "; + const std::string s_expected = "@@expected: "; + const std::string s_context = "@@context: "; + const std::string s_capsLock = "@@capsLock: "; + const std::string s_expecterror = "@@expect-error: "; + + // Parse out the header statements in file.kmn that tell us (a) environment, (b) key sequence, (c) start context, (d) expected + // result + std::ifstream kmn(path.native()); + if (!kmn.good()) { + std::cerr << "could not open file: " << path << std::endl; + return __LINE__; + } + std::string line; + while (std::getline(kmn, line)) { + trim(line); + + if (!line.length()) + continue; + if (line.compare(0, s_keys.length(), s_keys) == 0) { + keys = line.substr(s_keys.length()); + trim(keys); + } else if (is_token(s_expected, line)) { + if (line == "\\b") { + expected_beep = true; + } else { + expected = parse_source_string(line); + } + } else if (is_token(s_expecterror, line)) { + expected_error = true; + } else if (is_token(s_context, line)) { + context = parse_source_string(line); + } else if (is_token(s_capsLock, line)) { + set_caps_lock_on(parse_source_string(line).compare(u"1") == 0); + } + } + + if (keys == "") { + // We must at least have a key sequence to run the test + return __LINE__; + } + + return 0; +} + +km_kbp_status +LdmlEmbeddedTestSource::get_expected_load_status() { + return expected_error ? KM_KBP_STATUS_INVALID_KEYBOARD : KM_KBP_STATUS_OK; +} + +const std::u16string& +LdmlEmbeddedTestSource::get_context() const { + return context; +} + +bool LdmlEmbeddedTestSource::get_expected_beep() const { + return expected_beep; +} + +int +LdmlTestSource::caps_lock_state() { + return _caps_lock_on ? KM_KBP_MODIFIER_CAPS : 0; +} + +void +LdmlTestSource::toggle_caps_lock_state() { + _caps_lock_on = !_caps_lock_on; +} + +void +LdmlTestSource::set_caps_lock_on(bool caps_lock_on) { + _caps_lock_on = caps_lock_on; +} + +key_event +LdmlTestSource::char_to_event(char ch) { + assert(ch >= 32); + return { + km::kbp::kmx::s_char_to_vkey[(int)ch - 32].vk, + (uint16_t)(km::kbp::kmx::s_char_to_vkey[(int)ch - 32].shifted ? KM_KBP_MODIFIER_SHIFT : 0)}; +} + +uint16_t +LdmlTestSource::get_modifier(std::string const m) { + for (int i = 0; km::kbp::kmx::s_modifier_names[i].name; i++) { + if (m == km::kbp::kmx::s_modifier_names[i].name) { + return km::kbp::kmx::s_modifier_names[i].modifier; + } + } + return 0; +} + +key_event +LdmlEmbeddedTestSource::vkey_to_event(std::string const &vk_event) { + // vkey format is MODIFIER MODIFIER K_NAME + // std::cout << "VK=" << vk_event << std::endl; + + std::stringstream f(vk_event); + std::string s; + uint16_t modifier_state = 0; + km_kbp_virtual_key vk = 0; + while (std::getline(f, s, ' ')) { + uint16_t modifier = get_modifier(s); + if (modifier != 0) { + modifier_state |= modifier; + } else { + vk = get_vk(s); + break; + } + } + + // The string should be empty at this point + assert(!std::getline(f, s, ' ')); + assert(vk != 0); + + return {vk, modifier_state}; +} + +void +LdmlEmbeddedTestSource::next_action(ldml_action &fillin) { + if (is_done) { + // We were already done. return done. + fillin.type = LDML_ACTION_DONE; + return; + } else if(keys.empty()) { + // Got to the end of the keys. time to check + fillin.type = LDML_ACTION_CHECK_EXPECTED; + fillin.string = expected; // copy expected + is_done = true; // so we get DONE next time + } else { + fillin.type = LDML_ACTION_KEY_EVENT; + fillin.k = next_key(); + } +} + + +key_event +LdmlEmbeddedTestSource::next_key() { + // mutate this->keys + return next_key(keys); +} + +key_event +LdmlEmbeddedTestSource::next_key(std::string &keys) { + // Parse the next element of the string, chop it off, and return it + // mutates keys + if (keys.length() == 0) + return {0, 0}; + char ch = keys[0]; + if (ch == '[') { + if (keys.length() > 1 && keys[1] == '[') { + keys.erase(0, 2); + return char_to_event(ch); + } + auto n = keys.find(']'); + assert(n != std::string::npos); + auto vkey = keys.substr(1, n - 1); + keys.erase(0, n + 1); + return vkey_to_event(vkey); + } else { + keys.erase(0, 1); + return char_to_event(ch); + } +} + + +class LdmlJsonTestSource : public LdmlTestSource { +public: + LdmlJsonTestSource(const std::string &path, km::kbp::kmx::kmx_plus *kmxplus); + virtual ~LdmlJsonTestSource(); + virtual const std::u16string &get_context() const; + int load(const nlohmann::json &test); + virtual void next_action(ldml_action &fillin); +private: + std::string path; + nlohmann::json data; // maybe + std::u16string context; + std::u16string expected; + /** + * Which action are we on? + */ + std::size_t action_index = -1; + const km::kbp::kmx::kmx_plus *kmxplus; + /** + * Helpers + */ + void set_key_from_id(key_event& k, const std::u16string& id); +}; + +LdmlJsonTestSource::LdmlJsonTestSource(const std::string &path, km::kbp::kmx::kmx_plus *k) +:path(path), kmxplus(k) { + +} + +LdmlJsonTestSource::~LdmlJsonTestSource() { +} + +void LdmlJsonTestSource::set_key_from_id(key_event& k, const std::u16string& id) { + k = {0, 0}; // set to a null value at first. + + assert(kmxplus != nullptr); + // lookup the id + assert(kmxplus->key2 != nullptr); + + assert(kmxplus->key2Helper.valid()); + + // TODO-LDML: optimize. or optimise. + + // First, find the string + KMX_DWORD strId = kmxplus->strs->find(id); + if (strId == 0) { + // will also get here if id is empty. + std::cerr << "ERROR: could not find string for " << id << std::endl; + assert(false); + return; + } + + // OK. Now we can search the keybag + KMX_DWORD keyIndex = 0; // initialize loop + auto *key2 = kmxplus->key2Helper.findKeyByStringId(strId, keyIndex); + assert(key2 != nullptr); + if (key2 == nullptr) { + return; + } + + // Now, look for the _first_ candidate vkey match in the kmap. + for (KMX_DWORD kmapIndex = 0; kmapIndex < kmxplus->key2->kmapCount; kmapIndex++) { + auto *kmap = kmxplus->key2Helper.getKmap(kmapIndex); + assert(kmap != nullptr); + if (kmap->key == keyIndex) { + k = {(km_kbp_virtual_key)kmap->vkey, (uint16_t)kmap->mod}; + return; + } + } + // Else, unfound + return; +} + + +void +LdmlJsonTestSource::next_action(ldml_action &fillin) { + if ((action_index+1) >= data["/actions"_json_pointer].size()) { + // at end, done + fillin.type = LDML_ACTION_DONE; + return; + } + + action_index++; + auto action = data["/actions"_json_pointer].at(action_index); + + // is it a check event? + auto as_check = action["/check/result"_json_pointer]; + if (as_check.is_string()) { + fillin.type = LDML_ACTION_CHECK_EXPECTED; + fillin.string = LdmlTestSource::parse_u8_source_string(as_check.get()); + return; + } + + // is it a keystroke by id? + auto as_key = action["/keystroke/key"_json_pointer]; + if (as_key.is_string()) { + fillin.type = LDML_ACTION_KEY_EVENT; + auto keyId = LdmlTestSource::parse_u8_source_string(as_key.get()); + // now, look up the key + set_key_from_id(fillin.k, keyId); + return; + } + // TODO-LDML: handle gesture, etc + + auto as_emit = action["/emit/to"_json_pointer]; + if (as_emit.is_string()) { + fillin.type = LDML_ACTION_EMIT_STRING; + fillin.string = LdmlTestSource::parse_u8_source_string(as_emit.get()); + return; + } + + // TODO-LDML: error passthrough + std::cerr << "TODO-LDML: Error, unknown/unhandled action: " << action << std::endl; + fillin.type = LDML_ACTION_DONE; +} + +const std::u16string & +LdmlJsonTestSource::get_context() const { + return context; +} + +int LdmlJsonTestSource::load(const nlohmann::json &data) { + this->data = data; // TODO-LDML + auto startContext = data["/startContext/to"_json_pointer]; + context = LdmlTestSource::parse_u8_source_string(startContext); + + return 0; +} + +#if defined(HAVE_ICU4C) +class LdmlJsonRepertoireTestSource : public LdmlTestSource { +public: + LdmlJsonRepertoireTestSource(const std::string &path, km::kbp::kmx::kmx_plus *kmxplus); + virtual ~LdmlJsonRepertoireTestSource(); + virtual const std::u16string &get_context() const; + int load(const nlohmann::json &test); + virtual void next_action(ldml_action &fillin); +private: + std::string path; + nlohmann::json data; // maybe + std::string type; + std::u16string context; + std::u16string expected; + std::string chars; + std::unique_ptr uset; + std::unique_ptr iterator; + bool need_check = false; // set this after each char + const km::kbp::kmx::kmx_plus *kmxplus; + /** + * Helpers + */ + void set_key_from_id(key_event& k, const std::u16string& id); +}; + +LdmlJsonRepertoireTestSource::LdmlJsonRepertoireTestSource(const std::string &path, km::kbp::kmx::kmx_plus *k) +:path(path), kmxplus(k){ + +} + +LdmlJsonRepertoireTestSource::~LdmlJsonRepertoireTestSource() { +} + +void +LdmlJsonRepertoireTestSource::next_action(ldml_action &fillin) { + if (type != "simple") { + std::cerr << "TODO-LDML: Warning: only 'simple' is supported now, not " << type << std::endl; + fillin.type = LDML_ACTION_DONE; + return; + } + + if (!iterator->next()) { + std::cout << "TODO-LDML: end of unicode set iterator" << std::endl; + fillin.type = LDML_ACTION_DONE; + return; + } + + if (need_check) { + need_check = false; + fillin.type = LDML_ACTION_CHECK_EXPECTED; + fillin.string = expected; + return; + } + + // we have already excluded strings, so just get the codepoint + const km_kbp_usv ch = iterator->getCodepoint(); + + // as string for debugging. + // const icu::UnicodeString& str = iterator->getString(); + + km::kbp::kmx::char16_single ch16; + std::size_t len = km::kbp::kmx::Utf32CharToUtf16(ch, ch16); + std::u16string chstr = std::u16string(ch16.ch, len); + // append to expected + expected.append(chstr); + need_check = true; + + // --------------------------------------------------- + // find a key that can emit this string. + // TODO-LDML: no transforms yet. + // TODO-LDML: looking for an exact single key for now + + assert(kmxplus != nullptr); + // lookup the id + assert(kmxplus->strs != nullptr); + assert(kmxplus->key2 != nullptr); + assert(kmxplus->layr != nullptr); + + assert(kmxplus->key2Helper.valid()); + assert(kmxplus->layrHelper.valid()); + + // First, find the string as an id + // TODO-LDML: will not work for multi string cases + KMX_DWORD strId = kmxplus->strs->find(chstr); + if (strId == 0) { // will also get here if id is empty. + fillin.string = u"No string for repertoire test: "; + fillin.string.append(chstr); + fillin.type = LDML_ACTION_FAIL; + return; + } + assert(strId != 0); + + // OK. Now we can search the keybag + KMX_DWORD keyIndex = 0; + auto *key2 = kmxplus->key2Helper.findKeyByStringTo(strId, keyIndex); + if (key2 == nullptr) { + fillin.string = u"No key for repertoire test: "; + fillin.string.append(chstr); + fillin.type = LDML_ACTION_FAIL; + return; + } + + // Now, look for the _first_ candidate vkey match in the kmap. + for (KMX_DWORD kmapIndex = 0; kmapIndex < kmxplus->key2->kmapCount; kmapIndex++) { + auto *kmap = kmxplus->key2Helper.getKmap(kmapIndex); + assert(kmap != nullptr); + if (kmap->key == keyIndex) { + fillin.k = {(km_kbp_virtual_key)kmap->vkey, (uint16_t)kmap->mod}; + std::cout << "found vkey " << fillin.k.vk << ":" << fillin.k.modifier_state << std::endl; + fillin.type = LDML_ACTION_KEY_EVENT; + return; + } + } + + fillin.type = LDML_ACTION_FAIL; + fillin.string = u"Could not find candidate vkey: "; + fillin.string.append(chstr); +} + +const std::u16string & +LdmlJsonRepertoireTestSource::get_context() const { + return context; // no context needed +} + +int LdmlJsonRepertoireTestSource::load(const nlohmann::json &data) { + this->data = data; // TODO-LDML + // Need an update to json.hpp to use contains() + // if (data.contains("/type"_json_pointer)) { + if (data.find("type") != data.end()) { + type = data["/type"_json_pointer].get(); + } else { + type = "default"; + } + chars = data["/chars"_json_pointer].get(); + std::cout << "Loaded " << path << " = " << this->type << " || " << this->chars << std::endl; + UErrorCode status = U_ZERO_ERROR; + icu::StringPiece piece(chars); + icu::UnicodeString pattern = icu::UnicodeString::fromUTF8(piece); + // icu::UnicodeString pattern(chars.data(), (int32_t)chars.length()); + uset = std::unique_ptr(new icu::UnicodeSet(pattern, status)); + if (U_FAILURE(status)) { + // could be a malformed syntax isue + std::cerr << "UnicodeSet c'tor problem " << u_errorName(status) << std::endl; + return 1; + } + std::cout << "Got UnicodeSet of " << uset->size() << " char(s)." << std::endl; + // #if (U_ICU_VERSION_MAJOR_NUM >= 70) + // // TODO-LDML: function was private previously + // if (uset->hasStrings()) { + // // illegal unicodeset of this form: [a b c {this_is_a_string}] + // std::cerr << "Spec err: may not have strings. " << chars << std::endl; + // return 1; + // } + // #endif + iterator = std::unique_ptr(new icu::UnicodeSetIterator(*uset)); + return 0; +} +#endif // HAVE_ICU4C + +LdmlJsonTestSourceFactory::LdmlJsonTestSourceFactory() : test_map() { +} + +km::kbp::path +LdmlJsonTestSourceFactory::kmx_to_test_json(const km::kbp::path &kmx) { + km::kbp::path p = kmx; + p.replace_extension(TEST_JSON_SUFFIX); + return p; +} + +int LdmlJsonTestSourceFactory::load(const km::kbp::path &compiled, const km::kbp::path &path) { + std::ifstream json_file(path.native()); + if (!json_file) { + return -1; // no file + } + nlohmann::json data = nlohmann::json::parse(json_file); + if (data.empty()) { + return __LINE__; // empty + } + + // check and load the KMX (yes, once again) + if(!km::kbp::ldml_processor::is_kmxplus_file(compiled, rawdata)) { + std::cerr << "Reading KMX for test purposes failed: " << compiled << std::endl; + return __LINE__; + } + + auto comp_keyboard = (const km::kbp::kmx::COMP_KEYBOARD*)rawdata.data(); + // initialize the kmxplus object with our copy + kmxplus.reset(new km::kbp::kmx::kmx_plus(comp_keyboard, rawdata.size())); + + if (!kmxplus->is_valid()) { + std::cerr << "kmx_plus invalid" << std::endl; + return __LINE__; + } + + if (!kmxplus->key2Helper.valid()) { + std::cerr << "kmx_plus invalid" << std::endl; + return __LINE__; + } + + auto conformsTo = data["/keyboardTest/conformsTo"_json_pointer].get(); + assert_or_return(std::string(LDML_CLDR_VERSION_LATEST) == conformsTo); + auto info_keyboard = data["/keyboardTest/info/keyboard"_json_pointer].get(); + auto info_author = data["/keyboardTest/info/author"_json_pointer].get(); + auto info_name = data["/keyboardTest/info/name"_json_pointer].get(); + // TODO-LDML: store these elsewhere? + std::cout << "JSON: reading " << info_name << " test of " << info_keyboard << " by " << info_author << std::endl; + + auto all_tests = data["/keyboardTest/tests"_json_pointer]; + assert_or_return((!all_tests.empty()) && (all_tests.size() > 0)); // TODO-LDML: can be empty if repertoire only? + + for(auto tests : all_tests) { + auto tests_name = tests["/name"_json_pointer].get(); + for (auto test : tests["/test"_json_pointer]) { + auto test_name = test["/name"_json_pointer].get(); + std::string test_path; + test_path.append(info_name).append("/tests/").append(tests_name).append("/").append(test_name); + std::cout << "JSON: reading " << info_name << "/" << test_path << std::endl; + + std::unique_ptr subtest(new LdmlJsonTestSource(test_path, kmxplus.get())); + assert_or_return(subtest->load(test) == 0); + test_map[test_path] = std::unique_ptr(subtest.release()); + } + } + +#if defined(HAVE_ICU4C) + auto rep_tests = data["/keyboardTest/repertoire"_json_pointer]; + assert_or_return((!rep_tests.empty()) && (rep_tests.size() > 0)); // TODO-LDML: can be empty if tests only? + + for(auto rep : rep_tests) { + auto rep_name = rep["/name"_json_pointer].get(); + + std::string test_path; + test_path.append(info_name).append("/repertoire/").append(rep_name); + + std::unique_ptr reptest(new LdmlJsonRepertoireTestSource(test_path, kmxplus.get())); + assert_or_return(reptest->load(rep) == 0); + test_map[test_path] = std::unique_ptr(reptest.release()); + } + + +#else + std::cerr << "Warning: HAVE_ICU4C not defined, so not enabling repertoire tests" << std::endl; +#endif + + return 0; +} + +const JsonTestMap& +LdmlJsonTestSourceFactory::get_tests() const { + return test_map; +} + + +} // namespace tests +} // namespace km diff --git a/core/tests/unit/ldml/ldml_test_source.hpp b/core/tests/unit/ldml/ldml_test_source.hpp new file mode 100644 index 0000000000000000000000000000000000000000..340f0bd0e905dce09e0e661dcb9ba86e1d85a5cf --- /dev/null +++ b/core/tests/unit/ldml/ldml_test_source.hpp @@ -0,0 +1,130 @@ +#ifndef __KMX_TEST_SOURCE_HPP__ +#define __KMX_TEST_SOURCE_HPP__ + +#include "path.hpp" + +#include +#include + +#include "kmx/kmx_plus.h" + +namespace km { +namespace tests { + +struct key_event { + km_kbp_virtual_key vk; + uint16_t modifier_state; +}; + +enum ldml_action_type { + /** + * Done. no more actions + */ + LDML_ACTION_DONE, + /** + * key_event - a vkey + */ + LDML_ACTION_KEY_EVENT, + /** + * string - emit this + */ + LDML_ACTION_EMIT_STRING, + /** + * expected text + */ + LDML_ACTION_CHECK_EXPECTED, + // TODO-LDML: gestures, etc? Depends on touch. + + /** + * fail test. 'string' has message. + */ + LDML_ACTION_FAIL, +}; + +struct ldml_action { + ldml_action_type type; + key_event k; + std::u16string string; +}; + +/** + * pure virtual representing a test source, or a specific subtest + */ +class LdmlTestSource { +public: + LdmlTestSource(); + virtual ~LdmlTestSource(); + virtual void next_action(ldml_action &fillin) = 0; + virtual int caps_lock_state(); + virtual void toggle_caps_lock_state(); + virtual void set_caps_lock_on(bool caps_lock_on); + virtual km_kbp_status get_expected_load_status(); + virtual const std::u16string &get_context() const = 0; + virtual bool get_expected_beep() const; + + // helper functions + static key_event char_to_event(char ch); + static uint16_t get_modifier(std::string const m); + static std::u16string parse_source_string(std::string const &s); + static std::u16string parse_u8_source_string(std::string const &s); + +private: + bool _caps_lock_on = false; +}; + +typedef std::map> JsonTestMap; + +class LdmlJsonTestSourceFactory { + public: + LdmlJsonTestSourceFactory(); + /** + * @param compiled the KMX - for lookup + * @param path the json + */ + int load(const km::kbp::path &compiled, const km::kbp::path &path); + + static km::kbp::path kmx_to_test_json(const km::kbp::path& kmx); + + const JsonTestMap& get_tests() const; + private: + JsonTestMap test_map; + // copy of the kbd data, for lookups + std::vector rawdata; + std::unique_ptr kmxplus; +}; + + +class LdmlEmbeddedTestSource : public LdmlTestSource { +public: + LdmlEmbeddedTestSource(); + virtual ~LdmlEmbeddedTestSource(); + + /** + * Load the test_source from comments in the .xml source + */ + int load_source(const km::kbp::path &path); + + virtual km_kbp_status get_expected_load_status(); + virtual const std::u16string &get_context() const; + virtual bool get_expected_beep() const; + + virtual void next_action(ldml_action &fillin); + +private: + + bool is_token(const std::string token, std::string &line); + key_event vkey_to_event(std::string const &vk_event); + key_event next_key(std::string &keys); + key_event next_key(); + + std::string keys = ""; + std::u16string expected = u"", context = u""; + bool expected_beep = false; + bool expected_error = false; + bool is_done = false; +}; + +} // namespace tests +} // namespace km + +#endif // __LDML_TEST_SOURCE_HPP__ diff --git a/core/tests/unit/ldml/ldml_test_utils.cpp b/core/tests/unit/ldml/ldml_test_utils.cpp new file mode 100644 index 0000000000000000000000000000000000000000..57c71dce37580f6a828aad566e8d4dbb98eebaec --- /dev/null +++ b/core/tests/unit/ldml/ldml_test_utils.cpp @@ -0,0 +1,27 @@ +/* + Copyright: © 2022-2023 SIL International. + Description: Internal utils for ldml tests + Create Date: 16 Mar 2023 + Authors: Steven R. Loomis (SRL) + History: Refactored out of ldml_test_source.cpp +*/ + +#include // for char to vk mapping tables + +#include "ldml_test_utils.hpp" + +namespace km { +namespace tests { + +km_kbp_virtual_key +get_vk(std::string const &vk) { + for (int i = 1; i < 256; i++) { + if (vk == km::kbp::kmx::s_key_names[i]) { + return i; + } + } + return 0; +} + +} // namespace tests +} // namespace km diff --git a/core/tests/unit/ldml/ldml_test_utils.hpp b/core/tests/unit/ldml/ldml_test_utils.hpp new file mode 100644 index 0000000000000000000000000000000000000000..8b19edf8d33d6f33ff612ef017c56cf760eb12e1 --- /dev/null +++ b/core/tests/unit/ldml/ldml_test_utils.hpp @@ -0,0 +1,24 @@ +/* + Copyright: © 2022-2023 SIL International. + Description: Internal utils for ldml tests + Create Date: 16 Mar 2023 + Authors: Steven R. Loomis (SRL) + History: Refactored out of ldml_test_source.cpp +*/ + +#pragma once + +#include +#include +#include // for char to vk mapping tables +#include // for surrogate pair macros +#include +#include + +namespace km { +namespace tests { + +km_kbp_virtual_key get_vk(std::string const &vk); + +} // namespace tests +} // namespace km diff --git a/core/tests/unit/ldml/meson.build b/core/tests/unit/ldml/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..a816658134e0ff263dd018294e3583e207ec32d1 --- /dev/null +++ b/core/tests/unit/ldml/meson.build @@ -0,0 +1,107 @@ +# Copyright: © SIL International. +# Description: Cross platform build script to compile kmkbpldml API unit tests. +# Create Date: 5 Aug 2022 +# Authors: Marc Durdin +# + +# ICU4C is used for repertoire tests + + +if target_machine.system() == 'linux' + # use pkg-config when targetting linux + pkgconfig = 'pkg-config' + icu_uc = dependency('icu-uc', required: true) +else + # load ICU from wrap + # Requires meson of about 0.57+ + icu4c = subproject('icu-minimal', default_options: [ 'default_library=static', 'cpp_std=c++17', 'warning_level=0', +'werror=false']) # TODO-LDML: options: static, no data (these are in the meson build files) + icu_uc = icu4c.get_variable('icuuc_dep') +endif + +if icu_uc.found() + defns += '-DHAVE_ICU4C' +endif + +# TODO -- why are these differing from the standard.meson.build flags? +if cpp_compiler.get_id() == 'gcc' or cpp_compiler.get_id() == 'clang' or cpp_compiler.get_id() == 'emscripten' + warns = [ + '-Wno-missing-field-initializers', + '-Wno-unused-parameter' + ] +else + warns = [] +endif + +# Build all keyboards in output folder; these are defined here and used in the +# keyboards subdir + +tests = [] +invalid_tests = [] + +# Setup copying of source files, used in child subdir calls + +if build_machine.system() == 'windows' + copy_cmd = [find_program('cmd.exe', required: true), '/c', 'copy'] +else + copy_cmd = [find_program('cp', required: true)] +endif + +if node.found() + # Note: if node is not available, we cannot build the keyboards; build.sh + # emits a warning that the ldml keyboard tests will be skipped + subdir('keyboards') + subdir('invalid-keyboards') +endif + + +# Build ldml test executable + +if cpp_compiler.get_id() == 'emscripten' + tests_flags = ['--embed-file', join_paths(meson.current_build_dir(),'keyboards','@')] + tests_flags += ['--embed-file', join_paths(meson.current_build_dir(),'invalid-keyboards','@')] + test_path = '/' + invalid_test_path = '/' +else + tests_flags = [] + test_path = join_paths(meson.current_build_dir(),'keyboards') + invalid_test_path = join_paths(meson.current_build_dir(),'invalid-keyboards') +endif + +ldml = executable('ldml', + 'ldml.cpp', + 'ldml_test_source.cpp', + 'ldml_test_utils.cpp', + cpp_args: defns + warns, + include_directories: [inc, libsrc, '../../../../developer/src/ext/json'], + link_args: links + tests_flags, + objects: lib.extract_all_objects(recursive: false), + dependencies: [icu_uc], + ) + +# Run tests on all keyboards (`tests` defined in keyboards/meson.build) + +foreach kbd : tests + kbd_src = join_paths(test_path, kbd) + '.xml' + kbd_obj = join_paths(test_path, kbd) + '.kmx' + test(kbd, ldml, args: [kbd_src, kbd_obj], suite: 'ldml-keyboards') +endforeach + +# Run tests on all invalid keyboards (`invalid_tests` defined in invalid-keyboards/meson.build) + +foreach kbd : invalid_tests + kbd_src = join_paths(invalid_test_path, kbd) + '.xml' + kbd_obj = join_paths(invalid_test_path, kbd) + '.kmx' + test(kbd, ldml, args: [kbd_src, kbd_obj], suite: 'ldml-invalid-keyboards') + # todo: consider if we should use `should_fail: true`? +endforeach + +# Build and run additional test_kmx_plus test + +e = executable('test_kmx_plus', 'test_kmx_plus.cpp', + 'ldml_test_utils.cpp', + cpp_args: defns + warns, + include_directories: [inc, libsrc, '../../../../developer/src/ext/json'], + link_args: links + tests_flags, + objects: lib.extract_all_objects(recursive: false)) +test('test_kmx_plus', e, suite: 'ldml') diff --git a/core/tests/unit/ldml/test_kmx_plus.cpp b/core/tests/unit/ldml/test_kmx_plus.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a4d83a69a7294653e49925e4c5b45aa825d8cce3 --- /dev/null +++ b/core/tests/unit/ldml/test_kmx_plus.cpp @@ -0,0 +1,166 @@ +#include +#include "kmx/kmx_plus.h" +#include "kmx/kmx_xstring.h" +#include "../../../src/ldml/ldml_vkeys.hpp" +#include +#include "ldml_test_utils.hpp" + +// needed for streaming operators +#include "utfcodec.hpp" + + +using namespace km::kbp::kmx; + +int test_COMP_KMXPLUS_KEYS_KEY() { + std::cout << "== " << __FUNCTION__ << std::endl; + + COMP_KMXPLUS_KEYS_KEY e[2] = { + { + 0x00000127, // to = U+0127 = 295 + 0x00000000 // flags: !EXTEND + }, + { + 0x0001F640, // to + 0x00000000 // flags: !EXTEND + }}; + COMP_KMXPLUS_ELEM_ELEMENT elems[2] = { + { + 0x00000127, // to = U+0127 = 295 + 0x00000000 // flags: !LDML_ELEM_FLAGS_UNICODE_SET + }, + { + 0x0001F640, // to + 0x00000000 // flags: !LDML_ELEM_FLAGS_UNICODE_SET + }}; + std::u16string s0 = e[0].get_string(); + assert_equal(s0.length(), 1); + assert_equal(s0.at(0), 0x0127); + assert(s0 == std::u16string(u"ħ")); + + std::u16string s1 = e[1].get_string(); + assert_equal(s1.length(), 2); + assert_equal(s1.at(0), 0xD83D); + assert_equal(s1.at(1), 0xDE40); + assert(s1 == std::u16string(u"🙀")); + + // now, elems. Parallel. + std::u16string es0 = elems[0].get_string(); + assert_equal(es0.length(), 1); + assert_equal(es0.at(0), 0x0127); + assert(es0 == std::u16string(u"ħ")); + + std::u16string es1 = elems[1].get_string(); + assert_equal(es1.length(), 2); + assert_equal(es1.at(0), 0xD83D); + assert_equal(es1.at(1), 0xDE40); + assert(es1 == std::u16string(u"🙀")); + + return EXIT_SUCCESS; +} + +int test_ldml_vkeys() { + std::cout << "== " << __FUNCTION__ << std::endl; + + km::kbp::ldml::vkeys vk; + +#define ADD_VKEY(k, m) { \ + const char* str = k "-" #m ; \ + PKMX_WCHAR wstr = km::kbp::kmx::strtowstr(const_cast(str)); \ + vk.add(km::tests::get_vk(k), m, wstr); \ + delete [] wstr; \ +} + + ADD_VKEY("K_A", 0); + ADD_VKEY("K_A", LCTRLFLAG); // K_A + left control -> "K_A-LCTRLFLAG", etc + ADD_VKEY("K_A", RCTRLFLAG); + ADD_VKEY("K_B", K_CTRLFLAG); + ADD_VKEY("K_A", LALTFLAG); + ADD_VKEY("K_A", RALTFLAG); + ADD_VKEY("K_B", K_ALTFLAG); + + ADD_VKEY("K_C", K_ALTFLAG|K_CTRLFLAG); + ADD_VKEY("K_D", RALTFLAG|K_CTRLFLAG); + ADD_VKEY("K_D", LALTFLAG|K_CTRLFLAG); + ADD_VKEY("K_E", K_ALTFLAG|LCTRLFLAG); + ADD_VKEY("K_E", K_ALTFLAG|RCTRLFLAG); + +#undef ADD_VKEY + assert_equal(vk.lookup(km::tests::get_vk( + "K_A"), 0), u"K_A-0"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_A"), LCTRLFLAG), u"K_A-LCTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_A"), RCTRLFLAG), u"K_A-RCTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_A"), LALTFLAG), u"K_A-LALTFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_A"), RALTFLAG), u"K_A-RALTFLAG"); + + // now try either-side keys :should get the same result with either or both + assert_equal(vk.lookup(km::tests::get_vk( + "K_B"), LCTRLFLAG), u"K_B-K_CTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_B"), RCTRLFLAG), u"K_B-K_CTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_B"), LCTRLFLAG|RCTRLFLAG), u"K_B-K_CTRLFLAG"); + + assert_equal(vk.lookup(km::tests::get_vk( + "K_B"), LALTFLAG), u"K_B-K_ALTFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_B"), RALTFLAG), u"K_B-K_ALTFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_B"), LALTFLAG|RALTFLAG), u"K_B-K_ALTFLAG"); + + // OOOkay now try BOTH side + assert_equal(vk.lookup(km::tests::get_vk( + "K_C"), LCTRLFLAG|LALTFLAG), u"K_C-K_ALTFLAG|K_CTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_C"), LCTRLFLAG|RALTFLAG), u"K_C-K_ALTFLAG|K_CTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_C"), RCTRLFLAG|LALTFLAG), u"K_C-K_ALTFLAG|K_CTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_C"), RCTRLFLAG|RALTFLAG), u"K_C-K_ALTFLAG|K_CTRLFLAG"); + + // OOOkay now try either alt + assert_equal(vk.lookup(km::tests::get_vk( + "K_D"), LCTRLFLAG|LALTFLAG), u"K_D-LALTFLAG|K_CTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_D"), LCTRLFLAG|RALTFLAG), u"K_D-RALTFLAG|K_CTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_D"), RCTRLFLAG|LALTFLAG), u"K_D-LALTFLAG|K_CTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_D"), RCTRLFLAG|RALTFLAG), u"K_D-RALTFLAG|K_CTRLFLAG"); + + // OOOkay now try either ctrl + assert_equal(vk.lookup(km::tests::get_vk( + "K_E"), LCTRLFLAG|LALTFLAG), u"K_E-K_ALTFLAG|LCTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_E"), LCTRLFLAG|RALTFLAG), u"K_E-K_ALTFLAG|LCTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_E"), RCTRLFLAG|LALTFLAG), u"K_E-K_ALTFLAG|RCTRLFLAG"); + assert_equal(vk.lookup(km::tests::get_vk( + "K_E"), RCTRLFLAG|RALTFLAG), u"K_E-K_ALTFLAG|RCTRLFLAG"); + + return EXIT_SUCCESS; +} + +int +main(int argc, const char *argv[]) { + int rc = EXIT_SUCCESS; + + if (test_COMP_KMXPLUS_KEYS_KEY() != EXIT_SUCCESS) { + rc = EXIT_FAILURE; + } + + if (test_ldml_vkeys() != EXIT_SUCCESS) { + rc = EXIT_FAILURE; + } + + if (rc == EXIT_FAILURE) { + std::cout << "== FAILURE" << std::endl; + } else { + std::cout << "== PASS" << std::endl; + } + + return rc; +} diff --git a/core/tests/unit/meson.build b/core/tests/unit/meson.build index a0125baed368e739f7ddb07dad33410b3e0bd3d1..2572dd57518351503ec1f5d10d0a4d43e2cc4463 100644 --- a/core/tests/unit/meson.build +++ b/core/tests/unit/meson.build @@ -1,4 +1,10 @@ +node = find_program('node', required: true) + +hextobin_root = join_paths(meson.source_root(),'..','common','tools','hextobin','build','hextobin.js') +hextobin_cmd = [node, hextobin_root] + subdir('json') subdir('utftest') subdir('kmnkbd') subdir('kmx') +subdir('ldml') diff --git a/core/tools/ldml-const-builder/build.sh b/core/tools/ldml-const-builder/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..3b1924e7ee91a2fccd5b0f457e052978a1d8d5fe --- /dev/null +++ b/core/tools/ldml-const-builder/build.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# +# Builds /core/include/ldml/keyboardprocessor_ldml.h from /core/include/ldml/keyboardprocessor_ldml.ts +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +# This script runs from its own folder +cd "$(dirname "$THIS_SCRIPT")" + +KBP_LDML_H_FILE="../../include/ldml/keyboardprocessor_ldml.h" + +################################ Main script ################################ + +builder_describe "Build and run the constant builder for LDML" clean build run +builder_parse "$@" + +# TODO: build if out-of-date if test is specified +# TODO: configure if npm has not been run, and build is specified + + +if builder_start_action clean; then + rm -rf ../../include/ldml/build/ + # Not removing ${KBP_LDML_H_FILE} as it is checked in + builder_finish_action success clean +fi + +if builder_start_action build; then + # Generate index.ts + npx tsc -b ../../include/ldml/tsconfig.build.json + + builder_finish_action success build +fi + +if builder_start_action run; then + node --enable-source-maps ../../include/ldml/ldml-const-builder/ldml-const-builder.js > ${KBP_LDML_H_FILE} + echo "Updated ${KBP_LDML_H_FILE}" + + builder_finish_action success run +fi + diff --git a/core/wasm.build.linux.in b/core/wasm.build.linux.in index 95dd08f12bbbdb5135668b01433926df7083512d..d449dcf94a04cb2addcb233997c64a17e26295c3 100644 --- a/core/wasm.build.linux.in +++ b/core/wasm.build.linux.in @@ -1,7 +1,4 @@ [binaries] -c = ['$EMSCRIPTEN_BASE/emcc.py', '-s', 'WASM=1', '-O2'] -cpp = ['$EMSCRIPTEN_BASE/em++.py', '-s', 'WASM=1','-O2'] -ar = ['$EMSCRIPTEN_BASE/emar.py'] - -[properties] -root = '$EMSCRIPTEN_BASE/system' +c = ['$EMSCRIPTEN_BASE/emcc.py'] +cpp = ['$EMSCRIPTEN_BASE/em++.py'] +ar = ['$EMSCRIPTEN_BASE/emar.py'] \ No newline at end of file diff --git a/core/wasm.build.mac.in b/core/wasm.build.mac.in index 126f8563417dfa59ff986e7246e18de6f4bedaa8..d449dcf94a04cb2addcb233997c64a17e26295c3 100644 --- a/core/wasm.build.mac.in +++ b/core/wasm.build.mac.in @@ -1,2 +1,4 @@ -[properties] -root = '$EMSCRIPTEN_BASE/system' +[binaries] +c = ['$EMSCRIPTEN_BASE/emcc.py'] +cpp = ['$EMSCRIPTEN_BASE/em++.py'] +ar = ['$EMSCRIPTEN_BASE/emar.py'] \ No newline at end of file diff --git a/core/wasm.build.win.in b/core/wasm.build.win.in index bc61cbbcc02a36827d2d3539befa94239f0f773c..c846fbc740711ebb09929182770f5bb10c80e5d5 100644 --- a/core/wasm.build.win.in +++ b/core/wasm.build.win.in @@ -4,4 +4,3 @@ cpp = ['python.exe', '$EMSCRIPTEN_BASE/em++.py'] ar = ['python.exe', '$EMSCRIPTEN_BASE/emar.py'] [properties] -root = '$EMSCRIPTEN_BASE/system' diff --git a/core/wasm.defs.build b/core/wasm.defs.build index a99081d2a10bb11fce266439a36b24b7d57222ec..4a598a1e1c121d759e5637df28d17dabcb675734 100644 --- a/core/wasm.defs.build +++ b/core/wasm.defs.build @@ -1,10 +1,11 @@ [binaries] -c = ['emcc.py', '-s', 'WASM=1', '-O2'] -cpp = ['em++.py', '-s', 'WASM=1','-O2'] +c = ['emcc.py'] +cpp = ['em++.py'] ar = ['emar.py'] exe_wrapper = 'node' [properties] +root = '$EMSCRIPTEN_BASE/system' shared_lib_suffix = 'js' static_lib_suffix = 'js' shared_module_suffix = 'js' diff --git a/developer/build.sh b/developer/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..76fc3c94a729561a576a7e59529c9d5b069805e1 --- /dev/null +++ b/developer/build.sh @@ -0,0 +1,40 @@ +#!/usr/bin/env bash +# +# Build Keyman Developer components +# +# TODO: convert existing Makefiles/ into build.sh scripts; for now, +# this only builds kmc and kmcmplib + +#set -x +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +################################ Main script ################################ + +builder_describe \ + "Build Keyman Developer + + **NOTE:** this only builds kmc and kmcmplib for now (TODO on other modules)" \ + \ + clean \ + configure \ + build \ + test \ + ":kmcmplib=src/kmcmplib Compiler - .kmn compiler" \ + ":kmc-kmn=src/kmc-kmn Compiler - .kmn wrapper Keyboard Module" \ + ":kmc-ldml=src/kmc-ldml Compiler - LDML Keyboard Module" \ + ":kmc-model=src/kmc-model Compiler - Lexical Model Module" \ + ":kmc-model-info=src/kmc-model-info Compiler - .model_info Module" \ + ":kmc-package=src/kmc-package Compiler - Package Module" \ + ":kmc=src/kmc Compiler - Command Line Interface" + +builder_parse "$@" + +builder_run_child_actions clean configure build test diff --git a/developer/src/.eslintrc.cjs b/developer/src/.eslintrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..0b4001b57255e2e2c43e038d7f5d72d8f47ee5c0 --- /dev/null +++ b/developer/src/.eslintrc.cjs @@ -0,0 +1,4 @@ +module.exports = { + ignorePatterns: ["**/build/**/*", "**/coverage/**/*"], + rules: {}, +}; diff --git a/developer/src/.gitignore b/developer/src/.gitignore index 1616224fd6aae46083f64547713015febb5429f1..5e1280d2cad3414ca8eb59895c082cce27a256b7 100644 --- a/developer/src/.gitignore +++ b/developer/src/.gitignore @@ -31,7 +31,7 @@ inst/setup.inf inst/setup.zip inst/templates.wxs inst/xml.wxs -inst/kmlmc.wxs +inst/kmc.wxs # /developer/TIKE/ tike/stock.kct @@ -86,7 +86,8 @@ tds_file.txt # Breakpad files generated for Sentry **/*.sym - - +# All kmc projects have build/ folders +kmc/build/ +kmc-*/build/ diff --git a/developer/src/Defines.mak b/developer/src/Defines.mak index b4b567c6e7f6c36d92644ac78f1b5698b44cab38..0a92bee695701109ddf03786f6cdfb170f48911a 100644 --- a/developer/src/Defines.mak +++ b/developer/src/Defines.mak @@ -12,8 +12,6 @@ DEVELOPER_PROGRAM=$(DEVELOPER_ROOT)\bin DEVELOPER_OUTLIB=$(DEVELOPER_ROOT)\lib DEVELOPER_DEBUGPATH=$(DEVELOPER_ROOT)\debug -KEYMAN_MODELCOMPILER_ROOT=$(DEVELOPER_ROOT)\src\kmlmc - DEVELOPER_DELPHIDPKPARAMS=-Q -B -GD -VT -^$C+ -^$D+ -^$J+ -^$L+ -^$O+ -^$Q- -^$R- -^$W+ -^$Y+ -E. $(DELPHIWARNINGS) -I$(DELPHIINCLUDES) -U$(DELPHIINCLUDES) -R$(DELPHIINCLUDES) -NSVcl;Vcl.Imaging;Vcl.Touch;Vcl.Samples;Vcl.Shell;System;Xml;Web;Soap;Winapi;System.Win -LE$(DEVELOPER_OUTLIB) -LN$(DEVELOPER_OUTLIB) -NSData -NUobj\Win32\$(TARGET_PATH) DEVELOPER_DCC32DPK=cmd /c "$(DCC32PATH)\dcc32.exe" $(DEVELOPER_DELPHIDPKPARAMS) diff --git a/developer/src/Makefile b/developer/src/Makefile index 10231b0ea22f1f2c79e0dd718184c1bf23e1cc8e..d4c6bd9384ab4264dade66f3a08bbd779abc27c0 100644 --- a/developer/src/Makefile +++ b/developer/src/Makefile @@ -3,9 +3,9 @@ # !ifdef NODELPHI -TARGETS=build-tools kmcmpdll kmanalyze kmdecomp server kmlmc +TARGETS=build-tools kmcmplib kmcmpdll kmanalyze kmdecomp server kmc !else -TARGETS=build-tools kmcmpdll kmcomp kmanalyze kmconvert tike samples setup inst kmdecomp server kmlmc +TARGETS=build-tools kmcmplib kmcmpdll kmcomp kmanalyze kmconvert tike samples setup inst kmdecomp server kmc !endif EXCLUDEPATHDEFINES=1 @@ -29,7 +29,11 @@ imsample: .virtual cd $(DEVELOPER_ROOT)\src\imsample $(MAKE) $(TARGET) -kmcmpdll: .virtual +kmcmplib: global-versions .virtual + cd $(DEVELOPER_ROOT)\src\kmcmplib + $(MAKE) $(TARGET) + +kmcmpdll: kmcmplib .virtual cd $(DEVELOPER_ROOT)\src\kmcmpdll $(MAKE) $(TARGET) @@ -65,8 +69,28 @@ server: .virtual cd $(DEVELOPER_ROOT)\src\server $(MAKE) $(TARGET) -kmlmc: .virtual - cd $(DEVELOPER_ROOT)\src\kmlmc +kmc: kmc-ldml kmc-kmn kmc-model kmc-model-info kmc-package + cd $(DEVELOPER_ROOT)\src\kmc + $(MAKE) $(TARGET) + +kmc-ldml: .virtual + cd $(DEVELOPER_ROOT)\src\kmc-ldml + $(MAKE) $(TARGET) + +kmc-kmn: .virtual + cd $(DEVELOPER_ROOT)\src\kmc-kmn + $(MAKE) $(TARGET) + +kmc-model: .virtual + cd $(DEVELOPER_ROOT)\src\kmc-model + $(MAKE) $(TARGET) + +kmc-model-info: .virtual + cd $(DEVELOPER_ROOT)\src\kmc-model-info + $(MAKE) $(TARGET) + +kmc-package: .virtual + cd $(DEVELOPER_ROOT)\src\kmc-package $(MAKE) $(TARGET) # ---------------------------------------------------------------------- @@ -233,7 +257,7 @@ build-tools: global-versions: cd $(COMMON_ROOT) - @if not exist $(KEYMAN_ROOT)\common\windows\cpp\include\keymanversion_build.h $(MAKE) global-versions + @if not exist $(KEYMAN_ROOT)\include\keymanversion_build.h $(MAKE) global-versions cd $(DEVELOPER_ROOT)\src build-tools-internal: diff --git a/developer/src/README.md b/developer/src/README.md index 6054cd5a61dba3b458ef1bddeee60d217275893c..95b33c36f44be4364cb3c71f9cdf5e74f1773f10 100644 --- a/developer/src/README.md +++ b/developer/src/README.md @@ -27,10 +27,10 @@ Building and signing of the installation archive keymandeveloper.msi. ### src/inst/node -Contains a minimal distribution of node.js intended just for compiling lexical -models. If more dependencies are required, then the developer will be expected -to install node.js themselves; this gets users going without requiring a large -installer or a full node.js install. +Contains a minimal distribution of node.js intended just for running kmc. If +more dependencies are required, then the developer will be expected to install +node.js themselves; this gets users going without requiring a large installer or +a full node.js install. ## src/kmanalyze - kmanalyze.exe @@ -66,27 +66,33 @@ Unsupported utility decompiles a Keyman .kmx keyboard. It will produce a .kmn source file and optionally a .ico or .bmp image. see kmdecomp/kmdecomp.md for details. -## src/kmlmc +## src/kmc -node-based compilers for lexical models +node-based next generation compiler, hosts kmc, kmlmi, kmlmc, kmlmp -### src/kmlmc/kmlmc - Lexical Model Compiler +### src/kmc-ldml - LDML Keyboard Compiler + +Next Generation keyboard compiler package - LDML keyboards only at present. +Command line access through kmc. + +### src/kmc-model - Lexical Model Compiler The Lexical Model Compiler, kmlmc, runs on nodeJS on all supported desktop -platforms. +platforms. Command line access through kmc/kmlmc. -### src/kmlmc/kmlmp - Package Compiler +### src/kmc-package - Package Compiler The package compiler is broadly compatible with the kmcomp .kps package compiler. However at this stage it is only tested with lexical models, and use with keyboards (either .js or .kmx) is not tested or supported. It is likely in the future that the kmcomp .kps compiler will be deprecated in favour of this -one. +one. Command line access through kmc/kmlmp. -### src/kmlmc/kmlmi - Model Info Compiler +### src/kmc-model-info - Model Info Compiler -Merges .model_info files for use on the Keyman Cloud lexical model repository -at https://github.com/keymanapp/lexical-models. +Merges .model_info files for use on the Keyman Cloud lexical model repository at +https://github.com/keymanapp/lexical-models. Command line access through +kmc/kmlmi. ## src/samples diff --git a/developer/src/common/delphi/compiler/compile.pas b/developer/src/common/delphi/compiler/compile.pas index ba136af97308b88f502837f14e9f0135a2cf1770..9b304b39d83d5dd75687a441ce4c054c9e570628 100644 --- a/developer/src/common/delphi/compiler/compile.pas +++ b/developer/src/common/delphi/compiler/compile.pas @@ -64,7 +64,7 @@ type FILE_KEY = record Key: WCHAR; // WCHAR -- actually a WORD - packing: WORD; + LineStoreIndex: WORD; Line: DWORD; ShiftFlags: DWORD; dpOutput: PWideChar; // from start of key structure @@ -174,6 +174,7 @@ type TCompilerOptions = record dwSize: DWORD; ShouldAddCompilerVersion: BOOL; + UseKmcmpLib: BOOL; end; COMPILER_OPTIONS = TCompilerOptions; diff --git a/developer/src/common/delphi/lexicalmodels/Keyman.Developer.System.LexicalModelCompile.pas b/developer/src/common/delphi/lexicalmodels/Keyman.Developer.System.LexicalModelCompile.pas index c99d7f84c2d54f3ab6d6544aa7eafd103c18c73e..a3e07f03b234a45c6c8ecf64fcaca86db20ae606 100644 --- a/developer/src/common/delphi/lexicalmodels/Keyman.Developer.System.LexicalModelCompile.pas +++ b/developer/src/common/delphi/lexicalmodels/Keyman.Developer.System.LexicalModelCompile.pas @@ -61,7 +61,7 @@ begin if m.Success then begin msgFilename := m.Groups[1].Value; - msgLine := StrToInt(m.Groups[2].Value); + msgLine := StrToIntDef(m.Groups[2].Value, 0); msgType := m.Groups[3].Value; msgCode := StrToInt('$'+m.Groups[4].Value); msgText := m.Groups[5].Value; diff --git a/developer/src/common/delphi/lexicalmodels/Keyman.System.LexicalModelUtils.pas b/developer/src/common/delphi/lexicalmodels/Keyman.System.LexicalModelUtils.pas index b7e461b0783bae44c2cdbe282978882189a51ee6..c367331eee7a5205274f869dd4bdfe262e90e837 100644 --- a/developer/src/common/delphi/lexicalmodels/Keyman.System.LexicalModelUtils.pas +++ b/developer/src/common/delphi/lexicalmodels/Keyman.System.LexicalModelUtils.pas @@ -49,7 +49,7 @@ uses const SLexicalModelExtension = '.model.js'; - // The model ID SHOULD adhere to this pattern (see also developer/src/kmlmc/index.ts): + // The model ID SHOULD adhere to this pattern (see also developer/src/kmc-model): // author .bcp47 .uniq MODEL_ID_PATTERN_JS = '^[a-z_][a-z0-9_]*\.[a-z_][a-z0-9_-]*\.[a-z_][a-z0-9_]*\.model\.js$'; MODEL_ID_PATTERN_TS = '^[a-z_][a-z0-9_]*\.[a-z_][a-z0-9_-]*\.[a-z_][a-z0-9_]*\.model\.ts$'; @@ -70,7 +70,7 @@ end; class function TLexicalModelUtils.DoesPackageFilenameFollowLexicalModelConventions( const Name: string): Boolean; -// The model ID SHOULD adhere to this pattern (see also developer/src/kmlmc/index.ts): +// The model ID SHOULD adhere to this pattern (see also developer/src/kmc-model): // author .bcp47 .uniq begin Result := TRegEx.IsMatch(ExtractFileName(Name), MODEL_ID_PATTERN_PACKAGE); diff --git a/developer/src/kmcmpdll/comperr.h b/developer/src/common/include/kmn_compiler_errors.h similarity index 97% rename from developer/src/kmcmpdll/comperr.h rename to developer/src/common/include/kmn_compiler_errors.h index 258825dab4c8055ad8e1f3c417928d36ee8de235..6cfae03fc9ea00c559fe53f1b55ddb0e5759b66a 100644 --- a/developer/src/kmcmpdll/comperr.h +++ b/developer/src/common/include/kmn_compiler_errors.h @@ -20,8 +20,8 @@ 22 Jul 2020 - eddieantonio - Add lexical model range https://github.com/keymanapp/keyman/pull/3385 */ // I4061 -#ifndef _COMPERR_H -#define _COMPERR_H +#ifndef _kmn_compiler_errors_h +#define _kmn_compiler_errors_h // Note: these are not be a bitmask #define CERR_FATAL 0x00008000 @@ -101,9 +101,6 @@ #define CERR_InvalidNamedCode 0x0000403F #define CERR_InvalidSystemStore 0x00004040 -#define CERR_CallIsProfessionalFeature 0x00004041 -#define CERR_IncludeCodesIsProfessionalFeature 0x00004042 -#define CERR_MnemonicLayoutIsProfessionalFeature 0x00004043 #define CERR_60FeatureOnly_VirtualCharKey 0x00004044 #define CERR_VersionAlreadyIncluded 0x00004045 @@ -233,4 +230,4 @@ #define CERR_BufferOverflow 0x000080C0 #define CERR_Break 0x000080C1 -#endif // _COMPERR_H +#endif // _kmn_compiler_errors_h diff --git a/developer/src/common/web/test-helpers/.gitignore b/developer/src/common/web/test-helpers/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..d16386367f7cd7dd3c1842c484239e9e82a25efc --- /dev/null +++ b/developer/src/common/web/test-helpers/.gitignore @@ -0,0 +1 @@ +build/ \ No newline at end of file diff --git a/developer/src/common/web/test-helpers/build.sh b/developer/src/common/web/test-helpers/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..77db81e63a06ad5d3353e07896aa684c4dadb9b7 --- /dev/null +++ b/developer/src/common/web/test-helpers/build.sh @@ -0,0 +1,50 @@ +#!/usr/bin/env bash +# +# Compiles developer test helpers +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +cd "$THIS_SCRIPT_PATH" + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +builder_describe "Build Keyman Developer test helpers" \ + "@/common/web/types" \ + "clean" \ + "configure" \ + "build" + +builder_describe_outputs \ + configure /node_modules \ + build /developer/src/common/web/test-helpers/build/index.js + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action clean; then + rm -rf ./build/ + builder_finish_action success clean +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action configure; then + verify_npm_setup + builder_finish_action success configure +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action build; then + tsc --build + builder_finish_action success build +fi diff --git a/developer/src/common/web/test-helpers/index.ts b/developer/src/common/web/test-helpers/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..7f34107dc91a8406b6d82c395f9fc0b0a6f21e36 --- /dev/null +++ b/developer/src/common/web/test-helpers/index.ts @@ -0,0 +1,87 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import { CompilerEvent, CompilerCallbacks, CompilerSchema, CompilerPathCallbacks, CompilerFileSystemCallbacks, compilerErrorSeverityName } from '@keymanapp/common-types'; +export { verifyCompilerMessagesObject } from './verifyCompilerMessagesObject.js'; + +// TODO: schemas are only used by kmc-ldml for now, so this works at this +// time, but it's a little fragile if we need them elsewhere in the future +const SCHEMA_BASE = '../../../../kmc-ldml/build/src/'; + +/** + * A CompilerCallbacks implementation for testing + */ +export class TestCompilerCallbacks implements CompilerCallbacks { + /* TestCompilerCallbacks */ + + messages: CompilerEvent[] = []; + + clear() { + this.messages = []; + } + + printMessages() { + this.messages.forEach(event => { + const code = event.code.toString(16); + if(event.line) { + console.log(`${compilerErrorSeverityName(event.code)} ${code} [${event.line}]: ${event.message}`); + } else { + console.log(`${compilerErrorSeverityName(event.code)} ${code}: ${event.message}`); + } + }); + } + + hasMessage(code: number): boolean { + return this.messages.find((item) => item.code == code) === undefined ? false : true; + } + + /* CompilerCallbacks */ + + loadFile(filename: string | URL): Buffer { + try { + return fs.readFileSync(filename); + } catch(e) { + if (e.code === 'ENOENT') { + return null; + } else { + throw e; + } + } + } + + get path(): CompilerPathCallbacks { + return path; + } + + get fs(): CompilerFileSystemCallbacks { + return fs; + } + + resolveFilename(baseFilename: string, filename: string): string { + const basePath = path.dirname(baseFilename); + // Transform separators to platform separators -- we are agnostic + // in our use here but path prefers files may use + // either / or \, although older kps files were always \. + if(path.sep == '/') { + filename = filename.replace(/\\/g, '/'); + } else { + filename = filename.replace(/\//g, '\\'); + } + if(!path.isAbsolute(filename)) { + filename = path.resolve(basePath, filename); + } + return filename; + } + + reportMessage(event: CompilerEvent): void { + // console.log(event.message); + this.messages.push(event); + } + + loadSchema(schema: CompilerSchema): Buffer { + return fs.readFileSync(new URL(SCHEMA_BASE + schema + '.schema.json', import.meta.url)); + } + + debug(msg: string) { + console.debug(msg); + } +}; \ No newline at end of file diff --git a/developer/src/common/web/test-helpers/package.json b/developer/src/common/web/test-helpers/package.json new file mode 100644 index 0000000000000000000000000000000000000000..09b5778f3bc4d9f9cf48253508695dc2291b7015 --- /dev/null +++ b/developer/src/common/web/test-helpers/package.json @@ -0,0 +1,23 @@ +{ + "name": "@keymanapp/developer-test-helpers", + "description": "Keyman Developer test helpers", + "type": "module", + "exports": { + ".": "./build/index.js" + }, + "files": [ + "/build/" + ], + "devDependencies": { + "@types/node": "^10.14.6", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" + }, +"scripts": { + "build": "tsc -b" + }, + "license": "MIT", + "dependencies": { + "@keymanapp/common-types": "*" + } +} diff --git a/developer/src/common/web/test-helpers/tsconfig.json b/developer/src/common/web/test-helpers/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..47646be3a61554882b8095c8277a7ad496552bd2 --- /dev/null +++ b/developer/src/common/web/test-helpers/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../../../tsconfig.esm-base.json", + + "compilerOptions": { + "rootDir": ".", + "outDir": "./build/", + "baseUrl": ".", + "paths": { + "@keymanapp/common-types": ["../../../../../common/web/types/src/main"], + }, + }, + "include": [ + "./*.ts", + ], + "references": [ + { "path": "../../../../../common/web/types/" }, + ] +} \ No newline at end of file diff --git a/developer/src/common/web/test-helpers/verifyCompilerMessagesObject.ts b/developer/src/common/web/test-helpers/verifyCompilerMessagesObject.ts new file mode 100644 index 0000000000000000000000000000000000000000..223ab430f3319d58b294be7695c2dacafc4bae5a --- /dev/null +++ b/developer/src/common/web/test-helpers/verifyCompilerMessagesObject.ts @@ -0,0 +1,66 @@ +import { CompilerErrorSeverity, compilerErrorSeverityName } from '@keymanapp/common-types'; +import {assert, expect} from 'chai'; + +// +// The purpose of these tests is to ensure that our slightly WET constant +// definitions for compiler errors are consistent in their usage: +// +// * that names are consistent between the message functions and constants +// * that constants have unique codes +// * that constants have the right error mask for their type +// +// This means we don't have to worry about DRYing out the constants, which would +// probably require us to have a preprocessing step, which has its own +// negatives. +// +// These are used in each of the test-messages.ts units to verify the +// CompilerMessages classes + +const toTitleCase = (s: string) => s.substring(0, 1).toUpperCase() + s.substring(1).toLowerCase(); + +export function verifyCompilerMessagesObject(source: Record) { + const keys = Object.keys(source); + + const m = source as Record; + + const codes: number[] = []; + + for(const key of keys) { + + // Verify each object member matches the pattern we expect + + if(typeof m[key] == 'function') { + const o = /^(Info|Hint|Warn|Error|Fatal)_([A-Za-z0-9_]+)$/.exec(key); + expect(o).to.be.instanceOf(Array, `Expected member ${key} to be a valid message function name`); + + const c = o[1].toUpperCase() + '_' + o[2]; + expect(m[c]).to.be.a('number', `Expected constant name ${c} to exist`); + + const v = m[key]('','','','','','','','','','','','' /* ignore arguments*/); + expect(v.code).to.equal(m[c], `Function ${key} returns the wrong code`); + } + else if(typeof m[key] == 'number') { + const o = /^(INFO|HINT|WARN|ERROR|FATAL)_([A-Za-z0-9_]+)$/.exec(key); + expect(o).to.be.instanceOf(Array); + + const f = toTitleCase(o[1]) + '_' + o[2]; + expect(m[f]).to.be.a('function', `Expected function name ${f} to exist`); + } else { + assert.fail(`Unexepected compiler message member ${key}`); + } + + // Verify severify masks + + if(typeof m[key] == 'number') { + const o = /^(INFO|HINT|WARN|ERROR|FATAL)_([A-Za-z0-9_]+)$/.exec(key); + expect(o).to.be.instanceOf(Array); + + const mask = compilerErrorSeverityName(m[key]); + expect(o[1]).to.equal(mask, `Mask value for ${key} does not match`); + + const code = m[key] & CompilerErrorSeverity.Error_Mask; + expect(codes).to.not.contain(code, `Constant value ${key} is not unique`); + codes.push(code); + } + } +} diff --git a/developer/src/ext/json-schema-validator/json-validator.cpp b/developer/src/ext/json-schema-validator/json-validator.cpp index 8e8ffaee68c9b6cef878a78e6c4d0003f39368a0..28988f37b54d4e96ca0666f4c2c7dddcd723bc56 100644 --- a/developer/src/ext/json-schema-validator/json-validator.cpp +++ b/developer/src/ext/json-schema-validator/json-validator.cpp @@ -683,8 +683,8 @@ void json_validator::validate_object(const json &instance, const json &schema, c static std::size_t utf8_length(const std::string &s) { size_t len = 0; - for (const unsigned char &c : s) - if ((c & 0xc0) != 0x80) + for (const char &c : s) + if (((unsigned char)c & 0xc0) != 0x80) len++; return len; } diff --git a/developer/src/inst/License.rtf b/developer/src/inst/License.rtf index 43a045c99f29e947bc03e0fe29500fd1afa0a949..472971f09a052477530a74bbf91126b26c1b00b6 100644 Binary files a/developer/src/inst/License.rtf and b/developer/src/inst/License.rtf differ diff --git a/developer/src/inst/Makefile b/developer/src/inst/Makefile index d6606be97b5b2c114d4c4ff85fa5cea8cd5ea0ae..ae2e328c821f2a0fd40581d9b84a689a74063331 100644 --- a/developer/src/inst/Makefile +++ b/developer/src/inst/Makefile @@ -6,7 +6,7 @@ # ---------------------------------------------------------------------- -DEVELOPER_FILES=kmdev.wixobj xml.wixobj cef.wixobj templates.wixobj kmlmc.wixobj server.wixobj +DEVELOPER_FILES=kmdev.wixobj xml.wixobj cef.wixobj templates.wixobj server.wixobj kmc.wixobj setup: # @@ -60,7 +60,7 @@ clean: -del /Q xml.wxs -del /Q cef.wxs -del /Q templates.wxs - -del /Q kmlmc.wxs + -del /Q kmc.wxs test-releaseexists: cd $(DEVELOPER_ROOT)\src\inst diff --git a/developer/src/inst/download.in.mak b/developer/src/inst/download.in.mak index 111aca754c78bff572822dd884f20534cc56eedd..14b01c82ba4588b879c70ea57218a6bd6be9a187 100644 --- a/developer/src/inst/download.in.mak +++ b/developer/src/inst/download.in.mak @@ -16,7 +16,7 @@ KEYMAN_WIX_TEMP_BASE=$(TEMP)\keyman_wix_build KEYMAN_WIX_TEMP_XML=$(TEMP)\keyman_wix_build\xml KEYMAN_WIX_TEMP_CEF=$(TEMP)\keyman_wix_build\cef KEYMAN_WIX_TEMP_TEMPLATES=$(TEMP)\keyman_wix_build\templates -KEYMAN_WIX_TEMP_MODELCOMPILER=$(TEMP)\keyman_wix_build\ModelCompiler +KEYMAN_WIX_TEMP_KMC=$(TEMP)\keyman_wix_build\kmc KEYMAN_WIX_TEMP_SERVER=$(TEMP)\keyman_wix_build\Server KEYMAN_WIX_KMDEV_SERVER=$(DEVELOPER_ROOT)\bin\server @@ -30,15 +30,15 @@ copykmdev: makeinstaller make-kmcomp-install-zip test-releaseexists: if exist $(DEVELOPER_ROOT)\release\$Version\keymandeveloper*.msi echo. & echo Release $Version already exists. Delete it or update VERSION.md and try again & exit 1 -candle: heat-cef heat-xml heat-templates heat-model-compiler heat-server +candle: heat-cef heat-xml heat-templates heat-server heat-kmc $(WIXCANDLE) -dVERSION=$VersionWin -dRELEASE=$VersionRelease kmdev.wxs $(WIXCANDLE) -dVERSION=$VersionWin -dRELEASE=$VersionRelease -dXmlSourceDir=$(DEVELOPER_ROOT)\src\tike\xml xml.wxs $(WIXCANDLE) -dVERSION=$VersionWin -dRELEASE=$VersionRelease -dCefSourceDir=$(KEYMAN_CEF4DELPHI_ROOT) cef.wxs $(WIXCANDLE) -dVERSION=$VersionWin -dRELEASE=$VersionRelease -dTemplatesSourceDir=$(KEYMAN_DEVELOPER_TEMPLATES_ROOT) templates.wxs - $(WIXCANDLE) -dVERSION=$VersionWin -dRELEASE=$VersionRelease -dModelCompilerSourceDir=$(KEYMAN_WIX_TEMP_MODELCOMPILER) kmlmc.wxs + $(WIXCANDLE) -dVERSION=$VersionWin -dRELEASE=$VersionRelease -dkmcSourceDir=$(KEYMAN_WIX_TEMP_KMC) kmc.wxs $(WIXCANDLE) -dVERSION=$VersionWin -dRELEASE=$VersionRelease -dServerSourceDir=$(KEYMAN_WIX_KMDEV_SERVER) server.wxs -clean-heat: clean-heat-model-compiler +clean-heat: clean-heat-kmc heat-xml: # We copy the files to a temp folder in order to exclude thumbs.db, .vs, etc from harvesting @@ -79,19 +79,20 @@ heat-server: # When we candle/light build, we can grab the source files from the proper root so go ahead and delete the temp folder again -rmdir /s/q $(KEYMAN_WIX_TEMP_SERVER) -heat-model-compiler: - cd $(KEYMAN_MODELCOMPILER_ROOT) +heat-kmc: + cd $(DEVELOPER_ROOT)\src\kmc # Build the distributable package - $(GIT_BASH_FOR_KEYMAN) bundle.sh --build-path "$(KEYMAN_WIX_TEMP_BASE)" + mkdir $(KEYMAN_WIX_TEMP_KMC) + $(GIT_BASH_FOR_KEYMAN) build.sh bundle --build-path "$(KEYMAN_WIX_TEMP_KMC)" # Build the .wxs file cd $(DEVELOPER_ROOT)\src\inst - $(WIXHEAT) dir $(KEYMAN_WIX_TEMP_MODELCOMPILER) -o kmlmc.wxs -ag -cg ModelCompiler -dr INSTALLDIR -var var.ModelCompilerSourceDir -wx -nologo + $(WIXHEAT) dir $(KEYMAN_WIX_TEMP_KMC) -o kmc.wxs -ag -cg kmc -dr INSTALLDIR -var var.kmcSourceDir -wx -nologo -clean-heat-model-compiler: +clean-heat-kmc: # the production build generates files that are not in source, e.g. .ps1 scripts # When we candle/light build, we can grab the source files from the proper root so go ahead and delete the temp folder again - -rmdir /s/q $(KEYMAN_WIX_TEMP_MODELCOMPILER) + -rmdir /s/q $(KEYMAN_WIX_TEMP_KMC) makeinstaller: cd $(DEVELOPER_ROOT)\src\inst @@ -124,6 +125,9 @@ make-kmcomp-install-zip: copy-schemas projects\* \ server\* +# TODO: are these required? +# kpj.schema.json kvks.schema.json \ +# ldml-keyboard.schema.json ldml-keyboardtest.schema.json \ copy-schemas: copy $(KEYMAN_ROOT)\common\schemas\keyboard_info\keyboard_info.source.json $(DEVELOPER_ROOT)\bin diff --git a/developer/src/inst/kmdev.wxs b/developer/src/inst/kmdev.wxs index 34feaeed66a34f1f3d38eb914ccda4917a1ee7a6..1c685ff113e8ad0637820563cf76d008c00cf782 100644 --- a/developer/src/inst/kmdev.wxs +++ b/developer/src/inst/kmdev.wxs @@ -55,7 +55,7 @@ - + @@ -211,7 +211,7 @@ - + @@ -264,6 +264,10 @@ + + + + @@ -287,7 +291,7 @@ - + diff --git a/developer/src/inst/node/dist/CHANGELOG.md b/developer/src/inst/node/dist/CHANGELOG.md index 154d7f97d4fc76356e9c1b6a3933ec694c979cc0..f9593cb605ae1e127353084524ef3c99d8b5b49b 100644 --- a/developer/src/inst/node/dist/CHANGELOG.md +++ b/developer/src/inst/node/dist/CHANGELOG.md @@ -2,38 +2,61 @@ Select a Node.js version below to view the changelog history: -* [Node.js 16](doc/changelogs/CHANGELOG\_V16.md) **Long Term Support** -* [Node.js 15](doc/changelogs/CHANGELOG\_V15.md) End-of-Life -* [Node.js 14](doc/changelogs/CHANGELOG\_V14.md) Long Term Support -* [Node.js 13](doc/changelogs/CHANGELOG\_V13.md) End-of-Life -* [Node.js 12](doc/changelogs/CHANGELOG\_V12.md) Long Term Support -* [Node.js 11](doc/changelogs/CHANGELOG\_V11.md) End-of-Life -* [Node.js 10](doc/changelogs/CHANGELOG\_V10.md) End-of-Life -* [Node.js 9](doc/changelogs/CHANGELOG\_V9.md) End-of-Life -* [Node.js 8](doc/changelogs/CHANGELOG\_V8.md) End-of-Life -* [Node.js 7](doc/changelogs/CHANGELOG\_V7.md) End-of-Life -* [Node.js 6](doc/changelogs/CHANGELOG\_V6.md) End-of-Life -* [Node.js 5](doc/changelogs/CHANGELOG\_V5.md) End-of-Life -* [Node.js 4](doc/changelogs/CHANGELOG\_V4.md) End-of-Life -* [io.js](doc/changelogs/CHANGELOG\_IOJS.md) End-of-Life -* [Node.js 0.12](doc/changelogs/CHANGELOG\_V012.md) End-of-Life -* [Node.js 0.10](doc/changelogs/CHANGELOG\_V010.md) End-of-Life -* [Archive](doc/changelogs/CHANGELOG\_ARCHIVE.md) +* [Node.js 18](doc/changelogs/CHANGELOG_V18.md) **Long Term Support** +* [Node.js 17](doc/changelogs/CHANGELOG_V17.md) End-of-Life +* [Node.js 16](doc/changelogs/CHANGELOG_V16.md) Long Term Support +* [Node.js 15](doc/changelogs/CHANGELOG_V15.md) End-of-Life +* [Node.js 14](doc/changelogs/CHANGELOG_V14.md) Long Term Support +* [Node.js 13](doc/changelogs/CHANGELOG_V13.md) End-of-Life +* [Node.js 12](doc/changelogs/CHANGELOG_V12.md) End-of-Life +* [Node.js 11](doc/changelogs/CHANGELOG_V11.md) End-of-Life +* [Node.js 10](doc/changelogs/CHANGELOG_V10.md) End-of-Life +* [Node.js 9](doc/changelogs/CHANGELOG_V9.md) End-of-Life +* [Node.js 8](doc/changelogs/CHANGELOG_V8.md) End-of-Life +* [Node.js 7](doc/changelogs/CHANGELOG_V7.md) End-of-Life +* [Node.js 6](doc/changelogs/CHANGELOG_V6.md) End-of-Life +* [Node.js 5](doc/changelogs/CHANGELOG_V5.md) End-of-Life +* [Node.js 4](doc/changelogs/CHANGELOG_V4.md) End-of-Life +* [io.js](doc/changelogs/CHANGELOG_IOJS.md) End-of-Life +* [Node.js 0.12](doc/changelogs/CHANGELOG_V012.md) End-of-Life +* [Node.js 0.10](doc/changelogs/CHANGELOG_V010.md) End-of-Life +* [Archive](doc/changelogs/CHANGELOG_ARCHIVE.md) Please use the following table to find the changelog for a specific Node.js release. - - - - - + + + - + -
16LTS14LTS12LTS18 (LTS)16 (LTS)14 (LTS)
-16.13.2
+
+18.14.1
+18.14.0
+18.13.0
+18.12.1
+18.12.0
+18.11.0
+18.10.0
+18.9.1
+18.9.0
+18.8.0
+18.7.0
+18.6.0
+18.5.0
+18.4.0
+18.3.0
+18.2.0
+18.1.0
+18.0.0
+
+16.14.2
+16.14.1
+16.14.0
+16.13.2
16.13.1
16.13.0
16.12.0
@@ -57,7 +80,17 @@ release. 16.0.0
-14.17.2
+14.19.1
+14.19.0
+14.18.3
+14.18.2
+14.18.1
+14.18.0
+14.17.6
+14.17.5
+14.17.4
+14.17.3
+14.17.2
14.17.1
14.17.0
14.16.1
@@ -86,49 +119,6 @@ release. 14.1.0
14.0.0
-12.22.2
-12.22.1
-12.22.0
-12.21.0
-12.20.2
-12.20.1
-12.20.0
-12.19.1
-12.19.0
-12.18.4
-12.18.3
-12.18.2
-12.18.1
-12.18.0
-12.17.0
-12.16.3
-12.16.2
-12.16.1
-12.16.0
-12.15.0
-12.14.1
-12.14.0
-12.13.1
-12.13.0
-12.12.0
-12.11.1
-12.11.0
-12.10.0
-12.9.1
-12.9.0
-12.8.1
-12.8.0
-12.7.0
-12.6.0
-12.5.0
-12.4.0
-12.3.1
-12.3.0
-12.2.0
-12.1.0
-12.0.0
-
diff --git a/developer/src/inst/node/dist/Keyman_README.md b/developer/src/inst/node/dist/Keyman_README.md index ab6edf3134176c8d8c39b827b7ab5cffc7a449cc..faf95051f5d80e543ae33d93af5a27ef1d84392a 100644 --- a/developer/src/inst/node/dist/Keyman_README.md +++ b/developer/src/inst/node/dist/Keyman_README.md @@ -1,7 +1,17 @@ # Bundled node.js -We are bundling node 16 here at present. +We are bundling node 18.14.1 here as of Keyman 17.0.52. Note that if we change the node version, we will need to rebuild the binary modules in /developer/src/server/src/win32/ to match the NAPI version. + +# Updating the node version + +1. Open https://nodejs.org/en/download/ +2. Download Windows Binary (.zip), 32-bit. +3. Extract the zip, and copy the following files from it into this folder: + * node.exe + * LICENSE + * CHANGELOG.md + * README.md diff --git a/developer/src/inst/node/dist/LICENSE b/developer/src/inst/node/dist/LICENSE index b1da90352139aa9ef61031146ab85e58a31ad6c6..f8fa687202dcb90b6d98a07b81296497cf79552e 100644 --- a/developer/src/inst/node/dist/LICENSE +++ b/developer/src/inst/node/dist/LICENSE @@ -55,7 +55,7 @@ The externally maintained libraries used by Node.js are: """ MIT License - Copyright (C) 2012-2020 by various contributors (see AUTHORS) + Copyright (C) 2012-2022 by various contributors (see AUTHORS) Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -107,11 +107,36 @@ The externally maintained libraries used by Node.js are: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ +- ittapi, located at deps/v8/third_party/ittapi, is licensed as follows: + """ + Copyright (c) 2019 Intel Corporation. All rights reserved. + + Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + + 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + """ + - ICU, located at deps/icu-small, is licensed as follows: """ - COPYRIGHT AND PERMISSION NOTICE (ICU 58 and later) + UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + + See Terms of Use + for definitions of Unicode Inc.’s Data Files and Software. + + NOTICE TO USER: Carefully read the following legal agreement. + BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S + DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), + YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE + TERMS AND CONDITIONS OF THIS AGREEMENT. + IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE + THE DATA FILES OR SOFTWARE. + + COPYRIGHT AND PERMISSION NOTICE - Copyright © 1991-2020 Unicode, Inc. All rights reserved. + Copyright © 1991-2022 Unicode, Inc. All rights reserved. Distributed under the Terms of Use in https://www.unicode.org/copyright.html. Permission is hereby granted, free of charge, to any person obtaining @@ -143,7 +168,7 @@ The externally maintained libraries used by Node.js are: use or other dealings in these Data Files or Software without prior written authorization of the copyright holder. - --------------------- + ---------------------------------------------------------------------- Third-Party Software Licenses @@ -151,7 +176,9 @@ The externally maintained libraries used by Node.js are: terms for licensed third-party software components included within ICU libraries. - 1. ICU License - ICU 1.8.1 to ICU 57.1 + ---------------------------------------------------------------------- + + ICU License - ICU 1.8.1 to ICU 57.1 COPYRIGHT AND PERMISSION NOTICE @@ -186,7 +213,9 @@ The externally maintained libraries used by Node.js are: All trademarks and registered trademarks mentioned herein are the property of their respective owners. - 2. Chinese/Japanese Word Break Dictionary Data (cjdict.txt) + ---------------------------------------------------------------------- + + Chinese/Japanese Word Break Dictionary Data (cjdict.txt) # The Google Chrome software developed by Google is licensed under # the BSD license. Other software included in this distribution is @@ -390,33 +419,33 @@ The externally maintained libraries used by Node.js are: # # ---------------COPYING.ipadic-----END---------------------------------- - 3. Lao Word Break Dictionary Data (laodict.txt) + ---------------------------------------------------------------------- - # Copyright (c) 2013 International Business Machines Corporation - # and others. All Rights Reserved. + Lao Word Break Dictionary Data (laodict.txt) + + # Copyright (C) 2016 and later: Unicode, Inc. and others. + # License & terms of use: http://www.unicode.org/copyright.html + # Copyright (c) 2015 International Business Machines Corporation + # and others. All Rights Reserved. # - # Project: https://github.com/veer66/lao-dictionary - # Dictionary: https://github.com/veer66/lao-dictionary/blob/master/Lao-Dictionary.txt - # License: https://github.com/veer66/lao-dictionary/blob/master/Lao-Dictionary-LICENSE.txt - # (copied below) + # Project: https://github.com/rober42539/lao-dictionary + # Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt + # License: https://github.com/rober42539/lao-dictionary/LICENSE.txt + # (copied below) # - # This file is derived from the above dictionary, with slight - # modifications. + # This file is derived from the above dictionary version of Nov 22, 2020 # ---------------------------------------------------------------------- # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. # All rights reserved. # # Redistribution and use in source and binary forms, with or without - # modification, - # are permitted provided that the following conditions are met: - # - # - # Redistributions of source code must retain the above copyright notice, this - # list of conditions and the following disclaimer. Redistributions in - # binary form must reproduce the above copyright notice, this list of - # conditions and the following disclaimer in the documentation and/or - # other materials provided with the distribution. + # modification, are permitted provided that the following conditions are met: # + # Redistributions of source code must retain the above copyright notice, this + # list of conditions and the following disclaimer. Redistributions in binary + # form must reproduce the above copyright notice, this list of conditions and + # the following disclaimer in the documentation and/or other materials + # provided with the distribution. # # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT @@ -432,7 +461,9 @@ The externally maintained libraries used by Node.js are: # OF THE POSSIBILITY OF SUCH DAMAGE. # -------------------------------------------------------------------------- - 4. Burmese Word Break Dictionary Data (burmesedict.txt) + ---------------------------------------------------------------------- + + Burmese Word Break Dictionary Data (burmesedict.txt) # Copyright (c) 2014 International Business Machines Corporation # and others. All Rights Reserved. @@ -472,7 +503,9 @@ The externally maintained libraries used by Node.js are: # SUCH DAMAGE. # -------------------------------------------------------------------------- - 5. Time Zone Database + ---------------------------------------------------------------------- + + Time Zone Database ICU uses the public domain data and code derived from Time Zone Database for its time zone support. The ownership of the TZ database @@ -495,7 +528,9 @@ The externally maintained libraries used by Node.js are: # making a contribution to the database or code waives all rights to # future claims in that contribution or in the TZ Database. - 6. Google double-conversion + ---------------------------------------------------------------------- + + Google double-conversion Copyright 2006-2011, the V8 project authors. All rights reserved. Redistribution and use in source and binary forms, with or without @@ -523,6 +558,83 @@ The externally maintained libraries used by Node.js are: THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + ---------------------------------------------------------------------- + + File: aclocal.m4 (only for ICU4C) + Section: pkg.m4 - Macros to locate and utilise pkg-config. + + Copyright © 2004 Scott James Remnant . + Copyright © 2012-2015 Dan Nicholson + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA + 02111-1307, USA. + + As a special exception to the GNU General Public License, if you + distribute this file as part of a program that contains a + configuration script generated by Autoconf, you may include it under + the same distribution terms that you use for the rest of that + program. + + (The condition for the exception is fulfilled because + ICU4C includes a configuration script generated by Autoconf, + namely the `configure` script.) + + ---------------------------------------------------------------------- + + File: config.guess (only for ICU4C) + + This file is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, but + WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program; if not, see . + + As a special exception to the GNU General Public License, if you + distribute this file as part of a program that contains a + configuration script generated by Autoconf, you may include it under + the same distribution terms that you use for the rest of that + program. This Exception is an additional permission under section 7 + of the GNU General Public License, version 3 ("GPLv3"). + + (The condition for the exception is fulfilled because + ICU4C includes a configuration script generated by Autoconf, + namely the `configure` script.) + + ---------------------------------------------------------------------- + + File: install-sh (only for ICU4C) + + Copyright 1991 by the Massachusetts Institute of Technology + + Permission to use, copy, modify, distribute, and sell this software and its + documentation for any purpose is hereby granted without fee, provided that + the above copyright notice appear in all copies and that both that + copyright notice and this permission notice appear in supporting + documentation, and that the name of M.I.T. not be used in advertising or + publicity pertaining to distribution of the software without specific, + written prior permission. M.I.T. makes no representations about the + suitability of this software for any purpose. It is provided "as is" + without express or implied warranty. """ - libuv, located at deps/uv, is licensed as follows: @@ -593,10 +705,6 @@ The externally maintained libraries used by Node.js are: - pthread-fixes.c, copyright Google Inc. and Sony Mobile Communications AB. Three clause BSD license. - - - android-ifaddrs.h, android-ifaddrs.c, copyright Berkeley Software Design - Inc, Kenneth MacKay and Emergya (Cloud4all, FP7/2007-2013, grant agreement - n° 289016). Three clause BSD license. """ - llhttp, located at deps/llhttp, is licensed as follows: @@ -636,58 +744,449 @@ The externally maintained libraries used by Node.js are: THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ -- OpenSSL, located at deps/openssl, is licensed as follows: +- undici, located at deps/undici, is licensed as follows: """ - Copyright (c) 1998-2019 The OpenSSL Project. All rights reserved. + MIT License - Redistribution and use in source and binary forms, with or without - modification, are permitted provided that the following conditions - are met: + Copyright (c) Matteo Collina and Undici contributors - 1. Redistributions of source code must retain the above copyright - notice, this list of conditions and the following disclaimer. + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: - 2. Redistributions in binary form must reproduce the above copyright - notice, this list of conditions and the following disclaimer in - the documentation and/or other materials provided with the - distribution. + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + +- postject, located at test/fixtures/postject-copy, is licensed as follows: + """ + Postject is licensed for use as follows: + + """ + MIT License + + Copyright (c) 2022 Postman, Inc + + Permission is hereby granted, free of charge, to any person obtaining a copy + of this software and associated documentation files (the "Software"), to deal + in the Software without restriction, including without limitation the rights + to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + copies of the Software, and to permit persons to whom the Software is + furnished to do so, subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + SOFTWARE. + """ + + The Postject license applies to all parts of Postject that are not externally + maintained libraries. - 3. All advertising materials mentioning features or use of this - software must display the following acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit. (http://www.openssl.org/)" - - 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to - endorse or promote products derived from this software without - prior written permission. For written permission, please contact - openssl-core@openssl.org. - - 5. Products derived from this software may not be called "OpenSSL" - nor may "OpenSSL" appear in their names without prior written - permission of the OpenSSL Project. - - 6. Redistributions of any form whatsoever must retain the following - acknowledgment: - "This product includes software developed by the OpenSSL Project - for use in the OpenSSL Toolkit (http://www.openssl.org/)" - - THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY - EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE - IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE OpenSSL PROJECT OR - ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT - NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; - LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, - STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) - ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED - OF THE POSSIBILITY OF SUCH DAMAGE. - ==================================================================== - - This product includes cryptographic software written by Eric Young - (eay@cryptsoft.com). This product includes software written by Tim - Hudson (tjh@cryptsoft.com). + The externally maintained libraries used by Postject are: + + - LIEF, located at vendor/LIEF, is licensed as follows: + """ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "{}" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2017 - 2022 R. Thomas + Copyright 2017 - 2022 Quarkslab + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. + """ + """ + +- OpenSSL, located at deps/openssl, is licensed as follows: + """ + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS """ - Punycode.js, located at lib/punycode.js, is licensed as follows: @@ -733,8 +1232,7 @@ The externally maintained libraries used by Node.js are: - Strongtalk assembler, the basis of the files assembler-arm-inl.h, assembler-arm.cc, assembler-arm.h, assembler-ia32-inl.h, assembler-ia32.cc, assembler-ia32.h, assembler-x64-inl.h, - assembler-x64.cc, assembler-x64.h, assembler-mips-inl.h, - assembler-mips.cc, assembler-mips.h, assembler.cc and assembler.h. + assembler-x64.cc, assembler-x64.h, assembler.cc and assembler.h. This code is copyrighted by Sun Microsystems Inc. and released under a 3-clause BSD license. @@ -794,9 +1292,9 @@ The externally maintained libraries used by Node.js are: - zlib, located at deps/zlib, is licensed as follows: """ zlib.h -- interface of the 'zlib' general purpose compression library - version 1.2.11, January 15th, 2017 + version 1.2.13, October 13th, 2022 - Copyright (C) 1995-2017 Jean-loup Gailly and Mark Adler + Copyright (C) 1995-2022 Jean-loup Gailly and Mark Adler This software is provided 'as-is', without any express or implied warranty. In no event will the authors be held liable for any damages @@ -818,6 +1316,28 @@ The externally maintained libraries used by Node.js are: jloup@gzip.org madler@alumni.caltech.edu """ +- simdutf, located at deps/simdutf, is licensed as follows: + """ + Copyright 2021 The simdutf authors + + Permission is hereby granted, free of charge, to any person obtaining a copy of + this software and associated documentation files (the "Software"), to deal in + the Software without restriction, including without limitation the rights to + use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of + the Software, and to permit persons to whom the Software is furnished to do so, + subject to the following conditions: + + The above copyright notice and this permission notice shall be included in all + copies or substantial portions of the Software. + + THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS + FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR + COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER + IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + """ + - npm, located at deps/npm, is licensed as follows: """ The npm application @@ -1215,7 +1735,7 @@ The externally maintained libraries used by Node.js are: - ESLint, located at tools/node_modules/eslint, is licensed as follows: """ - Copyright JS Foundation and other contributors, https://js.foundation + Copyright OpenJS Foundation and other contributors, Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal @@ -1236,32 +1756,6 @@ The externally maintained libraries used by Node.js are: THE SOFTWARE. """ -- Babel, located at tools/node_modules/@babel, is licensed as follows: - """ - MIT License - - Copyright (c) 2014-present Sebastian McKenzie and other contributors - - Permission is hereby granted, free of charge, to any person obtaining - a copy of this software and associated documentation files (the - "Software"), to deal in the Software without restriction, including - without limitation the rights to use, copy, modify, merge, publish, - distribute, sublicense, and/or sell copies of the Software, and to - permit persons to whom the Software is furnished to do so, subject to - the following conditions: - - The above copyright notice and this permission notice shall be - included in all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, - EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF - MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND - NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE - LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION - OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION - WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - """ - - gtest, located at deps/googletest, is licensed as follows: """ Copyright 2008, Google Inc. @@ -1614,3 +2108,35 @@ The externally maintained libraries used by Node.js are: OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. """ + +- base64, located at deps/base64/base64/, is licensed as follows: + """ + Copyright (c) 2005-2007, Nick Galbreath + Copyright (c) 2013-2019, Alfred Klomp + Copyright (c) 2015-2017, Wojciech Mula + Copyright (c) 2016-2017, Matthieu Darbois + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions are + met: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + - Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS + IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED + TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT + HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR + PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + """ diff --git a/developer/src/inst/node/dist/README.md b/developer/src/inst/node/dist/README.md index 72f8596896331a7175bf2b6e206c1da1218192e1..fb3f183934db00ca7dea967e0a76a1c26e3d51d3 100644 --- a/developer/src/inst/node/dist/README.md +++ b/developer/src/inst/node/dist/README.md @@ -1,25 +1,21 @@ - - -

- - Node.js - -

- -Node.js is an open-source, cross-platform, JavaScript runtime environment. It -executes JavaScript code outside of a browser. For more information on using -Node.js, see the [Node.js Website][]. +# Node.js + +Node.js is an open-source, cross-platform JavaScript runtime environment. + +For information on using Node.js, see the [Node.js website][]. The Node.js project uses an [open governance model](./GOVERNANCE.md). The [OpenJS Foundation][] provides support for the project. -**This project is bound by a [Code of Conduct][].** +Contributors are expected to act in a collaborative manner to move +the project forward. We encourage the constructive exchange of contrary +opinions and compromise. The [TSC](./GOVERNANCE.md#technical-steering-committee) +reserves the right to limit or block contributors who repeatedly act in ways +that discourage, exhaust, or otherwise negatively affect other participants. + +**This project has a [Code of Conduct][].** -# Table of contents +## Table of contents * [Support](#support) * [Release types](#release-types) @@ -61,7 +57,7 @@ Looking for help? Check out the * **Nightly**: Code from the Current branch built every 24-hours when there are changes. Use with caution. -Current and LTS releases follow [Semantic Versioning](https://semver.org). A +Current and LTS releases follow [semantic versioning](https://semver.org). A member of the Release Team [signs](#release-keys) each Current and LTS release. For more information, see the [Release README](https://github.com/nodejs/Release#readme). @@ -120,10 +116,10 @@ For Current and LTS, the GPG detached signature of `SHASUMS256.txt` is in import the keys: ```console -$ gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D +$ gpg --keyserver hkps://keys.openpgp.org --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C ``` -See the bottom of this README for a full script to import active release keys. +See [Release keys](#release-keys) for a script to import active release keys. Next, download the `SHASUMS256.txt.sig` for the release: @@ -156,57 +152,58 @@ For information on reporting security vulnerabilities in Node.js, see For information about the governance of the Node.js project, see [GOVERNANCE.md](./GOVERNANCE.md). - + ### TSC (Technical Steering Committee) * [aduh95](https://github.com/aduh95) - - **Antoine du Hamel** \ (he/him) + **Antoine du Hamel** <> (he/him) * [apapirovski](https://github.com/apapirovski) - - **Anatoli Papirovski** \ (he/him) + **Anatoli Papirovski** <> (he/him) * [BethGriggs](https://github.com/BethGriggs) - - **Beth Griggs** \ (she/her) + **Beth Griggs** <> (she/her) * [BridgeAR](https://github.com/BridgeAR) - - **Ruben Bridgewater** \ (he/him) + **Ruben Bridgewater** <> (he/him) * [ChALkeR](https://github.com/ChALkeR) - - **Сковорода Никита Андреевич** \ (he/him) + **Сковорода Никита Андреевич** <> (he/him) * [cjihrig](https://github.com/cjihrig) - - **Colin Ihrig** \ (he/him) -* [codebytere](https://github.com/codebytere) - - **Shelley Vohr** \ (she/her) + **Colin Ihrig** <> (he/him) * [danielleadams](https://github.com/danielleadams) - - **Danielle Adams** \ (she/her) + **Danielle Adams** <> (she/her) * [fhinkel](https://github.com/fhinkel) - - **Franziska Hinkelmann** \ (she/her) -* [gabrielschulhof](https://github.com/gabrielschulhof) - - **Gabriel Schulhof** \ + **Franziska Hinkelmann** <> (she/her) +* [GeoffreyBooth](https://github.com/geoffreybooth) - + **Geoffrey Booth** <> (he/him) * [gireeshpunathil](https://github.com/gireeshpunathil) - - **Gireesh Punathil** \ (he/him) + **Gireesh Punathil** <> (he/him) * [jasnell](https://github.com/jasnell) - - **James M Snell** \ (he/him) + **James M Snell** <> (he/him) * [joyeecheung](https://github.com/joyeecheung) - - **Joyee Cheung** \ (she/her) + **Joyee Cheung** <> (she/her) +* [legendecas](https://github.com/legendecas) - + **Chengzhong Wu** <> (he/him) * [mcollina](https://github.com/mcollina) - - **Matteo Collina** \ (he/him) + **Matteo Collina** <> (he/him) * [mhdawson](https://github.com/mhdawson) - - **Michael Dawson** \ (he/him) -* [mmarchini](https://github.com/mmarchini) - - **Mary Marchini** \ (she/her) -* [MylesBorins](https://github.com/MylesBorins) - - **Myles Borins** \ (he/him) + **Michael Dawson** <> (he/him) +* [RafaelGSS](https://github.com/RafaelGSS) - + **Rafael Gonzaga** <> (he/him) +* [RaisinTen](https://github.com/RaisinTen) - + **Darshan Sen** <> (he/him) * [richardlau](https://github.com/richardlau) - - **Richard Lau** \ + **Richard Lau** <> * [ronag](https://github.com/ronag) - - **Robert Nagy** \ + **Robert Nagy** <> * [targos](https://github.com/targos) - - **Michaël Zasso** \ (he/him) + **Michaël Zasso** <> (he/him) * [tniessen](https://github.com/tniessen) - - **Tobias Nießen** \ (he/him) + **Tobias Nießen** <> (he/him) * [Trott](https://github.com/Trott) - - **Rich Trott** \ (he/him) + **Rich Trott** <> (he/him)
@@ -215,47 +212,55 @@ For information about the governance of the Node.js project, see ### TSC emeriti * [addaleax](https://github.com/addaleax) - - **Anna Henningsen** \ (she/her) + **Anna Henningsen** <> (she/her) * [bnoordhuis](https://github.com/bnoordhuis) - - **Ben Noordhuis** \ + **Ben Noordhuis** <> * [chrisdickinson](https://github.com/chrisdickinson) - - **Chris Dickinson** \ + **Chris Dickinson** <> +* [codebytere](https://github.com/codebytere) - + **Shelley Vohr** <> (she/her) * [danbev](https://github.com/danbev) - - **Daniel Bevenius** \ (he/him) + **Daniel Bevenius** <> (he/him) * [evanlucas](https://github.com/evanlucas) - - **Evan Lucas** \ (he/him) + **Evan Lucas** <> (he/him) * [Fishrock123](https://github.com/Fishrock123) - - **Jeremiah Senkpiel** \ (he/they) + **Jeremiah Senkpiel** <> (he/they) +* [gabrielschulhof](https://github.com/gabrielschulhof) - + **Gabriel Schulhof** <> * [gibfahn](https://github.com/gibfahn) - - **Gibson Fahnestock** \ (he/him) + **Gibson Fahnestock** <> (he/him) * [indutny](https://github.com/indutny) - - **Fedor Indutny** \ + **Fedor Indutny** <> * [isaacs](https://github.com/isaacs) - - **Isaac Z. Schlueter** \ + **Isaac Z. Schlueter** <> * [joshgav](https://github.com/joshgav) - - **Josh Gavant** \ + **Josh Gavant** <> +* [mmarchini](https://github.com/mmarchini) - + **Mary Marchini** <> (she/her) * [mscdex](https://github.com/mscdex) - - **Brian White** \ + **Brian White** <> +* [MylesBorins](https://github.com/MylesBorins) - + **Myles Borins** <> (he/him) * [nebrius](https://github.com/nebrius) - - **Bryan Hughes** \ + **Bryan Hughes** <> * [ofrobots](https://github.com/ofrobots) - - **Ali Ijaz Sheikh** \ (he/him) + **Ali Ijaz Sheikh** <> (he/him) * [orangemocha](https://github.com/orangemocha) - - **Alexis Campailla** \ + **Alexis Campailla** <> * [piscisaureus](https://github.com/piscisaureus) - - **Bert Belder** \ + **Bert Belder** <> * [rvagg](https://github.com/rvagg) - - **Rod Vagg** \ + **Rod Vagg** <> * [sam-github](https://github.com/sam-github) - - **Sam Roberts** \ + **Sam Roberts** <> * [shigeki](https://github.com/shigeki) - - **Shigeki Ohtsu** \ (he/him) + **Shigeki Ohtsu** <> (he/him) * [thefourtheye](https://github.com/thefourtheye) - - **Sakthipriyan Vairamani** \ (he/him) + **Sakthipriyan Vairamani** <> (he/him) * [TimothyGu](https://github.com/TimothyGu) - - **Tiancheng "Timothy" Gu** \ (he/him) + **Tiancheng "Timothy" Gu** <> (he/him) * [trevnorris](https://github.com/trevnorris) - - **Trevor Norris** \ + **Trevor Norris** <>
@@ -266,199 +271,197 @@ For information about the governance of the Node.js project, see ### Collaborators * [addaleax](https://github.com/addaleax) - - **Anna Henningsen** \ (she/her) + **Anna Henningsen** <> (she/her) * [aduh95](https://github.com/aduh95) - - **Antoine du Hamel** \ (he/him) -* [ak239](https://github.com/ak239) - - **Aleksei Koziatinskii** \ + **Antoine du Hamel** <> (he/him) +* [anonrig](https://github.com/anonrig) - + **Yagiz Nizipli** <> (he/him) * [antsmartian](https://github.com/antsmartian) - - **Anto Aravinth** \ (he/him) + **Anto Aravinth** <> (he/him) * [apapirovski](https://github.com/apapirovski) - - **Anatoli Papirovski** \ (he/him) + **Anatoli Papirovski** <> (he/him) * [AshCripps](https://github.com/AshCripps) - - **Ash Cripps** \ + **Ash Cripps** <> * [Ayase-252](https://github.com/Ayase-252) - - **Qingyu Deng** \ + **Qingyu Deng** <> * [bcoe](https://github.com/bcoe) - - **Ben Coe** \ (he/him) + **Ben Coe** <> (he/him) * [bengl](https://github.com/bengl) - - **Bryan English** \ (he/him) + **Bryan English** <> (he/him) * [benjamingr](https://github.com/benjamingr) - - **Benjamin Gruenbaum** \ + **Benjamin Gruenbaum** <> * [BethGriggs](https://github.com/BethGriggs) - - **Beth Griggs** \ (she/her) + **Beth Griggs** <> (she/her) * [bmeck](https://github.com/bmeck) - - **Bradley Farias** \ -* [boneskull](https://github.com/boneskull) - - **Christopher Hiller** \ (he/him) + **Bradley Farias** <> +* [bnb](https://github.com/bnb) - + **Tierney Cyren** <> (they/he) +* [bnoordhuis](https://github.com/bnoordhuis) - + **Ben Noordhuis** <> * [BridgeAR](https://github.com/BridgeAR) - - **Ruben Bridgewater** \ (he/him) -* [bzoz](https://github.com/bzoz) - - **Bartosz Sosnowski** \ + **Ruben Bridgewater** <> (he/him) * [cclauss](https://github.com/cclauss) - - **Christian Clauss** \ (he/him) + **Christian Clauss** <> (he/him) * [ChALkeR](https://github.com/ChALkeR) - - **Сковорода Никита Андреевич** \ (he/him) + **Сковорода Никита Андреевич** <> (he/him) * [cjihrig](https://github.com/cjihrig) - - **Colin Ihrig** \ (he/him) + **Colin Ihrig** <> (he/him) * [codebytere](https://github.com/codebytere) - - **Shelley Vohr** \ (she/her) + **Shelley Vohr** <> (she/her) +* [cola119](https://github.com/cola119) - + **Kohei Ueno** <> (he/him) +* [daeyeon](https://github.com/daeyeon) - + **Daeyeon Jeong** <> (he/him) * [danbev](https://github.com/danbev) - - **Daniel Bevenius** \ (he/him) + **Daniel Bevenius** <> (he/him) * [danielleadams](https://github.com/danielleadams) - - **Danielle Adams** \ (she/her) -* [davisjam](https://github.com/davisjam) - - **Jamie Davis** \ (he/him) -* [DerekNonGeneric](https://github.com/DerekNonGeneric) - - **Derek Lewis** \ (he/him) + **Danielle Adams** <> (she/her) * [devnexen](https://github.com/devnexen) - - **David Carlier** \ + **David Carlier** <> * [devsnek](https://github.com/devsnek) - - **Gus Caplan** \ (they/them) -* [dmabupt](https://github.com/dmabupt) - - **Xu Meng** \ (he/him) -* [dnlup](https://github.com/dnlup) - **Daniele Belardi** \ (he/him) + **Gus Caplan** <> (they/them) * [edsadr](https://github.com/edsadr) - - **Adrian Estrada** \ (he/him) -* [eugeneo](https://github.com/eugeneo) - - **Eugene Ostroukhov** \ + **Adrian Estrada** <> (he/him) +* [erickwendel](https://github.com/erickwendel) - + **Erick Wendel** <> (he/him) * [evanlucas](https://github.com/evanlucas) - - **Evan Lucas** \ (he/him) + **Evan Lucas** <> (he/him) * [fhinkel](https://github.com/fhinkel) - - **Franziska Hinkelmann** \ (she/her) + **Franziska Hinkelmann** <> (she/her) +* [F3n67u](https://github.com/F3n67u) - + **Feng Yu** <> (he/him) * [Flarna](https://github.com/Flarna) - - **Gerhard Stöbich** \ (he/they) + **Gerhard Stöbich** <> (he/they) * [gabrielschulhof](https://github.com/gabrielschulhof) - - **Gabriel Schulhof** \ + **Gabriel Schulhof** <> * [gengjiawen](https://github.com/gengjiawen) - - **Jiawen Geng** \ + **Jiawen Geng** <> * [GeoffreyBooth](https://github.com/geoffreybooth) - - **Geoffrey Booth** \ (he/him) + **Geoffrey Booth** <> (he/him) * [gireeshpunathil](https://github.com/gireeshpunathil) - - **Gireesh Punathil** \ (he/him) + **Gireesh Punathil** <> (he/him) * [guybedford](https://github.com/guybedford) - - **Guy Bedford** \ (he/him) + **Guy Bedford** <> (he/him) * [HarshithaKP](https://github.com/HarshithaKP) - - **Harshitha K P** \ (she/her) -* [hashseed](https://github.com/hashseed) - - **Yang Guo** \ (he/him) + **Harshitha K P** <> (she/her) * [himself65](https://github.com/himself65) - - **Zeyu Yang** \ (he/him) -* [hiroppy](https://github.com/hiroppy) - - **Yuta Hiroto** \ (he/him) + **Zeyu "Alex" Yang** <> (he/him) * [iansu](https://github.com/iansu) - - **Ian Sutherland** \ + **Ian Sutherland** <> * [indutny](https://github.com/indutny) - - **Fedor Indutny** \ + **Fedor Indutny** <> * [JacksonTian](https://github.com/JacksonTian) - - **Jackson Tian** \ + **Jackson Tian** <> +* [JakobJingleheimer](https://github.com/JakobJingleheimer) - + **Jacob Smith** <> (he/him) * [jasnell](https://github.com/jasnell) - - **James M Snell** \ (he/him) + **James M Snell** <> (he/him) * [jkrems](https://github.com/jkrems) - - **Jan Krems** \ (he/him) -* [joaocgreis](https://github.com/joaocgreis) - - **João Reis** \ + **Jan Krems** <> (he/him) +* [joesepi](https://github.com/joesepi) - + **Joe Sepi** <> (he/him) * [joyeecheung](https://github.com/joyeecheung) - - **Joyee Cheung** \ (she/her) + **Joyee Cheung** <> (she/her) * [juanarbol](https://github.com/juanarbol) - - **Juan José Arboleda** \ (he/him) + **Juan José Arboleda** <> (he/him) * [JungMinu](https://github.com/JungMinu) - - **Minwoo Jung** \ (he/him) + **Minwoo Jung** <> (he/him) +* [kuriyosh](https://github.com/kuriyosh) - + **Yoshiki Kurihara** <> (he/him) * [legendecas](https://github.com/legendecas) - - **Chengzhong Wu** \ (he/him) + **Chengzhong Wu** <> (he/him) * [Leko](https://github.com/Leko) - - **Shingo Inoue** \ (he/him) + **Shingo Inoue** <> (he/him) * [linkgoron](https://github.com/linkgoron) - - **Nitzan Uziely** \ + **Nitzan Uziely** <> +* [LiviaMedeiros](https://github.com/LiviaMedeiros) - + **LiviaMedeiros** <> * [lpinca](https://github.com/lpinca) - - **Luigi Pinca** \ (he/him) -* [lundibundi](https://github.com/lundibundi) - - **Denys Otrishko** \ (he/him) + **Luigi Pinca** <> (he/him) +* [lukekarrys](https://github.com/lukekarrys) - + **Luke Karrys** <> (he/him) * [Lxxyx](https://github.com/Lxxyx) - - **Zijian Liu** \ (he/him) -* [mafintosh](https://github.com/mafintosh) - - **Mathias Buus** \ (he/him) + **Zijian Liu** <> (he/him) +* [marsonya](https://github.com/marsonya) - + **Akhil Marsonya** <> (he/him) * [mcollina](https://github.com/mcollina) - - **Matteo Collina** \ (he/him) + **Matteo Collina** <> (he/him) +* [meixg](https://github.com/meixg) - + **Xuguang Mei** <> (he/him) +* [Mesteery](https://github.com/Mesteery) - + **Mestery** <> (he/him) * [mhdawson](https://github.com/mhdawson) - - **Michael Dawson** \ (he/him) + **Michael Dawson** <> (he/him) * [miladfarca](https://github.com/miladfarca) - - **Milad Fa** \ (he/him) + **Milad Fa** <> (he/him) * [mildsunrise](https://github.com/mildsunrise) - - **Alba Mendez** \ (she/her) -* [mmarchini](https://github.com/mmarchini) - - **Mary Marchini** \ (she/her) + **Alba Mendez** <> (she/her) +* [MoLow](https://github.com/MoLow) - + **Moshe Atlow** <> (he/him) * [mscdex](https://github.com/mscdex) - - **Brian White** \ + **Brian White** <> * [MylesBorins](https://github.com/MylesBorins) - - **Myles Borins** \ (he/him) + **Myles Borins** <> (he/him) * [oyyd](https://github.com/oyyd) - - **Ouyang Yadong** \ (he/him) + **Ouyang Yadong** <> (he/him) * [panva](https://github.com/panva) - - **Filip Skokan** \ -* [PoojaDurgad](https://github.com/PoojaDurgad) - - **Pooja D P** \ (she/her) + **Filip Skokan** <> (he/him) * [puzpuzpuz](https://github.com/puzpuzpuz) - - **Andrey Pechkurov** \ (he/him) + **Andrey Pechkurov** <> (he/him) * [Qard](https://github.com/Qard) - - **Stephen Belanger** \ (he/him) + **Stephen Belanger** <> (he/him) +* [RafaelGSS](https://github.com/RafaelGSS) - + **Rafael Gonzaga** <> (he/him) * [RaisinTen](https://github.com/RaisinTen) - - **Darshan Sen** \ (he/him) -* [rexagod](https://github.com/rexagod) - - **Pranshu Srivastava** \ (he/him) + **Darshan Sen** <> (he/him) * [richardlau](https://github.com/richardlau) - - **Richard Lau** \ + **Richard Lau** <> * [rickyes](https://github.com/rickyes) - - **Ricky Zhou** \<0x19951125@gmail.com> (he/him) + **Ricky Zhou** <<0x19951125@gmail.com>> (he/him) * [ronag](https://github.com/ronag) - - **Robert Nagy** \ + **Robert Nagy** <> * [ruyadorno](https://github.com/ruyadorno) - - **Ruy Adorno** \ (he/him) + **Ruy Adorno** <> (he/him) * [rvagg](https://github.com/rvagg) - - **Rod Vagg** \ + **Rod Vagg** <> * [ryzokuken](https://github.com/ryzokuken) - - **Ujjwal Sharma** \ (he/him) + **Ujjwal Sharma** <> (he/him) * [santigimeno](https://github.com/santigimeno) - - **Santiago Gimeno** \ -* [seishun](https://github.com/seishun) - - **Nikolai Vavilov** \ + **Santiago Gimeno** <> * [shisama](https://github.com/shisama) - - **Masashi Hirano** \ (he/him) -* [silverwind](https://github.com/silverwind) - - **Roman Reiss** \ + **Masashi Hirano** <> (he/him) +* [ShogunPanda](https://github.com/ShogunPanda) - + **Paolo Insogna** <> (he/him) * [srl295](https://github.com/srl295) - - **Steven R Loomis** \ + **Steven R Loomis** <> * [starkwang](https://github.com/starkwang) - - **Weijia Wang** \ + **Weijia Wang** <> * [sxa](https://github.com/sxa) - - **Stewart X Addison** \ (he/him) + **Stewart X Addison** <> (he/him) * [targos](https://github.com/targos) - - **Michaël Zasso** \ (he/him) + **Michaël Zasso** <> (he/him) +* [theanarkh](https://github.com/theanarkh) - + **theanarkh** <> (he/him) * [TimothyGu](https://github.com/TimothyGu) - - **Tiancheng "Timothy" Gu** \ (he/him) + **Tiancheng "Timothy" Gu** <> (he/him) * [tniessen](https://github.com/tniessen) - - **Tobias Nießen** \ (he/him) + **Tobias Nießen** <> (he/him) * [trivikr](https://github.com/trivikr) - - **Trivikram Kamat** \ + **Trivikram Kamat** <> * [Trott](https://github.com/Trott) - - **Rich Trott** \ (he/him) + **Rich Trott** <> (he/him) * [vdeturckheim](https://github.com/vdeturckheim) - - **Vladimir de Turckheim** \ (he/him) -* [VoltrexMaster](https://github.com/VoltrexMaster) - - **Voltrex** \ (he/him) + **Vladimir de Turckheim** <> (he/him) +* [VoltrexKeyva](https://github.com/VoltrexKeyva) - + **Mohammed Keyvanzadeh** <> (he/him) * [watilde](https://github.com/watilde) - - **Daijiro Wachi** \ (he/him) -* [watson](https://github.com/watson) - - **Thomas Watson** \ + **Daijiro Wachi** <> (he/him) * [XadillaX](https://github.com/XadillaX) - - **Khaidi Chu** \ (he/him) + **Khaidi Chu** <> (he/him) * [yashLadha](https://github.com/yashLadha) - - **Yash Ladha** \ (he/him) -* [yosuke-furukawa](https://github.com/yosuke-furukawa) - - **Yosuke Furukawa** \ + **Yash Ladha** <> (he/him) * [ZYSzys](https://github.com/ZYSzys) - - **Yongsheng Zhang** \ (he/him) + **Yongsheng Zhang** <> (he/him)
@@ -469,258 +472,343 @@ For information about the governance of the Node.js project, see ### Collaborator emeriti +* [ak239](https://github.com/ak239) - + **Aleksei Koziatinskii** <> * [andrasq](https://github.com/andrasq) - - **Andras** \ + **Andras** <> * [AnnaMag](https://github.com/AnnaMag) - - **Anna M. Kedzierska** \ + **Anna M. Kedzierska** <> * [AndreasMadsen](https://github.com/AndreasMadsen) - - **Andreas Madsen** \ (he/him) + **Andreas Madsen** <> (he/him) * [aqrln](https://github.com/aqrln) - - **Alexey Orlenko** \ (he/him) + **Alexey Orlenko** <> (he/him) * [bmeurer](https://github.com/bmeurer) - - **Benedikt Meurer** \ -* [bnoordhuis](https://github.com/bnoordhuis) - - **Ben Noordhuis** \ + **Benedikt Meurer** <> +* [boneskull](https://github.com/boneskull) - + **Christopher Hiller** <> (he/him) * [brendanashworth](https://github.com/brendanashworth) - - **Brendan Ashworth** \ + **Brendan Ashworth** <> +* [bzoz](https://github.com/bzoz) - + **Bartosz Sosnowski** <> * [calvinmetcalf](https://github.com/calvinmetcalf) - - **Calvin Metcalf** \ + **Calvin Metcalf** <> * [chrisdickinson](https://github.com/chrisdickinson) - - **Chris Dickinson** \ + **Chris Dickinson** <> * [claudiorodriguez](https://github.com/claudiorodriguez) - - **Claudio Rodriguez** \ + **Claudio Rodriguez** <> * [DavidCai1993](https://github.com/DavidCai1993) - - **David Cai** \ (he/him) + **David Cai** <> (he/him) +* [davisjam](https://github.com/davisjam) - + **Jamie Davis** <> (he/him) * [digitalinfinity](https://github.com/digitalinfinity) - - **Hitesh Kanwathirtha** \ (he/him) + **Hitesh Kanwathirtha** <> (he/him) +* [dmabupt](https://github.com/dmabupt) - + **Xu Meng** <> (he/him) +* [dnlup](https://github.com/dnlup) + **dnlup** <> * [eljefedelrodeodeljefe](https://github.com/eljefedelrodeodeljefe) - - **Robert Jefe Lindstaedt** \ + **Robert Jefe Lindstaedt** <> * [estliberitas](https://github.com/estliberitas) - - **Alexander Makarenko** \ + **Alexander Makarenko** <> +* [eugeneo](https://github.com/eugeneo) - + **Eugene Ostroukhov** <> * [firedfox](https://github.com/firedfox) - - **Daniel Wang** \ + **Daniel Wang** <> * [Fishrock123](https://github.com/Fishrock123) - - **Jeremiah Senkpiel** \ (he/they) + **Jeremiah Senkpiel** <> (he/they) * [gdams](https://github.com/gdams) - - **George Adams** \ (he/him) + **George Adams** <> (he/him) * [geek](https://github.com/geek) - - **Wyatt Preul** \ + **Wyatt Preul** <> * [gibfahn](https://github.com/gibfahn) - - **Gibson Fahnestock** \ (he/him) + **Gibson Fahnestock** <> (he/him) * [glentiki](https://github.com/glentiki) - - **Glen Keane** \ (he/him) + **Glen Keane** <> (he/him) +* [hashseed](https://github.com/hashseed) - + **Yang Guo** <> (he/him) +* [hiroppy](https://github.com/hiroppy) - + **Yuta Hiroto** <> (he/him) * [iarna](https://github.com/iarna) - - **Rebecca Turner** \ + **Rebecca Turner** <> * [imran-iq](https://github.com/imran-iq) - - **Imran Iqbal** \ + **Imran Iqbal** <> * [imyller](https://github.com/imyller) - - **Ilkka Myller** \ + **Ilkka Myller** <> * [isaacs](https://github.com/isaacs) - - **Isaac Z. Schlueter** \ + **Isaac Z. Schlueter** <> * [italoacasas](https://github.com/italoacasas) - - **Italo A. Casas** \ (he/him) + **Italo A. Casas** <> (he/him) * [jasongin](https://github.com/jasongin) - - **Jason Ginchereau** \ + **Jason Ginchereau** <> * [jbergstroem](https://github.com/jbergstroem) - - **Johan Bergström** \ + **Johan Bergström** <> * [jdalton](https://github.com/jdalton) - - **John-David Dalton** \ + **John-David Dalton** <> * [jhamhader](https://github.com/jhamhader) - - **Yuval Brik** \ + **Yuval Brik** <> +* [joaocgreis](https://github.com/joaocgreis) - + **João Reis** <> * [joshgav](https://github.com/joshgav) - - **Josh Gavant** \ + **Josh Gavant** <> * [julianduque](https://github.com/julianduque) - - **Julian Duque** \ (he/him) + **Julian Duque** <> (he/him) * [kfarnung](https://github.com/kfarnung) - - **Kyle Farnung** \ (he/him) + **Kyle Farnung** <> (he/him) * [kunalspathak](https://github.com/kunalspathak) - - **Kunal Pathak** \ + **Kunal Pathak** <> * [lance](https://github.com/lance) - - **Lance Ball** \ (he/him) + **Lance Ball** <> (he/him) * [lucamaraschi](https://github.com/lucamaraschi) - - **Luca Maraschi** \ (he/him) + **Luca Maraschi** <> (he/him) +* [lundibundi](https://github.com/lundibundi) - + **Denys Otrishko** <> (he/him) * [lxe](https://github.com/lxe) - - **Aleksey Smolenchuk** \ + **Aleksey Smolenchuk** <> * [maclover7](https://github.com/maclover7) - - **Jon Moss** \ (he/him) + **Jon Moss** <> (he/him) +* [mafintosh](https://github.com/mafintosh) - + **Mathias Buus** <> (he/him) * [matthewloring](https://github.com/matthewloring) - - **Matthew Loring** \ + **Matthew Loring** <> * [micnic](https://github.com/micnic) - - **Nicu Micleușanu** \ (he/him) + **Nicu Micleușanu** <> (he/him) * [mikeal](https://github.com/mikeal) - - **Mikeal Rogers** \ + **Mikeal Rogers** <> * [misterdjules](https://github.com/misterdjules) - - **Julien Gilli** \ + **Julien Gilli** <> +* [mmarchini](https://github.com/mmarchini) - + **Mary Marchini** <> (she/her) * [monsanto](https://github.com/monsanto) - - **Christopher Monsanto** \ + **Christopher Monsanto** <> * [MoonBall](https://github.com/MoonBall) - - **Chen Gang** \ + **Chen Gang** <> * [not-an-aardvark](https://github.com/not-an-aardvark) - - **Teddy Katz** \ (he/him) + **Teddy Katz** <> (he/him) * [ofrobots](https://github.com/ofrobots) - - **Ali Ijaz Sheikh** \ (he/him) + **Ali Ijaz Sheikh** <> (he/him) * [Olegas](https://github.com/Olegas) - - **Oleg Elifantiev** \ + **Oleg Elifantiev** <> * [orangemocha](https://github.com/orangemocha) - - **Alexis Campailla** \ + **Alexis Campailla** <> * [othiym23](https://github.com/othiym23) - - **Forrest L Norvell** \ (they/them/themself) + **Forrest L Norvell** <> (they/them/themself) * [petkaantonov](https://github.com/petkaantonov) - - **Petka Antonov** \ + **Petka Antonov** <> * [phillipj](https://github.com/phillipj) - - **Phillip Johnsen** \ + **Phillip Johnsen** <> * [piscisaureus](https://github.com/piscisaureus) - - **Bert Belder** \ + **Bert Belder** <> * [pmq20](https://github.com/pmq20) - - **Minqi Pan** \ + **Minqi Pan** <> +* [PoojaDurgad](https://github.com/PoojaDurgad) - + **Pooja D P** <> (she/her) * [princejwesley](https://github.com/princejwesley) - - **Prince John Wesley** \ + **Prince John Wesley** <> * [psmarshall](https://github.com/psmarshall) - - **Peter Marshall** \ (he/him) + **Peter Marshall** <> (he/him) * [refack](https://github.com/refack) - - **Refael Ackermann (רפאל פלחי)** \ (he/him/הוא/אתה) + **Refael Ackermann (רפאל פלחי)** <> (he/him/הוא/אתה) +* [rexagod](https://github.com/rexagod) - + **Pranshu Srivastava** <> (he/him) * [rlidwka](https://github.com/rlidwka) - - **Alex Kocharin** \ + **Alex Kocharin** <> * [rmg](https://github.com/rmg) - - **Ryan Graham** \ + **Ryan Graham** <> * [robertkowalski](https://github.com/robertkowalski) - - **Robert Kowalski** \ + **Robert Kowalski** <> * [romankl](https://github.com/romankl) - - **Roman Klauke** \ + **Roman Klauke** <> * [ronkorving](https://github.com/ronkorving) - - **Ron Korving** \ + **Ron Korving** <> * [RReverser](https://github.com/RReverser) - - **Ingvar Stepanyan** \ + **Ingvar Stepanyan** <> * [rubys](https://github.com/rubys) - - **Sam Ruby** \ + **Sam Ruby** <> * [saghul](https://github.com/saghul) - - **Saúl Ibarra Corretgé** \ + **Saúl Ibarra Corretgé** <> * [sam-github](https://github.com/sam-github) - - **Sam Roberts** \ + **Sam Roberts** <> * [sebdeckers](https://github.com/sebdeckers) - - **Sebastiaan Deckers** \ + **Sebastiaan Deckers** <> +* [seishun](https://github.com/seishun) - + **Nikolai Vavilov** <> * [shigeki](https://github.com/shigeki) - - **Shigeki Ohtsu** \ (he/him) + **Shigeki Ohtsu** <> (he/him) +* [silverwind](https://github.com/silverwind) - + **Roman Reiss** <> * [stefanmb](https://github.com/stefanmb) - - **Stefan Budeanu** \ + **Stefan Budeanu** <> * [tellnes](https://github.com/tellnes) - - **Christian Tellnes** \ + **Christian Tellnes** <> * [thefourtheye](https://github.com/thefourtheye) - - **Sakthipriyan Vairamani** \ (he/him) + **Sakthipriyan Vairamani** <> (he/him) * [thlorenz](https://github.com/thlorenz) - - **Thorsten Lorenz** \ + **Thorsten Lorenz** <> * [trevnorris](https://github.com/trevnorris) - - **Trevor Norris** \ + **Trevor Norris** <> * [tunniclm](https://github.com/tunniclm) - - **Mike Tunnicliffe** \ + **Mike Tunnicliffe** <> * [vkurchatkin](https://github.com/vkurchatkin) - - **Vladimir Kurchatkin** \ + **Vladimir Kurchatkin** <> * [vsemozhetbyt](https://github.com/vsemozhetbyt) - - **Vse Mozhet Byt** \ (he/him) + **Vse Mozhet Byt** <> (he/him) +* [watson](https://github.com/watson) - + **Thomas Watson** <> * [whitlockjc](https://github.com/whitlockjc) - - **Jeremy Whitlock** \ + **Jeremy Whitlock** <> * [yhwang](https://github.com/yhwang) - - **Yihong Wang** \ + **Yihong Wang** <> * [yorkie](https://github.com/yorkie) - - **Yorkie Liu** \ + **Yorkie Liu** <> +* [yosuke-furukawa](https://github.com/yosuke-furukawa) - + **Yosuke Furukawa** <>
+ -Collaborators follow the [Collaborator Guide](./doc/guides/collaborator-guide.md) in +Collaborators follow the [Collaborator Guide](./doc/contributing/collaborator-guide.md) in maintaining the Node.js project. ### Triagers * [Ayase-252](https://github.com/Ayase-252) - - **Qingyu Deng** \ + **Qingyu Deng** <> +* [bmuenzenmeyer](https://github.com/bmuenzenmeyer) - + **Brian Muenzenmeyer** <> (he/him) +* [daeyeon](https://github.com/daeyeon) - + **Daeyeon Jeong** <> (he/him) +* [F3n67u](https://github.com/F3n67u) - + **Feng Yu** <> (he/him) * [himadriganguly](https://github.com/himadriganguly) - - **Himadri Ganguly** \ (he/him) + **Himadri Ganguly** <> (he/him) * [iam-frankqiu](https://github.com/iam-frankqiu) - - **Frank Qiu** \ (he/him) + **Frank Qiu** <> (he/him) +* [kvakil](https://github.com/kvakil) - + **Keyhan Vakil** <> (they/them) * [marsonya](https://github.com/marsonya) - - **Akhil Marsonya** \ (he/him) + **Akhil Marsonya** <> (he/him) +* [meixg](https://github.com/meixg) - + **Xuguang Mei** <> (he/him) * [Mesteery](https://github.com/Mesteery) - - **Mestery** \ + **Mestery** <> (he/him) +* [MoLow](https://github.com/MoLow) - + **Moshe Atlow** <> (he/him) * [PoojaDurgad](https://github.com/PoojaDurgad) - - **Pooja Durgad** \ + **Pooja Durgad** <> * [RaisinTen](https://github.com/RaisinTen) - - **Darshan Sen** \ -* [VoltrexMaster](https://github.com/VoltrexMaster) - - **Voltrex** \ (he/him) + **Darshan Sen** <> +* [VoltrexKeyva](https://github.com/VoltrexKeyva) - + **Mohammed Keyvanzadeh** <> (he/him) + +Triagers follow the [Triage Guide](./doc/contributing/issues.md#triaging-a-bug-report) when +responding to new issues. ### Release keys Primary GPG keys for Node.js Releasers (some Releasers sign with subkeys): -* **Beth Griggs** \ +* **Beth Griggs** <> `4ED778F539E3634C779C87C6D7062848A1AB005C` -* **Colin Ihrig** \ - `94AE36675C464D64BAFA68DD7434390BDBE9B9C5` -* **Danielle Adams** \ +* **Bryan English** <> + `141F07595B7B3FFE74309A937405533BE57C7D57` +* **Danielle Adams** <> `74F12602B6F1C4E913FAA37AD3A89613643B6201` -* **James M Snell** \ - `71DCFD284A79C3B38668286BC97EC7A07EDE3FC1` -* **Michaël Zasso** \ +* **Michaël Zasso** <> `8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600` -* **Myles Borins** \ +* **Myles Borins** <> `C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8` -* **Richard Lau** \ +* **RafaelGSS** <> + `890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4` +* **Richard Lau** <> `C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C` -* **Rod Vagg** \ - `DD8F2338BAE7501E3DD5AC78C273792F7D83545D` -* **Ruben Bridgewater** \ - `A48C2BEE680E841632CD4E44F07496B3EB3C1762` -* **Ruy Adorno** \ +* **Ruy Adorno** <> `108F52B48DB57BB0CC439B2997B01419BD92F80A` -* **Shelley Vohr** \ - `B9E2F5981AA6E0CD28160D9FF13993A75599653C` To import the full set of trusted release keys (including subkeys possibly used to sign releases): ```bash -gpg --keyserver pool.sks-keyservers.net --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C -gpg --keyserver pool.sks-keyservers.net --recv-keys 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 -gpg --keyserver pool.sks-keyservers.net --recv-keys 74F12602B6F1C4E913FAA37AD3A89613643B6201 -gpg --keyserver pool.sks-keyservers.net --recv-keys 71DCFD284A79C3B38668286BC97EC7A07EDE3FC1 -gpg --keyserver pool.sks-keyservers.net --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 -gpg --keyserver pool.sks-keyservers.net --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 -gpg --keyserver pool.sks-keyservers.net --recv-keys C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C -gpg --keyserver pool.sks-keyservers.net --recv-keys DD8F2338BAE7501E3DD5AC78C273792F7D83545D -gpg --keyserver pool.sks-keyservers.net --recv-keys A48C2BEE680E841632CD4E44F07496B3EB3C1762 -gpg --keyserver pool.sks-keyservers.net --recv-keys 108F52B48DB57BB0CC439B2997B01419BD92F80A -gpg --keyserver pool.sks-keyservers.net --recv-keys B9E2F5981AA6E0CD28160D9FF13993A75599653C +gpg --keyserver hkps://keys.openpgp.org --recv-keys 4ED778F539E3634C779C87C6D7062848A1AB005C +gpg --keyserver hkps://keys.openpgp.org --recv-keys 141F07595B7B3FFE74309A937405533BE57C7D57 +gpg --keyserver hkps://keys.openpgp.org --recv-keys 74F12602B6F1C4E913FAA37AD3A89613643B6201 +gpg --keyserver hkps://keys.openpgp.org --recv-keys 8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 +gpg --keyserver hkps://keys.openpgp.org --recv-keys C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 +gpg --keyserver hkps://keys.openpgp.org --recv-keys 890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 +gpg --keyserver hkps://keys.openpgp.org --recv-keys C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C +gpg --keyserver hkps://keys.openpgp.org --recv-keys 108F52B48DB57BB0CC439B2997B01419BD92F80A ``` -See the section above on [Verifying Binaries](#verifying-binaries) for how to -use these keys to verify a downloaded file. +See [Verifying binaries](#verifying-binaries) for how to use these keys to +verify a downloaded file.
Other keys used to sign some previous releases -* **Chris Dickinson** \ +* **Chris Dickinson** <> `9554F04D7259F04124DE6B476D5A82AC7E37093B` -* **Danielle Adams** \ +* **Colin Ihrig** <> + `94AE36675C464D64BAFA68DD7434390BDBE9B9C5` +* **Danielle Adams** <> `1C050899334244A8AF75E53792EF661D867B9DFA` -* **Evan Lucas** \ +* **Evan Lucas** <> `B9AE9905FFD7803F25714661B63B535A4C206CA9` -* **Gibson Fahnestock** \ +* **Gibson Fahnestock** <> `77984A986EBC2AA786BC0F66B01FBB92821C587A` -* **Isaac Z. Schlueter** \ +* **Isaac Z. Schlueter** <> `93C7E9E91B49E432C2F75674B0A78B0A6C481CF6` -* **Italo A. Casas** \ +* **Italo A. Casas** <> `56730D5401028683275BD23C23EFEFE93C4CFFFE` -* **Jeremiah Senkpiel** \ +* **James M Snell** <> + `71DCFD284A79C3B38668286BC97EC7A07EDE3FC1` +* **Jeremiah Senkpiel** <> `FD3A5288F042B6850C66B31F09FE44734EB7990E` -* **Julien Gilli** \ +* **Juan José Arboleda** <> + `61FC681DFB92A079F1685E77973F295594EC4689` +* **Julien Gilli** <> `114F43EE0176B71C7BC219DD50A3051F888C628D` -* **Timothy J Fontaine** \ +* **Rod Vagg** <> + `DD8F2338BAE7501E3DD5AC78C273792F7D83545D` +* **Ruben Bridgewater** <> + `A48C2BEE680E841632CD4E44F07496B3EB3C1762` +* **Shelley Vohr** <> + `B9E2F5981AA6E0CD28160D9FF13993A75599653C` +* **Timothy J Fontaine** <> `7937DFD2AB06298B2293C3187D33FF9D0246406D`
+### Security release stewards + +When possible, the commitment to take slots in the +security release steward rotation is made by companies in order +to ensure individuals who act as security stewards have the +support and recognition from their employer to be able to +prioritize security releases. Security release stewards manage security +releases on a rotation basis as outlined in the +[security release process](./doc/contributing/security-release-process.md). + +* Datadog + * [bengl](https://github.com/bengl) - + **Bryan English** <> (he/him) + * [vdeturckheim](https://github.com/vdeturckheim) - + **Vladimir de Turckheim** <> (he/him) +* NearForm + * [RafaelGSS](https://github.com/RafaelGSS) - + **Rafael Gonzaga** <> (he/him) +* NodeSource + * [juanarbol](https://github.com/juanarbol) - + **Juan José Arboleda** <> (he/him) +* Platformatic + * [mcollina](https://github.com/mcollina) - + **Matteo Collina** <> (he/him) +* Red Hat and IBM + * [joesepi](https://github.com/joesepi) - + **Joe Sepi** <> (he/him) + * [mhdawson](https://github.com/mhdawson) - + **Michael Dawson** <> (he/him) + ## License Node.js is available under the @@ -731,8 +819,8 @@ license text. [Code of Conduct]: https://github.com/nodejs/admin/blob/HEAD/CODE_OF_CONDUCT.md [Contributing to the project]: CONTRIBUTING.md -[Node.js Website]: https://nodejs.org/ +[Node.js website]: https://nodejs.org/ [OpenJS Foundation]: https://openjsf.org/ -[Strategic initiatives]: doc/guides/strategic-initiatives.md -[Technical values and prioritization]: doc/guides/technical-values.md +[Strategic initiatives]: doc/contributing/strategic-initiatives.md +[Technical values and prioritization]: doc/contributing/technical-values.md [Working Groups]: https://github.com/nodejs/TSC/blob/HEAD/WORKING_GROUPS.md diff --git a/developer/src/inst/node/dist/node.exe b/developer/src/inst/node/dist/node.exe index 06cc8d58937d8f43a89fd4bfb5407620182a35f4..0c737e1d110183412152735cd5e4b53931135f2b 100644 Binary files a/developer/src/inst/node/dist/node.exe and b/developer/src/inst/node/dist/node.exe differ diff --git a/developer/src/inst/node/kmc.cmd b/developer/src/inst/node/kmc.cmd new file mode 100644 index 0000000000000000000000000000000000000000..c1ac96270f772c53c9ad357acc332e870d37f48f --- /dev/null +++ b/developer/src/inst/node/kmc.cmd @@ -0,0 +1,4 @@ +@rem This script avoids path dependencies for node for distribution +@rem with Keyman Developer. When used on platforms other than Windows, +@rem node can be used directly with the compiler (`npm link` will setup). +@"%~dp0\node.js\node.exe" --enable-source-maps "%~dp0\kmc\kmc.cjs" %* diff --git a/developer/src/inst/node/kmlmc.cmd b/developer/src/inst/node/kmlmc.cmd index a2d6a012e92103641b05e19384e6021bf8c2dcf8..81b87c0f9efabff3dec9270b612af20b5228fe22 100644 --- a/developer/src/inst/node/kmlmc.cmd +++ b/developer/src/inst/node/kmlmc.cmd @@ -1,4 +1,4 @@ @rem This script avoids path dependencies for node for distribution @rem with Keyman Developer. When used on platforms other than Windows, @rem node can be used directly with the compiler (`npm link` will setup). -@"%~dp0\node.js\node.exe" "%~dp0\ModelCompiler\dist\kmlmc.js" %* +@"%~dp0\node.js\node.exe" --enable-source-maps "%~dp0\kmc\kmlmc.cjs" %* diff --git a/developer/src/inst/node/kmlmi.cmd b/developer/src/inst/node/kmlmi.cmd index fe8c4457de9f0bd1777bc5c7aea518c30a43d780..c02a72891c5e6d4080a9e5407b0bcdee4ca0141c 100644 --- a/developer/src/inst/node/kmlmi.cmd +++ b/developer/src/inst/node/kmlmi.cmd @@ -1,4 +1,4 @@ @rem This script avoids path dependencies for node for distribution @rem with Keyman Developer. When used on platforms other than Windows, @rem node can be used directly with the compiler (`npm link` will setup). -@"%~dp0\node.js\node.exe" "%~dp0\ModelCompiler\dist\kmlmi.js" %* +@"%~dp0\node.js\node.exe" --enable-source-maps "%~dp0\kmc\kmlmi.cjs" %* diff --git a/developer/src/inst/node/kmlmp.cmd b/developer/src/inst/node/kmlmp.cmd index 7eeb0c25860f5c2fd6adbc814eaa99cb8fe6feff..8994cf4db35adac1e4ea8cad88f07286e08a2fb0 100644 --- a/developer/src/inst/node/kmlmp.cmd +++ b/developer/src/inst/node/kmlmp.cmd @@ -1,4 +1,4 @@ @rem This script avoids path dependencies for node for distribution @rem with Keyman Developer. When used on platforms other than Windows, @rem node can be used directly with the compiler (`npm link` will setup). -@"%~dp0\node.js\node.exe" "%~dp0\ModelCompiler\dist\kmlmp.js" %* +@"%~dp0\node.js\node.exe" --enable-source-maps "%~dp0\kmc\kmlmp.cjs" %* diff --git a/developer/src/kmanalyze/kmanalyze.cpp b/developer/src/kmanalyze/kmanalyze.cpp index 6feebfb5c491574a57a3806299e064f9fcb949d3..579f85e0de4861627eea5ec80ec1b9a4a62a761d 100644 --- a/developer/src/kmanalyze/kmanalyze.cpp +++ b/developer/src/kmanalyze/kmanalyze.cpp @@ -2,7 +2,6 @@ // #include "pch.h" -#include "../../../common/windows/cpp/include/crc32.h" #include "../../../common/windows/cpp/include/keymanversion.h" #include #include @@ -11,7 +10,6 @@ BOOL LoadKeyboard(LPSTR fileName, LPKEYBOARD *lpKeyboard); -BOOL VerifyChecksum(LPBYTE buf, LPDWORD CheckSum, DWORD sz); void Err(const char *p); int DoKeyboardAnalysis(LPKEYBOARD kbd, char *keyboardID, char *keyboardJSFilename, char *outputfilename); void MapVirtualKeys(void); @@ -154,26 +152,22 @@ BOOL LoadKeyboard(LPSTR fileName, LPKEYBOARD *lpKeyboard) if (ckbp->dwFileVersion < VERSION_MIN || ckbp->dwFileVersion > VERSION_MAX) { - /* Old or new version -- identify the desired program version */ - if (VerifyChecksum(buf, &kbp->dwCheckSum, sz)) - { - kbp->dpStoreArray = (LPSTORE)(buf + ckbp->dpStoreArray); - for (sp = kbp->dpStoreArray, i = 0; i < kbp->cxStoreArray; i++, sp++) - if (sp->dwSystemID == TSS_COMPILEDVERSION) - { - char buf2[256]; - wsprintf(buf2, "Wrong File Version: file version is %ls", ((PBYTE)kbp) + (INT_PTR)sp->dpString); - delete buf; - Err(buf2); - return FALSE; - } + kbp->dpStoreArray = (LPSTORE)(buf + ckbp->dpStoreArray); + for (sp = kbp->dpStoreArray, i = 0; i < kbp->cxStoreArray; i++, sp++) { + if (sp->dwSystemID == TSS_COMPILEDVERSION) + { + char buf2[256]; + wsprintf(buf2, "Wrong File Version: file version is %ls", ((PBYTE)kbp) + (INT_PTR)sp->dpString); + delete buf; + Err(buf2); + return FALSE; + } } - delete buf; Err("Unknown File Version: try using the latest version of KMDECOMP"); + delete buf; + Err("Unknown File Version: try using the latest version of KMDECOMP"); return FALSE; } - if (!VerifyChecksum(buf, &kbp->dwCheckSum, sz)) { delete buf; Err("Bad Checksum in file"); return FALSE; } - kbp->dpStoreArray = (LPSTORE)(buf + ckbp->dpStoreArray); kbp->dpGroupArray = (LPGROUP)(buf + ckbp->dpGroupArray); @@ -207,17 +201,6 @@ BOOL LoadKeyboard(LPSTR fileName, LPKEYBOARD *lpKeyboard) return TRUE; } -BOOL VerifyChecksum(LPBYTE buf, LPDWORD CheckSum, DWORD sz) -{ - DWORD tempcs; - - tempcs = *CheckSum; - *CheckSum = 0; - - BuildCRCTable(); - return tempcs == CalculateBufferCRC(sz, buf); -} - //void DoContextAnalysis(LPKEYBOARD kbd, GROUPTREE *gpref, std::vector tree, LPKEY kp, PWCHAR pc, GROUPREFTYPE type) { //} diff --git a/developer/src/kmanalyze/kmanalyze.vcxproj b/developer/src/kmanalyze/kmanalyze.vcxproj index 4897b0e214fd8132370faa8da82c780ffe8b9285..20fd857a3526f7e232c2fa11944d3cffde29f8a8 100644 --- a/developer/src/kmanalyze/kmanalyze.vcxproj +++ b/developer/src/kmanalyze/kmanalyze.vcxproj @@ -185,7 +185,6 @@ - NotUsing NotUsing diff --git a/developer/src/kmanalyze/kmanalyze.vcxproj.filters b/developer/src/kmanalyze/kmanalyze.vcxproj.filters index 4e289235dd902fc9ccc5fc7ee4bc7d751d354d4f..14f27f1cfebdd9bc4211b2204701bbef3b97a4fb 100644 --- a/developer/src/kmanalyze/kmanalyze.vcxproj.filters +++ b/developer/src/kmanalyze/kmanalyze.vcxproj.filters @@ -38,9 +38,6 @@ Source Files - - Source Files - Source Files diff --git a/developer/src/kmc-kmn/.eslintrc.cjs b/developer/src/kmc-kmn/.eslintrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..01dae6b737e69e50f7ece590cc3fa7716d70ed11 --- /dev/null +++ b/developer/src/kmc-kmn/.eslintrc.cjs @@ -0,0 +1,14 @@ +module.exports = { + parserOptions: { + project: ["./tsconfig.json", "./test/tsconfig.json"], + }, + overrides: [ + { + files:"src/**/*.ts", + // extends: ["../../../common/web/eslint/eslintNoNodeImports.js"], + } + ], + rules: { + "prefer-const": "off", // TODO: enable this once infrastructure is in place and cleanup the problem cases + }, +}; diff --git a/developer/src/kmc-kmn/.gitignore b/developer/src/kmc-kmn/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..6a608d487b85755178ab0c6f1367d719cdd61406 --- /dev/null +++ b/developer/src/kmc-kmn/.gitignore @@ -0,0 +1,3 @@ +# WASM interfaces from kmcmplib are copied here so we can avoid having +# to make tsc aware of debug vs release paths +src/import/ diff --git a/developer/src/kmc-kmn/Makefile b/developer/src/kmc-kmn/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..31ce8fcb9ca46bd8103dcdb74174eb46259a1948 --- /dev/null +++ b/developer/src/kmc-kmn/Makefile @@ -0,0 +1,37 @@ +# +# Keyman Developer - kmc kmn Compiler Makefile +# + +!include ..\Defines.mak + +build: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh build + +configure: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh configure + +clean: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh clean + +test: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh test + +# build.sh bundle must be run from shell as it requires a temp folder to be +# passed in. See inst/download.in.mak for instantiation. + +publish: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh publish + +signcode: + @rem nothing to do + +wrap-symbols: + @rem nothing to do + +test-manifest: + @rem nothing to do + +install: + @rem nothing to do + +!include ..\Target.mak diff --git a/developer/src/kmc-kmn/build.sh b/developer/src/kmc-kmn/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..8c57d71e984920db23b54dd6b18a0a07b17d52f1 --- /dev/null +++ b/developer/src/kmc-kmn/build.sh @@ -0,0 +1,82 @@ +#!/usr/bin/env bash +# +# Compiles the kmc-kmn keyboard compiler. +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +cd "$THIS_SCRIPT_PATH" + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +builder_describe "Build Keyman Developer Compiler Module for .kmn to .kmx" \ + "@/common/web/keyman-version" \ + "@/common/web/types" \ + "@/developer/src/common/web/test-helpers" \ + "@/developer/src/kmcmplib:wasm" \ + "configure" \ + "build" \ + "clean" \ + "test" \ + "pack build a local .tgz pack for testing" \ + "publish publish to npm" \ + "--dry-run,-n don't actually publish, just dry run" + +builder_describe_outputs \ + configure /node_modules \ + build /developer/src/kmc-kmn/build/src/main.js + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action clean; then + rm -rf ./build/ ./tsconfig.tsbuildinfo + builder_finish_action success clean +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action configure; then + verify_npm_setup + builder_finish_action success configure +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action build; then + mkdir -p build/src/import/kmcmplib + mkdir -p src/import/kmcmplib + cp ../kmcmplib/build/wasm/$BUILDER_CONFIGURATION/src/wasm-host.js ./src/import/kmcmplib/wasm-host.js + cp ../kmcmplib/build/wasm/$BUILDER_CONFIGURATION/src/wasm-host.wasm ./build/src/import/kmcmplib/wasm-host.wasm + tsc --build + builder_finish_action success build +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action test; then + tsc --build test/ + npm run lint + c8 --reporter=lcov --reporter=text mocha "${builder_extra_params[@]}" + builder_finish_action success test +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action publish; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_npm + builder_finish_action success publish +elif builder_start_action pack; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_pack + builder_finish_action success pack +fi diff --git a/developer/src/kmc-kmn/package.json b/developer/src/kmc-kmn/package.json new file mode 100644 index 0000000000000000000000000000000000000000..108ce2564b7c0fda78d11170d0045b25153c8f4d --- /dev/null +++ b/developer/src/kmc-kmn/package.json @@ -0,0 +1,71 @@ +{ + "name": "@keymanapp/kmc-kmn", + "description": "Keyman Developer Compiler Module for .kmn to .kmx", + "keywords": [ + "keyboard", + "keyman", + "kmn", + "kmx", + "unicode" + ], + "type": "module", + "exports": { + ".": "./build/src/main.js" + }, + "files": [ + "/build/src/" + ], + "scripts": { + "build": "tsc -b", + "lint": "eslint .", + "test": "npm run lint && cd test && tsc -b && cd .. && c8 --reporter=lcov --reporter=text mocha", + "prepublishOnly": "npm run build" + }, + "author": "Marc Durdin (https://github.com/mcdurdin)", + "license": "MIT", + "bugs": { + "url": "https://github.com/keymanapp/keyman/issues" + }, + "dependencies": { + "@keymanapp/keyman-version": "*" + }, + "devDependencies": { + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/semver": "^7.3.12", + "@types/sinon": "^10.0.13", + "@types/sinon-chai": "^3.2.9", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "mocha": "^8.4.0", + "sinon": "^15.0.2", + "sinon-chai": "^3.7.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5", + "@keymanapp/developer-test-helpers": "*" + }, + "mocha": { + "spec": "build/test/**/test-*.js", + "require": [ + "source-map-support/register" + ] + }, + "c8": { + "all": true, + "src": [ + "src/" + ], + "exclude-after-remap": true, + "exclude": [ + "src/import/", + "test/" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/keymanapp/keyman.git" + } +} diff --git a/developer/src/kmc-kmn/src/compiler/compiler.ts b/developer/src/kmc-kmn/src/compiler/compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..2f83e83aee43d243c7e1c35d5cc86f14fa068aaa --- /dev/null +++ b/developer/src/kmc-kmn/src/compiler/compiler.ts @@ -0,0 +1,245 @@ +/* +TODO: implement additional interfaces: + + extern "C" bool kmcmp_CompileKeyboardFileToBuffer( + char* pszInfile, + void* pfkBuffer, + bool ACompilerWarningsAsErrors, + bool AWarnDeprecatedCode, + kmcmp_CompilerMessageProc pMsgproc, + void* AmsgprocContext, + int Target + ); + + typedef bool (*kmcmp_ValidateJsonMessageProc)(int64_t offset, const char* szText, void* context); + + extern "C" bool kmcmp_ValidateJsonFile( + std::fstream& f, + std::fstream& fd, + kmcmp_ValidateJsonMessageProc MessageProc, + void* context + ); +*/ + +// TODO: rename wasm-host? +import { CompilerCallbacks, CompilerEvent } from '@keymanapp/common-types'; +import loadWasmHost from '../import/kmcmplib/wasm-host.js'; +import { CompilerMessages, mapErrorFromKmcmplib } from './messages.js'; + +export interface CompilerOptions { + shouldAddCompilerVersion?: boolean; + saveDebug?: boolean; + compilerWarningsAsErrors?: boolean; + warnDeprecatedCode?: boolean; +}; + +const baseOptions: CompilerOptions = { + shouldAddCompilerVersion: true, + saveDebug: true, + compilerWarningsAsErrors: false, + warnDeprecatedCode: true +}; + +/** + * Allows multiple instances of the Compiler class, by ensuring that the + * 'unique' kmnCompilerCallback global will be correlated with a specific + * instance of the Compiler class + */ +let callbackProcIdentifier = 0; + +/** + * Pointer in wasm-space + */ +type WasmPtr = number; + +/** + * The wrapped functions + */ +class WasmWrapper { + Module: any; + + compileKeyboardFile?: (pszInfile: string, pszOutfile: string, aSaveDebug: number, aCompilerWarningsAsErrors: number, aWarnDeprecatedCode: number, msgProc: string) => boolean; + parseUnicodeSet?: (pat: string, buf: WasmPtr, length: number) => number; + setCompilerOptions?: (shouldAddCompilerVersion: number) => boolean; + + constructor(wasmModule: any) { + this.Module = wasmModule; + if (!wasmModule) { + throw Error(`wasm host did not load`); + } + this.compileKeyboardFile = this.Module.cwrap('kmcmp_Wasm_CompileKeyboardFile', 'boolean', ['string', 'string', 'number', 'number', 'number', 'string']); + this.parseUnicodeSet = this.Module.cwrap('kmcmp_Wasm_ParseUnicodeSet', 'number', ['string', 'number', 'number']); + this.setCompilerOptions = this.Module.cwrap('kmcmp_Wasm_SetCompilerOptions', 'boolean', ['number']); + + if (this.parseUnicodeSet === undefined + || this.setCompilerOptions === undefined + || this.compileKeyboardFile === undefined) { + throw Error(`some wasm functions did not load properly.`); + } + } + + /** + * Entry point into Wasm functions + * @returns WasmWrapper + */ + public static async load() : Promise { + return new WasmWrapper(await loadWasmHost()); + } +}; + +export class KmnCompiler { + callbackName: string; + callbacks: CompilerCallbacks; + wasm: WasmWrapper; + + constructor() { + this.callbackName = 'kmnCompilerCallback' + callbackProcIdentifier; + callbackProcIdentifier++; + } + + public async init(callbacks: CompilerCallbacks): Promise { + this.callbacks = callbacks; + if(!this.wasm) { + try { + this.wasm = await WasmWrapper.load(); + } catch(e: any) { + this.callbacks.reportMessage(CompilerMessages.Fatal_MissingWasmModule({e})); + return false; + } + } + return this.verifyInitialized(); + } + + /** + * Verify that wasm is spun up OK. + * @returns true if OK + */ + public verifyInitialized() : boolean { + if(!this.callbacks) { + // Can't report a message here. + throw Error('Must call Compiler.init(callbacks) before proceeding'); + } + if(!this.wasm) { // fail if wasm not loaded or function not found + this.callbacks.reportMessage(CompilerMessages.Fatal_MissingWasmModule({})); + return false; + } + return true; + } + + public run(infile: string, outfile: string, options?: CompilerOptions): boolean { + if(!this.verifyInitialized()) { + return false; + } + + options = {...baseOptions, ...options}; + (globalThis as any)[this.callbackName] = this.compilerMessageCallback; + // TODO: use callbacks for file access -- so kmc-kmn is entirely fs agnostic + let result = this.runCompiler(infile, outfile, options); + delete (globalThis as any)[this.callbackName]; + return result; + } + + private compilerMessageCallback = (line: number, code: number, msg: string): number => { + this.callbacks.reportMessage(mapErrorFromKmcmplib(line, code, msg)); + return 1; + } + + private runCompiler(infile: string, outfile: string, options: CompilerOptions): boolean { + try { + if (!this.wasm.setCompilerOptions(options.shouldAddCompilerVersion ? 1 : 0)) { + this.callbacks.reportMessage(CompilerMessages.Fatal_UnableToSetCompilerOptions()); + } + return this.wasm.compileKeyboardFile( + infile, + outfile, + options.saveDebug ? 1 : 0, + options.compilerWarningsAsErrors ? 1 : 0, + options.warnDeprecatedCode ? 1 : 0, + this.callbackName); + } catch(e) { + this.callbacks.reportMessage(CompilerMessages.Fatal_UnexpectedException({e:e})); + return false; + } + } + + /** + * + * @param pattern UnicodeSet pattern such as `[a-z]` + * @param bufferSize guess as to the buffer size + * @returns UnicodeSet accessor object, or null on failure + */ + public parseUnicodeSet(pattern: string, bufferSize: number) : UnicodeSet | null { + if(!this.verifyInitialized()) { + return null; + } + + if (!bufferSize) { + bufferSize = 100; // TODO-LDML: Preflight mode? Reuse buffer? + } + const { Module } = this.wasm; + const buf = Module.asm.malloc(bufferSize * 2 * Module.HEAPU32.BYTES_PER_ELEMENT); + // TODO-LDML: Catch OOM + const rc = this.wasm.parseUnicodeSet(pattern, buf, bufferSize); + if (rc >= 0) { + const ranges = []; + const startu = (buf / Module.HEAPU32.BYTES_PER_ELEMENT); + for (let i = 0; i < rc; i++) { + const low = Module.HEAPU32[startu + (i * 2) + 0]; + const high = Module.HEAPU32[startu + (i * 2) + 1]; + ranges.push([low, high]); + } + // TODO-LDML: no free?? + // Module.asm.free(buf); + return new UnicodeSet(pattern, ranges); + } else { + // translate error + // TODO-LDML: no free?? + // Module.asm.free(buf); + this.callbacks.reportMessage(getUnicodeSetError(rc)); + return null; + } + } +} + +/** + * translate UnicodeSet return code into a compiler event + * @param rc parseUnicodeSet error code + * @returns the compiler event + */ +function getUnicodeSetError(rc: number) : CompilerEvent { + // from kmcmplib.h + const KMCMP_ERROR_SYNTAX_ERR = -1; + const KMCMP_ERROR_HAS_STRINGS = -2; + const KMCMP_ERROR_UNSUPPORTED_PROPERTY = -3; + const KMCMP_FATAL_OUT_OF_RANGE = -4; + switch(rc) { + case KMCMP_ERROR_SYNTAX_ERR: + return CompilerMessages.Error_UnicodeSetSyntaxError(); + case KMCMP_ERROR_HAS_STRINGS: + return CompilerMessages.Error_UnicodeSetHasStrings(); + case KMCMP_ERROR_UNSUPPORTED_PROPERTY: + return CompilerMessages.Error_UnicodeSetHasProperties(); + case KMCMP_FATAL_OUT_OF_RANGE: + return CompilerMessages.Fatal_UnicodeSetOutOfRange(); + default: + return CompilerMessages.Fatal_UnexpectedException({e: `Unexpected UnicodeSet error code ${rc}`}); + } +} + +/** + * Represents a parsed UnicodeSet + */ +export class UnicodeSet { + constructor(public pattern: string, public ranges: number[][]) { + } + /** + * Number of ranges + */ + get length() : number { + return this.ranges.length; + } + + toString() : string { + return this.pattern; + } +} diff --git a/developer/src/kmc-kmn/src/compiler/messages.ts b/developer/src/kmc-kmn/src/compiler/messages.ts new file mode 100644 index 0000000000000000000000000000000000000000..10578870d7c1499350936abe16981a503cc8167a --- /dev/null +++ b/developer/src/kmc-kmn/src/compiler/messages.ts @@ -0,0 +1,81 @@ +import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerEvent, CompilerMessageSpec as m, compilerExceptionToString as exc } from "@keymanapp/common-types"; + +const Namespace = CompilerErrorNamespace.KmnCompiler; +const SevInfo = CompilerErrorSeverity.Info | Namespace; +const SevHint = CompilerErrorSeverity.Hint | Namespace; +const SevWarn = CompilerErrorSeverity.Warn | Namespace; +const SevError = CompilerErrorSeverity.Error | Namespace; +const SevFatal = CompilerErrorSeverity.Fatal | Namespace; + +/** + * LogLevel comes from kmn_compiler_errors.h, for legacy compiler error messages + */ +const enum LogLevel { + LEVEL_MASK = 0xF000, + CODE_MASK = 0x0FFF, + CERR_FATAL = 0x8000, + CERR_ERROR = 0x4000, + CERR_WARNING = 0x2000, + CERR_HINT = 0x1000, + CERR_INFO = 0 +}; + +/** + * Translate the legacy compiler error messages to Severity codes + */ +const LogLevelToSeverity: Record = { + [LogLevel.CERR_FATAL]: SevFatal, + [LogLevel.CERR_ERROR]: SevError, + [LogLevel.CERR_WARNING]: SevWarn, + [LogLevel.CERR_HINT]: SevHint, + [LogLevel.CERR_INFO]: SevInfo +} + +export const enum KmnCompilerMessageRanges { + RANGE_KMN_COMPILER_MIN = 0x0001, // from kmn_compiler_errors.h + RANGE_KMN_COMPILER_MAX = 0x07FF, // from kmn_compiler_errors.h + RANGE_LEXICAL_MODEL_MIN = 0x0800, // from kmn_compiler_errors.h, deprecated -- this range will not be used in future versions + RANGE_LEXICAL_MODEL_MAX = 0x08FF, // from kmn_compiler_errors.h, deprecated -- this range will not be used in future versions + RANGE_CompilerMessage_Min = 0x1000, // All compiler messages listed here must be >= this value +} + +/* + The messages in this class share the namespace with messages from kmn_compiler_errors.h + and the below ranges are reserved. +*/ +export class CompilerMessages { + static Fatal_UnexpectedException = (o:{e: any}) => m(this.FATAL_UnexpectedException, `Unexpected exception: ${exc(o.e)}`); + static FATAL_UnexpectedException = SevFatal | 0x1000; + + static Fatal_MissingWasmModule = (o:{e?: any}) => m(this.FATAL_MissingWasmModule, `Could not instantiate WASM compiler module or initialization failed: ${exc(o.e)}`); + static FATAL_MissingWasmModule = SevFatal | 0x1001; + + static Fatal_UnableToSetCompilerOptions = () => m(this.FATAL_UnableToSetCompilerOptions, `Unable to set compiler options`); + static FATAL_UnableToSetCompilerOptions = SevFatal | 0x1002; + + static Fatal_CallbacksNotSet = () => m(this.FATAL_CallbacksNotSet, `Callbacks were not set with init`); + static FATAL_CallbacksNotSet = SevFatal | 0x1003; + + static Fatal_UnicodeSetOutOfRange = () => m(this.FATAL_UnicodeSetOutOfRange, `UnicodeSet buffer was too small`); + static FATAL_UnicodeSetOutOfRange = SevFatal | 0x1004; + + static Error_UnicodeSetHasStrings = () => m(this.ERROR_UnicodeSetHasStrings, `UnicodeSet contains strings, not allowed`); + static ERROR_UnicodeSetHasStrings = SevError | 0x1005; + + static Error_UnicodeSetHasProperties = () => m(this.ERROR_UnicodeSetHasProperties, `UnicodeSet contains properties, not allowed`); + static ERROR_UnicodeSetHasProperties = SevError | 0x1006; + + static Error_UnicodeSetSyntaxError = () => m(this.ERROR_UnicodeSetSyntaxError, `UnicodeSet had a Syntax Error while parsing`); + static ERROR_UnicodeSetSyntaxError = SevError | 0x1007; +} + +export function mapErrorFromKmcmplib(line: number, code: number, msg: string): CompilerEvent { + const severity = LogLevelToSeverity[code & LogLevel.LEVEL_MASK]; + const baseCode = code & LogLevel.CODE_MASK; + const event: CompilerEvent = { + line: line, + code: severity | CompilerErrorNamespace.KmnCompiler | baseCode, + message: msg + }; + return event; +}; diff --git a/developer/src/kmc-kmn/src/main.ts b/developer/src/kmc-kmn/src/main.ts new file mode 100644 index 0000000000000000000000000000000000000000..70d11989c6bfca468558bb217b42c628cf7017de --- /dev/null +++ b/developer/src/kmc-kmn/src/main.ts @@ -0,0 +1,2 @@ + +export { KmnCompiler } from './compiler/compiler.js'; diff --git a/developer/src/kmc-kmn/test/README.md b/developer/src/kmc-kmn/test/README.md new file mode 100644 index 0000000000000000000000000000000000000000..96a198a0d33cfceb2154296d90b246744ea64107 --- /dev/null +++ b/developer/src/kmc-kmn/test/README.md @@ -0,0 +1,7 @@ +Keyman kmn Keyboard Compiler Tests +=================================== + +Test +---- + + ../build.sh test diff --git a/developer/src/kmc-kmn/test/test-compiler.ts b/developer/src/kmc-kmn/test/test-compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..2eacd219e6c7c522baaa715131d702ae1c3568de --- /dev/null +++ b/developer/src/kmc-kmn/test/test-compiler.ts @@ -0,0 +1,90 @@ +import 'mocha'; +import sinon from 'sinon'; +import chai, { assert } from 'chai'; +import sinonChai from 'sinon-chai'; +import { KmnCompiler } from '../src/main.js'; +import { dirname } from 'path'; +import { fileURLToPath } from 'url'; +import fs from 'fs'; +import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers'; + +const __dirname = dirname(fileURLToPath(import.meta.url)).replace(/\\/g, '/'); +const baselineDir = __dirname + '/../../../../../common/test/keyboards/baseline/'; +chai.use(sinonChai); + +describe('Compiler class', function() { + let consoleLog: any; + + // TODO: do we need this? + beforeEach(function() { + consoleLog = sinon.spy(console, 'log'); + }); + + afterEach(function() { + consoleLog.restore(); + }); + + it('should throw on failure', async function() { + const compiler = new KmnCompiler(); + const callbacks : any = null; // ERROR + try { + await compiler.init(callbacks) + assert.fail('Expected exception'); + } catch(e) { + assert.ok(e); + } + assert.throws(() => compiler.verifyInitialized()); + }); + + it('should start', async function() { + const compiler = new KmnCompiler(); + const callbacks = new TestCompilerCallbacks(); + assert(await compiler.init(callbacks)); + assert(compiler.verifyInitialized()); + }); + + it('should compile a basic keyboard', async function() { + const compiler = new KmnCompiler(); + const callbacks = new TestCompilerCallbacks(); + assert(await compiler.init(callbacks)); + assert(compiler.verifyInitialized()); + + const fixtureName = baselineDir + 'k_000___null_keyboard.kmx'; + const infile = baselineDir + 'k_000___null_keyboard.kmn'; + const outfile = __dirname + '/k_000___null_keyboard.kmx'; + + assert(compiler.run(infile, outfile, {saveDebug: true, shouldAddCompilerVersion: false})); + + assert(fs.existsSync(outfile)); + const outfileData = fs.readFileSync(outfile); + const fixtureData = fs.readFileSync(fixtureName); + assert.equal(outfileData.byteLength, fixtureData.byteLength); + assert.deepEqual(outfileData, fixtureData); + }); + + // Note, above test case is essentially a subset of this one, but will leave both because + // the basic keyboard test is slightly simpler to read + it('should build all baseline fixtures', async function() { + const compiler = new KmnCompiler(); + const callbacks = new TestCompilerCallbacks(); + assert(await compiler.init(callbacks)); + assert(compiler.verifyInitialized()); + + const files = fs.readdirSync(baselineDir); + for(let file of files) { + if(file.match(/\.kmx$/)) { + const fixtureName = baselineDir + file; + const infile = baselineDir + file.replace(/x$/, 'n'); + const outfile = __dirname + '/' + file; + + assert(compiler.run(infile, outfile, {saveDebug: true, shouldAddCompilerVersion: false})); + + assert(fs.existsSync(outfile)); + const outfileData = fs.readFileSync(outfile); + const fixtureData = fs.readFileSync(fixtureName); + assert.equal(outfileData.byteLength, fixtureData.byteLength); + assert.deepEqual(outfileData, fixtureData); + } + } + }); +}); diff --git a/developer/src/kmc-kmn/test/test-messages.ts b/developer/src/kmc-kmn/test/test-messages.ts new file mode 100644 index 0000000000000000000000000000000000000000..0dee53f12112d47b67ca19bc266630a791dd4bf9 --- /dev/null +++ b/developer/src/kmc-kmn/test/test-messages.ts @@ -0,0 +1,9 @@ +import 'mocha'; +import { CompilerMessages } from '../src/compiler/messages.js'; +import { verifyCompilerMessagesObject } from '@keymanapp/developer-test-helpers'; + +describe('CompilerMessages', function () { + it('should have a valid CompilerMessages object', function() { + return verifyCompilerMessagesObject(CompilerMessages); + }); +}); diff --git a/developer/src/kmc-kmn/test/test-wasm-uset.ts b/developer/src/kmc-kmn/test/test-wasm-uset.ts new file mode 100644 index 0000000000000000000000000000000000000000..a63b408a959dfbe410703b3f73b28df5ce915bb4 --- /dev/null +++ b/developer/src/kmc-kmn/test/test-wasm-uset.ts @@ -0,0 +1,66 @@ +import 'mocha'; +import { assert } from 'chai'; +import { KmnCompiler } from '../src/main.js'; +import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers'; +import { CompilerMessages } from '../src/compiler/messages.js'; +import { compilerErrorFormatCode } from '@keymanapp/common-types'; + +describe('Compiler UnicodeSet function', function() { + it('should start', async function() { + const compiler = new KmnCompiler(); + const callbacks = new TestCompilerCallbacks(); + assert(await compiler.init(callbacks)); + assert(compiler.verifyInitialized()); + }); + + it('should compile a basic uset', async function() { + const compiler = new KmnCompiler(); + const callbacks = new TestCompilerCallbacks(); + assert(await compiler.init(callbacks)); + assert(compiler.verifyInitialized()); + + const pat = "[abc]"; + const set = compiler.parseUnicodeSet(pat, 23); + + assert(set.length === 1); + assert(set.ranges[0][0] === 'a'.charCodeAt(0)); + assert(set.ranges[0][1] === 'c'.charCodeAt(0)); + }); + it('should compile a more complex uset', async function() { + const compiler = new KmnCompiler(); + const callbacks = new TestCompilerCallbacks(); + assert(await compiler.init(callbacks)); + assert(compiler.verifyInitialized()); + + const pat = "[[🙀A-C]-[CB]]"; + const set = compiler.parseUnicodeSet(pat, 23); + + assert.equal(set.length, 2); + assert.equal(set.ranges[0][0], 'A'.charCodeAt(0)); + assert.equal(set.ranges[0][1], 'A'.charCodeAt(0)); + assert.equal(set.ranges[1][0], 0x1F640); + assert.equal(set.ranges[1][1], 0x1F640); + }); + it('should fail in various ways', async function() { + const compiler = new KmnCompiler(); + const callbacks = new TestCompilerCallbacks(); + assert(await compiler.init(callbacks)); + assert(compiler.verifyInitialized()); + // map from string to failing error + const failures = { + '[:Adlm:]': CompilerMessages.ERROR_UnicodeSetHasProperties, // what it saye + '[acegik]': CompilerMessages.FATAL_UnicodeSetOutOfRange, // 6 ranges, allocated 1 + '[[\\p{Mn}]&[A-Z]]': CompilerMessages.ERROR_UnicodeSetHasProperties, + '[abc{def}]': CompilerMessages.ERROR_UnicodeSetHasStrings, + '[[]': CompilerMessages.ERROR_UnicodeSetSyntaxError, + }; + for(const [pat, expected] of Object.entries(failures)) { + callbacks.clear(); + assert.notOk(compiler.parseUnicodeSet(pat, 1)); + assert.equal(callbacks.messages.length, 1); + const firstMessage = callbacks.messages[0]; + const code = firstMessage.code; + assert.equal(code, expected, `${compilerErrorFormatCode(code)}≠${compilerErrorFormatCode(expected)} got ${firstMessage.message} for ${pat}`); + } + }); +}); diff --git a/developer/src/kmc-kmn/test/tsconfig.json b/developer/src/kmc-kmn/test/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..115412f57f397294d7bb8336dfed238cd9b3040c --- /dev/null +++ b/developer/src/kmc-kmn/test/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../../kmc/tsconfig.kmc-base.json", + + "compilerOptions": { + "rootDir": ".", + "rootDirs": ["./", "../src/"], + "outDir": "../build/test", + "baseUrl": ".", + "allowSyntheticDefaultImports": true, // for chai + "paths": { + "@keymanapp/common-types": ["../../../../common/web/types/src/main"], + "@keymanapp/developer-test-helpers": ["../../common/web/test-helpers/index"], + }, + }, + "include": [ + "**/test-*.ts" + ], + "references": [ + { "path": "../../../../common/web/keyman-version/tsconfig.esm.json" }, + { "path": "../../../../common/web/types/" }, + { "path": "../../../../common/tools/hextobin/" }, + { "path": "../../common/web/test-helpers/" }, + { "path": "../" } + ] +} \ No newline at end of file diff --git a/developer/src/kmc-kmn/tsconfig.json b/developer/src/kmc-kmn/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..b828a5076487c095a83cfaf700f73801f44d758b --- /dev/null +++ b/developer/src/kmc-kmn/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "../../../tsconfig.esm-base.json", + + "compilerOptions": { + "outDir": "build/src/", + "rootDir": "src/", + "baseUrl": ".", + "allowJs": true, + "paths": { + "@keymanapp/common-types": ["../../../common/web/types/src/main"], + }, + + }, + "include": [ + "src/**/*.ts", + "src/import/kmcmplib/wasm-host.js" + ], + "references": [ + { "path": "../../../common/web/keyman-version/tsconfig.esm.json" }, + { "path": "../../../common/web/types/" }, + ] +} diff --git a/developer/src/kmc-ldml/.eslintrc.cjs b/developer/src/kmc-ldml/.eslintrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..09038ae9291d0ce786656be735b38cff1049976d --- /dev/null +++ b/developer/src/kmc-ldml/.eslintrc.cjs @@ -0,0 +1,15 @@ +module.exports = { + parserOptions: { + project: ["./tsconfig.json", "./test/tsconfig.json"], + }, + ignorePatterns: ["test/fixtures/**/*"], + overrides: [ + { + files:"src/**/*.ts", + extends: ["../../../common/web/eslint/eslintNoNodeImports.js"], + } + ], + rules: { + "prefer-const": "off", // TODO: enable this once infrastructure is in place and cleanup the problem cases + }, +}; diff --git a/developer/src/kmc-ldml/Makefile b/developer/src/kmc-ldml/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..3cf3ac055a949f3a1eaa495b5d045b229be7a221 --- /dev/null +++ b/developer/src/kmc-ldml/Makefile @@ -0,0 +1,39 @@ +# +# Keyman Developer - kmc Keyboard Compiler Makefile +# + +!include ..\Defines.mak + +# We do configure here because parent Makefile calls this first; other +# kmc and kmc-* makefiles don't do it +build: configure .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh build + +configure: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh configure + +clean: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh clean + +test: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh test + +# build.sh bundle must be run from shell as it requires a temp folder to be +# passed in. See inst/download.in.mak for instantiation. + +publish: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh publish + +signcode: + @rem nothing to do + +wrap-symbols: + @rem nothing to do + +test-manifest: + @rem nothing to do + +install: + @rem nothing to do + +!include ..\Target.mak diff --git a/developer/src/kmc-ldml/build.sh b/developer/src/kmc-ldml/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..71f146e835adc94adac256997240c25f4a21317b --- /dev/null +++ b/developer/src/kmc-ldml/build.sh @@ -0,0 +1,112 @@ +#!/usr/bin/env bash +# +# Compiles the kmc keyboard compiler. +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +cd "$THIS_SCRIPT_PATH" + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +builder_describe "Build Keyman kmc Keyboard Compiler module" \ + "@/common/web/keyman-version" \ + "@/common/web/types" \ + "@/developer/src/common/web/test-helpers" \ + "configure" \ + "build" \ + "clean" \ + "test" \ + "build-fixtures builds test fixtures for manual examination" \ + "pack build a local .tgz pack for testing" \ + "publish publish to npm" \ + "--dry-run,-n don't actually publish, just dry run" +builder_describe_outputs \ + configure /node_modules \ + build /developer/src/kmc-ldml/build/src/main.js + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action clean; then + rm -rf ./build/ ./tsconfig.tsbuildinfo + builder_finish_action success clean +fi + +SCHEMAS_COPIED=false + +copy_schemas() { + if $SCHEMAS_COPIED; then + return 0 + fi + SCHEMAS_COPIED=true + # We need the schema file at runtime and bundled, so always copy it for all actions except `clean` + mkdir -p "$THIS_SCRIPT_PATH/build/src/" + cp "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json" "$THIS_SCRIPT_PATH/build/src/" + cp "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest.schema.json" "$THIS_SCRIPT_PATH/build/src/" + cp "$KEYMAN_ROOT/common/schemas/kvks/kvks.schema.json" "$THIS_SCRIPT_PATH/build/src/" + cp "$KEYMAN_ROOT/common/schemas/kpj/kpj.schema.json" "$THIS_SCRIPT_PATH/build/src/" +} + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action configure; then + copy_schemas + verify_npm_setup + builder_finish_action success configure +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action build; then + copy_schemas + npm run build + builder_finish_action success build +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action build-fixtures; then + copy_schemas + + # Build basic.kmx and emit its checksum + mkdir -p ./build/test/fixtures + node ../kmc build ./test/fixtures/basic.xml --no-compiler-version --debug --out-file ./build/test/fixtures/basic-xml.kmx + printf "${COLOR_GREY}Checksum for basic-xml.kmx: ${COLOR_PURPLE}%s${COLOR_RESET}\n" \ + "$(xxd -g 1 -l 12 ./build/test/fixtures/basic-xml.kmx | cut -d' ' -f 10-13)" + + # Generate a binary file from basic.txt for comparison purposes + node ../../../common/tools/hextobin/build/hextobin.js ./test/fixtures/basic.txt ./build/test/fixtures/basic-txt.kmx + + builder_finish_action success build-fixtures +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action test; then + copy_schemas + npm test + builder_finish_action success test +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action publish; then + copy_schemas + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_npm + builder_finish_action success publish +elif builder_start_action pack; then + copy_schemas + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_pack + builder_finish_action success pack +fi diff --git a/developer/src/kmc-ldml/package.json b/developer/src/kmc-ldml/package.json new file mode 100644 index 0000000000000000000000000000000000000000..fda0b44272aa05a36300be18b6e3fa9a5877a790 --- /dev/null +++ b/developer/src/kmc-ldml/package.json @@ -0,0 +1,70 @@ +{ + "name": "@keymanapp/kmc-ldml", + "description": "Keyman Developer LDML keyboard compiler", + "keywords": [ + "keyboard", + "keyman", + "ldml", + "unicode" + ], + "type": "module", + "exports": { + ".": "./build/src/main.js" + }, + "files": [ + "/build/src/" + ], + "scripts": { + "build": "tsc -b", + "lint": "eslint .", + "test": "npm run lint && cd test && tsc -b && cd .. && c8 --reporter=lcov --reporter=text mocha", + "prepublishOnly": "npm run build" + }, + "author": "Marc Durdin (https://github.com/mcdurdin)", + "license": "MIT", + "bugs": { + "url": "https://github.com/keymanapp/keyman/issues" + }, + "dependencies": { + "@keymanapp/keyman-version": "*", + "@keymanapp/ldml-keyboard-constants": "*", + "ajv": "^8.11.0", + "restructure": "git+https://github.com/keymanapp/dependency-restructure.git#49d129cf0916d082a7278bb09296fb89cecfcc50", + "semver": "^7.3.7", + "xml2js": "git+https://github.com/keymanapp/dependency-node-xml2js#535fe732dc408d697e0f847c944cc45f0baf0829" + }, + "devDependencies": { + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/semver": "^7.3.12", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "mocha": "^8.4.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5", + "@keymanapp/developer-test-helpers": "*" + }, + "mocha": { + "spec": "build/test/**/test-*.js", + "require": [ + "source-map-support/register" + ] + }, + "c8": { + "all": true, + "src": [ + "src/" + ], + "exclude-after-remap": true, + "exclude": [ + "test/" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/keymanapp/keyman.git" + } +} diff --git a/developer/src/kmc-ldml/src/compiler/compiler-options.ts b/developer/src/kmc-ldml/src/compiler/compiler-options.ts new file mode 100644 index 0000000000000000000000000000000000000000..3d29e6393ad3de65cca0db87f464c8cc4f91c8f1 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/compiler-options.ts @@ -0,0 +1,13 @@ + + +export interface CompilerOptions { + /** + * Add debug information to the .kmx file when compiling + */ + debug?: boolean; + + /** + * Add metadata about the compiler version to .kmx file when compiling + */ + addCompilerVersion?: boolean; +}; diff --git a/developer/src/kmc-ldml/src/compiler/compiler.ts b/developer/src/kmc-ldml/src/compiler/compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..b7b46e49b2a2e9304f0b2616ff9d22eab6ab0268 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/compiler.ts @@ -0,0 +1,163 @@ +import { LDMLKeyboardXMLSourceFileReader, LDMLKeyboard, KMXPlus, CompilerCallbacks, LDMLKeyboardTestDataXMLSourceFile } from '@keymanapp/common-types'; +import { CompilerOptions } from './compiler-options.js'; +import { CompilerMessages } from './messages.js'; +import { BkspCompiler, FinlCompiler, TranCompiler } from './tran.js'; +import { DispCompiler } from './disp.js'; +import { KeysCompiler } from './keys.js'; +import { LayrCompiler } from './layr.js'; +import { LocaCompiler } from './loca.js'; +import { MetaCompiler } from './meta.js'; +import { NameCompiler } from './name.js'; +import { OrdrCompiler } from './ordr.js'; +import { VkeyCompiler } from './vkey.js'; + +import LDMLKeyboardXMLSourceFile = LDMLKeyboard.LDMLKeyboardXMLSourceFile; +import KMXPlusFile = KMXPlus.KMXPlusFile; + +const SECTION_COMPILERS = [ + BkspCompiler, + DispCompiler, + FinlCompiler, + KeysCompiler, + LayrCompiler, + LocaCompiler, + MetaCompiler, + NameCompiler, + OrdrCompiler, + TranCompiler, + VkeyCompiler, +]; + +export class LdmlKeyboardCompiler { + private readonly callbacks: CompilerCallbacks; + // private readonly options: CompilerOptions; // not currently used + + constructor (callbacks: CompilerCallbacks, _options?: CompilerOptions) { + /* + this.options = { + debug: false, + addCompilerVersion: true, + ...options + }; + */ + this.callbacks = callbacks; + } + + private buildSections(source: LDMLKeyboardXMLSourceFile) { + return SECTION_COMPILERS.map(c => new c(source, this.callbacks)); + } + + /** + * Loads a LDML Keyboard xml file and compiles into in-memory xml + * structures. + * @param filename input filename, will use callback to load from disk + * @returns the source file, or null if invalid + */ + public load(filename: string): LDMLKeyboardXMLSourceFile | null { + const reader = new LDMLKeyboardXMLSourceFileReader(this.callbacks); + const data = this.callbacks.loadFile(filename); + if(!data) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({errorText: 'Unable to read XML file'})); + return null; + } + const source = reader.load(data); + if(!source) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({errorText: 'Unable to load XML file'})); + return null; + } + try { + if (!reader.validate(source, this.callbacks.loadSchema('ldml-keyboard'))) { + return null; + } + } catch(e) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({errorText: e.toString()})); + return null; + } + + return source; + } + + /** + * Loads a LDML Keyboard test data xml file and compiles into in-memory xml + * structures. + * @param filename input filename, will use callback to load from disk + * @returns the source file, or null if invalid + */ + public loadTestData(filename: string): LDMLKeyboardTestDataXMLSourceFile | null { + const reader = new LDMLKeyboardXMLSourceFileReader(this.callbacks); + const data = this.callbacks.loadFile(filename); + if(!data) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({errorText: 'Unable to read XML file'})); + return null; + } + const source = reader.loadTestData(data); + if(!source) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({errorText: 'Unable to load XML file'})); + return null; + } + // TODO-LDML: The unboxed data doesn't match the schema anymore. Skipping validation, for now. + + // try { + // if (!reader.validate(source, this.callbacks.loadSchema('ldml-keyboard-test'))) { + // return null; + // } + // } catch(e) { + // this.callbacks.reportMessage(CompilerMessages.Error_InvalidFile({errorText: e.toString()})); + // return null; + // } + + return source; + } + + + /** + * Validates that the LDML keyboard source file and lints. Actually just + * compiles the keyboard and returns `true` if everything is good... + * @param source + * @returns true if the file validates + */ + public validate(source: LDMLKeyboardXMLSourceFile): boolean { + return !!this.compile(source); + } + + /** + * Transforms in-memory LDML keyboard xml file to an intermediate + * representation of a .kmx file. + * @param source in-memory representation of LDML keyboard xml file + * @returns KMXPlusFile intermediate file + */ + public compile(source: LDMLKeyboardXMLSourceFile): KMXPlusFile { + const sections = this.buildSections(source); + let passed = true; + + const kmx = new KMXPlusFile(); + + // These two sections are required by other sections + kmx.kmxplus.strs = new KMXPlus.Strs(); + kmx.kmxplus.elem = new KMXPlus.Elem(kmx.kmxplus.strs); + kmx.kmxplus.list = new KMXPlus.List(kmx.kmxplus.strs); + + for(let section of sections) { + if(!section.validate()) { + passed = false; + // We'll keep validating other sections anyway, so we get a full set of + // errors for the keyboard developer. + continue; + } + const sect = section.compile({strs: kmx.kmxplus.strs, elem: kmx.kmxplus.elem, list: kmx.kmxplus.list}); + + /* istanbul ignore if */ + if(!sect) { + // This should not happen -- validate() should have told us + // if something is going to fail to compile + this.callbacks.reportMessage(CompilerMessages.Fatal_SectionCompilerFailed({sect:section.id})); + passed = false; + continue; + } + kmx.kmxplus[section.id] = sect as any; + } + + return passed ? kmx : null; + } +} + diff --git a/developer/src/kmc-ldml/src/compiler/disp.ts b/developer/src/kmc-ldml/src/compiler/disp.ts new file mode 100644 index 0000000000000000000000000000000000000000..98223de132ee3cfafbaec954d541c662b3277989 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/disp.ts @@ -0,0 +1,51 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlus } from '@keymanapp/common-types'; + +import { CompilerMessages } from "./messages.js"; +import { SectionCompiler } from "./section-compiler.js"; + +import GlobalSections = KMXPlus.GlobalSections; +import Disp = KMXPlus.Disp; +import DispItem = KMXPlus.DispItem; + +export class DispCompiler extends SectionCompiler { + + public get id() { + return constants.section.disp; + } + + public validate(): boolean { + let valid = true; + + const tos = new Set(); + + if (this.keyboard.displays?.display) { + for (const { to } of this.keyboard.displays?.display) { + if (tos.has(to)) { + this.callbacks.reportMessage(CompilerMessages.Error_DisplayIsRepeated({ to })); + return false; + } + tos.add(to); + } + } + + return valid; + } + + public compile(sections: GlobalSections): Disp { + let result = new Disp(); + + // displayOptions + result.baseCharacter = sections.strs.allocAndUnescapeString(this.keyboard.displays?.displayOptions?.baseCharacter); + + // displays + result.disps = this.keyboard.displays?.display.map(display => ({ + to: sections.strs.allocAndUnescapeString(display.to), + display: sections.strs.allocAndUnescapeString(display.display), + })) || []; + + result.disps.sort((a: DispItem, b: DispItem) => a.to.compareTo(b.to)); + + return result; + } +} diff --git a/developer/src/kmc-ldml/src/compiler/keymanweb-compiler.ts b/developer/src/kmc-ldml/src/compiler/keymanweb-compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..7ecdbe5937dabcc013fc44af1f16bef71054188a --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/keymanweb-compiler.ts @@ -0,0 +1,117 @@ +import { CompilerCallbacks, VisualKeyboard, LDMLKeyboard, TouchLayoutFileWriter } from "@keymanapp/common-types"; +import { CompilerOptions } from "./compiler-options.js"; +import { TouchLayoutCompiler } from "./touch-layout-compiler.js"; +import { LdmlKeyboardVisualKeyboardCompiler } from "./visual-keyboard-compiler.js"; + +const MINIMUM_KMW_VERSION = '16.0'; + +export interface LdmlKeyboardKeymanWebCompilerOptions extends CompilerOptions { +}; + +export class LdmlKeyboardKeymanWebCompiler { + private readonly options: LdmlKeyboardKeymanWebCompilerOptions; + private readonly nl: string; + private readonly tab: string; + + constructor(private callbacks: CompilerCallbacks, options?: LdmlKeyboardKeymanWebCompilerOptions) { + this.options = { ...options }; + this.nl = this.options.debug ? "\n" : ''; + this.tab = this.options.debug ? " " : ''; + } + + public compileVisualKeyboard(source: LDMLKeyboard.LDMLKeyboardXMLSourceFile) { + const nl = this.nl, tab = this.tab; + const vkc = new LdmlKeyboardVisualKeyboardCompiler(); + const vk: VisualKeyboard.VisualKeyboard = vkc.compile(source); + + let result = + `{F: '${vk.header.unicodeFont.size}pt ${JSON.stringify(vk.header.unicodeFont.name)}', `+ + `K102: ${vk.header.flags & VisualKeyboard.VisualKeyboardHeaderFlags.kvkh102 ? 1 : 0}};${nl}` + // TODO-LDML: escape ' and " in font name correctly + `${tab}this.KV.KLS={${nl}` + + `${tab}${tab}TODO_LDML: ${vk.keys.length}${nl}` + + // TODO-LDML: fill in KLS + `${tab}}`; + + return result; + } + + public compileTouchLayout(source: LDMLKeyboard.LDMLKeyboardXMLSourceFile) { + const tlcompiler = new TouchLayoutCompiler(); + const layout = tlcompiler.compileToJavascript(source); + const writer = new TouchLayoutFileWriter({formatted: this.options.debug}); + return writer.compile(layout); + } + + private cleanName(name: string): string { + let result = this.callbacks.path.basename(name, '.xml'); + if(!result) { + throw new Error(`Invalid file name ${name}`); + } + + result = result.replaceAll(/[^a-z0-9]/g, '_'); + if(result.match(/^[0-9]/)) { + // Can't have a digit as initial + result = '_' + result; + } + return result; + } + + public compile(name: string, source: LDMLKeyboard.LDMLKeyboardXMLSourceFile): string { + const nl = this.nl, tab = this.tab; + + const sName = 'Keyboard_'+this.cleanName(name); + const displayUnderlying = true; // TODO-LDML + const modifierBitmask = 0; // TODO-LDML: define the modifiers used by this keyboard + const vkDictionary = ''; // TODO-LDML: vk dictionary for touch keys + const hasSupplementaryPlaneChars = false; // TODO-LDML + const isRTL = false; // TODO-LDML + + let result = + `if(typeof keyman === 'undefined') {${nl}` + + `${tab}console.error('Keyboard requires KeymanWeb ${MINIMUM_KMW_VERSION} or later');${nl}` + + `} else {${nl}` + + `${tab}KeymanWeb.KR(new ${sName}());${nl}` + + `}${nl}` + + `function ${sName}() {${nl}` + + // `${tab}${this.setupDebug()}${nl}` + ? we may use this for modifierBitmask in future + // `${tab}this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9;${nl}` + ? we probably don't need this, it's for back-compat + `${tab}this.KI="${sName}";${nl}` + + `${tab}this.KN=${JSON.stringify(source.keyboard.names.name[0])};${nl}` + + `${tab}this.KMINVER=${JSON.stringify(MINIMUM_KMW_VERSION)};${nl}` + + `${tab}this.KV=${this.compileVisualKeyboard(source)};${nl}` + + `${tab}this.KDU=${displayUnderlying ? '1' : '0'};${nl}` + + `${tab}this.KH="";${nl}` + // TODO-LDML: help text not supported + `${tab}this.KM=0;${nl}` + // TODO-LDML: mnemonic layout not supported for LDML keyboards + `${tab}this.KBVER=${JSON.stringify(source.keyboard.version?.number || '0.0')};${nl}` + + `${tab}this.KMBM=${modifierBitmask};${nl}`; + + if(isRTL) { + result += `${tab}this.KRTL=1;${nl}`; + } + + if(hasSupplementaryPlaneChars) { + result += `${tab}this.KS=1;${nl}`; + } + + if(vkDictionary != '') { + result += `${tab}this.KVKD=${JSON.stringify(vkDictionary)};${nl}`; + } + + let layoutFile = this.compileTouchLayout(source); + if(layoutFile != '') { + result += `${tab}this.KVKL=${layoutFile};${nl}`; + } + // TODO-LDML: KCSS not supported + + // TODO-LDML: embed binary keyboard for loading into Core + + // A LDML keyboard has a no-op for its gs() (begin Unicode) function, + // because the functionality is embedded in Keyman Core + result += `${tab}this.gs=function(t,e){${nl}`+ + `${tab}${tab}return 0;${nl}`+ // TODO-LDML: we will start by embedding call into Keyman Core here + `${tab}};${nl}`; + + result += `}${nl}`; + return result; + } +} \ No newline at end of file diff --git a/developer/src/kmc-ldml/src/compiler/keys.ts b/developer/src/kmc-ldml/src/compiler/keys.ts new file mode 100644 index 0000000000000000000000000000000000000000..fab1d8b28ab23391bebb4672b3be1b937bc66ed3 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/keys.ts @@ -0,0 +1,246 @@ +import { constants } from '@keymanapp/ldml-keyboard-constants'; +import { LDMLKeyboard, KMXPlus, Constants } from '@keymanapp/common-types'; +import { CompilerMessages } from './messages.js'; +import { SectionCompiler } from "./section-compiler.js"; + +import GlobalSections = KMXPlus.GlobalSections; +import Keys = KMXPlus.Keys; +import ListItem = KMXPlus.ListItem; +import KeysFlicks = KMXPlus.KeysFlicks; +import { allUsedKeyIdsInLayers, calculateUniqueKeys, translateLayerAttrToModifier, validModifier } from '../util/util.js'; + +export class KeysCompiler extends SectionCompiler { + + public get id() { + return constants.section.keys; + } + + /** + * + * @returns just the non-touch layers. + */ + public hardwareLayers() { + return this.keyboard.layers?.filter(({form}) => form !== 'touch'); + } + + public validate() { + let valid = true; + + // general key-level validation here, only of used keys + const usedKeys = allUsedKeyIdsInLayers(this.keyboard?.layers); + const uniqueKeys = calculateUniqueKeys([...this.keyboard.keys?.key]); + for (let key of uniqueKeys) { + const {id, flicks} = key; + if (!usedKeys.has(id)) { + continue; // unused key, ignore + } + // TODO-LDML: further key-level validation here + if (!flicks) { + continue; // no flicks + } + const flickEntry = this.keyboard.keys?.flicks?.find(x => x.id === flicks); + if (!flickEntry ) { + valid = false; + this.callbacks.reportMessage(CompilerMessages.Error_MissingFlicks({flicks, id})); + } + } + + // the layr compiler does more extensive validation of the layer attributes. + + // Kmap validation + const hardwareLayers = this.hardwareLayers(); + + if (hardwareLayers.length >= 1) { + // validate all errors + for (let layers of hardwareLayers) { + for(let layer of layers.layer) { + valid = this.validateHardwareLayerForKmap(layers.form, layer) && valid; // note: always validate even if previously invalid results found + } + } + } else { + // TODO-LDML: Touch? + } + + return valid; + } + + public compile(sections: GlobalSections): Keys { + if (!this.keyboard?.keys?.key && !this.keyboard?.keys?.flicks) { + // short-circuit if no keys or flicks + return null; + } + + let sect = new Keys(sections.strs); + + // Load the flicks first + this.loadFlicks(sections, sect); + + // Now, load the keys + this.loadKeys(sections, sect); + + // Finally, kmap + // Use LayerMap + keys to generate compiled keys for hardware + const hardwareLayers = this.hardwareLayers(); + if (hardwareLayers.length > 1) { + // validation should have already caught this + throw Error(`Internal error: Expected 0 or 1 hardware layer, not ${hardwareLayers.length}`); + } else if (hardwareLayers.length === 1) { + const theLayers = hardwareLayers[0]; + const { form } = theLayers; + for(let layer of theLayers.layer) { + this.compileHardwareLayerToKmap(sections, layer, sect, form); + } + } // else: TODO-LDML do nothing if only touch layers + + return sect; + } + + public loadFlicks(sections: GlobalSections, sect: Keys) { + for (let lkflicks of this.keyboard.keys.flicks) { + let flicks: KeysFlicks = new KeysFlicks(sections.strs.allocString(lkflicks.id)); + + for (let lkflick of lkflicks.flick) { + let flags = 0; + // TODO-LDML: single char + const to = sections.strs.allocAndUnescapeString(lkflick.to); + flags |= constants.keys_flick_flags_extend; + let directions : ListItem = sections.list.allocListFromSpaces(sections.strs, lkflick.directions); + flicks.flicks.push({ + directions, + flags, + to, + }); + } + + sect.flicks.push(flicks); + } + } + + public loadKeys(sections: GlobalSections, sect: Keys) { + const usedKeys = allUsedKeyIdsInLayers(this.keyboard?.layers); + const uniqueKeys = calculateUniqueKeys([...this.keyboard.keys?.key]); + + for (let key of uniqueKeys) { + if (!usedKeys.has(key.id)) { + // TODO-LDML: linting for unused, non-implied and non-imported keys, + continue; // unused key, skip + } + let flags = 0; + const flicks = key.flicks; + if (!!key.gap) { + flags |= constants.keys_key_flags_gap; + } + if (key.transform === 'no') { + flags |= constants.keys_key_flags_notransform; + } + const id = sections.strs.allocString(key.id); + const longPress: ListItem = sections.list.allocListFromEscapedSpaces(sections.strs, key.longPress); + const longPressDefault = sections.strs.allocAndUnescapeString(key.longPressDefault); + const multiTap: ListItem = sections.list.allocListFromEscapedSpaces(sections.strs, key.multiTap); + const keySwitch = sections.strs.allocString(key.switch); // 'switch' is a reserved word + flags |= constants.keys_key_flags_extend; + const to = sections.strs.allocAndUnescapeString(key.to); // TODO-LDML: single char + const width = Math.ceil((key.width || 1) * 10.0); // default, width=1 + sect.keys.push({ + flags, + flicks, + id, + longPress, + longPressDefault, + multiTap, + switch: keySwitch, // 'switch' is a reserved word + to, + width, + }); + } + } + + /** + * TODO-LDML: from old 'keys' + * Validate for purpose of kmap + * @param hardware the 'form' parameter + * @param layer + * @returns + */ + private validateHardwareLayerForKmap(hardware: string, layer: LDMLKeyboard.LKLayer) { + let valid = true; + + const { modifier } = layer; + if (!validModifier(modifier)) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidModifier({ modifier, layer: layer.id })); + valid = false; + } + + const keymap = Constants.HardwareToKeymap.get(hardware); + if (!keymap) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidHardware({ form: hardware })); + valid = false; + } + + const uniqueKeys = calculateUniqueKeys([...this.keyboard.keys?.key]); + if (layer.row.length > keymap.length) { + this.callbacks.reportMessage(CompilerMessages.Error_HardwareLayerHasTooManyRows()); + valid = false; + } + + for (let y = 0; y < layer.row.length && y < keymap.length; y++) { + const keys = layer.row[y].keys.split(' '); + + if (keys.length > keymap[y].length) { + this.callbacks.reportMessage(CompilerMessages.Error_RowOnHardwareLayerHasTooManyKeys({ row: y + 1, hardware, modifier })); + valid = false; + } + + let x = -1; + for (let key of keys) { + x++; + + let keydef = uniqueKeys.find(x => x.id == key); + if (!keydef) { + this.callbacks.reportMessage(CompilerMessages.Error_KeyNotFoundInKeyBag({ keyId: key, col: x + 1, row: y + 1, layer: layer.id, form: 'hardware' })); + valid = false; + continue; + } + if (!keydef.to && !keydef.gap && !keydef.switch) { + this.callbacks.reportMessage(CompilerMessages.Error_KeyMissingToGapOrSwitch({ keyId: key })); + valid = false; + continue; + } + } + } + + return valid; + } + + private compileHardwareLayerToKmap( + sections: GlobalSections, + layer: LDMLKeyboard.LKLayer, + sect: Keys, + hardware: string, + ): Keys { + const mod = translateLayerAttrToModifier(layer); + const keymap = Constants.HardwareToKeymap.get(hardware); + + let y = -1; + for (let row of layer.row) { + y++; + + const keys = row.keys.split(' '); + let x = -1; + for (let key of keys) { + x++; + + // TODO-LDML: we already validated that the key exists, above. + // So here we only need the ID? + // let keydef = this.keyboard.keys?.key?.find(x => x.id == key); + + sect.kmap.push({ + vkey: keymap[y][x], + mod: mod, + key, // key id, to be changed into key index at finalization + }); + } + } + return sect; + } +} diff --git a/developer/src/kmc-ldml/src/compiler/layr.ts b/developer/src/kmc-ldml/src/compiler/layr.ts new file mode 100644 index 0000000000000000000000000000000000000000..f506b3e2379469edee063a18869b6b60cbd91067 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/layr.ts @@ -0,0 +1,87 @@ +import { constants } from '@keymanapp/ldml-keyboard-constants'; +import { KMXPlus } from '@keymanapp/common-types'; +import { CompilerMessages } from './messages.js'; +import { SectionCompiler } from "./section-compiler.js"; +import { translateLayerAttrToModifier, validModifier } from '../util/util.js'; + + +import GlobalSections = KMXPlus.GlobalSections; +import Layr = KMXPlus.Layr; +import LayrEntry = KMXPlus.LayrEntry; +import LayrList = KMXPlus.LayrList; +import LayrRow = KMXPlus.LayrRow; + +export class LayrCompiler extends SectionCompiler { + + public get id() { + return constants.section.layr; + } + + public validate() { + let valid = true; + let totalLayerCount = 0; + let hardwareLayers = 0; + // let touchLayers = 0; + this.keyboard.layers?.forEach((layers) => { + const { form } = layers; + if (form === 'touch') { + // touchLayers++; + // multiple touch layers are OK + totalLayerCount += layers.layer?.length; + // TODO-LDML: check that widths are distinct + } else { + // hardware + hardwareLayers++; + if (hardwareLayers > 1) { + valid = false; + this.callbacks.reportMessage(CompilerMessages.Error_ExcessHardware({form})); + } else if (!constants.layr_list_hardware_map.get(form)) { + valid = false; + this.callbacks.reportMessage(CompilerMessages.Error_InvalidHardware({form})); + } + } + layers.layer.forEach((layer) => { + const { modifier, id } = layer; + totalLayerCount++; + if (!validModifier(modifier)) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidModifier({ modifier, layer: id })); + valid = false; + } + }); + }); + if (totalLayerCount === 0) { // TODO-LDML: does not validate touch layers yet + // no layers seen anywhere + valid = false; + this.callbacks.reportMessage(CompilerMessages.Error_MustBeAtLeastOneLayerElement()); + } + return valid; + } + + public compile(sections: GlobalSections): Layr { + const sect = new Layr(); + + sect.lists = this.keyboard.layers.map((layers) => { + const hardware = constants.layr_list_hardware_map.get(layers.form); + // Already validated in validate + const list: LayrList = { + hardware, + minDeviceWidth: layers.minDeviceWidth || 0, + layers: layers.layer.map((layer) => { + const entry: LayrEntry = { + id: sections.strs.allocString(layer.id), + mod: translateLayerAttrToModifier(layer), + rows: layer.row.map((row) => { + const erow: LayrRow = { + keys: row.keys.split(' ').map((id) => sections.strs.allocString(id)), + }; + return erow; + }), + }; + return entry; + }), + }; + return list; + }); + return sect; + } +} diff --git a/developer/src/kmc-ldml/src/compiler/loca.ts b/developer/src/kmc-ldml/src/compiler/loca.ts new file mode 100644 index 0000000000000000000000000000000000000000..da7d2fb8d2ee797db12c87dd2292092722baeda6 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/loca.ts @@ -0,0 +1,69 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { LDMLKeyboard, KMXPlus } from '@keymanapp/common-types'; +import { SectionCompiler } from "./section-compiler.js"; +import { CompilerMessages } from "./messages.js"; + +import GlobalSections = KMXPlus.GlobalSections; +import Loca = KMXPlus.Loca; +import LKKeyboard = LDMLKeyboard.LKKeyboard; + +export class LocaCompiler extends SectionCompiler { + + public get id() { + return constants.section.loca; + } + + /** + * + * @param keyboard + * @returns list of BCP 47 tags in the keyboard xml, potentially with invalid or repeated entries + */ + private getLocales = + (keyboard: LKKeyboard) => + [keyboard.locale].concat(Array.isArray(keyboard.locales?.locale) ? keyboard.locales.locale.map(v => v.id) : []) + + public validate(): boolean { + let valid = true; + const locales = this.getLocales(this.keyboard); + for(let tag of locales) { + try { + new Intl.Locale(tag); + } catch(e) { + if(e instanceof RangeError) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidLocale({tag})); + valid = false; + } else { + throw e; + } + } + } + return valid; + } + + public compile(sections: GlobalSections): Loca { + let result = new Loca(); + + // This also minimizes locales according to Remove Likely Subtags algorithm: + // https://www.unicode.org/reports/tr35/#Likely_Subtags + const sourceLocales = this.getLocales(this.keyboard); + const locales = sourceLocales.map((sourceLocale: string) => { + const locale = new Intl.Locale(sourceLocale).minimize().toString(); + if(locale != sourceLocale) { + this.callbacks.reportMessage(CompilerMessages.Hint_LocaleIsNotMinimalAndClean({sourceLocale, locale})); + } + return locale; + }); + + // TODO: remove `as any` cast: (Intl as any): ts lib version we have doesn't + // yet include `getCanonicalLocales` but node 16 does include it so we can + // safely use it. Also well supported in modern browsers. + const canonicalLocales = (Intl as any).getCanonicalLocales(locales) as string[]; + result.locales = canonicalLocales.map(locale => sections.strs.allocString(locale)); + + if(result.locales.length < locales.length) { + this.callbacks.reportMessage(CompilerMessages.Hint_OneOrMoreRepeatedLocales()); + } + + return result; + } +} diff --git a/developer/src/kmc-ldml/src/compiler/messages.ts b/developer/src/kmc-ldml/src/compiler/messages.ts new file mode 100644 index 0000000000000000000000000000000000000000..32eb943a683ee6ef1995932b685e6f9a467f3669 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/messages.ts @@ -0,0 +1,93 @@ +import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec as m } from "@keymanapp/common-types"; + +const SevInfo = CompilerErrorSeverity.Info | CompilerErrorNamespace.LdmlKeyboardCompiler; +const SevHint = CompilerErrorSeverity.Hint | CompilerErrorNamespace.LdmlKeyboardCompiler; +// const SevWarn = CompilerErrorSeverity.Warn | CompilerErrorNamespace.KeyboardCompiler; +const SevError = CompilerErrorSeverity.Error | CompilerErrorNamespace.LdmlKeyboardCompiler; +const SevFatal = CompilerErrorSeverity.Fatal | CompilerErrorNamespace.LdmlKeyboardCompiler; + +export class CompilerMessages { + static Error_InvalidNormalization = (o:{form: string}) => m(this.ERROR_InvalidNormalization, `Invalid normalization form '${o.form}`); + static ERROR_InvalidNormalization = SevError | 0x0001; + + static Error_InvalidLocale = (o:{tag: string}) => m(this.ERROR_InvalidLocale, `Invalid BCP 47 locale form '${o.tag}'`); + static ERROR_InvalidLocale = SevError | 0x0002; + + static Error_HardwareLayerHasTooManyRows = () => m(this.ERROR_HardwareLayerHasTooManyRows, `'hardware' layer has too many rows`); + static ERROR_HardwareLayerHasTooManyRows = SevError | 0x0003; + + static Error_RowOnHardwareLayerHasTooManyKeys = (o:{row: number, hardware: string, modifier: string}) => m(this.ERROR_RowOnHardwareLayerHasTooManyKeys, `Row #${o.row} on 'hardware' ${o.hardware} layer for modifier ${o.modifier || 'none'} has too many keys`); + static ERROR_RowOnHardwareLayerHasTooManyKeys = SevError | 0x0004; + + static Error_KeyNotFoundInKeyBag = (o:{keyId: string, col: number, row: number, layer: string, form: string}) => + m(this.ERROR_KeyNotFoundInKeyBag, `Key '${o.keyId}' in position #${o.col} on row #${o.row} of layer ${o.layer}, form '${o.form}' not found in key bag`); + static ERROR_KeyNotFoundInKeyBag = SevError | 0x0005; + + static Hint_OneOrMoreRepeatedLocales = () => + m(this.HINT_OneOrMoreRepeatedLocales, `After minimization, one or more locales is repeated and has been removed`); + static HINT_OneOrMoreRepeatedLocales = SevHint | 0x0006; + + static Error_InvalidFile = (o:{errorText: string}) => + m(this.ERROR_InvalidFile, `The source file has an invalid structure: ${o.errorText}`); + static ERROR_InvalidFile = SevError | 0x0007; + + static Hint_LocaleIsNotMinimalAndClean = (o:{sourceLocale: string, locale: string}) => + m(this.HINT_LocaleIsNotMinimalAndClean, `Locale '${o.sourceLocale}' is not minimal or correctly formatted and should be '${o.locale}'`); + static HINT_LocaleIsNotMinimalAndClean = SevHint | 0x0008; + + static Error_VkeyIsNotValid = (o:{vkey: string}) => + m(this.ERROR_VkeyIsNotValid, `Virtual key '${o.vkey}' is not found in the CLDR VKey Enum table.`); + static ERROR_VkeyIsNotValid = SevError | 0x0009; + + static Hint_VkeyIsRedundant = (o:{vkey: string}) => + m(this.HINT_VkeyIsRedundant, `Virtual key '${o.vkey}' is mapped to itself, which is redundant.`); + static HINT_VkeyIsRedundant = SevHint | 0x000A; + + static Error_VkeyIsRepeated = (o:{vkey: string}) => + m(this.ERROR_VkeyIsRepeated, `Virtual key '${o.vkey}' has more than one vkey entry.`); + static ERROR_VkeyIsRepeated = SevError | 0x000B; + + static Info_MultipleVkeysHaveSameTarget = (o:{vkey: string}) => + m(this.INFO_MultipleVkeysHaveSameTarget, `Target virtual key '${o.vkey}' has multiple source mappings, which may be an error.`); + static INFO_MultipleVkeysHaveSameTarget = SevInfo | 0x000C; + + static Error_InvalidVersion = (o:{version: string}) => + m(this.ERROR_InvalidVersion, `Version number '${o.version}' must be a semantic version format string.`); + static ERROR_InvalidVersion = SevError | 0x000D; + + static Error_MustBeAtLeastOneLayerElement = () => + m(this.ERROR_MustBeAtLeastOneLayerElement, `The source file must contain at least one layer element.`); + static ERROR_MustBeAtLeastOneLayerElement = SevError | 0x000E; + + static Fatal_SectionCompilerFailed = (o:{sect: string}) => + m(this.FATAL_SectionCompilerFailed, `The compiler for '${o.sect}' failed unexpectedly.`); + static FATAL_SectionCompilerFailed = SevFatal | 0x000F; + + static Error_DisplayIsRepeated = (o:{to: string}) => + m(this.ERROR_DisplayIsRepeated, `display to='${o.to}' has more than one display entry.`); + static ERROR_DisplayIsRepeated = SevError | 0x0010; + + static Error_KeyMissingToGapOrSwitch = (o:{keyId: string}) => + m(this.ERROR_KeyMissingToGapOrSwitch, `key id='${o.keyId}' must have either to=, gap=, or switch=.`); + static ERROR_KeyMissingToGapOrSwitch = SevError | 0x0011; + + static Error_ExcessHardware = (o:{form: string}) => m(this.ERROR_ExcessHardware, + `layers form=${o.form}: Can only have one non-'touch' element`); + static ERROR_ExcessHardware = SevError | 0x0012; + + static Error_InvalidHardware = (o:{form: string}) => m(this.ERROR_InvalidHardware, + `layers has invalid value form=${o.form}`); + /** + * Note: may not hit this due to XML validation. + */ + static ERROR_InvalidHardware = SevError | 0x0013; + + static Error_InvalidModifier = (o:{layer: string, modifier: string}) => m(this.ERROR_InvalidModifier, + `layer has invalid modifier='${o.modifier}' on layer id=${o.layer}`); + static ERROR_InvalidModifier = SevError | 0x0014; + + static Error_MissingFlicks = (o:{flicks: string, id: string}) => m(this.ERROR_MissingFlicks, + `key id=${o.id} refers to missing flicks=${o.flicks}`); + static ERROR_MissingFlicks = SevError | 0x0015; +} + diff --git a/developer/src/kmc-ldml/src/compiler/meta.ts b/developer/src/kmc-ldml/src/compiler/meta.ts new file mode 100644 index 0000000000000000000000000000000000000000..feb4d79f173b52fd368eacd24c80a8413e8d4d2b --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/meta.ts @@ -0,0 +1,68 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlus } from '@keymanapp/common-types'; + +import { isValidEnumValue } from "../util/util.js"; +import { CompilerMessages } from "./messages.js"; +import { SectionCompiler } from "./section-compiler.js"; +import semver from "semver"; + +import GlobalSections = KMXPlus.GlobalSections; +import Meta = KMXPlus.Meta; +import Meta_NormalizationForm = KMXPlus.Meta_NormalizationForm; +import KeyboardSettings = KMXPlus.KeyboardSettings; + +export class MetaCompiler extends SectionCompiler { + + public get id() { + return constants.section.meta; + } + + public validate(): boolean { + let valid = true; + + valid &&= this.validateNormalization(this.keyboard.info?.normalization); + valid &&= this.validateVersion(this.keyboard.version?.number); + + return valid; + } + + private validateVersion(versionNumber?: string) { + if(versionNumber !== undefined) { + if(versionNumber.match(/^[=v]/i)) { + // semver ignores a preceding '=' or 'v' + this.callbacks.reportMessage(CompilerMessages.Error_InvalidVersion({ version: versionNumber })); + return false; + } + if(!semver.parse(versionNumber, {loose: false})) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidVersion({ version: versionNumber })); + return false; + } + } + return true; + } + + private validateNormalization(normalization?: string) { + if (normalization !== undefined) { + if (!isValidEnumValue(Meta_NormalizationForm, normalization)) { + this.callbacks.reportMessage(CompilerMessages.Error_InvalidNormalization({ form: normalization })); + return false; + } + } + return true; + } + + public compile(sections: GlobalSections): Meta { + let result = new Meta(); + result.author = sections.strs.allocString(this.keyboard.info?.author); + result.conform = sections.strs.allocString(this.keyboard.conformsTo); + result.layout = sections.strs.allocString(this.keyboard.info?.layout); + result.normalization = sections.strs.allocString(this.keyboard.info?.normalization); + result.indicator = sections.strs.allocString(this.keyboard.info?.indicator); + result.version = sections.strs.allocString(this.keyboard.version?.number ?? "0.0.0"); + result.settings = + (this.keyboard.settings?.fallback == "omit" ? KeyboardSettings.fallback : 0) | + (this.keyboard.settings?.transformFailure == "omit" ? KeyboardSettings.transformFailure : 0) | + (this.keyboard.settings?.transformPartial == "hide" ? KeyboardSettings.transformPartial : 0); + return result; + } +} \ No newline at end of file diff --git a/developer/src/kmc-ldml/src/compiler/metadata-compiler.ts b/developer/src/kmc-ldml/src/compiler/metadata-compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..262b86c8019f19d1fdd733a4c73a4901c9eaa793 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/metadata-compiler.ts @@ -0,0 +1,57 @@ +import { KMX, KMXPlus } from '@keymanapp/common-types'; +import { CompilerOptions } from "./compiler-options.js"; +import KEYMAN_VERSION from "@keymanapp/keyman-version"; + +import KMXPlusData = KMXPlus.KMXPlusData; +import KMXFile = KMX.KMXFile; +import KEYBOARD = KMX.KEYBOARD; + +export class KMXPlusMetadataCompiler { + /** + * Look for metadata fields in the KMXPlus data and copy them + * through to the relevant KMX stores + * @param kmxplus const KMXPlusData + */ + public static addKmxMetadata(kmxplus: KMXPlusData, keyboard: KEYBOARD, options: CompilerOptions): void { + // Order of stores is not significant by kmx spec, but kmxplus compiler will + // always store according to dwSystemID binary order for non-zero + // dwSystemID, then by dpName binary order, and finally by dpString binary + // order + + // TSS_NAME = 7 + // TSS_COMPILEDVERSION = 20 + // TSS_KEYBOARDVERSION = 36 + // TSS_TARGETS = 38 + + // TSS_NAME: User friendly name of keyboard + keyboard.stores.push({ + dpName: '&NAME', + dpString: kmxplus.name?.names?.[0]?.value ?? 'unknown', // Empty name should not happen, so ok to use 'unknown' here + dwSystemID: KMXFile.TSS_NAME + }); + + if(options.addCompilerVersion) { + // TSS_COMPILEDVERSION: version of the compiler + keyboard.stores.push({ + dpName: '', + dpString: KEYMAN_VERSION.VERSION_WITH_TAG, + dwSystemID: KMXFile.TSS_COMPILEDVERSION + }); + } + + // TSS_KEYBOARDVERSION: Version of the keyboard, should be semver + keyboard.stores.push({ + dpName: '&KEYBOARDVERSION', + dpString: kmxplus.meta?.version?.value ?? '1.0', // 1.0 is inferred version + dwSystemID: KMXFile.TSS_KEYBOARDVERSION + }); + + // TSS_TARGETS: which platforms are supported + keyboard.stores.push({ + dpName: '&TARGETS', + dpString: 'desktop', // TODO-LDML: support touch layouts in #7238 + dwSystemID: KMXFile.TSS_TARGETS + }); + } + +} \ No newline at end of file diff --git a/developer/src/kmc-ldml/src/compiler/name.ts b/developer/src/kmc-ldml/src/compiler/name.ts new file mode 100644 index 0000000000000000000000000000000000000000..33fad1ef9aa6f927f20a4a66b6ab1cc88711ec68 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/name.ts @@ -0,0 +1,25 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlus } from '@keymanapp/common-types'; +import { SectionCompiler } from "./section-compiler.js"; + +import GlobalSections = KMXPlus.GlobalSections; +import Name = KMXPlus.Name; + +export class NameCompiler extends SectionCompiler { + + public get id() { + return constants.section.name; + } + + public validate(): boolean { + let valid = true; + valid = (this.keyboard.names?.name?.length ?? 0) > 0; + return valid; + } + + public compile(sections: GlobalSections): Name { + let result = new Name(); + result.names = this.keyboard.names?.name?.map(v => sections.strs.allocString(v.value)) ?? []; + return result; + } +} diff --git a/developer/src/kmc-ldml/src/compiler/ordr.ts b/developer/src/kmc-ldml/src/compiler/ordr.ts new file mode 100644 index 0000000000000000000000000000000000000000..89785f107d621877212820590c7e44c32528ec31 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/ordr.ts @@ -0,0 +1,46 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlus, LDMLKeyboard } from '@keymanapp/common-types'; +import { SectionCompiler } from "./section-compiler.js"; + +import GlobalSections = KMXPlus.GlobalSections; +import Ordr = KMXPlus.Ordr; +import OrdrItem = KMXPlus.OrdrItem; +import LKReorder = LDMLKeyboard.LKReorder; +import LKReorders = LDMLKeyboard.LKReorders; + +export class OrdrCompiler extends SectionCompiler { + + public get id() { + return constants.section.ordr; + } + + public validate(): boolean { + let valid = true; + // TODO-LDML: linting here should check for identical before+from, but this involves a double-parse which is ugly + // TODO-LDML: unicodesets means that either we fully parse them and verify conflicting rules or the linting is imperfect + return valid; + } + + private compileReorder(sections: GlobalSections, reorder: LKReorder): OrdrItem { + let result = new OrdrItem(); + result.elements = sections.elem.allocElementString(sections.strs, reorder.from, reorder.order, reorder.tertiary, reorder.tertiary_base, reorder.prebase); + result.before = sections.elem.allocElementString(sections.strs, reorder.before); + return result; + } + + private compileReorders(sections: GlobalSections, reorders: LKReorders): Ordr { + let result = new Ordr(); + + if(reorders?.reorder) { + for(let reorder of reorders.reorder) { + result.items.push(this.compileReorder(sections, reorder)); + } + } + + return result; + } + + public compile(sections: GlobalSections): Ordr { + return this.compileReorders(sections, this.keyboard.reorders); + } +} diff --git a/developer/src/kmc-ldml/src/compiler/section-compiler.ts b/developer/src/kmc-ldml/src/compiler/section-compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..a96d935190336ea1af257d6e3ec9700af103f400 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/section-compiler.ts @@ -0,0 +1,29 @@ +import { LDMLKeyboard, KMXPlus, CompilerCallbacks } from "@keymanapp/common-types"; +import { SectionIdent } from '@keymanapp/ldml-keyboard-constants'; + +/* istanbul ignore next */ +export class SectionCompiler { + protected readonly keyboard: LDMLKeyboard.LKKeyboard; + protected readonly callbacks: CompilerCallbacks; + + constructor(source: LDMLKeyboard.LDMLKeyboardXMLSourceFile, callbacks: CompilerCallbacks) { + this.keyboard = source.keyboard; + this.callbacks = callbacks; + } + + public get id(): SectionIdent { + return null; + } + + public get required(): boolean { + return true; + } + + public compile(sections: KMXPlus.GlobalSections): KMXPlus.Section { + return null; + } + + public validate(): boolean { + return true; + } +} diff --git a/developer/src/kmc-ldml/src/compiler/touch-layout-compiler.ts b/developer/src/kmc-ldml/src/compiler/touch-layout-compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..311f213749531aa1a28286afcb7e3c639151599e --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/touch-layout-compiler.ts @@ -0,0 +1,109 @@ +import { TouchLayout, LDMLKeyboard } from "@keymanapp/common-types"; + +export class TouchLayoutCompiler { + public compileToJavascript(source: LDMLKeyboard.LDMLKeyboardXMLSourceFile): TouchLayout.TouchLayoutFile { + let result: TouchLayout.TouchLayoutFile = {}; + + // start with desktop to mimic vk emit + result.desktop = { + defaultHint: "none", // TODO-LDML this should be optional + layer: [] + }; + + for(let layers of source.keyboard.layers) { + for(let layer of layers.layer) { + const resultLayer = this.compileHardwareLayer(source, result, layer); + result.desktop.layer.push(resultLayer); + } + } + return result; + } + + private compileHardwareLayer( + source: LDMLKeyboard.LDMLKeyboardXMLSourceFile, + file: TouchLayout.TouchLayoutFile, + layer: LDMLKeyboard.LKLayer + ) { + // TODO-LDML: consider consolidation with keys.ts? + + let fileLayer: TouchLayout.TouchLayoutLayer = { + id: this.translateLayerIdToTouchLayoutLayerId(layer.id, layer.modifier), + row: [] + }; + + let y = -1; + + for(let row of layer.row) { + y++; + + let fileRow: TouchLayout.TouchLayoutRow = {id: y, key: []}; + fileLayer.row.push(fileRow); + + const keys = row.keys.split(' '); + for(let key of keys) { + const keydef = source.keyboard.keys?.key?.find(x => x.id == key); + if(keydef) { + const fileKey: TouchLayout.TouchLayoutKey = { + id: this.translateKeyIdentifierToTouch(keydef.id) as TouchLayout.TouchLayoutKeyId, + text: keydef.to || '', + // TODO-LDML: additional properties + }; + fileRow.key.push(fileKey); + } else { + // TODO-LDML: consider logging missing keys + } + } + } + + return fileLayer; + } + + private translateLayerIdToTouchLayoutLayerId(id: string, modifier: string): string { + // Touch layout layers have a set of reserved names that correspond to + // hardware modifiers. We want to map these identifiers first before falling + // back to the layer ids + + // The set of recognized layer identifiers is: + // + // touch | LDML + // ---------------+------------- + // default | none + // shift | shift + // caps | caps + // rightalt | altR + // rightalt-shift | altR shift + // + + const map = { + none: 'default', + shift: 'shift', + caps: 'caps', + altR: 'rightalt', + "altR shift": 'rightalt-shift' + }; + + // canonicalize modifier string, alphabetical + modifier = (modifier||'').split(/\b/).sort().join(' ').trim(); + + if(Object.hasOwn(map, modifier)) { + return (map as any)[modifier]; + } + + // TODO-LDML: Other layer names will be used unmodified, is this sufficient? + return id; + } + + private translateKeyIdentifierToTouch(id: string): string { + // Note: keys identifiers in kmx were traditionally case-insensitive, but we + // are going to use them as case-insensitive for LDML keyboards. The set of + // standard key identifiers a-z, A-Z, 0-9 will be used, where possible, and + // all other keys will be mapped to `T_key`. + + if(id.match(/^[0-9a-zA-Z]$/)) { + return 'K_'+id; + } + + // Not a standard key + return 'T_'+id; + } +} \ No newline at end of file diff --git a/developer/src/kmc-ldml/src/compiler/tran.ts b/developer/src/kmc-ldml/src/compiler/tran.ts new file mode 100644 index 0000000000000000000000000000000000000000..428dbd64f77db8bbb93b67fe5a3de9b91566e06d --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/tran.ts @@ -0,0 +1,119 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlus, LDMLKeyboard, CompilerCallbacks } from '@keymanapp/common-types'; +import { SectionCompiler } from "./section-compiler.js"; + +import Finl = KMXPlus.Finl; +import FinlItem = KMXPlus.FinlItem; +import Bksp = KMXPlus.Bksp; +import BkspItem = KMXPlus.BkspItem; +import GlobalSections = KMXPlus.GlobalSections; +import Tran = KMXPlus.Tran; +import TranItem = KMXPlus.TranItem; +import TranItemFlags = KMXPlus.TranItemFlags; +import LDMLKeyboardXMLSourceFile = LDMLKeyboard.LDMLKeyboardXMLSourceFile; +import LKTransform = LDMLKeyboard.LKTransform; +import LKTransforms = LDMLKeyboard.LKTransforms; + +type TransformCompilerType = 'simple' | 'final' | 'backspace'; + +class TransformCompiler extends SectionCompiler { + + protected type: T; + + constructor(source: LDMLKeyboardXMLSourceFile, callbacks: CompilerCallbacks) { + super(source, callbacks); + } + + public validate(): boolean { + let valid = true; + // TODO-LDML: linting here should check for identical before+from, but this involves a double-parse which is ugly + // TODO-LDML: unicodesets means that either we fully parse them and verify conflicting rules or the linting is imperfect + return valid; + } + + protected newTranItem(): TranItemBase { + return null; + } + + protected newTran(): TranBase { + return null; + } + + private compileTransform(sections: GlobalSections, transform: LKTransform): TranItemBase { + let result = this.newTranItem(); + result.from = sections.elem.allocElementString(sections.strs, transform.from); + result.to = sections.strs.allocAndUnescapeString(transform.to); + result.before = sections.elem.allocElementString(sections.strs, transform.before); + result.flags = transform.error == 'fail' ? TranItemFlags.error : TranItemFlags.none; + return result; + } + + private compileTransforms(sections: GlobalSections, transforms: LKTransforms): TranBase { + let result = this.newTran(); + + if(transforms?.transform) { + for(let transform of transforms.transform) { + result.items.push(this.compileTransform(sections, transform)); + } + } + + return result; + } + + public compile(sections: GlobalSections): TranBase { + for(let t of this.keyboard.transforms) { + if(t.type == this.type) { + return this.compileTransforms(sections, t); + } + } + return this.newTran(); + } +} + +export class TranCompiler extends TransformCompiler<'simple', Tran, TranItem> { + constructor(source: LDMLKeyboardXMLSourceFile, callbacks: CompilerCallbacks) { + super(source, callbacks); + this.type = 'simple'; + } + protected newTranItem(): TranItem { + return new TranItem(); + } + protected newTran(): Tran { + return new Tran(); + } + public get id() { + return constants.section.tran; + } +}; + +export class FinlCompiler extends TransformCompiler<'final', Finl, FinlItem> { + constructor(source: LDMLKeyboardXMLSourceFile, callbacks: CompilerCallbacks) { + super(source, callbacks); + this.type = 'final'; + } + protected newTranItem(): FinlItem { + return new FinlItem(); + } + protected newTran(): Finl { + return new Finl(); + } + public get id() { + return constants.section.finl; + } +}; + +export class BkspCompiler extends TransformCompiler<'backspace', Bksp, BkspItem> { + constructor(source: LDMLKeyboardXMLSourceFile, callbacks: CompilerCallbacks) { + super(source, callbacks); + this.type = 'backspace'; + } + protected newTranItem(): BkspItem { + return new BkspItem(); + } + protected newTran(): Bksp { + return new Bksp(); + } + public get id() { + return constants.section.bksp; + } +}; diff --git a/developer/src/kmc-ldml/src/compiler/visual-keyboard-compiler.ts b/developer/src/kmc-ldml/src/compiler/visual-keyboard-compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..d951080b9b41467553e235db92cede920f2789c1 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/visual-keyboard-compiler.ts @@ -0,0 +1,64 @@ +import { Constants, VisualKeyboard, LDMLKeyboard } from "@keymanapp/common-types"; + +export class LdmlKeyboardVisualKeyboardCompiler { + public compile(source: LDMLKeyboard.LDMLKeyboardXMLSourceFile): VisualKeyboard.VisualKeyboard { + let result = new VisualKeyboard.VisualKeyboard(); + + /* TODO-LDML: consider VisualKeyboardHeaderFlags.kvkhUseUnderlying kvkhDisplayUnderlying kvkhAltGr kvkh102 */ + result.header.flags = 0; + result.header.version = 0x0600; + + /* TODO-LDML: consider font, associatedKeyboard */ + result.header.associatedKeyboard = ''; + result.header.ansiFont.name = 'Arial'; + result.header.ansiFont.size = 10; + result.header.ansiFont.color = 0; + result.header.unicodeFont.name = 'Arial'; + result.header.unicodeFont.size = 10; + result.header.unicodeFont.color = 0; + + for(let layers of source.keyboard.layers) { + for(let layer of layers.layer) { + this.compileHardwareLayer(source, result, layer); + } + } + return result; + } + + private compileHardwareLayer( + source: LDMLKeyboard.LDMLKeyboardXMLSourceFile, + vk: VisualKeyboard.VisualKeyboard, + layer: LDMLKeyboard.LKLayer + ) { + // TODO-LDML: consider consolidation with keys.ts? + const shift = this.translateLayerIdToVisualKeyboardShift(layer.id); + + let y = -1; + for(let row of layer.row) { + y++; + + const keys = row.keys.split(' '); + let x = -1; + for(let key of keys) { + x++; + + let keydef = source.keyboard.keys?.key?.find(x => x.id == key); + + vk.keys.push({ + flags: VisualKeyboard.VisualKeyboardKeyFlags.kvkkUnicode, + shift: shift, + text: keydef.to, // TODO-LDML: displays + vkey: Constants.USVirtualKeyMap[y][x] // TODO-LDML: #7965 US-only + }); + } + } + } + + private translateLayerIdToVisualKeyboardShift(id: string) { + if(id == 'base') { + return 0; + } + // TODO-LDML: other modifiers + return 0; + } +} diff --git a/developer/src/kmc-ldml/src/compiler/vkey.ts b/developer/src/kmc-ldml/src/compiler/vkey.ts new file mode 100644 index 0000000000000000000000000000000000000000..c9b58b693c64730d2fdd625b5a409b9b07ae9c53 --- /dev/null +++ b/developer/src/kmc-ldml/src/compiler/vkey.ts @@ -0,0 +1,70 @@ +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { KMXPlus, Constants } from '@keymanapp/common-types'; +import { CompilerMessages } from "./messages.js"; +import { SectionCompiler } from "./section-compiler.js"; + +import Vkey = KMXPlus.Vkey; +import LdmlVkeyNames = Constants.LdmlVkeyNames; + +export class VkeyCompiler extends SectionCompiler { + + public get id() { + return constants.section.vkey; + } + + public get required(): boolean { + return !!this.keyboard.vkeys; + } + + public validate(): boolean { + let valid = true; + if(this.keyboard.vkeys) { + let from: string[] = [], to: string[] = []; + + this.keyboard.vkeys.vkey.forEach(vk => { + if(LdmlVkeyNames[vk.from] === undefined) { + this.callbacks.reportMessage(CompilerMessages.Error_VkeyIsNotValid({vkey: vk.from})); + valid = false; + } + + if(LdmlVkeyNames[vk.to] === undefined) { + this.callbacks.reportMessage(CompilerMessages.Error_VkeyIsNotValid({vkey: vk.to})); + valid = false; + } + + if(vk.from == vk.to) { + this.callbacks.reportMessage(CompilerMessages.Hint_VkeyIsRedundant({vkey: vk.from})); + } + + if(from.find(svk => svk == vk.from)) { + this.callbacks.reportMessage(CompilerMessages.Error_VkeyIsRepeated({vkey: vk.from})); + valid = false; + } + from.push(vk.from); + + if(to.find(svk => svk == vk.to)) { + this.callbacks.reportMessage(CompilerMessages.Info_MultipleVkeysHaveSameTarget({vkey: vk.to})); + } + to.push(vk.to); + }); + } + return valid; + } + + public compile(): Vkey { + let result = new Vkey(); + if(!this.keyboard.vkeys) { + return result; + } + + result.vkeys = this.keyboard.vkeys?.vkey.map(vk => { + return { + vkey: LdmlVkeyNames[vk.from], + target: LdmlVkeyNames[vk.to] + }; + }); + // Sort according to vkey binary order, per C7043 + result.vkeys.sort((a,b) => a.vkey - b.vkey); + return result; + } +} diff --git a/developer/src/kmc-ldml/src/main.ts b/developer/src/kmc-ldml/src/main.ts new file mode 100644 index 0000000000000000000000000000000000000000..5d5d2f09e64947c9bf79baa94f6d9eeaa01e0e6e --- /dev/null +++ b/developer/src/kmc-ldml/src/main.ts @@ -0,0 +1,10 @@ + +export { LdmlKeyboardCompiler } from './compiler/compiler.js'; +export { LdmlKeyboardKeymanWebCompiler } from './compiler/keymanweb-compiler.js'; +export { LdmlKeyboardVisualKeyboardCompiler } from './compiler/visual-keyboard-compiler.js'; +export { TouchLayoutCompiler } from './compiler/touch-layout-compiler.js'; +export { CompilerOptions } from './compiler/compiler-options.js'; +export { CompilerMessages } from './compiler/messages.js'; +export { KMXPlusMetadataCompiler } from './compiler/metadata-compiler.js'; + +export { KMXBuilder } from "@keymanapp/common-types"; diff --git a/developer/src/kmc-ldml/src/util/util.ts b/developer/src/kmc-ldml/src/util/util.ts new file mode 100644 index 0000000000000000000000000000000000000000..7caad74e3a317f3cc26422bb768f58b0723428f4 --- /dev/null +++ b/developer/src/kmc-ldml/src/util/util.ts @@ -0,0 +1,91 @@ +import { LDMLKeyboard } from "@keymanapp/common-types"; +import { constants } from "@keymanapp/ldml-keyboard-constants"; +/** + * Verifies that value is an item in the enumeration. + */ +export function isValidEnumValue(enu: T, value: string) { + return (Object.values(enu) as string[]).includes(value); +} + +/** + * Returns unique LKKeys only, preserving later ones + * in case of conflict. (i.e. later overrides) + * @param keys list of keys to consider. (mutated) + * @returns Array of unique keys. Order is not specified. + */ +export function calculateUniqueKeys(keys?: LDMLKeyboard.LKKey[]): LDMLKeyboard.LKKey[] { + if (!keys) { + return []; + } + // Need 'newer' (later) keys to override older ones. + const reverseKeys = keys.reverse(); // newest to oldest + const alreadySeen = new Set(); + // filter out only the keys that haven't already been seen + const uniqueKeys = reverseKeys.filter(({ id }) => { + if (!alreadySeen.has(id)) { + alreadySeen.add(id); + return true; + } + return false; + }); + + return uniqueKeys; +} + +/** + * + * @param layersList list of layers elements, from `keyboard?.layers` + * @returns set of key IDs + */ +export function allUsedKeyIdsInLayers(layersList : LDMLKeyboard.LKLayers[] | null): Set { + const s = new Set(); + if (layersList) { + for (const layers of layersList || []) { + for (const layer of layers.layer || []) { + for (const row of layer.row || []) { + if (row.keys) { + for (const k of row.keys.split(" ")) { + s.add(k); + } + } + } + } + } + } + return s; +} + +/** + * Determine modifier from layer info + * @param layer layer obj + * @returns modifier + */ +export function translateLayerAttrToModifier(layer: LDMLKeyboard.LKLayer) : number { + const { modifier } = layer; + if (modifier) { + let mod = constants.keys_mod_none; + for (let str of modifier.split(' ')) { + const submod = constants.keys_mod_map.get(str); + mod |= submod; + } + return mod; + } + // TODO-LDML: other modifiers, other ids? + return constants.keys_mod_none; +} + +/** + * @param modifier modifier sequence such as undefined, "none", "shift altR" etc + * @returns true if valid + */ +export function validModifier(modifier?: string) : boolean { + if (!modifier) return true; // valid to have no modifier, == none + for (let str of modifier.split(' ')) { + if (!constants.keys_mod_map.has(str)) { + return false; + } + } + return true; +} + + diff --git a/developer/src/kmc-ldml/test/README.md b/developer/src/kmc-ldml/test/README.md new file mode 100644 index 0000000000000000000000000000000000000000..50e58784d29ee8f850e2fe20528d31f7c4d53760 --- /dev/null +++ b/developer/src/kmc-ldml/test/README.md @@ -0,0 +1,7 @@ +Keyman LDML Keyboard Compiler Tests +=================================== + +Test +---- + + ../build.sh test diff --git a/developer/src/kmc-ldml/test/fixtures/basic-kvk.txt b/developer/src/kmc-ldml/test/fixtures/basic-kvk.txt new file mode 100644 index 0000000000000000000000000000000000000000..341beb3597bfe600cf56adf3125e471395c12f3f --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/basic-kvk.txt @@ -0,0 +1,53 @@ +# +# basic-kvk.txt describes the expected output of running kmc against basic.xml to generate +# a .kvk file. It is used in the end-to-end test test-visual-keyboard-compiler-e2e.ts. +# +# Any changes to the compiler or basic.xml will likely result in changes to the compiled file. +# + +block(kvkheader) + 4b 56 4b 46 # identifier 'KVKF' + 00 06 00 00 # version 0x0600 + 00 # flags +block(associated_keyboard) + 01 00 # string len in UTF-16 code units incl zterm + 00 00 # '\0' + +block(ansi_font) + 06 00 # string len in UTF-16 code units incl zterm + 41 00 72 00 69 00 61 00 6c 00 00 00 # 'Arial\0' + +block(ansi_font_extra) + 0a 00 00 00 # size + 00 00 00 00 # color + +block(unicode_font) + 06 00 # string len in UTF-16 code units incl zterm + 41 00 72 00 69 00 61 00 6c 00 00 00 # 'Arial\0' + +block(unicode_font_extra) + 0a 00 00 00 # size + 00 00 00 00 # color + +block(keys_header) + 02 00 00 00 # number of keys + +block(keys) + +block(key0) + 02 # flags = unicode + 00 00 # shift + c0 00 # vkey + 02 00 # string len in UTF-16 code units incl zterm + 27 01 00 00 # "ħ" + 00 00 00 00 # bitmap + +block(key1) + 02 # flags = unicode + 00 00 # shift + 31 00 # vkey + 03 00 # string len in UTF-16 code units incl zterm + 90 17 b6 17 00 00 # "ថា" + 00 00 00 00 # bitmap + +block(eof) # end of file \ No newline at end of file diff --git a/developer/src/kmc-ldml/test/fixtures/basic-no-debug.js b/developer/src/kmc-ldml/test/fixtures/basic-no-debug.js new file mode 100644 index 0000000000000000000000000000000000000000..177d55963eed5e39e7e4fb58f0a264405989b7d9 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/basic-no-debug.js @@ -0,0 +1 @@ +if(typeof keyman === 'undefined') {console.error('Keyboard requires KeymanWeb 16.0 or later');} else {KeymanWeb.KR(new Keyboard_basic());}function Keyboard_basic() {this.KI="Keyboard_basic";this.KN={"value":"TestKbd"};this.KMINVER="16.0";this.KV={F: '10pt "Arial"', K102: 0};this.KV.KLS={TODO_LDML: 2};this.KDU=1;this.KH="";this.KM=0;this.KBVER="1.0.0";this.KMBM=0;this.KVKL={"desktop":{"defaultHint":"none","layer":[{"id":"base","row":[{"id":0,"key":[{"id":"T_hmaqtugha","text":"ħ"},{"id":"T_that","text":"ថា"}]}]}]}};this.gs=function(t,e){return 0;};} \ No newline at end of file diff --git a/developer/src/kmc-ldml/test/fixtures/basic.js b/developer/src/kmc-ldml/test/fixtures/basic.js new file mode 100644 index 0000000000000000000000000000000000000000..59a1902ee6795c4daf6660cefc75b04c79cd7d54 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/basic.js @@ -0,0 +1,47 @@ +if(typeof keyman === 'undefined') { + console.error('Keyboard requires KeymanWeb 16.0 or later'); +} else { + KeymanWeb.KR(new Keyboard_basic()); +} +function Keyboard_basic() { + this.KI="Keyboard_basic"; + this.KN={"value":"TestKbd"}; + this.KMINVER="16.0"; + this.KV={F: '10pt "Arial"', K102: 0}; + this.KV.KLS={ + TODO_LDML: 2 + }; + this.KDU=1; + this.KH=""; + this.KM=0; + this.KBVER="1.0.0"; + this.KMBM=0; + this.KVKL={ + "desktop": { + "defaultHint": "none", + "layer": [ + { + "id": "base", + "row": [ + { + "id": 0, + "key": [ + { + "id": "T_hmaqtugha", + "text": "ħ" + }, + { + "id": "T_that", + "text": "ថា" + } + ] + } + ] + } + ] + } +}; + this.gs=function(t,e){ + return 0; + }; +} diff --git a/developer/src/kmc-ldml/test/fixtures/basic.txt b/developer/src/kmc-ldml/test/fixtures/basic.txt new file mode 100644 index 0000000000000000000000000000000000000000..195066648dd526b2d48342035e9cf4ff514a4540 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/basic.txt @@ -0,0 +1,509 @@ +# +# basic.txt describes the expected output of running kmc against basic.xml. It is used in +# the end-to-end test test-compiler-e2e.ts. +# +# Any changes to the compiler or basic.xml will likely result in changes to the compiled file. +# While structural differences should be updated manually in this file to ensure that we are +# getting the expected result for the e2e test, the checksum can be safely retrieved from the +# updated compilation result. The following may be helpful for working with this file when +# updating the binary format: +# +# cd developer/src/kmc +# ./build.sh configure build # if needed +# ./build.sh build-fixtures +# +# This will compile both the .xml and the .txt to build/test/fixtures and also emit the +# checksum for basic-xml.kmx so you can patch that into this file. +# + +block(kmxheader) # struct COMP_KEYBOARD { + 4b 58 54 53 # KMX_DWORD dwIdentifier; // 0000 Keyman compiled keyboard id + + 00 10 00 00 # KMX_DWORD dwFileVersion; // 0004 Version of the file - Keyman 4.0 is 0x0400 + + 00 00 00 00 # KMX_DWORD dwCheckSum; // 0008 deprecated in 16.0, always 0 + 00 00 00 00 # KMX_DWORD KeyboardID; // 000C as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts + 01 00 00 00 # KMX_DWORD IsRegistered; // 0010 + 00 00 00 00 # KMX_DWORD version; // 0014 keyboard version + + sizeof(stores,12) # KMX_DWORD cxStoreArray; // 0018 in array entries + 00 00 00 00 # KMX_DWORD cxGroupArray; // 001C in array entries + + offset(stores) # KMX_DWORD dpStoreArray; // 0020 [LPSTORE] address of first item in store array + 00 00 00 00 # KMX_DWORD dpGroupArray; // 0024 [LPGROUP] address of first item in group array + + ff ff ff ff # KMX_DWORD StartGroup[2]; // 0028 index of starting groups [2 of them] + ff ff ff ff # + + 20 00 00 00 # KMX_DWORD dwFlags; // 0030 Flags for the keyboard file + + 00 00 00 00 # KMX_DWORD dwHotKey; // 0034 standard windows hotkey (hiword=shift/ctrl/alt stuff, loword=vkey) + + 00 00 00 00 # KMX_DWORD dpBitmapOffset; // 0038 offset of the bitmaps in the file + 00 00 00 00 # KMX_DWORD dwBitmapSize; // 003C size in bytes of the bitmaps + # }; + +block(kmxplusinfo) # struct COMP_KEYBOARD_KMXPLUSINFO { + offset(sect) # KMX_DWORD dpKMXPlus; // 0040 offset of KMXPlus data from BOF, header is first + diff(sect,eof) # KMX_DWORD dwKMXPlusSize; // 0044 size in bytes of entire KMXPlus data + # }; + +block(stores) # struct COMP_STORE { + 07 00 00 00 # KMX_DWORD dwSystemID; - TSS_NAME + offset(store_name_name) # KMX_DWORD dpName; + offset(store_name_string) # KMX_DWORD dpString; + # }; + # excluding this so we don't have compiled version changes + # 14 00 00 00 # KMX_DWORD dwSystemID; - TSS_COMPILEDVERSION + # offset(store_compiledversion_name) # KMX_DWORD dpName; + # offset(store_compiledversion_string) # KMX_DWORD dpString; + # }; + 24 00 00 00 # KMX_DWORD dwSystemID; - TSS_KEYBOARDVERSION + offset(store_keyboardversion_name) # KMX_DWORD dpName; + offset(store_keyboardversion_string) # KMX_DWORD dpString; + # }; + 26 00 00 00 # KMX_DWORD dwSystemID; - TSS_TARGETS + offset(store_targets_name) # KMX_DWORD dpName; + offset(store_targets_string) # KMX_DWORD dpString; + # }; + +block(store_name_name) + 26 00 4e 00 41 00 4d 00 45 00 00 00 # '&NAME' +block(store_name_string) + 54 00 65 00 73 00 74 00 4b 00 62 00 64 00 00 00 # 'TestKbd' + +block(store_keyboardversion_name) + 26 00 4b 00 45 00 59 00 42 00 4f 00 41 00 52 00 + 44 00 56 00 45 00 52 00 53 00 49 00 4f 00 4e 00 + 00 00 # '&KEYBOARDVERSION' +block(store_keyboardversion_string) + 31 00 2e 00 30 00 2e 00 30 00 00 00 # '1.0.0' + +block(store_targets_name) + 26 00 54 00 41 00 52 00 47 00 45 00 54 00 53 00 00 00 # '&TARGETS' +block(store_targets_string) + 64 00 65 00 73 00 6b 00 74 00 6f 00 70 00 00 00 # 'desktop' + +block(sect) # struct COMP_KMXPLUS_SECT { + 73 65 63 74 # KMX_DWORD header.ident; // 0000 Section name + diff(sect,endsect) # KMX_DWORD header.size; // 0004 Section length + diff(sect,eof) # KMX_DWORD total; // 0008 KMXPlus entire length + sizeof(sectitems,8) # KMX_DWORD count; // 000C number of section headers + # }; + # Next sections are sect entries + # KMX_DWORD sect; // 0010+ Section identity + # KMX_DWORD offset; // 0014+ Section offset relative to dpKMXPlus of section + +block(sectitems) + # 62 6b 73 70 + # diff(sect,bksp) + + 64 69 73 70 + diff(sect,disp) + + 65 6c 65 6d + diff(sect,elem) + + # 66 69 6e 6c + # diff(sect,finl) + + 6b 65 79 73 + diff(sect,keys) + + 6c 61 79 72 + diff(sect,layr) + + 6c 69 73 74 + diff(sect,list) + + 6c 6f 63 61 + diff(sect,loca) + + 6d 65 74 61 + diff(sect,meta) + + 6e 61 6d 65 + diff(sect,name) + + # 6f 72 64 72 + # diff(sect,ordr) + + 73 74 72 73 + diff(sect,strs) + + # 74 72 61 6e + # diff(sect,tran) + + 76 6b 65 79 + diff(sect,vkey) + +block(endsect) + +# ---------------------------------------------------------------------------------------------------- +# bksp +# ---------------------------------------------------------------------------------------------------- + +# block(bksp) +# 62 6b 73 70 +# sizeof(bksp) +# 01 00 00 00 # KMX_DWORD count; // 0008 number of entries +# # }; + +# # struct COMP_KMXPLUS_TRAN_ENTRY { +# index(elemNull,elemBkspFrom) # KMXPLUS_ELEM from; +# 00 00 00 00 # KMXPLUS_STR to; +# 00 00 00 00 # KMXPLUS_ELEM before; +# 00 00 00 00 # KMX_DWORD flags; +# # }; + + +# ---------------------------------------------------------------------------------------------------- +# disp +# ---------------------------------------------------------------------------------------------------- + +block(disp) # struct COMP_KMXPLUS_DISP { + 64 69 73 70 # KMX_DWORD header.ident; // 0000 Section name - disp + sizeof(disp) # KMX_DWORD header.size; // 0004 Section length + 01 00 00 00 # KMX_DWORD count; // 0008 number of entries + index(strNull,strElemBkspFrom2,2) # KMX_DWORD baseCharacter // 000C baseCharacter = 'e' + # }; + + # only entry: + index(strNull,strElemTranFrom2,2) # KMX_DWORD to // 000C baseCharacter = 'a' + index(strNull,strElemTranFrom1,2) # KMX_DWORD display // 000C baseCharacter = '^' + + + +# ---------------------------------------------------------------------------------------------------- +# elem +# ---------------------------------------------------------------------------------------------------- + +block(elem) # struct COMP_KMXPLUS_ELEM { + 65 6c 65 6d # KMX_DWORD header.ident; // 0000 Section name - elem + diff(elem,endelem) # KMX_DWORD header.size; // 0004 Section length + index(elemNull,endelem) # KMX_DWORD count; // 0008 number of entries + # }; + + 00 00 00 00 # KMX_DWORD offset; // 0010+ offset from this blob + sizeof(elemNull,8) # KMX_DWORD length; // 0014+ str length (ELEMENT units) + + # diff(elem,elemFinlFrom) # KMX_DWORD offset; // 0010+ offset from this blob + # sizeof(elemFinlFrom,8) # KMX_DWORD length; // 0014+ str length (ELEMENT units) + + # diff(elem,elemTranFrom) # KMX_DWORD offset; // 0010+ offset from this blob + # sizeof(elemTranFrom,8) # KMX_DWORD length; // 0014+ str length (ELEMENT units) + + # diff(elem,elemBkspFrom) # KMX_DWORD offset; // 0010+ offset from this blob + # sizeof(elemBkspFrom,8) # KMX_DWORD length; // 0014+ str length (ELEMENT units) + + # diff(elem,elemOrdrFrom) # KMX_DWORD offset; // 0010+ offset from this blob + # sizeof(elemOrdrFrom,8) # KMX_DWORD length; // 0014+ str length (ELEMENT units) + + # diff(elem,elemOrdrBefore) # KMX_DWORD offset; // 0010+ offset from this blob + # sizeof(elemOrdrBefore,8) # KMX_DWORD length; // 0014+ str length (ELEMENT units) + + +block(elemNull) + +# block(elemFinlFrom) +# index(strNull,strElemTranFrom1,2) # KMX_DWORD element; // str: output string or UTF-32LE codepoint +# 01 00 00 00 # KMX_DWORD flags; // flag and order values - unicodeset +# index(strNull,strElemTranFrom1,2) # KMX_DWORD element; // str: output string or UTF-32LE codepoint +# 01 00 00 00 # KMX_DWORD flags; // flag and order values - unicodeset + +# block(elemTranFrom) +# index(strNull,strElemTranFrom1,2) # KMX_DWORD element; // str: output string or UTF-32LE codepoint +# 01 00 00 00 # KMX_DWORD flags; // flag and order values - unicodeset +# index(strNull,strElemTranFrom2,2) # KMX_DWORD element; // str: output string or UTF-32LE codepoint +# 01 00 00 00 # KMX_DWORD flags; // flag and order values - unicodeset + +# block(elemBkspFrom) +# index(strNull,strElemTranFrom1,2) # KMX_DWORD element; // str: output string or UTF-32LE codepoint +# 01 00 00 00 # KMX_DWORD flags; // flag and order values - unicodeset +# index(strNull,strElemBkspFrom2,2) # KMX_DWORD element; // str: output string or UTF-32LE codepoint +# 01 00 00 00 # KMX_DWORD flags; // flag and order values - unicodeset + +# block(elemOrdrFrom) +# # +# index(strNull,strElemOrdrFrom1,2) # KMX_DWORD element; // str: output string or UTF-32LE codepoint +# 01 00 0A 00 # KMX_DWORD flags; // flag and order values - unicodeset +# index(strNull,strElemOrdrFrom2,2) # KMX_DWORD element; // str: output string or UTF-32LE codepoint +# 01 00 37 00 # KMX_DWORD flags; // flag and order values - unicodeset +# index(strNull,strElemOrdrFrom3,2) # KMX_DWORD element; // str: output string or UTF-32LE codepoint +# 01 00 0A 00 # KMX_DWORD flags; // flag and order values - unicodeset + +# block(elemOrdrBefore) +# index(strNull,strElemOrdrBefore,2) # KMX_DWORD element; // str: output string or UTF-32LE codepoint +# 01 00 00 00 # KMX_DWORD flags; // flag and order values - unicodeset + +block(endelem) + +# ---------------------------------------------------------------------------------------------------- +# finl +# ---------------------------------------------------------------------------------------------------- + +# block(finl) +# 66 69 6e 6c +# sizeof(finl) +# 01 00 00 00 # KMX_DWORD count; // 0008 number of entries +# # }; + +# # struct COMP_KMXPLUS_TRAN_ENTRY { +# index(elemNull,elemFinlFrom) # KMXPLUS_ELEM from; +# index(strNull,strElemTranFrom1,2) # KMXPLUS_STR to; +# 00 00 00 00 # KMXPLUS_ELEM before; +# 01 00 00 00 # KMX_DWORD flags; +# # }; +# ---------------------------------------------------------------------------------------------------- +# keys +# ---------------------------------------------------------------------------------------------------- + +block(keys) # struct COMP_KMXPLUS_KEYS { + 6b 65 79 73 # KMX_DWORD header.ident; // 0000 Section name - keys + sizeof(keys) # KMX_DWORD header.size; // 0004 Section length + 02 00 00 00 # KMX_DWORD keyCount + 01 00 00 00 # KMX_DWORD flicksCount + 00 00 00 00 # KMX_DWORD flickCount + 02 00 00 00 # KMX_DWORD kmapCount; // 0008 number of kmap + # keys + # (#0000) hmaqtugha + index(strNull,strKey1,2) # KMXPLUS_STR 'U+0127' + 01 00 00 00 # KMX_DWORD (flags: extend) + index(strNull,strHmaqtugha,2) # KMXPLUS_STR 'hmaqtugha' + 00 00 00 00 # KMXPLUS_STR switch + 0A 00 00 00 # KMX_DWORD width*10 + 01 00 00 00 # TODO: index(listNull,indexAe,4) # LIST longPress 'a e' + 00 00 00 00 # STR longPressDefault + 00 00 00 00 # TODO: index(listNull,listNull,4) # LIST multiTap + 00 00 00 00 # flicks 0 + # (#0001) that + index(strNull,strKeys,2) # KMXPLUS_STR 'U+0127' + 01 00 00 00 # KMX_DWORD flags = extend + index(strNull,strThat,2) # KMXPLUS_STR 'hmaqtugha' + 00 00 00 00 # KMXPLUS_STR switch + 0A 00 00 00 # KMX_DWORD width*10 + 00 00 00 00 # TODO: index(listNull,listNull,4) # LIST longPress + 00 00 00 00 # STR longPressDefault + 00 00 00 00 # TODO: index(listNull,listNull,4) # LIST multiTap + 00 00 00 00 # flicks 0 + # flicks + # flicks 0 - null + 00 00 00 00 # KMX_DWORD count + 00 00 00 00 # KMX_DWORD flick + 00 00 00 00 # KMX_STR id + # flick + # Right now there aren't any flick elements. + #00 00 00 00 # LIST directions + #00 00 00 01 # flags + #00 00 00 00 # str: to + # kmapdata: + + 31 00 00 00 00 00 00 00 01 00 00 00 # KMX_DWORD vkey, mod, key; + c0 00 00 00 00 00 00 00 00 00 00 00 # KMX_DWORD vkey, mod, key; + + +# ---------------------------------------------------------------------------------------------------- +# layr +# ---------------------------------------------------------------------------------------------------- + +block(layr) # struct COMP_KMXPLUS_LAYR { + 6c 61 79 72 # KMX_DWORD header.ident; // 0000 Section name - layr + sizeof(layr) # KMX_DWORD header.size; // 0004 Section length + 01 00 00 00 # KMX_DWORD listCount + 01 00 00 00 # KMX_DWORD layerCount + 01 00 00 00 # KMX_DWORD rowCount + 02 00 00 00 # KMX_DWORD keyCount + # list 0 + 04 00 00 00 # KMX_DWORD hardware = 'us' + 00 00 00 00 # KMX_DWORD layer; + 01 00 00 00 # count + 7B 00 00 00 # KMX_DWORD minDeviceWidth; // 123 + # layers 0 + index(strNull,strBase,2) # KMXPLUS_STR id; + 00 00 00 00 # KMX_DWORD mod + 00 00 00 00 # KMX_DWORD row index + 01 00 00 00 # KMX_DWORD count + # rows 0 + 00 00 00 00 # KMX_DWORD key index + 02 00 00 00 # KMX_DWORD count + # keys + index(strNull,strHmaqtugha,2) # KMXPLUS_STR locale; // 'hmaqtugha' + index(strNull,strThat,2) # KMXPLUS_STR locale; // 'that' + +# ---------------------------------------------------------------------------------------------------- +# list +# ---------------------------------------------------------------------------------------------------- + +# TODO-LDML: lots of comment-out ahead. Need to revisit. + +block(list) # struct COMP_KMXPLUS_LAYR_LIST { + 6c 69 73 74 # KMX_DWORD header.ident; // 0000 Section name - list + diff(list,endList) # KMX_DWORD header.size; // 0004 Section length + 02 00 00 00 # KMX_DWORD listCount (should be 2) + 02 00 00 00 # KMX_DWORD indexCount (should be 2) + # list #0 the null list + block(listNull) + 00 00 00 00 #index(indexNull,indexNull,2) # KMX_DWORD list index (0) + 00 00 00 00 # KMX_DWORD lists[0].count + # list #1 the ae list + block(listAe) + 00 00 00 00 # index(indexAe,indexNull,2) # KMX_DWORD list index (also 0) + 02 00 00 00 # KMX_DWORD count + block(endLists) + # indices + #block(indexNull) + # No null index + # index(strNull,strNull,2) # KMXPLUS_STR string index + block(indexAe) + index(strNull,strElemTranFrom2,2) # KMXPLUS_STR a + index(strNull,strElemBkspFrom2,2) # KMXPLUS_STR e + block(endIndices) + block(endList) + +# ---------------------------------------------------------------------------------------------------- +# loca +# ---------------------------------------------------------------------------------------------------- + +block(loca) # struct COMP_KMXPLUS_LOCA { + 6c 6f 63 61 # KMX_DWORD header.ident; // 0000 Section name - loca + sizeof(loca) # KMX_DWORD header.size; // 0004 Section length + 01 00 00 00 # KMX_DWORD count; // 0008 number of locales + index(strNull,strLocale,2) # KMXPLUS_STR locale; // 000C+ locale string entry = 'mt' + # }; +# ---------------------------------------------------------------------------------------------------- +# meta +# ---------------------------------------------------------------------------------------------------- + +block(meta) # struct COMP_KMXPLUS_META { + 6d 65 74 61 # KMX_DWORD header.ident; // 0000 Section name - meta + sizeof(meta) # KMX_DWORD header.size; // 0004 Section length + index(strNull,strAuthor,2) # KMXPLUS_STR author; + index(strNull,strConformsTo,2) # KMXPLUS_STR conform; + index(strNull,strLayout,2) # KMXPLUS_STR layout; + index(strNull,strNorm,2) # KMXPLUS_STR normalization; + index(strNull,strIndicator,2) # KMXPLUS_STR indicator; + index(strNull,strVersion,2) # KMXPLUS_STR version; + 00 00 00 00 # KMX_DWORD settings; + # }; +# ---------------------------------------------------------------------------------------------------- +# store_targets_name +# ---------------------------------------------------------------------------------------------------- + +block(name) # struct COMP_KMXPLUS_META { + 6e 61 6d 65 # KMX_DWORD header.ident; // 0000 Section name - name + sizeof(name) # KMX_DWORD header.size; // 0004 Section length + 01 00 00 00 # KMX_DWORD count; // 0008 number of names + index(strNull,strName,2) # KMXPLUS_STR name; // 000C+ name string entry = 'TestKbd' + # }; + +# ---------------------------------------------------------------------------------------------------- +# ordr +# ---------------------------------------------------------------------------------------------------- + +# block(ordr) +# 6f 72 64 72 # KMX_DWORD header.ident; // 0000 Section name - ordr +# sizeof(ordr) # KMX_DWORD header.size; // 0004 Section length +# 01 00 00 00 # KMX_DWORD count; // 0008 count of str entries +# # }; + +# index(elemNull,elemOrdrFrom) # KMXPLUS_ELEM elements; +# index(elemNull,elemOrdrBefore) # KMXPLUS_ELEM before; + +# ---------------------------------------------------------------------------------------------------- +# strs +# ---------------------------------------------------------------------------------------------------- + +block(strs) # struct COMP_KMXPLUS_STRS { + 73 74 72 73 # KMX_DWORD header.ident; // 0000 Section name - strs + diff(strs,endstrs) # KMX_DWORD header.size; // 0004 Section length + index(strNull,endstrs,2) # KMX_DWORD count; // 0008 count of str entries + # }; + + # Next sections are string entries + # KMX_DWORD offset; // 0010+ offset from this blob + # KMX_DWORD length; // 0014+ str length (UTF-16LE units) + + diff(strs,strNull) sizeof(strNull,2) + diff(strs,strVersion) sizeof(strVersion,2) + diff(strs,strNorm) sizeof(strNorm,2) + diff(strs,strName) sizeof(strName,2) + diff(strs,strElemTranFrom1) sizeof(strElemTranFrom1,2) + diff(strs,strElemTranFrom2) sizeof(strElemTranFrom2,2) + diff(strs,strBase) sizeof(strBase,2) + diff(strs,strElemBkspFrom2) sizeof(strElemBkspFrom2,2) + diff(strs,strHmaqtugha) sizeof(strHmaqtugha,2) + diff(strs,strLocale) sizeof(strLocale,2) + diff(strs,strLayout) sizeof(strLayout,2) + diff(strs,strAuthor) sizeof(strAuthor,2) + diff(strs,strConformsTo) sizeof(strConformsTo,2) + diff(strs,strThat) sizeof(strThat,2) + # diff(strs,strTranTo) sizeof(strTranTo,2) + diff(strs,strKey1) sizeof(strKey1,2) + diff(strs,strKeys) sizeof(strKeys,2) + # diff(strs,strElemOrdrFrom3) sizeof(strElemOrdrFrom3,2) + # diff(strs,strElemOrdrFrom1) sizeof(strElemOrdrFrom1,2) + # diff(strs,strElemOrdrBefore) sizeof(strElemOrdrBefore,2) + # diff(strs,strElemOrdrFrom2) sizeof(strElemOrdrFrom2,2) + diff(strs,strIndicator) sizeof(strIndicator,2) + + + # String table -- block(x) is used to store the null u16char at end of each string + # without interfering with sizeof() calculation above + + block(strNull) block(x) 00 00 # the zero-length string + block(strVersion) 31 00 2e 00 30 00 2e 00 30 00 block(x) 00 00 # '1.0.0' + block(strNorm) 4e 00 46 00 43 00 block(x) 00 00 # 'NFC' + block(strName) 54 00 65 00 73 00 74 00 4b 00 62 00 64 00 block(x) 00 00 # 'TestKbd' + block(strElemTranFrom1) 5E 00 block(x) 00 00 # '^' + block(strElemTranFrom2) 61 00 block(x) 00 00 # 'a' + block(strBase) 62 00 61 00 73 00 65 00 block(x) 00 00 # 'base' + block(strElemBkspFrom2) 65 00 block(x) 00 00 # 'e' + block(strHmaqtugha) 68 00 6d 00 61 00 71 00 74 00 75 00 67 00 68 00 61 00 block(x) 00 00 # 'hmaqtugha' + block(strLocale) 6d 00 74 00 block(x) 00 00 # 'mt' + block(strLayout) 71 00 77 00 65 00 72 00 74 00 79 00 block(x) 00 00 # 'qwerty' + block(strAuthor) 73 00 72 00 6c 00 32 00 39 00 35 00 block(x) 00 00 # 'srl295' + block(strConformsTo) 74 00 65 00 63 00 68 00 70 00 72 00 65 00 76 00 + 69 00 65 00 77 00 block(x) 00 00 # 'techpreview' + block(strThat) 74 00 68 00 61 00 74 00 block(x) 00 00 # 'that' + # block(strTranTo) E2 00 block(x) 00 00 # 'â' + block(strKey1) 27 01 block(x) 00 00 # 'ħ' + block(strKeys) 90 17 b6 17 block(x) 00 00 # 'ថា' + # + # block(strElemOrdrFrom3) 45 1a block(x) 00 00 # 'ᩅ' + # block(strElemOrdrFrom1) 60 1a block(x) 00 00 # '᩠' + # block(strElemOrdrBefore) 6b 1a block(x) 00 00 # 'ᩫ' + # block(strElemOrdrFrom2) 75 1a block(x) 00 00 # '᩵' + block(strIndicator) 3d d8 40 de block(x) 00 00 # '🙀' + + + + +block(endstrs) # end of strs block + +# ---------------------------------------------------------------------------------------------------- +# tran +# ---------------------------------------------------------------------------------------------------- + +# block(tran) # struct COMP_KMXPLUS_TRAN { +# 74 72 61 6e # KMX_DWORD header.ident; // 0000 Section name - tran +# sizeof(tran) # KMX_DWORD header.size; // 0004 Section length +# 01 00 00 00 # KMX_DWORD count; // 0008 number of entries +# # }; + +# # struct COMP_KMXPLUS_TRAN_ENTRY { +# index(elemNull,elemTranFrom) # KMXPLUS_ELEM from; +# index(strNull,strTranTo,2) # KMXPLUS_STR to; +# 00 00 00 00 # KMXPLUS_ELEM before; +# 00 00 00 00 # KMX_DWORD flags; +# # }; + +block(vkey) # struct COMP_KMXPLUS_VKEY { + 76 6b 65 79 # KMX_DWORD header.ident; // 0000 Section name - vkey + sizeof(vkey) # KMX_DWORD header.size; // 0004 Section length + 02 00 00 00 # KMX_DWORD count; // 0008 Number of vkey maps + + 41 00 00 00 51 00 00 00 # KMX_DWORD vkey; KMX_DWORD target; // K_A => K_Q + 51 00 00 00 41 00 00 00 # KMX_DWORD vkey; KMX_DWORD target; // K_Q => K_A + # }; + +block(eof) # end of file diff --git a/developer/src/kmc-ldml/test/fixtures/basic.xml b/developer/src/kmc-ldml/test/fixtures/basic.xml new file mode 100644 index 0000000000000000000000000000000000000000..4f9208cb20674f4846eb579abd4aaa526bffb20f --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/basic.xml @@ -0,0 +1,61 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/bksp/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/bksp/minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..6de012b33a1c20084a98e8ac6bf8817252b4d3e8 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/bksp/minimal.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/escaped.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/escaped.xml new file mode 100644 index 0000000000000000000000000000000000000000..56508009fda4fddd1f6cc367d9915f6dfe71e389 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/escaped.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupto.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupto.xml new file mode 100644 index 0000000000000000000000000000000000000000..3f4c264cecee1f9a8be8c53ef91782034f8c0c93 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/invalid-dupto.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/maximal.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/maximal.xml new file mode 100644 index 0000000000000000000000000000000000000000..979b55e43cd999ed68f4c3f6041611e97ffdf4ec --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/maximal.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..feb599c825fb75af00b4cd2a68c589d1925f5c45 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/minimal.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/options-only.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/options-only.xml new file mode 100644 index 0000000000000000000000000000000000000000..c030909cc9150a4a21271a642d617635740b526a --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/options-only.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/disp/typical.xml b/developer/src/kmc-ldml/test/fixtures/sections/disp/typical.xml new file mode 100644 index 0000000000000000000000000000000000000000..935225e214f532bd15cbe79b7f9458d91603ef17 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/disp/typical.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/finl/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/finl/minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..b9d5176bc1245e3a24477e112944a7d6857fcfc1 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/finl/minimal.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped.xml new file mode 100644 index 0000000000000000000000000000000000000000..d0a968927b360ae62c8df9f7fc3f015d043edacb --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped2.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped2.xml new file mode 100644 index 0000000000000000000000000000000000000000..fee8847897b9c410012e8a957f895131fa7d31c4 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/escaped2.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/gap-switch.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/gap-switch.xml new file mode 100644 index 0000000000000000000000000000000000000000..4cba4320e4b069d5515fdc99a8160d0aff20234f --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/gap-switch.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware.xml new file mode 100644 index 0000000000000000000000000000000000000000..fc282c7a6c00ee94961dd0a2020c105bd1281920 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware.xml @@ -0,0 +1,26 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_iso.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_iso.xml new file mode 100644 index 0000000000000000000000000000000000000000..84afa0dddbbd8ab3982431a17bd1d6a3d391cda7 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_iso.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_us.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_us.xml new file mode 100644 index 0000000000000000000000000000000000000000..8182e8c3f00a9c3f76d8fae5f4ffc5e7cbeeb558 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/hardware_us.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-bad-modifier.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-bad-modifier.xml new file mode 100644 index 0000000000000000000000000000000000000000..77f2ff39d1007774fd2740f6bd5726ed68f707f1 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-bad-modifier.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-keys.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-keys.xml new file mode 100644 index 0000000000000000000000000000000000000000..6c2f01a08571b4742da20ff31cc4d21409004eb0 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-keys.xml @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-rows.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-rows.xml new file mode 100644 index 0000000000000000000000000000000000000000..f868fb3db39fa15786a3f3ff23df4622e2b0fc51 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-hardware-too-many-rows.xml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-key-missing-attrs.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-key-missing-attrs.xml new file mode 100644 index 0000000000000000000000000000000000000000..98e2131b5daeae7003af338e519a17e9e1c94483 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-key-missing-attrs.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-missing-flick.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-missing-flick.xml new file mode 100644 index 0000000000000000000000000000000000000000..4bce8aa31d2022ac53b3a12d22c807c505e9f301 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-missing-flick.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-undefined-key.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-undefined-key.xml new file mode 100644 index 0000000000000000000000000000000000000000..65a86838ee494f481e15fcb11e93890871062645 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/invalid-undefined-key.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/maximal.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/maximal.xml new file mode 100644 index 0000000000000000000000000000000000000000..61554e8dd970ac502077b6ee64050ef1cce510d2 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/maximal.xml @@ -0,0 +1,37 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/keys/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/keys/minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..dc498b31f6eb489d72c9d3f55be9c832450c5f02 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/keys/minimal.xml @@ -0,0 +1,19 @@ + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-invalid-form.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-invalid-form.xml new file mode 100644 index 0000000000000000000000000000000000000000..064a59df80fcdac6e386a70cecf2442a2886d115 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-invalid-form.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-hardware.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-hardware.xml new file mode 100644 index 0000000000000000000000000000000000000000..8d1c63e801038e0b73d8a61e493d4d48cadb95f2 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-hardware.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer.xml new file mode 100644 index 0000000000000000000000000000000000000000..0a2cdf061058541c580236e90defe759d608c8f8 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer2.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer2.xml new file mode 100644 index 0000000000000000000000000000000000000000..dd08e40e5805eb12b85050c9dd016877d3cb3811 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-missing-layer2.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-multi-hardware.xml b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-multi-hardware.xml new file mode 100644 index 0000000000000000000000000000000000000000..dadef48404d2b36bb096777845d4b12a2f962d2c --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/layr/invalid-multi-hardware.xml @@ -0,0 +1,27 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/loca/invalid-locale.xml b/developer/src/kmc-ldml/test/fixtures/sections/loca/invalid-locale.xml new file mode 100644 index 0000000000000000000000000000000000000000..1644742c733519aca492f9ea55192e9947f581f4 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/loca/invalid-locale.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/loca/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/loca/minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..7ca838be6fda2d5e7d8c4bc180b0a9ed260d36b7 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/loca/minimal.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/loca/multiple.xml b/developer/src/kmc-ldml/test/fixtures/sections/loca/multiple.xml new file mode 100644 index 0000000000000000000000000000000000000000..30d00bea2e181d35f6f17dc0d6f109b0bdfc9f4e --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/loca/multiple.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-normalization.xml b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-normalization.xml new file mode 100644 index 0000000000000000000000000000000000000000..13723cbb2e24afb9e593d0f890cf64146bc6abcd --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-normalization.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-1.0.xml b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-1.0.xml new file mode 100644 index 0000000000000000000000000000000000000000..f7246e40cbb2dc24a317fd4a766a31b19a997a75 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-1.0.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-v1.0.3.xml b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-v1.0.3.xml new file mode 100644 index 0000000000000000000000000000000000000000..dd6e292345c6b77e5df1506fab9d2d948869af52 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/meta/invalid-version-v1.0.3.xml @@ -0,0 +1,12 @@ + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/meta/maximal.xml b/developer/src/kmc-ldml/test/fixtures/sections/meta/maximal.xml new file mode 100644 index 0000000000000000000000000000000000000000..f42d892e91ce56decc0d32bdfc9b04d76231ab94 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/meta/maximal.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/meta/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/meta/minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..9de105e868e4e873d658c8a7b9b6ea5b2b9d2a40 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/meta/minimal.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/name/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/name/minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..7181aa65f3175f3464d7f8d2f4621d70e64b85d7 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/name/minimal.xml @@ -0,0 +1,10 @@ + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/name/multiple.xml b/developer/src/kmc-ldml/test/fixtures/sections/name/multiple.xml new file mode 100644 index 0000000000000000000000000000000000000000..8838c4b4a6b1f2b3becedbda50464e12421a250b --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/name/multiple.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/ordr/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/ordr/minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..c29f6621cb68af764865251d43180e6ed8e18b25 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/ordr/minimal.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/tran/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/tran/minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..6504c6920f5b18c4c02d4c614ce66ef570b374fa --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/tran/minimal.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-from-vkey.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-from-vkey.xml new file mode 100644 index 0000000000000000000000000000000000000000..d28c9f09d02a7b11eade45671004e270201a2f65 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-from-vkey.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-repeated-vkey.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-repeated-vkey.xml new file mode 100644 index 0000000000000000000000000000000000000000..15641e6855a06599f78acdbae549f0a7f0cadc94 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-repeated-vkey.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-to-vkey.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-to-vkey.xml new file mode 100644 index 0000000000000000000000000000000000000000..ff475970009c456ea9be2d624fe1571e817b10e6 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/invalid-to-vkey.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/minimal.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/minimal.xml new file mode 100644 index 0000000000000000000000000000000000000000..3223d31189308c255097395bc070f8aecec17a07 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/minimal.xml @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/redundant.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/redundant.xml new file mode 100644 index 0000000000000000000000000000000000000000..8d5d1caf61743d09aaebc2d4fccd42cc4e283547 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/redundant.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/sections/vkey/same-target.xml b/developer/src/kmc-ldml/test/fixtures/sections/vkey/same-target.xml new file mode 100644 index 0000000000000000000000000000000000000000..65aa1fa2a52349f1a10825d50a71cdead513b34f --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/sections/vkey/same-target.xml @@ -0,0 +1,16 @@ + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/fixtures/test-fr.json b/developer/src/kmc-ldml/test/fixtures/test-fr.json new file mode 100644 index 0000000000000000000000000000000000000000..9e3341f824377597c3038205ac3c56876ada559f --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/test-fr.json @@ -0,0 +1,77 @@ +{ + "keyboardTest": { + "conformsTo": "techpreview", + "info": { + "keyboard": "fr-t-k0-azerty.xml", + "author": "Team Keyboard", + "name": "fr-test" + }, + "repertoire": [ + { + "name": "simple-repertoire", + "chars": "[a b c d e \\u{22}]", + "type": "simple" + }, + { + "name": "chars-repertoire", + "chars": "[á é ó]", + "type": "gesture" + } + ], + "tests": [ + { + "name": "key-tests", + "test": [ + { + "name": "key-test", + "startContext": { + "to": "abc\\u0022..." + }, + "actions": [ + { + "keystroke": { + "key": "s" + } + }, + { + "check": { + "result": "abc\\u0022...s" + } + }, + { + "keystroke": { + "key": "t" + } + }, + { + "check": { + "result": "abc\\u0022...st" + } + }, + { + "keystroke": { + "key": "u" + } + }, + { + "check": { + "result": "abc\\u0022...stu" + } + }, + { + "emit": { + "to": "v" + } + }, + { + "check": { + "result": "abc\\u0022...stuv" + } + } + ] + } + ] + } + ] + } +} diff --git a/developer/src/kmc-ldml/test/fixtures/test-fr.xml b/developer/src/kmc-ldml/test/fixtures/test-fr.xml new file mode 100644 index 0000000000000000000000000000000000000000..c97825385ad96a7df206fdea9e47c36f5cefc283 --- /dev/null +++ b/developer/src/kmc-ldml/test/fixtures/test-fr.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + + + + + + + diff --git a/developer/src/kmc-ldml/test/helpers/index.ts b/developer/src/kmc-ldml/test/helpers/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..8ba8a28aa84ded8a6549461d6ea8b657302bb431 --- /dev/null +++ b/developer/src/kmc-ldml/test/helpers/index.ts @@ -0,0 +1,196 @@ +/** + * Helpers and utilities for the Mocha tests. + */ +import 'mocha'; +import * as path from 'path'; +import { fileURLToPath } from 'url'; +import { SectionCompiler } from '../../src/compiler/section-compiler.js'; +import { KMXPlus, LDMLKeyboardXMLSourceFileReader, VisualKeyboard, CompilerEvent, LDMLKeyboardTestDataXMLSourceFile } from '@keymanapp/common-types'; +import { LdmlKeyboardCompiler } from '../../src/compiler/compiler.js'; +import { assert } from 'chai'; +import { KMXPlusMetadataCompiler } from '../../src/compiler/metadata-compiler.js'; +import { CompilerOptions } from '../../src/compiler/compiler-options.js'; +import { LdmlKeyboardVisualKeyboardCompiler } from '../../src/compiler/visual-keyboard-compiler.js'; +import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers'; + +import KMXPlusFile = KMXPlus.KMXPlusFile; +import Elem = KMXPlus.Elem; +import GlobalSections = KMXPlus.GlobalSections; +import Section = KMXPlus.Section; +import Strs = KMXPlus.Strs; +import List = KMXPlus.List; + +/** + * Builds a path to the fixture with the given path components. + * + * e.g., makePathToFixture('basic.xml') + * + * @param components One or more path components. + */ +export function makePathToFixture(...components: string[]): string { + return fileURLToPath(new URL(path.join('..', '..', '..', 'test', 'fixtures', ...components), import.meta.url)); +} + +export const compilerTestCallbacks = new TestCompilerCallbacks(); + +beforeEach(function() { + compilerTestCallbacks.clear(); +}); + +afterEach(function() { + if (this.currentTest.state !== 'passed') { + compilerTestCallbacks.messages.forEach(message => console.log(message.message)); + } +}); + + +export function loadSectionFixture(compilerClass: typeof SectionCompiler, filename: string, callbacks: TestCompilerCallbacks): Section { + callbacks.messages = []; + const inputFilename = makePathToFixture(filename); + const data = callbacks.loadFile(inputFilename); + assert.isNotNull(data); + + const reader = new LDMLKeyboardXMLSourceFileReader(callbacks); + const source = reader.load(data); + assert.isNotNull(source); + + if (!reader.validate(source, callbacks.loadSchema('ldml-keyboard'))) { + return null; // mimic kmc behavior - bail if validate fails + } + + const compiler = new compilerClass(source, callbacks); + + if(!compiler.validate()) { + return null; + } + + let globalSections: GlobalSections = { + strs: new Strs(), + elem: null, + list: null, + }; + globalSections.elem = new Elem(globalSections.strs); + globalSections.list = new List(globalSections.strs); + + return compiler.compile(globalSections); +} + +export function loadTestdata(inputFilename: string, options: CompilerOptions) : LDMLKeyboardTestDataXMLSourceFile { + const k = new LdmlKeyboardCompiler(compilerTestCallbacks, options); + const source = k.loadTestData(inputFilename); + return source; +} + +export function compileKeyboard(inputFilename: string, options: CompilerOptions): KMXPlusFile { + const k = new LdmlKeyboardCompiler(compilerTestCallbacks, options); + const source = k.load(inputFilename); + checkMessages(); + assert.isNotNull(source, 'k.load should not have returned null'); + + const valid = k.validate(source); + checkMessages(); + assert.isTrue(valid, 'k.validate should not have failed'); + + const kmx = k.compile(source); + checkMessages(); + assert.isNotNull(kmx, 'k.compile should not have returned null'); + + // In order for the KMX file to be loaded by non-KMXPlus components, it is helpful + // to duplicate some of the metadata + KMXPlusMetadataCompiler.addKmxMetadata(kmx.kmxplus, kmx.keyboard, options); + + return kmx; +} + +export function compileVisualKeyboard(inputFilename: string, options: CompilerOptions): VisualKeyboard.VisualKeyboard { + const k = new LdmlKeyboardCompiler(compilerTestCallbacks, options); + const source = k.load(inputFilename); + checkMessages(); + assert.isNotNull(source, 'k.load should not have returned null'); + + const valid = k.validate(source); + checkMessages(); + assert.isTrue(valid, 'k.validate should not have failed'); + + const vk = (new LdmlKeyboardVisualKeyboardCompiler()).compile(source); + checkMessages(); + assert.isNotNull(vk, 'LdmlKeyboardVisualKeyboardCompiler.compile should not have returned null'); + + return vk; +} + +export function checkMessages() { + if(compilerTestCallbacks.messages.length > 0) { + console.log(compilerTestCallbacks.messages); + } + assert.isEmpty(compilerTestCallbacks.messages); +} + +export interface CompilationCase { + /** + * path to xml, such as 'sections/layr/invalid-case.xml' + */ + subpath: string; + /** + * expected error messages. If falsy, expected to succeed. All must be present to pass. + */ + errors?: CompilerEvent[]; + /** + * expected warning messages. All must be present to pass. + */ + warnings?: CompilerEvent[]; + /** + * optional callback with the section + */ + callback?: (sect: KMXPlus.Section, subpath: string, callbacks: TestCompilerCallbacks ) => void; + /** + * if present, expect compiler to throw (use .* to match all) + */ + throws?: RegExp; +} + +/** + * Run a bunch of cases + * @param cases cases to run + * @param compiler argument to loadSectionFixture() + * @param callbacks argument to loadSectionFixture() + */ +export function testCompilationCases(compiler: typeof SectionCompiler, cases : CompilationCase[]) { + // we need our own callbacks rather than using the global so messages don't get mixed + const callbacks = new TestCompilerCallbacks(); + for (let testcase of cases) { + const expectFailure = testcase.throws || !!(testcase.errors); // if true, we expect this to fail + const testHeading = expectFailure ? `should fail to compile: ${testcase.subpath}`: + `should compile: ${testcase.subpath}`; + it(testHeading, function () { + callbacks.clear(); + // special case for an expected exception + if (testcase.throws) { + assert.throws(() => loadSectionFixture(compiler, testcase.subpath, callbacks), testcase.throws, 'expected exception from compilation'); + return; + } + let section = loadSectionFixture(compiler, testcase.subpath, callbacks); + if (expectFailure) { + assert.isNull(section, 'expected compilation result to be null, but got something'); + } else { + assert.isNotNull(section, `expected successful compilation, but got null and ${JSON.stringify(callbacks.messages)}`); + } + + // if we expected errors or warnings, show them + if (testcase.errors) { + assert.includeDeepMembers(callbacks.messages, testcase.errors, 'expected errors to be included'); + } + if (testcase.warnings) { + assert.includeDeepMembers(callbacks.messages, testcase.warnings, 'expected warnings to be included'); + } else if (!expectFailure) { + // no warnings, so expect zero messages + assert.strictEqual(callbacks.messages.length, 0, 'expected zero messages'); + } + + // run the user-supplied callback if any + if (testcase.callback) { + testcase.callback(section, testcase.subpath, callbacks); + } + }); + } +} diff --git a/developer/src/kmc-ldml/test/test-bksp.ts b/developer/src/kmc-ldml/test/test-bksp.ts new file mode 100644 index 0000000000000000000000000000000000000000..92a55077b517140b24383409d8de43bf020fa8e5 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-bksp.ts @@ -0,0 +1,28 @@ +import 'mocha'; +import { assert } from 'chai'; +import { BkspCompiler } from '../src/compiler/tran.js'; +import { compilerTestCallbacks, loadSectionFixture } from './helpers/index.js'; +import { KMXPlus } from '@keymanapp/common-types'; + +import Bksp = KMXPlus.Bksp; +import BkspItemFlags = KMXPlus.BkspItemFlags; + +describe('bksp', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile minimal bksp data', function() { + let bksp = loadSectionFixture(BkspCompiler, 'sections/bksp/minimal.xml', compilerTestCallbacks) as Bksp; + assert.lengthOf(compilerTestCallbacks.messages, 0); + + it.skip('TODO-LDML rewriting this #7377', () => { + assert.lengthOf(bksp.items, 1); + assert.lengthOf(bksp.items[0].from, 2); + assert.strictEqual(bksp.items[0].from[0].value.value, "្"); + assert.strictEqual(bksp.items[0].from[1].value.value, "ម"); + assert.strictEqual(bksp.items[0].flags, BkspItemFlags.none); + assert.isEmpty(bksp.items[0].before); + assert.strictEqual(bksp.items[0].to.value, ""); + }); + }); +}); + diff --git a/developer/src/kmc-ldml/test/test-compiler-e2e.ts b/developer/src/kmc-ldml/test/test-compiler-e2e.ts new file mode 100644 index 0000000000000000000000000000000000000000..ec711549051a4f4a5d43911f8ae8b2924996b962 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-compiler-e2e.ts @@ -0,0 +1,33 @@ +import 'mocha'; +import {assert} from 'chai'; +import x_hextobin from '@keymanapp/hextobin'; +import { KMXBuilder } from '@keymanapp/common-types'; +import {checkMessages, compileKeyboard, makePathToFixture} from './helpers/index.js'; + +const hextobin = (x_hextobin as any).default; + +describe('compiler-tests', function() { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should-build-fixtures', async function() { + // Let's build basic.xml + // It should match basic.kmx (built from basic.txt) + + const inputFilename = makePathToFixture('basic.xml'); + const binaryFilename = makePathToFixture('basic.txt'); + + // Compile the keyboard + const kmx = compileKeyboard(inputFilename, {debug: true, addCompilerVersion: false}); + assert.isNotNull(kmx); + + // Use the builder to generate the binary output file + const builder = new KMXBuilder(kmx, true); + const code = builder.compile(); + checkMessages(); + assert.isNotNull(code); + + // Compare output + let expected = await hextobin(binaryFilename, undefined, {silent:true}); + assert.deepEqual(code, expected); + }); +}); \ No newline at end of file diff --git a/developer/src/kmc-ldml/test/test-disp.ts b/developer/src/kmc-ldml/test/test-disp.ts new file mode 100644 index 0000000000000000000000000000000000000000..5f3876585943091d4bf4be3c95ba200930b3da7f --- /dev/null +++ b/developer/src/kmc-ldml/test/test-disp.ts @@ -0,0 +1,66 @@ +import 'mocha'; +import {assert} from 'chai'; +import { DispCompiler } from '../src/compiler/disp.js'; +import { compilerTestCallbacks, loadSectionFixture } from './helpers/index.js'; +import { KMXPlus } from '@keymanapp/common-types'; +import { CompilerMessages } from '../src/compiler/messages.js'; + +import Disp = KMXPlus.Disp; + +describe('disp', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile minimal disp', function() { + let disp = loadSectionFixture(DispCompiler, 'sections/disp/minimal.xml', compilerTestCallbacks) as Disp; + assert.equal(compilerTestCallbacks.messages.length, 0); + + assert.ok(disp?.disps); + assert.equal(disp.disps.length, 0); + }); + it('should compile typical disp', function() { + let disp = loadSectionFixture(DispCompiler, 'sections/disp/typical.xml', compilerTestCallbacks) as Disp; + assert.equal(compilerTestCallbacks.messages.length, 0); + + assert.ok(disp?.disps); + assert.equal(disp.disps.length, 1); + assert.equal(disp.disps[0].to?.value, '\u0300'); + assert.equal(disp.disps[0].display?.value, '`'); + }); + it('should compile maximal disp', function() { + let disp = loadSectionFixture(DispCompiler, 'sections/disp/maximal.xml', compilerTestCallbacks) as Disp; + assert.equal(compilerTestCallbacks.messages.length, 0); + assert.equal(disp?.baseCharacter?.value, 'x'); + assert.ok(disp?.disps); + assert.equal(disp.disps.length, 2); + assert.equal(disp.disps[0].to?.value, 'e'); + assert.equal(disp.disps[0].display?.value, '(e)'); + assert.equal(disp.disps[1].to?.value, 'f'); + assert.equal(disp.disps[1].display?.value, '(f)'); + }); + it('should compile escaped disp', function() { + let disp = loadSectionFixture(DispCompiler, 'sections/disp/escaped.xml', compilerTestCallbacks) as Disp; + assert.equal(compilerTestCallbacks.messages.length, 0); + assert.equal(disp?.baseCharacter?.value, 'x'); + assert.ok(disp?.disps); + assert.equal(disp.disps.length, 2); + assert.equal(disp.disps[0].to?.value, 'e'); + assert.equal(disp.disps[0].display?.value, '(e)'); + assert.equal(disp.disps[1].to?.value, 'f'); + assert.equal(disp.disps[1].display?.value, '(f)'); + }); + it('should compile options-only disp', function() { + let disp = loadSectionFixture(DispCompiler, 'sections/disp/maximal.xml', compilerTestCallbacks) as Disp; + assert.equal(compilerTestCallbacks.messages.length, 0); + assert.equal(disp?.baseCharacter?.value, 'x'); + assert.ok(disp?.disps); + }); + + it('should reject duplicate tos', function() { + let disp = loadSectionFixture(DispCompiler, 'sections/disp/invalid-dupto.xml', compilerTestCallbacks) as Disp; + assert.isNull(disp); + assert.equal(compilerTestCallbacks.messages.length, 1); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_DisplayIsRepeated({to:'e'})); + }); + +}); + diff --git a/developer/src/kmc-ldml/test/test-finl.ts b/developer/src/kmc-ldml/test/test-finl.ts new file mode 100644 index 0000000000000000000000000000000000000000..89189031e187c6b9bc65aa8e82255ba7407cf377 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-finl.ts @@ -0,0 +1,28 @@ +import 'mocha'; +import { assert } from 'chai'; +import { FinlCompiler } from '../src/compiler/tran.js'; +import { compilerTestCallbacks, loadSectionFixture } from './helpers/index.js'; +import { KMXPlus } from '@keymanapp/common-types'; + +import Finl = KMXPlus.Finl; +import FinlItemFlags = KMXPlus.FinlItemFlags; + +describe('finl', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile minimal finl data', function() { + let finl = loadSectionFixture(FinlCompiler, 'sections/finl/minimal.xml', compilerTestCallbacks) as Finl; + assert.lengthOf(compilerTestCallbacks.messages, 0); + + it.skip('TODO-LDML rewriting this #7377', () => { + assert.lengthOf(finl.items, 1); + assert.lengthOf(finl.items[0].from, 2); + assert.strictEqual(finl.items[0].from[0].value.value, "x"); + assert.strictEqual(finl.items[0].from[1].value.value, "x"); + assert.strictEqual(finl.items[0].flags, FinlItemFlags.error); + assert.isEmpty(finl.items[0].before); + assert.strictEqual(finl.items[0].to.value, "x"); + }); + }); +}); + diff --git a/developer/src/kmc-ldml/test/test-keymanweb-compiler.ts b/developer/src/kmc-ldml/test/test-keymanweb-compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..fb4f28daeeedf1fef9a6c191df57b55e0c5f2933 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-keymanweb-compiler.ts @@ -0,0 +1,49 @@ +import 'mocha'; +import { assert } from 'chai'; +import { checkMessages, compilerTestCallbacks, makePathToFixture } from './helpers/index.js'; +import { LdmlKeyboardKeymanWebCompiler } from '../src/compiler/keymanweb-compiler.js'; +import { LdmlKeyboardCompiler } from '../src/compiler/compiler.js'; +import * as fs from 'fs'; + +describe('LdmlKeyboardKeymanWebCompiler', function() { + + it('should build a .js file', async function() { + // Let's build basic.xml + // It should generate content identical to basic.js + const inputFilename = makePathToFixture('basic.xml'); + const outputFilename = makePathToFixture('basic.js'); + const outputFilenameNoDebug = makePathToFixture('basic-no-debug.js'); + + // Load input data; we'll use the LDML keyboard compiler loader to save us + // effort here + const k = new LdmlKeyboardCompiler(compilerTestCallbacks, {debug: true, addCompilerVersion: false}); + const source = k.load(inputFilename); + checkMessages(); + assert.isNotNull(source, 'k.load should not have returned null'); + + // Sanity check ... this is also checked in other tests + const valid = k.validate(source); + checkMessages(); + assert.isTrue(valid, 'k.validate should not have failed'); + + // Actual test: compile to javascript + const jsCompiler = new LdmlKeyboardKeymanWebCompiler(compilerTestCallbacks, {debug: true}); + const output = jsCompiler.compile('basic.xml', source); + assert.isNotNull(output); + + // Does the emitted js match? + const outputFixture = fs.readFileSync(outputFilename, 'utf-8').replaceAll(/\r\n/g, '\n'); + assert.strictEqual(output, outputFixture); + + // Second test: compile to javascript without debug formatting + const jsCompilerNoDebug = new LdmlKeyboardKeymanWebCompiler(compilerTestCallbacks, {debug: false}); + const outputNoDebug = jsCompilerNoDebug.compile('basic.xml', source); + assert.isNotNull(outputNoDebug); + + // Does the emitted js match? + const outputFixtureNoDebug = fs.readFileSync(outputFilenameNoDebug, 'utf-8').replaceAll(/\r\n/g, '\n'); + assert.strictEqual(outputNoDebug, outputFixtureNoDebug); + + // TODO(lowpri): consider using Typescript parser to generate AST for further validation + }); +}); \ No newline at end of file diff --git a/developer/src/kmc-ldml/test/test-keys.ts b/developer/src/kmc-ldml/test/test-keys.ts new file mode 100644 index 0000000000000000000000000000000000000000..df978de773cada0195258caf91e07d804effd13b --- /dev/null +++ b/developer/src/kmc-ldml/test/test-keys.ts @@ -0,0 +1,255 @@ +import 'mocha'; +import { assert } from 'chai'; +import { KeysCompiler } from '../src/compiler/keys.js'; +import { compilerTestCallbacks, loadSectionFixture, testCompilationCases } from './helpers/index.js'; +import { KMXPlus, Constants } from '@keymanapp/common-types'; +import { CompilerMessages } from '../src/compiler/messages.js'; +import { constants } from '@keymanapp/ldml-keyboard-constants'; +import Keys = KMXPlus.Keys; +const K = Constants.USVirtualKeyCodes; + +describe('keys', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + testCompilationCases(KeysCompiler, [ + { + // should compile minimal keys data + subpath: 'sections/keys/minimal.xml', + callback(sect) { + const keys = sect; + assert.ok(keys); + assert.equal(compilerTestCallbacks.messages.length, 0); + assert.equal(keys.keys.length, 1); + assert.equal(keys.flicks.length, 1); // there's always a 'null' flick + assert.equal(keys.keys[0].to.value, String.fromCodePoint(0x1FAA6)); + assert.equal(keys.keys[0].id.value, 'grave'); + }, + }, + { + subpath: 'sections/keys/maximal.xml', + callback(sect) { + const keys = sect; + assert.ok(keys); + assert.equal(compilerTestCallbacks.messages.length, 0); + assert.equal(keys.keys.length, 4); + + const [q] = keys.keys.filter(({ id }) => id.value === 'q'); + assert.ok(q); + assert.isFalse(!!(q.flags & constants.keys_key_flags_gap)); + assert.equal(q.width, 32, 'q\'s width'); // ceil(3.14159 * 10.0) + assert.equal(q.flicks, 'flick0'); // note this is a string, not a StrsItem + assert.equal(q.longPress.toString(), 'á é í'); + assert.equal(q.longPressDefault.value, 'é'); + assert.equal(q.multiTap.toString(), 'ä ë ï'); + + const [flick0] = keys.flicks.filter(({ id }) => id.value === 'flick0'); + assert.ok(flick0); + assert.equal(flick0.flicks.length, 2); + + const [flick0_nw_se] = flick0.flicks.filter(({ directions }) => directions && directions.isEqual('nw se'.split(' '))); + assert.ok(flick0_nw_se); + assert.equal(flick0_nw_se.to?.value, 'ç'); + + const [flick0_ne_sw] = flick0.flicks.filter(({ directions }) => directions && directions.isEqual('ne sw'.split(' '))); + assert.ok(flick0_ne_sw); + assert.equal(flick0_ne_sw.to?.value, 'ê'); + }, + }, + { + subpath: 'sections/keys/escaped.xml', + callback(sect) { + const keys = sect; + assert.ok(keys); + assert.equal(compilerTestCallbacks.messages.length, 0); + assert.equal(keys.keys.length, 4); + + const [q] = keys.keys.filter(({ id }) => id.value === 'q'); + assert.ok(q); + assert.isFalse(!!(q.flags & constants.keys_key_flags_gap)); + assert.equal(q.width, 32); // ceil(3.1 * 10) + assert.equal(q.flicks, 'flick0'); // note this is a string, not a StrsItem + assert.equal(q.longPress.toString(), 'á é í'); + assert.equal(q.longPressDefault.value, 'é'); + assert.equal(q.multiTap.toString(), 'ä ë ï'); + + const [flick0] = keys.flicks.filter(({ id }) => id.value === 'flick0'); + assert.ok(flick0); + assert.equal(flick0.flicks.length, 2); + + const [flick0_nw_se] = flick0.flicks.filter(({ directions }) => directions && directions.isEqual('nw se'.split(' '))); + assert.ok(flick0_nw_se); + assert.equal(flick0_nw_se.to?.value, 'ç'); + + const [flick0_ne_sw] = flick0.flicks.filter(({ directions }) => directions && directions.isEqual('ne sw'.split(' '))); + assert.ok(flick0_ne_sw); + assert.equal(flick0_ne_sw.to?.value, 'ế'); + }, + }, + { + subpath: 'sections/keys/gap-switch.xml', + callback(sect) { + const keys = sect; + assert.equal(compilerTestCallbacks.messages.length, 0); + assert.equal(keys.keys.length, 4); + + const [Qgap] = keys.keys.filter(({ id }) => id.value === 'Q'); + assert.ok(Qgap); + assert.isTrue(!!(Qgap.flags & constants.keys_key_flags_gap), 'Q’s gap='); + + const [Wshift] = keys.keys.filter(({ id }) => id.value === 'W'); + assert.isNotNull(Wshift); + assert.isFalse(!!(Wshift.flags & constants.keys_key_flags_gap)); + assert.equal(Wshift.switch.value, 'shift'); + }, + }, + { + subpath: 'sections/keys/escaped2.xml', + callback: (keys, subpath, callbacks) => { + assert.isNotNull(keys); + assert.equal((keys).keys.length, 1); + const [q] = (keys).keys.filter(({ id }) => id.value === 'grave'); + assert.equal(q.to.value, String.fromCodePoint(0x1faa6)); + }, + }, + ]); +}); + +describe('keys.kmap', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile minimal kmap data', function() { + let keys = loadSectionFixture(KeysCompiler, 'sections/keys/minimal.xml', compilerTestCallbacks) as Keys; + assert.isNotNull(keys); + assert.equal(compilerTestCallbacks.messages.length, 0); + assert.equal(keys.kmap.length, 1); + }); + + testCompilationCases(KeysCompiler, [ + { + subpath: 'sections/keys/hardware.xml', + callback: (sect, subpath, callbacks) => { + const keys = sect as Keys; + assert.isNotNull(keys); + assert.equal(compilerTestCallbacks.messages.length, 0); + assert.equal(keys.keys.length, 4); + assert.sameDeepMembers(keys.kmap, [ + { + vkey: K.K_BKQUOTE, + key: 'qqq', + mod: constants.keys_mod_none, + }, + { + vkey: K.K_1, + key: 'www', + mod: constants.keys_mod_none, + }, + { + vkey: K.K_BKQUOTE, + key: 'QQQ', + mod: constants.keys_mod_shift, + }, + { + vkey: K.K_1, + key: 'WWW', + mod: constants.keys_mod_shift, + }, + ]); + }, + }, + { + subpath: 'sections/keys/hardware_us.xml', + callback: (sect, subpath, callbacks) => { + const keys = sect as Keys; + assert.isNotNull(keys); + assert.includeDeepMembers(keys.kmap, [ + { + vkey: K.K_BKSLASH, + key: 'backslash', + mod: constants.keys_mod_none, + }, + { + vkey: K.K_Z, + key: 'z', + mod: constants.keys_mod_none, + }, + { + vkey: K.K_BKQUOTE, + key: 'grave', + mod: constants.keys_mod_none, + }, + ]); + }, + }, + { + subpath: 'sections/keys/hardware_iso.xml', + callback: (sect, subpath, callbacks) => { + const keys = sect as Keys; + assert.isNotNull(keys); + assert.includeDeepMembers(keys.kmap, [ + { + vkey: K.K_oE2, + key: 'backslash', + mod: constants.keys_mod_none, + }, + { + vkey: 'Z'.charCodeAt(0), + key: 'z', + mod: constants.keys_mod_none, + }, + { + vkey: 192, + key: 'grave', + mod: constants.keys_mod_none, + }, + ]); + }, + }, + { + subpath: 'sections/keys/invalid-bad-modifier.xml', + errors: [ + CompilerMessages.Error_InvalidModifier({layer:'base',modifier:'altR-shift'}), + ] + }, + { + subpath: 'sections/keys/invalid-missing-flick.xml', + errors: [ + CompilerMessages.Error_MissingFlicks({flicks:'an-undefined-flick-id',id:'Q'}), + ] + }, + ]); + + it('should reject layouts with too many hardware rows', function() { + let keys = loadSectionFixture(KeysCompiler, 'sections/keys/invalid-hardware-too-many-rows.xml', compilerTestCallbacks) as Keys; + assert.isNull(keys); + assert.equal(compilerTestCallbacks.messages.length, 1); + + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_HardwareLayerHasTooManyRows()); + }); + + it('should reject layouts with too many hardware keys', function() { + let keys = loadSectionFixture(KeysCompiler, 'sections/keys/invalid-hardware-too-many-keys.xml', compilerTestCallbacks) as Keys; + assert.isNull(keys); + assert.equal(compilerTestCallbacks.messages.length, 1); + + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_RowOnHardwareLayerHasTooManyKeys({row: 1, hardware: 'us', modifier: 'none'})); + }); + + it('should reject layouts with undefined keys', function() { + let keys = loadSectionFixture(KeysCompiler, 'sections/keys/invalid-undefined-key.xml', compilerTestCallbacks) as Keys; + assert.isNull(keys); + assert.equal(compilerTestCallbacks.messages.length, 1); + + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_KeyNotFoundInKeyBag({col: 1, form: 'hardware', keyId: 'foo', layer: 'base', row: 1})); + }); + it('should reject layouts with invalid keys', function() { + let keys = loadSectionFixture(KeysCompiler, 'sections/keys/invalid-key-missing-attrs.xml', compilerTestCallbacks) as Keys; + assert.isNull(keys); + assert.equal(compilerTestCallbacks.messages.length, 1); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_KeyMissingToGapOrSwitch({keyId: 'Q'})); + }); + it('should accept layouts with gap/switch keys', function() { + let keys = loadSectionFixture(KeysCompiler, 'sections/keys/gap-switch.xml', compilerTestCallbacks) as Keys; + assert.isNotNull(keys); + assert.equal(compilerTestCallbacks.messages.length, 0); + assert.equal(keys.keys.length, 4); + }); +}); diff --git a/developer/src/kmc-ldml/test/test-layr.ts b/developer/src/kmc-ldml/test/test-layr.ts new file mode 100644 index 0000000000000000000000000000000000000000..e38a1b728dc273a6476116541413f63c742dc1ef --- /dev/null +++ b/developer/src/kmc-ldml/test/test-layr.ts @@ -0,0 +1,119 @@ +import 'mocha'; +import { assert } from 'chai'; +import { LayrCompiler } from '../src/compiler/layr.js'; +import { CompilerMessages } from '../src/compiler/messages.js'; +import { compilerTestCallbacks, loadSectionFixture, testCompilationCases } from './helpers/index.js'; +import { KMXPlus, CommonTypesMessages } from '@keymanapp/common-types'; +import { constants } from '@keymanapp/ldml-keyboard-constants'; + +import Layr = KMXPlus.Layr; +import LayrRow = KMXPlus.LayrRow; + +function allKeysOk(row : LayrRow, str : string, msg? : string) { + const split = str.split(' '); + assert.equal(row.keys.length, split.length, msg); + for (let i=0; i sect; + assert.equal(layr.lists?.length, 2); + + const listHardware = layr.lists.find(v => v.hardware === constants.layr_list_hardware_iso); + assert.ok(listHardware); + assert.equal(listHardware.minDeviceWidth, 0); + assert.equal(listHardware.layers.length, 2); + const hardware0 = listHardware.layers[0]; + assert.ok(hardware0); + assert.equal(hardware0.id.value, 'base'); + assert.equal(hardware0.mod, constants.keys_mod_none); + const hardware0row0 = hardware0.rows[0]; + assert.ok(hardware0row0); + assert.equal(hardware0row0.keys.length, 2); + allKeysOk(hardware0row0,'Q W', 'hardware0row0'); + const hardware1 = listHardware.layers[1]; + assert.ok(hardware1); + assert.equal(hardware1.rows.length, 1); + assert.equal(hardware1.id.value, 'shift'); + assert.equal(hardware1.mod, constants.keys_mod_shift); + const hardware1row0 = hardware1.rows[0]; + assert.ok(hardware1row0); + assert.equal(hardware1row0.keys.length, 2); + allKeysOk(hardware1row0,'q w', 'hardware1row0'); + + const listTouch = layr.lists.find(v => v.hardware === constants.layr_list_hardware_touch); + assert.ok(listTouch); + assert.equal(listTouch.minDeviceWidth, 300); + assert.equal(listTouch.layers.length, 1); + const touch0 = listTouch.layers[0]; + assert.ok(touch0); + assert.equal(touch0.rows.length, 1); + assert.equal(touch0.id.value, 'base'); + assert.equal(touch0.mod, constants.keys_mod_none); + const touch0row0 = touch0.rows[0]; + assert.ok(touch0row0); + assert.equal(touch0row0.keys.length, 4); + allKeysOk(touch0row0,'Q q W w', 'touch0row0'); + }, + }, + { + subpath: 'sections/layr/invalid-missing-hardware.xml', + errors: [], + }, + { + subpath: 'sections/layr/invalid-multi-hardware.xml', + errors: [CompilerMessages.Error_ExcessHardware({ form: 'iso' })], + }, + { + subpath: 'sections/layr/invalid-invalid-form.xml', + errors: [CommonTypesMessages.Error_SchemaValidationError({ + instancePath: '/keyboard/layers/0/form', + keyword: 'enum', + message: 'must be equal to one of the allowed values', + params: `allowedValues="touch,us,iso,jis,abnt2"`}),], + }, + { + // missing layer element + subpath: 'sections/layr/invalid-missing-layer.xml', + errors: [CompilerMessages.Error_MustBeAtLeastOneLayerElement()], + }, + { + // missing layers element completely + subpath: 'sections/layr/invalid-missing-layer.xml', + errors: [ + CompilerMessages.Error_MustBeAtLeastOneLayerElement(), + ], + } + ]); +}); diff --git a/developer/src/kmc-ldml/test/test-loca.ts b/developer/src/kmc-ldml/test/test-loca.ts new file mode 100644 index 0000000000000000000000000000000000000000..317902316c140bdfd7b6970278b4c6e99cad26b6 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-loca.ts @@ -0,0 +1,51 @@ +import 'mocha'; +import { assert } from 'chai'; +import { LocaCompiler } from '../src/compiler/loca.js'; +import { compilerTestCallbacks, loadSectionFixture } from './helpers/index.js'; +import { KMXPlus } from '@keymanapp/common-types'; +import { CompilerMessages } from '../src/compiler/messages.js'; + +import Loca = KMXPlus.Loca; + +describe('loca', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile minimal loca data', function() { + let loca = loadSectionFixture(LocaCompiler, 'sections/loca/minimal.xml', compilerTestCallbacks) as Loca; + assert.isObject(loca); + + assert.equal(compilerTestCallbacks.messages.length, 0); + + assert.equal(loca.locales.length, 1); + assert.equal(loca.locales[0].value.toLowerCase(), 'mt'); + }); + + it('should compile multiple locales', function() { + let loca = loadSectionFixture(LocaCompiler, 'sections/loca/multiple.xml', compilerTestCallbacks) as Loca; + assert.isObject(loca); + + // Note: multiple.xml includes fr-FR twice, with differing case, which should be canonicalized + assert.equal(compilerTestCallbacks.messages.length, 4); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Hint_LocaleIsNotMinimalAndClean({sourceLocale: 'fr-FR', locale: 'fr'})); + assert.deepEqual(compilerTestCallbacks.messages[1], CompilerMessages.Hint_LocaleIsNotMinimalAndClean({sourceLocale: 'km-khmr-kh', locale: 'km'})); + assert.deepEqual(compilerTestCallbacks.messages[2], CompilerMessages.Hint_LocaleIsNotMinimalAndClean({sourceLocale: 'fr-fr', locale: 'fr'})); + assert.deepEqual(compilerTestCallbacks.messages[3], CompilerMessages.Hint_OneOrMoreRepeatedLocales()); + + // Original is 6 locales, now five minimized in the results + assert.equal(loca.locales.length, 5); + assert.equal(loca.locales[0].value, 'mt'); + assert.equal(loca.locales[1].value, 'fr'); // Original fr-FR + assert.equal(loca.locales[2].value, 'km'); // Original km-Khmr-kh + assert.equal(loca.locales[3].value, 'qq-Abcd-ZZ-x-foobar'); + assert.equal(loca.locales[4].value, 'en-fonipa'); + }); + + it('should reject structurally invalid locales', function() { + let loca = loadSectionFixture(LocaCompiler, 'sections/loca/invalid-locale.xml', compilerTestCallbacks) as Loca; + assert.isNull(loca); + assert.equal(compilerTestCallbacks.messages.length, 1); + // We'll only test one invalid BCP 47 tag to verify that we are properly calling BCP 47 validation routines. + // Furthermore, we are testing BCP 47 structure, not the validity of each subtag -- we must assume the author knows of new subtags! + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_InvalidLocale({tag:'en-*'})); + }) +}); diff --git a/developer/src/kmc-ldml/test/test-messages.ts b/developer/src/kmc-ldml/test/test-messages.ts new file mode 100644 index 0000000000000000000000000000000000000000..0dee53f12112d47b67ca19bc266630a791dd4bf9 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-messages.ts @@ -0,0 +1,9 @@ +import 'mocha'; +import { CompilerMessages } from '../src/compiler/messages.js'; +import { verifyCompilerMessagesObject } from '@keymanapp/developer-test-helpers'; + +describe('CompilerMessages', function () { + it('should have a valid CompilerMessages object', function() { + return verifyCompilerMessagesObject(CompilerMessages); + }); +}); diff --git a/developer/src/kmc-ldml/test/test-meta.ts b/developer/src/kmc-ldml/test/test-meta.ts new file mode 100644 index 0000000000000000000000000000000000000000..e507222866a6a49d9a9b81f7af2c3bf5d1d5aa0c --- /dev/null +++ b/developer/src/kmc-ldml/test/test-meta.ts @@ -0,0 +1,58 @@ +import 'mocha'; +import {assert} from 'chai'; +import { MetaCompiler } from '../src/compiler/meta.js'; +import { compilerTestCallbacks, loadSectionFixture } from './helpers/index.js'; +import { KMXPlus } from '@keymanapp/common-types'; +import { CompilerMessages } from '../src/compiler/messages.js'; + +import KeyboardSettings = KMXPlus.KeyboardSettings; +import Meta = KMXPlus.Meta; + +describe('meta', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile minimal metadata', function() { + let meta = loadSectionFixture(MetaCompiler, 'sections/meta/minimal.xml', compilerTestCallbacks) as Meta; + assert.equal(compilerTestCallbacks.messages.length, 0); + + assert.isEmpty(meta.author.value); // TODO-LDML: default author string "unknown"? + assert.equal(meta.conform.value, 'techpreview'); + assert.isEmpty(meta.layout.value); // TODO-LDML: assumed layout? + assert.isEmpty(meta.normalization.value); // TODO-LDML: assumed normalization? + assert.isEmpty(meta.indicator.value); // TODO-LDML: synthesize an indicator? + assert.equal(meta.settings, KeyboardSettings.none); + }); + + it('should compile maximal metadata', function() { + let meta = loadSectionFixture(MetaCompiler, 'sections/meta/maximal.xml', compilerTestCallbacks) as Meta; + assert.equal(compilerTestCallbacks.messages.length, 0); + + assert.equal(meta.author.value, 'The Keyman Team'); + assert.equal(meta.conform.value, 'techpreview'); + assert.equal(meta.layout.value, 'QWIRKY'); + assert.equal(meta.normalization.value, 'NFC'); + assert.equal(meta.indicator.value, 'QW'); + assert.equal(meta.version.value, "1.2.3"); + assert.equal(meta.settings, KeyboardSettings.fallback); + }); + + it('should reject invalid normalization', function() { + let meta = loadSectionFixture(MetaCompiler, 'sections/meta/invalid-normalization.xml', compilerTestCallbacks) as Meta; + assert.isNull(meta); + assert.equal(compilerTestCallbacks.messages.length, 1); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_InvalidNormalization({form:'NFQ'})); + }); + + it('should reject invalid version', function() { + let meta = loadSectionFixture(MetaCompiler, 'sections/meta/invalid-version-1.0.xml', compilerTestCallbacks) as Meta; + assert.isNull(meta); + assert.equal(compilerTestCallbacks.messages.length, 1); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_InvalidVersion({version:'1.0'})); + + meta = loadSectionFixture(MetaCompiler, 'sections/meta/invalid-version-v1.0.3.xml', compilerTestCallbacks) as Meta; + assert.isNull(meta); + assert.equal(compilerTestCallbacks.messages.length, 1); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_InvalidVersion({version:'v1.0.3'})); + }); +}); + diff --git a/developer/src/kmc-ldml/test/test-metadata-compiler.ts b/developer/src/kmc-ldml/test/test-metadata-compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..59500d09950c313568948fb70b8322ea0799b0d7 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-metadata-compiler.ts @@ -0,0 +1,74 @@ +import 'mocha'; +import { assert } from 'chai'; +import { checkMessages, compileKeyboard, makePathToFixture } from './helpers/index.js'; +import { KMX } from '@keymanapp/common-types'; +import KEYMAN_VERSION from '@keymanapp/keyman-version'; + +import KMXFile = KMX.KMXFile; + +describe('kmx metadata compiler', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile metadata with debug and compiler version', function() { + const inputFilename = makePathToFixture('basic.xml'); + + // Compile the keyboard + const kmx = compileKeyboard(inputFilename, {debug:true, addCompilerVersion:true}); + checkMessages(); + assert.isNotNull(kmx); + + // Order of stores is not significant in kmx spec, but kmxplus compiler will + // always store according to dwSystemID binary order for non-zero + // dwSystemID, then by dpName binary order, and finally by dpString binary + // order + + // TSS_NAME = 7 + // TSS_COMPILEDVERSION = 20 + // TSS_KEYBOARDVERSION = 36 + // TSS_TARGETS = 38 + + assert.equal(kmx.keyboard.stores[0].dpName, '&NAME'); + assert.equal(kmx.keyboard.stores[0].dpString, 'TestKbd'); + assert.equal(kmx.keyboard.stores[0].dwSystemID, KMXFile.TSS_NAME); + + assert.equal(kmx.keyboard.stores[1].dpName, ''); + assert.equal(kmx.keyboard.stores[1].dpString, KEYMAN_VERSION.VERSION_WITH_TAG); + assert.equal(kmx.keyboard.stores[1].dwSystemID, KMXFile.TSS_COMPILEDVERSION); + + assert.equal(kmx.keyboard.stores[2].dpName, '&KEYBOARDVERSION'); + assert.equal(kmx.keyboard.stores[2].dpString, '1.0.0'); + assert.equal(kmx.keyboard.stores[2].dwSystemID, KMXFile.TSS_KEYBOARDVERSION); + + assert.equal(kmx.keyboard.stores[3].dpName, '&TARGETS'); + assert.equal(kmx.keyboard.stores[3].dpString, 'desktop'); + assert.equal(kmx.keyboard.stores[3].dwSystemID, KMXFile.TSS_TARGETS); + }); + + it('should compile metadata with no compiler version', function() { + const inputFilename = makePathToFixture('basic.xml'); + + // Compile the keyboard + const kmx = compileKeyboard(inputFilename, {debug:true, addCompilerVersion:false}); + checkMessages(); + assert.isNotNull(kmx); + + // TSS_NAME = 7 + // -- TSS_COMPILEDVERSION = 20 -- not included with addCompilerVersion = false + // TSS_KEYBOARDVERSION = 36 + // TSS_TARGETS = 38 + + assert.equal(kmx.keyboard.stores[0].dpName, '&NAME'); + assert.equal(kmx.keyboard.stores[0].dpString, 'TestKbd'); + assert.equal(kmx.keyboard.stores[0].dwSystemID, KMXFile.TSS_NAME); + + assert.equal(kmx.keyboard.stores[1].dpName, '&KEYBOARDVERSION'); + assert.equal(kmx.keyboard.stores[1].dpString, '1.0.0'); + assert.equal(kmx.keyboard.stores[1].dwSystemID, KMXFile.TSS_KEYBOARDVERSION); + + assert.equal(kmx.keyboard.stores[2].dpName, '&TARGETS'); + assert.equal(kmx.keyboard.stores[2].dpString, 'desktop'); + assert.equal(kmx.keyboard.stores[2].dwSystemID, KMXFile.TSS_TARGETS); + }); + +}); + diff --git a/developer/src/kmc-ldml/test/test-name.ts b/developer/src/kmc-ldml/test/test-name.ts new file mode 100644 index 0000000000000000000000000000000000000000..d206c8a486846be09838cd8dcf1d99d865837a72 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-name.ts @@ -0,0 +1,34 @@ +import 'mocha'; +import { assert } from 'chai'; +import { NameCompiler } from '../src/compiler/name.js'; +import { compilerTestCallbacks, loadSectionFixture } from './helpers/index.js'; +import { KMXPlus } from '@keymanapp/common-types'; + +import Name = KMXPlus.Name; + +describe('name', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile minimal name data', function() { + let name = loadSectionFixture(NameCompiler, 'sections/name/minimal.xml', compilerTestCallbacks) as Name; + assert.equal(compilerTestCallbacks.messages.length, 0); + + assert.equal(name.names.length, 1); + assert.equal(name.names[0].value, 'My First Keyboard'); + }); + + it('should compile multiple names', function() { + let name = loadSectionFixture(NameCompiler, 'sections/name/multiple.xml', compilerTestCallbacks) as Name; + assert.equal(compilerTestCallbacks.messages.length, 0); + + assert.equal(name.names.length, 5); + assert.equal(name.names[0].value, 'My Second Keyboard'); + assert.equal(name.names[1].value, 'My 2nd Keyboard'); + assert.equal(name.names[2].value, 'win:kbd2'); + assert.equal(name.names[3].value, 'mac:keybd_2'); + assert.equal(name.names[4].value, 'web:keyboard-2'); + }); + + //TODO-LDML: should we be linting on repeated names? +}); + diff --git a/developer/src/kmc-ldml/test/test-ordr.ts b/developer/src/kmc-ldml/test/test-ordr.ts new file mode 100644 index 0000000000000000000000000000000000000000..6f764e7b633ecc7f87c84a42419900b389ea03b8 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-ordr.ts @@ -0,0 +1,31 @@ +import 'mocha'; +import { assert } from 'chai'; +import { OrdrCompiler } from '../src/compiler/ordr.js'; +import { compilerTestCallbacks, loadSectionFixture } from './helpers/index.js'; +import { KMXPlus } from '@keymanapp/common-types'; + +import Ordr = KMXPlus.Ordr; + +describe('ordr', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile minimal ordr data', function() { + let ordr = loadSectionFixture(OrdrCompiler, 'sections/ordr/minimal.xml', compilerTestCallbacks) as Ordr; + assert.lengthOf(compilerTestCallbacks.messages, 0); + + it.skip('TODO-LDML rewriting this #7377', () => { + assert.lengthOf(ordr.items, 1); + assert.lengthOf(ordr.items[0].elements, 4); + assert.strictEqual(ordr.items[0].elements[0].value.value, "ខ"); + assert.strictEqual(ordr.items[0].elements[1].value.value, "ែ"); + assert.strictEqual(ordr.items[0].elements[2].value.value, "្"); + assert.strictEqual(ordr.items[0].elements[3].value.value, "ម"); + assert.strictEqual(ordr.items[0].elements[0].order, 1); + assert.strictEqual(ordr.items[0].elements[1].order, 3); + assert.strictEqual(ordr.items[0].elements[2].order, 4); + assert.strictEqual(ordr.items[0].elements[3].order, 2); + assert.isEmpty(ordr.items[0].before); + }); + }); +}); + diff --git a/developer/src/kmc-ldml/test/test-testdata-e2e.ts b/developer/src/kmc-ldml/test/test-testdata-e2e.ts new file mode 100644 index 0000000000000000000000000000000000000000..25ac1963213a5fed475292821837b4fbb8c005fb --- /dev/null +++ b/developer/src/kmc-ldml/test/test-testdata-e2e.ts @@ -0,0 +1,24 @@ +import { readFileSync } from 'fs'; +import 'mocha'; +import {assert} from 'chai'; +import {loadTestdata, makePathToFixture} from './helpers/index.js'; + +describe('testdata-tests', function() { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should-build-testdata-fixtures', async function() { + // Let's build test-fr.json + // It should match test-fr.json (built from test-fr.xml) + + const inputFilename = makePathToFixture('test-fr.xml'); + const jsonFilename = makePathToFixture('test-fr.json'); + + // Compile the keyboard + const testData = loadTestdata(inputFilename, {debug: true, addCompilerVersion: false}); + assert.isNotNull(testData); + + const jsonData = JSON.parse(readFileSync(jsonFilename, 'utf-8')); + + assert.deepEqual(testData, jsonData); + }); +}); diff --git a/developer/src/kmc-ldml/test/test-tran.ts b/developer/src/kmc-ldml/test/test-tran.ts new file mode 100644 index 0000000000000000000000000000000000000000..0661af62a520179ad85ea61633db5c49d07f2f0c --- /dev/null +++ b/developer/src/kmc-ldml/test/test-tran.ts @@ -0,0 +1,28 @@ +import 'mocha'; +import { assert } from 'chai'; +import { TranCompiler } from '../src/compiler/tran.js'; +import { compilerTestCallbacks, loadSectionFixture } from './helpers/index.js'; +import { KMXPlus } from '@keymanapp/common-types'; + +import Tran = KMXPlus.Tran; +import TranItemFlags = KMXPlus.TranItemFlags; + +describe('tran', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile minimal tran data', function() { + let tran = loadSectionFixture(TranCompiler, 'sections/tran/minimal.xml', compilerTestCallbacks) as Tran; + assert.lengthOf(compilerTestCallbacks.messages, 0); + + it.skip('TODO-LDML rewriting this #7377', () => { + assert.lengthOf(tran.items, 1); + assert.lengthOf(tran.items[0].from, 2); + assert.strictEqual(tran.items[0].from[0].value.value, "x"); + assert.strictEqual(tran.items[0].from[1].value.value, "x"); + assert.strictEqual(tran.items[0].flags, TranItemFlags.error); + assert.isEmpty(tran.items[0].before); + assert.strictEqual(tran.items[0].to.value, "x"); + }); + }); +}); + diff --git a/developer/src/kmc-ldml/test/test-utils.ts b/developer/src/kmc-ldml/test/test-utils.ts new file mode 100644 index 0000000000000000000000000000000000000000..de41caa64b39d58811b95184e83f3a6632276f92 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-utils.ts @@ -0,0 +1,164 @@ +import 'mocha'; +import {assert} from 'chai'; +import { isValidEnumValue, calculateUniqueKeys, allUsedKeyIdsInLayers, translateLayerAttrToModifier, validModifier } from '../src/util/util.js'; +import { constants } from "@keymanapp/ldml-keyboard-constants"; +import { LDMLKeyboard } from '@keymanapp/common-types'; + +describe('test of util/util.ts', () => { + describe('isValidEnumValue()', () => { + enum MyFruit { + apple, peach, pear, plum + }; + enum MyNumbers { + wieħed=1, tnejn=2, tlieta=3 + }; + enum MyLetters { + akka='h', magħtugha='ħ' + }; + + it('should handle a bare enum', ()=> { + assert.ok(isValidEnumValue(MyFruit, 'apple')); + assert.notOk(isValidEnumValue(MyFruit, 'banana')); + assert.notOk(isValidEnumValue(MyFruit, '')); + assert.notOk(isValidEnumValue(MyFruit, undefined)); + assert.notOk(isValidEnumValue(MyFruit, null)); + assert.notOk(isValidEnumValue(MyFruit, 'unknown')); + }); + + it('should handle a numerical enum', ()=> { + assert.ok(isValidEnumValue(MyNumbers, 'tlieta')); + assert.notOk(isValidEnumValue(MyNumbers, '3')); + assert.notOk(isValidEnumValue(MyNumbers, 'seventy-six')); + assert.notOk(isValidEnumValue(MyNumbers, '76')); + }); + + it('should handle a string enum', ()=> { + assert.ok(isValidEnumValue(MyLetters, 'h')); + assert.ok(isValidEnumValue(MyLetters, 'ħ')); + assert.notOk(isValidEnumValue(MyLetters, 'akka')); + assert.notOk(isValidEnumValue(MyLetters, 'z')); + assert.notOk(isValidEnumValue(MyLetters, 'zed')); + }); + }); + + describe('calculateUniqueKeys()', () => { + it('should handle some null cases', () => { + assert.sameDeepMembers(calculateUniqueKeys(null), + []); + assert.sameDeepMembers(calculateUniqueKeys([]), + []); + }); + it('should handle some real cases', () => { + assert.sameDeepMembers(calculateUniqueKeys([ + { id: 'a', to: 'a' }, + { id: 'a', to: 'a' }, // dup + { id: 'b', to: 'b' }, + { id: 'a', to: 'å' }, // override + ]),[ + { id: 'b', to: 'b' }, + { id: 'a', to: 'å' }, + ]); + }); + }); + + describe('allUsedKeyIdsInLayers()', () => { + it('should handle a null case', () => { + assert.sameDeepMembers(Array.from(allUsedKeyIdsInLayers(null).values()), + []); + }); + it('should handle a real case', () => { + assert.sameDeepMembers(Array.from(allUsedKeyIdsInLayers([ + { + layer: [ + { + row: [ + { keys: 'q w e r t y' }, + { keys: 'a s d f' }, + ] + }, + { + row: [ + { keys: 'Q W E R T Y' }, + { keys: 'A S D F' }, + ] + } + ] + }, + { + layer: [ + { + row: [ + { keys: 'q w e r t y' }, + { keys: '0 1 2 3' } + ] + }, + ] + } + ]).values()), + 'q w e r t y Q W E R T Y a s d f A S D F 0 1 2 3'.split(' ')); + }); + }); + describe('translateLayerAttrToModifier', () => { + it('should map from layer info to modifier number', () => { + assert.equal(translateLayerAttrToModifier({ + id: 'base', + }), constants.keys_mod_none); + assert.equal(translateLayerAttrToModifier({ + id: 'base', + modifier: '', + }), constants.keys_mod_none); + assert.equal(translateLayerAttrToModifier({ + id: 'base', + modifier: 'none', + }), constants.keys_mod_none); + assert.equal(translateLayerAttrToModifier({ + id: 'shift', + modifier: 'shift', + }), constants.keys_mod_shift); + assert.equal(translateLayerAttrToModifier({ + id: 'shift', + modifier: 'shift', + }), constants.keys_mod_shift); + assert.equal(translateLayerAttrToModifier({ + id: 'altshift', + modifier: 'alt shift', + }), constants.keys_mod_alt | constants.keys_mod_shift); + }); + it('should round trip each possible modifier', () => { + for(let str of constants.keys_mod_map.keys()) { + const layer : LDMLKeyboard.LKLayer = { + id: str, + modifier: `${str}`, + }; + assert.equal(translateLayerAttrToModifier(layer), + constants.keys_mod_map.get(str), str); + } + }); + it('should round trip each possible modifier with altL', () => { + for(let str of constants.keys_mod_map.keys()) { + const layer : LDMLKeyboard.LKLayer = { + id: str, + modifier: `${str} altL`, + }; + assert.equal(translateLayerAttrToModifier(layer), + constants.keys_mod_map.get(str) | constants.keys_mod_altL, str); + } + }); + }); + describe('isValidModifier()', () => { + it('should treat falsy values as valid', () => { + for(let str of [ + null, undefined, '', 'none' + ]) { + assert.ok(validModifier(str), `validModifier(${JSON.stringify(str)})`); + } + }); + it('should treat bad values as invalid', () => { + for(let str of [ + 'asdfasdf', 'shift asdfasdf', 'altR-shift', 'altR-shift shift' + ]) { + assert.notOk(validModifier(str), `validModifier(${JSON.stringify(str)})`); + } + }); + }); +}); diff --git a/developer/src/kmc-ldml/test/test-virtual-key-constants.ts b/developer/src/kmc-ldml/test/test-virtual-key-constants.ts new file mode 100644 index 0000000000000000000000000000000000000000..3ad5d3662cce47451c723f58f8454168a154c205 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-virtual-key-constants.ts @@ -0,0 +1,70 @@ +import { expect } from 'chai'; +import { Constants } from '@keymanapp/common-types'; + +import LdmlVkeyNames = Constants.LdmlVkeyNames; + +describe('virtual key constants', function () { + + it('should map the CLDR VKey Enum values to the right constants', function () { + + // These are copied-and-pasted from the table in TR35 + // We want to check that our constants match the ones in that table! + const CLDRVKeyEnumValues: Record = { + 'SPACE': 0x20, + '0': 0x30, + '1': 0x31, + '2': 0x32, + '3': 0x33, + '4': 0x34, + '5': 0x35, + '6': 0x36, + '7': 0x37, + '8': 0x38, + '9': 0x39, + 'A': 0x41, + 'B': 0x42, + 'C': 0x43, + 'D': 0x44, + 'E': 0x45, + 'F': 0x46, + 'G': 0x47, + 'H': 0x48, + 'I': 0x49, + 'J': 0x4A, + 'K': 0x4B, + 'L': 0x4C, + 'M': 0x4D, + 'N': 0x4E, + 'O': 0x4F, + 'P': 0x50, + 'Q': 0x51, + 'R': 0x52, + 'S': 0x53, + 'T': 0x54, + 'U': 0x55, + 'V': 0x56, + 'W': 0x57, + 'X': 0x58, + 'Y': 0x59, + 'Z': 0x5A, + 'SEMICOLON': 0xBA, + 'EQUAL': 0xBB, + 'COMMA': 0xBC, + 'HYPHEN': 0xBD, + 'PERIOD': 0xBE, + 'SLASH': 0xBF, + 'GRAVE': 0xC0, + 'LBRACKET': 0xDB, + 'BACKSLASH': 0xDC, + 'RBRACKET': 0xDD, + 'QUOTE': 0xDE, + 'LESS-THAN': 0xE2, + 'ABNT2': 0xC1 + }; + + const keys = Object.keys(CLDRVKeyEnumValues); + for (let key of keys) { + expect(CLDRVKeyEnumValues[key]).to.be.equal(LdmlVkeyNames[key]); + } + }); +}); diff --git a/developer/src/kmc-ldml/test/test-visual-keyboard-compiler-e2e.ts b/developer/src/kmc-ldml/test/test-visual-keyboard-compiler-e2e.ts new file mode 100644 index 0000000000000000000000000000000000000000..1b1e34069e5ac2b13982f5ee18654b80d1bacb6f --- /dev/null +++ b/developer/src/kmc-ldml/test/test-visual-keyboard-compiler-e2e.ts @@ -0,0 +1,33 @@ +import 'mocha'; +import {assert} from 'chai'; +import x_hextobin from '@keymanapp/hextobin'; +import { KvkFileWriter } from '@keymanapp/common-types'; +import {checkMessages, compileVisualKeyboard, makePathToFixture} from './helpers/index.js'; + +const hextobin = (x_hextobin as any).default; + +describe('visual-keyboard-compiler', function() { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should build fixtures', async function() { + // Let's build basic.xml + // It should match basic.kvk (built from basic-kvk.txt) + + const inputFilename = makePathToFixture('basic.xml'); + const binaryFilename = makePathToFixture('basic-kvk.txt'); + + // Compile the visual keyboard + const vk = compileVisualKeyboard(inputFilename, {debug: true, addCompilerVersion: false}); + assert.isNotNull(vk); + + // Use the builder to generate the binary output file + const writer = new KvkFileWriter(); + const code = writer.write(vk); + checkMessages(); + assert.isNotNull(code); + + // Compare output + let expected = await hextobin(binaryFilename, undefined, {silent:true}); + assert.deepEqual(code, expected); + }); +}); \ No newline at end of file diff --git a/developer/src/kmc-ldml/test/test-vkey.ts b/developer/src/kmc-ldml/test/test-vkey.ts new file mode 100644 index 0000000000000000000000000000000000000000..185754c976ff9c0c4310006e69670b3ef9b1bf61 --- /dev/null +++ b/developer/src/kmc-ldml/test/test-vkey.ts @@ -0,0 +1,62 @@ +import 'mocha'; +import { assert } from 'chai'; +import { VkeyCompiler } from '../src/compiler/vkey.js'; +import { compilerTestCallbacks, loadSectionFixture } from './helpers/index.js'; +import { KMXPlus, Constants } from '@keymanapp/common-types'; +import { CompilerMessages } from '../src/compiler/messages.js'; + +import Vkey = KMXPlus.Vkey; +import USVirtualKeyCodes = Constants.USVirtualKeyCodes; + +describe('vkey compiler', function () { + this.slow(500); // 0.5 sec -- json schema validation takes a while + + it('should compile minimal vkey data', function() { + let vkey = loadSectionFixture(VkeyCompiler, 'sections/vkey/minimal.xml', compilerTestCallbacks) as Vkey; + assert.equal(compilerTestCallbacks.messages.length, 0); + + assert.equal(vkey.vkeys.length, 4); + // Note, final order is sorted by `vkey` member + assert.deepEqual(vkey.vkeys[0], {vkey: USVirtualKeyCodes.K_A, target: USVirtualKeyCodes.K_Q}); + assert.deepEqual(vkey.vkeys[1], {vkey: USVirtualKeyCodes.K_Q, target: USVirtualKeyCodes.K_A}); + assert.deepEqual(vkey.vkeys[2], {vkey: USVirtualKeyCodes.K_W, target: USVirtualKeyCodes.K_Z}); + assert.deepEqual(vkey.vkeys[3], {vkey: USVirtualKeyCodes.K_Z, target: USVirtualKeyCodes.K_W}); + }); + + it('should hint on redundant data', function() { + let vkey = loadSectionFixture(VkeyCompiler, 'sections/vkey/redundant.xml', compilerTestCallbacks) as Vkey; + assert.isNotNull(vkey); + assert.equal(compilerTestCallbacks.messages.length, 1); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Hint_VkeyIsRedundant({vkey: 'A'})); + }); + + it('should report an info message if same target found', function() { + let vkey = loadSectionFixture(VkeyCompiler, 'sections/vkey/same-target.xml', compilerTestCallbacks) as Vkey; + assert.isNotNull(vkey); + assert.equal(compilerTestCallbacks.messages.length, 1); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Info_MultipleVkeysHaveSameTarget({vkey: 'Q'})); + }); + + it('should error on invalid "from" vkey', function() { + let vkey = loadSectionFixture(VkeyCompiler, 'sections/vkey/invalid-from-vkey.xml', compilerTestCallbacks) as Vkey; + assert.isNull(vkey); + assert.equal(compilerTestCallbacks.messages.length, 2); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_VkeyIsNotValid({vkey: 'q'})); + assert.deepEqual(compilerTestCallbacks.messages[1], CompilerMessages.Error_VkeyIsNotValid({vkey: 'HYFEN'})); + }); + + it('should error on invalid "to" vkey', function() { + let vkey = loadSectionFixture(VkeyCompiler, 'sections/vkey/invalid-to-vkey.xml', compilerTestCallbacks) as Vkey; + assert.isNull(vkey); + assert.equal(compilerTestCallbacks.messages.length, 1); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_VkeyIsNotValid({vkey: 'A-ACUTE'})); + }); + + it('should error on repeated vkeys', function() { + let vkey = loadSectionFixture(VkeyCompiler, 'sections/vkey/invalid-repeated-vkey.xml', compilerTestCallbacks) as Vkey; + assert.isNull(vkey); + assert.equal(compilerTestCallbacks.messages.length, 1); + assert.deepEqual(compilerTestCallbacks.messages[0], CompilerMessages.Error_VkeyIsRepeated({vkey: 'A'})); + }); +}); + diff --git a/developer/src/kmc-ldml/test/tsconfig.json b/developer/src/kmc-ldml/test/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..cfc7583fa48620c06c92c20039f6b11dfa724f4d --- /dev/null +++ b/developer/src/kmc-ldml/test/tsconfig.json @@ -0,0 +1,28 @@ +{ + "extends": "../../kmc/tsconfig.kmc-base.json", + + "compilerOptions": { + "rootDir": ".", + "rootDirs": ["./", "../src/"], + "outDir": "../build/test", + "baseUrl": ".", + "strictNullChecks": false, // TODO: get rid of this as some point + "paths": { + // "@keymanapp/keyman-version": ["../../../common/web/keyman-version/keyman-version.mts"], + "@keymanapp/common-types": ["../../../../common/web/types/src/main"], + "@keymanapp/developer-test-helpers": ["../../common/web/test-helpers/index"], + // "@keymanapp/": ["core/include/ldml/ldml-keyboard-constants"], + }, + }, + "include": [ + "**/test-*.ts", + "./helpers/index.ts" + ], + "references": [ + { "path": "../../../../common/web/keyman-version/tsconfig.esm.json" }, + { "path": "../../../../common/web/types/" }, + { "path": "../../../../common/tools/hextobin/" }, + { "path": "../../common/web/test-helpers/" }, + { "path": "../" } + ] +} \ No newline at end of file diff --git a/developer/src/kmc-ldml/tsconfig.json b/developer/src/kmc-ldml/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..a9dcdbbb2a8e8039b5bd7a448ab80c93434df207 --- /dev/null +++ b/developer/src/kmc-ldml/tsconfig.json @@ -0,0 +1,25 @@ +{ + "extends": "../../../tsconfig.esm-base.json", + + "compilerOptions": { + "outDir": "build/src/", + "rootDir": "src/", + "baseUrl": ".", + "allowSyntheticDefaultImports": true, // for ajv + + "paths": { + // "@keymanapp/keyman-version": ["../../../common/web/keyman-version/keyman-version.mts"], + "@keymanapp/common-types": ["../../../common/web/types/src/main"], + // "@keymanapp/": ["core/include/ldml/ldml-keyboard-constants"], + }, + + }, + "include": [ + "src/**/*.ts" + ], + "references": [ + { "path": "../../../common/web/keyman-version/tsconfig.esm.json" }, + { "path": "../../../common/web/types/" }, + { "path": "../../../core/include/ldml/"}, + ] +} diff --git a/developer/src/kmc-model-info/.eslintrc.cjs b/developer/src/kmc-model-info/.eslintrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..01dae6b737e69e50f7ece590cc3fa7716d70ed11 --- /dev/null +++ b/developer/src/kmc-model-info/.eslintrc.cjs @@ -0,0 +1,14 @@ +module.exports = { + parserOptions: { + project: ["./tsconfig.json", "./test/tsconfig.json"], + }, + overrides: [ + { + files:"src/**/*.ts", + // extends: ["../../../common/web/eslint/eslintNoNodeImports.js"], + } + ], + rules: { + "prefer-const": "off", // TODO: enable this once infrastructure is in place and cleanup the problem cases + }, +}; diff --git a/developer/src/kmc-model-info/Makefile b/developer/src/kmc-model-info/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..878d77f184f61fd91dd90ee8c403ed7c513c8f8c --- /dev/null +++ b/developer/src/kmc-model-info/Makefile @@ -0,0 +1,38 @@ +# +# Keyman Developer - kmc Model-Info Compiler Makefile +# + +!include ..\Defines.mak + +# We don't depend on configure here because kmc-ldml does that already +build: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh build + +configure: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh configure + +clean: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh clean + +test: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh test + +# build.sh bundle must be run from shell as it requires a temp folder to be +# passed in. See inst/download.in.mak for instantiation. + +publish: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh publish + +signcode: + @rem nothing to do + +wrap-symbols: + @rem nothing to do + +test-manifest: + @rem nothing to do + +install: + @rem nothing to do + +!include ..\Target.mak diff --git a/developer/src/kmc-model-info/build.sh b/developer/src/kmc-model-info/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..7c2119826f5c3dba16e250d92b387e60bb6cfbc1 --- /dev/null +++ b/developer/src/kmc-model-info/build.sh @@ -0,0 +1,67 @@ +#!/usr/bin/env bash +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +cd "$THIS_SCRIPT_PATH" + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +builder_describe "Build Keyman kmc Lexical Model model-info Compiler module" \ + "@/common/web/types" \ + "@/common/models/types" \ + "clean" \ + "configure" \ + "build" \ + "test" \ + "pack build a local .tgz pack for testing" \ + "publish publish to npm" \ + "--dry-run,-n don't actually publish, just dry run" + +builder_describe_outputs \ + configure /node_modules \ + build /developer/src/kmc-model-info/build/src/model-info-compiler.js + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action clean; then + rm -rf ./build/ ./tsconfig.tsbuildinfo + builder_finish_action success clean +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action configure; then + verify_npm_setup + builder_finish_action success configure +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action build; then + npm run build + builder_finish_action success build +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action test; then + #npm test - no tests as yet + builder_finish_action success test +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action publish; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_npm + builder_finish_action success publish +elif builder_start_action pack; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_pack + builder_finish_action success pack +fi diff --git a/developer/src/kmc-model-info/package.json b/developer/src/kmc-model-info/package.json new file mode 100644 index 0000000000000000000000000000000000000000..709f9d2d6fc0b29a0b732361a6463e6b487e42ad --- /dev/null +++ b/developer/src/kmc-model-info/package.json @@ -0,0 +1,59 @@ +{ + "name": "@keymanapp/kmc-model-info", + "description": "Keyman Developer .model_info compiler", + "keywords": [ + "keyboard", + "keyman", + "unicode", + "lexical-model", + "predictive-text" + ], + "type": "module", + "exports": { + ".": "./build/src/model-info-compiler.js" + }, + "files": [ + "/build/src/" + ], + "scripts": { + "build": "tsc -b", + "lint": "eslint .", + "test": "npm run lint && cd test && tsc -b && cd .. && c8 --reporter=lcov --reporter=text mocha", + "prepublishOnly": "npm run build" + }, + "author": "Marc Durdin (https://github.com/mcdurdin)", + "contributors": [ + "Eddie Antonio Santos ", + "Joshua Horton" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/keymanapp/keyman/issues" + }, + "dependencies": { + "@keymanapp/common-types": "*", + "@keymanapp/models-types": "*" + }, + "devDependencies": { + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "mocha": "^8.4.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" + }, + "mocha": { + "spec": "build/test/**/test-*.js", + "require": [ + "source-map-support/register" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/keymanapp/keyman.git" + } +} diff --git a/developer/src/kmlmc/source/util/min-keyman-version.ts b/developer/src/kmc-model-info/src/min-keyman-version.ts similarity index 100% rename from developer/src/kmlmc/source/util/min-keyman-version.ts rename to developer/src/kmc-model-info/src/min-keyman-version.ts diff --git a/developer/src/kmlmc/source/model-info-compiler/model-info-compiler.ts b/developer/src/kmc-model-info/src/model-info-compiler.ts similarity index 92% rename from developer/src/kmlmc/source/model-info-compiler/model-info-compiler.ts rename to developer/src/kmc-model-info/src/model-info-compiler.ts index e8606b0dc632bd5b16638cf7d71f2bfd802b63d4..7fd22308d557d9d0bb3ebec7064fbb87ffb1ced1 100644 --- a/developer/src/kmlmc/source/model-info-compiler/model-info-compiler.ts +++ b/developer/src/kmc-model-info/src/model-info-compiler.ts @@ -3,21 +3,18 @@ * compiled files to produce a comprehensive .model_info file. */ -/// -/// - import * as fs from "fs"; import * as path from "path"; -import { minKeymanVersion } from "../util/min-keyman-version"; -import {SysExits} from "../util/sysexits"; - +import { minKeymanVersion } from "./min-keyman-version.js"; +import { ModelInfoFile } from "./model-info-file.js"; +import { KmpJsonFile } from "@keymanapp/common-types"; export class ModelInfoOptions { /** The identifier for the model */ model_id: string; /** The data from the .kps file, transformed to kmp.json */ - kmpJsonData: KmpJsonFile; + kmpJsonData: KmpJsonFile.KmpJsonFile; /** The path in the keymanapp/lexical-models repo where this model may be found (optional) */ sourcePath?: string; @@ -96,8 +93,7 @@ export function writeMergedModelMetadataFile( // we strip the mailto: from the .kps file for the .model_info let match = author.url.match(/^(mailto\:)?(.+)$/); if (match === null) { - console.error(`Invalid author email: ${author.url}`); - process.exit(SysExits.EX_DATAERR); + throw new Error(`Invalid author email: ${author.url}`); } let email = match[2]; diff --git a/developer/src/kmlmc/source/lexical-model-compiler/model-info-file.ts b/developer/src/kmc-model-info/src/model-info-file.ts similarity index 84% rename from developer/src/kmlmc/source/lexical-model-compiler/model-info-file.ts rename to developer/src/kmc-model-info/src/model-info-file.ts index 2320218bf7e6c1f4ac4c824acf6679fac1115632..36c17fc5aa5ba289fdf932ed2a2aff6c01c62138 100644 --- a/developer/src/kmlmc/source/lexical-model-compiler/model-info-file.ts +++ b/developer/src/kmc-model-info/src/model-info-file.ts @@ -1,4 +1,4 @@ -interface ModelInfoFile { +export interface ModelInfoFile { id?: string; name?: string; authorName?: string; @@ -21,12 +21,12 @@ interface ModelInfoFile { related?: ModelInfoFileRelated[]; } -interface ModelInfoFileLink { +export interface ModelInfoFileLink { name: string; url: string; } -interface ModelInfoFileRelated { +export interface ModelInfoFileRelated { deprecates?: string; deprecatedBy?: string; note?: string; diff --git a/developer/src/kmc-model-info/tsconfig.json b/developer/src/kmc-model-info/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..1e6ba49b190f09623f7062e6b0abaf000d87662b --- /dev/null +++ b/developer/src/kmc-model-info/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../kmc/tsconfig.kmc-base.json", + + "compilerOptions": { + "outDir": "build/src/", + "rootDir": "src/", + "baseUrl": ".", + "paths": { + } + }, + "include": [ + "src/**/*.ts" + ], + "references": [ + { "path": "../../../common/web/types" }, + { "path": "../../../common/models/types" }, + ] +} diff --git a/developer/src/kmc-model/.eslintrc.cjs b/developer/src/kmc-model/.eslintrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..bd32773f9ada5d3c4e82ac3ff22bc268d70c0aad --- /dev/null +++ b/developer/src/kmc-model/.eslintrc.cjs @@ -0,0 +1,19 @@ +module.exports = { + parserOptions: { + project: ["./tsconfig.json", "./test/tsconfig.json"], + }, + ignorePatterns: [ + "test/fixtures/**/*", + "tools/*" /* TODO: linting on tools */, + ], + overrides: [ + { + files: "src/**/*.ts", + // extends: ["../../../common/web/eslint/eslintNoNodeImports.js"], + }, + ], + rules: { + "prefer-const": "off", // TODO: enable this once infrastructure is in place and cleanup the problem cases + "no-var": "off", // TODO: enable this once infrastructure is in place and cleanup the problem cases + }, +}; diff --git a/developer/src/kmc-model/Makefile b/developer/src/kmc-model/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..b41bbe81844c79856e4479de808232ef618bff98 --- /dev/null +++ b/developer/src/kmc-model/Makefile @@ -0,0 +1,38 @@ +# +# Keyman Developer - kmc Model Compiler Makefile +# + +!include ..\Defines.mak + +# We don't depend on configure here because kmc-ldml does that already +build: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh build + +configure: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh configure + +clean: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh clean + +test: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh test + +# build.sh bundle must be run from shell as it requires a temp folder to be +# passed in. See inst/download.in.mak for instantiation. + +publish: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh publish + +signcode: + @rem nothing to do + +wrap-symbols: + @rem nothing to do + +test-manifest: + @rem nothing to do + +install: + @rem nothing to do + +!include ..\Target.mak diff --git a/developer/src/kmc-model/build.sh b/developer/src/kmc-model/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..ecf58e20e478e40cdb2094d854acb523e483f261 --- /dev/null +++ b/developer/src/kmc-model/build.sh @@ -0,0 +1,45 @@ +#!/usr/bin/env bash +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" +. "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + +cd "$THIS_SCRIPT_PATH" + +# TODO: "@/common/models/types" \ + +builder_describe "Build Keyman kmc Lexical Model Compiler module" \ + "@/common/web/keyman-version" \ + "@/developer/src/common/web/test-helpers" \ + "clean" \ + "configure" \ + "build" \ + "test" \ + "pack build a local .tgz pack for testing" \ + "publish publish to npm" \ + "--dry-run,-n don't actually publish, just dry run" + +builder_describe_outputs \ + configure /node_modules \ + build /developer/src/kmc-model/build/src/main.js + +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +function do_build() { + mkdir -p build/cjs-src + npm run build +} + +builder_run_action clean rm -rf ./build/ ./tsconfig.tsbuildinfo +builder_run_action configure verify_npm_setup +builder_run_action build do_build +builder_run_action test npm test +builder_run_action publish builder_publish_to_npm +builder_run_action pack builder_publish_to_pack + diff --git a/developer/src/kmc-model/package.json b/developer/src/kmc-model/package.json new file mode 100644 index 0000000000000000000000000000000000000000..bbeefca05ed595d2787340a1942ab281b3970764 --- /dev/null +++ b/developer/src/kmc-model/package.json @@ -0,0 +1,76 @@ +{ + "name": "@keymanapp/kmc-model", + "description": "Keyman Developer lexical model compiler", + "keywords": [ + "keyboard", + "keyman", + "unicode", + "lexical-model", + "predictive-text" + ], + "type": "module", + "exports": { + ".": "./build/src/main.js" + }, + "files": [ + "/build/src/" + ], + "scripts": { + "build": "tsc -b && npm run build-cjs", + "build-cjs": "esbuild build/src/lexical-model-compiler.js --bundle --platform=node --external:../../node_modules/* > build/cjs-src/lexical-model-compiler.cjs", + "lint": "eslint .", + "test": "npm run lint && cd test && tsc -b && cd .. && c8 --reporter=lcov --reporter=text mocha", + "prepublishOnly": "npm run build" + }, + "author": "Marc Durdin (https://github.com/mcdurdin)", + "contributors": [ + "Eddie Antonio Santos ", + "Joshua Horton" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/keymanapp/keyman/issues" + }, + "dependencies": { + "@keymanapp/keyman-version": "*", + "@keymanapp/models-types": "*", + "@keymanapp/common-types": "*", + "typescript": "^4.9.5", + "xml2js": "^0.4.19" + }, + "devDependencies": { + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "esbuild": "^0.15.7", + "mocha": "^10.0.0", + "ts-node": "^10.9.1", + "@keymanapp/developer-test-helpers": "*" + }, + "mocha": { + "spec": "build/test/**/test-*.js", + "require": [ + "source-map-support/register" + ] + }, + "c8": { + "all": true, + "src": [ + "src/" + ], + "exclude-after-remap": true, + "exclude": [ + "test/", + "tools/", + "src/lexical-model.ts" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/keymanapp/keyman.git" + } +} diff --git a/developer/src/kmlmc/source/lexical-model-compiler/build-trie.ts b/developer/src/kmc-model/src/build-trie.ts similarity index 95% rename from developer/src/kmlmc/source/lexical-model-compiler/build-trie.ts rename to developer/src/kmc-model/src/build-trie.ts index 8bf49a51243a1edbe48ca5fc20ec01428fe9d3ab..beeb80821b6bac61d3cceb84a612e3119d54230e 100644 --- a/developer/src/kmlmc/source/lexical-model-compiler/build-trie.ts +++ b/developer/src/kmc-model/src/build-trie.ts @@ -1,5 +1,6 @@ import { readFileSync } from "fs"; -import { log, KeymanCompilerError } from "../errors"; +import { ModelCompilerError, ModelCompilerMessageContext, ModelCompilerMessages } from "./model-compiler-errors.js"; +import { callbacks } from "./compiler-callbacks.js"; // Supports LF or CRLF line terminators. const NEWLINE_SEPARATOR = /\u000d?\u000a/; @@ -23,7 +24,7 @@ export type WordList = {[wordform: string]: number}; */ export function createTrieDataStructure(filenames: string[], searchTermToKey?: (wf: string) => string): string { if (typeof searchTermToKey !== "function") { - throw new TypeError("searchTermToKey must be explicitly specified") + throw new ModelCompilerError(ModelCompilerMessages.Error_SearchTermToKeyMustBeExplicitlySpecified()); } // Make one big word list out of all of the filenames provided. let wordlist: WordList = {}; @@ -45,6 +46,7 @@ export function createTrieDataStructure(filenames: string[], searchTermToKey?: ( * @param filename filename of the word list */ export function parseWordListFromFilename(wordlist: WordList, filename: string): void { + ModelCompilerMessageContext.filename = filename; _parseWordList(wordlist, new WordListFromFilename(filename)); } @@ -56,6 +58,7 @@ export function parseWordListFromFilename(wordlist: WordList, filename: string): * @param filename filename of the word list */ export function parseWordListFromContents(wordlist: WordList, contents: string): void { + ModelCompilerMessageContext.filename = undefined; _parseWordList(wordlist, new WordListFromMemory(contents)); } @@ -91,6 +94,8 @@ function _parseWordList(wordlist: WordList, source: WordListSource): void { let wordsSeenInThisFile = new Set(); for (let [lineno, line] of source.lines()) { + ModelCompilerMessageContext.line = lineno; + // Remove the byte-order mark (BOM) from the beginning of the string. // Because `contents` can be the concatenation of several files, we have to remove // the BOM from every possible start of file -- i.e., beginning of every line. @@ -109,11 +114,7 @@ function _parseWordList(wordlist: WordList, source: WordListSource): void { wordform = wordform.normalize('NFC'); if (original !== wordform) { // Mixed normalization forms are yucky! Warn about it. - log( - KeymanCompilerError.CWARN_MixedNormalizationForms, - `“${wordform}” is not in Unicode NFC. Automatically converting to NFC.`, - {filename: source.name, lineno} - ) + callbacks.reportMessage(ModelCompilerMessages.Warn_MixedNormalizationForms({wordform: wordform})); } wordform = wordform.trim() @@ -131,11 +132,7 @@ function _parseWordList(wordlist: WordList, source: WordListSource): void { if (wordsSeenInThisFile.has(wordform)) { // The same word seen across multiple files is fine, // but a word seen multiple times in one file is a problem! - log( - KeymanCompilerError.CWARN_DuplicateWordInSameFile, - `duplicate word “${wordform}” found in same file; summing counts`, - {filename: source.name, lineno} - ) + callbacks.reportMessage(ModelCompilerMessages.Warn_DuplicateWordInSameFile({wordform: wordform})); } wordsSeenInThisFile.add(wordform); @@ -473,7 +470,7 @@ namespace Trie { } if(isNaN(val)) { - console.error("Unexpected NaN has appeared!"); + throw new Error("Unexpected NaN has appeared!"); } return val; } @@ -503,7 +500,7 @@ function detectEncoding(filename: string): 'utf8' | 'utf16le' { } else if (buffer[0] == 0xFE && buffer[1] == 0xFF) { // Big Endian, is NOT supported because Node does not support it (???) // See: https://stackoverflow.com/a/14551669/6626414 - throw new Error('UTF-16BE is unsupported') + throw new ModelCompilerError(ModelCompilerMessages.Error_UTF16BEUnsupported()); } else { // Assume its in UTF-8, with or without a BOM. return 'utf8'; diff --git a/developer/src/kmc-model/src/compiler-callbacks.ts b/developer/src/kmc-model/src/compiler-callbacks.ts new file mode 100644 index 0000000000000000000000000000000000000000..a077035003f9e36b258ac008b1e6d64372e01510 --- /dev/null +++ b/developer/src/kmc-model/src/compiler-callbacks.ts @@ -0,0 +1,7 @@ +import { CompilerCallbacks } from "@keymanapp/common-types"; + +export let callbacks: CompilerCallbacks; + +export function setCompilerCallbacks(c: CompilerCallbacks) { + callbacks = c; +} \ No newline at end of file diff --git a/developer/src/kmlmc/source/lexical-model-compiler/join-word-breaker-decorator.ts b/developer/src/kmc-model/src/join-word-breaker-decorator.ts similarity index 100% rename from developer/src/kmlmc/source/lexical-model-compiler/join-word-breaker-decorator.ts rename to developer/src/kmc-model/src/join-word-breaker-decorator.ts diff --git a/developer/src/kmlmc/source/lexical-model-compiler/lexical-model-compiler.ts b/developer/src/kmc-model/src/lexical-model-compiler.ts similarity index 88% rename from developer/src/kmlmc/source/lexical-model-compiler/lexical-model-compiler.ts rename to developer/src/kmc-model/src/lexical-model-compiler.ts index 78a25cd959283b8650a26b25a78694b6506e2018..0bf8bd8db4c2925645e51cdf999e7b1634025089 100644 --- a/developer/src/kmlmc/source/lexical-model-compiler/lexical-model-compiler.ts +++ b/developer/src/kmc-model/src/lexical-model-compiler.ts @@ -3,15 +3,16 @@ */ /// -/// import * as ts from "typescript"; import * as fs from "fs"; import * as path from "path"; -import { createTrieDataStructure } from "./build-trie"; -import { ModelDefinitions } from "./model-definitions"; -import {decorateWithJoin} from "./join-word-breaker-decorator"; -import {decorateWithScriptOverrides} from "./script-overrides-decorator"; +import { createTrieDataStructure } from "./build-trie.js"; +import { ModelDefinitions } from "./model-definitions.js"; +import {decorateWithJoin} from "./join-word-breaker-decorator.js"; +import {decorateWithScriptOverrides} from "./script-overrides-decorator.js"; +import { LexicalModelSource, WordBreakerSpec, SimpleWordBreakerSpec } from "./lexical-model.js"; +import { ModelCompilerError, ModelCompilerMessages } from "./model-compiler-errors.js"; export default class LexicalModelCompiler { @@ -43,7 +44,7 @@ export default class LexicalModelCompiler { func += `LMLayerWorker.loadModel(new ${modelSource.rootClass}());\n`; break; case "fst-foma-1.0": - throw new ModelSourceError(`Unimplemented model format: ${modelSource.format}`); + throw new ModelCompilerError(ModelCompilerMessages.Error_UnimplementedModelFormat({format:modelSource.format})); case "trie-1.0": // Convert all relative path names to paths relative to the enclosing // directory. This way, we'll read the files relative to the model.ts @@ -81,7 +82,7 @@ export default class LexicalModelCompiler { func += `}));\n`; break; default: - throw new ModelSourceError(`Unknown model format: ${modelSource.format}`); + throw new ModelCompilerError(ModelCompilerMessages.Error_UnknownModelFormat({format: modelSource.format})); } func += fileSuffix; @@ -99,14 +100,8 @@ export default class LexicalModelCompiler { ); }; - logError(s: string) { - console.error(require('chalk').red(s)); - }; }; -export class ModelSourceError extends Error { -} - /** * Returns a JavaScript expression (as a string) that can serve as a word * breaking function. @@ -170,7 +165,7 @@ function normalizeWordBreakerSpec(wordBreakerSpec: LexicalModelSource["wordBreak } else if (wordBreakerSpec.use) { return wordBreakerSpec; } else { - throw new Error(`Unknown word breaker: ${wordBreakerSpec}`); + throw new ModelCompilerError(ModelCompilerMessages.Error_UnknownWordBreaker({spec: wordBreakerSpec.toString()})); } } diff --git a/developer/src/kmlmc/source/lexical-model-compiler/lexical-model.ts b/developer/src/kmc-model/src/lexical-model.ts similarity index 87% rename from developer/src/kmlmc/source/lexical-model-compiler/lexical-model.ts rename to developer/src/kmc-model/src/lexical-model.ts index e1b55266d031eb512b151fcd5c5c923d991668b8..794d7763b224aa1ec12cc65fa19e5e569ad0b7fd 100644 --- a/developer/src/kmlmc/source/lexical-model-compiler/lexical-model.ts +++ b/developer/src/kmc-model/src/lexical-model.ts @@ -3,7 +3,7 @@ * the LMLayer's internal worker code, so we provide those definitions too. */ -interface LexicalModelDeclaration { +export interface LexicalModelDeclaration { readonly format: 'trie-1.0'|'fst-foma-1.0'|'custom-1.0', //... metadata ... } @@ -16,7 +16,7 @@ interface LexicalModelDeclaration { * * @since 14.0 */ -interface WordBreakerSpec { + export interface WordBreakerSpec { readonly use: SimpleWordBreakerSpec; /** * If present, joins words that were split by the word breaker @@ -43,27 +43,27 @@ interface WordBreakerSpec { * * @since 11.0 */ -type SimpleWordBreakerSpec = 'default' | 'ascii' | WordBreakingFunction; + export type SimpleWordBreakerSpec = 'default' | 'ascii' | WordBreakingFunction; /** * Simplifies input text to facilitate finding entries within a lexical model's * lexicon. * @since 11.0 */ -type SimpleWordformToKeySpec = (term: string) => string; + export type SimpleWordformToKeySpec = (term: string) => string; /** * Simplifies input text to facilitate finding entries within a lexical model's * lexicon, using the model's `applyCasing` function to assist in the keying process. * @since 14.0 */ - type CasedWordformToKeySpec = (term: string, applyCasing?: CasingFunction) => string; +export type CasedWordformToKeySpec = (term: string, applyCasing?: CasingFunction) => string; /** * Simplifies input text to facilitate finding entries within a lexical model's * lexicon. */ -type WordformToKeySpec = SimpleWordformToKeySpec | CasedWordformToKeySpec; + export type WordformToKeySpec = SimpleWordformToKeySpec | CasedWordformToKeySpec; /** * Override the default word breaking behaviour for some scripts. @@ -89,10 +89,10 @@ type WordformToKeySpec = SimpleWordformToKeySpec | CasedWordformToKeySpec; * * @since 14.0 */ -type OverrideScriptDefaults = 'break-words-at-spaces'; +export type OverrideScriptDefaults = 'break-words-at-spaces'; -interface LexicalModelSource extends LexicalModelDeclaration { +export interface LexicalModelSource extends LexicalModelDeclaration { readonly sources: Array; /** * The name of the type to instantiate (without parameters) as the base object for a custom predictive model. @@ -114,7 +114,7 @@ interface LexicalModelSource extends LexicalModelDeclaration { * - 'initial' -- a version preserving the input casing aside from the initial character, * which is uppercased (like with proper nouns and sentence-initial words in English * sentences.) - * + * * This is only utilized if `languageUsesCasing` is defined and set to `true`. * @since 14.0 */ @@ -145,6 +145,6 @@ interface LexicalModelSource extends LexicalModelDeclaration { readonly punctuation?: LexicalModelPunctuation; } -interface LexicalModelCompiled extends LexicalModelDeclaration { +export interface LexicalModelCompiled extends LexicalModelDeclaration { readonly id: string; } diff --git a/developer/src/kmlmc/source/util/util.ts b/developer/src/kmc-model/src/main.ts similarity index 51% rename from developer/src/kmlmc/source/util/util.ts rename to developer/src/kmc-model/src/main.ts index 15e177fb05c025c32477b7ec5a02002b3f3a8c4f..3d808057d5981cef795bd59545735b1ef6cc1e31 100644 --- a/developer/src/kmlmc/source/util/util.ts +++ b/developer/src/kmc-model/src/main.ts @@ -1,24 +1,36 @@ -// TODO: this file is really only for lexical model compiler tests. Find a good name. -// +import { CompilerCallbacks } from '@keymanapp/common-types'; import * as fs from 'fs'; import * as path from 'path'; -import * as ts from 'typescript'; +import ts from 'typescript'; +import { setCompilerCallbacks } from './compiler-callbacks.js'; -import { SysExits } from "./sysexits"; -import LexicalModelCompiler from '../lexical-model-compiler/lexical-model-compiler'; +import LexicalModelCompiler from './lexical-model-compiler.js'; +import { LexicalModelSource } from './lexical-model.js'; +import { ModelCompilerError, ModelCompilerMessageContext, ModelCompilerMessages } from './model-compiler-errors.js'; /** * Compiles a model.ts file, using paths relative to its location. * * @param filename path to model.ts source. - * @return model source code + * @return model source code, or null on error */ -export function compileModel(filename: string): string { - let modelSource = loadFromFilename(filename); - let containingDirectory = path.dirname(filename); +export function compileModel(filename: string, callbacks: CompilerCallbacks): string { + setCompilerCallbacks(callbacks); - return (new LexicalModelCompiler) - .generateLexicalModelCode('', modelSource, containingDirectory); + try { + let modelSource = loadFromFilename(filename, callbacks); + let containingDirectory = path.dirname(filename); + + return (new LexicalModelCompiler) + .generateLexicalModelCode('', modelSource, containingDirectory); + } catch(e) { + callbacks.reportMessage( + e instanceof ModelCompilerError + ? e.event + : ModelCompilerMessages.Fatal_UnexpectedException({e:e}) + ); + } + return null; } /** @@ -35,15 +47,17 @@ interface ES2015Module { * * @param filename path to the model source file. */ -export function loadFromFilename(filename: string): LexicalModelSource { +export function loadFromFilename(filename: string, callbacks: CompilerCallbacks): LexicalModelSource { + setCompilerCallbacks(callbacks); + let sourceCode = fs.readFileSync(filename, 'utf8'); // Compile the module to JavaScript code. // NOTE: transpile module does a very simple TS to JS compilation. // It DOES NOT check for types! let compilationOutput = ts.transpile(sourceCode, { // Our runtime only supports ES3 with Node/CommonJS modules on Android 5.0. - // When we drop Android 5.0 support, we can update this to a `ScriptTarget` - // matrix against target version of Keyman, here and in + // When we drop Android 5.0 support, we can update this to a `ScriptTarget` + // matrix against target version of Keyman, here and in // lexical-model-compiler.ts. target: ts.ScriptTarget.ES3, module: ts.ModuleKind.CommonJS, @@ -57,9 +71,8 @@ export function loadFromFilename(filename: string): LexicalModelSource { module(moduleExports); if (!moduleExports['__esModule'] || !moduleExports['default']) { - console.error(`Model source '${filename}' does have a default export. Did you remember to write \`export default source;\`?`); - // TODO: throw an Error instead. - process.exit(SysExits.EX_DATAERR); + ModelCompilerMessageContext.filename = filename; + throw new ModelCompilerError(ModelCompilerMessages.Error_NoDefaultExport()); } return moduleExports['default'] as LexicalModelSource; diff --git a/developer/src/kmc-model/src/model-compiler-errors.ts b/developer/src/kmc-model/src/model-compiler-errors.ts new file mode 100644 index 0000000000000000000000000000000000000000..f7062da44e2cd2a9efff487d24a3c681d1503f5d --- /dev/null +++ b/developer/src/kmc-model/src/model-compiler-errors.ts @@ -0,0 +1,74 @@ +import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerEvent } from "@keymanapp/common-types"; + +const Namespace = CompilerErrorNamespace.ModelCompiler; +// const SevInfo = CompilerErrorSeverity.Info | Namespace; +// const SevHint = CompilerErrorSeverity.Hint | Namespace; +const SevWarn = CompilerErrorSeverity.Warn | Namespace; +const SevError = CompilerErrorSeverity.Error | Namespace; +const SevFatal = CompilerErrorSeverity.Fatal | Namespace; + +const m = (code: number, message: string) : CompilerEvent => { return { + line: ModelCompilerMessageContext.line, + filename: ModelCompilerMessageContext.filename, + code, + message +} }; + +export class ModelCompilerMessageContext { + // Context added to all messages + static line: number; + static filename: string; +} + +export class ModelCompilerMessages { + + static Fatal_UnexpectedException = (o:{e: any}) => m(this.FATAL_UnexpectedException, + `Unexpected exception: ${(o.e ?? 'unknown error').toString()}\n\nCall stack:\n${(o.e instanceof Error ? o.e.stack : (new Error()).stack)}`); + static FATAL_UnexpectedException = SevFatal | 0x0001; + + static Warn_MixedNormalizationForms = (o:{wordform: string}) => m(this.WARN_MixedNormalizationForms, + `“${o.wordform}” is not in Unicode NFC. Automatically converting to NFC.`); + static WARN_MixedNormalizationForms = SevWarn | 0x0002; + + static Warn_DuplicateWordInSameFile = (o:{wordform: string}) => m(this.WARN_DuplicateWordInSameFile, + `duplicate word “${o.wordform}” found in same file; summing counts`); + static WARN_DuplicateWordInSameFile = SevWarn | 0x0003; + + static Error_UnimplementedModelFormat = (o:{format: string}) => m(this.ERROR_UnimplementedModelFormat, + `Unimplemented model format: ${o.format}`); + static ERROR_UnimplementedModelFormat = SevError | 0x0004; + + static Error_UnknownModelFormat = (o:{format: string}) => m(this.ERROR_UnknownModelFormat, + `Unimplemented model format: ${o.format}`); + static ERROR_UnknownModelFormat = SevError | 0x0005; + + static Error_NoDefaultExport = () => m(this.ERROR_NoDefaultExport, + `Model source does have a default export. Did you remember to write \`export default source;\`?`); + static ERROR_NoDefaultExport = SevError | 0x0006; + + static Error_SearchTermToKeyMustBeExplicitlySpecified = () => m(this.ERROR_SearchTermToKeyMustBeExplicitlySpecified, + "searchTermToKey must be explicitly specified"); + static ERROR_SearchTermToKeyMustBeExplicitlySpecified = SevError | 0x0007; + + static Error_UTF16BEUnsupported = () => m(this.ERROR_UTF16BEUnsupported, 'UTF-16BE is unsupported'); + static ERROR_UTF16BEUnsupported = SevError | 0x0008; + + static Error_UnknownWordBreaker = (o:{spec:string}) => m(this.ERROR_UnknownWordBreaker, + `Unknown word breaker: ${o.spec}`); + static ERROR_UnknownWordBreaker = SevError | 0x0009; + + static Error_UnsupportedScriptOverride = (o:{option:string}) => m(this.ERROR_UnsupportedScriptOverride, + `Unsupported script override: ${o.option}`); + static ERROR_UnsupportedScriptOverride = SevError | 0x000A; +}; + +/** + * A ModelCompilerError should be thrown when an unrecoverable error occurs that + * would block further compilation. It will be caught in the top-most compiler + * API endpoint and converted into a callback message. + */ +export class ModelCompilerError extends Error { + constructor(public event: CompilerEvent) { + super(event.message); + } +} diff --git a/developer/src/kmlmc/source/lexical-model-compiler/model-defaults.ts b/developer/src/kmc-model/src/model-defaults.ts similarity index 100% rename from developer/src/kmlmc/source/lexical-model-compiler/model-defaults.ts rename to developer/src/kmc-model/src/model-defaults.ts diff --git a/developer/src/kmlmc/source/lexical-model-compiler/model-definitions.ts b/developer/src/kmc-model/src/model-definitions.ts similarity index 97% rename from developer/src/kmlmc/source/lexical-model-compiler/model-definitions.ts rename to developer/src/kmc-model/src/model-definitions.ts index 4ab6fcad1ee53329dfbb0d93da0c59c20d32fb4b..d05a8254ce5b4a817c9dc4f6a85508f2abe1db6a 100644 --- a/developer/src/kmlmc/source/lexical-model-compiler/model-definitions.ts +++ b/developer/src/kmc-model/src/model-definitions.ts @@ -1,9 +1,10 @@ import { defaultApplyCasing, defaultCasedSearchTermToKey, defaultSearchTermToKey - } from "./model-defaults"; + } from "./model-defaults.js"; -const KEYMAN_VERSION = require("@keymanapp/keyman-version").KEYMAN_VERSION; +import KEYMAN_VERSION from "@keymanapp/keyman-version"; +import { LexicalModelSource, WordformToKeySpec } from "./lexical-model.js"; /** * Processes certain defined model behaviors in such a way that the needed closures diff --git a/developer/src/kmlmc/source/lexical-model-compiler/script-overrides-decorator.ts b/developer/src/kmc-model/src/script-overrides-decorator.ts similarity index 87% rename from developer/src/kmlmc/source/lexical-model-compiler/script-overrides-decorator.ts rename to developer/src/kmc-model/src/script-overrides-decorator.ts index f53851146f97721de9fa4c83fb376e8b55922230..3723a56dae325d69c4a7cf5b5168d4fa55e750f7 100644 --- a/developer/src/kmlmc/source/lexical-model-compiler/script-overrides-decorator.ts +++ b/developer/src/kmc-model/src/script-overrides-decorator.ts @@ -1,15 +1,16 @@ -/// +import { OverrideScriptDefaults } from "./lexical-model.js"; +import { ModelCompilerError, ModelCompilerMessages } from "./model-compiler-errors.js"; export function decorateWithScriptOverrides(breaker: WordBreakingFunction, option: OverrideScriptDefaults) { if (option !== 'break-words-at-spaces') { - throw new Error(`Unsupported script override: ${option}`) + throw new ModelCompilerError(ModelCompilerMessages.Error_UnsupportedScriptOverride({option})); } /** * Matches if when a span contains a Southeast-Asian letter or mark anywhere. * This makes it a candidate for joining. * - * See: libexec/create-override-script-regexp.ts for how this RegExp was + * See: tools/create-override-script-regexp.ts for how this RegExp was * generated. * * Last updated for Unicode 13.0.0. diff --git a/developer/src/kmlmc/tests/README.md b/developer/src/kmc-model/test/README.md similarity index 100% rename from developer/src/kmlmc/tests/README.md rename to developer/src/kmc-model/test/README.md diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.joinwordbreaker/example.qaa.joinwordbreaker.model.ts b/developer/src/kmc-model/test/fixtures/example.qaa.joinwordbreaker/example.qaa.joinwordbreaker.model.ts similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.joinwordbreaker/example.qaa.joinwordbreaker.model.ts rename to developer/src/kmc-model/test/fixtures/example.qaa.joinwordbreaker/example.qaa.joinwordbreaker.model.ts diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.joinwordbreaker/wordlist.tsv b/developer/src/kmc-model/test/fixtures/example.qaa.joinwordbreaker/wordlist.tsv similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.joinwordbreaker/wordlist.tsv rename to developer/src/kmc-model/test/fixtures/example.qaa.joinwordbreaker/wordlist.tsv diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.scriptusesspaces/example.qaa.scriptusesspaces.model.ts b/developer/src/kmc-model/test/fixtures/example.qaa.scriptusesspaces/example.qaa.scriptusesspaces.model.ts similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.scriptusesspaces/example.qaa.scriptusesspaces.model.ts rename to developer/src/kmc-model/test/fixtures/example.qaa.scriptusesspaces/example.qaa.scriptusesspaces.model.ts diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.scriptusesspaces/wordlist.tsv b/developer/src/kmc-model/test/fixtures/example.qaa.scriptusesspaces/wordlist.tsv similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.scriptusesspaces/wordlist.tsv rename to developer/src/kmc-model/test/fixtures/example.qaa.scriptusesspaces/wordlist.tsv diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.intermediate.json b/developer/src/kmc-model/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.json similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.intermediate.json rename to developer/src/kmc-model/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.json diff --git a/developer/src/kmc-model/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kps b/developer/src/kmc-model/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kps new file mode 100644 index 0000000000000000000000000000000000000000..5354ba7980af9c9f2efc5cb328d60520f42d8ac2 --- /dev/null +++ b/developer/src/kmc-model/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kps @@ -0,0 +1,31 @@ + + + + 12.0.1500.0 + 12.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.0.3 + + + + ..\build\example.qaa.sencoten.model.js + Lexical model example.qaa.sencoten.model.js + 0 + .model.js + + + + + SENĆOŦEN dictionary + example.qaa.sencoten + + North Straits Salish + SENĆOŦEN + + + + diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.ts b/developer/src/kmc-model/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.ts similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.ts rename to developer/src/kmc-model/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.ts diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/wordlist.tsv b/developer/src/kmc-model/test/fixtures/example.qaa.sencoten/wordlist.tsv similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/wordlist.tsv rename to developer/src/kmc-model/test/fixtures/example.qaa.sencoten/wordlist.tsv diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.smp/example.qaa.smp.model.ts b/developer/src/kmc-model/test/fixtures/example.qaa.smp/example.qaa.smp.model.ts similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.smp/example.qaa.smp.model.ts rename to developer/src/kmc-model/test/fixtures/example.qaa.smp/example.qaa.smp.model.ts diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.smp/wordlist.tsv b/developer/src/kmc-model/test/fixtures/example.qaa.smp/wordlist.tsv similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.smp/wordlist.tsv rename to developer/src/kmc-model/test/fixtures/example.qaa.smp/wordlist.tsv diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.trivial/example.qaa.trivial.model.ts b/developer/src/kmc-model/test/fixtures/example.qaa.trivial/example.qaa.trivial.model.ts similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.trivial/example.qaa.trivial.model.ts rename to developer/src/kmc-model/test/fixtures/example.qaa.trivial/example.qaa.trivial.model.ts diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.trivial/wordlist.tsv b/developer/src/kmc-model/test/fixtures/example.qaa.trivial/wordlist.tsv similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.trivial/wordlist.tsv rename to developer/src/kmc-model/test/fixtures/example.qaa.trivial/wordlist.tsv diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.utf16be/example.qaa.utf16be.model.ts b/developer/src/kmc-model/test/fixtures/example.qaa.utf16be/example.qaa.utf16be.model.ts similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.utf16be/example.qaa.utf16be.model.ts rename to developer/src/kmc-model/test/fixtures/example.qaa.utf16be/example.qaa.utf16be.model.ts diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.utf16be/wordlist.txt b/developer/src/kmc-model/test/fixtures/example.qaa.utf16be/wordlist.txt similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.utf16be/wordlist.txt rename to developer/src/kmc-model/test/fixtures/example.qaa.utf16be/wordlist.txt diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.utf16le/example.qaa.utf16le.model.ts b/developer/src/kmc-model/test/fixtures/example.qaa.utf16le/example.qaa.utf16le.model.ts similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.utf16le/example.qaa.utf16le.model.ts rename to developer/src/kmc-model/test/fixtures/example.qaa.utf16le/example.qaa.utf16le.model.ts diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.utf16le/wordlist.txt b/developer/src/kmc-model/test/fixtures/example.qaa.utf16le/wordlist.txt similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.utf16le/wordlist.txt rename to developer/src/kmc-model/test/fixtures/example.qaa.utf16le/wordlist.txt diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.wordbreaker/example.qaa.wordbreaker.model.ts b/developer/src/kmc-model/test/fixtures/example.qaa.wordbreaker/example.qaa.wordbreaker.model.ts similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.wordbreaker/example.qaa.wordbreaker.model.ts rename to developer/src/kmc-model/test/fixtures/example.qaa.wordbreaker/example.qaa.wordbreaker.model.ts diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.wordbreaker/wordlist.tsv b/developer/src/kmc-model/test/fixtures/example.qaa.wordbreaker/wordlist.tsv similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.wordbreaker/wordlist.tsv rename to developer/src/kmc-model/test/fixtures/example.qaa.wordbreaker/wordlist.tsv diff --git a/developer/src/kmlmc/tests/helpers/index.ts b/developer/src/kmc-model/test/helpers/index.ts similarity index 70% rename from developer/src/kmlmc/tests/helpers/index.ts rename to developer/src/kmc-model/test/helpers/index.ts index f09f438e2f290ca1d4cd3805116198119a1015c0..e7d274f571290cceb3b9048df53d0ca82c718ac8 100644 --- a/developer/src/kmlmc/tests/helpers/index.ts +++ b/developer/src/kmc-model/test/helpers/index.ts @@ -4,8 +4,8 @@ * Helpers and utilities for the Mocha tests. */ import * as path from 'path'; +import { fileURLToPath } from 'url'; import {assert} from 'chai'; -import {LogMessage, KeymanCompilerError, redirectLogMessagesTo, resetLogMessageHandler, LogLevel} from '../../dist/errors'; export interface CompilationResult { hasSyntaxError: boolean; @@ -22,8 +22,8 @@ export interface CompilationResult { * * @param components One or more path components. */ -export function makePathToFixture(...components: string[]): string { - return path.join(__dirname, '..', '..', 'tests', 'fixtures', ...components); + export function makePathToFixture(...components: string[]): string { + return fileURLToPath(new URL(path.join('..', '..', '..', 'test', 'fixtures', ...components), import.meta.url)); } /** @@ -120,64 +120,6 @@ export function compileModelSourceCode(code: string) { }; } -/** - * Enables one to query log messages after they have been logged. - */ -export class LogHoarder { - private messages: LogMessage[] = []; - - /** - * Get rid of all log messages seen. - */ - clear() { - this.messages = []; - } - - /** - * Hoards a log message for later perusal. - */ - handleLog(log: LogMessage) { - this.messages.push(log); - } - - /** - * Has an error message with this code been witnessed? - */ - hasSeenCode(code: KeymanCompilerError): boolean { - return Boolean(this.messages.find(log => log.code === code)); - } - - /** - * Have any warnings been logged? - */ - hasSeenWarnings(): boolean { - return this.messages - .filter(log => log.level === LogLevel.CERR_WARNING) - .length > 0; - } - - /** - * Overrides the global log handler, allowing one to browse log messages - * later. - * - * Remember to uninstall the log handler afterwards! - */ - install(): this { - redirectLogMessagesTo(this.handleLog.bind(this)); - return this; - } - - /** - * Return the log message handler to its default. - * - * Note: You MUST uninstall the hoarder after use! - * It's recommended you put this in an afterEach() callback. - */ - uninstall() { - resetLogMessageHandler() - } -} - type ModuleType = (a: LMLayerWorker, b: ModelsNamespace, c: WordBreakersNamespace) => any; interface LMLayerWorker { loadModel(model: object): void; diff --git a/developer/src/kmlmc/tests/test-compile-model-with-pseudoclosure.ts b/developer/src/kmc-model/test/test-compile-model-with-pseudoclosure.ts similarity index 98% rename from developer/src/kmlmc/tests/test-compile-model-with-pseudoclosure.ts rename to developer/src/kmc-model/test/test-compile-model-with-pseudoclosure.ts index 391cbbae37eb6fab39b05c3ef2eed5d061b911a0..95b8ee37228b5590b37287b37212d0ad5763a6a1 100644 --- a/developer/src/kmlmc/tests/test-compile-model-with-pseudoclosure.ts +++ b/developer/src/kmc-model/test/test-compile-model-with-pseudoclosure.ts @@ -1,9 +1,8 @@ -import LexicalModelCompiler from '../dist/lexical-model-compiler/lexical-model-compiler'; +import LexicalModelCompiler from '../src/lexical-model-compiler.js'; import {assert} from 'chai'; import 'mocha'; -import { compileModelSourceCode } from './helpers'; -import { makePathToFixture } from './helpers'; +import { makePathToFixture, compileModelSourceCode } from './helpers/index.js'; describe('LexicalModelCompiler - pseudoclosure compilation + use', function () { const MODEL_ID = 'example.qaa.trivial'; diff --git a/developer/src/kmlmc/tests/test-compile-model.ts b/developer/src/kmc-model/test/test-compile-model.ts similarity index 79% rename from developer/src/kmlmc/tests/test-compile-model.ts rename to developer/src/kmc-model/test/test-compile-model.ts index 9003ac133039773eb9361056bbd71683bea2f269..c24a857e71a422e3a2a1070ca745bca29e932b3a 100644 --- a/developer/src/kmlmc/tests/test-compile-model.ts +++ b/developer/src/kmc-model/test/test-compile-model.ts @@ -1,10 +1,13 @@ import 'mocha'; import {assert} from 'chai'; -import {compileModel} from '../dist/util/util'; -import {makePathToFixture, compileModelSourceCode, CompilationResult} from './helpers'; +import {compileModel} from '../src/main.js'; +import {makePathToFixture, compileModelSourceCode, CompilationResult} from './helpers/index.js'; +import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers'; describe('compileModel', function () { + let callbacks = new TestCompilerCallbacks(); + // Try to compile ALL of the correct models. const MODELS = [ 'example.qaa.sencoten', @@ -19,7 +22,7 @@ describe('compileModel', function () { let modelPath = makePathToFixture(modelID, `${modelID}.model.ts`); it(`should compile ${modelID}`, function () { - let code = compileModel(modelPath); + let code = compileModel(modelPath, callbacks); let r: unknown; assert.doesNotThrow(() => { r = compileModelSourceCode(code); diff --git a/developer/src/kmlmc/tests/test-compile-trie.ts b/developer/src/kmc-model/test/test-compile-trie.ts similarity index 95% rename from developer/src/kmlmc/tests/test-compile-trie.ts rename to developer/src/kmc-model/test/test-compile-trie.ts index b487d055b335542abb82b0eae8af1a176a17891b..9a2c744a1987b6b1ff1a51a29a9005e2de6969e7 100644 --- a/developer/src/kmlmc/tests/test-compile-trie.ts +++ b/developer/src/kmc-model/test/test-compile-trie.ts @@ -1,9 +1,10 @@ -import LexicalModelCompiler from '../dist/lexical-model-compiler/lexical-model-compiler'; +import LexicalModelCompiler from '../src/lexical-model-compiler.js'; import {assert} from 'chai'; import 'mocha'; -import {makePathToFixture, compileModelSourceCode} from './helpers'; -import { createTrieDataStructure } from '../dist/lexical-model-compiler/build-trie'; +import {makePathToFixture, compileModelSourceCode} from './helpers/index.js'; +import { createTrieDataStructure } from '../src/build-trie.js'; +import { ModelCompilerError } from '../src/model-compiler-errors.js'; describe('LexicalModelCompiler', function () { describe('#generateLexicalModelCode', function () { @@ -100,7 +101,7 @@ describe('LexicalModelCompiler', function () { } else if(code.charCodeAt(i) >= 0xDC00 && code.charCodeAt(i) < 0xE000) { assert.isTrue((code.charCodeAt(i-1) >= 0xD800 && code.charCodeAt(i-1) < 0xDC00), 'Unpaired trail surrogate U+'+code.charCodeAt(i).toString(16)+' at position '+i+' of \''+code+'\''); - } + } } // Sanity check: the word list has three total unweighted words, with a @@ -131,7 +132,7 @@ describe('createTrieDataStructure()', function () { it('must be given an explicit searchTermToKey function', function () { assert.throws(function () { createTrieDataStructure([WORDLIST_FILENAME]); - }, TypeError) + }, ModelCompilerError) }); it('uses the provided searchTermToKey function', function () { diff --git a/developer/src/kmlmc/tests/test-default-apply-case.ts b/developer/src/kmc-model/test/test-default-apply-case.ts similarity index 97% rename from developer/src/kmlmc/tests/test-default-apply-case.ts rename to developer/src/kmc-model/test/test-default-apply-case.ts index a408c730144bd3db59f230ccdd33fe9c193b0af7..09d1f49d7ae9c02845470e866718472d4b453240 100644 --- a/developer/src/kmlmc/tests/test-default-apply-case.ts +++ b/developer/src/kmc-model/test/test-default-apply-case.ts @@ -1,7 +1,7 @@ import 'mocha'; import { assert } from 'chai'; -import { defaultApplyCasing } from '../dist/lexical-model-compiler/model-defaults'; +import { defaultApplyCasing } from '../src/model-defaults.js'; describe('The default applyCasing() function', function () { // // -------- @@ -11,7 +11,7 @@ describe('The default applyCasing() function', function () { // let u = function(code: number): string { // var H = Math.floor((code - 0x10000) / 0x400) + 0xD800; // var L = (code - 0x10000) % 0x400 + 0xDC00; - + // return String.fromCharCode(H, L); // } @@ -37,7 +37,7 @@ describe('The default applyCasing() function', function () { // Note: not written the Turkish way. Turns out 'İ'.toLowerCase() decomposes the result, // which would have made for a fairly yucky test. ['Istanbul', 'istanbul'], - + // The DEFAULT function is NOT responsible for understanding the Turkish // case regarding the lowercasing of: // 'I' U+0048 LATIN CAPITAL LETTER I to 'ı' U+0131 LATIN SMALL LETTER DOTLESS I @@ -47,16 +47,16 @@ describe('The default applyCasing() function', function () { // full-width romaji has corresponding capitalized versions: ['AESTHETIC', 'aesthetic'], - + // "skýlos" is Greek for dog 🇬🇷🐶 // starts with an 's' and ends with an 's' // which are DIFFERENT CHARACTERS in lowercased Greek! ['ΣΚΥΛΟΣ', 'σκυλος'], - + // Uncased syntax and numbers should pass through unscathed: ['1234.?!', '1234.?!'] ]; - + for (let [input, expected] of testCases) { it(`should lowercase '${input}' as '${expected}'`, function() { assert.equal(defaultApplyCasing('lower', input), expected); @@ -68,7 +68,7 @@ describe('The default applyCasing() function', function () { const testCases: [string, string][] = [ // Inverse of the corresponding 'lower' test. ['istanbul', 'ISTANBUL'], - + // The DEFAULT function is NOT responsible for understanding the Turkish // case regarding the uppercasing of: // 'ı' U+0131 LATIN SMALL LETTER DOTLESS I to 'I' U+0048 LATIN CAPITAL LETTER I @@ -78,16 +78,16 @@ describe('The default applyCasing() function', function () { // full-width romaji has corresponding capitalized versions: ['aesthetic', 'AESTHETIC'], - + // "skýlos" is Greek for dog 🇬🇷🐶 // starts with an 's' and ends with an 's' // which are DIFFERENT CHARACTERS in lowercased Greek! ['σκυλος', 'ΣΚΥΛΟΣ'], - + // Uncased syntax and numbers should pass through unscathed: ['1234.?!', '1234.?!'] ]; - + for (let [input, expected] of testCases) { it(`should uppercase '${input}' as '${expected}'`, function() { assert.equal(defaultApplyCasing('upper', input), expected); @@ -99,14 +99,14 @@ describe('The default applyCasing() function', function () { const testCases: [string, string][] = [ // Inverse of the corresponding 'lower' test. ['istanbul', 'Istanbul'], - + // The DEFAULT function is NOT responsible for understanding the Turkish // case regarding the uppercasing of: // 'ı' U+0131 LATIN SMALL LETTER DOTLESS I to 'I' U+0048 LATIN CAPITAL LETTER I // For Turkic languages, the recommendation is to make a // custom applyCasing function: ['diyarbakır', 'Diyarbakır'], // The 'i̇' is the decomposed result alluded to for the previous case. - + // full-width romaji has corresponding capitalized versions: ['aesthetic', 'Aesthetic'], @@ -114,11 +114,11 @@ describe('The default applyCasing() function', function () { // starts with an 's' and ends with an 's' // which are DIFFERENT CHARACTERS in lowercased Greek! ['σκυλος', 'Σκυλος'], - + // Uncased syntax and numbers should pass through unscathed: ['1234.?!', '1234.?!'] ]; - + for (let [input, expected] of testCases) { it(`should initial-case '${input}' as '${expected}'`, function() { assert.equal(defaultApplyCasing('initial', input), expected); diff --git a/developer/src/kmlmc/tests/test-default-search-term-to-key.ts b/developer/src/kmc-model/test/test-default-search-term-to-key.ts similarity index 95% rename from developer/src/kmlmc/tests/test-default-search-term-to-key.ts rename to developer/src/kmc-model/test/test-default-search-term-to-key.ts index 5b90b0e48c3de47b0702e7c1c850a24bc91e7264..b777c7c79c314b9cd4e7f52b892fa4c46306c813 100644 --- a/developer/src/kmlmc/tests/test-default-search-term-to-key.ts +++ b/developer/src/kmc-model/test/test-default-search-term-to-key.ts @@ -1,9 +1,9 @@ import 'mocha'; import {assert} from 'chai'; -import { defaultSearchTermToKey, +import { defaultSearchTermToKey, defaultCasedSearchTermToKey, - defaultApplyCasing } from '../dist/lexical-model-compiler/model-defaults'; + defaultApplyCasing } from '../src/model-defaults.js'; describe('The default searchTermToKey() function', function () { @@ -12,28 +12,28 @@ describe('The default searchTermToKey() function', function () { // "İstanbul" has a U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE. // Without any casing operations, only the I should be altered. ['İstanbul', 'Istanbul'], - + // Similarly... ['DİYARBAKIR', 'DIYARBAKIR'], - + // "skýlos" is Greek for dog 🇬🇷🐶 // starts with an 's' and ends with an 's' // which are DIFFERENT CHARACTERS in lowercased Greek! ['σκύλος', 'σκυλος'], ['ΣΚΥΛΟΣ', 'ΣΚΥΛΟΣ'], - + // full-width romaji is compatibility-canonical with ASCII characters: ['aesthetic', 'aesthetic'], - + // U+212B ANGSTROM SIGN (Å) // U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE (Å) // and should both normalize to 'A' ['\u212B', 'A'], ['\u00C5', 'A'], - + // We should not fall for U+037E GREEK QUESTION MARK's trolling: ['\u037e', ';'], - + // Test presentational forms of Arabic: // U+FE8D ARABIC LETTER ALEF ISOLATED FORM -> U+0627 ARABIC LETTER ALEF // U+FEDF ARABIC LETTER LAM INITIAL FORM -> U+0644 ARABIC LETTER LAM @@ -42,12 +42,12 @@ describe('The default searchTermToKey() function', function () { // U+FEEE ARABIC LETTER WAW FINAL FORM -> U+0648 ARABIC LETTER WAW // U+FE93 ARABIC LETTER TEH MARBUTA ISOLATED FORM -> U+0629 ARABIC LETTER TEH MARBUTA ['\uFE8D\uFEDF\uFED8\uFEEC\uFEEE\uFE93', '\u0627\u0644\u0642\u0647\u0648\u0629'], - + // Combine both NFKD **AND** knocking off diacritics: // U+01C4 LATIN CAPITAL LETTER DZ WITH CARON (DŽ) -> (dz) ['DŽ', 'DZ'], ]; - + for (let [input, expected] of testCases) { it(`should normalize '${input}' to '${expected}'`, function() { assert.equal(defaultSearchTermToKey(input), expected); @@ -64,25 +64,25 @@ describe('The default searchTermToKey() function', function () { // custom searchTermToKey function. ['İstanbul', 'ISTANBUL'], ['DİYARBAKIR', 'DIYARBAKIR'], - + // "skýlos" is Greek for dog 🇬🇷🐶 // starts with an 's' and ends with an 's' // which are DIFFERENT CHARACTERS in lowercased Greek! ['σκύλος', 'ΣΚΥΛΟΣ'], ['σκυλοσ', 'ΣΚΥΛΟΣ'], - + // full-width romaji is compatibility-canonical with ASCII characters: ['aesthetic', 'AESTHETIC'], - + // U+212B ANGSTROM SIGN (Å) // U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE (Å) // and should both normalize to 'a' ['\u212B', 'A'], ['\u00C5', 'A'], - + // We should not fall for U+037E GREEK QUESTION MARK's trolling: ['\u037e', ';'], - + // Test presentational forms of Arabic: // U+FE8D ARABIC LETTER ALEF ISOLATED FORM -> U+0627 ARABIC LETTER ALEF // U+FEDF ARABIC LETTER LAM INITIAL FORM -> U+0644 ARABIC LETTER LAM @@ -91,7 +91,7 @@ describe('The default searchTermToKey() function', function () { // U+FEEE ARABIC LETTER WAW FINAL FORM -> U+0648 ARABIC LETTER WAW // U+FE93 ARABIC LETTER TEH MARBUTA ISOLATED FORM -> U+0629 ARABIC LETTER TEH MARBUTA ['\uFE8D\uFEDF\uFED8\uFEEC\uFEEE\uFE93', '\u0627\u0644\u0642\u0647\u0648\u0629'], - + // Combine both NFKD **AND** knocking off diacritics: // U+01C4 LATIN CAPITAL LETTER DZ WITH CARON (DŽ) -> (dz) ['DŽ', 'DZ'], @@ -101,8 +101,8 @@ describe('The default searchTermToKey() function', function () { // as U+0130's default handling is... not ideal in Turkish. // // Instead, we can get a simple-enough test with inverted casing. - let customCasing = function(caseToApply: CasingForm, - text: string, + let customCasing = function(caseToApply: CasingForm, + text: string, defaultApplyCasing: CasingFunction): string { switch(caseToApply) { case 'lower': @@ -110,7 +110,7 @@ describe('The default searchTermToKey() function', function () { case 'upper': return text.toLowerCase(); case 'initial': - return customCasing('upper', text.charAt(0), defaultApplyCasing) + text.substr(1); + return customCasing('upper', text.charAt(0), defaultApplyCasing) + text.substr(1); default: return text; } @@ -119,7 +119,7 @@ describe('The default searchTermToKey() function', function () { let customCasingClosure = function(caseToApply: CasingForm, text: string): string { return customCasing(caseToApply, text, defaultApplyCasing); } - + for (let [input, expected] of testCases) { it(`should normalize '${input}' to '${expected}'`, function() { assert.equal(defaultCasedSearchTermToKey(input, customCasingClosure as CasingFunction), expected); @@ -132,32 +132,32 @@ describe('The default searchTermToKey() function', function () { // "İstanbul" has a U+0130 LATIN CAPITAL LETTER I WITH DOT ABOVE. // This should be lowercased. ['İstanbul', 'istanbul'], - + // The DEFAULT function is NOT responsible for understanding the Turkish // case regarding the lowercasing of: // 'I' U+0048 LATIN CAPITAL LETTER I to 'ı' U+0131 LATIN SMALL LETTER DOTLESS I // For Turkic languages, the recommendation is to make a // custom searchTermToKey function: ['DİYARBAKIR', 'diyarbakir'], - + // "skýlos" is Greek for dog 🇬🇷🐶 // starts with an 's' and ends with an 's' // which are DIFFERENT CHARACTERS in lowercased Greek! ['σκύλος', 'σκυλος'], ['ΣΚΥΛΟΣ', 'σκυλοσ'], - + // full-width romaji is compatibility-canonical with ASCII characters: ['aesthetic', 'aesthetic'], - + // U+212B ANGSTROM SIGN (Å) // U+00C5 LATIN CAPITAL LETTER A WITH RING ABOVE (Å) // and should both normalize to 'a' ['\u212B', 'a'], ['\u00C5', 'a'], - + // We should not fall for U+037E GREEK QUESTION MARK's trolling: ['\u037e', ';'], - + // Test presentational forms of Arabic: // U+FE8D ARABIC LETTER ALEF ISOLATED FORM -> U+0627 ARABIC LETTER ALEF // U+FEDF ARABIC LETTER LAM INITIAL FORM -> U+0644 ARABIC LETTER LAM @@ -166,12 +166,12 @@ describe('The default searchTermToKey() function', function () { // U+FEEE ARABIC LETTER WAW FINAL FORM -> U+0648 ARABIC LETTER WAW // U+FE93 ARABIC LETTER TEH MARBUTA ISOLATED FORM -> U+0629 ARABIC LETTER TEH MARBUTA ['\uFE8D\uFEDF\uFED8\uFEEC\uFEEE\uFE93', '\u0627\u0644\u0642\u0647\u0648\u0629'], - + // Combine both NFKD **AND** knocking off diacritics: // U+01C4 LATIN CAPITAL LETTER DZ WITH CARON (DŽ) -> (dz) ['DŽ', 'dz'], ]; - + for (let [input, expected] of testCases) { it(`should normalize '${input}' to '${expected}'`, function() { assert.equal(defaultCasedSearchTermToKey(input, defaultApplyCasing), expected); diff --git a/developer/src/kmlmc/tests/test-join-word-breaker.ts b/developer/src/kmc-model/test/test-join-word-breaker.ts similarity index 92% rename from developer/src/kmlmc/tests/test-join-word-breaker.ts rename to developer/src/kmc-model/test/test-join-word-breaker.ts index 9a2ad54e63426b85bec519549d4fe56bd6dcdd2b..d06bc7a6efd3cd6c536904754dfa43b9f0586cf7 100644 --- a/developer/src/kmlmc/tests/test-join-word-breaker.ts +++ b/developer/src/kmc-model/test/test-join-word-breaker.ts @@ -1,8 +1,6 @@ -var assert = require('chai').assert; - -const defaultWordBreaker = require('../../../../common/models/wordbreakers/build').wordBreakers['default']; -import {decorateWithJoin} from '../dist/lexical-model-compiler/join-word-breaker-decorator'; - +import { assert } from "chai"; +import defaultWordBreaker from './wordbreakers/default-wordbreaker-esm.js'; +import {decorateWithJoin} from '../src/join-word-breaker-decorator.js'; describe('The join word breaker decorator', function () { it('should decorate an existing word breaker', function () { diff --git a/developer/src/kmc-model/test/test-messages.ts b/developer/src/kmc-model/test/test-messages.ts new file mode 100644 index 0000000000000000000000000000000000000000..51394313040cd07c0bfff2777d5ee8a9671ba5f6 --- /dev/null +++ b/developer/src/kmc-model/test/test-messages.ts @@ -0,0 +1,9 @@ +import 'mocha'; +import { ModelCompilerMessages } from '../src/model-compiler-errors.js'; +import { verifyCompilerMessagesObject } from '@keymanapp/developer-test-helpers'; + +describe('ModelCompilerMessages', function () { + it('should have a valid ModelCompilerMessages object', function() { + return verifyCompilerMessagesObject(ModelCompilerMessages); + }); +}); diff --git a/developer/src/kmlmc/tests/test-model-definitions.ts b/developer/src/kmc-model/test/test-model-definitions.ts similarity index 98% rename from developer/src/kmlmc/tests/test-model-definitions.ts rename to developer/src/kmc-model/test/test-model-definitions.ts index 507c30533330bc7b0f0b4cf50e6aa6dee56c0e93..297bb1a995b08adb243e382b3ad5bf9bf627351a 100644 --- a/developer/src/kmlmc/tests/test-model-definitions.ts +++ b/developer/src/kmc-model/test/test-model-definitions.ts @@ -1,6 +1,7 @@ import 'mocha'; import { assert } from 'chai'; -import { ModelDefinitions } from '../dist/lexical-model-compiler/model-definitions'; +import { ModelDefinitions } from '../src/model-definitions.js'; +import { LexicalModelSource } from '../src/lexical-model.js'; describe('Model definition pseudoclosures', function () { describe('14.0 defaults', function() { diff --git a/developer/src/kmlmc/tests/test-override-script-defaults.ts b/developer/src/kmc-model/test/test-override-script-defaults.ts similarity index 84% rename from developer/src/kmlmc/tests/test-override-script-defaults.ts rename to developer/src/kmc-model/test/test-override-script-defaults.ts index 5f25e69a2dd83e0014dc1f2ce1f82164875f04aa..909f52c29813f76d06bf4c7c85c3a7173018bdd1 100644 --- a/developer/src/kmlmc/tests/test-override-script-defaults.ts +++ b/developer/src/kmc-model/test/test-override-script-defaults.ts @@ -1,7 +1,6 @@ -var assert = require('chai').assert; - -const defaultWordBreaker = require('../../../../common/models/wordbreakers/build').wordBreakers['default']; -import {decorateWithScriptOverrides} from '../dist/lexical-model-compiler/script-overrides-decorator'; +import { assert } from "chai"; +import defaultWordBreaker from './wordbreakers/default-wordbreaker-esm.js'; +import {decorateWithScriptOverrides} from '../src/script-overrides-decorator.js'; const THIN_SPACE = "\u2009"; diff --git a/developer/src/kmlmc/tests/test-parse-wordlist.ts b/developer/src/kmc-model/test/test-parse-wordlist.ts similarity index 75% rename from developer/src/kmlmc/tests/test-parse-wordlist.ts rename to developer/src/kmc-model/test/test-parse-wordlist.ts index 3d0c7a565b1c839538335537064036dd7432b684..ab610f5e802c832ef9b8a606c6aef8c500ff09a0 100644 --- a/developer/src/kmlmc/tests/test-parse-wordlist.ts +++ b/developer/src/kmc-model/test/test-parse-wordlist.ts @@ -1,8 +1,10 @@ -import {parseWordListFromContents, parseWordListFromFilename, WordList} from '../dist/lexical-model-compiler/build-trie'; +import {parseWordListFromContents, parseWordListFromFilename, WordList} from '../src/build-trie.js'; import {assert} from 'chai'; import 'mocha'; -import { makePathToFixture, LogHoarder } from './helpers'; -import { KeymanCompilerError } from '../dist/errors'; +import { makePathToFixture } from './helpers/index.js'; +import { ModelCompilerMessages } from '../src/model-compiler-errors.js'; +import { setCompilerCallbacks } from '../src/compiler-callbacks.js'; +import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers'; const BOM = '\ufeff'; const SENCOTEN_WORDLIST = { @@ -18,15 +20,18 @@ const SENCOTEN_WORDLIST = { 'I': 1884 }; + describe('parsing a word list', function () { + let testCallbacks = new TestCompilerCallbacks(); + beforeEach(function () { - this.logHoarder = (new LogHoarder).install() - }) + testCallbacks.clear(); + setCompilerCallbacks(testCallbacks); + }); afterEach(function () { - this.logHoarder.uninstall(); - delete this.logHoarder; - }) + setCompilerCallbacks(null); + }); it('should remove the UTF-8 byte order mark from files', function () { let word = 'hello'; @@ -38,12 +43,12 @@ describe('parsing a word list', function () { let withoutBOM: WordList = {}; parseWordListFromContents(withoutBOM, file); assert.deepEqual(withoutBOM, expected, "expected regular file to parse properly"); - assert.isFalse(this.logHoarder.hasSeenWarnings()); + assert.isEmpty(testCallbacks.messages); let withBOM: WordList = {}; parseWordListFromContents(withBOM, `${BOM}${file}`) assert.deepEqual(withBOM, expected, "expected BOM to be ignored"); - assert.isFalse(this.logHoarder.hasSeenWarnings()); + assert.isEmpty(testCallbacks.messages); }); it('should read word lists in UTF-8', function () { @@ -53,7 +58,7 @@ describe('parsing a word list', function () { parseWordListFromFilename(wordlist, filename); assert.deepEqual(wordlist, SENCOTEN_WORDLIST); - assert.isFalse(this.logHoarder.hasSeenWarnings()); + assert.isEmpty(testCallbacks.messages); }); it('should read word lists in UTF-16 little-endian (with BOM)', function () { @@ -64,7 +69,7 @@ describe('parsing a word list', function () { parseWordListFromFilename(wordlist, filename); assert.deepEqual(wordlist, SENCOTEN_WORDLIST); - assert.isFalse(this.logHoarder.hasSeenWarnings()); + assert.isEmpty(testCallbacks.messages); }); it('should NOT read word lists in UTF-16 big-endian (with BOM)', function () { @@ -100,23 +105,23 @@ describe('parsing a word list', function () { parseWordListFromContents(repeatedWords, file); assert.deepEqual(repeatedWords, expected); - - assert.isTrue(this.logHoarder.hasSeenWarnings()); + + assert.lengthOf(testCallbacks.messages, 4); // hello has been seen multiple times: - assert.isTrue(this.logHoarder.hasSeenCode(KeymanCompilerError.CWARN_DuplicateWordInSameFile)); + assert.isTrue(testCallbacks.hasMessage(ModelCompilerMessages.WARN_DuplicateWordInSameFile)); // helló and hello + U+0301 have both been seen: - assert.isTrue(this.logHoarder.hasSeenCode(KeymanCompilerError.CWARN_MixedNormalizationForms)); + assert.isTrue(testCallbacks.hasMessage(ModelCompilerMessages.WARN_MixedNormalizationForms)); // Let's parse another file: - this.logHoarder.clear(); + testCallbacks.clear(); // Now, parse a DIFFERENT file, but with an NFD entry. parseWordListFromContents(repeatedWords, "hello\u0301\t5\n"); - assert.isTrue(this.logHoarder.hasSeenWarnings()) + assert.lengthOf(testCallbacks.messages, 1); // hello + U+0301 (NFD) has been seen, but... - assert.isTrue(this.logHoarder.hasSeenCode(KeymanCompilerError.CWARN_MixedNormalizationForms)); + assert.isTrue(testCallbacks.hasMessage(ModelCompilerMessages.WARN_MixedNormalizationForms)); // BUT! We have not seen a duplicate **within the same file** - assert.isFalse(this.logHoarder.hasSeenCode(KeymanCompilerError.CWARN_DuplicateWordInSameFile)); + assert.isFalse(testCallbacks.hasMessage(ModelCompilerMessages.WARN_DuplicateWordInSameFile)); assert.deepEqual(repeatedWords, { hello: expected['hello'], diff --git a/developer/src/kmlmc/tests/test-punctuation.ts b/developer/src/kmc-model/test/test-punctuation.ts similarity index 85% rename from developer/src/kmlmc/tests/test-punctuation.ts rename to developer/src/kmc-model/test/test-punctuation.ts index 925a01bd8eedccfbc36f3ef431ffec58c4720964..34dbafca327e3acb8581b66b95fe0877eb59e8a9 100644 --- a/developer/src/kmlmc/tests/test-punctuation.ts +++ b/developer/src/kmc-model/test/test-punctuation.ts @@ -1,10 +1,8 @@ -import LexicalModelCompiler from '../dist/lexical-model-compiler/lexical-model-compiler'; +import LexicalModelCompiler from '../src/lexical-model-compiler.js'; import {assert} from 'chai'; import 'mocha'; -import { compileModelSourceCode } from './helpers'; -import { makePathToFixture } from './helpers'; - +import { makePathToFixture, compileModelSourceCode } from './helpers/index.js'; describe('LexicalModelCompiler', function () { describe('specifying punctuation', function () { diff --git a/developer/src/kmc-model/test/tsconfig.json b/developer/src/kmc-model/test/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..3902bed57f0fe4fa4219b67f663284aef74b76ea --- /dev/null +++ b/developer/src/kmc-model/test/tsconfig.json @@ -0,0 +1,26 @@ +{ + "extends": "../../kmc/tsconfig.kmc-base.json", + + "compilerOptions": { + "rootDir": ".", + "rootDirs": ["./", "../src/"], + "outDir": "../build/test", + "esModuleInterop": true, + "moduleResolution": "node16", + "allowSyntheticDefaultImports": true, + "baseUrl": ".", + "paths": { + "@keymanapp/developer-test-helpers": ["../../common/web/test-helpers/index"], + }, + }, + "include": [ + "**/test-*.ts", + "*.ts", + "helpers/*.ts", + "wordbreakers/*.ts" + ], + "references": [ + { "path": "../" }, + { "path": "../../common/web/test-helpers/" }, + ] +} \ No newline at end of file diff --git a/developer/src/kmc-model/test/wordbreakers/README.md b/developer/src/kmc-model/test/wordbreakers/README.md new file mode 100644 index 0000000000000000000000000000000000000000..d204b51c6a3e69ab542b80c3969d9eea86bea6af --- /dev/null +++ b/developer/src/kmc-model/test/wordbreakers/README.md @@ -0,0 +1,3 @@ +Wordbreakers ES Module format + +TODO: once we move common/models/wordbreakers to ESM, eliminate this. diff --git a/developer/src/kmc-model/test/wordbreakers/data.ts b/developer/src/kmc-model/test/wordbreakers/data.ts new file mode 100644 index 0000000000000000000000000000000000000000..5622bf5c03719353c501c7a9dd99b53b4ac4e026 --- /dev/null +++ b/developer/src/kmc-model/test/wordbreakers/data.ts @@ -0,0 +1,1776 @@ +// TEMP: esm version of /common/models/wordbreakers/default/data.ts +// Hand updated version of automatically generated file. +/** + * Valid values for a word break property. + */ +export enum WordBreakProperty { + Other, + LF, + Newline, + CR, + WSegSpace, + Double_Quote, + Single_Quote, + MidNum, + MidNumLet, + Numeric, + MidLetter, + ALetter, + ExtendNumLet, + Format, + Extend, + Hebrew_Letter, + ZWJ, + Katakana, + Regional_Indicator, + sot, + eot +}; + +/** + * Constants for indexing values in WORD_BREAK_PROPERTY. + */ +export enum I { + Start = 0, + Value = 1 +} + +export const WORD_BREAK_PROPERTY: [number, WordBreakProperty][] = [ + [/*start*/ 0x0, WordBreakProperty.Other], + [/*start*/ 0xA, WordBreakProperty.LF], + [/*start*/ 0xB, WordBreakProperty.Newline], + [/*start*/ 0xD, WordBreakProperty.CR], + [/*start*/ 0xE, WordBreakProperty.Other], + [/*start*/ 0x20, WordBreakProperty.WSegSpace], + [/*start*/ 0x21, WordBreakProperty.Other], + [/*start*/ 0x22, WordBreakProperty.Double_Quote], + [/*start*/ 0x23, WordBreakProperty.Other], + [/*start*/ 0x27, WordBreakProperty.Single_Quote], + [/*start*/ 0x28, WordBreakProperty.Other], + [/*start*/ 0x2C, WordBreakProperty.MidNum], + [/*start*/ 0x2D, WordBreakProperty.Other], + [/*start*/ 0x2E, WordBreakProperty.MidNumLet], + [/*start*/ 0x2F, WordBreakProperty.Other], + [/*start*/ 0x30, WordBreakProperty.Numeric], + [/*start*/ 0x3A, WordBreakProperty.MidLetter], + [/*start*/ 0x3B, WordBreakProperty.MidNum], + [/*start*/ 0x3C, WordBreakProperty.Other], + [/*start*/ 0x41, WordBreakProperty.ALetter], + [/*start*/ 0x5B, WordBreakProperty.Other], + [/*start*/ 0x5F, WordBreakProperty.ExtendNumLet], + [/*start*/ 0x60, WordBreakProperty.Other], + [/*start*/ 0x61, WordBreakProperty.ALetter], + [/*start*/ 0x7B, WordBreakProperty.Other], + [/*start*/ 0x85, WordBreakProperty.Newline], + [/*start*/ 0x86, WordBreakProperty.Other], + [/*start*/ 0xAA, WordBreakProperty.ALetter], + [/*start*/ 0xAB, WordBreakProperty.Other], + [/*start*/ 0xAD, WordBreakProperty.Format], + [/*start*/ 0xAE, WordBreakProperty.Other], + [/*start*/ 0xB5, WordBreakProperty.ALetter], + [/*start*/ 0xB6, WordBreakProperty.Other], + [/*start*/ 0xB7, WordBreakProperty.MidLetter], + [/*start*/ 0xB8, WordBreakProperty.Other], + [/*start*/ 0xBA, WordBreakProperty.ALetter], + [/*start*/ 0xBB, WordBreakProperty.Other], + [/*start*/ 0xC0, WordBreakProperty.ALetter], + [/*start*/ 0xD7, WordBreakProperty.Other], + [/*start*/ 0xD8, WordBreakProperty.ALetter], + [/*start*/ 0xF7, WordBreakProperty.Other], + [/*start*/ 0xF8, WordBreakProperty.ALetter], + [/*start*/ 0x2D8, WordBreakProperty.Other], + [/*start*/ 0x2DE, WordBreakProperty.ALetter], + [/*start*/ 0x300, WordBreakProperty.Extend], + [/*start*/ 0x370, WordBreakProperty.ALetter], + [/*start*/ 0x375, WordBreakProperty.Other], + [/*start*/ 0x376, WordBreakProperty.ALetter], + [/*start*/ 0x378, WordBreakProperty.Other], + [/*start*/ 0x37A, WordBreakProperty.ALetter], + [/*start*/ 0x37E, WordBreakProperty.MidNum], + [/*start*/ 0x37F, WordBreakProperty.ALetter], + [/*start*/ 0x380, WordBreakProperty.Other], + [/*start*/ 0x386, WordBreakProperty.ALetter], + [/*start*/ 0x387, WordBreakProperty.MidLetter], + [/*start*/ 0x388, WordBreakProperty.ALetter], + [/*start*/ 0x38B, WordBreakProperty.Other], + [/*start*/ 0x38C, WordBreakProperty.ALetter], + [/*start*/ 0x38D, WordBreakProperty.Other], + [/*start*/ 0x38E, WordBreakProperty.ALetter], + [/*start*/ 0x3A2, WordBreakProperty.Other], + [/*start*/ 0x3A3, WordBreakProperty.ALetter], + [/*start*/ 0x3F6, WordBreakProperty.Other], + [/*start*/ 0x3F7, WordBreakProperty.ALetter], + [/*start*/ 0x482, WordBreakProperty.Other], + [/*start*/ 0x483, WordBreakProperty.Extend], + [/*start*/ 0x48A, WordBreakProperty.ALetter], + [/*start*/ 0x530, WordBreakProperty.Other], + [/*start*/ 0x531, WordBreakProperty.ALetter], + [/*start*/ 0x557, WordBreakProperty.Other], + [/*start*/ 0x559, WordBreakProperty.ALetter], + [/*start*/ 0x55D, WordBreakProperty.Other], + [/*start*/ 0x55E, WordBreakProperty.ALetter], + [/*start*/ 0x55F, WordBreakProperty.MidLetter], + [/*start*/ 0x560, WordBreakProperty.ALetter], + [/*start*/ 0x589, WordBreakProperty.MidNum], + [/*start*/ 0x58A, WordBreakProperty.ALetter], + [/*start*/ 0x58B, WordBreakProperty.Other], + [/*start*/ 0x591, WordBreakProperty.Extend], + [/*start*/ 0x5BE, WordBreakProperty.Other], + [/*start*/ 0x5BF, WordBreakProperty.Extend], + [/*start*/ 0x5C0, WordBreakProperty.Other], + [/*start*/ 0x5C1, WordBreakProperty.Extend], + [/*start*/ 0x5C3, WordBreakProperty.Other], + [/*start*/ 0x5C4, WordBreakProperty.Extend], + [/*start*/ 0x5C6, WordBreakProperty.Other], + [/*start*/ 0x5C7, WordBreakProperty.Extend], + [/*start*/ 0x5C8, WordBreakProperty.Other], + [/*start*/ 0x5D0, WordBreakProperty.Hebrew_Letter], + [/*start*/ 0x5EB, WordBreakProperty.Other], + [/*start*/ 0x5EF, WordBreakProperty.Hebrew_Letter], + [/*start*/ 0x5F3, WordBreakProperty.ALetter], + [/*start*/ 0x5F4, WordBreakProperty.MidLetter], + [/*start*/ 0x5F5, WordBreakProperty.Other], + [/*start*/ 0x600, WordBreakProperty.Format], + [/*start*/ 0x606, WordBreakProperty.Other], + [/*start*/ 0x60C, WordBreakProperty.MidNum], + [/*start*/ 0x60E, WordBreakProperty.Other], + [/*start*/ 0x610, WordBreakProperty.Extend], + [/*start*/ 0x61B, WordBreakProperty.Other], + [/*start*/ 0x61C, WordBreakProperty.Format], + [/*start*/ 0x61D, WordBreakProperty.Other], + [/*start*/ 0x620, WordBreakProperty.ALetter], + [/*start*/ 0x64B, WordBreakProperty.Extend], + [/*start*/ 0x660, WordBreakProperty.Numeric], + [/*start*/ 0x66A, WordBreakProperty.Other], + [/*start*/ 0x66B, WordBreakProperty.Numeric], + [/*start*/ 0x66C, WordBreakProperty.MidNum], + [/*start*/ 0x66D, WordBreakProperty.Other], + [/*start*/ 0x66E, WordBreakProperty.ALetter], + [/*start*/ 0x670, WordBreakProperty.Extend], + [/*start*/ 0x671, WordBreakProperty.ALetter], + [/*start*/ 0x6D4, WordBreakProperty.Other], + [/*start*/ 0x6D5, WordBreakProperty.ALetter], + [/*start*/ 0x6D6, WordBreakProperty.Extend], + [/*start*/ 0x6DD, WordBreakProperty.Format], + [/*start*/ 0x6DE, WordBreakProperty.Other], + [/*start*/ 0x6DF, WordBreakProperty.Extend], + [/*start*/ 0x6E5, WordBreakProperty.ALetter], + [/*start*/ 0x6E7, WordBreakProperty.Extend], + [/*start*/ 0x6E9, WordBreakProperty.Other], + [/*start*/ 0x6EA, WordBreakProperty.Extend], + [/*start*/ 0x6EE, WordBreakProperty.ALetter], + [/*start*/ 0x6F0, WordBreakProperty.Numeric], + [/*start*/ 0x6FA, WordBreakProperty.ALetter], + [/*start*/ 0x6FD, WordBreakProperty.Other], + [/*start*/ 0x6FF, WordBreakProperty.ALetter], + [/*start*/ 0x700, WordBreakProperty.Other], + [/*start*/ 0x70F, WordBreakProperty.Format], + [/*start*/ 0x710, WordBreakProperty.ALetter], + [/*start*/ 0x711, WordBreakProperty.Extend], + [/*start*/ 0x712, WordBreakProperty.ALetter], + [/*start*/ 0x730, WordBreakProperty.Extend], + [/*start*/ 0x74B, WordBreakProperty.Other], + [/*start*/ 0x74D, WordBreakProperty.ALetter], + [/*start*/ 0x7A6, WordBreakProperty.Extend], + [/*start*/ 0x7B1, WordBreakProperty.ALetter], + [/*start*/ 0x7B2, WordBreakProperty.Other], + [/*start*/ 0x7C0, WordBreakProperty.Numeric], + [/*start*/ 0x7CA, WordBreakProperty.ALetter], + [/*start*/ 0x7EB, WordBreakProperty.Extend], + [/*start*/ 0x7F4, WordBreakProperty.ALetter], + [/*start*/ 0x7F6, WordBreakProperty.Other], + [/*start*/ 0x7F8, WordBreakProperty.MidNum], + [/*start*/ 0x7F9, WordBreakProperty.Other], + [/*start*/ 0x7FA, WordBreakProperty.ALetter], + [/*start*/ 0x7FB, WordBreakProperty.Other], + [/*start*/ 0x7FD, WordBreakProperty.Extend], + [/*start*/ 0x7FE, WordBreakProperty.Other], + [/*start*/ 0x800, WordBreakProperty.ALetter], + [/*start*/ 0x816, WordBreakProperty.Extend], + [/*start*/ 0x81A, WordBreakProperty.ALetter], + [/*start*/ 0x81B, WordBreakProperty.Extend], + [/*start*/ 0x824, WordBreakProperty.ALetter], + [/*start*/ 0x825, WordBreakProperty.Extend], + [/*start*/ 0x828, WordBreakProperty.ALetter], + [/*start*/ 0x829, WordBreakProperty.Extend], + [/*start*/ 0x82E, WordBreakProperty.Other], + [/*start*/ 0x840, WordBreakProperty.ALetter], + [/*start*/ 0x859, WordBreakProperty.Extend], + [/*start*/ 0x85C, WordBreakProperty.Other], + [/*start*/ 0x860, WordBreakProperty.ALetter], + [/*start*/ 0x86B, WordBreakProperty.Other], + [/*start*/ 0x8A0, WordBreakProperty.ALetter], + [/*start*/ 0x8B5, WordBreakProperty.Other], + [/*start*/ 0x8B6, WordBreakProperty.ALetter], + [/*start*/ 0x8C8, WordBreakProperty.Other], + [/*start*/ 0x8D3, WordBreakProperty.Extend], + [/*start*/ 0x8E2, WordBreakProperty.Format], + [/*start*/ 0x8E3, WordBreakProperty.Extend], + [/*start*/ 0x904, WordBreakProperty.ALetter], + [/*start*/ 0x93A, WordBreakProperty.Extend], + [/*start*/ 0x93D, WordBreakProperty.ALetter], + [/*start*/ 0x93E, WordBreakProperty.Extend], + [/*start*/ 0x950, WordBreakProperty.ALetter], + [/*start*/ 0x951, WordBreakProperty.Extend], + [/*start*/ 0x958, WordBreakProperty.ALetter], + [/*start*/ 0x962, WordBreakProperty.Extend], + [/*start*/ 0x964, WordBreakProperty.Other], + [/*start*/ 0x966, WordBreakProperty.Numeric], + [/*start*/ 0x970, WordBreakProperty.Other], + [/*start*/ 0x971, WordBreakProperty.ALetter], + [/*start*/ 0x981, WordBreakProperty.Extend], + [/*start*/ 0x984, WordBreakProperty.Other], + [/*start*/ 0x985, WordBreakProperty.ALetter], + [/*start*/ 0x98D, WordBreakProperty.Other], + [/*start*/ 0x98F, WordBreakProperty.ALetter], + [/*start*/ 0x991, WordBreakProperty.Other], + [/*start*/ 0x993, WordBreakProperty.ALetter], + [/*start*/ 0x9A9, WordBreakProperty.Other], + [/*start*/ 0x9AA, WordBreakProperty.ALetter], + [/*start*/ 0x9B1, WordBreakProperty.Other], + [/*start*/ 0x9B2, WordBreakProperty.ALetter], + [/*start*/ 0x9B3, WordBreakProperty.Other], + [/*start*/ 0x9B6, WordBreakProperty.ALetter], + [/*start*/ 0x9BA, WordBreakProperty.Other], + [/*start*/ 0x9BC, WordBreakProperty.Extend], + [/*start*/ 0x9BD, WordBreakProperty.ALetter], + [/*start*/ 0x9BE, WordBreakProperty.Extend], + [/*start*/ 0x9C5, WordBreakProperty.Other], + [/*start*/ 0x9C7, WordBreakProperty.Extend], + [/*start*/ 0x9C9, WordBreakProperty.Other], + [/*start*/ 0x9CB, WordBreakProperty.Extend], + [/*start*/ 0x9CE, WordBreakProperty.ALetter], + [/*start*/ 0x9CF, WordBreakProperty.Other], + [/*start*/ 0x9D7, WordBreakProperty.Extend], + [/*start*/ 0x9D8, WordBreakProperty.Other], + [/*start*/ 0x9DC, WordBreakProperty.ALetter], + [/*start*/ 0x9DE, WordBreakProperty.Other], + [/*start*/ 0x9DF, WordBreakProperty.ALetter], + [/*start*/ 0x9E2, WordBreakProperty.Extend], + [/*start*/ 0x9E4, WordBreakProperty.Other], + [/*start*/ 0x9E6, WordBreakProperty.Numeric], + [/*start*/ 0x9F0, WordBreakProperty.ALetter], + [/*start*/ 0x9F2, WordBreakProperty.Other], + [/*start*/ 0x9FC, WordBreakProperty.ALetter], + [/*start*/ 0x9FD, WordBreakProperty.Other], + [/*start*/ 0x9FE, WordBreakProperty.Extend], + [/*start*/ 0x9FF, WordBreakProperty.Other], + [/*start*/ 0xA01, WordBreakProperty.Extend], + [/*start*/ 0xA04, WordBreakProperty.Other], + [/*start*/ 0xA05, WordBreakProperty.ALetter], + [/*start*/ 0xA0B, WordBreakProperty.Other], + [/*start*/ 0xA0F, WordBreakProperty.ALetter], + [/*start*/ 0xA11, WordBreakProperty.Other], + [/*start*/ 0xA13, WordBreakProperty.ALetter], + [/*start*/ 0xA29, WordBreakProperty.Other], + [/*start*/ 0xA2A, WordBreakProperty.ALetter], + [/*start*/ 0xA31, WordBreakProperty.Other], + [/*start*/ 0xA32, WordBreakProperty.ALetter], + [/*start*/ 0xA34, WordBreakProperty.Other], + [/*start*/ 0xA35, WordBreakProperty.ALetter], + [/*start*/ 0xA37, WordBreakProperty.Other], + [/*start*/ 0xA38, WordBreakProperty.ALetter], + [/*start*/ 0xA3A, WordBreakProperty.Other], + [/*start*/ 0xA3C, WordBreakProperty.Extend], + [/*start*/ 0xA3D, WordBreakProperty.Other], + [/*start*/ 0xA3E, WordBreakProperty.Extend], + [/*start*/ 0xA43, WordBreakProperty.Other], + [/*start*/ 0xA47, WordBreakProperty.Extend], + [/*start*/ 0xA49, WordBreakProperty.Other], + [/*start*/ 0xA4B, WordBreakProperty.Extend], + [/*start*/ 0xA4E, WordBreakProperty.Other], + [/*start*/ 0xA51, WordBreakProperty.Extend], + [/*start*/ 0xA52, WordBreakProperty.Other], + [/*start*/ 0xA59, WordBreakProperty.ALetter], + [/*start*/ 0xA5D, WordBreakProperty.Other], + [/*start*/ 0xA5E, WordBreakProperty.ALetter], + [/*start*/ 0xA5F, WordBreakProperty.Other], + [/*start*/ 0xA66, WordBreakProperty.Numeric], + [/*start*/ 0xA70, WordBreakProperty.Extend], + [/*start*/ 0xA72, WordBreakProperty.ALetter], + [/*start*/ 0xA75, WordBreakProperty.Extend], + [/*start*/ 0xA76, WordBreakProperty.Other], + [/*start*/ 0xA81, WordBreakProperty.Extend], + [/*start*/ 0xA84, WordBreakProperty.Other], + [/*start*/ 0xA85, WordBreakProperty.ALetter], + [/*start*/ 0xA8E, WordBreakProperty.Other], + [/*start*/ 0xA8F, WordBreakProperty.ALetter], + [/*start*/ 0xA92, WordBreakProperty.Other], + [/*start*/ 0xA93, WordBreakProperty.ALetter], + [/*start*/ 0xAA9, WordBreakProperty.Other], + [/*start*/ 0xAAA, WordBreakProperty.ALetter], + [/*start*/ 0xAB1, WordBreakProperty.Other], + [/*start*/ 0xAB2, WordBreakProperty.ALetter], + [/*start*/ 0xAB4, WordBreakProperty.Other], + [/*start*/ 0xAB5, WordBreakProperty.ALetter], + [/*start*/ 0xABA, WordBreakProperty.Other], + [/*start*/ 0xABC, WordBreakProperty.Extend], + [/*start*/ 0xABD, WordBreakProperty.ALetter], + [/*start*/ 0xABE, WordBreakProperty.Extend], + [/*start*/ 0xAC6, WordBreakProperty.Other], + [/*start*/ 0xAC7, WordBreakProperty.Extend], + [/*start*/ 0xACA, WordBreakProperty.Other], + [/*start*/ 0xACB, WordBreakProperty.Extend], + [/*start*/ 0xACE, WordBreakProperty.Other], + [/*start*/ 0xAD0, WordBreakProperty.ALetter], + [/*start*/ 0xAD1, WordBreakProperty.Other], + [/*start*/ 0xAE0, WordBreakProperty.ALetter], + [/*start*/ 0xAE2, WordBreakProperty.Extend], + [/*start*/ 0xAE4, WordBreakProperty.Other], + [/*start*/ 0xAE6, WordBreakProperty.Numeric], + [/*start*/ 0xAF0, WordBreakProperty.Other], + [/*start*/ 0xAF9, WordBreakProperty.ALetter], + [/*start*/ 0xAFA, WordBreakProperty.Extend], + [/*start*/ 0xB00, WordBreakProperty.Other], + [/*start*/ 0xB01, WordBreakProperty.Extend], + [/*start*/ 0xB04, WordBreakProperty.Other], + [/*start*/ 0xB05, WordBreakProperty.ALetter], + [/*start*/ 0xB0D, WordBreakProperty.Other], + [/*start*/ 0xB0F, WordBreakProperty.ALetter], + [/*start*/ 0xB11, WordBreakProperty.Other], + [/*start*/ 0xB13, WordBreakProperty.ALetter], + [/*start*/ 0xB29, WordBreakProperty.Other], + [/*start*/ 0xB2A, WordBreakProperty.ALetter], + [/*start*/ 0xB31, WordBreakProperty.Other], + [/*start*/ 0xB32, WordBreakProperty.ALetter], + [/*start*/ 0xB34, WordBreakProperty.Other], + [/*start*/ 0xB35, WordBreakProperty.ALetter], + [/*start*/ 0xB3A, WordBreakProperty.Other], + [/*start*/ 0xB3C, WordBreakProperty.Extend], + [/*start*/ 0xB3D, WordBreakProperty.ALetter], + [/*start*/ 0xB3E, WordBreakProperty.Extend], + [/*start*/ 0xB45, WordBreakProperty.Other], + [/*start*/ 0xB47, WordBreakProperty.Extend], + [/*start*/ 0xB49, WordBreakProperty.Other], + [/*start*/ 0xB4B, WordBreakProperty.Extend], + [/*start*/ 0xB4E, WordBreakProperty.Other], + [/*start*/ 0xB55, WordBreakProperty.Extend], + [/*start*/ 0xB58, WordBreakProperty.Other], + [/*start*/ 0xB5C, WordBreakProperty.ALetter], + [/*start*/ 0xB5E, WordBreakProperty.Other], + [/*start*/ 0xB5F, WordBreakProperty.ALetter], + [/*start*/ 0xB62, WordBreakProperty.Extend], + [/*start*/ 0xB64, WordBreakProperty.Other], + [/*start*/ 0xB66, WordBreakProperty.Numeric], + [/*start*/ 0xB70, WordBreakProperty.Other], + [/*start*/ 0xB71, WordBreakProperty.ALetter], + [/*start*/ 0xB72, WordBreakProperty.Other], + [/*start*/ 0xB82, WordBreakProperty.Extend], + [/*start*/ 0xB83, WordBreakProperty.ALetter], + [/*start*/ 0xB84, WordBreakProperty.Other], + [/*start*/ 0xB85, WordBreakProperty.ALetter], + [/*start*/ 0xB8B, WordBreakProperty.Other], + [/*start*/ 0xB8E, WordBreakProperty.ALetter], + [/*start*/ 0xB91, WordBreakProperty.Other], + [/*start*/ 0xB92, WordBreakProperty.ALetter], + [/*start*/ 0xB96, WordBreakProperty.Other], + [/*start*/ 0xB99, WordBreakProperty.ALetter], + [/*start*/ 0xB9B, WordBreakProperty.Other], + [/*start*/ 0xB9C, WordBreakProperty.ALetter], + [/*start*/ 0xB9D, WordBreakProperty.Other], + [/*start*/ 0xB9E, WordBreakProperty.ALetter], + [/*start*/ 0xBA0, WordBreakProperty.Other], + [/*start*/ 0xBA3, WordBreakProperty.ALetter], + [/*start*/ 0xBA5, WordBreakProperty.Other], + [/*start*/ 0xBA8, WordBreakProperty.ALetter], + [/*start*/ 0xBAB, WordBreakProperty.Other], + [/*start*/ 0xBAE, WordBreakProperty.ALetter], + [/*start*/ 0xBBA, WordBreakProperty.Other], + [/*start*/ 0xBBE, WordBreakProperty.Extend], + [/*start*/ 0xBC3, WordBreakProperty.Other], + [/*start*/ 0xBC6, WordBreakProperty.Extend], + [/*start*/ 0xBC9, WordBreakProperty.Other], + [/*start*/ 0xBCA, WordBreakProperty.Extend], + [/*start*/ 0xBCE, WordBreakProperty.Other], + [/*start*/ 0xBD0, WordBreakProperty.ALetter], + [/*start*/ 0xBD1, WordBreakProperty.Other], + [/*start*/ 0xBD7, WordBreakProperty.Extend], + [/*start*/ 0xBD8, WordBreakProperty.Other], + [/*start*/ 0xBE6, WordBreakProperty.Numeric], + [/*start*/ 0xBF0, WordBreakProperty.Other], + [/*start*/ 0xC00, WordBreakProperty.Extend], + [/*start*/ 0xC05, WordBreakProperty.ALetter], + [/*start*/ 0xC0D, WordBreakProperty.Other], + [/*start*/ 0xC0E, WordBreakProperty.ALetter], + [/*start*/ 0xC11, WordBreakProperty.Other], + [/*start*/ 0xC12, WordBreakProperty.ALetter], + [/*start*/ 0xC29, WordBreakProperty.Other], + [/*start*/ 0xC2A, WordBreakProperty.ALetter], + [/*start*/ 0xC3A, WordBreakProperty.Other], + [/*start*/ 0xC3D, WordBreakProperty.ALetter], + [/*start*/ 0xC3E, WordBreakProperty.Extend], + [/*start*/ 0xC45, WordBreakProperty.Other], + [/*start*/ 0xC46, WordBreakProperty.Extend], + [/*start*/ 0xC49, WordBreakProperty.Other], + [/*start*/ 0xC4A, WordBreakProperty.Extend], + [/*start*/ 0xC4E, WordBreakProperty.Other], + [/*start*/ 0xC55, WordBreakProperty.Extend], + [/*start*/ 0xC57, WordBreakProperty.Other], + [/*start*/ 0xC58, WordBreakProperty.ALetter], + [/*start*/ 0xC5B, WordBreakProperty.Other], + [/*start*/ 0xC60, WordBreakProperty.ALetter], + [/*start*/ 0xC62, WordBreakProperty.Extend], + [/*start*/ 0xC64, WordBreakProperty.Other], + [/*start*/ 0xC66, WordBreakProperty.Numeric], + [/*start*/ 0xC70, WordBreakProperty.Other], + [/*start*/ 0xC80, WordBreakProperty.ALetter], + [/*start*/ 0xC81, WordBreakProperty.Extend], + [/*start*/ 0xC84, WordBreakProperty.Other], + [/*start*/ 0xC85, WordBreakProperty.ALetter], + [/*start*/ 0xC8D, WordBreakProperty.Other], + [/*start*/ 0xC8E, WordBreakProperty.ALetter], + [/*start*/ 0xC91, WordBreakProperty.Other], + [/*start*/ 0xC92, WordBreakProperty.ALetter], + [/*start*/ 0xCA9, WordBreakProperty.Other], + [/*start*/ 0xCAA, WordBreakProperty.ALetter], + [/*start*/ 0xCB4, WordBreakProperty.Other], + [/*start*/ 0xCB5, WordBreakProperty.ALetter], + [/*start*/ 0xCBA, WordBreakProperty.Other], + [/*start*/ 0xCBC, WordBreakProperty.Extend], + [/*start*/ 0xCBD, WordBreakProperty.ALetter], + [/*start*/ 0xCBE, WordBreakProperty.Extend], + [/*start*/ 0xCC5, WordBreakProperty.Other], + [/*start*/ 0xCC6, WordBreakProperty.Extend], + [/*start*/ 0xCC9, WordBreakProperty.Other], + [/*start*/ 0xCCA, WordBreakProperty.Extend], + [/*start*/ 0xCCE, WordBreakProperty.Other], + [/*start*/ 0xCD5, WordBreakProperty.Extend], + [/*start*/ 0xCD7, WordBreakProperty.Other], + [/*start*/ 0xCDE, WordBreakProperty.ALetter], + [/*start*/ 0xCDF, WordBreakProperty.Other], + [/*start*/ 0xCE0, WordBreakProperty.ALetter], + [/*start*/ 0xCE2, WordBreakProperty.Extend], + [/*start*/ 0xCE4, WordBreakProperty.Other], + [/*start*/ 0xCE6, WordBreakProperty.Numeric], + [/*start*/ 0xCF0, WordBreakProperty.Other], + [/*start*/ 0xCF1, WordBreakProperty.ALetter], + [/*start*/ 0xCF3, WordBreakProperty.Other], + [/*start*/ 0xD00, WordBreakProperty.Extend], + [/*start*/ 0xD04, WordBreakProperty.ALetter], + [/*start*/ 0xD0D, WordBreakProperty.Other], + [/*start*/ 0xD0E, WordBreakProperty.ALetter], + [/*start*/ 0xD11, WordBreakProperty.Other], + [/*start*/ 0xD12, WordBreakProperty.ALetter], + [/*start*/ 0xD3B, WordBreakProperty.Extend], + [/*start*/ 0xD3D, WordBreakProperty.ALetter], + [/*start*/ 0xD3E, WordBreakProperty.Extend], + [/*start*/ 0xD45, WordBreakProperty.Other], + [/*start*/ 0xD46, WordBreakProperty.Extend], + [/*start*/ 0xD49, WordBreakProperty.Other], + [/*start*/ 0xD4A, WordBreakProperty.Extend], + [/*start*/ 0xD4E, WordBreakProperty.ALetter], + [/*start*/ 0xD4F, WordBreakProperty.Other], + [/*start*/ 0xD54, WordBreakProperty.ALetter], + [/*start*/ 0xD57, WordBreakProperty.Extend], + [/*start*/ 0xD58, WordBreakProperty.Other], + [/*start*/ 0xD5F, WordBreakProperty.ALetter], + [/*start*/ 0xD62, WordBreakProperty.Extend], + [/*start*/ 0xD64, WordBreakProperty.Other], + [/*start*/ 0xD66, WordBreakProperty.Numeric], + [/*start*/ 0xD70, WordBreakProperty.Other], + [/*start*/ 0xD7A, WordBreakProperty.ALetter], + [/*start*/ 0xD80, WordBreakProperty.Other], + [/*start*/ 0xD81, WordBreakProperty.Extend], + [/*start*/ 0xD84, WordBreakProperty.Other], + [/*start*/ 0xD85, WordBreakProperty.ALetter], + [/*start*/ 0xD97, WordBreakProperty.Other], + [/*start*/ 0xD9A, WordBreakProperty.ALetter], + [/*start*/ 0xDB2, WordBreakProperty.Other], + [/*start*/ 0xDB3, WordBreakProperty.ALetter], + [/*start*/ 0xDBC, WordBreakProperty.Other], + [/*start*/ 0xDBD, WordBreakProperty.ALetter], + [/*start*/ 0xDBE, WordBreakProperty.Other], + [/*start*/ 0xDC0, WordBreakProperty.ALetter], + [/*start*/ 0xDC7, WordBreakProperty.Other], + [/*start*/ 0xDCA, WordBreakProperty.Extend], + [/*start*/ 0xDCB, WordBreakProperty.Other], + [/*start*/ 0xDCF, WordBreakProperty.Extend], + [/*start*/ 0xDD5, WordBreakProperty.Other], + [/*start*/ 0xDD6, WordBreakProperty.Extend], + [/*start*/ 0xDD7, WordBreakProperty.Other], + [/*start*/ 0xDD8, WordBreakProperty.Extend], + [/*start*/ 0xDE0, WordBreakProperty.Other], + [/*start*/ 0xDE6, WordBreakProperty.Numeric], + [/*start*/ 0xDF0, WordBreakProperty.Other], + [/*start*/ 0xDF2, WordBreakProperty.Extend], + [/*start*/ 0xDF4, WordBreakProperty.Other], + [/*start*/ 0xE31, WordBreakProperty.Extend], + [/*start*/ 0xE32, WordBreakProperty.Other], + [/*start*/ 0xE34, WordBreakProperty.Extend], + [/*start*/ 0xE3B, WordBreakProperty.Other], + [/*start*/ 0xE47, WordBreakProperty.Extend], + [/*start*/ 0xE4F, WordBreakProperty.Other], + [/*start*/ 0xE50, WordBreakProperty.Numeric], + [/*start*/ 0xE5A, WordBreakProperty.Other], + [/*start*/ 0xEB1, WordBreakProperty.Extend], + [/*start*/ 0xEB2, WordBreakProperty.Other], + [/*start*/ 0xEB4, WordBreakProperty.Extend], + [/*start*/ 0xEBD, WordBreakProperty.Other], + [/*start*/ 0xEC8, WordBreakProperty.Extend], + [/*start*/ 0xECE, WordBreakProperty.Other], + [/*start*/ 0xED0, WordBreakProperty.Numeric], + [/*start*/ 0xEDA, WordBreakProperty.Other], + [/*start*/ 0xF00, WordBreakProperty.ALetter], + [/*start*/ 0xF01, WordBreakProperty.Other], + [/*start*/ 0xF18, WordBreakProperty.Extend], + [/*start*/ 0xF1A, WordBreakProperty.Other], + [/*start*/ 0xF20, WordBreakProperty.Numeric], + [/*start*/ 0xF2A, WordBreakProperty.Other], + [/*start*/ 0xF35, WordBreakProperty.Extend], + [/*start*/ 0xF36, WordBreakProperty.Other], + [/*start*/ 0xF37, WordBreakProperty.Extend], + [/*start*/ 0xF38, WordBreakProperty.Other], + [/*start*/ 0xF39, WordBreakProperty.Extend], + [/*start*/ 0xF3A, WordBreakProperty.Other], + [/*start*/ 0xF3E, WordBreakProperty.Extend], + [/*start*/ 0xF40, WordBreakProperty.ALetter], + [/*start*/ 0xF48, WordBreakProperty.Other], + [/*start*/ 0xF49, WordBreakProperty.ALetter], + [/*start*/ 0xF6D, WordBreakProperty.Other], + [/*start*/ 0xF71, WordBreakProperty.Extend], + [/*start*/ 0xF85, WordBreakProperty.Other], + [/*start*/ 0xF86, WordBreakProperty.Extend], + [/*start*/ 0xF88, WordBreakProperty.ALetter], + [/*start*/ 0xF8D, WordBreakProperty.Extend], + [/*start*/ 0xF98, WordBreakProperty.Other], + [/*start*/ 0xF99, WordBreakProperty.Extend], + [/*start*/ 0xFBD, WordBreakProperty.Other], + [/*start*/ 0xFC6, WordBreakProperty.Extend], + [/*start*/ 0xFC7, WordBreakProperty.Other], + [/*start*/ 0x102B, WordBreakProperty.Extend], + [/*start*/ 0x103F, WordBreakProperty.Other], + [/*start*/ 0x1040, WordBreakProperty.Numeric], + [/*start*/ 0x104A, WordBreakProperty.Other], + [/*start*/ 0x1056, WordBreakProperty.Extend], + [/*start*/ 0x105A, WordBreakProperty.Other], + [/*start*/ 0x105E, WordBreakProperty.Extend], + [/*start*/ 0x1061, WordBreakProperty.Other], + [/*start*/ 0x1062, WordBreakProperty.Extend], + [/*start*/ 0x1065, WordBreakProperty.Other], + [/*start*/ 0x1067, WordBreakProperty.Extend], + [/*start*/ 0x106E, WordBreakProperty.Other], + [/*start*/ 0x1071, WordBreakProperty.Extend], + [/*start*/ 0x1075, WordBreakProperty.Other], + [/*start*/ 0x1082, WordBreakProperty.Extend], + [/*start*/ 0x108E, WordBreakProperty.Other], + [/*start*/ 0x108F, WordBreakProperty.Extend], + [/*start*/ 0x1090, WordBreakProperty.Numeric], + [/*start*/ 0x109A, WordBreakProperty.Extend], + [/*start*/ 0x109E, WordBreakProperty.Other], + [/*start*/ 0x10A0, WordBreakProperty.ALetter], + [/*start*/ 0x10C6, WordBreakProperty.Other], + [/*start*/ 0x10C7, WordBreakProperty.ALetter], + [/*start*/ 0x10C8, WordBreakProperty.Other], + [/*start*/ 0x10CD, WordBreakProperty.ALetter], + [/*start*/ 0x10CE, WordBreakProperty.Other], + [/*start*/ 0x10D0, WordBreakProperty.ALetter], + [/*start*/ 0x10FB, WordBreakProperty.Other], + [/*start*/ 0x10FC, WordBreakProperty.ALetter], + [/*start*/ 0x1249, WordBreakProperty.Other], + [/*start*/ 0x124A, WordBreakProperty.ALetter], + [/*start*/ 0x124E, WordBreakProperty.Other], + [/*start*/ 0x1250, WordBreakProperty.ALetter], + [/*start*/ 0x1257, WordBreakProperty.Other], + [/*start*/ 0x1258, WordBreakProperty.ALetter], + [/*start*/ 0x1259, WordBreakProperty.Other], + [/*start*/ 0x125A, WordBreakProperty.ALetter], + [/*start*/ 0x125E, WordBreakProperty.Other], + [/*start*/ 0x1260, WordBreakProperty.ALetter], + [/*start*/ 0x1289, WordBreakProperty.Other], + [/*start*/ 0x128A, WordBreakProperty.ALetter], + [/*start*/ 0x128E, WordBreakProperty.Other], + [/*start*/ 0x1290, WordBreakProperty.ALetter], + [/*start*/ 0x12B1, WordBreakProperty.Other], + [/*start*/ 0x12B2, WordBreakProperty.ALetter], + [/*start*/ 0x12B6, WordBreakProperty.Other], + [/*start*/ 0x12B8, WordBreakProperty.ALetter], + [/*start*/ 0x12BF, WordBreakProperty.Other], + [/*start*/ 0x12C0, WordBreakProperty.ALetter], + [/*start*/ 0x12C1, WordBreakProperty.Other], + [/*start*/ 0x12C2, WordBreakProperty.ALetter], + [/*start*/ 0x12C6, WordBreakProperty.Other], + [/*start*/ 0x12C8, WordBreakProperty.ALetter], + [/*start*/ 0x12D7, WordBreakProperty.Other], + [/*start*/ 0x12D8, WordBreakProperty.ALetter], + [/*start*/ 0x1311, WordBreakProperty.Other], + [/*start*/ 0x1312, WordBreakProperty.ALetter], + [/*start*/ 0x1316, WordBreakProperty.Other], + [/*start*/ 0x1318, WordBreakProperty.ALetter], + [/*start*/ 0x135B, WordBreakProperty.Other], + [/*start*/ 0x135D, WordBreakProperty.Extend], + [/*start*/ 0x1360, WordBreakProperty.Other], + [/*start*/ 0x1380, WordBreakProperty.ALetter], + [/*start*/ 0x1390, WordBreakProperty.Other], + [/*start*/ 0x13A0, WordBreakProperty.ALetter], + [/*start*/ 0x13F6, WordBreakProperty.Other], + [/*start*/ 0x13F8, WordBreakProperty.ALetter], + [/*start*/ 0x13FE, WordBreakProperty.Other], + [/*start*/ 0x1401, WordBreakProperty.ALetter], + [/*start*/ 0x166D, WordBreakProperty.Other], + [/*start*/ 0x166F, WordBreakProperty.ALetter], + [/*start*/ 0x1680, WordBreakProperty.WSegSpace], + [/*start*/ 0x1681, WordBreakProperty.ALetter], + [/*start*/ 0x169B, WordBreakProperty.Other], + [/*start*/ 0x16A0, WordBreakProperty.ALetter], + [/*start*/ 0x16EB, WordBreakProperty.Other], + [/*start*/ 0x16EE, WordBreakProperty.ALetter], + [/*start*/ 0x16F9, WordBreakProperty.Other], + [/*start*/ 0x1700, WordBreakProperty.ALetter], + [/*start*/ 0x170D, WordBreakProperty.Other], + [/*start*/ 0x170E, WordBreakProperty.ALetter], + [/*start*/ 0x1712, WordBreakProperty.Extend], + [/*start*/ 0x1715, WordBreakProperty.Other], + [/*start*/ 0x1720, WordBreakProperty.ALetter], + [/*start*/ 0x1732, WordBreakProperty.Extend], + [/*start*/ 0x1735, WordBreakProperty.Other], + [/*start*/ 0x1740, WordBreakProperty.ALetter], + [/*start*/ 0x1752, WordBreakProperty.Extend], + [/*start*/ 0x1754, WordBreakProperty.Other], + [/*start*/ 0x1760, WordBreakProperty.ALetter], + [/*start*/ 0x176D, WordBreakProperty.Other], + [/*start*/ 0x176E, WordBreakProperty.ALetter], + [/*start*/ 0x1771, WordBreakProperty.Other], + [/*start*/ 0x1772, WordBreakProperty.Extend], + [/*start*/ 0x1774, WordBreakProperty.Other], + [/*start*/ 0x17B4, WordBreakProperty.Extend], + [/*start*/ 0x17D4, WordBreakProperty.Other], + [/*start*/ 0x17DD, WordBreakProperty.Extend], + [/*start*/ 0x17DE, WordBreakProperty.Other], + [/*start*/ 0x17E0, WordBreakProperty.Numeric], + [/*start*/ 0x17EA, WordBreakProperty.Other], + [/*start*/ 0x180B, WordBreakProperty.Extend], + [/*start*/ 0x180E, WordBreakProperty.Format], + [/*start*/ 0x180F, WordBreakProperty.Other], + [/*start*/ 0x1810, WordBreakProperty.Numeric], + [/*start*/ 0x181A, WordBreakProperty.Other], + [/*start*/ 0x1820, WordBreakProperty.ALetter], + [/*start*/ 0x1879, WordBreakProperty.Other], + [/*start*/ 0x1880, WordBreakProperty.ALetter], + [/*start*/ 0x1885, WordBreakProperty.Extend], + [/*start*/ 0x1887, WordBreakProperty.ALetter], + [/*start*/ 0x18A9, WordBreakProperty.Extend], + [/*start*/ 0x18AA, WordBreakProperty.ALetter], + [/*start*/ 0x18AB, WordBreakProperty.Other], + [/*start*/ 0x18B0, WordBreakProperty.ALetter], + [/*start*/ 0x18F6, WordBreakProperty.Other], + [/*start*/ 0x1900, WordBreakProperty.ALetter], + [/*start*/ 0x191F, WordBreakProperty.Other], + [/*start*/ 0x1920, WordBreakProperty.Extend], + [/*start*/ 0x192C, WordBreakProperty.Other], + [/*start*/ 0x1930, WordBreakProperty.Extend], + [/*start*/ 0x193C, WordBreakProperty.Other], + [/*start*/ 0x1946, WordBreakProperty.Numeric], + [/*start*/ 0x1950, WordBreakProperty.Other], + [/*start*/ 0x19D0, WordBreakProperty.Numeric], + [/*start*/ 0x19DA, WordBreakProperty.Other], + [/*start*/ 0x1A00, WordBreakProperty.ALetter], + [/*start*/ 0x1A17, WordBreakProperty.Extend], + [/*start*/ 0x1A1C, WordBreakProperty.Other], + [/*start*/ 0x1A55, WordBreakProperty.Extend], + [/*start*/ 0x1A5F, WordBreakProperty.Other], + [/*start*/ 0x1A60, WordBreakProperty.Extend], + [/*start*/ 0x1A7D, WordBreakProperty.Other], + [/*start*/ 0x1A7F, WordBreakProperty.Extend], + [/*start*/ 0x1A80, WordBreakProperty.Numeric], + [/*start*/ 0x1A8A, WordBreakProperty.Other], + [/*start*/ 0x1A90, WordBreakProperty.Numeric], + [/*start*/ 0x1A9A, WordBreakProperty.Other], + [/*start*/ 0x1AB0, WordBreakProperty.Extend], + [/*start*/ 0x1AC1, WordBreakProperty.Other], + [/*start*/ 0x1B00, WordBreakProperty.Extend], + [/*start*/ 0x1B05, WordBreakProperty.ALetter], + [/*start*/ 0x1B34, WordBreakProperty.Extend], + [/*start*/ 0x1B45, WordBreakProperty.ALetter], + [/*start*/ 0x1B4C, WordBreakProperty.Other], + [/*start*/ 0x1B50, WordBreakProperty.Numeric], + [/*start*/ 0x1B5A, WordBreakProperty.Other], + [/*start*/ 0x1B6B, WordBreakProperty.Extend], + [/*start*/ 0x1B74, WordBreakProperty.Other], + [/*start*/ 0x1B80, WordBreakProperty.Extend], + [/*start*/ 0x1B83, WordBreakProperty.ALetter], + [/*start*/ 0x1BA1, WordBreakProperty.Extend], + [/*start*/ 0x1BAE, WordBreakProperty.ALetter], + [/*start*/ 0x1BB0, WordBreakProperty.Numeric], + [/*start*/ 0x1BBA, WordBreakProperty.ALetter], + [/*start*/ 0x1BE6, WordBreakProperty.Extend], + [/*start*/ 0x1BF4, WordBreakProperty.Other], + [/*start*/ 0x1C00, WordBreakProperty.ALetter], + [/*start*/ 0x1C24, WordBreakProperty.Extend], + [/*start*/ 0x1C38, WordBreakProperty.Other], + [/*start*/ 0x1C40, WordBreakProperty.Numeric], + [/*start*/ 0x1C4A, WordBreakProperty.Other], + [/*start*/ 0x1C4D, WordBreakProperty.ALetter], + [/*start*/ 0x1C50, WordBreakProperty.Numeric], + [/*start*/ 0x1C5A, WordBreakProperty.ALetter], + [/*start*/ 0x1C7E, WordBreakProperty.Other], + [/*start*/ 0x1C80, WordBreakProperty.ALetter], + [/*start*/ 0x1C89, WordBreakProperty.Other], + [/*start*/ 0x1C90, WordBreakProperty.ALetter], + [/*start*/ 0x1CBB, WordBreakProperty.Other], + [/*start*/ 0x1CBD, WordBreakProperty.ALetter], + [/*start*/ 0x1CC0, WordBreakProperty.Other], + [/*start*/ 0x1CD0, WordBreakProperty.Extend], + [/*start*/ 0x1CD3, WordBreakProperty.Other], + [/*start*/ 0x1CD4, WordBreakProperty.Extend], + [/*start*/ 0x1CE9, WordBreakProperty.ALetter], + [/*start*/ 0x1CED, WordBreakProperty.Extend], + [/*start*/ 0x1CEE, WordBreakProperty.ALetter], + [/*start*/ 0x1CF4, WordBreakProperty.Extend], + [/*start*/ 0x1CF5, WordBreakProperty.ALetter], + [/*start*/ 0x1CF7, WordBreakProperty.Extend], + [/*start*/ 0x1CFA, WordBreakProperty.ALetter], + [/*start*/ 0x1CFB, WordBreakProperty.Other], + [/*start*/ 0x1D00, WordBreakProperty.ALetter], + [/*start*/ 0x1DC0, WordBreakProperty.Extend], + [/*start*/ 0x1DFA, WordBreakProperty.Other], + [/*start*/ 0x1DFB, WordBreakProperty.Extend], + [/*start*/ 0x1E00, WordBreakProperty.ALetter], + [/*start*/ 0x1F16, WordBreakProperty.Other], + [/*start*/ 0x1F18, WordBreakProperty.ALetter], + [/*start*/ 0x1F1E, WordBreakProperty.Other], + [/*start*/ 0x1F20, WordBreakProperty.ALetter], + [/*start*/ 0x1F46, WordBreakProperty.Other], + [/*start*/ 0x1F48, WordBreakProperty.ALetter], + [/*start*/ 0x1F4E, WordBreakProperty.Other], + [/*start*/ 0x1F50, WordBreakProperty.ALetter], + [/*start*/ 0x1F58, WordBreakProperty.Other], + [/*start*/ 0x1F59, WordBreakProperty.ALetter], + [/*start*/ 0x1F5A, WordBreakProperty.Other], + [/*start*/ 0x1F5B, WordBreakProperty.ALetter], + [/*start*/ 0x1F5C, WordBreakProperty.Other], + [/*start*/ 0x1F5D, WordBreakProperty.ALetter], + [/*start*/ 0x1F5E, WordBreakProperty.Other], + [/*start*/ 0x1F5F, WordBreakProperty.ALetter], + [/*start*/ 0x1F7E, WordBreakProperty.Other], + [/*start*/ 0x1F80, WordBreakProperty.ALetter], + [/*start*/ 0x1FB5, WordBreakProperty.Other], + [/*start*/ 0x1FB6, WordBreakProperty.ALetter], + [/*start*/ 0x1FBD, WordBreakProperty.Other], + [/*start*/ 0x1FBE, WordBreakProperty.ALetter], + [/*start*/ 0x1FBF, WordBreakProperty.Other], + [/*start*/ 0x1FC2, WordBreakProperty.ALetter], + [/*start*/ 0x1FC5, WordBreakProperty.Other], + [/*start*/ 0x1FC6, WordBreakProperty.ALetter], + [/*start*/ 0x1FCD, WordBreakProperty.Other], + [/*start*/ 0x1FD0, WordBreakProperty.ALetter], + [/*start*/ 0x1FD4, WordBreakProperty.Other], + [/*start*/ 0x1FD6, WordBreakProperty.ALetter], + [/*start*/ 0x1FDC, WordBreakProperty.Other], + [/*start*/ 0x1FE0, WordBreakProperty.ALetter], + [/*start*/ 0x1FED, WordBreakProperty.Other], + [/*start*/ 0x1FF2, WordBreakProperty.ALetter], + [/*start*/ 0x1FF5, WordBreakProperty.Other], + [/*start*/ 0x1FF6, WordBreakProperty.ALetter], + [/*start*/ 0x1FFD, WordBreakProperty.Other], + [/*start*/ 0x2000, WordBreakProperty.WSegSpace], + [/*start*/ 0x2007, WordBreakProperty.Other], + [/*start*/ 0x2008, WordBreakProperty.WSegSpace], + [/*start*/ 0x200B, WordBreakProperty.Other], + [/*start*/ 0x200C, WordBreakProperty.Extend], + [/*start*/ 0x200D, WordBreakProperty.ZWJ], + [/*start*/ 0x200E, WordBreakProperty.Format], + [/*start*/ 0x2010, WordBreakProperty.Other], + [/*start*/ 0x2018, WordBreakProperty.MidNumLet], + [/*start*/ 0x201A, WordBreakProperty.Other], + [/*start*/ 0x2024, WordBreakProperty.MidNumLet], + [/*start*/ 0x2025, WordBreakProperty.Other], + [/*start*/ 0x2027, WordBreakProperty.MidLetter], + [/*start*/ 0x2028, WordBreakProperty.Newline], + [/*start*/ 0x202A, WordBreakProperty.Format], + [/*start*/ 0x202F, WordBreakProperty.ExtendNumLet], + [/*start*/ 0x2030, WordBreakProperty.Other], + [/*start*/ 0x203F, WordBreakProperty.ExtendNumLet], + [/*start*/ 0x2041, WordBreakProperty.Other], + [/*start*/ 0x2044, WordBreakProperty.MidNum], + [/*start*/ 0x2045, WordBreakProperty.Other], + [/*start*/ 0x2054, WordBreakProperty.ExtendNumLet], + [/*start*/ 0x2055, WordBreakProperty.Other], + [/*start*/ 0x205F, WordBreakProperty.WSegSpace], + [/*start*/ 0x2060, WordBreakProperty.Format], + [/*start*/ 0x2065, WordBreakProperty.Other], + [/*start*/ 0x2066, WordBreakProperty.Format], + [/*start*/ 0x2070, WordBreakProperty.Other], + [/*start*/ 0x2071, WordBreakProperty.ALetter], + [/*start*/ 0x2072, WordBreakProperty.Other], + [/*start*/ 0x207F, WordBreakProperty.ALetter], + [/*start*/ 0x2080, WordBreakProperty.Other], + [/*start*/ 0x2090, WordBreakProperty.ALetter], + [/*start*/ 0x209D, WordBreakProperty.Other], + [/*start*/ 0x20D0, WordBreakProperty.Extend], + [/*start*/ 0x20F1, WordBreakProperty.Other], + [/*start*/ 0x2102, WordBreakProperty.ALetter], + [/*start*/ 0x2103, WordBreakProperty.Other], + [/*start*/ 0x2107, WordBreakProperty.ALetter], + [/*start*/ 0x2108, WordBreakProperty.Other], + [/*start*/ 0x210A, WordBreakProperty.ALetter], + [/*start*/ 0x2114, WordBreakProperty.Other], + [/*start*/ 0x2115, WordBreakProperty.ALetter], + [/*start*/ 0x2116, WordBreakProperty.Other], + [/*start*/ 0x2119, WordBreakProperty.ALetter], + [/*start*/ 0x211E, WordBreakProperty.Other], + [/*start*/ 0x2124, WordBreakProperty.ALetter], + [/*start*/ 0x2125, WordBreakProperty.Other], + [/*start*/ 0x2126, WordBreakProperty.ALetter], + [/*start*/ 0x2127, WordBreakProperty.Other], + [/*start*/ 0x2128, WordBreakProperty.ALetter], + [/*start*/ 0x2129, WordBreakProperty.Other], + [/*start*/ 0x212A, WordBreakProperty.ALetter], + [/*start*/ 0x212E, WordBreakProperty.Other], + [/*start*/ 0x212F, WordBreakProperty.ALetter], + [/*start*/ 0x213A, WordBreakProperty.Other], + [/*start*/ 0x213C, WordBreakProperty.ALetter], + [/*start*/ 0x2140, WordBreakProperty.Other], + [/*start*/ 0x2145, WordBreakProperty.ALetter], + [/*start*/ 0x214A, WordBreakProperty.Other], + [/*start*/ 0x214E, WordBreakProperty.ALetter], + [/*start*/ 0x214F, WordBreakProperty.Other], + [/*start*/ 0x2160, WordBreakProperty.ALetter], + [/*start*/ 0x2189, WordBreakProperty.Other], + [/*start*/ 0x24B6, WordBreakProperty.ALetter], + [/*start*/ 0x24EA, WordBreakProperty.Other], + [/*start*/ 0x2C00, WordBreakProperty.ALetter], + [/*start*/ 0x2C2F, WordBreakProperty.Other], + [/*start*/ 0x2C30, WordBreakProperty.ALetter], + [/*start*/ 0x2C5F, WordBreakProperty.Other], + [/*start*/ 0x2C60, WordBreakProperty.ALetter], + [/*start*/ 0x2CE5, WordBreakProperty.Other], + [/*start*/ 0x2CEB, WordBreakProperty.ALetter], + [/*start*/ 0x2CEF, WordBreakProperty.Extend], + [/*start*/ 0x2CF2, WordBreakProperty.ALetter], + [/*start*/ 0x2CF4, WordBreakProperty.Other], + [/*start*/ 0x2D00, WordBreakProperty.ALetter], + [/*start*/ 0x2D26, WordBreakProperty.Other], + [/*start*/ 0x2D27, WordBreakProperty.ALetter], + [/*start*/ 0x2D28, WordBreakProperty.Other], + [/*start*/ 0x2D2D, WordBreakProperty.ALetter], + [/*start*/ 0x2D2E, WordBreakProperty.Other], + [/*start*/ 0x2D30, WordBreakProperty.ALetter], + [/*start*/ 0x2D68, WordBreakProperty.Other], + [/*start*/ 0x2D6F, WordBreakProperty.ALetter], + [/*start*/ 0x2D70, WordBreakProperty.Other], + [/*start*/ 0x2D7F, WordBreakProperty.Extend], + [/*start*/ 0x2D80, WordBreakProperty.ALetter], + [/*start*/ 0x2D97, WordBreakProperty.Other], + [/*start*/ 0x2DA0, WordBreakProperty.ALetter], + [/*start*/ 0x2DA7, WordBreakProperty.Other], + [/*start*/ 0x2DA8, WordBreakProperty.ALetter], + [/*start*/ 0x2DAF, WordBreakProperty.Other], + [/*start*/ 0x2DB0, WordBreakProperty.ALetter], + [/*start*/ 0x2DB7, WordBreakProperty.Other], + [/*start*/ 0x2DB8, WordBreakProperty.ALetter], + [/*start*/ 0x2DBF, WordBreakProperty.Other], + [/*start*/ 0x2DC0, WordBreakProperty.ALetter], + [/*start*/ 0x2DC7, WordBreakProperty.Other], + [/*start*/ 0x2DC8, WordBreakProperty.ALetter], + [/*start*/ 0x2DCF, WordBreakProperty.Other], + [/*start*/ 0x2DD0, WordBreakProperty.ALetter], + [/*start*/ 0x2DD7, WordBreakProperty.Other], + [/*start*/ 0x2DD8, WordBreakProperty.ALetter], + [/*start*/ 0x2DDF, WordBreakProperty.Other], + [/*start*/ 0x2DE0, WordBreakProperty.Extend], + [/*start*/ 0x2E00, WordBreakProperty.Other], + [/*start*/ 0x2E2F, WordBreakProperty.ALetter], + [/*start*/ 0x2E30, WordBreakProperty.Other], + [/*start*/ 0x3000, WordBreakProperty.WSegSpace], + [/*start*/ 0x3001, WordBreakProperty.Other], + [/*start*/ 0x3005, WordBreakProperty.ALetter], + [/*start*/ 0x3006, WordBreakProperty.Other], + [/*start*/ 0x302A, WordBreakProperty.Extend], + [/*start*/ 0x3030, WordBreakProperty.Other], + [/*start*/ 0x3031, WordBreakProperty.Katakana], + [/*start*/ 0x3036, WordBreakProperty.Other], + [/*start*/ 0x303B, WordBreakProperty.ALetter], + [/*start*/ 0x303D, WordBreakProperty.Other], + [/*start*/ 0x3099, WordBreakProperty.Extend], + [/*start*/ 0x309B, WordBreakProperty.Katakana], + [/*start*/ 0x309D, WordBreakProperty.Other], + [/*start*/ 0x30A0, WordBreakProperty.Katakana], + [/*start*/ 0x30FB, WordBreakProperty.Other], + [/*start*/ 0x30FC, WordBreakProperty.Katakana], + [/*start*/ 0x3100, WordBreakProperty.Other], + [/*start*/ 0x3105, WordBreakProperty.ALetter], + [/*start*/ 0x3130, WordBreakProperty.Other], + [/*start*/ 0x3131, WordBreakProperty.ALetter], + [/*start*/ 0x318F, WordBreakProperty.Other], + [/*start*/ 0x31A0, WordBreakProperty.ALetter], + [/*start*/ 0x31C0, WordBreakProperty.Other], + [/*start*/ 0x31F0, WordBreakProperty.Katakana], + [/*start*/ 0x3200, WordBreakProperty.Other], + [/*start*/ 0x32D0, WordBreakProperty.Katakana], + [/*start*/ 0x32FF, WordBreakProperty.Other], + [/*start*/ 0x3300, WordBreakProperty.Katakana], + [/*start*/ 0x3358, WordBreakProperty.Other], + [/*start*/ 0xA000, WordBreakProperty.ALetter], + [/*start*/ 0xA48D, WordBreakProperty.Other], + [/*start*/ 0xA4D0, WordBreakProperty.ALetter], + [/*start*/ 0xA4FE, WordBreakProperty.Other], + [/*start*/ 0xA500, WordBreakProperty.ALetter], + [/*start*/ 0xA60D, WordBreakProperty.Other], + [/*start*/ 0xA610, WordBreakProperty.ALetter], + [/*start*/ 0xA620, WordBreakProperty.Numeric], + [/*start*/ 0xA62A, WordBreakProperty.ALetter], + [/*start*/ 0xA62C, WordBreakProperty.Other], + [/*start*/ 0xA640, WordBreakProperty.ALetter], + [/*start*/ 0xA66F, WordBreakProperty.Extend], + [/*start*/ 0xA673, WordBreakProperty.Other], + [/*start*/ 0xA674, WordBreakProperty.Extend], + [/*start*/ 0xA67E, WordBreakProperty.Other], + [/*start*/ 0xA67F, WordBreakProperty.ALetter], + [/*start*/ 0xA69E, WordBreakProperty.Extend], + [/*start*/ 0xA6A0, WordBreakProperty.ALetter], + [/*start*/ 0xA6F0, WordBreakProperty.Extend], + [/*start*/ 0xA6F2, WordBreakProperty.Other], + [/*start*/ 0xA708, WordBreakProperty.ALetter], + [/*start*/ 0xA7C0, WordBreakProperty.Other], + [/*start*/ 0xA7C2, WordBreakProperty.ALetter], + [/*start*/ 0xA7CB, WordBreakProperty.Other], + [/*start*/ 0xA7F5, WordBreakProperty.ALetter], + [/*start*/ 0xA802, WordBreakProperty.Extend], + [/*start*/ 0xA803, WordBreakProperty.ALetter], + [/*start*/ 0xA806, WordBreakProperty.Extend], + [/*start*/ 0xA807, WordBreakProperty.ALetter], + [/*start*/ 0xA80B, WordBreakProperty.Extend], + [/*start*/ 0xA80C, WordBreakProperty.ALetter], + [/*start*/ 0xA823, WordBreakProperty.Extend], + [/*start*/ 0xA828, WordBreakProperty.Other], + [/*start*/ 0xA82C, WordBreakProperty.Extend], + [/*start*/ 0xA82D, WordBreakProperty.Other], + [/*start*/ 0xA840, WordBreakProperty.ALetter], + [/*start*/ 0xA874, WordBreakProperty.Other], + [/*start*/ 0xA880, WordBreakProperty.Extend], + [/*start*/ 0xA882, WordBreakProperty.ALetter], + [/*start*/ 0xA8B4, WordBreakProperty.Extend], + [/*start*/ 0xA8C6, WordBreakProperty.Other], + [/*start*/ 0xA8D0, WordBreakProperty.Numeric], + [/*start*/ 0xA8DA, WordBreakProperty.Other], + [/*start*/ 0xA8E0, WordBreakProperty.Extend], + [/*start*/ 0xA8F2, WordBreakProperty.ALetter], + [/*start*/ 0xA8F8, WordBreakProperty.Other], + [/*start*/ 0xA8FB, WordBreakProperty.ALetter], + [/*start*/ 0xA8FC, WordBreakProperty.Other], + [/*start*/ 0xA8FD, WordBreakProperty.ALetter], + [/*start*/ 0xA8FF, WordBreakProperty.Extend], + [/*start*/ 0xA900, WordBreakProperty.Numeric], + [/*start*/ 0xA90A, WordBreakProperty.ALetter], + [/*start*/ 0xA926, WordBreakProperty.Extend], + [/*start*/ 0xA92E, WordBreakProperty.Other], + [/*start*/ 0xA930, WordBreakProperty.ALetter], + [/*start*/ 0xA947, WordBreakProperty.Extend], + [/*start*/ 0xA954, WordBreakProperty.Other], + [/*start*/ 0xA960, WordBreakProperty.ALetter], + [/*start*/ 0xA97D, WordBreakProperty.Other], + [/*start*/ 0xA980, WordBreakProperty.Extend], + [/*start*/ 0xA984, WordBreakProperty.ALetter], + [/*start*/ 0xA9B3, WordBreakProperty.Extend], + [/*start*/ 0xA9C1, WordBreakProperty.Other], + [/*start*/ 0xA9CF, WordBreakProperty.ALetter], + [/*start*/ 0xA9D0, WordBreakProperty.Numeric], + [/*start*/ 0xA9DA, WordBreakProperty.Other], + [/*start*/ 0xA9E5, WordBreakProperty.Extend], + [/*start*/ 0xA9E6, WordBreakProperty.Other], + [/*start*/ 0xA9F0, WordBreakProperty.Numeric], + [/*start*/ 0xA9FA, WordBreakProperty.Other], + [/*start*/ 0xAA00, WordBreakProperty.ALetter], + [/*start*/ 0xAA29, WordBreakProperty.Extend], + [/*start*/ 0xAA37, WordBreakProperty.Other], + [/*start*/ 0xAA40, WordBreakProperty.ALetter], + [/*start*/ 0xAA43, WordBreakProperty.Extend], + [/*start*/ 0xAA44, WordBreakProperty.ALetter], + [/*start*/ 0xAA4C, WordBreakProperty.Extend], + [/*start*/ 0xAA4E, WordBreakProperty.Other], + [/*start*/ 0xAA50, WordBreakProperty.Numeric], + [/*start*/ 0xAA5A, WordBreakProperty.Other], + [/*start*/ 0xAA7B, WordBreakProperty.Extend], + [/*start*/ 0xAA7E, WordBreakProperty.Other], + [/*start*/ 0xAAB0, WordBreakProperty.Extend], + [/*start*/ 0xAAB1, WordBreakProperty.Other], + [/*start*/ 0xAAB2, WordBreakProperty.Extend], + [/*start*/ 0xAAB5, WordBreakProperty.Other], + [/*start*/ 0xAAB7, WordBreakProperty.Extend], + [/*start*/ 0xAAB9, WordBreakProperty.Other], + [/*start*/ 0xAABE, WordBreakProperty.Extend], + [/*start*/ 0xAAC0, WordBreakProperty.Other], + [/*start*/ 0xAAC1, WordBreakProperty.Extend], + [/*start*/ 0xAAC2, WordBreakProperty.Other], + [/*start*/ 0xAAE0, WordBreakProperty.ALetter], + [/*start*/ 0xAAEB, WordBreakProperty.Extend], + [/*start*/ 0xAAF0, WordBreakProperty.Other], + [/*start*/ 0xAAF2, WordBreakProperty.ALetter], + [/*start*/ 0xAAF5, WordBreakProperty.Extend], + [/*start*/ 0xAAF7, WordBreakProperty.Other], + [/*start*/ 0xAB01, WordBreakProperty.ALetter], + [/*start*/ 0xAB07, WordBreakProperty.Other], + [/*start*/ 0xAB09, WordBreakProperty.ALetter], + [/*start*/ 0xAB0F, WordBreakProperty.Other], + [/*start*/ 0xAB11, WordBreakProperty.ALetter], + [/*start*/ 0xAB17, WordBreakProperty.Other], + [/*start*/ 0xAB20, WordBreakProperty.ALetter], + [/*start*/ 0xAB27, WordBreakProperty.Other], + [/*start*/ 0xAB28, WordBreakProperty.ALetter], + [/*start*/ 0xAB2F, WordBreakProperty.Other], + [/*start*/ 0xAB30, WordBreakProperty.ALetter], + [/*start*/ 0xAB6A, WordBreakProperty.Other], + [/*start*/ 0xAB70, WordBreakProperty.ALetter], + [/*start*/ 0xABE3, WordBreakProperty.Extend], + [/*start*/ 0xABEB, WordBreakProperty.Other], + [/*start*/ 0xABEC, WordBreakProperty.Extend], + [/*start*/ 0xABEE, WordBreakProperty.Other], + [/*start*/ 0xABF0, WordBreakProperty.Numeric], + [/*start*/ 0xABFA, WordBreakProperty.Other], + [/*start*/ 0xAC00, WordBreakProperty.ALetter], + [/*start*/ 0xD7A4, WordBreakProperty.Other], + [/*start*/ 0xD7B0, WordBreakProperty.ALetter], + [/*start*/ 0xD7C7, WordBreakProperty.Other], + [/*start*/ 0xD7CB, WordBreakProperty.ALetter], + [/*start*/ 0xD7FC, WordBreakProperty.Other], + [/*start*/ 0xFB00, WordBreakProperty.ALetter], + [/*start*/ 0xFB07, WordBreakProperty.Other], + [/*start*/ 0xFB13, WordBreakProperty.ALetter], + [/*start*/ 0xFB18, WordBreakProperty.Other], + [/*start*/ 0xFB1D, WordBreakProperty.Hebrew_Letter], + [/*start*/ 0xFB1E, WordBreakProperty.Extend], + [/*start*/ 0xFB1F, WordBreakProperty.Hebrew_Letter], + [/*start*/ 0xFB29, WordBreakProperty.Other], + [/*start*/ 0xFB2A, WordBreakProperty.Hebrew_Letter], + [/*start*/ 0xFB37, WordBreakProperty.Other], + [/*start*/ 0xFB38, WordBreakProperty.Hebrew_Letter], + [/*start*/ 0xFB3D, WordBreakProperty.Other], + [/*start*/ 0xFB3E, WordBreakProperty.Hebrew_Letter], + [/*start*/ 0xFB3F, WordBreakProperty.Other], + [/*start*/ 0xFB40, WordBreakProperty.Hebrew_Letter], + [/*start*/ 0xFB42, WordBreakProperty.Other], + [/*start*/ 0xFB43, WordBreakProperty.Hebrew_Letter], + [/*start*/ 0xFB45, WordBreakProperty.Other], + [/*start*/ 0xFB46, WordBreakProperty.Hebrew_Letter], + [/*start*/ 0xFB50, WordBreakProperty.ALetter], + [/*start*/ 0xFBB2, WordBreakProperty.Other], + [/*start*/ 0xFBD3, WordBreakProperty.ALetter], + [/*start*/ 0xFD3E, WordBreakProperty.Other], + [/*start*/ 0xFD50, WordBreakProperty.ALetter], + [/*start*/ 0xFD90, WordBreakProperty.Other], + [/*start*/ 0xFD92, WordBreakProperty.ALetter], + [/*start*/ 0xFDC8, WordBreakProperty.Other], + [/*start*/ 0xFDF0, WordBreakProperty.ALetter], + [/*start*/ 0xFDFC, WordBreakProperty.Other], + [/*start*/ 0xFE00, WordBreakProperty.Extend], + [/*start*/ 0xFE10, WordBreakProperty.MidNum], + [/*start*/ 0xFE11, WordBreakProperty.Other], + [/*start*/ 0xFE13, WordBreakProperty.MidLetter], + [/*start*/ 0xFE14, WordBreakProperty.MidNum], + [/*start*/ 0xFE15, WordBreakProperty.Other], + [/*start*/ 0xFE20, WordBreakProperty.Extend], + [/*start*/ 0xFE30, WordBreakProperty.Other], + [/*start*/ 0xFE33, WordBreakProperty.ExtendNumLet], + [/*start*/ 0xFE35, WordBreakProperty.Other], + [/*start*/ 0xFE4D, WordBreakProperty.ExtendNumLet], + [/*start*/ 0xFE50, WordBreakProperty.MidNum], + [/*start*/ 0xFE51, WordBreakProperty.Other], + [/*start*/ 0xFE52, WordBreakProperty.MidNumLet], + [/*start*/ 0xFE53, WordBreakProperty.Other], + [/*start*/ 0xFE54, WordBreakProperty.MidNum], + [/*start*/ 0xFE55, WordBreakProperty.MidLetter], + [/*start*/ 0xFE56, WordBreakProperty.Other], + [/*start*/ 0xFE70, WordBreakProperty.ALetter], + [/*start*/ 0xFE75, WordBreakProperty.Other], + [/*start*/ 0xFE76, WordBreakProperty.ALetter], + [/*start*/ 0xFEFD, WordBreakProperty.Other], + [/*start*/ 0xFEFF, WordBreakProperty.Format], + [/*start*/ 0xFF00, WordBreakProperty.Other], + [/*start*/ 0xFF07, WordBreakProperty.MidNumLet], + [/*start*/ 0xFF08, WordBreakProperty.Other], + [/*start*/ 0xFF0C, WordBreakProperty.MidNum], + [/*start*/ 0xFF0D, WordBreakProperty.Other], + [/*start*/ 0xFF0E, WordBreakProperty.MidNumLet], + [/*start*/ 0xFF0F, WordBreakProperty.Other], + [/*start*/ 0xFF10, WordBreakProperty.Numeric], + [/*start*/ 0xFF1A, WordBreakProperty.MidLetter], + [/*start*/ 0xFF1B, WordBreakProperty.MidNum], + [/*start*/ 0xFF1C, WordBreakProperty.Other], + [/*start*/ 0xFF21, WordBreakProperty.ALetter], + [/*start*/ 0xFF3B, WordBreakProperty.Other], + [/*start*/ 0xFF3F, WordBreakProperty.ExtendNumLet], + [/*start*/ 0xFF40, WordBreakProperty.Other], + [/*start*/ 0xFF41, WordBreakProperty.ALetter], + [/*start*/ 0xFF5B, WordBreakProperty.Other], + [/*start*/ 0xFF66, WordBreakProperty.Katakana], + [/*start*/ 0xFF9E, WordBreakProperty.Extend], + [/*start*/ 0xFFA0, WordBreakProperty.ALetter], + [/*start*/ 0xFFBF, WordBreakProperty.Other], + [/*start*/ 0xFFC2, WordBreakProperty.ALetter], + [/*start*/ 0xFFC8, WordBreakProperty.Other], + [/*start*/ 0xFFCA, WordBreakProperty.ALetter], + [/*start*/ 0xFFD0, WordBreakProperty.Other], + [/*start*/ 0xFFD2, WordBreakProperty.ALetter], + [/*start*/ 0xFFD8, WordBreakProperty.Other], + [/*start*/ 0xFFDA, WordBreakProperty.ALetter], + [/*start*/ 0xFFDD, WordBreakProperty.Other], + [/*start*/ 0xFFF9, WordBreakProperty.Format], + [/*start*/ 0xFFFC, WordBreakProperty.Other], + [/*start*/ 0x10000, WordBreakProperty.ALetter], + [/*start*/ 0x1000C, WordBreakProperty.Other], + [/*start*/ 0x1000D, WordBreakProperty.ALetter], + [/*start*/ 0x10027, WordBreakProperty.Other], + [/*start*/ 0x10028, WordBreakProperty.ALetter], + [/*start*/ 0x1003B, WordBreakProperty.Other], + [/*start*/ 0x1003C, WordBreakProperty.ALetter], + [/*start*/ 0x1003E, WordBreakProperty.Other], + [/*start*/ 0x1003F, WordBreakProperty.ALetter], + [/*start*/ 0x1004E, WordBreakProperty.Other], + [/*start*/ 0x10050, WordBreakProperty.ALetter], + [/*start*/ 0x1005E, WordBreakProperty.Other], + [/*start*/ 0x10080, WordBreakProperty.ALetter], + [/*start*/ 0x100FB, WordBreakProperty.Other], + [/*start*/ 0x10140, WordBreakProperty.ALetter], + [/*start*/ 0x10175, WordBreakProperty.Other], + [/*start*/ 0x101FD, WordBreakProperty.Extend], + [/*start*/ 0x101FE, WordBreakProperty.Other], + [/*start*/ 0x10280, WordBreakProperty.ALetter], + [/*start*/ 0x1029D, WordBreakProperty.Other], + [/*start*/ 0x102A0, WordBreakProperty.ALetter], + [/*start*/ 0x102D1, WordBreakProperty.Other], + [/*start*/ 0x102E0, WordBreakProperty.Extend], + [/*start*/ 0x102E1, WordBreakProperty.Other], + [/*start*/ 0x10300, WordBreakProperty.ALetter], + [/*start*/ 0x10320, WordBreakProperty.Other], + [/*start*/ 0x1032D, WordBreakProperty.ALetter], + [/*start*/ 0x1034B, WordBreakProperty.Other], + [/*start*/ 0x10350, WordBreakProperty.ALetter], + [/*start*/ 0x10376, WordBreakProperty.Extend], + [/*start*/ 0x1037B, WordBreakProperty.Other], + [/*start*/ 0x10380, WordBreakProperty.ALetter], + [/*start*/ 0x1039E, WordBreakProperty.Other], + [/*start*/ 0x103A0, WordBreakProperty.ALetter], + [/*start*/ 0x103C4, WordBreakProperty.Other], + [/*start*/ 0x103C8, WordBreakProperty.ALetter], + [/*start*/ 0x103D0, WordBreakProperty.Other], + [/*start*/ 0x103D1, WordBreakProperty.ALetter], + [/*start*/ 0x103D6, WordBreakProperty.Other], + [/*start*/ 0x10400, WordBreakProperty.ALetter], + [/*start*/ 0x1049E, WordBreakProperty.Other], + [/*start*/ 0x104A0, WordBreakProperty.Numeric], + [/*start*/ 0x104AA, WordBreakProperty.Other], + [/*start*/ 0x104B0, WordBreakProperty.ALetter], + [/*start*/ 0x104D4, WordBreakProperty.Other], + [/*start*/ 0x104D8, WordBreakProperty.ALetter], + [/*start*/ 0x104FC, WordBreakProperty.Other], + [/*start*/ 0x10500, WordBreakProperty.ALetter], + [/*start*/ 0x10528, WordBreakProperty.Other], + [/*start*/ 0x10530, WordBreakProperty.ALetter], + [/*start*/ 0x10564, WordBreakProperty.Other], + [/*start*/ 0x10600, WordBreakProperty.ALetter], + [/*start*/ 0x10737, WordBreakProperty.Other], + [/*start*/ 0x10740, WordBreakProperty.ALetter], + [/*start*/ 0x10756, WordBreakProperty.Other], + [/*start*/ 0x10760, WordBreakProperty.ALetter], + [/*start*/ 0x10768, WordBreakProperty.Other], + [/*start*/ 0x10800, WordBreakProperty.ALetter], + [/*start*/ 0x10806, WordBreakProperty.Other], + [/*start*/ 0x10808, WordBreakProperty.ALetter], + [/*start*/ 0x10809, WordBreakProperty.Other], + [/*start*/ 0x1080A, WordBreakProperty.ALetter], + [/*start*/ 0x10836, WordBreakProperty.Other], + [/*start*/ 0x10837, WordBreakProperty.ALetter], + [/*start*/ 0x10839, WordBreakProperty.Other], + [/*start*/ 0x1083C, WordBreakProperty.ALetter], + [/*start*/ 0x1083D, WordBreakProperty.Other], + [/*start*/ 0x1083F, WordBreakProperty.ALetter], + [/*start*/ 0x10856, WordBreakProperty.Other], + [/*start*/ 0x10860, WordBreakProperty.ALetter], + [/*start*/ 0x10877, WordBreakProperty.Other], + [/*start*/ 0x10880, WordBreakProperty.ALetter], + [/*start*/ 0x1089F, WordBreakProperty.Other], + [/*start*/ 0x108E0, WordBreakProperty.ALetter], + [/*start*/ 0x108F3, WordBreakProperty.Other], + [/*start*/ 0x108F4, WordBreakProperty.ALetter], + [/*start*/ 0x108F6, WordBreakProperty.Other], + [/*start*/ 0x10900, WordBreakProperty.ALetter], + [/*start*/ 0x10916, WordBreakProperty.Other], + [/*start*/ 0x10920, WordBreakProperty.ALetter], + [/*start*/ 0x1093A, WordBreakProperty.Other], + [/*start*/ 0x10980, WordBreakProperty.ALetter], + [/*start*/ 0x109B8, WordBreakProperty.Other], + [/*start*/ 0x109BE, WordBreakProperty.ALetter], + [/*start*/ 0x109C0, WordBreakProperty.Other], + [/*start*/ 0x10A00, WordBreakProperty.ALetter], + [/*start*/ 0x10A01, WordBreakProperty.Extend], + [/*start*/ 0x10A04, WordBreakProperty.Other], + [/*start*/ 0x10A05, WordBreakProperty.Extend], + [/*start*/ 0x10A07, WordBreakProperty.Other], + [/*start*/ 0x10A0C, WordBreakProperty.Extend], + [/*start*/ 0x10A10, WordBreakProperty.ALetter], + [/*start*/ 0x10A14, WordBreakProperty.Other], + [/*start*/ 0x10A15, WordBreakProperty.ALetter], + [/*start*/ 0x10A18, WordBreakProperty.Other], + [/*start*/ 0x10A19, WordBreakProperty.ALetter], + [/*start*/ 0x10A36, WordBreakProperty.Other], + [/*start*/ 0x10A38, WordBreakProperty.Extend], + [/*start*/ 0x10A3B, WordBreakProperty.Other], + [/*start*/ 0x10A3F, WordBreakProperty.Extend], + [/*start*/ 0x10A40, WordBreakProperty.Other], + [/*start*/ 0x10A60, WordBreakProperty.ALetter], + [/*start*/ 0x10A7D, WordBreakProperty.Other], + [/*start*/ 0x10A80, WordBreakProperty.ALetter], + [/*start*/ 0x10A9D, WordBreakProperty.Other], + [/*start*/ 0x10AC0, WordBreakProperty.ALetter], + [/*start*/ 0x10AC8, WordBreakProperty.Other], + [/*start*/ 0x10AC9, WordBreakProperty.ALetter], + [/*start*/ 0x10AE5, WordBreakProperty.Extend], + [/*start*/ 0x10AE7, WordBreakProperty.Other], + [/*start*/ 0x10B00, WordBreakProperty.ALetter], + [/*start*/ 0x10B36, WordBreakProperty.Other], + [/*start*/ 0x10B40, WordBreakProperty.ALetter], + [/*start*/ 0x10B56, WordBreakProperty.Other], + [/*start*/ 0x10B60, WordBreakProperty.ALetter], + [/*start*/ 0x10B73, WordBreakProperty.Other], + [/*start*/ 0x10B80, WordBreakProperty.ALetter], + [/*start*/ 0x10B92, WordBreakProperty.Other], + [/*start*/ 0x10C00, WordBreakProperty.ALetter], + [/*start*/ 0x10C49, WordBreakProperty.Other], + [/*start*/ 0x10C80, WordBreakProperty.ALetter], + [/*start*/ 0x10CB3, WordBreakProperty.Other], + [/*start*/ 0x10CC0, WordBreakProperty.ALetter], + [/*start*/ 0x10CF3, WordBreakProperty.Other], + [/*start*/ 0x10D00, WordBreakProperty.ALetter], + [/*start*/ 0x10D24, WordBreakProperty.Extend], + [/*start*/ 0x10D28, WordBreakProperty.Other], + [/*start*/ 0x10D30, WordBreakProperty.Numeric], + [/*start*/ 0x10D3A, WordBreakProperty.Other], + [/*start*/ 0x10E80, WordBreakProperty.ALetter], + [/*start*/ 0x10EAA, WordBreakProperty.Other], + [/*start*/ 0x10EAB, WordBreakProperty.Extend], + [/*start*/ 0x10EAD, WordBreakProperty.Other], + [/*start*/ 0x10EB0, WordBreakProperty.ALetter], + [/*start*/ 0x10EB2, WordBreakProperty.Other], + [/*start*/ 0x10F00, WordBreakProperty.ALetter], + [/*start*/ 0x10F1D, WordBreakProperty.Other], + [/*start*/ 0x10F27, WordBreakProperty.ALetter], + [/*start*/ 0x10F28, WordBreakProperty.Other], + [/*start*/ 0x10F30, WordBreakProperty.ALetter], + [/*start*/ 0x10F46, WordBreakProperty.Extend], + [/*start*/ 0x10F51, WordBreakProperty.Other], + [/*start*/ 0x10FB0, WordBreakProperty.ALetter], + [/*start*/ 0x10FC5, WordBreakProperty.Other], + [/*start*/ 0x10FE0, WordBreakProperty.ALetter], + [/*start*/ 0x10FF7, WordBreakProperty.Other], + [/*start*/ 0x11000, WordBreakProperty.Extend], + [/*start*/ 0x11003, WordBreakProperty.ALetter], + [/*start*/ 0x11038, WordBreakProperty.Extend], + [/*start*/ 0x11047, WordBreakProperty.Other], + [/*start*/ 0x11066, WordBreakProperty.Numeric], + [/*start*/ 0x11070, WordBreakProperty.Other], + [/*start*/ 0x1107F, WordBreakProperty.Extend], + [/*start*/ 0x11083, WordBreakProperty.ALetter], + [/*start*/ 0x110B0, WordBreakProperty.Extend], + [/*start*/ 0x110BB, WordBreakProperty.Other], + [/*start*/ 0x110BD, WordBreakProperty.Format], + [/*start*/ 0x110BE, WordBreakProperty.Other], + [/*start*/ 0x110CD, WordBreakProperty.Format], + [/*start*/ 0x110CE, WordBreakProperty.Other], + [/*start*/ 0x110D0, WordBreakProperty.ALetter], + [/*start*/ 0x110E9, WordBreakProperty.Other], + [/*start*/ 0x110F0, WordBreakProperty.Numeric], + [/*start*/ 0x110FA, WordBreakProperty.Other], + [/*start*/ 0x11100, WordBreakProperty.Extend], + [/*start*/ 0x11103, WordBreakProperty.ALetter], + [/*start*/ 0x11127, WordBreakProperty.Extend], + [/*start*/ 0x11135, WordBreakProperty.Other], + [/*start*/ 0x11136, WordBreakProperty.Numeric], + [/*start*/ 0x11140, WordBreakProperty.Other], + [/*start*/ 0x11144, WordBreakProperty.ALetter], + [/*start*/ 0x11145, WordBreakProperty.Extend], + [/*start*/ 0x11147, WordBreakProperty.ALetter], + [/*start*/ 0x11148, WordBreakProperty.Other], + [/*start*/ 0x11150, WordBreakProperty.ALetter], + [/*start*/ 0x11173, WordBreakProperty.Extend], + [/*start*/ 0x11174, WordBreakProperty.Other], + [/*start*/ 0x11176, WordBreakProperty.ALetter], + [/*start*/ 0x11177, WordBreakProperty.Other], + [/*start*/ 0x11180, WordBreakProperty.Extend], + [/*start*/ 0x11183, WordBreakProperty.ALetter], + [/*start*/ 0x111B3, WordBreakProperty.Extend], + [/*start*/ 0x111C1, WordBreakProperty.ALetter], + [/*start*/ 0x111C5, WordBreakProperty.Other], + [/*start*/ 0x111C9, WordBreakProperty.Extend], + [/*start*/ 0x111CD, WordBreakProperty.Other], + [/*start*/ 0x111CE, WordBreakProperty.Extend], + [/*start*/ 0x111D0, WordBreakProperty.Numeric], + [/*start*/ 0x111DA, WordBreakProperty.ALetter], + [/*start*/ 0x111DB, WordBreakProperty.Other], + [/*start*/ 0x111DC, WordBreakProperty.ALetter], + [/*start*/ 0x111DD, WordBreakProperty.Other], + [/*start*/ 0x11200, WordBreakProperty.ALetter], + [/*start*/ 0x11212, WordBreakProperty.Other], + [/*start*/ 0x11213, WordBreakProperty.ALetter], + [/*start*/ 0x1122C, WordBreakProperty.Extend], + [/*start*/ 0x11238, WordBreakProperty.Other], + [/*start*/ 0x1123E, WordBreakProperty.Extend], + [/*start*/ 0x1123F, WordBreakProperty.Other], + [/*start*/ 0x11280, WordBreakProperty.ALetter], + [/*start*/ 0x11287, WordBreakProperty.Other], + [/*start*/ 0x11288, WordBreakProperty.ALetter], + [/*start*/ 0x11289, WordBreakProperty.Other], + [/*start*/ 0x1128A, WordBreakProperty.ALetter], + [/*start*/ 0x1128E, WordBreakProperty.Other], + [/*start*/ 0x1128F, WordBreakProperty.ALetter], + [/*start*/ 0x1129E, WordBreakProperty.Other], + [/*start*/ 0x1129F, WordBreakProperty.ALetter], + [/*start*/ 0x112A9, WordBreakProperty.Other], + [/*start*/ 0x112B0, WordBreakProperty.ALetter], + [/*start*/ 0x112DF, WordBreakProperty.Extend], + [/*start*/ 0x112EB, WordBreakProperty.Other], + [/*start*/ 0x112F0, WordBreakProperty.Numeric], + [/*start*/ 0x112FA, WordBreakProperty.Other], + [/*start*/ 0x11300, WordBreakProperty.Extend], + [/*start*/ 0x11304, WordBreakProperty.Other], + [/*start*/ 0x11305, WordBreakProperty.ALetter], + [/*start*/ 0x1130D, WordBreakProperty.Other], + [/*start*/ 0x1130F, WordBreakProperty.ALetter], + [/*start*/ 0x11311, WordBreakProperty.Other], + [/*start*/ 0x11313, WordBreakProperty.ALetter], + [/*start*/ 0x11329, WordBreakProperty.Other], + [/*start*/ 0x1132A, WordBreakProperty.ALetter], + [/*start*/ 0x11331, WordBreakProperty.Other], + [/*start*/ 0x11332, WordBreakProperty.ALetter], + [/*start*/ 0x11334, WordBreakProperty.Other], + [/*start*/ 0x11335, WordBreakProperty.ALetter], + [/*start*/ 0x1133A, WordBreakProperty.Other], + [/*start*/ 0x1133B, WordBreakProperty.Extend], + [/*start*/ 0x1133D, WordBreakProperty.ALetter], + [/*start*/ 0x1133E, WordBreakProperty.Extend], + [/*start*/ 0x11345, WordBreakProperty.Other], + [/*start*/ 0x11347, WordBreakProperty.Extend], + [/*start*/ 0x11349, WordBreakProperty.Other], + [/*start*/ 0x1134B, WordBreakProperty.Extend], + [/*start*/ 0x1134E, WordBreakProperty.Other], + [/*start*/ 0x11350, WordBreakProperty.ALetter], + [/*start*/ 0x11351, WordBreakProperty.Other], + [/*start*/ 0x11357, WordBreakProperty.Extend], + [/*start*/ 0x11358, WordBreakProperty.Other], + [/*start*/ 0x1135D, WordBreakProperty.ALetter], + [/*start*/ 0x11362, WordBreakProperty.Extend], + [/*start*/ 0x11364, WordBreakProperty.Other], + [/*start*/ 0x11366, WordBreakProperty.Extend], + [/*start*/ 0x1136D, WordBreakProperty.Other], + [/*start*/ 0x11370, WordBreakProperty.Extend], + [/*start*/ 0x11375, WordBreakProperty.Other], + [/*start*/ 0x11400, WordBreakProperty.ALetter], + [/*start*/ 0x11435, WordBreakProperty.Extend], + [/*start*/ 0x11447, WordBreakProperty.ALetter], + [/*start*/ 0x1144B, WordBreakProperty.Other], + [/*start*/ 0x11450, WordBreakProperty.Numeric], + [/*start*/ 0x1145A, WordBreakProperty.Other], + [/*start*/ 0x1145E, WordBreakProperty.Extend], + [/*start*/ 0x1145F, WordBreakProperty.ALetter], + [/*start*/ 0x11462, WordBreakProperty.Other], + [/*start*/ 0x11480, WordBreakProperty.ALetter], + [/*start*/ 0x114B0, WordBreakProperty.Extend], + [/*start*/ 0x114C4, WordBreakProperty.ALetter], + [/*start*/ 0x114C6, WordBreakProperty.Other], + [/*start*/ 0x114C7, WordBreakProperty.ALetter], + [/*start*/ 0x114C8, WordBreakProperty.Other], + [/*start*/ 0x114D0, WordBreakProperty.Numeric], + [/*start*/ 0x114DA, WordBreakProperty.Other], + [/*start*/ 0x11580, WordBreakProperty.ALetter], + [/*start*/ 0x115AF, WordBreakProperty.Extend], + [/*start*/ 0x115B6, WordBreakProperty.Other], + [/*start*/ 0x115B8, WordBreakProperty.Extend], + [/*start*/ 0x115C1, WordBreakProperty.Other], + [/*start*/ 0x115D8, WordBreakProperty.ALetter], + [/*start*/ 0x115DC, WordBreakProperty.Extend], + [/*start*/ 0x115DE, WordBreakProperty.Other], + [/*start*/ 0x11600, WordBreakProperty.ALetter], + [/*start*/ 0x11630, WordBreakProperty.Extend], + [/*start*/ 0x11641, WordBreakProperty.Other], + [/*start*/ 0x11644, WordBreakProperty.ALetter], + [/*start*/ 0x11645, WordBreakProperty.Other], + [/*start*/ 0x11650, WordBreakProperty.Numeric], + [/*start*/ 0x1165A, WordBreakProperty.Other], + [/*start*/ 0x11680, WordBreakProperty.ALetter], + [/*start*/ 0x116AB, WordBreakProperty.Extend], + [/*start*/ 0x116B8, WordBreakProperty.ALetter], + [/*start*/ 0x116B9, WordBreakProperty.Other], + [/*start*/ 0x116C0, WordBreakProperty.Numeric], + [/*start*/ 0x116CA, WordBreakProperty.Other], + [/*start*/ 0x1171D, WordBreakProperty.Extend], + [/*start*/ 0x1172C, WordBreakProperty.Other], + [/*start*/ 0x11730, WordBreakProperty.Numeric], + [/*start*/ 0x1173A, WordBreakProperty.Other], + [/*start*/ 0x11800, WordBreakProperty.ALetter], + [/*start*/ 0x1182C, WordBreakProperty.Extend], + [/*start*/ 0x1183B, WordBreakProperty.Other], + [/*start*/ 0x118A0, WordBreakProperty.ALetter], + [/*start*/ 0x118E0, WordBreakProperty.Numeric], + [/*start*/ 0x118EA, WordBreakProperty.Other], + [/*start*/ 0x118FF, WordBreakProperty.ALetter], + [/*start*/ 0x11907, WordBreakProperty.Other], + [/*start*/ 0x11909, WordBreakProperty.ALetter], + [/*start*/ 0x1190A, WordBreakProperty.Other], + [/*start*/ 0x1190C, WordBreakProperty.ALetter], + [/*start*/ 0x11914, WordBreakProperty.Other], + [/*start*/ 0x11915, WordBreakProperty.ALetter], + [/*start*/ 0x11917, WordBreakProperty.Other], + [/*start*/ 0x11918, WordBreakProperty.ALetter], + [/*start*/ 0x11930, WordBreakProperty.Extend], + [/*start*/ 0x11936, WordBreakProperty.Other], + [/*start*/ 0x11937, WordBreakProperty.Extend], + [/*start*/ 0x11939, WordBreakProperty.Other], + [/*start*/ 0x1193B, WordBreakProperty.Extend], + [/*start*/ 0x1193F, WordBreakProperty.ALetter], + [/*start*/ 0x11940, WordBreakProperty.Extend], + [/*start*/ 0x11941, WordBreakProperty.ALetter], + [/*start*/ 0x11942, WordBreakProperty.Extend], + [/*start*/ 0x11944, WordBreakProperty.Other], + [/*start*/ 0x11950, WordBreakProperty.Numeric], + [/*start*/ 0x1195A, WordBreakProperty.Other], + [/*start*/ 0x119A0, WordBreakProperty.ALetter], + [/*start*/ 0x119A8, WordBreakProperty.Other], + [/*start*/ 0x119AA, WordBreakProperty.ALetter], + [/*start*/ 0x119D1, WordBreakProperty.Extend], + [/*start*/ 0x119D8, WordBreakProperty.Other], + [/*start*/ 0x119DA, WordBreakProperty.Extend], + [/*start*/ 0x119E1, WordBreakProperty.ALetter], + [/*start*/ 0x119E2, WordBreakProperty.Other], + [/*start*/ 0x119E3, WordBreakProperty.ALetter], + [/*start*/ 0x119E4, WordBreakProperty.Extend], + [/*start*/ 0x119E5, WordBreakProperty.Other], + [/*start*/ 0x11A00, WordBreakProperty.ALetter], + [/*start*/ 0x11A01, WordBreakProperty.Extend], + [/*start*/ 0x11A0B, WordBreakProperty.ALetter], + [/*start*/ 0x11A33, WordBreakProperty.Extend], + [/*start*/ 0x11A3A, WordBreakProperty.ALetter], + [/*start*/ 0x11A3B, WordBreakProperty.Extend], + [/*start*/ 0x11A3F, WordBreakProperty.Other], + [/*start*/ 0x11A47, WordBreakProperty.Extend], + [/*start*/ 0x11A48, WordBreakProperty.Other], + [/*start*/ 0x11A50, WordBreakProperty.ALetter], + [/*start*/ 0x11A51, WordBreakProperty.Extend], + [/*start*/ 0x11A5C, WordBreakProperty.ALetter], + [/*start*/ 0x11A8A, WordBreakProperty.Extend], + [/*start*/ 0x11A9A, WordBreakProperty.Other], + [/*start*/ 0x11A9D, WordBreakProperty.ALetter], + [/*start*/ 0x11A9E, WordBreakProperty.Other], + [/*start*/ 0x11AC0, WordBreakProperty.ALetter], + [/*start*/ 0x11AF9, WordBreakProperty.Other], + [/*start*/ 0x11C00, WordBreakProperty.ALetter], + [/*start*/ 0x11C09, WordBreakProperty.Other], + [/*start*/ 0x11C0A, WordBreakProperty.ALetter], + [/*start*/ 0x11C2F, WordBreakProperty.Extend], + [/*start*/ 0x11C37, WordBreakProperty.Other], + [/*start*/ 0x11C38, WordBreakProperty.Extend], + [/*start*/ 0x11C40, WordBreakProperty.ALetter], + [/*start*/ 0x11C41, WordBreakProperty.Other], + [/*start*/ 0x11C50, WordBreakProperty.Numeric], + [/*start*/ 0x11C5A, WordBreakProperty.Other], + [/*start*/ 0x11C72, WordBreakProperty.ALetter], + [/*start*/ 0x11C90, WordBreakProperty.Other], + [/*start*/ 0x11C92, WordBreakProperty.Extend], + [/*start*/ 0x11CA8, WordBreakProperty.Other], + [/*start*/ 0x11CA9, WordBreakProperty.Extend], + [/*start*/ 0x11CB7, WordBreakProperty.Other], + [/*start*/ 0x11D00, WordBreakProperty.ALetter], + [/*start*/ 0x11D07, WordBreakProperty.Other], + [/*start*/ 0x11D08, WordBreakProperty.ALetter], + [/*start*/ 0x11D0A, WordBreakProperty.Other], + [/*start*/ 0x11D0B, WordBreakProperty.ALetter], + [/*start*/ 0x11D31, WordBreakProperty.Extend], + [/*start*/ 0x11D37, WordBreakProperty.Other], + [/*start*/ 0x11D3A, WordBreakProperty.Extend], + [/*start*/ 0x11D3B, WordBreakProperty.Other], + [/*start*/ 0x11D3C, WordBreakProperty.Extend], + [/*start*/ 0x11D3E, WordBreakProperty.Other], + [/*start*/ 0x11D3F, WordBreakProperty.Extend], + [/*start*/ 0x11D46, WordBreakProperty.ALetter], + [/*start*/ 0x11D47, WordBreakProperty.Extend], + [/*start*/ 0x11D48, WordBreakProperty.Other], + [/*start*/ 0x11D50, WordBreakProperty.Numeric], + [/*start*/ 0x11D5A, WordBreakProperty.Other], + [/*start*/ 0x11D60, WordBreakProperty.ALetter], + [/*start*/ 0x11D66, WordBreakProperty.Other], + [/*start*/ 0x11D67, WordBreakProperty.ALetter], + [/*start*/ 0x11D69, WordBreakProperty.Other], + [/*start*/ 0x11D6A, WordBreakProperty.ALetter], + [/*start*/ 0x11D8A, WordBreakProperty.Extend], + [/*start*/ 0x11D8F, WordBreakProperty.Other], + [/*start*/ 0x11D90, WordBreakProperty.Extend], + [/*start*/ 0x11D92, WordBreakProperty.Other], + [/*start*/ 0x11D93, WordBreakProperty.Extend], + [/*start*/ 0x11D98, WordBreakProperty.ALetter], + [/*start*/ 0x11D99, WordBreakProperty.Other], + [/*start*/ 0x11DA0, WordBreakProperty.Numeric], + [/*start*/ 0x11DAA, WordBreakProperty.Other], + [/*start*/ 0x11EE0, WordBreakProperty.ALetter], + [/*start*/ 0x11EF3, WordBreakProperty.Extend], + [/*start*/ 0x11EF7, WordBreakProperty.Other], + [/*start*/ 0x11FB0, WordBreakProperty.ALetter], + [/*start*/ 0x11FB1, WordBreakProperty.Other], + [/*start*/ 0x12000, WordBreakProperty.ALetter], + [/*start*/ 0x1239A, WordBreakProperty.Other], + [/*start*/ 0x12400, WordBreakProperty.ALetter], + [/*start*/ 0x1246F, WordBreakProperty.Other], + [/*start*/ 0x12480, WordBreakProperty.ALetter], + [/*start*/ 0x12544, WordBreakProperty.Other], + [/*start*/ 0x13000, WordBreakProperty.ALetter], + [/*start*/ 0x1342F, WordBreakProperty.Other], + [/*start*/ 0x13430, WordBreakProperty.Format], + [/*start*/ 0x13439, WordBreakProperty.Other], + [/*start*/ 0x14400, WordBreakProperty.ALetter], + [/*start*/ 0x14647, WordBreakProperty.Other], + [/*start*/ 0x16800, WordBreakProperty.ALetter], + [/*start*/ 0x16A39, WordBreakProperty.Other], + [/*start*/ 0x16A40, WordBreakProperty.ALetter], + [/*start*/ 0x16A5F, WordBreakProperty.Other], + [/*start*/ 0x16A60, WordBreakProperty.Numeric], + [/*start*/ 0x16A6A, WordBreakProperty.Other], + [/*start*/ 0x16AD0, WordBreakProperty.ALetter], + [/*start*/ 0x16AEE, WordBreakProperty.Other], + [/*start*/ 0x16AF0, WordBreakProperty.Extend], + [/*start*/ 0x16AF5, WordBreakProperty.Other], + [/*start*/ 0x16B00, WordBreakProperty.ALetter], + [/*start*/ 0x16B30, WordBreakProperty.Extend], + [/*start*/ 0x16B37, WordBreakProperty.Other], + [/*start*/ 0x16B40, WordBreakProperty.ALetter], + [/*start*/ 0x16B44, WordBreakProperty.Other], + [/*start*/ 0x16B50, WordBreakProperty.Numeric], + [/*start*/ 0x16B5A, WordBreakProperty.Other], + [/*start*/ 0x16B63, WordBreakProperty.ALetter], + [/*start*/ 0x16B78, WordBreakProperty.Other], + [/*start*/ 0x16B7D, WordBreakProperty.ALetter], + [/*start*/ 0x16B90, WordBreakProperty.Other], + [/*start*/ 0x16E40, WordBreakProperty.ALetter], + [/*start*/ 0x16E80, WordBreakProperty.Other], + [/*start*/ 0x16F00, WordBreakProperty.ALetter], + [/*start*/ 0x16F4B, WordBreakProperty.Other], + [/*start*/ 0x16F4F, WordBreakProperty.Extend], + [/*start*/ 0x16F50, WordBreakProperty.ALetter], + [/*start*/ 0x16F51, WordBreakProperty.Extend], + [/*start*/ 0x16F88, WordBreakProperty.Other], + [/*start*/ 0x16F8F, WordBreakProperty.Extend], + [/*start*/ 0x16F93, WordBreakProperty.ALetter], + [/*start*/ 0x16FA0, WordBreakProperty.Other], + [/*start*/ 0x16FE0, WordBreakProperty.ALetter], + [/*start*/ 0x16FE2, WordBreakProperty.Other], + [/*start*/ 0x16FE3, WordBreakProperty.ALetter], + [/*start*/ 0x16FE4, WordBreakProperty.Extend], + [/*start*/ 0x16FE5, WordBreakProperty.Other], + [/*start*/ 0x16FF0, WordBreakProperty.Extend], + [/*start*/ 0x16FF2, WordBreakProperty.Other], + [/*start*/ 0x1B000, WordBreakProperty.Katakana], + [/*start*/ 0x1B001, WordBreakProperty.Other], + [/*start*/ 0x1B164, WordBreakProperty.Katakana], + [/*start*/ 0x1B168, WordBreakProperty.Other], + [/*start*/ 0x1BC00, WordBreakProperty.ALetter], + [/*start*/ 0x1BC6B, WordBreakProperty.Other], + [/*start*/ 0x1BC70, WordBreakProperty.ALetter], + [/*start*/ 0x1BC7D, WordBreakProperty.Other], + [/*start*/ 0x1BC80, WordBreakProperty.ALetter], + [/*start*/ 0x1BC89, WordBreakProperty.Other], + [/*start*/ 0x1BC90, WordBreakProperty.ALetter], + [/*start*/ 0x1BC9A, WordBreakProperty.Other], + [/*start*/ 0x1BC9D, WordBreakProperty.Extend], + [/*start*/ 0x1BC9F, WordBreakProperty.Other], + [/*start*/ 0x1BCA0, WordBreakProperty.Format], + [/*start*/ 0x1BCA4, WordBreakProperty.Other], + [/*start*/ 0x1D165, WordBreakProperty.Extend], + [/*start*/ 0x1D16A, WordBreakProperty.Other], + [/*start*/ 0x1D16D, WordBreakProperty.Extend], + [/*start*/ 0x1D173, WordBreakProperty.Format], + [/*start*/ 0x1D17B, WordBreakProperty.Extend], + [/*start*/ 0x1D183, WordBreakProperty.Other], + [/*start*/ 0x1D185, WordBreakProperty.Extend], + [/*start*/ 0x1D18C, WordBreakProperty.Other], + [/*start*/ 0x1D1AA, WordBreakProperty.Extend], + [/*start*/ 0x1D1AE, WordBreakProperty.Other], + [/*start*/ 0x1D242, WordBreakProperty.Extend], + [/*start*/ 0x1D245, WordBreakProperty.Other], + [/*start*/ 0x1D400, WordBreakProperty.ALetter], + [/*start*/ 0x1D455, WordBreakProperty.Other], + [/*start*/ 0x1D456, WordBreakProperty.ALetter], + [/*start*/ 0x1D49D, WordBreakProperty.Other], + [/*start*/ 0x1D49E, WordBreakProperty.ALetter], + [/*start*/ 0x1D4A0, WordBreakProperty.Other], + [/*start*/ 0x1D4A2, WordBreakProperty.ALetter], + [/*start*/ 0x1D4A3, WordBreakProperty.Other], + [/*start*/ 0x1D4A5, WordBreakProperty.ALetter], + [/*start*/ 0x1D4A7, WordBreakProperty.Other], + [/*start*/ 0x1D4A9, WordBreakProperty.ALetter], + [/*start*/ 0x1D4AD, WordBreakProperty.Other], + [/*start*/ 0x1D4AE, WordBreakProperty.ALetter], + [/*start*/ 0x1D4BA, WordBreakProperty.Other], + [/*start*/ 0x1D4BB, WordBreakProperty.ALetter], + [/*start*/ 0x1D4BC, WordBreakProperty.Other], + [/*start*/ 0x1D4BD, WordBreakProperty.ALetter], + [/*start*/ 0x1D4C4, WordBreakProperty.Other], + [/*start*/ 0x1D4C5, WordBreakProperty.ALetter], + [/*start*/ 0x1D506, WordBreakProperty.Other], + [/*start*/ 0x1D507, WordBreakProperty.ALetter], + [/*start*/ 0x1D50B, WordBreakProperty.Other], + [/*start*/ 0x1D50D, WordBreakProperty.ALetter], + [/*start*/ 0x1D515, WordBreakProperty.Other], + [/*start*/ 0x1D516, WordBreakProperty.ALetter], + [/*start*/ 0x1D51D, WordBreakProperty.Other], + [/*start*/ 0x1D51E, WordBreakProperty.ALetter], + [/*start*/ 0x1D53A, WordBreakProperty.Other], + [/*start*/ 0x1D53B, WordBreakProperty.ALetter], + [/*start*/ 0x1D53F, WordBreakProperty.Other], + [/*start*/ 0x1D540, WordBreakProperty.ALetter], + [/*start*/ 0x1D545, WordBreakProperty.Other], + [/*start*/ 0x1D546, WordBreakProperty.ALetter], + [/*start*/ 0x1D547, WordBreakProperty.Other], + [/*start*/ 0x1D54A, WordBreakProperty.ALetter], + [/*start*/ 0x1D551, WordBreakProperty.Other], + [/*start*/ 0x1D552, WordBreakProperty.ALetter], + [/*start*/ 0x1D6A6, WordBreakProperty.Other], + [/*start*/ 0x1D6A8, WordBreakProperty.ALetter], + [/*start*/ 0x1D6C1, WordBreakProperty.Other], + [/*start*/ 0x1D6C2, WordBreakProperty.ALetter], + [/*start*/ 0x1D6DB, WordBreakProperty.Other], + [/*start*/ 0x1D6DC, WordBreakProperty.ALetter], + [/*start*/ 0x1D6FB, WordBreakProperty.Other], + [/*start*/ 0x1D6FC, WordBreakProperty.ALetter], + [/*start*/ 0x1D715, WordBreakProperty.Other], + [/*start*/ 0x1D716, WordBreakProperty.ALetter], + [/*start*/ 0x1D735, WordBreakProperty.Other], + [/*start*/ 0x1D736, WordBreakProperty.ALetter], + [/*start*/ 0x1D74F, WordBreakProperty.Other], + [/*start*/ 0x1D750, WordBreakProperty.ALetter], + [/*start*/ 0x1D76F, WordBreakProperty.Other], + [/*start*/ 0x1D770, WordBreakProperty.ALetter], + [/*start*/ 0x1D789, WordBreakProperty.Other], + [/*start*/ 0x1D78A, WordBreakProperty.ALetter], + [/*start*/ 0x1D7A9, WordBreakProperty.Other], + [/*start*/ 0x1D7AA, WordBreakProperty.ALetter], + [/*start*/ 0x1D7C3, WordBreakProperty.Other], + [/*start*/ 0x1D7C4, WordBreakProperty.ALetter], + [/*start*/ 0x1D7CC, WordBreakProperty.Other], + [/*start*/ 0x1D7CE, WordBreakProperty.Numeric], + [/*start*/ 0x1D800, WordBreakProperty.Other], + [/*start*/ 0x1DA00, WordBreakProperty.Extend], + [/*start*/ 0x1DA37, WordBreakProperty.Other], + [/*start*/ 0x1DA3B, WordBreakProperty.Extend], + [/*start*/ 0x1DA6D, WordBreakProperty.Other], + [/*start*/ 0x1DA75, WordBreakProperty.Extend], + [/*start*/ 0x1DA76, WordBreakProperty.Other], + [/*start*/ 0x1DA84, WordBreakProperty.Extend], + [/*start*/ 0x1DA85, WordBreakProperty.Other], + [/*start*/ 0x1DA9B, WordBreakProperty.Extend], + [/*start*/ 0x1DAA0, WordBreakProperty.Other], + [/*start*/ 0x1DAA1, WordBreakProperty.Extend], + [/*start*/ 0x1DAB0, WordBreakProperty.Other], + [/*start*/ 0x1E000, WordBreakProperty.Extend], + [/*start*/ 0x1E007, WordBreakProperty.Other], + [/*start*/ 0x1E008, WordBreakProperty.Extend], + [/*start*/ 0x1E019, WordBreakProperty.Other], + [/*start*/ 0x1E01B, WordBreakProperty.Extend], + [/*start*/ 0x1E022, WordBreakProperty.Other], + [/*start*/ 0x1E023, WordBreakProperty.Extend], + [/*start*/ 0x1E025, WordBreakProperty.Other], + [/*start*/ 0x1E026, WordBreakProperty.Extend], + [/*start*/ 0x1E02B, WordBreakProperty.Other], + [/*start*/ 0x1E100, WordBreakProperty.ALetter], + [/*start*/ 0x1E12D, WordBreakProperty.Other], + [/*start*/ 0x1E130, WordBreakProperty.Extend], + [/*start*/ 0x1E137, WordBreakProperty.ALetter], + [/*start*/ 0x1E13E, WordBreakProperty.Other], + [/*start*/ 0x1E140, WordBreakProperty.Numeric], + [/*start*/ 0x1E14A, WordBreakProperty.Other], + [/*start*/ 0x1E14E, WordBreakProperty.ALetter], + [/*start*/ 0x1E14F, WordBreakProperty.Other], + [/*start*/ 0x1E2C0, WordBreakProperty.ALetter], + [/*start*/ 0x1E2EC, WordBreakProperty.Extend], + [/*start*/ 0x1E2F0, WordBreakProperty.Numeric], + [/*start*/ 0x1E2FA, WordBreakProperty.Other], + [/*start*/ 0x1E800, WordBreakProperty.ALetter], + [/*start*/ 0x1E8C5, WordBreakProperty.Other], + [/*start*/ 0x1E8D0, WordBreakProperty.Extend], + [/*start*/ 0x1E8D7, WordBreakProperty.Other], + [/*start*/ 0x1E900, WordBreakProperty.ALetter], + [/*start*/ 0x1E944, WordBreakProperty.Extend], + [/*start*/ 0x1E94B, WordBreakProperty.ALetter], + [/*start*/ 0x1E94C, WordBreakProperty.Other], + [/*start*/ 0x1E950, WordBreakProperty.Numeric], + [/*start*/ 0x1E95A, WordBreakProperty.Other], + [/*start*/ 0x1EE00, WordBreakProperty.ALetter], + [/*start*/ 0x1EE04, WordBreakProperty.Other], + [/*start*/ 0x1EE05, WordBreakProperty.ALetter], + [/*start*/ 0x1EE20, WordBreakProperty.Other], + [/*start*/ 0x1EE21, WordBreakProperty.ALetter], + [/*start*/ 0x1EE23, WordBreakProperty.Other], + [/*start*/ 0x1EE24, WordBreakProperty.ALetter], + [/*start*/ 0x1EE25, WordBreakProperty.Other], + [/*start*/ 0x1EE27, WordBreakProperty.ALetter], + [/*start*/ 0x1EE28, WordBreakProperty.Other], + [/*start*/ 0x1EE29, WordBreakProperty.ALetter], + [/*start*/ 0x1EE33, WordBreakProperty.Other], + [/*start*/ 0x1EE34, WordBreakProperty.ALetter], + [/*start*/ 0x1EE38, WordBreakProperty.Other], + [/*start*/ 0x1EE39, WordBreakProperty.ALetter], + [/*start*/ 0x1EE3A, WordBreakProperty.Other], + [/*start*/ 0x1EE3B, WordBreakProperty.ALetter], + [/*start*/ 0x1EE3C, WordBreakProperty.Other], + [/*start*/ 0x1EE42, WordBreakProperty.ALetter], + [/*start*/ 0x1EE43, WordBreakProperty.Other], + [/*start*/ 0x1EE47, WordBreakProperty.ALetter], + [/*start*/ 0x1EE48, WordBreakProperty.Other], + [/*start*/ 0x1EE49, WordBreakProperty.ALetter], + [/*start*/ 0x1EE4A, WordBreakProperty.Other], + [/*start*/ 0x1EE4B, WordBreakProperty.ALetter], + [/*start*/ 0x1EE4C, WordBreakProperty.Other], + [/*start*/ 0x1EE4D, WordBreakProperty.ALetter], + [/*start*/ 0x1EE50, WordBreakProperty.Other], + [/*start*/ 0x1EE51, WordBreakProperty.ALetter], + [/*start*/ 0x1EE53, WordBreakProperty.Other], + [/*start*/ 0x1EE54, WordBreakProperty.ALetter], + [/*start*/ 0x1EE55, WordBreakProperty.Other], + [/*start*/ 0x1EE57, WordBreakProperty.ALetter], + [/*start*/ 0x1EE58, WordBreakProperty.Other], + [/*start*/ 0x1EE59, WordBreakProperty.ALetter], + [/*start*/ 0x1EE5A, WordBreakProperty.Other], + [/*start*/ 0x1EE5B, WordBreakProperty.ALetter], + [/*start*/ 0x1EE5C, WordBreakProperty.Other], + [/*start*/ 0x1EE5D, WordBreakProperty.ALetter], + [/*start*/ 0x1EE5E, WordBreakProperty.Other], + [/*start*/ 0x1EE5F, WordBreakProperty.ALetter], + [/*start*/ 0x1EE60, WordBreakProperty.Other], + [/*start*/ 0x1EE61, WordBreakProperty.ALetter], + [/*start*/ 0x1EE63, WordBreakProperty.Other], + [/*start*/ 0x1EE64, WordBreakProperty.ALetter], + [/*start*/ 0x1EE65, WordBreakProperty.Other], + [/*start*/ 0x1EE67, WordBreakProperty.ALetter], + [/*start*/ 0x1EE6B, WordBreakProperty.Other], + [/*start*/ 0x1EE6C, WordBreakProperty.ALetter], + [/*start*/ 0x1EE73, WordBreakProperty.Other], + [/*start*/ 0x1EE74, WordBreakProperty.ALetter], + [/*start*/ 0x1EE78, WordBreakProperty.Other], + [/*start*/ 0x1EE79, WordBreakProperty.ALetter], + [/*start*/ 0x1EE7D, WordBreakProperty.Other], + [/*start*/ 0x1EE7E, WordBreakProperty.ALetter], + [/*start*/ 0x1EE7F, WordBreakProperty.Other], + [/*start*/ 0x1EE80, WordBreakProperty.ALetter], + [/*start*/ 0x1EE8A, WordBreakProperty.Other], + [/*start*/ 0x1EE8B, WordBreakProperty.ALetter], + [/*start*/ 0x1EE9C, WordBreakProperty.Other], + [/*start*/ 0x1EEA1, WordBreakProperty.ALetter], + [/*start*/ 0x1EEA4, WordBreakProperty.Other], + [/*start*/ 0x1EEA5, WordBreakProperty.ALetter], + [/*start*/ 0x1EEAA, WordBreakProperty.Other], + [/*start*/ 0x1EEAB, WordBreakProperty.ALetter], + [/*start*/ 0x1EEBC, WordBreakProperty.Other], + [/*start*/ 0x1F130, WordBreakProperty.ALetter], + [/*start*/ 0x1F14A, WordBreakProperty.Other], + [/*start*/ 0x1F150, WordBreakProperty.ALetter], + [/*start*/ 0x1F16A, WordBreakProperty.Other], + [/*start*/ 0x1F170, WordBreakProperty.ALetter], + [/*start*/ 0x1F18A, WordBreakProperty.Other], + [/*start*/ 0x1F1E6, WordBreakProperty.Regional_Indicator], + [/*start*/ 0x1F200, WordBreakProperty.Other], + [/*start*/ 0x1F3FB, WordBreakProperty.Extend], + [/*start*/ 0x1F400, WordBreakProperty.Other], + [/*start*/ 0x1FBF0, WordBreakProperty.Numeric], + [/*start*/ 0x1FBFA, WordBreakProperty.Other], + [/*start*/ 0xE0001, WordBreakProperty.Format], + [/*start*/ 0xE0002, WordBreakProperty.Other], + [/*start*/ 0xE0020, WordBreakProperty.Extend], + [/*start*/ 0xE0080, WordBreakProperty.Other], + [/*start*/ 0xE0100, WordBreakProperty.Extend], + [/*start*/ 0xE01F0, WordBreakProperty.Other], +]; diff --git a/developer/src/kmc-model/test/wordbreakers/default-wordbreaker-esm.ts b/developer/src/kmc-model/test/wordbreakers/default-wordbreaker-esm.ts new file mode 100644 index 0000000000000000000000000000000000000000..55c0e560da6fff157ad2eb890e60ed3f32a3c605 --- /dev/null +++ b/developer/src/kmc-model/test/wordbreakers/default-wordbreaker-esm.ts @@ -0,0 +1,383 @@ +// TEMP: esm version of /common/models/wordbreakers/default/index.ts + + import { I, WORD_BREAK_PROPERTY, WordBreakProperty } from './data.js'; + + + /** + * Word breaker based on Unicode Standard Annex #29, Section 4.1: + * Default Word Boundary Specification. + * + * @see http://unicode.org/reports/tr29/#Word_Boundaries + * @see https://github.com/eddieantonio/unicode-default-word-boundary/tree/v12.0.0 + */ + export default function default_(text: string): Span[] { + let boundaries = findBoundaries(text); + if (boundaries.length == 0) { + return []; + } + + // All non-empty strings have at least TWO boundaries: at the start and at the end of + // the string. + let spans = []; + for (let i = 0; i < boundaries.length - 1; i++) { + let start = boundaries[i]; + let end = boundaries[i + 1]; + let span = new LazySpan(text, start, end); + + if (isNonSpace(span.text)) { + spans.push(span); + // Preserve a sequence-final space if it exists. Needed to signal "end of word". + } else if (i == boundaries.length - 2) { // if "we just checked the final boundary"... + // We don't want to return the whitespace itself; the correct token is simply ''. + span = new LazySpan(text, end, end); + spans.push(span); + } + } + return spans; + } + + // Utilities // + // type WordBreakProperty = data.WordBreakProperty; + // const WordBreakProperty = data.WordBreakProperty; + // type I = data.I; + // const I = data.I; + // const WORD_BREAK_PROPERTY = data.WORD_BREAK_PROPERTY; + + /** + * A span that does not cut out the substring until it absolutely has to! + */ + class LazySpan implements Span { + private _source: string; + readonly start: number; + readonly end: number; + constructor(source: string, start: number, end: number) { + this._source = source; + this.start = start; + this.end = end; + } + + get text(): string { + return this._source.substring(this.start, this.end); + } + + get length(): number { + return this.end - this.start; + } + } + + /** + * Returns true when the chunk does not solely consist of whitespace. + * + * @param chunk a chunk of text. Starts and ends at word boundaries. + */ + function isNonSpace(chunk: string): boolean { + return !Array.from(chunk).map(property).every(wb => ( + wb === WordBreakProperty.CR || + wb === WordBreakProperty.LF || + wb === WordBreakProperty.Newline || + wb === WordBreakProperty.WSegSpace + )); + } + + /** + * Yields a series of string indices where a word break should + * occur. That is, there should be a break BEFORE each string + * index yielded by this generator. + * + * @param text Text to find word boundaries in. + */ + function findBoundaries(text: string): number[] { + // WB1 and WB2: no boundaries if given an empty string. + if (text.length === 0) { + // There are no boundaries in an empty string! + return []; + } + + // This algorithm works by maintaining a sliding window of four SCALAR VALUES. + // + // - Scalar values? JavaScript strings are NOT actually a string of + // Unicode code points; some characters are made up of TWO + // JavaScript indices. e.g., + // "💩".length === 2; + // "💩"[0] === '\uD83D'; + // "💩"[1] === '\uDCA9'; + // + // These characters that are represented by TWO indices are + // called "surrogate pairs". Since we don't want to be in the + // "middle" of a character, make sure we're always advancing + // by scalar values, and NOT indices. That means, we sometimes + // need to advance by TWO indices, not just one. + // - Four values? Some rules look at what's to the left of + // left, and some look at what's to the right of right. So + // keep track of this! + + let boundaries = []; + + let rightPos: number; + let lookaheadPos = 0; // lookahead, one scalar value to the right of right. + // Before the start of the string is also the start of the string. + let lookbehind: WordBreakProperty; + let left = WordBreakProperty.sot; + let right = WordBreakProperty.sot; + let lookahead = wordbreakPropertyAt(0); + // Count RIs to make sure we're not splitting emoji flags: + let nConsecutiveRegionalIndicators = 0; + + do { + // Shift all positions, one scalar value to the right. + rightPos = lookaheadPos; + lookaheadPos = positionAfter(lookaheadPos); + // Shift all properties, one scalar value to the right. + [lookbehind, left, right, lookahead] = + [left, right, lookahead, wordbreakPropertyAt(lookaheadPos)]; + + // Break at the start and end of text, unless the text is empty. + // WB1: Break at start of text... + if (left === WordBreakProperty.sot) { + boundaries.push(rightPos); + continue; + } + // WB2: Break at the end of text... + if (right === WordBreakProperty.eot) { + boundaries.push(rightPos); + break; // Reached the end of the string. We're done! + } + // WB3: Do not break within CRLF: + if (left === WordBreakProperty.CR && right === WordBreakProperty.LF) + continue; + // WB3b: Otherwise, break after... + if (left === WordBreakProperty.Newline || + left === WordBreakProperty.CR || + left === WordBreakProperty.LF) { + boundaries.push(rightPos); + continue; + } + // WB3a: ...and before newlines + if (right === WordBreakProperty.Newline || + right === WordBreakProperty.CR || + right === WordBreakProperty.LF) { + boundaries.push(rightPos); + continue; + } + + // TODO: WB3c is not implemented, due to its complex, error-prone + // implementation, requiring a ginormous regexp, and the fact that + // the only thing it does is prevent big emoji sequences from being + // split up, like 🧚🏼‍♂️ + // https://www.unicode.org/Public/emoji/12.0/emoji-zwj-sequences.txt + + // WB3d: Keep horizontal whitespace together + if (left === WordBreakProperty.WSegSpace && right == WordBreakProperty.WSegSpace) + continue; + + // WB4: Ignore format and extend characters + // This is to keep grapheme clusters together! + // See: Section 6.2: https://unicode.org/reports/tr29/#Grapheme_Cluster_and_Format_Rules + // N.B.: The rule about "except after sot, CR, LF, and + // Newline" already been by WB1, WB2, WB3a, and WB3b above. + while (right === WordBreakProperty.Format || + right === WordBreakProperty.Extend || + right === WordBreakProperty.ZWJ) { + // Continue advancing in the string, as if these + // characters do not exist. DO NOT update left and + // lookbehind however! + [rightPos, lookaheadPos] = [lookaheadPos, positionAfter(lookaheadPos)]; + [right, lookahead] = [lookahead, wordbreakPropertyAt(lookaheadPos)]; + } + // In ignoring the characters in the previous loop, we could + // have fallen off the end of the string, so end the loop + // prematurely if that happens! + if (right === WordBreakProperty.eot) { + boundaries.push(rightPos); + break; + } + // WB4 (continued): Lookahead must ALSO ignore these format, + // extend, ZWJ characters! + while (lookahead === WordBreakProperty.Format || + lookahead === WordBreakProperty.Extend || + lookahead === WordBreakProperty.ZWJ) { + // Continue advancing in the string, as if these + // characters do not exist. DO NOT update left and right, + // however! + lookaheadPos = positionAfter(lookaheadPos); + lookahead = wordbreakPropertyAt(lookaheadPos); + } + + // WB5: Do not break between most letters. + if (isAHLetter(left) && isAHLetter(right)) + continue; + // Do not break across certain punctuation + // WB6: (Don't break before apostrophes in contractions) + if (isAHLetter(left) && isAHLetter(lookahead) && + (right === WordBreakProperty.MidLetter || isMidNumLetQ(right))) + continue; + // WB7: (Don't break after apostrophes in contractions) + if (isAHLetter(lookbehind) && isAHLetter(right) && + (left === WordBreakProperty.MidLetter || isMidNumLetQ(left))) + continue; + // WB7a + if (left === WordBreakProperty.Hebrew_Letter && right === WordBreakProperty.Single_Quote) + continue; + // WB7b + if (left === WordBreakProperty.Hebrew_Letter && right === WordBreakProperty.Double_Quote && + lookahead === WordBreakProperty.Hebrew_Letter) + continue; + // WB7c + if (lookbehind === WordBreakProperty.Hebrew_Letter && left === WordBreakProperty.Double_Quote && + right === WordBreakProperty.Hebrew_Letter) + continue; + // Do not break within sequences of digits, or digits adjacent to letters. + // e.g., "3a" or "A3" + // WB8 + if (left === WordBreakProperty.Numeric && right === WordBreakProperty.Numeric) + continue; + // WB9 + if (isAHLetter(left) && right === WordBreakProperty.Numeric) + continue; + // WB10 + if (left === WordBreakProperty.Numeric && isAHLetter(right)) + continue; + // Do not break within sequences, such as 3.2, 3,456.789 + // WB11 + if (lookbehind === WordBreakProperty.Numeric && right === WordBreakProperty.Numeric && + (left === WordBreakProperty.MidNum || isMidNumLetQ(left))) + continue; + // WB12 + if (left === WordBreakProperty.Numeric && lookahead === WordBreakProperty.Numeric && + (right === WordBreakProperty.MidNum || isMidNumLetQ(right))) + continue; + // WB13: Do not break between Katakana + if (left === WordBreakProperty.Katakana && right === WordBreakProperty.Katakana) + continue; + // Do not break from extenders (e.g., U+202F NARROW NO-BREAK SPACE) + // WB13a + if ((isAHLetter(left) || + left === WordBreakProperty.Numeric || + left === WordBreakProperty.Katakana || + left === WordBreakProperty.ExtendNumLet) && + right === WordBreakProperty.ExtendNumLet) + continue; + // WB13b + if ((isAHLetter(right) || + right === WordBreakProperty.Numeric || + right === WordBreakProperty.Katakana) && left === WordBreakProperty.ExtendNumLet) + continue; + + // WB15 & WB16: + // Do not break within emoji flag sequences. That is, do not break between + // regional indicator (RI) symbols if there is an odd number of RI + // characters before the break point. + if (right === WordBreakProperty.Regional_Indicator) { + // Emoji flags are actually composed of TWO scalar values, each being a + // "regional indicator". These indicators correspond to Latin letters. Put + // two of them together, and they spell out an ISO 3166-1-alpha-2 country + // code. Since these always come in pairs, NEVER split the pairs! So, if + // we happen to be inside the middle of an odd numbered of + // Regional_Indicators, DON'T SPLIT IT! + nConsecutiveRegionalIndicators += 1; + if ((nConsecutiveRegionalIndicators % 2) == 1) { + continue; + } + } else { + nConsecutiveRegionalIndicators = 0; + } + // WB999: Otherwise, break EVERYWHERE (including around ideographs) + boundaries.push(rightPos); + } while (rightPos < text.length); + + return boundaries; + + ///// Internal utility functions ///// + + /** + * Returns the position of the start of the next scalar value. This jumps + * over surrogate pairs. + * + * If asked for the character AFTER the end of the string, this always + * returns the length of the string. + */ + function positionAfter(pos: number): number { + if (pos >= text.length) { + return text.length; + } else if (isStartOfSurrogatePair(text[pos])) { + return pos + 2; + } + return pos + 1; + } + + /** + * Return the value of the Word_Break property at the given string index. + * @param pos position in the text. + */ + function wordbreakPropertyAt(pos: number) { + if (pos < 0) { + return WordBreakProperty.sot; // Always "start of string" before the string starts! + } else if (pos >= text.length) { + return WordBreakProperty.eot; // Always "end of string" after the string ends! + } else if (isStartOfSurrogatePair(text[pos])) { + // Surrogate pairs the next TWO items from the string! + return property(text[pos] + text[pos + 1]); + } + return property(text[pos]); + } + + // Word_Break rule macros + // See: https://unicode.org/reports/tr29/#WB_Rule_Macros + function isAHLetter(prop: WordBreakProperty): boolean { + return prop === WordBreakProperty.ALetter || + prop === WordBreakProperty.Hebrew_Letter; + } + + function isMidNumLetQ(prop: WordBreakProperty): boolean { + return prop === WordBreakProperty.MidNumLet || + prop === WordBreakProperty.Single_Quote; + } + } + + function isStartOfSurrogatePair(character: string) { + let codeUnit = character.charCodeAt(0); + return codeUnit >= 0xD800 && codeUnit <= 0xDBFF; + } + + /** + * Return the Word_Break property value for a character. + * Note that + * @param character a scalar value + */ + function property(character: string): WordBreakProperty { + // This MUST be a scalar value. + // TODO: remove dependence on character.codepointAt()? + let codepoint = character.codePointAt(0) as number; + return searchForProperty(codepoint, 0, WORD_BREAK_PROPERTY.length - 1); + } + + /** + * Binary search for the word break property of a given CODE POINT. + * + * The auto-generated data.ts master array defines a **character range** + * lookup table. If a character's codepoint is equal to or greater than + * the I.Start value for an entry and exclusively less than the next entry, + * it falls in the first entry's range bucket and is classified accordingly + * by this method. + */ + function searchForProperty(codePoint: number, left: number, right: number): WordBreakProperty { + // All items that are not found in the array are assigned the 'Other' property. + if (right < left) { + return WordBreakProperty.Other; + } + + let midpoint = left + ~~((right - left) / 2); + let candidate = WORD_BREAK_PROPERTY[midpoint]; + + let nextRange = WORD_BREAK_PROPERTY[midpoint + 1]; + let startOfNextRange = nextRange ? nextRange[I.Start] : Infinity; + + if (codePoint < candidate[I.Start]) { + return searchForProperty(codePoint, left, midpoint - 1); + } else if (codePoint >= startOfNextRange) { + return searchForProperty(codePoint, midpoint + 1, right); + } + + // We found it! + return candidate[I.Value]; + } diff --git a/developer/src/kmlmc/libexec/create-override-script-regexp.ts b/developer/src/kmc-model/tools/create-override-script-regexp.ts similarity index 95% rename from developer/src/kmlmc/libexec/create-override-script-regexp.ts rename to developer/src/kmc-model/tools/create-override-script-regexp.ts index 7cc262282a36047bb3be88e704b9f07d33bc4262..38604320583962cfac79bcca75d2b6829111dea3 100644 --- a/developer/src/kmlmc/libexec/create-override-script-regexp.ts +++ b/developer/src/kmc-model/tools/create-override-script-regexp.ts @@ -15,7 +15,7 @@ import {readFileSync} from "fs"; import * as path from "path"; // Where to find UnicodeData.txt and Blocks.txt -const UCD_DIR = path.join("..", "..", "resources", "standards-data", "unicode-character-database"); +const UCD_DIR = path.join("..", "..", "..", "..", "resources", "standards-data", "unicode-character-database"); const SPACELESS_SCRIPT_BLOCKS = new Set([ "Myanmar", // a.k.a., Burmese @@ -30,7 +30,7 @@ const SPACELESS_SCRIPT_BLOCKS = new Set([ let blockIter = blocks(); let block = nextBlock(); -let eligibleCharacters = []; +let eligibleCharacters: number[] = []; // @ts-ignore: TypeScript complains that it can't compile for..of over a // generator without --downlevelIteration, but it works anyway? @@ -116,7 +116,7 @@ function isLetterOrMark(category: string): boolean { } function groupCodePointsIntoRanges(characters: number[]): [number, number][] { - let ranges = []; + let ranges: [number,number][] = []; let previousCharacter = characters[0]; const candidates = characters.slice(1); diff --git a/developer/src/kmc-model/tsconfig.json b/developer/src/kmc-model/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..8ad34413fa273854677e75ad7d41264a6434e234 --- /dev/null +++ b/developer/src/kmc-model/tsconfig.json @@ -0,0 +1,18 @@ +{ + "extends": "../kmc/tsconfig.kmc-base.json", + + "compilerOptions": { + "outDir": "build/src/", + "rootDir": "src/", + "baseUrl": ".", + "allowSyntheticDefaultImports": true, + }, + "include": [ + "src/**/*.ts" + ], + "references": [ + { "path": "../../../common/web/keyman-version/tsconfig.esm.json" }, + { "path": "../../../common/models/types" }, + { "path": "../../../common/web/types" }, + ] +} diff --git a/developer/src/kmc-package/.eslintrc.cjs b/developer/src/kmc-package/.eslintrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..09038ae9291d0ce786656be735b38cff1049976d --- /dev/null +++ b/developer/src/kmc-package/.eslintrc.cjs @@ -0,0 +1,15 @@ +module.exports = { + parserOptions: { + project: ["./tsconfig.json", "./test/tsconfig.json"], + }, + ignorePatterns: ["test/fixtures/**/*"], + overrides: [ + { + files:"src/**/*.ts", + extends: ["../../../common/web/eslint/eslintNoNodeImports.js"], + } + ], + rules: { + "prefer-const": "off", // TODO: enable this once infrastructure is in place and cleanup the problem cases + }, +}; diff --git a/developer/src/kmc-package/Makefile b/developer/src/kmc-package/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..0a5ba6a1c10107a854a1170ce9ca317758f449b8 --- /dev/null +++ b/developer/src/kmc-package/Makefile @@ -0,0 +1,38 @@ +# +# Keyman Developer - kmc Package Compiler Makefile +# + +!include ..\Defines.mak + +# We don't depend on configure here because kmc-ldml does that already +build: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh build + +configure: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh configure + +clean: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh clean + +test: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh test + +# build.sh bundle must be run from shell as it requires a temp folder to be +# passed in. See inst/download.in.mak for instantiation. + +publish: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh publish + +signcode: + @rem nothing to do + +wrap-symbols: + @rem nothing to do + +test-manifest: + @rem nothing to do + +install: + @rem nothing to do + +!include ..\Target.mak diff --git a/developer/src/kmc-package/build.sh b/developer/src/kmc-package/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..3206f60fda34cef55f689d2206c3229743836772 --- /dev/null +++ b/developer/src/kmc-package/build.sh @@ -0,0 +1,72 @@ +#!/usr/bin/env bash +# +# Compiles the kmc lexical model package compiler. +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +cd "$THIS_SCRIPT_PATH" + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +builder_describe "Build Keyman kmc Package Compiler module" \ + "@/common/web/keyman-version" \ + "@/developer/src/common/web/test-helpers" \ + "configure" \ + "build" \ + "clean" \ + "test" \ + "pack build a local .tgz pack for testing" \ + "publish publish to npm" \ + "--dry-run,-n don't actually publish, just dry run" +builder_describe_outputs \ + configure /node_modules \ + build /developer/src/kmc-package/build/src/main.js +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action clean; then + rm -rf ./build/ ./tsconfig.tsbuildinfo + builder_finish_action success clean +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action configure; then + verify_npm_setup + builder_finish_action success configure +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action build; then + npm run build + builder_finish_action success build +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action test; then + npm test + builder_finish_action success test +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action publish; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_npm + builder_finish_action success publish +elif builder_start_action pack; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_pack + builder_finish_action success pack +fi diff --git a/developer/src/kmc-package/package.json b/developer/src/kmc-package/package.json new file mode 100644 index 0000000000000000000000000000000000000000..1595dc21ecc47d6842584e31657a22c775f7514d --- /dev/null +++ b/developer/src/kmc-package/package.json @@ -0,0 +1,70 @@ +{ + "name": "@keymanapp/kmc-package", + "description": "Keyman Developer package compiler", + "keywords": [ + "keyboard", + "keyman", + "unicode" + ], + "type": "module", + "exports": { + ".": "./build/src/main.js" + }, + "files": [ + "/build/src/" + ], + "scripts": { + "build": "tsc -b", + "lint": "eslint .", + "test": "npm run lint && cd test && tsc -b && cd .. && c8 --reporter=lcov --reporter=text mocha", + "coverage": "npm test", + "prepublishOnly": "npm run build" + }, + "author": "Marc Durdin (https://github.com/mcdurdin)", + "contributors": [ + "Eddie Antonio Santos ", + "Joshua Horton" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/keymanapp/keyman/issues" + }, + "dependencies": { + "jszip": "^3.7.0", + "@keymanapp/common-types": "*" + }, + "devDependencies": { + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "mocha": "^8.4.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5", + "@keymanapp/developer-test-helpers": "*" + }, + "mocha": { + "spec": "build/test/**/test-*.js", + "require": [ + "source-map-support/register" + ] + }, + "c8": { + "all": true, + "src": [ + "src/" + ], + "exclude-after-remap": true, + "exclude": [ + "test/", + "src/kmp-json-file.ts", + "src/kps-file.ts" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/keymanapp/keyman.git" + } +} diff --git a/developer/src/kmc-package/src/compiler/kmp-compiler.ts b/developer/src/kmc-package/src/compiler/kmp-compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..b660641df9c564972064f4ed644433dd793c3f65 --- /dev/null +++ b/developer/src/kmc-package/src/compiler/kmp-compiler.ts @@ -0,0 +1,293 @@ +import * as xml2js from 'xml2js'; +import JSZip from 'jszip'; +import KEYMAN_VERSION from "@keymanapp/keyman-version"; + +import { CompilerCallbacks, KvkFile } from '@keymanapp/common-types'; +import { CompilerMessages } from './messages.js'; +import { KmpJsonFile, KpsFile } from '@keymanapp/common-types'; +import { PackageVersionValidation } from './package-version-validation.js'; + +const FILEVERSION_KMP_JSON = '12.0'; + +export class KmpCompiler { + + constructor(private callbacks: CompilerCallbacks) { + } + + public transformKpsToKmpObject(kpsFilename: string): KmpJsonFile.KmpJsonFile { + // Load the KPS data from XML as JS structured data. + const data = this.callbacks.fs.readFileSync(kpsFilename, 'utf-8'); + + const kpsPackage = (() => { + let a: KpsFile.KpsPackage; + let parser = new xml2js.Parser({ + tagNameProcessors: [xml2js.processors.firstCharLowerCase], + explicitArray: false + }); + parser.parseString(data, (e: unknown, r: unknown) => { a = r as KpsFile.KpsPackage }); + return a; + })(); + + let kps: KpsFile.KpsFile = kpsPackage.package; + + // + // To convert to kmp.json, we need to: + // + // 1. Unwrap arrays (and convert to array where single object) + // 2. Fix casing on `iD` + // 3. Rewrap info, keyboard.languages, lexicalModel.languages, startMenu.items elements + // 4. Remove options.followKeyboardVersion, file.fileType + // 5. Convert file.copyLocation to a Number + // 6. Filenames need to be basenames (but this comes after processing) + // + + // Start to construct the kmp.json file from the .kps file + + let kmp: KmpJsonFile.KmpJsonFile = { + system: { + fileVersion: FILEVERSION_KMP_JSON, + keymanDeveloperVersion: KEYMAN_VERSION.VERSION + }, + options: {} + }; + + // + // Fill in additional fields + // + + let keys: [keyof KpsFile.KpsFileOptions, keyof KmpJsonFile.KmpJsonFileOptions][] = [ + ['executeProgram','executeProgram'], + ['graphicFile', 'graphicFile'], + ['msiFileName','msiFilename'], + ['msiOptions', 'msiOptions'], + ['readMeFile', 'readmeFile'] + ]; + if(kps.options) { + for (let [src,dst] of keys) { + if (kps.options[src]) { + kmp.options[dst] = kps.options[src]; + } + } + } + + // + // Add basic metadata + // + + if(kps.info) { + kmp.info = this.kpsInfoToKmpInfo(kps.info); + } + + // + // Add file metadata + // + + if(kps.files && kps.files.file) { + kmp.files = this.arrayWrap(kps.files.file).map((file: KpsFile.KpsFileContentFile) => { + return { + name: file.name, + description: file.description, + copyLocation: parseInt(file.copyLocation, 10) || undefined + // note: we don't emit fileType as that is not permitted in kmp.json + }; + }); + } + kmp.files = kmp.files ?? []; + + // Add the standard kmp.json self-referential to match existing implementations + kmp.files.push({ + name: "kmp.json", + description: "Package information (JSON)" + }); + + // + // Add keyboard metadata + // + + if(kps.keyboards && kps.keyboards.keyboard) { + kmp.keyboards = this.arrayWrap(kps.keyboards.keyboard).map((keyboard: KpsFile.KpsFileKeyboard) => ({ + displayFont: keyboard.displayFont ? this.callbacks.path.basename(keyboard.displayFont) : undefined, + oskFont: keyboard.oSKFont ? this.callbacks.path.basename(keyboard.oSKFont) : undefined, + name:keyboard.name, + id:keyboard.iD, + version:keyboard.version, + languages: keyboard.languages ? + this.kpsLanguagesToKmpLanguages(this.arrayWrap(keyboard.languages.language) as KpsFile.KpsFileLanguage[]) : + [] + })); + } + + // + // Add lexical-model metadata + // + + if(kps.lexicalModels && kps.lexicalModels.lexicalModel) { + kmp.lexicalModels = this.arrayWrap(kps.lexicalModels.lexicalModel).map((model: KpsFile.KpsFileLexicalModel) => ({ + name:model.name, + id:model.iD, + languages: model.languages ? + this.kpsLanguagesToKmpLanguages(this.arrayWrap(model.languages.language) as KpsFile.KpsFileLanguage[]) : [] + })); + } + + // + // Verify version metadata; doing this in the transform + // while we have access to the .kps metadata, and keeping the + // + + const versionValidator = new PackageVersionValidation(this.callbacks); + if(!versionValidator.validateAndUpdateVersions(kpsFilename, kps, kmp)) { + return null; + } + + // + // Add Windows Start Menu metadata + // + + if(kps.startMenu && kps.startMenu.items) { + kmp.startMenu = {}; + if(kps.startMenu.addUninstallEntry) kmp.startMenu.addUninstallEntry = kps.startMenu.addUninstallEntry === ''; + if(kps.startMenu.folder) kmp.startMenu.folder = kps.startMenu.folder; + if(kps.startMenu.items && kps.startMenu.items.item) kmp.startMenu.items = this.arrayWrap(kps.startMenu.items.item); + } + + // + // Add translation strings + // + + if(kps.strings && kps.strings.string) { + kmp.strings = this.arrayWrap(kps.strings.string); + } + + kmp = this.stripUndefined(kmp) as KmpJsonFile.KmpJsonFile; + + return kmp; + } + + // Helper functions + + private kpsInfoToKmpInfo(info: KpsFile.KpsFileInfo): KmpJsonFile.KmpJsonFileInfo { + let ni: KmpJsonFile.KmpJsonFileInfo = {}; + + const keys: [(keyof KpsFile.KpsFileInfo), (keyof KmpJsonFile.KmpJsonFileInfo)][] = [ + ['author','author'], + ['copyright','copyright'], + ['name','name'], + ['version','version'], + ['webSite','website'] + ]; + + for (let [src,dst] of keys) { + if (info[src]) { + ni[dst] = {description: info[src]._ ?? (typeof info[src] == 'string' ? info[src].toString() : '')}; + if(info[src].$ && info[src].$.URL) ni[dst].url = info[src].$.URL; + } + } + + return ni; + }; + + private arrayWrap(a: unknown) { + if (Array.isArray(a)) { + return a; + } + return [a]; + }; + + private kpsLanguagesToKmpLanguages(language: KpsFile.KpsFileLanguage[]): KmpJsonFile.KmpJsonFileLanguage[] { + return language.map((element) => { return { name: element._, id: element.$.ID } }); + }; + + + + private stripUndefined(o: any) { + for(const key in o) { + if(o[key] === undefined) { + delete o[key]; + } else if(typeof o[key] == 'object') { + o[key] = this.stripUndefined(o[key]); + } + } + return o; + } + + /** + * Returns a Promise to the serialized data which can then be written to a .kmp file. + * + * @param kpsFilename - Filename of the kps, not read, used only for calculating relative paths + * @param kmpJsonData - The kmp.json Object + */ + public buildKmpFile(kpsFilename: string, kmpJsonData: KmpJsonFile.KmpJsonFile): Promise { + const zip = JSZip(); + + const kmpJsonFileName = 'kmp.json'; + + // Make a copy of kmpJsonData, as we mutate paths for writing + const data: KmpJsonFile.KmpJsonFile = JSON.parse(JSON.stringify(kmpJsonData)); + if(!data.files) { + data.files = []; + } + + let failed = false; + data.files.forEach((value) => { + // Get the path of the file + let filename = value.name; + + // We add this separately after zipping all other files + if(filename == 'kmp.json') { + return; + } + + if(this.callbacks.path.isAbsolute(filename)) { + // absolute paths are not portable to other computers + this.callbacks.reportMessage(CompilerMessages.Warn_AbsolutePath({filename: filename})); + } + + filename = this.callbacks.resolveFilename(kpsFilename, filename); + const basename = this.callbacks.path.basename(filename); + + if(!this.callbacks.fs.existsSync(filename)) { + this.callbacks.reportMessage(CompilerMessages.Error_FileDoesNotExist({filename: filename})); + failed = true; + return; + } + + let memberFileData; + try { + memberFileData = this.callbacks.loadFile(filename); + } catch(e) { + this.callbacks.reportMessage(CompilerMessages.Error_FileCouldNotBeRead({filename: filename, e: e})); + failed = true; + return; + } + + this.warnIfKvkFileIsNotBinary(filename, memberFileData); + + zip.file(basename, memberFileData); + + // Remove path data from files before JSON save + value.name = basename; + }); + + if(failed) { + return null; + } + + zip.file(kmpJsonFileName, JSON.stringify(data, null, 2)); + + // Generate kmp file + return zip.generateAsync({type: 'binarystring', compression:'DEFLATE'}); + } + + /** + * Legacy .kmp compiler would transform xml-format .kvk files into a binary .kvk file; now + * we want that to remain the responsibility of the keyboard compiler, so we'll warn the + * few users who are still doing this + */ + private warnIfKvkFileIsNotBinary(filename: string, data: Buffer) { + // TODO: Buffer is not available on web + if(filename.match(/\.kvk$/) && data.compare(Buffer.from(KvkFile.KVK_HEADER_IDENTIFIER_BYTES), 0, 3, 0, 3) != 0) { + this.callbacks.reportMessage(CompilerMessages.Warn_FileIsNotABinaryKvkFile({filename: filename})); + } + } +} diff --git a/developer/src/kmc-package/src/compiler/messages.ts b/developer/src/kmc-package/src/compiler/messages.ts new file mode 100644 index 0000000000000000000000000000000000000000..35eb5a851258d4066cc438b645a6613927e0bc12 --- /dev/null +++ b/developer/src/kmc-package/src/compiler/messages.ts @@ -0,0 +1,114 @@ +import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec as m } from "@keymanapp/common-types"; + +const Namespace = CompilerErrorNamespace.PackageCompiler; +const SevInfo = CompilerErrorSeverity.Info | Namespace; +// const SevHint = CompilerErrorSeverity.Hint | Namespace; +const SevWarn = CompilerErrorSeverity.Warn | Namespace; +const SevError = CompilerErrorSeverity.Error | Namespace; +const SevFatal = CompilerErrorSeverity.Fatal | Namespace; + +export class CompilerMessages { + static Fatal_UnexpectedException = (o:{e: any}) => m(this.FATAL_UnexpectedException, + `Unexpected exception: ${(o.e ?? 'unknown error').toString()}\n\nCall stack:\n${(o.e instanceof Error ? o.e.stack : (new Error()).stack)}`); + static FATAL_UnexpectedException = SevFatal | 0x0001; + + static Warn_AbsolutePath = (o:{filename: string}) => m(this.WARN_AbsolutePath, `File ${o.filename} has an absolute path, which is not portable.`); + static WARN_AbsolutePath = SevWarn | 0x0002; + + static Error_FileDoesNotExist = (o:{filename: string}) => m(this.ERROR_FileDoesNotExist, `File ${o.filename} does not exist.`); + static ERROR_FileDoesNotExist = SevError | 0x0003; + + static Error_FileCouldNotBeRead = (o:{filename: string; e: any}) => m(this.ERROR_FileCouldNotBeRead, + `File ${o.filename} could not be read: ${(o.e ?? 'unknown error').toString()}.`); + static ERROR_FileCouldNotBeRead = SevError | 0x0004; + + static Warn_FileIsNotABinaryKvkFile = (o:{filename: string}) => m(this.WARN_FileIsNotABinaryKvkFile, + `File ${o.filename} does not appear to be a valid binary .kvk file; this may be an old package that includes an xml-format .kvk file. `+ + `You must update the package to include the compiled .kvk file in the package.`); + static WARN_FileIsNotABinaryKvkFile = SevWarn | 0x0005; + + static Error_FollowKeyboardVersionNotAllowedForModelPackages = () => m(this.ERROR_FollowKeyboardVersionNotAllowedForModelPackages, + `FollowKeyboardVersion is not allowed in model packages`); + static ERROR_FollowKeyboardVersionNotAllowedForModelPackages = SevError | 0x0006; + + static Error_FollowKeyboardVersionButNoKeyboards = () => m(this.ERROR_FollowKeyboardVersionButNoKeyboards, + `FollowKeyboardVersion is set, but the package contains no keyboards`); + static ERROR_FollowKeyboardVersionButNoKeyboards = SevError | 0x0007; + + static Error_KeyboardContentFileNotFound = (o:{id:string}) => m(this.ERROR_KeyboardContentFileNotFound, + `Keyboard ${o.id} was listed in but a corresponding .kmx file was not found in `); + static ERROR_KeyboardContentFileNotFound = SevError | 0x0008; + + static Error_KeyboardFileNotValid = (o:{filename:string}) => m(this.ERROR_KeyboardFileNotValid, + `Keyboard file ${o.filename} is not a valid .kmx file`); + static ERROR_KeyboardFileNotValid = SevError | 0x0009; + + static Info_KeyboardFileHasNoKeyboardVersion = (o:{filename:string}) => m(this.INFO_KeyboardFileHasNoKeyboardVersion, + `Keyboard file ${o.filename} has no &KeyboardVersion store, using default '0.0'`); + static INFO_KeyboardFileHasNoKeyboardVersion = SevInfo | 0x000A; + + static Error_PackageCannotContainBothModelsAndKeyboards = () => m(this.ERROR_PackageCannotContainBothModelsAndKeyboards, + `The package contains both lexical models and keyboards, which is not permitted.`); + static ERROR_PackageCannotContainBothModelsAndKeyboards = SevError | 0x000B; + + static Warn_PackageShouldNotRepeatLanguages = (o:{resourceType: string, id: string, minimalTag: string, firstTag: string, secondTag: string}) => m(this.WARN_PackageShouldNotRepeatLanguages, + `Two language tags in ${o.resourceType} ${o.id}, '${o.firstTag}' and '${o.secondTag}', reduce to the same minimal tag '${o.minimalTag}'.`); + static WARN_PackageShouldNotRepeatLanguages = SevWarn | 0x000C; + + static Warn_PackageNameDoesNotFollowLexicalModelConventions = (o:{filename: string}) => m(this.WARN_PackageNameDoesNotFollowLexicalModelConventions, + `The package file ${o.filename} does not follow the recommended model filename conventions. The name should be all lower case, `+ + `include only alphanumeric characters and underscore (_), not start with a digit, and should have the structure `+ + `...model.kps.`); + static WARN_PackageNameDoesNotFollowLexicalModelConventions = SevWarn | 0x000D; + + static Warn_PackageNameDoesNotFollowKeyboardConventions = (o:{filename: string}) => m(this.WARN_PackageNameDoesNotFollowKeyboardConventions, + `The package file ${o.filename} does not follow the recommended keyboard filename conventions. The name should be all lower case, `+ + `include only alphanumeric characters and underscore (_), and not start with a digit.`); + static WARN_PackageNameDoesNotFollowKeyboardConventions = SevWarn | 0x000E; + + static Warn_FileInPackageDoesNotFollowFilenameConventions = (o:{filename: string}) => m(this.WARN_FileInPackageDoesNotFollowFilenameConventions, + `The file ${o.filename} does not follow the recommended filename conventions. The extension should be all lower case, `+ + `and the filename should include only alphanumeric characters, -, _, + and .`); + static WARN_FileInPackageDoesNotFollowFilenameConventions = SevWarn | 0x000F; + + static Error_PackageNameCannotBeBlank = () => m(this.ERROR_PackageNameCannotBeBlank, + `Package name cannot be an empty string.`); + static ERROR_PackageNameCannotBeBlank = SevError | 0x0010; + + static Error_KeyboardFileNotFound = (o:{filename:string}) => m(this.ERROR_KeyboardFileNotFound, + `Keyboard file ${o.filename} was not found. Has it been compiled?`); + static ERROR_KeyboardFileNotFound = SevError | 0x0011; + + static Warn_KeyboardVersionsDoNotMatch = (o: {keyboard:string, version:string, firstKeyboard:string, firstVersion:string}) => m(this.WARN_KeyboardVersionsDoNotMatch, + `Keyboard ${o.keyboard} version ${o.version} does not match keyboard ${o.firstKeyboard} version ${o.firstVersion}.`); + static WARN_KeyboardVersionsDoNotMatch = SevWarn | 0x0012; + + static Warn_KeyboardVersionsDoNotMatchPackageVersion = (o: {keyboard:string, keyboardVersion: string, packageVersion: string}) => m(this.WARN_KeyboardVersionsDoNotMatchPackageVersion, + `Keyboard ${o.keyboard} version ${o.keyboardVersion} does not match package version ${o.packageVersion}.`); + static WARN_KeyboardVersionsDoNotMatchPackageVersion = SevWarn | 0x0013; + + static Error_LanguageTagIsNotValid = (o: {resourceType: string, id:string, lang:string, e:any}) => m(this.ERROR_LanguageTagIsNotValid, + `Language tag '${o.lang}' in ${o.resourceType} ${o.id} is invalid.`); + static ERROR_LanguageTagIsNotValid = SevError | 0x0014; + + static Warn_LanguageTagIsNotMinimal = (o: {resourceType: string, id:string, actual:string, expected:string}) => m(this.WARN_LanguageTagIsNotMinimal, + `Language tag '${o.actual}' in ${o.resourceType} ${o.id} is not minimal, and should be '${o.expected}'.`); + static WARN_LanguageTagIsNotMinimal = SevWarn | 0x0015; + + static Error_MustHaveAtLeastOneLanguage = (o:{resourceType:string, id:string}) => m(this.ERROR_MustHaveAtLeastOneLanguage, + `The ${o.resourceType} ${o.id} must have at least one language specified.`); + static ERROR_MustHaveAtLeastOneLanguage = SevError | 0x0016; + + static Warn_RedistFileShouldNotBeInPackage = (o:{filename:string}) => m(this.WARN_RedistFileShouldNotBeInPackage, + `The Keyman system file '${o.filename}' should not be compiled into the package.`); + static WARN_RedistFileShouldNotBeInPackage = SevWarn | 0x0017; + + static Warn_DocFileDangerous = (o:{filename:string}) => m(this.WARN_DocFileDangerous, + `Microsoft Word .doc or .docx files ('${o.filename}') are not portable. You should instead use HTML or PDF format.`); + static WARN_DocFileDangerous = SevWarn | 0x0018; + + static Error_PackageMustContainAModelOrAKeyboard = () => m(this.ERROR_PackageMustContainAModelOrAKeyboard, + `Package must contain a lexical model or a keyboard.`); + static ERROR_PackageMustContainAModelOrAKeyboard = SevError | 0x0019; +} + diff --git a/developer/src/kmc-package/src/compiler/package-validation.ts b/developer/src/kmc-package/src/compiler/package-validation.ts new file mode 100644 index 0000000000000000000000000000000000000000..0fd139bb47c27218791052fc08c07e270a93dfec --- /dev/null +++ b/developer/src/kmc-package/src/compiler/package-validation.ts @@ -0,0 +1,184 @@ +import { KmpJsonFile, CompilerCallbacks } from '@keymanapp/common-types'; +import { CompilerMessages } from './messages.js'; +import { keymanEngineForWindowsFiles, keymanForWindowsInstallerFiles, keymanForWindowsRedistFiles } from './redist-files.js'; + +// const SLexicalModelExtension = '.model.js'; + +// The keyboard ID SHOULD adhere to this pattern: +const KEYBOARD_ID_PATTERN_PACKAGE = /^[a-z_][a-z0-9_]*\.(kps|kmp)$/; + +// The model ID SHOULD adhere to this pattern: +// author .bcp47 .uniq +const MODEL_ID_PATTERN_PACKAGE = /^[a-z_][a-z0-9_]*\.[a-z_][a-z0-9_-]*\.[a-z_][a-z0-9_]*\.model\.(kps|kmp)$/; +// const MODEL_ID_PATTERN_JS = /^[a-z_][a-z0-9_]*\.[a-z_][a-z0-9_-]*\.[a-z_][a-z0-9_]*\.model\.js$/; +// const MODEL_ID_PATTERN_TS = /^[a-z_][a-z0-9_]*\.[a-z_][a-z0-9_-]*\.[a-z_][a-z0-9_]*\.model\.ts$/; +// const MODEL_ID_PATTERN_PROJECT = /^[a-z_][a-z0-9_]*\.[a-z_][a-z0-9_-]*\.[a-z_][a-z0-9_]*\.model\.kpj$/; + +// "Content files" within the package should adhere to these pattern: +const CONTENT_FILE_BASENAME_PATTERN = /^[a-z0-9_+.-]+$/; +const CONTENT_FILE_EXTENSION_PATTERN = /^\.[a-z0-9_]+$/; + +export class PackageValidation { + + constructor(private callbacks: CompilerCallbacks) { + } + + public validate(filename: string, kmpJson: KmpJsonFile.KmpJsonFile) { + if(!this.checkForModelsAndKeyboardsInSamePackage(kmpJson)) { + return false; + } + if(!this.checkKeyboards(filename, kmpJson)) { + return false; + } + if(!this.checkLexicalModels(filename, kmpJson)) { + return false; + } + if(!this.checkContentFiles(kmpJson)) { + return false; + } + if(!this.checkPackageInfo(kmpJson)) { + return false; + } + return true; + } + + private checkForDuplicatedOrNonMinimalLanguages(resourceType: 'keyboard'|'model', id: string, languages: KmpJsonFile.KmpJsonFileLanguage[]): boolean { + let minimalTags: {[tag: string]: string} = {}; + + if(languages.length == 0) { + this.callbacks.reportMessage(CompilerMessages.Error_MustHaveAtLeastOneLanguage({resourceType, id})); + return false; + } + + for(let lang of languages) { + let locale; + try { + locale = new Intl.Locale(lang.id); + } catch(e: any) { + this.callbacks.reportMessage(CompilerMessages.Error_LanguageTagIsNotValid({resourceType, id, lang: lang.id, e})); + return false; + } + + const minimalTag = locale.minimize().toString(); + + if(minimalTag.toLowerCase() !== lang.id.toLowerCase()) { + this.callbacks.reportMessage(CompilerMessages.Warn_LanguageTagIsNotMinimal({resourceType, id, actual: lang.id, expected: minimalTag})); + } + + if(minimalTags[minimalTag]) { + this.callbacks.reportMessage(CompilerMessages.Warn_PackageShouldNotRepeatLanguages({resourceType, id, minimalTag, firstTag: lang.id, secondTag: minimalTags[minimalTag]})); + } + else { + minimalTags[minimalTag] = lang.id; + } + } + + return true; + } + + private checkForModelsAndKeyboardsInSamePackage(kmpJson: KmpJsonFile.KmpJsonFile): boolean { + if(kmpJson.lexicalModels?.length > 0 && kmpJson.keyboards?.length > 0) { + this.callbacks.reportMessage(CompilerMessages.Error_PackageCannotContainBothModelsAndKeyboards()); + return false; + } + + if(!kmpJson.lexicalModels?.length && !kmpJson.keyboards?.length) { + // Note: we require at least 1 keyboard or model in the package. This may + // change in the future if we start to use packages to distribute, e.g. + // localizations or themes. + this.callbacks.reportMessage(CompilerMessages.Error_PackageMustContainAModelOrAKeyboard()); + return false; + } + + + + return true; + } + + private checkLexicalModels(filename: string, kmpJson: KmpJsonFile.KmpJsonFile): boolean { + if(!kmpJson.lexicalModels || kmpJson.lexicalModels.length == 0) { + return true; + } + + filename = this.callbacks.path.basename(filename); + + if(!MODEL_ID_PATTERN_PACKAGE.test(filename)) { + this.callbacks.reportMessage(CompilerMessages.Warn_PackageNameDoesNotFollowLexicalModelConventions({filename})); + } + + for(let model of kmpJson.lexicalModels) { + if(!this.checkForDuplicatedOrNonMinimalLanguages('model', model.id, model.languages)) { + return false; + } + } + + return true; + } + + private checkKeyboards(filename: string, kmpJson: KmpJsonFile.KmpJsonFile): boolean { + if(!kmpJson.keyboards || kmpJson.keyboards.length == 0) { + return true; + } + + filename = this.callbacks.path.basename(filename); + + if(!KEYBOARD_ID_PATTERN_PACKAGE.test(filename)) { + this.callbacks.reportMessage(CompilerMessages.Warn_PackageNameDoesNotFollowKeyboardConventions({filename})); + } + + for(let keyboard of kmpJson.keyboards) { + if(!this.checkForDuplicatedOrNonMinimalLanguages('keyboard', keyboard.id, keyboard.languages)) { + return false; + } + } + + return true; + } + + private checkContentFiles(kmpJson: KmpJsonFile.KmpJsonFile): boolean { + for(let file of kmpJson.files) { + if(!this.checkContentFile(file)) { + return false; + } + } + + return true; + } + + private checkContentFile(file: KmpJsonFile.KmpJsonFileContentFile): boolean { + const filename = this.callbacks.path.basename(file.name); + const ext = this.callbacks.path.extname(filename); + const base = filename.substring(0, filename.length-ext.length); + if(!CONTENT_FILE_BASENAME_PATTERN.test(base) || !CONTENT_FILE_EXTENSION_PATTERN.test(ext)) { + this.callbacks.reportMessage(CompilerMessages.Warn_FileInPackageDoesNotFollowFilenameConventions({filename})); + } + + if(!this.checkIfContentFileIsDangerous(file)) { + return false; + } + + return true; + } + + private checkIfContentFileIsDangerous(file: KmpJsonFile.KmpJsonFileContentFile): boolean { + let filename = this.callbacks.path.basename(file.name).toLowerCase(); + if(keymanForWindowsInstallerFiles.includes(filename) || + keymanForWindowsRedistFiles.includes(filename) || + keymanEngineForWindowsFiles.includes(filename)) { + this.callbacks.reportMessage(CompilerMessages.Warn_RedistFileShouldNotBeInPackage({filename})); + } + if(filename.match(/\.doc(x?)$/)) { + this.callbacks.reportMessage(CompilerMessages.Warn_DocFileDangerous({filename})); + } + return true; + } + + private checkPackageInfo(file: KmpJsonFile.KmpJsonFile) { + if(!file.info || !file.info.name || !file.info.name.description.trim()) { + this.callbacks.reportMessage(CompilerMessages.Error_PackageNameCannotBeBlank()); + return false; + } + + return true; + } +} diff --git a/developer/src/kmc-package/src/compiler/package-version-validation.ts b/developer/src/kmc-package/src/compiler/package-version-validation.ts new file mode 100644 index 0000000000000000000000000000000000000000..ffd7565912dfbfedadb75758c040633e733bd1f5 --- /dev/null +++ b/developer/src/kmc-package/src/compiler/package-version-validation.ts @@ -0,0 +1,139 @@ +import { KmpJsonFile, CompilerCallbacks, KpsFile, KmxFileReader, KMX } from '@keymanapp/common-types'; +import { CompilerMessages } from './messages.js'; + +export class PackageVersionValidation { + + constructor(private callbacks: CompilerCallbacks) {} + + /** + * Verifies version information in corresponding keyboards and updates kmpJson + * metadata as the version information can be out of sync in the .kps file + * after updating a contained keyboard. + * @param kpsFilename + * @param kps + * @param kmp + * @returns + */ + public validateAndUpdateVersions(kpsFilename: string, kps: KpsFile.KpsFile, kmp: KmpJsonFile.KmpJsonFile) { + const followKeyboardVersion = kps.options?.followKeyboardVersion !== undefined; + + if(followKeyboardVersion) { + if(!this.checkFollowKeyboardVersion(kps, kmp)) { + return false; + } + } + + if(!kmp.keyboards) { + // Lexical models don't have version metadata; only their packages. + return true; + } + + let result = true; + + // We now know we have at least one keyboard in the package + + for(let keyboard of kmp.keyboards) { + result = this.updateKeyboardVersionFromKmx(kpsFilename, kmp, keyboard) && result; + if(result) { + if(kmp.keyboards[0].version !== keyboard.version) { + this.callbacks.reportMessage(CompilerMessages.Warn_KeyboardVersionsDoNotMatch({ + keyboard:keyboard.id, + version:keyboard.version, + firstKeyboard:kmp.keyboards[0].id, + firstVersion:kmp.keyboards[0].version + })); + } + } + } + + if(result) { + if(followKeyboardVersion) { + kmp.info.version.description = kmp.keyboards[0].version; + } + else if(kmp.info.version?.description != kmp.keyboards[0].version) { + // Only need to compare against first keyboard as we compare keyboards above + this.callbacks.reportMessage(CompilerMessages.Warn_KeyboardVersionsDoNotMatchPackageVersion({ + keyboard: kmp.keyboards[0].id, + keyboardVersion: kmp.keyboards[0].version, + packageVersion: kmp.info.version?.description + })); + } + } + + return result; + } + + private checkFollowKeyboardVersion(kps: KpsFile.KpsFile, kmp: KmpJsonFile.KmpJsonFile) { + // Lexical model packages do not allow FollowKeyboardVersion + if(kmp.lexicalModels && kmp.lexicalModels.length) { + this.callbacks.reportMessage(CompilerMessages.Error_FollowKeyboardVersionNotAllowedForModelPackages()); + return false; + } + + if(!kmp.keyboards || !kmp.keyboards.length) { + this.callbacks.reportMessage(CompilerMessages.Error_FollowKeyboardVersionButNoKeyboards()); + return false; + } + + return true; + } + + private updateKeyboardVersionFromKmx( + kpsFilename: string, + kmp: KmpJsonFile.KmpJsonFile, + keyboard: KmpJsonFile.KmpJsonFileKeyboard + ): boolean { + // The DEFAULT_VERSION used to be '1.0', but we now use '0.0' to allow + // pre-release 0.x keyboards to be considered later than a keyboard without + // any version metadata at all. + const DEFAULT_VERSION = '0.0'; + + // Note: there is often version metadata in the .kps element, but + // we don't read from the metadata because we want to ensure we have the + // most up-to-date keyboard version data here, from the compiled keyboard. + + // Reset the keyboard version to the default in the kmp.json metadata, for + // warning/failure code paths in this file + keyboard.version = DEFAULT_VERSION; + + const file = kmp.files.find(file => this.callbacks.path.basename(file.name, '.kmx') == keyboard.id); + if(!file) { + this.callbacks.reportMessage(CompilerMessages.Error_KeyboardContentFileNotFound({id:keyboard.id})); + return false; + } + + const filename = this.callbacks.resolveFilename(kpsFilename, file.name); + if(!this.callbacks.fs.existsSync(filename)) { + this.callbacks.reportMessage(CompilerMessages.Error_KeyboardFileNotFound({filename})); + return false; + } + + // + // load the .kmx and extract the version number + // + let kmxFileData; + try { + kmxFileData = this.callbacks.loadFile(filename); + } catch(e) { + this.callbacks.reportMessage(CompilerMessages.Error_FileCouldNotBeRead({filename, e})); + return false; + } + const kmxReader: KmxFileReader = new KmxFileReader(); + const kmx: KMX.KEYBOARD = kmxReader.read(kmxFileData); + if(!kmx) { + // The file couldn't be read, it might not be a .kmx file + this.callbacks.reportMessage(CompilerMessages.Error_KeyboardFileNotValid({filename})); + return false; + } + + const store = kmx.stores.find(store => store.dwSystemID == KMX.KMXFile.TSS_KEYBOARDVERSION); + if(!store) { + // We have no version number store, so use default version + this.callbacks.reportMessage(CompilerMessages.Info_KeyboardFileHasNoKeyboardVersion({filename})); + return true; + } + + keyboard.version = store.dpString; + return true; + } +} diff --git a/developer/src/kmc-package/src/compiler/redist-files.ts b/developer/src/kmc-package/src/compiler/redist-files.ts new file mode 100644 index 0000000000000000000000000000000000000000..9fccb32944a9aaa8d6d38dde47d70c7b0681c704 --- /dev/null +++ b/developer/src/kmc-package/src/compiler/redist-files.ts @@ -0,0 +1,64 @@ + +/** + * This is a set of known redistributable files for Keyman for Windows that + * should not be included in packages. It is not critical that this list matches + * the current deployment; it is just for warning against accidental inclusion + * of these files by package authors. Some redistributable files have been + * intentionally excluded because they could legitimately be a different file + * with the same name. + * + * This matches behaviour from the legacy package compiler; we may want to + * reconsider how this is done in the future. + * + * These lists have been constructed from 17.0.109 alpha build. Filenames + * intentionally in lower case. + */ + +export const + keymanForWindowsInstallerFiles: string[] = [ + 'keymandesktop.msi', + 'keymanengine.msm' + ]; + + +export const + keymanEngineForWindowsFiles: string[] = [ + 'base.xslt', + 'crashpad_handler.exe', + 'keyman-debug-etw.man', + 'keyman.exe', + 'keyman32.dll', + 'keyman64.dll', + 'keymanmc.dll', + 'keymanx64.exe', + 'kmcomapi.dll', + 'kmcomapi.x64.dll', + 'kmrefresh.x64.exe', + 'kmrefresh.x86.exe', + 'kmtip.dll', + 'kmtip64.dll', + 'mcompile.exe', + 'sentry.dll', + 'sentry.x64.dll', + 'si_browsers.xslt', + 'si_fonts.xslt', + 'si_hookdlls.xslt', + 'si_keyman.xslt', + 'si_language.xslt', + 'si_office.xslt', + 'si_overview.xslt', + 'si_processes.xslt', + 'si_processes_x64.xslt', + 'si_startup.xslt', + 'tsysinfo.exe', + ]; + +export const + keymanForWindowsRedistFiles: string[] = [ + 'desktop_resources.dll', + 'keymandesktop.chm', + 'kmbrowserhost.exe', + 'kmconfig.exe', + 'kmshell.exe', + 'unicodedata.mdb', + ]; diff --git a/developer/src/kmc-package/src/main.ts b/developer/src/kmc-package/src/main.ts new file mode 100644 index 0000000000000000000000000000000000000000..5903a59de3055ef20bf5ac4b086c43f72d840ba7 --- /dev/null +++ b/developer/src/kmc-package/src/main.ts @@ -0,0 +1,2 @@ +export { KmpCompiler } from "./compiler/kmp-compiler.js"; +export { PackageValidation } from "./compiler/package-validation.js"; \ No newline at end of file diff --git a/developer/src/kmc-package/test/fixtures/absolute_path/source/absolute_path.kps b/developer/src/kmc-package/test/fixtures/absolute_path/source/absolute_path.kps new file mode 100644 index 0000000000000000000000000000000000000000..e7c4a8b8512ddf02f8d0e47094638a66cba3679a --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/absolute_path/source/absolute_path.kps @@ -0,0 +1,29 @@ + + + + 15.0.266.0 + 7.0 + + + + + + + + + + + + + + Absolute Path + + + + \build\absolute_path.kmx + File absolute_path.kmx + 0 + .kmx + + + diff --git a/developer/src/kmc-package/test/fixtures/binary_kvk_file/source/binary_kvk_file.kps b/developer/src/kmc-package/test/fixtures/binary_kvk_file/source/binary_kvk_file.kps new file mode 100644 index 0000000000000000000000000000000000000000..a95f5c6fe169f68d7e0c86e786ceaa1fee3abdca --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/binary_kvk_file/source/binary_kvk_file.kps @@ -0,0 +1,46 @@ + + + + 15.0.266.0 + 7.0 + + + + + + + + + + + + + + Binary KVK File + 1.3 + + + + binary_kvk_file.kvk + File binary_kvk_file.kvk + 0 + .kvk + + + ../../invalid/khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Khmer + + + + diff --git a/developer/src/kmc-package/test/fixtures/binary_kvk_file/source/binary_kvk_file.kvk b/developer/src/kmc-package/test/fixtures/binary_kvk_file/source/binary_kvk_file.kvk new file mode 100644 index 0000000000000000000000000000000000000000..c64b3a5a544dc64ab3dcfd44a6875ea5f339b878 Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/binary_kvk_file/source/binary_kvk_file.kvk differ diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.js b/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.js similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.js rename to developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.js diff --git a/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.intermediate.json b/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.intermediate.json new file mode 100644 index 0000000000000000000000000000000000000000..3a683626fa31daa440d76e212d1ce538a4e6e3c1 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.intermediate.json @@ -0,0 +1,48 @@ +{ + "system": { + "keymanDeveloperVersion": "12.0.1500.0", + "fileVersion": "12.0" + }, + "options": {}, + "info": { + "author": { + "description": "Eddie Antonio Santos", + "url": "mailto:Eddie.Santos@nrc-cnrc.gc.ca" + }, + "copyright": { + "description": "© 2019 National Research Council Canada" + }, + "name": { + "description": "SENĆOŦEN (Saanich Dialect) Lexical Model" + }, + "version": { + "description": "1.0.3" + } + }, + "files": [ + { + "name": "example.qaa.sencoten.model.js", + "description": "Lexical model example.qaa.sencoten.model.js" + }, + { + "description": "Package information (JSON)", + "name": "kmp.json" + } + ], + "lexicalModels": [ + { + "name": "SENĆOŦEN dictionary", + "id": "example.qaa.sencoten", + "languages": [ + { + "name": "North Straits Salish", + "id": "qaa" + }, + { + "name": "SENĆOŦEN", + "id": "qaa-Latn" + } + ] + } + ] +} diff --git a/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.json b/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.json new file mode 100644 index 0000000000000000000000000000000000000000..dacbc3ee67ed2c1da7727762e9fd4e56014d8256 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.json @@ -0,0 +1,48 @@ +{ + "system": { + "keymanDeveloperVersion": "12.0.1500.0", + "fileVersion": "12.0" + }, + "options": {}, + "info": { + "author": { + "description": "Eddie Antonio Santos", + "url": "mailto:Eddie.Santos@nrc-cnrc.gc.ca" + }, + "copyright": { + "description": "© 2019 National Research Council Canada" + }, + "name": { + "description": "SENĆOŦEN (Saanich Dialect) Lexical Model" + }, + "version": { + "description": "0.0.0" + } + }, + "files": [ + { + "name": "..\\build\\example.qaa.sencoten.model.js", + "description": "Lexical model example.qaa.sencoten.model.js" + }, + { + "name": "kmp.json", + "description": "Package information (JSON)" + } + ], + "lexicalModels": [ + { + "name": "SENĆOŦEN dictionary", + "id": "example.qaa.sencoten", + "languages": [ + { + "name": "North Straits Salish", + "id": "qaa" + }, + { + "name": "SENĆOŦEN", + "id": "qaa-Latn" + } + ] + } + ] +} \ No newline at end of file diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.zipped.json b/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.zipped.json similarity index 100% rename from developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.zipped.json rename to developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kmp.zipped.json diff --git a/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kps b/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kps new file mode 100644 index 0000000000000000000000000000000000000000..fd5faa8476ee1c3b9616d638dad40384e9b221ee --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kps @@ -0,0 +1,31 @@ + + + + 12.0.1500.0 + 12.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.0.3 + + + + example.qaa.sencoten.model.js + Lexical model example.qaa.sencoten.model.js + 0 + .model.js + + + + + SENĆOŦEN dictionary + example.qaa.sencoten + + North Straits Salish + SENĆOŦEN + + + + diff --git a/developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.ts b/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.ts similarity index 100% rename from developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.ts rename to developer/src/kmc-package/test/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.ts diff --git a/developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/source/wordlist.tsv b/developer/src/kmc-package/test/fixtures/example.qaa.sencoten/wordlist.tsv similarity index 100% rename from developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/source/wordlist.tsv rename to developer/src/kmc-package/test/fixtures/example.qaa.sencoten/wordlist.tsv diff --git a/developer/src/kmc-package/test/fixtures/invalid/WARN_PackageNameDoesNotFollowKeyboardConventions.kps b/developer/src/kmc-package/test/fixtures/invalid/WARN_PackageNameDoesNotFollowKeyboardConventions.kps new file mode 100644 index 0000000000000000000000000000000000000000..867129bac3676d0825d64d1eab50b2423d645727 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/WARN_PackageNameDoesNotFollowKeyboardConventions.kps @@ -0,0 +1,32 @@ + + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/WARN_PackageNameDoesNotFollowLexicalModelConventions.kps b/developer/src/kmc-package/test/fixtures/invalid/WARN_PackageNameDoesNotFollowLexicalModelConventions.kps new file mode 100644 index 0000000000000000000000000000000000000000..674ad85a2f055e9cf87e944bc9d4198469b77f4c --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/WARN_PackageNameDoesNotFollowLexicalModelConventions.kps @@ -0,0 +1,32 @@ + + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.0.3 + + + + example.qaa.sencoten.model.js + Lexical model example.qaa.sencoten.model.js + 0 + .model.js + + + + + SENĆOŦEN dictionary + example.qaa.sencoten + + North Straits Salish + SENĆOŦEN + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/error_language_tag_is_not_valid.kps b/developer/src/kmc-package/test/fixtures/invalid/error_language_tag_is_not_valid.kps new file mode 100644 index 0000000000000000000000000000000000000000..3c47540d2b1d6742c75af554ea56caa42e812c7a --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/error_language_tag_is_not_valid.kps @@ -0,0 +1,32 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + + English (Australian script) as spoken in Latin + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/error_package_cannot_contain_both_models_and_keyboards.kps b/developer/src/kmc-package/test/fixtures/invalid/error_package_cannot_contain_both_models_and_keyboards.kps new file mode 100644 index 0000000000000000000000000000000000000000..5ee547dcf1ead34086979570c7f772c7e2a23ad5 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/error_package_cannot_contain_both_models_and_keyboards.kps @@ -0,0 +1,49 @@ + + + + 15.0.266.0 + 7.0 + + + Khmer Angkor + © 2015-2022 SIL International + Makara Sok + 1.3 + https://keyman.com/keyboards/khmer_angkor + + + + khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + example.qaa.sencoten.model.js + Lexical model example.qaa.sencoten.model.js + 0 + .model.js + + + + + + SENĆOŦEN dictionary + example.qaa.sencoten + + North Straits Salish + SENĆOŦEN + + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/error_package_must_contain_a_model_or_a_keyboard.kps b/developer/src/kmc-package/test/fixtures/invalid/error_package_must_contain_a_model_or_a_keyboard.kps new file mode 100644 index 0000000000000000000000000000000000000000..335201a6e5b0d47456237139691a32e24175bddd --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/error_package_must_contain_a_model_or_a_keyboard.kps @@ -0,0 +1,21 @@ + + + + 15.0.266.0 + 7.0 + + + error_package_must_contain_a_model_or_a_keyboard + 1.3 + + + + + khmer_angkor.kmn + Keyboard Khmer Angkor + 0 + .kmn + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/error_package_name_cannot_be_blank.kps b/developer/src/kmc-package/test/fixtures/invalid/error_package_name_cannot_be_blank.kps new file mode 100644 index 0000000000000000000000000000000000000000..870d8ae55b81b3c97c1ea08a71244d16bb354004 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/error_package_name_cannot_be_blank.kps @@ -0,0 +1,32 @@ + + + + 15.0.266.0 + 7.0 + + + + + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/error_package_name_cannot_be_blank_2.kps b/developer/src/kmc-package/test/fixtures/invalid/error_package_name_cannot_be_blank_2.kps new file mode 100644 index 0000000000000000000000000000000000000000..01eba9981d2b0d5d04db00c85e84fbdff97a627b --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/error_package_name_cannot_be_blank_2.kps @@ -0,0 +1,31 @@ + + + + 15.0.266.0 + 7.0 + + + + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/followkeyboardversion.empty.kps b/developer/src/kmc-package/test/fixtures/invalid/followkeyboardversion.empty.kps new file mode 100644 index 0000000000000000000000000000000000000000..955cf8a05351e801f229c37f88c197d4b7518d73 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/followkeyboardversion.empty.kps @@ -0,0 +1,24 @@ + + + + 15.0.266.0 + 7.0 + + + + + + + + + + + + + + + FollowKeyboardVersion with no keyboards + + + + diff --git a/developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kps b/developer/src/kmc-package/test/fixtures/invalid/followkeyboardversion.qaa.sencoten.model.kps similarity index 93% rename from developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kps rename to developer/src/kmc-package/test/fixtures/invalid/followkeyboardversion.qaa.sencoten.model.kps index e93266d48c9cf8ca97cabdcf19f71d4733a24203..f6dfae7119de8ebba69c8592b5cdf3d31c9336aa 100644 --- a/developer/src/kmlmc/tests/fixtures/example.qaa.sencoten/example.qaa.sencoten.model.kps +++ b/developer/src/kmc-package/test/fixtures/invalid/followkeyboardversion.qaa.sencoten.model.kps @@ -5,6 +5,7 @@ 12.0 + @@ -25,7 +26,6 @@ SENĆOŦEN dictionary example.qaa.sencoten - 1.0.3 North Straits Salish SENĆOŦEN diff --git a/developer/src/kmc-package/test/fixtures/invalid/keyboardcontentfilenotfound.kps b/developer/src/kmc-package/test/fixtures/invalid/keyboardcontentfilenotfound.kps new file mode 100644 index 0000000000000000000000000000000000000000..cfcd52789453f18921025aa19b9f773280ee8ac8 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/keyboardcontentfilenotfound.kps @@ -0,0 +1,128 @@ + + + + 15.0.266.0 + 7.0 + + + + readme.htm + splash.gif + + + + + + + + + + Khmer Angkor + © 2015-2022 SIL International + Makara Sok + + https://keyman.com/keyboards/khmer_angkor + + + + + ..\build\khmer_angkor.js + File khmer_angkor.js + 0 + .js + + + ..\build\khmer_angkor.kvk + File khmer_angkor.kvk + 0 + .kvk + + + welcome\keyboard_layout.png + File keyboard_layout.png + 0 + .png + + + welcome\welcome.htm + File welcome.htm + 0 + .htm + + + ..\shared\fonts\khmer\mondulkiri\FONTLOG.txt + File FONTLOG.txt + 0 + .txt + + + ..\shared\fonts\khmer\mondulkiri\Mondulkiri-R.ttf + Font Khmer Mondulkiri + 0 + .ttf + + + ..\shared\fonts\khmer\mondulkiri\OFL.txt + File OFL.txt + 0 + .txt + + + ..\shared\fonts\khmer\mondulkiri\OFL-FAQ.txt + File OFL-FAQ.txt + 0 + .txt + + + welcome\KAK_Documentation_EN.pdf + File KAK_Documentation_EN.pdf + 0 + .pdf + + + welcome\KAK_Documentation_KH.pdf + File KAK_Documentation_KH.pdf + 0 + .pdf + + + readme.htm + File readme.htm + 0 + .htm + + + welcome\image002.png + File image002.png + 0 + .png + + + ..\shared\fonts\khmer\busrakbd\khmer_busra_kbd.ttf + Font KhmerBusraKbd + 0 + .ttf + + + splash.gif + File splash.gif + 0 + .gif + + + + + Khmer Angkor + khmer_angkor + 1.3 + ..\shared\fonts\khmer\busrakbd\khmer_busra_kbd.ttf + ..\shared\fonts\khmer\mondulkiri\Mondulkiri-R.ttf + + Central Khmer (Khmer, Cambodia) + + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/keyboardfilenotfound.kps b/developer/src/kmc-package/test/fixtures/invalid/keyboardfilenotfound.kps new file mode 100644 index 0000000000000000000000000000000000000000..cf6e49053a507a1e98ee8125e4b94c23ec08d924 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/keyboardfilenotfound.kps @@ -0,0 +1,41 @@ + + + + 15.0.266.0 + 7.0 + + + + + + + + + + Khmer Angkor + © 2015-2022 SIL International + Makara Sok + + https://keyman.com/keyboards/khmer_angkor + + + + + keyboardfilenotfound.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + keyboardfilenotfound + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/keyboardfilenotvalid.kmx b/developer/src/kmc-package/test/fixtures/invalid/keyboardfilenotvalid.kmx new file mode 100644 index 0000000000000000000000000000000000000000..93b44e9d16e3ec69bf9ed5e6d41d5d1af3d44989 Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/invalid/keyboardfilenotvalid.kmx differ diff --git a/developer/src/kmc-package/test/fixtures/invalid/keyboardfilenotvalid.kps b/developer/src/kmc-package/test/fixtures/invalid/keyboardfilenotvalid.kps new file mode 100644 index 0000000000000000000000000000000000000000..37dbc27a664169ade8feb3817cc7866750a1fd7e --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/keyboardfilenotvalid.kps @@ -0,0 +1,41 @@ + + + + 15.0.266.0 + 7.0 + + + + + + + + + + Khmer Angkor + © 2015-2022 SIL International + Makara Sok + + https://keyman.com/keyboards/khmer_angkor + + + + + keyboardfilenotvalid.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + keyboardfilenotvalid + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/keyman.en.error_must_have_at_least_one_language.model.kps b/developer/src/kmc-package/test/fixtures/invalid/keyman.en.error_must_have_at_least_one_language.model.kps new file mode 100644 index 0000000000000000000000000000000000000000..b79330f06f1ec885b6e5a55f6d2901c7086a39f2 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/keyman.en.error_must_have_at_least_one_language.model.kps @@ -0,0 +1,28 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.0.3 + + + + example.qaa.sencoten.model.js + Lexical model example.qaa.sencoten.model.js + 0 + .model.js + + + + + SENĆOŦEN dictionary + example.qaa.sencoten + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/keyman.en.warn_package_should_not_repeat_languages.model.kps b/developer/src/kmc-package/test/fixtures/invalid/keyman.en.warn_package_should_not_repeat_languages.model.kps new file mode 100644 index 0000000000000000000000000000000000000000..0fdb270321410e75782c9498017cebc42496902a --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/keyman.en.warn_package_should_not_repeat_languages.model.kps @@ -0,0 +1,33 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.0.3 + + + + example.qaa.sencoten.model.js + Lexical model example.qaa.sencoten.model.js + 0 + .model.js + + + + + SENĆOŦEN dictionary + example.qaa.sencoten + + North Straits Salish + + Salish Again + SENĆOŦEN + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/khmer_angkor.kmx b/developer/src/kmc-package/test/fixtures/invalid/khmer_angkor.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c3d0289f4863c7c4a998c348eb1d425caadca79d Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/invalid/khmer_angkor.kmx differ diff --git a/developer/src/kmc-package/test/fixtures/invalid/my special keyboard.kmx b/developer/src/kmc-package/test/fixtures/invalid/my special keyboard.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c3d0289f4863c7c4a998c348eb1d425caadca79d Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/invalid/my special keyboard.kmx differ diff --git a/developer/src/kmc-package/test/fixtures/invalid/my_special-keyboard.kmx b/developer/src/kmc-package/test/fixtures/invalid/my_special-keyboard.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c3d0289f4863c7c4a998c348eb1d425caadca79d Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/invalid/my_special-keyboard.kmx differ diff --git a/developer/src/kmc-package/test/fixtures/invalid/nokeyboardversion.kmn b/developer/src/kmc-package/test/fixtures/invalid/nokeyboardversion.kmn new file mode 100644 index 0000000000000000000000000000000000000000..4fdd8a62f32d26814daf16079813b6010729ee07 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/nokeyboardversion.kmn @@ -0,0 +1,3 @@ +store(&NAME) "nokeyboardversion" +store(&VERSION) "10.0" +c no &keyboardversion store! \ No newline at end of file diff --git a/developer/src/kmc-package/test/fixtures/invalid/nokeyboardversion.kmx b/developer/src/kmc-package/test/fixtures/invalid/nokeyboardversion.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0cf77b0cbbceed2664457d5f2590ad54b410a207 Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/invalid/nokeyboardversion.kmx differ diff --git a/developer/src/kmc-package/test/fixtures/invalid/nokeyboardversion.kps b/developer/src/kmc-package/test/fixtures/invalid/nokeyboardversion.kps new file mode 100644 index 0000000000000000000000000000000000000000..56cd7e3e58939ea06528de4f42e36a2f0837593d --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/nokeyboardversion.kps @@ -0,0 +1,40 @@ + + + + 15.0.266.0 + 7.0 + + + + + + + + + + Khmer Angkor + © 2015-2022 SIL International + Makara Sok + + https://keyman.com/keyboards/khmer_angkor + + + + nokeyboardversion.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + nokeyboardversion + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/version_four.kmn b/developer/src/kmc-package/test/fixtures/invalid/version_four.kmn new file mode 100644 index 0000000000000000000000000000000000000000..cb2cce5816df350bfcc819ec8b902ab7c09aa01e --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/version_four.kmn @@ -0,0 +1,6 @@ +store(&name) 'version 4' +store(&keyboardversion) '4.0' + +begin unicode > use(main) + +group(main) using keys \ No newline at end of file diff --git a/developer/src/kmc-package/test/fixtures/invalid/version_four.kmx b/developer/src/kmc-package/test/fixtures/invalid/version_four.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7180460e961b26b2bbb372c70302c0d8f77934f8 Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/invalid/version_four.kmx differ diff --git a/developer/src/kmc-package/test/fixtures/invalid/warn_doc_file_dangerous.kps b/developer/src/kmc-package/test/fixtures/invalid/warn_doc_file_dangerous.kps new file mode 100644 index 0000000000000000000000000000000000000000..045e14b740c0611550baacf8746279aee6be84ea --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/warn_doc_file_dangerous.kps @@ -0,0 +1,38 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + khmer_angkor.docx + Documentation + 0 + .docx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Khmer + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/warn_file_in_package_does_not_follow_filename_conventions.kps b/developer/src/kmc-package/test/fixtures/invalid/warn_file_in_package_does_not_follow_filename_conventions.kps new file mode 100644 index 0000000000000000000000000000000000000000..6523df4813ef75f66770085fdc79a5923cfe0af2 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/warn_file_in_package_does_not_follow_filename_conventions.kps @@ -0,0 +1,32 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + + my special keyboard.kmx + Keyboard my special keyboard + 0 + .kmx + + + + + Khmer Angkor + my special keyboard + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/warn_file_in_package_does_not_follow_filename_conventions_2.kps b/developer/src/kmc-package/test/fixtures/invalid/warn_file_in_package_does_not_follow_filename_conventions_2.kps new file mode 100644 index 0000000000000000000000000000000000000000..d29a01c580139f3582c285d05b5e24e1f8ff4e4c --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/warn_file_in_package_does_not_follow_filename_conventions_2.kps @@ -0,0 +1,39 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + + my_file.PDF + My Documentation + 0 + .PDF + + + + khmer_angkor.kmx + Keyboard my special keyboard + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/warn_keyboard_versions_do_not_match.kps b/developer/src/kmc-package/test/fixtures/invalid/warn_keyboard_versions_do_not_match.kps new file mode 100644 index 0000000000000000000000000000000000000000..2eb09374c6ee134c8cf6980932857e25eb70d8dd --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/warn_keyboard_versions_do_not_match.kps @@ -0,0 +1,45 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + version_four.kmx + Keyboard Version Four + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Khmer + + + + Version 4 + version_four + 4.0 + + Khmer + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/warn_keyboard_versions_do_not_match_package_version.kps b/developer/src/kmc-package/test/fixtures/invalid/warn_keyboard_versions_do_not_match_package_version.kps new file mode 100644 index 0000000000000000000000000000000000000000..fe0276104bd72f7cfbec0a5698e11efd38274d7d --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/warn_keyboard_versions_do_not_match_package_version.kps @@ -0,0 +1,31 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + version_four.kmx + Keyboard Version Four + 0 + .kmx + + + + + Version 4 + version_four + 4.0 + + Khmer + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/warn_language_tag_is_not_minimal.kps b/developer/src/kmc-package/test/fixtures/invalid/warn_language_tag_is_not_minimal.kps new file mode 100644 index 0000000000000000000000000000000000000000..8e4440e3da3e290bfa927a489679b1d0ce9f5733 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/warn_language_tag_is_not_minimal.kps @@ -0,0 +1,32 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + + Central Khmer (Khmer, Cambodia) + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/warn_package_should_not_repeat_languages.kps b/developer/src/kmc-package/test/fixtures/invalid/warn_package_should_not_repeat_languages.kps new file mode 100644 index 0000000000000000000000000000000000000000..a1c6cffe9f2461aa002fc35de8b17c1cf81e15b7 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/warn_package_should_not_repeat_languages.kps @@ -0,0 +1,33 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + + Central Khmer (Khmer, Cambodia) + Khmer + + + + diff --git a/developer/src/kmc-package/test/fixtures/invalid/warn_redist_file_should_not_be_in_package.kps b/developer/src/kmc-package/test/fixtures/invalid/warn_redist_file_should_not_be_in_package.kps new file mode 100644 index 0000000000000000000000000000000000000000..1b5d1e246dc3b5af9210e95f8da5de1373f7a609 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/invalid/warn_redist_file_should_not_be_in_package.kps @@ -0,0 +1,38 @@ + + + + 15.0.266.0 + 7.0 + + + SENĆOŦEN (Saanich Dialect) Lexical Model + © 2019 National Research Council Canada + Eddie Antonio Santos + 1.3 + + + + khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + keyman.exe + Keyman Program + 0 + .exe + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Khmer + + + + diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/build/khmer_angkor.js b/developer/src/kmc-package/test/fixtures/khmer_angkor/build/khmer_angkor.js new file mode 100644 index 0000000000000000000000000000000000000000..4ee51e4d3e6b49069ddd0cabe1d7ccd49eb350cc --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/khmer_angkor/build/khmer_angkor.js @@ -0,0 +1 @@ +if(typeof keyman === 'undefined') {console.log('Keyboard requires KeymanWeb 10.0 or later');if(typeof tavultesoft !== 'undefined') tavultesoft.keymanweb.util.alert("This keyboard requires KeymanWeb 10.0 or later");} else {KeymanWeb.KR(new Keyboard_khmer_angkor());}function Keyboard_khmer_angkor(){this._v=(typeof keyman!="undefined"&&typeof keyman.version=="string")?parseInt(keyman.version,10):9;this.KI="Keyboard_khmer_angkor";this.KN="Khmer Angkor";this.KMINVER="10.0";this.KV={F:' 1em "Khmer Busra Kbd"',K102:0};this.KV.KLS={"rightalt": ["‍","‌","@","","$","€","៙","៚","*","{","}","≈","","","","","ៜ","","ឯ","ឫ","ឨ","[","]","ឦ","ឱ","ឰ","ឩ","ឳ","\\","","","","+","-","×","÷",":","‘","’","ឝ","៘","៖","ៈ","","","","","","","<",">","#","&","ឞ",";","",",",".","/","","","","",""," "],"rightalt-shift": ["","៱","៲","៳","៴","៵","៶","៷","៸","៹","៰","","","","","","᧠","᧡","᧢","᧣","᧤","᧥","᧦","᧧","᧨","᧩","᧪","᧫","","","","","᧬","᧭","᧮","᧯","᧰","᧱","᧲","᧳","᧴","᧵","᧶","","","","","","","᧷","᧸","᧹","᧺","᧻","᧼","᧽","᧾","᧿","","","","","","",""],"default": ["«","១","២","៣","៤","៥","៦","៧","៨","៩","០","ឥ","ឲ","","","","ឆ","","","រ","ត","យ","","","","ផ","","ឪ","ឮ","","","","","ស","ដ","ថ","ង","ហ","","ក","ល","","","","","","","","","ឋ","ខ","ច","វ","ប","ន","ម","","។","","","","","","","​"],"shift": ["»","!","ៗ","\"","៛","%","","","","(",")","","=","","","","ឈ","","","ឬ","ទ","","","","","ភ","","ឧ","ឭ","","","","","","ឌ","ធ","អ","ះ","ញ","គ","ឡ","","","","","","","","","ឍ","ឃ","ជ","","ព","ណ","","","៕","?","","","","","",""]};this.KV.BK=(function(x){var e=Array.apply(null,Array(65)).map(String.prototype.valueOf,""),r=[],v,i,m=['default','shift','ctrl','shift-ctrl','alt','shift-alt','ctrl-alt','shift-ctrl-alt'];for(i=m.length-1;i>=0;i--)if((v=x[m[i]])||r.length)r=(v?v:e).slice().concat(r);return r})(this.KV.KLS);this.KDU=0;this.KH='';this.KM=0;this.KBVER="1.3";this.KMBM=0x0018;this.KVKD="T_17D2_1780 T_17D2_1781 T_17D2_1782 T_17D2_1783 T_17D2_1784 T_17D2_1785 T_17D2_1786 T_17D2_1787 T_17D2_1788 T_17D2_1789 T_17D2_178A T_17D2_178B T_17D2_178C T_17D2_178D T_17D2_178E T_17D2_178F T_17D2_1790 T_17D2_1791 T_17D2_1792 T_17D2_1793 T_17D2_1794 T_17D2_1795 T_17D2_1796 T_17D2_1797 T_17D2_1798 T_17D2_1799 T_17D2_179A T_17D2_179B T_17D2_179C T_17D2_179D T_17D2_179E T_17D2_179F T_17D2_17A0 T_17D2_17A1 T_17D2_17A2 U_0030 U_0031 U_0032 U_0033 U_0034 U_0035 U_0036 U_0037 U_0038 U_0039";this.KVKL={"phone":{"font":"Khmer Busra Kbd","fontsize":"0.8em","displayUnderlying":false,"layer":[{"id":"default","row":[{"id":"1","key":[{"id":"K_Q","text":"\u1786","sk":[{"layer":"shift","id":"K_Q","text":"\u1788"},{"id":"T_17D2_1786","text":"\uEF86"},{"id":"T_17D2_1788","text":"\uEF88"}]},{"id":"K_W","text":"\uEFB9","sk":[{"layer":"shift","id":"K_W","text":"\uEFBA"}]},{"id":"K_E","text":"\uEFC1","sk":[{"layer":"shift","id":"K_E","text":"\uEFC2"},{"layer":"shift","id":"K_S","text":"\uEFC3"},{"layer":"shift","id":"K_V","text":"\uEF12"},{"id":"U_17AF","text":"\u17AF"},{"id":"U_17B0","text":"\u17B0"}]},{"id":"K_R","text":"\u179A","sk":[{"id":"T_17D2_179A","text":"\uEF9A"},{"id":"U_17AB","text":"\u17AB"},{"id":"U_17AC","text":"\u17AC"}]},{"id":"K_T","text":"\u178F","sk":[{"layer":"shift","id":"K_T","text":"\u1791"},{"id":"T_17D2_178F","text":"\uEF8F"},{"layer":"default","id":"T_17D2_1791","text":"\uEF91"}]},{"id":"K_Y","text":"\u1799","sk":[{"id":"T_17D2_1799","text":"\uEF99"}]},{"id":"K_U","text":"\uEFBB","sk":[{"layer":"shift","id":"K_U","text":"\uEFBC"},{"layer":"shift","id":"K_Y","text":"\uEFBD"},{"id":"U_17A7","text":"\u17A7"},{"layer":"shift","id":"U_17AA","text":"\u17AA"},{"layer":"shift","id":"U_17A9","text":"\u17A9"},{"id":"U_17A8","text":"\u17A8"}]},{"id":"K_I","text":"\uEFB7","sk":[{"layer":"shift","id":"K_I","text":"\uEFB8"},{"id":"U_17A5","text":"\u17A5"},{"layer":"shift","id":"U_17A6","text":"\u17A6"}]},{"id":"K_O","text":"\uEFC4","sk":[{"layer":"shift","id":"K_O","text":"\uEFC5"},{"id":"K_LBRKT","text":"\uEFC0"},{"layer":"shift","id":"K_LBRKT","text":"\uEFBF"},{"layer":"shift","id":"K_COLON","text":"\uEF14"},{"id":"U_17B1","text":"\u17B1"},{"id":"U_17B2","text":"\u17B2"},{"layer":"shift","id":"U_17B3","text":"\u17B3"}]},{"id":"K_P","text":"\u1795","sk":[{"layer":"shift","id":"K_P","text":"\u1797"},{"id":"T_17D2_1795","text":"\uEF95"},{"layer":"default","id":"T_17D2_1797","text":"\uEF97"}]}]},{"id":"2","key":[{"width":"100","id":"K_A","text":"\uEFB6","sk":[{"layer":"shift","id":"K_A","text":"\uEF11"}]},{"id":"K_S","text":"\u179F","sk":[{"id":"T_17D2_179F","text":"\uEF9F"},{"id":"U_179D","text":"\u179D"},{"id":"U_179E","text":"\u179E"}]},{"id":"K_D","text":"\u178A","sk":[{"layer":"shift","id":"K_D","text":"\u178C"},{"id":"T_17D2_178A","text":"\uEF8A"},{"layer":"default","id":"T_17D2_178C","text":"\uEF8C"}]},{"id":"K_F","text":"\u1790","sk":[{"layer":"shift","id":"K_F","text":"\u1792"},{"id":"T_17D2_1790","text":"\uEF90"},{"layer":"default","id":"T_17D2_1792","text":"\uEF92"}]},{"id":"K_G","text":"\u1784","sk":[{"layer":"shift","id":"K_G","text":"\u17A2"},{"id":"T_17D2_1784","text":"\uEF84"},{"layer":"default","id":"T_17D2_17A2","text":"\uEFA2"}]},{"id":"K_H","text":"\u17A0","sk":[{"id":"T_17D2_17A0","text":"\uEFA0"},{"layer":"shift","id":"K_H","text":"\u17C7"},{"id":"U_17C8","text":"\u17C8"}]},{"layer":"shift","id":"K_J","text":"\u1789","sk":[{"id":"T_17D2_1789","text":"\uEF89"}]},{"id":"K_K","text":"\u1780","sk":[{"layer":"shift","id":"K_K","text":"\u1782"},{"id":"T_17D2_1780","text":"\uEF80"},{"id":"T_17D2_1782","text":"\uEF82"}]},{"id":"K_L","text":"\u179B","sk":[{"layer":"shift","id":"K_L","text":"\u17A1"},{"id":"T_17D2_179B","text":"\uEF9B"},{"id":"U_17AD","text":"\u17AD"},{"id":"U_17AE","text":"\u17AE"}]},{"id":"K_COLON","text":"\uEFBE"}]},{"id":"3","key":[{"id":"K_Z","text":"\u178B","sk":[{"layer":"shift","id":"K_Z","text":"\u178D"},{"id":"T_17D2_178B","text":"\uEF8B"},{"layer":"default","id":"T_17D2_178D","text":"\uEF8D"}]},{"id":"K_X","text":"\u1781","sk":[{"layer":"shift","id":"K_X","text":"\u1783"},{"id":"T_17D2_1781","text":"\uEF81"},{"layer":"default","id":"T_17D2_1783","text":"\uEF83"}]},{"id":"K_C","text":"\u1785","sk":[{"layer":"shift","id":"K_C","text":"\u1787"},{"id":"T_17D2_1785","text":"\uEF85"},{"layer":"default","id":"T_17D2_1787","text":"\uEF87"}]},{"id":"K_V","text":"\u179C","sk":[{"id":"T_17D2_179C","text":"\uEF9C"}]},{"id":"K_B","text":"\u1794","sk":[{"layer":"shift","id":"K_B","text":"\u1796"},{"id":"T_17D2_1794","text":"\uEF94"},{"layer":"default","id":"T_17D2_1796","text":"\uEF96"}]},{"id":"K_N","text":"\u1793","sk":[{"layer":"shift","id":"K_N","text":"\u178E"},{"id":"T_17D2_1793","text":"\uEF93"},{"layer":"default","id":"T_17D2_178E","text":"\uEF8E"}]},{"id":"K_M","text":"\u1798","sk":[{"id":"T_17D2_1798","text":"\uEF98"},{"layer":"shift","id":"K_M","text":"\uEFC6"}]},{"id":"K_COMMA","text":"\uEF10","sk":[{"layer":"shift","id":"K_COMMA","text":"\uEF13"},{"layer":"shift","id":"K_6","text":"\uEFCD"},{"layer":"shift","id":"K_7","text":"\uEFD0"},{"layer":"shift","id":"K_8","text":"\uEFCF"},{"layer":"shift","id":"K_HYPHEN","text":"\uEFCC"},{"layer":"shift","id":"U_17D1","text":"\uEFD1"},{"layer":"shift","id":"U_17DD","text":"\uEFDD"},{"layer":"shift","id":"U_17CE","text":"\uEFCE"}]},{"width":"100","id":"K_QUOTE","text":"\uEFCB","sk":[{"layer":"shift","id":"K_QUOTE","text":"\uEFC9"},{"id":"K_SLASH","text":"\uEFCA"}]},{"width":"100","id":"K_BKSP","sp":"1","text":"*BkSp*"}]},{"id":"4","key":[{"nextlayer":"numeric","width":"140","id":"K_NUMLOCK","sp":"1","text":"\u17E1\u17E2\u17E3"},{"width":"120","id":"K_LOPT","sp":"1","text":"*Menu*"},{"width":"555","id":"K_SPACE","text":"\u200B","sk":[{"layer":"default","id":"U_0020","text":" "}]},{"width":"120","id":"K_PERIOD","text":"\u17D4","sk":[{"layer":"shift","id":"K_PERIOD","text":"\u17D5"},{"id":"U_0021","text":"!"},{"id":"U_003F","text":"?"}]},{"width":"140","id":"K_ENTER","sp":"1","text":"*Enter*"}]}]},{"id":"numeric","row":[{"id":"1","key":[{"id":"K_1","text":"\u17E1","sk":[{"id":"U_0031","text":"1"}]},{"id":"K_2","text":"\u17E2","sk":[{"id":"U_0032","text":"2"}]},{"id":"K_3","text":"\u17E3","sk":[{"id":"U_0033","text":"3"}]},{"id":"K_4","text":"\u17E4","sk":[{"id":"U_0034","text":"4"}]},{"id":"K_5","text":"\u17E5","sk":[{"id":"U_0035","text":"5"}]},{"id":"K_6","text":"\u17E6","sk":[{"id":"U_0036","text":"6"}]},{"id":"K_7","text":"\u17E7","sk":[{"id":"U_0037","text":"7"}]},{"id":"K_8","text":"\u17E8","sk":[{"id":"U_0038","text":"8"}]},{"id":"K_9","text":"\u17E9","sk":[{"id":"U_0039","text":"9"}]},{"id":"K_0","text":"\u17E0","sk":[{"id":"U_0030","text":"0"},{"id":"U_17D3","text":"\uEFD3"}]}]},{"id":"2","key":[{"id":"U_0040","text":"@","sk":[{"id":"U_00A9","text":"\u00A9"},{"id":"U_00AE","text":"\u00AE"}]},{"id":"U_0023","text":"#","sk":[{"id":"U_2116","text":"\u2116"},{"id":"U_007E","text":"~"}]},{"id":"U_17DB","text":"\u17DB","sk":[{"id":"U_0024","text":"$"},{"id":"U_0E3F","text":"\u0E3F"},{"id":"U_00A2","text":"\u00A2"},{"id":"U_00A3","text":"\u00A3"},{"id":"U_00A5","text":"\u00A5"}]},{"id":"U_0026","text":"&"},{"id":"U_0025","text":"%","sk":[{"id":"U_2030","text":"\u2030"},{"id":"U_2031","text":"\u2031"}]},{"id":"U_002B","text":"+","sk":[{"id":"U_002D","text":"-"},{"id":"U_00D7","text":"\u00D7"},{"id":"U_00F7","text":"\u00F7"},{"id":"U_00B1","text":"\u00B1"}]},{"id":"U_003D","text":"=","sk":[{"id":"U_005F","text":"_"},{"id":"U_2260","text":"\u2260"}]},{"id":"U_002A","text":"*","sk":[{"id":"U_005E","text":"^"}]},{"id":"U_003F","text":"?","sk":[{"id":"U_00BF","text":"\u00BF"}]},{"id":"U_0021","text":"!","sk":[{"id":"U_00A1","text":"\u00A1"}]}]},{"id":"3","key":[{"id":"U_2018","text":"\u2018","sk":[{"id":"U_2019","text":"\u2019"}]},{"id":"U_201C","text":"\u201C","sk":[{"id":"U_201D","text":"\u201D"}]},{"id":"U_00AB","text":"\u00AB","sk":[{"id":"U_00BB","text":"\u00BB"}]},{"id":"U_002F","text":"\/","sk":[{"id":"U_005C","text":"\\"},{"id":"U_007C","text":"|"},{"id":"U_00A6","text":"\u00A6"}]},{"id":"U_0028","text":"(","sk":[{"id":"U_0029","text":")"},{"id":"U_005B","text":"["},{"id":"U_005D","text":"]"},{"id":"U_007B","text":"{"},{"id":"U_007D","text":"}"}]},{"id":"U_17D9","text":"\u17D9","sk":[{"id":"U_17DA","text":"\u17DA"},{"id":"U_17DC","text":"\u17DC"},{"id":"U_00A7","text":"\u00A7"},{"id":"U_00D8","text":"\u00D8"}]},{"id":"U_17D7","text":"\u17D7"},{"id":"U_003C","text":"<","sk":[{"id":"U_2264","text":"\u2264"},{"id":"U_003E","text":">"},{"id":"U_2265","text":"\u2265"}]},{"id":"U_17D6","text":"\u17D6","sk":[{"id":"U_003A","text":":"},{"id":"U_003B","text":";"},{"id":"U_2026","text":"\u2026"}]},{"id":"K_BKSP","sp":"1","text":"*BkSp*"}]},{"id":"4","key":[{"nextlayer":"default","width":"140","id":"K_LCONTROL","sp":"2","text":"\u17E1\u17E2\u17E3"},{"width":"120","id":"K_LOPT","sp":"1","text":"*Menu*"},{"layer":"shift","width":"555","id":"K_SPACE","text":"\u200B"},{"width":"120","id":"K_PERIOD","text":"\u17D4","sk":[{"layer":"shift","id":"K_PERIOD","text":"\u17D5"},{"id":"U_0021","text":"!"},{"id":"U_003F","text":"?"}]},{"width":"140","id":"K_ENTER","sp":"1","text":"*Enter*"}]}]}]},"tablet":{"font":"Khmer Busra Kbd","fontsize":"0.8em","displayUnderlying":false,"layer":[{"id":"default","row":[{"id":"1","key":[{"id":"K_1","text":"\u17E1"},{"id":"K_2","text":"\u17E2"},{"id":"K_3","text":"\u17E3"},{"id":"K_4","text":"\u17E4"},{"id":"K_5","text":"\u17E5"},{"id":"K_6","text":"\u17E6"},{"id":"K_7","text":"\u17E7"},{"id":"K_8","text":"\u17E8"},{"id":"K_9","text":"\u17E9"},{"id":"K_0","text":"\u17E0"},{"id":"K_HYPHEN","text":"\u17A5"},{"id":"K_EQUAL","text":"\u17B2"},{"width":"100","id":"K_BKSP","sp":"1","text":"*BkSp*"}]},{"id":"2","key":[{"id":"K_Q","pad":"75","text":"\u1786"},{"id":"K_W","text":"\uEFB9"},{"id":"K_E","text":"\uEFC1"},{"id":"K_R","text":"\u179A"},{"id":"K_T","text":"\u178F"},{"id":"K_Y","text":"\u1799"},{"id":"K_U","text":"\uEFBB"},{"id":"K_I","text":"\uEFB7"},{"id":"K_O","text":"\uEFC4"},{"id":"K_P","text":"\u1795"},{"id":"K_LBRKT","text":"\uEFC0"},{"id":"K_RBRKT","text":"\u17AA"},{"width":"10","id":"T_new_138","sp":"10"}]},{"id":"3","key":[{"id":"K_BKQUOTE","text":"\u00AB"},{"id":"K_A","text":"\uEFB6"},{"id":"K_S","text":"\u179F"},{"id":"K_D","text":"\u178A"},{"id":"K_F","text":"\u1790"},{"id":"K_G","text":"\u1784"},{"id":"K_H","text":"\u17A0"},{"id":"K_J","text":"\uEFD2"},{"id":"K_K","text":"\u1780"},{"id":"K_L","text":"\u179B"},{"id":"K_COLON","text":"\uEFBE"},{"id":"K_QUOTE","text":"\uEFCB"},{"id":"K_BKSLASH","text":"\u17AE"}]},{"id":"4","key":[{"nextlayer":"shift","width":"160","id":"K_SHIFT","sp":"1","text":"*Shift*"},{"id":"K_oE2"},{"id":"K_Z","text":"\u178B"},{"id":"K_X","text":"\u1781"},{"id":"K_C","text":"\u1785"},{"id":"K_V","text":"\u179C"},{"id":"K_B","text":"\u1794"},{"id":"K_N","text":"\u1793"},{"id":"K_M","text":"\u1798"},{"id":"K_COMMA","text":"\uEF10"},{"id":"K_PERIOD","text":"\u17D4"},{"id":"K_SLASH","text":"\uEFCA"},{"width":"10","id":"T_new_164","sp":"10"}]},{"id":"5","key":[{"nextlayer":"rightalt","width":"160","id":"K_LCONTROL","sp":"1","text":"*AltGr*"},{"width":"160","id":"K_LOPT","sp":"1","text":"*Menu*"},{"width":"930","id":"K_SPACE","text":"\u200B"},{"width":"160","id":"K_ENTER","sp":"1","text":"*Enter*"}]}]},{"id":"rightalt","row":[{"id":"1","key":[{"id":"K_1","text":"\u200C"},{"id":"K_2","text":"@"},{"id":"K_3","text":"\uEFD1"},{"id":"K_4","text":"$"},{"id":"K_5","text":"\u20AC"},{"id":"K_6","text":"\u17D9"},{"id":"K_7","text":"\u17DA"},{"id":"K_8","text":"*"},{"id":"K_9","text":"{"},{"id":"K_0","text":"}"},{"id":"K_HYPHEN","text":"\u2248"},{"id":"K_EQUAL","text":"\uEFCE"},{"width":"100","id":"K_BKSP","sp":"1","text":"*BkSp*"}]},{"id":"2","key":[{"id":"K_Q","pad":"75","text":"\u17DC"},{"id":"K_W","text":"\uEFDD"},{"id":"K_E","text":"\u17AF"},{"id":"K_R","text":"\u17AB"},{"id":"K_T","text":"\u17A8"},{"id":"K_Y","text":"["},{"id":"K_U","text":"]"},{"id":"K_I","text":"\u17A6"},{"id":"K_O","text":"\u17B1"},{"id":"K_P","text":"\u17B0"},{"id":"K_LBRKT","text":"\u17A9"},{"id":"K_RBRKT","text":"\u17B3"},{"width":"10","id":"T_new_307","sp":"10"}]},{"id":"3","key":[{"id":"K_BKQUOTE","text":"\u200D"},{"id":"K_A","text":"+"},{"id":"K_S","text":"-"},{"id":"K_D","text":"\u00D7"},{"id":"K_F","text":"\u00F7"},{"id":"K_G","text":":"},{"id":"K_H","text":"\u2018"},{"id":"K_J","text":"\u2019"},{"id":"K_K","text":"\u179D"},{"id":"K_L","text":"\u17D8"},{"id":"K_COLON","text":"\u17D6"},{"id":"K_QUOTE","text":"\u17C8"},{"id":"K_BKSLASH","text":"\\"}]},{"id":"4","key":[{"nextlayer":"shift","width":"160","id":"K_SHIFT","sp":"1","text":"*Shift*"},{"id":"K_oE2"},{"id":"K_Z","text":"<"},{"id":"K_X","text":">"},{"id":"K_C","text":"#"},{"id":"K_V","text":"&"},{"id":"K_B","text":"\u179E"},{"id":"K_N","text":";"},{"id":"K_M","text":"\uEFD3"},{"id":"K_COMMA","text":","},{"id":"K_PERIOD","text":"."},{"id":"K_SLASH","text":"\/"},{"width":"10","id":"T_new_333","sp":"10"}]},{"id":"5","key":[{"nextlayer":"default","width":"160","id":"K_LCONTROL","sp":"2","text":"*AltGr*"},{"width":"160","id":"K_LOPT","sp":"1","text":"*Menu*"},{"width":"930","id":"K_SPACE","text":"\u00A0"},{"width":"160","id":"K_ENTER","sp":"1","text":"*Enter*"}]}]},{"id":"shift","row":[{"id":"1","key":[{"id":"K_1","text":"!"},{"id":"K_2","text":"\u17D7"},{"id":"K_3","text":"\""},{"id":"K_4","text":"\u17DB"},{"id":"K_5","text":"%"},{"id":"K_6","text":"\uEFCD"},{"id":"K_7","text":"\uEFD0"},{"id":"K_8","text":"\uEFCF"},{"id":"K_9","text":"("},{"id":"K_0","text":")"},{"id":"K_HYPHEN","text":"\uEFCC"},{"id":"K_EQUAL","text":"="},{"width":"100","id":"K_BKSP","sp":"1","text":"*BkSp*"}]},{"id":"2","key":[{"id":"K_Q","pad":"75","text":"\u1788"},{"id":"K_W","text":"\uEFBA"},{"id":"K_E","text":"\uEFC2"},{"id":"K_R","text":"\u17AC"},{"id":"K_T","text":"\u1791"},{"id":"K_Y","text":"\uEFBD"},{"id":"K_U","text":"\uEFBC"},{"id":"K_I","text":"\uEFB8"},{"id":"K_O","text":"\uEFC5"},{"id":"K_P","text":"\u1797"},{"id":"K_LBRKT","text":"\uEFBF"},{"id":"K_RBRKT","text":"\u17A7"},{"width":"10","id":"T_new_364","sp":"10"}]},{"id":"3","key":[{"id":"K_BKQUOTE","text":"\u00BB"},{"id":"K_A","text":"\uEF11"},{"id":"K_S","text":"\uEFC3"},{"id":"K_D","text":"\u178C"},{"id":"K_F","text":"\u1792"},{"id":"K_G","text":"\u17A2"},{"id":"K_H","text":"\u17C7"},{"id":"K_J","text":"\u1789"},{"id":"K_K","text":"\u1782"},{"id":"K_L","text":"\u17A1"},{"id":"K_COLON","text":"\uEF14"},{"id":"K_QUOTE","text":"\uEFC9"},{"id":"K_BKSLASH","text":"\u17AD"}]},{"id":"4","key":[{"nextlayer":"default","width":"160","id":"K_SHIFT","sp":"2","text":"*Shift*"},{"id":"K_oE2"},{"id":"K_Z","text":"\u178D"},{"id":"K_X","text":"\u1783"},{"id":"K_C","text":"\u1787"},{"id":"K_V","text":"\uEF12"},{"id":"K_B","text":"\u1796"},{"id":"K_N","text":"\u178E"},{"id":"K_M","text":"\uEFC6"},{"id":"K_COMMA","text":"\uEF13"},{"id":"K_PERIOD","text":"\u17D5"},{"id":"K_SLASH","text":"?"},{"width":"10","id":"T_new_390","sp":"10"}]},{"id":"5","key":[{"nextlayer":"rightalt","width":"160","id":"K_LCONTROL","sp":"1","text":"*AltGr*"},{"width":"160","id":"K_LOPT","sp":"1","text":"*Menu*"},{"width":"930","id":"K_SPACE"},{"width":"160","id":"K_ENTER","sp":"1","text":"*Enter*"}]}]}]}};this.s12=['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''];this.s13="កខគឃងចឆជឈញដឋឌឍណតថទធនបផពភមយរលវសហឡអឝឞ";this.s14=['','','','','','','','','','','','','','','',''];this.s15="ាិីឹឺុូួើឿៀេែៃោៅ";this.s16=['','',''];this.s17="ំះៈ";this.s18=['','','','','','','','','','','','','','','','','','',''];this.s19="ាិីឹឺុូួើឿៀេែៃោៅំះៈ";this.s20="ាិីឹឺុូួើឿៀេែៃោៅំះៈ";this.s21="េោុិីឹែ";this.s22="ាុ";this.s23="េោុិីឹែាុ";this.s24=['','','','','','','','','','','','','','',''];this.s25="ឥឦឧឨឩឪឫឬឭឮឯឰឱឲឳ";this.s26=['','','','','','','','','','',''];this.s27="់័៌៏៍ៈ៎៑៝ៜ្";this.s28=['',''];this.s29="៉៊";this.s30=['','','','','','','',''];this.s31="។៕៖ៗ៘៙៚៓";this.s32=['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''];this.s33="«»()!\"%=?{}\\@*,×./[]‍‌+-÷:≈‘’;<>#&";this.s34=['','',''];this.s35="​  ";this.s36=['','',''];this.s37="៛$€";this.s38=['','','','','','','','','',''];this.s39="០១២៣៤៥៦៧៨៩";this.s40=['','','','','','','','','',''];this.s41="៰៱៲៳៴៵៶៷៸៹";this.s42=['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''];this.s43="᧬᧻᧹᧮᧢᧯᧰᧱᧧᧲᧳᧴᧽᧼᧨᧩᧠᧣᧭᧤᧦᧺᧡᧸᧥᧷᧵᧾᧿᧪᧫᧶";this.s44=['','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','','',''];this.s45="កខគឃងចឆជឈញដឋឌឍណតថទធនបផពភមយរលវឝឞសហឡអ";this.s46=['','','','','','','','','',''];this.s47="0123456789";this.s48="ិីឹឺើ័";this.s49="សហអ";this.s50="ប";this.s51="ងញមយរវនល";this.s52="ងញមយរវនលប";this.s53="យមងបវ";this.s54="យលងរ";this.s55="បហអ";this.s56="ហសអ";this.s57="បយលមនញងរវអ";this.s58="ឆឈបផតទ";this.s59="វឣ";this.s63="touch";this.KVER="15.0.270.0";this.KVS=[];this.gs=function(t,e) {return this.g0(t,e);};this.gs=function(t,e) {return this.g0(t,e);};this.g0=function(t,e) {var k=KeymanWeb,r=0,m=0;if(k.KKM(e,16384,8)) {if(k.KFCM(2,t,['្',{t:'a',a:this.s13}])&&k.KIFS(31,this.s63,t)){r=m=1;k.KDC(2,t);}else if(k.KFCM(2,t,[{t:'a',a:this.s22},'ំ'])){r=m=1;k.KDC(2,t);}else if(k.KFCM(2,t,[{t:'a',a:this.s21},'ះ'])){r=m=1;k.KDC(2,t);}}else if(k.KKM(e,16392,75)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឝ");}}else if(k.KKM(e,16392,66)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឞ");}}else if(k.KKM(e,16392,222)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ៈ");}else if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ៈ");}}else if(k.KKM(e,16392,221)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឳ");}}else if(k.KKM(e,16392,80)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឰ");}}else if(k.KKM(e,16392,73)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឦ");}}else if(k.KKM(e,16392,84)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឨ");}}else if(k.KKM(e,16392,79)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឱ");}}else if(k.KKM(e,16392,219)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឩ");}}else if(k.KKM(e,16392,82)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឫ");}}else if(k.KKM(e,16392,69)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឯ");}}else if(k.KKM(e,16392,87)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៝");}}else if(k.KKM(e,16392,51)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៑");}}else if(k.KKM(e,16392,187)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៎");}}else if(k.KKM(e,16392,81)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ៜ");}}else if(k.KKM(e,16392,186)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៖");}}else if(k.KKM(e,16392,77)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៓");}}else if(k.KKM(e,16392,76)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៘");}}else if(k.KKM(e,16392,54)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៙");}}else if(k.KKM(e,16392,55)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៚");}}else if(k.KKM(e,16392,192)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"‍");}}else if(k.KKM(e,16392,49)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"‌");}}else if(k.KKM(e,16392,85)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"]");}}else if(k.KKM(e,16392,89)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"[");}}else if(k.KKM(e,16392,191)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"/");}}else if(k.KKM(e,16392,65)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"+");}}else if(k.KKM(e,16392,83)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"-");}}else if(k.KKM(e,16392,70)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"÷");}}else if(k.KKM(e,16392,190)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,".");}}else if(k.KKM(e,16392,220)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"\\");}}else if(k.KKM(e,16392,48)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"}");}}else if(k.KKM(e,16392,71)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,":");}}else if(k.KKM(e,16392,68)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"×");}}else if(k.KKM(e,16392,188)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,",");}}else if(k.KKM(e,16392,189)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"≈");}}else if(k.KKM(e,16392,56)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"*");}}else if(k.KKM(e,16392,72)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"‘");}}else if(k.KKM(e,16392,50)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"@");}}else if(k.KKM(e,16392,74)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"’");}}else if(k.KKM(e,16392,78)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,";");}}else if(k.KKM(e,16392,90)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"<");}}else if(k.KKM(e,16392,88)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,">");}}else if(k.KKM(e,16392,57)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"{");}}else if(k.KKM(e,16392,86)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"&");}}else if(k.KKM(e,16392,67)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"#");}}else if(k.KKM(e,16392,53)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"€");}}else if(k.KKM(e,16392,52)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"$");}}else if(k.KKM(e,16408,52)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៴");}}else if(k.KKM(e,16408,56)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៸");}}else if(k.KKM(e,16408,48)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៰");}}else if(k.KKM(e,16408,49)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៱");}}else if(k.KKM(e,16408,50)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៲");}}else if(k.KKM(e,16408,51)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៳");}}else if(k.KKM(e,16408,57)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៹");}}else if(k.KKM(e,16408,53)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៵");}}else if(k.KKM(e,16408,54)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៶");}}else if(k.KKM(e,16408,55)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៷");}}else if(k.KKM(e,16408,221)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧫");}}else if(k.KKM(e,16408,219)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧪");}}else if(k.KKM(e,16408,65)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧬");}}else if(k.KKM(e,16408,66)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧻");}}else if(k.KKM(e,16408,67)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧹");}}else if(k.KKM(e,16408,68)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧮");}}else if(k.KKM(e,16408,69)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧢");}}else if(k.KKM(e,16408,70)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧯");}}else if(k.KKM(e,16408,71)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧰");}}else if(k.KKM(e,16408,72)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧱");}}else if(k.KKM(e,16408,222)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧶");}}else if(k.KKM(e,16408,74)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧲");}}else if(k.KKM(e,16408,75)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧳");}}else if(k.KKM(e,16408,76)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧴");}}else if(k.KKM(e,16408,77)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧽");}}else if(k.KKM(e,16408,78)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧼");}}else if(k.KKM(e,16408,79)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧨");}}else if(k.KKM(e,16408,80)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧩");}}else if(k.KKM(e,16408,81)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧠");}}else if(k.KKM(e,16408,82)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧣");}}else if(k.KKM(e,16408,83)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧭");}}else if(k.KKM(e,16408,84)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧤");}}else if(k.KKM(e,16408,85)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧦");}}else if(k.KKM(e,16408,86)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧺");}}else if(k.KKM(e,16408,87)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧡");}}else if(k.KKM(e,16408,88)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧸");}}else if(k.KKM(e,16408,89)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧥");}}else if(k.KKM(e,16408,190)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧿");}}else if(k.KKM(e,16408,90)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧷");}}else if(k.KKM(e,16408,186)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧵");}}else if(k.KKM(e,16408,188)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧾");}}else if(k.KKM(e,16408,73)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"᧧");}}else if(k.KKM(e,16392,32)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t," ");}}else if(k.KKM(e,16384,261)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ច");}}else if(k.KKM(e,16384,260)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ង");}}else if(k.KKM(e,16384,264)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ឈ");}}else if(k.KKM(e,16384,265)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ញ");}}else if(k.KKM(e,16384,262)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ឆ");}}else if(k.KKM(e,16384,259)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ឃ");}}else if(k.KKM(e,16384,266)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ដ");}}else if(k.KKM(e,16384,267)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ឋ");}}else if(k.KKM(e,16384,268)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ឌ");}}if(m) {}else if(k.KKM(e,16384,290)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្អ");}}else if(k.KKM(e,16384,289)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ឡ");}}else if(k.KKM(e,16384,288)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ហ");}}else if(k.KKM(e,16384,287)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ស");}}else if(k.KKM(e,16384,286)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ឞ");}}else if(k.KKM(e,16384,285)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ឝ");}}else if(k.KKM(e,16384,284)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្វ");}}else if(k.KKM(e,16384,283)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ល");}}else if(k.KKM(e,16384,282)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្រ");}}else if(k.KKM(e,16384,281)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្យ");}}else if(k.KKM(e,16384,280)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ម");}}else if(k.KKM(e,16384,279)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ភ");}}else if(k.KKM(e,16384,278)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ព");}}else if(k.KKM(e,16384,277)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ផ");}}else if(k.KKM(e,16384,276)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ប");}}else if(k.KKM(e,16384,275)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ន");}}else if(k.KKM(e,16384,274)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ធ");}}else if(k.KKM(e,16384,273)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ទ");}}else if(k.KKM(e,16384,272)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ថ");}}else if(k.KKM(e,16384,271)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ត");}}else if(k.KKM(e,16384,256)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ក");}}else if(k.KKM(e,16384,270)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ណ");}}else if(k.KKM(e,16384,257)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ខ");}}else if(k.KKM(e,16384,258)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្គ");}}else if(k.KKM(e,16384,269)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ឍ");}}else if(k.KKM(e,16384,263)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្ជ");}}else if(k.KKM(e,16384,106)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"*");}}else if(k.KKM(e,16400,106)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"*");}}else if(k.KKM(e,16384,107)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"+");}}else if(k.KKM(e,16400,107)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"+");}}else if(k.KKM(e,16384,109)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"-");}}else if(k.KKM(e,16400,109)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"-");}}else if(k.KKM(e,16384,110)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,".");}}else if(k.KKM(e,16400,110)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,".");}}else if(k.KKM(e,16384,111)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"/");}}else if(k.KKM(e,16400,111)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"/");}}else if(k.KKM(e,16384,32)) {if(k.KFCM(1,t,['​'])){r=m=1;k.KDC(1,t);k.KO(-1,t," ");}else if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"​");}}else if(k.KKM(e,16400,32)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t," ");}}else if(k.KKM(e,16400,49)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"!");}}else if(k.KKM(e,16400,222)) {if(k.KFCM(3,t,[{t:'a',a:this.s58},'្','អ'])){r=m=1;k.KDC(3,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្អ៉");k.KB(t);}else if(k.KFCM(3,t,['ល','្',{t:'a',a:this.s55}])){r=m=1;k.KDC(3,t);k.KO(-1,t,"ល្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៉");k.KB(t);}else if(k.KFCM(3,t,['ម','្',{t:'a',a:this.s56}])){r=m=1;k.KDC(3,t);k.KO(-1,t,"ម្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៉");k.KB(t);}else if(k.KFCM(3,t,['ស','្',{t:'a',a:this.s57}])){r=m=1;k.KDC(3,t);k.KO(-1,t,"ស្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៉");k.KB(t);}else if(k.KFCM(3,t,[{t:'a',a:this.s59},'្','ហ'])){r=m=1;k.KDC(3,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្ហ៉");k.KB(t);}else if(k.KFCM(3,t,['អ','្','ង'])){r=m=1;k.KDC(3,t);k.KO(-1,t,"អ្ង៉");k.KB(t);}else if(k.KFCM(3,t,['អ','្','វ'])){r=m=1;k.KDC(3,t);k.KO(-1,t,"អ្វ៉");k.KB(t);}else if(k.KFCM(1,t,[{t:'a',a:this.s29}])){r=m=1;k.KDC(1,t);k.KIO(-1,this.s29,1,t);k.KB(t);}else if(k.KFCM(1,t,[{t:'a',a:this.s49}])){r=m=1;k.KDC(1,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៉");k.KB(t);}else if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៉");}}else if(k.KKM(e,16400,51)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"\"");}}else if(k.KKM(e,16400,52)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៛");}}else if(k.KKM(e,16400,53)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"%");}}else if(k.KKM(e,16400,55)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"័");}}else if(k.KKM(e,16384,222)) {if(k.KFCM(2,t,['្',{t:'a',a:this.s13}])){r=m=1;k.KDC(2,t);k.KO(-1,t,"្");k.KIO(-1,this.s13,2,t);k.KB(t);}else if(k.KFCM(1,t,[{t:'a',a:this.s15}])){r=m=1;k.KDC(1,t);k.KIO(-1,this.s15,1,t);k.KB(t);}else if(k.KFCM(1,t,[{t:'a',a:this.s17}])){r=m=1;k.KDC(1,t);k.KIO(-1,this.s17,1,t);k.KB(t);}else if(k.KFCM(1,t,[{t:'a',a:this.s29}])){r=m=1;k.KDC(1,t);k.KIO(-1,this.s29,1,t);k.KB(t);}else if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"់");}}else if(k.KKM(e,16400,57)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"(");}}else if(k.KKM(e,16400,48)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,")");}}else if(k.KKM(e,16400,56)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៏");}}else if(k.KKM(e,16400,187)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"=");}}else if(k.KKM(e,16384,188)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ុំ");}}else if(k.KKM(e,16384,189)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឥ");}}else if(k.KKM(e,16384,190)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"។");}}else if(k.KKM(e,16384,191)) {if(k.KFCM(3,t,['ល','្',{t:'a',a:this.s53}])){r=m=1;k.KDC(3,t);k.KO(-1,t,"ល្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៊");k.KB(t);}else if(k.KFCM(3,t,['ម','្',{t:'a',a:this.s54}])){r=m=1;k.KDC(3,t);k.KO(-1,t,"ម្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៊");k.KB(t);}else if(k.KFCM(1,t,[{t:'a',a:this.s29}])){r=m=1;k.KDC(1,t);k.KIO(-1,this.s29,1,t);k.KB(t);}else if(k.KFCM(1,t,[{t:'a',a:this.s52}])){r=m=1;k.KDC(1,t);k.KIO(-1,this.s52,1,t);k.KO(-1,t,"៊");k.KB(t);}else if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៊");}}else if(k.KKM(e,16384,48)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"០");}}else if(k.KKM(e,16384,49)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"១");}}else if(k.KKM(e,16384,50)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"២");}}else if(k.KKM(e,16384,51)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៣");}}else if(k.KKM(e,16384,52)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៤");}}else if(k.KKM(e,16384,53)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៥");}}else if(k.KKM(e,16384,54)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៦");}}else if(k.KKM(e,16384,55)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៧");}}else if(k.KKM(e,16384,56)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៨");}}else if(k.KKM(e,16384,57)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៩");}}else if(k.KKM(e,16400,186)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ោះ");}}else if(k.KKM(e,16384,186)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ើ");}}else if(k.KKM(e,16400,188)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ុះ");}}else if(k.KKM(e,16384,187)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឲ");}}else if(k.KKM(e,16400,190)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៕");}}else if(k.KKM(e,16400,191)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"?");}}else if(k.KKM(e,16400,50)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ៗ");}}else if(k.KKM(e,16400,65)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ាំ");}}else if(k.KKM(e,16400,66)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ព");}}else if(k.KKM(e,16400,67)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ជ");}}else if(k.KKM(e,16400,68)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឌ");}}else if(k.KKM(e,16400,69)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ែ");}}else if(k.KKM(e,16400,70)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ធ");}}else if(k.KKM(e,16400,71)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"អ");}}else if(k.KKM(e,16400,72)) {if(k.KFCM(1,t,['ះ'])){r=m=1;k.KDC(1,t);k.KO(-1,t,"ៈ");}else if(k.KFCM(1,t,['ៈ'])){r=m=1;k.KDC(1,t);k.KO(-1,t,"ះ");}else if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ះ");}}else if(k.KKM(e,16400,73)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ី");}}else if(k.KKM(e,16400,74)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ញ");}}else if(k.KKM(e,16400,75)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"គ");}}else if(k.KKM(e,16400,76)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឡ");}}else if(k.KKM(e,16400,77)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ំ");}}else if(k.KKM(e,16400,78)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ណ");}}else if(k.KKM(e,16400,79)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ៅ");}}else if(k.KKM(e,16400,80)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ភ");}}else if(k.KKM(e,16400,81)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឈ");}}else if(k.KKM(e,16400,82)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឬ");}}else if(k.KKM(e,16400,83)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ៃ");}}else if(k.KKM(e,16400,84)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ទ");}}else if(k.KKM(e,16400,85)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ូ");}}else if(k.KKM(e,16400,86)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"េះ");}}else if(k.KKM(e,16400,87)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឺ");}}else if(k.KKM(e,16400,88)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឃ");}}else if(k.KKM(e,16400,89)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ួ");}}else if(k.KKM(e,16400,90)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឍ");}}else if(k.KKM(e,16384,219)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ៀ");}}else if(k.KKM(e,16384,220)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឮ");}}else if(k.KKM(e,16384,221)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឪ");}}else if(k.KKM(e,16400,54)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៍");}}if(m) {}else if(k.KKM(e,16400,189)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"៌");}}else if(k.KKM(e,16384,192)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"«");}}else if(k.KKM(e,16384,65)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ា");}}else if(k.KKM(e,16384,66)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ប");}}else if(k.KKM(e,16384,67)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ច");}}else if(k.KKM(e,16384,68)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ដ");}}else if(k.KKM(e,16384,69)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"េ");}}else if(k.KKM(e,16384,70)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ថ");}}else if(k.KKM(e,16384,71)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ង");}}else if(k.KKM(e,16384,72)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ហ");}}else if(k.KKM(e,16384,73)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ិ");}}else if(k.KKM(e,16384,74)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"្");}}else if(k.KKM(e,16384,75)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ក");}}else if(k.KKM(e,16384,76)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ល");}}else if(k.KKM(e,16384,77)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ម");}}else if(k.KKM(e,16384,78)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ន");}}else if(k.KKM(e,16384,79)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ោ");}}else if(k.KKM(e,16384,80)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ផ");}}else if(k.KKM(e,16384,81)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឆ");}}else if(k.KKM(e,16384,82)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"រ");}}else if(k.KKM(e,16384,83)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ស");}}else if(k.KKM(e,16384,84)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ត");}}else if(k.KKM(e,16384,85)) {if(k.KFCM(3,t,[{t:'a',a:this.s49},'ា','ំ'])){r=m=1;k.KDC(3,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(3,t,[{t:'a',a:this.s52},'ា','ំ'])){r=m=1;k.KDC(3,t);k.KIO(-1,this.s52,1,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ុ");}}else if(k.KKM(e,16384,86)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"វ");}}else if(k.KKM(e,16384,87)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឹ");}}else if(k.KKM(e,16384,88)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ខ");}}else if(k.KKM(e,16384,89)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"យ");}}else if(k.KKM(e,16384,90)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឋ");}}else if(k.KKM(e,16400,219)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឿ");}}else if(k.KKM(e,16400,220)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឭ");}}else if(k.KKM(e,16400,221)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"ឧ");}}else if(k.KKM(e,16400,192)) {if(1){r=m=1;k.KDC(0,t);k.KO(-1,t,"»");}}if(m==1) {k.KDC(-1,t);r=this.g1(t,e);m=2;}return r;};this.g1=function(t,e) {var k=KeymanWeb,r=1,m=0;if(k.KFCM(7,t,[{t:'a',a:this.s58},'្','អ','ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,['ល','្',{t:'a',a:this.s55},'ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,['ម','្',{t:'a',a:this.s56},'ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,['ស','្','ប','ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KO(-1,t,"ប៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,['ស','្',{t:'a',a:this.s57},'ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,[{t:'a',a:this.s59},'្','ហ','ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,['អ','្','ង','ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,['អ','្','វ','ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,['ហ','្','ប','ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KO(-1,t,"ហ");k.KO(-1,t,"្");k.KO(-1,t,"ប៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,['ហ','្',{t:'a',a:this.s52},'ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KO(-1,t,"ហ");k.KO(-1,t,"្");k.KIO(-1,this.s52,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,['ល','្',{t:'a',a:this.s53},'ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(7,t,['ម','្',{t:'a',a:this.s54},'ុ','ំ','ា','ំ'])){m=1;k.KDC(7,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['្','ដ',{t:'a',a:this.s22},'ំ','្','រ'])){m=1;k.KDC(6,t);k.KO(-1,t,"្ត");k.KO(-1,t,"្");k.KO(-1,t,"រ");k.KIO(-1,this.s22,3,t);k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['្','ដ',{t:'a',a:this.s21},'ះ','្','រ'])){m=1;k.KDC(6,t);k.KO(-1,t,"្ត");k.KO(-1,t,"្");k.KO(-1,t,"រ");k.KIO(-1,this.s21,3,t);k.KO(-1,t,"ះ");}else if(k.KFCM(6,t,['្','រ',{t:'a',a:this.s22},'ំ','្','ដ'])){m=1;k.KDC(6,t);k.KO(-1,t,"្ត");k.KO(-1,t,"្");k.KO(-1,t,"រ");k.KIO(-1,this.s22,3,t);k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['្','រ',{t:'a',a:this.s21},'ះ','្','ដ'])){m=1;k.KDC(6,t);k.KO(-1,t,"្ត");k.KO(-1,t,"្");k.KO(-1,t,"រ");k.KIO(-1,this.s21,3,t);k.KO(-1,t,"ះ");}else if(k.KFCM(6,t,['្','រ',{t:'a',a:this.s22},'ំ','្',{t:'a',a:this.s45}])){m=1;k.KDC(6,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,6,t);k.KO(-1,t,"្");k.KO(-1,t,"រ");k.KIO(-1,this.s22,3,t);k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['្','រ',{t:'a',a:this.s21},'ះ','្',{t:'a',a:this.s45}])){m=1;k.KDC(6,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,6,t);k.KO(-1,t,"្");k.KO(-1,t,"រ");k.KIO(-1,this.s21,3,t);k.KO(-1,t,"ះ");}else if(k.KFCM(6,t,[{t:'a',a:this.s58},'្','អ','ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s55},'ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s56},'ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ស','្','ប','ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KO(-1,t,"ប៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ស','្',{t:'a',a:this.s57},'ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,[{t:'a',a:this.s59},'្','ហ','ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['អ','្','ង','ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['អ','្','វ','ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ហ','្','ប','ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ហ");k.KO(-1,t,"្");k.KO(-1,t,"ប៉");k.KO(-1,t,"ប");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ហ','្',{t:'a',a:this.s52},'ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ហ");k.KO(-1,t,"្");k.KIO(-1,this.s52,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s52,3,t);k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s53},'ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s54},'ុ','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s53},'៊',{t:'a',a:this.s15},{t:'a',a:this.s17}])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉");k.KIO(-1,this.s15,5,t);k.KIO(-1,this.s17,6,t);}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s54},'៊',{t:'a',a:this.s15},{t:'a',a:this.s17}])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉");k.KIO(-1,this.s15,5,t);k.KIO(-1,this.s17,6,t);}else if(k.KFCM(6,t,[{t:'a',a:this.s58},'្','អ','៉','ា','ំ'])){m=1;k.KDC(6,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s55},'៉','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s56},'៉','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ស','្','ប','៉','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KO(-1,t,"ប៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ស','្',{t:'a',a:this.s57},'៉','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,[{t:'a',a:this.s59},'្','ហ','៉','ា','ំ'])){m=1;k.KDC(6,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['អ','្','ង','៉','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['អ','្','វ','៉','ា','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,[{t:'a',a:this.s58},'្','អ','ា','ុ','ំ'])){m=1;k.KDC(6,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,[{t:'a',a:this.s58},'្','អ','ុ','ំ','ា'])){m=1;k.KDC(6,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s55},'ា','ុ','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s55},'ុ','ំ','ា'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s56},'ា','ុ','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s56},'ុ','ំ','ា'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ស','្',{t:'a',a:this.s57},'ា','ុ','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ស','្',{t:'a',a:this.s57},'ុ','ំ','ា'])){m=1;k.KDC(6,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,[{t:'a',a:this.s59},'្','ហ','ា','ុ','ំ'])){m=1;k.KDC(6,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,[{t:'a',a:this.s59},'្','ហ','ុ','ំ','ា'])){m=1;k.KDC(6,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['អ','្','ង','ា','ុ','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['អ','្','ង','ុ','ំ','ា'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['អ','្','វ','ា','ុ','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['អ','្','វ','ុ','ំ','ា'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊");k.KO(-1,t,"ុ");k.KO(-1,t,"ា");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s53},'ា','ុ','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s53},'ុ','ំ','ា'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s54},'ា','ុ','ំ'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s54},'ុ','ំ','ា'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(6,t,[{t:'a',a:this.s58},'្','អ','េ','ុ','ី'])){m=1;k.KDC(6,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊ើ");}else if(k.KFCM(6,t,[{t:'a',a:this.s58},'្','អ','ុ','េ','ី'])){m=1;k.KDC(6,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊ើ");}else if(k.KFCM(6,t,[{t:'a',a:this.s58},'្','អ','៉','េ','ី'])){m=1;k.KDC(6,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊ើ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s55},'េ','ុ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s55},'ុ','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s55},'៉','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s56},'េ','ុ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s56},'ុ','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s56},'៉','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(6,t,['ស','្',{t:'a',a:this.s57},'េ','ុ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(6,t,['ស','្',{t:'a',a:this.s57},'ុ','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(6,t,['ស','្',{t:'a',a:this.s57},'៉','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(6,t,[{t:'a',a:this.s59},'្','ហ','េ','ុ','ី'])){m=1;k.KDC(6,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊ើ");}else if(k.KFCM(6,t,[{t:'a',a:this.s59},'្','ហ','ុ','េ','ី'])){m=1;k.KDC(6,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊ើ");}else if(k.KFCM(6,t,[{t:'a',a:this.s59},'្','ហ','៉','េ','ី'])){m=1;k.KDC(6,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊ើ");}else if(k.KFCM(6,t,['អ','្','ង','េ','ុ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊ើ");}else if(k.KFCM(6,t,['អ','្','ង','ុ','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊ើ");}else if(k.KFCM(6,t,['អ','្','ង','៉','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊ើ");}else if(k.KFCM(6,t,['អ','្','វ','េ','ុ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊ើ");}else if(k.KFCM(6,t,['អ','្','វ','ុ','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊ើ");}else if(k.KFCM(6,t,['អ','្','វ','៉','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊ើ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s53},'េ','ុ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉ើ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s53},'ុ','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉ើ");}else if(k.KFCM(6,t,['ល','្',{t:'a',a:this.s53},'៊','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉ើ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s54},'េ','ុ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉ើ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s54},'ុ','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉ើ");}else if(k.KFCM(6,t,['ម','្',{t:'a',a:this.s54},'៊','េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉ើ");}else if(k.KFCM(6,t,['្','យ','្',{t:'a',a:this.s13},'េ','ឺ'])){m=1;k.KDC(6,t);k.KO(-1,t,"្");k.KIO(-1,this.s13,4,t);k.KO(-1,t,"ឿ");}else if(k.KFCM(6,t,['្','យ','្',{t:'a',a:this.s13},'េ','ឹ'])){m=1;k.KDC(6,t);k.KO(-1,t,"្");k.KIO(-1,this.s13,4,t);k.KO(-1,t,"ឿ");}else if(k.KFCM(6,t,['្','យ','្',{t:'a',a:this.s13},'េ','ី'])){m=1;k.KDC(6,t);k.KO(-1,t,"្");k.KIO(-1,this.s13,4,t);k.KO(-1,t,"ឿ");}else if(k.KFCM(5,t,[{t:'a',a:this.s29},{t:'a',a:this.s22},'ំ','្',{t:'a',a:this.s45}])){m=1;k.KDC(5,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,5,t);k.KIO(-1,this.s29,1,t);k.KIO(-1,this.s22,2,t);k.KO(-1,t,"ំ");}else if(k.KFCM(5,t,[{t:'a',a:this.s29},{t:'a',a:this.s21},'ះ','្',{t:'a',a:this.s45}])){m=1;k.KDC(5,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,5,t);k.KIO(-1,this.s29,1,t);k.KIO(-1,this.s21,2,t);k.KO(-1,t,"ះ");}else if(k.KFCM(5,t,['្','ដ',{t:'a',a:this.s20},'្','រ'])){m=1;k.KDC(5,t);k.KO(-1,t,"្ត");k.KO(-1,t,"្");k.KO(-1,t,"រ");k.KIO(-1,this.s20,3,t);}else if(k.KFCM(5,t,['្','រ',{t:'a',a:this.s20},'្','ដ'])){m=1;k.KDC(5,t);k.KO(-1,t,"្ត");k.KO(-1,t,"្");k.KO(-1,t,"រ");k.KIO(-1,this.s20,3,t);}else if(k.KFCM(5,t,['្','រ',{t:'a',a:this.s29},'្',{t:'a',a:this.s45}])){m=1;k.KDC(5,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,5,t);k.KO(-1,t,"្");k.KO(-1,t,"រ");k.KIO(-1,this.s29,3,t);}else if(k.KFCM(5,t,['្','រ',{t:'a',a:this.s20},'្',{t:'a',a:this.s45}])){m=1;k.KDC(5,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,5,t);k.KO(-1,t,"្");k.KO(-1,t,"រ");k.KIO(-1,this.s20,3,t);}else if(k.KFCM(5,t,[{t:'a',a:this.s58},'្','អ','ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,[{t:'a',a:this.s58},'្','អ',{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,['ល','្',{t:'a',a:this.s55},'ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ល','្',{t:'a',a:this.s55},{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,['ម','្',{t:'a',a:this.s56},'ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ម','្',{t:'a',a:this.s56},{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,4,t);}if(m) {}else if(k.KFCM(5,t,['ស','្','ប','ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KO(-1,t,"ប៉");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ស','្','ប',{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KO(-1,t,"ប៉");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,['ស','្',{t:'a',a:this.s57},'ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ស','្',{t:'a',a:this.s57},{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,[{t:'a',a:this.s59},'្','ហ','ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,[{t:'a',a:this.s59},'្','ហ',{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,['អ','្','ង','ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['អ','្','ង',{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,['អ','្','វ','ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['អ','្','វ',{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,['ហ','្','ប','ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ហ");k.KO(-1,t,"្");k.KO(-1,t,"ប៉");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ហ','្','ប',{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KO(-1,t,"ហ");k.KO(-1,t,"្");k.KO(-1,t,"ប៉");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,['ហ','្',{t:'a',a:this.s52},'ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ហ");k.KO(-1,t,"្");k.KIO(-1,this.s52,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ហ','្',{t:'a',a:this.s52},{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KO(-1,t,"ហ");k.KO(-1,t,"្");k.KIO(-1,this.s52,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,['ល','្',{t:'a',a:this.s53},'ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ល','្',{t:'a',a:this.s53},{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,['ម','្',{t:'a',a:this.s54},'ុ',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ម','្',{t:'a',a:this.s54},{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(5,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(5,t,[{t:'a',a:this.s49},'ុ','ំ','ា','ំ'])){m=1;k.KDC(5,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(5,t,[{t:'a',a:this.s52},'ុ','ំ','ា','ំ'])){m=1;k.KDC(5,t);k.KIO(-1,this.s52,1,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(5,t,['ល','្',{t:'a',a:this.s53},'៊',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s53,3,t);k.KO(-1,t,"៉");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ម','្',{t:'a',a:this.s54},'៊',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s54,3,t);k.KO(-1,t,"៉");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['្',{t:'a',a:this.s51},'៊',{t:'a',a:this.s15},{t:'a',a:this.s17}])){m=1;k.KDC(5,t);k.KO(-1,t,"្");k.KIO(-1,this.s51,2,t);k.KO(-1,t,"៊");k.KIO(-1,this.s15,4,t);k.KIO(-1,this.s17,5,t);}else if(k.KFCM(5,t,[{t:'a',a:this.s58},'្','អ','៉',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KIO(-1,this.s58,1,t);k.KO(-1,t,"្");k.KO(-1,t,"អ៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ល','្',{t:'a',a:this.s55},'៉',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ល");k.KO(-1,t,"្");k.KIO(-1,this.s55,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ម','្',{t:'a',a:this.s56},'៉',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ម");k.KO(-1,t,"្");k.KIO(-1,this.s56,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ស','្','ប','៉',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KO(-1,t,"ប៉");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ស','្',{t:'a',a:this.s57},'៉',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"ស");k.KO(-1,t,"្");k.KIO(-1,this.s57,3,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,[{t:'a',a:this.s59},'្','ហ','៉',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KIO(-1,this.s59,1,t);k.KO(-1,t,"្");k.KO(-1,t,"ហ៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['អ','្','ង','៉',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"ង៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['អ','្','វ','៉',{t:'a',a:this.s48}])){m=1;k.KDC(5,t);k.KO(-1,t,"អ");k.KO(-1,t,"្");k.KO(-1,t,"វ៊");k.KIO(-1,this.s48,5,t);}else if(k.KFCM(5,t,['ព','័','ន','្','ឋ'])){m=1;k.KDC(5,t);k.KO(-1,t,"ព");k.KO(-1,t,"័");k.KO(-1,t,"ន");k.KO(-1,t,"្ធ");}else if(k.KFCM(4,t,[{t:'a',a:this.s15},{t:'a',a:this.s17},{t:'a',a:this.s15},{t:'a',a:this.s17}])){m=1;k.KDC(4,t);k.KIO(-1,this.s15,3,t);k.KIO(-1,this.s17,4,t);}else if(k.KFCM(4,t,[{t:'a',a:this.s22},'ំ','្',{t:'a',a:this.s45}])){m=1;k.KDC(4,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,4,t);k.KIO(-1,this.s22,1,t);k.KO(-1,t,"ំ");}else if(k.KFCM(4,t,[{t:'a',a:this.s21},'ះ','្',{t:'a',a:this.s45}])){m=1;k.KDC(4,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,4,t);k.KIO(-1,this.s21,1,t);k.KO(-1,t,"ះ");}else if(k.KFCM(4,t,[{t:'a',a:this.s29},{t:'a',a:this.s20},'្',{t:'a',a:this.s45}])){m=1;k.KDC(4,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,4,t);k.KIO(-1,this.s29,1,t);k.KIO(-1,this.s20,2,t);}else if(k.KFCM(4,t,['្','ដ','្','រ'])){m=1;k.KDC(4,t);k.KO(-1,t,"្ត");k.KO(-1,t,"្");k.KO(-1,t,"រ");}else if(k.KFCM(4,t,['្','រ','្','ដ'])){m=1;k.KDC(4,t);k.KO(-1,t,"្ត");k.KO(-1,t,"្");k.KO(-1,t,"រ");}else if(k.KFCM(4,t,['្','រ','្',{t:'a',a:this.s45}])){m=1;k.KDC(4,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,4,t);k.KO(-1,t,"្");k.KO(-1,t,"រ");}else if(k.KFCM(4,t,[{t:'a',a:this.s29},{t:'a',a:this.s15},{t:'a',a:this.s17},{t:'a',a:this.s29}])){m=1;k.KDC(4,t);k.KIO(-1,this.s15,2,t);k.KIO(-1,this.s17,3,t);k.KIO(-1,this.s29,4,t);}else if(k.KFCM(4,t,[{t:'a',a:this.s49},'ុ','ា','ំ'])){m=1;k.KDC(4,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(4,t,[{t:'a',a:this.s52},'ុ','ា','ំ'])){m=1;k.KDC(4,t);k.KIO(-1,this.s52,1,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(4,t,[{t:'a',a:this.s51},'៊',{t:'a',a:this.s15},{t:'a',a:this.s17}])){m=1;k.KDC(4,t);k.KIO(-1,this.s51,1,t);k.KO(-1,t,"៉");k.KIO(-1,this.s15,3,t);k.KIO(-1,this.s17,4,t);}else if(k.KFCM(4,t,['្',{t:'a',a:this.s51},'៊',{t:'a',a:this.s48}])){m=1;k.KDC(4,t);k.KO(-1,t,"្");k.KIO(-1,this.s51,2,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,4,t);}else if(k.KFCM(4,t,['ប','្','យ',{t:'a',a:this.s29}])){m=1;k.KDC(4,t);k.KO(-1,t,"ប្យ");k.KIO(-1,this.s29,4,t);}else if(k.KFCM(4,t,['ស','្','ប',{t:'a',a:this.s29}])){m=1;k.KDC(4,t);k.KO(-1,t,"ស្ប");k.KIO(-1,this.s29,4,t);}else if(k.KFCM(4,t,['ឆ','្','ប',{t:'a',a:this.s29}])){m=1;k.KDC(4,t);k.KO(-1,t,"ឆ្ប");k.KIO(-1,this.s29,4,t);}else if(k.KFCM(4,t,['ប','្','យ',{t:'a',a:this.s29}])){m=1;k.KDC(4,t);k.KO(-1,t,"ប្យ");k.KIO(-1,this.s29,4,t);}else if(k.KFCM(4,t,['ស','្','ប',{t:'a',a:this.s29}])){m=1;k.KDC(4,t);k.KO(-1,t,"ស្ប");k.KIO(-1,this.s29,4,t);}else if(k.KFCM(4,t,['ឆ','្','ប',{t:'a',a:this.s29}])){m=1;k.KDC(4,t);k.KO(-1,t,"ឆ្ប");k.KIO(-1,this.s29,4,t);}else if(k.KFCM(4,t,[{t:'a',a:this.s49},'៉',{t:'a',a:this.s15},{t:'a',a:this.s17}])){m=1;k.KDC(4,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊");k.KIO(-1,this.s15,3,t);k.KIO(-1,this.s17,4,t);}else if(k.KFCM(4,t,[{t:'a',a:this.s49},'ា','ុ','ំ'])){m=1;k.KDC(4,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(4,t,[{t:'a',a:this.s49},'ុ','ំ','ា'])){m=1;k.KDC(4,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(4,t,[{t:'a',a:this.s52},'ា','ុ','ំ'])){m=1;k.KDC(4,t);k.KIO(-1,this.s52,1,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(4,t,[{t:'a',a:this.s52},'ុ','ំ','ា'])){m=1;k.KDC(4,t);k.KIO(-1,this.s52,1,t);k.KO(-1,t,"៉");k.KO(-1,t,"ា");k.KO(-1,t,"ំ");}else if(k.KFCM(4,t,[{t:'a',a:this.s49},'េ','ុ','ី'])){m=1;k.KDC(4,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(4,t,[{t:'a',a:this.s49},'ុ','េ','ី'])){m=1;k.KDC(4,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(4,t,[{t:'a',a:this.s49},'៉','េ','ី'])){m=1;k.KDC(4,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊ើ");}else if(k.KFCM(4,t,[{t:'a',a:this.s51},'េ','ុ','ី'])){m=1;k.KDC(4,t);k.KIO(-1,this.s51,1,t);k.KO(-1,t,"៉ើ");}else if(k.KFCM(4,t,[{t:'a',a:this.s51},'ុ','េ','ី'])){m=1;k.KDC(4,t);k.KIO(-1,this.s51,1,t);k.KO(-1,t,"៉ើ");}else if(k.KFCM(4,t,[{t:'a',a:this.s51},'៊','េ','ី'])){m=1;k.KDC(4,t);k.KIO(-1,this.s51,1,t);k.KO(-1,t,"៉ើ");}else if(k.KFCM(4,t,['ព','ន','្','ឋ'])){m=1;k.KDC(4,t);k.KO(-1,t,"ព");k.KO(-1,t,"ន");k.KO(-1,t,"្ធ");}else if(k.KFCM(4,t,['្','យ','េ','ឺ'])){m=1;k.KDC(4,t);k.KO(-1,t,"ឿ");}else if(k.KFCM(4,t,['្','យ','េ','ឹ'])){m=1;k.KDC(4,t);k.KO(-1,t,"ឿ");}else if(k.KFCM(4,t,['្','យ','េ','ី'])){m=1;k.KDC(4,t);k.KO(-1,t,"ឿ");}else if(k.KFCM(3,t,[{t:'a',a:this.s15},{t:'a',a:this.s17},{t:'a',a:this.s15}])){m=1;k.KDC(3,t);k.KIO(-1,this.s15,3,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s15},{t:'a',a:this.s17},{t:'a',a:this.s17}])){m=1;k.KDC(3,t);k.KIO(-1,this.s17,3,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s15},{t:'a',a:this.s15},{t:'a',a:this.s17}])){m=1;k.KDC(3,t);k.KIO(-1,this.s15,2,t);k.KIO(-1,this.s17,3,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s17},{t:'a',a:this.s15},{t:'a',a:this.s17}])){m=1;k.KDC(3,t);k.KIO(-1,this.s15,2,t);k.KIO(-1,this.s17,3,t);}else if(k.KFCM(3,t,['្',{t:'a',a:this.s15},{t:'a',a:this.s17}])){m=1;k.KDC(3,t);k.KIO(-1,this.s15,2,t);k.KIO(-1,this.s17,3,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s20},'្',{t:'a',a:this.s45}])){m=1;k.KDC(3,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,3,t);k.KIO(-1,this.s20,1,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s29},'្',{t:'a',a:this.s45}])){m=1;k.KDC(3,t);k.KO(-1,t,"្");k.KIO(-1,this.s45,3,t);k.KIO(-1,this.s29,1,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s15},{t:'a',a:this.s17},{t:'a',a:this.s29}])){m=1;k.KDC(3,t);k.KIO(-1,this.s29,3,t);k.KIO(-1,this.s15,1,t);k.KIO(-1,this.s17,2,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s29},{t:'a',a:this.s20},{t:'a',a:this.s29}])){m=1;k.KDC(3,t);k.KIO(-1,this.s29,3,t);k.KIO(-1,this.s20,2,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s49},'ុ',{t:'a',a:this.s48}])){m=1;k.KDC(3,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,3,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s49},{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(3,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,2,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s52},'ុ',{t:'a',a:this.s48}])){m=1;k.KDC(3,t);k.KIO(-1,this.s52,1,t);k.KO(-1,t,"៉");k.KIO(-1,this.s48,3,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s52},{t:'a',a:this.s48},'ុ'])){m=1;k.KDC(3,t);k.KIO(-1,this.s52,1,t);k.KO(-1,t,"៉");k.KIO(-1,this.s48,2,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s51},'៊',{t:'a',a:this.s48}])){m=1;k.KDC(3,t);k.KIO(-1,this.s51,1,t);k.KO(-1,t,"៉");k.KIO(-1,this.s48,3,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s49},'៉',{t:'a',a:this.s48}])){m=1;k.KDC(3,t);k.KIO(-1,this.s49,1,t);k.KO(-1,t,"៊");k.KIO(-1,this.s48,3,t);}else if(k.KFCM(3,t,[{t:'a',a:this.s13},{t:'a',a:this.s15},'៌'])){m=1;k.KDC(3,t);k.KIO(-1,this.s13,1,t);k.KO(-1,t,"៌");k.KIO(-1,this.s15,2,t);}else if(k.KFCM(3,t,['ណ','្','ត'])){m=1;k.KDC(3,t);k.KO(-1,t,"ណ");k.KO(-1,t,"្ដ");}else if(k.KFCM(3,t,['ន','្','ដ'])){m=1;k.KDC(3,t);k.KO(-1,t,"ន");k.KO(-1,t,"្ត");}else if(k.KFCM(3,t,['ទ','្','ប'])){m=1;k.KDC(3,t);k.KO(-1,t,"ឡ");}else if(k.KFCM(3,t,['ប','្','ញ'])){m=1;k.KDC(3,t);k.KO(-1,t,"ឫ");}else if(k.KFCM(3,t,['ព','្','ញ'])){m=1;k.KDC(3,t);k.KO(-1,t,"ឭ");}else if(k.KFCM(3,t,['ព','្','ឋ'])){m=1;k.KDC(3,t);k.KO(-1,t,"ឰ");}else if(k.KFCM(3,t,['ដ','្','ធ'])){m=1;k.KDC(3,t);k.KO(-1,t,"ដ្ឋ");}else if(k.KFCM(3,t,['ទ','្','ឋ'])){m=1;k.KDC(3,t);k.KO(-1,t,"ទ្ធ");}else if(k.KFCM(3,t,['ឪ','្','យ'])){m=1;k.KDC(3,t);k.KO(-1,t,"ឱ");k.KO(-1,t,"្");k.KO(-1,t,"យ");}else if(k.KFCM(3,t,['ឳ','្','យ'])){m=1;k.KDC(3,t);k.KO(-1,t,"ឱ");k.KO(-1,t,"្");k.KO(-1,t,"យ");}else if(k.KFCM(3,t,['ញ','្','វ'])){m=1;k.KDC(3,t);k.KO(-1,t,"ព");k.KO(-1,t,"្");k.KO(-1,t,"វា");}else if(k.KFCM(2,t,['េ','ា'])){m=1;k.KDC(2,t);k.KO(-1,t,"ោ");}else if(k.KFCM(2,t,['ា','េ'])){m=1;k.KDC(2,t);k.KO(-1,t,"ោ");}else if(k.KFCM(2,t,['េ','ី'])){m=1;k.KDC(2,t);k.KO(-1,t,"ើ");}else if(k.KFCM(2,t,['ី','េ'])){m=1;k.KDC(2,t);k.KO(-1,t,"ើ");}else if(k.KFCM(2,t,['ំ','ុ'])){m=1;k.KDC(2,t);k.KO(-1,t,"ុំ");}else if(k.KFCM(2,t,['ំ','ា'])){m=1;k.KDC(2,t);k.KO(-1,t,"ាំ");}else if(k.KFCM(2,t,[{t:'a',a:this.s15},{t:'a',a:this.s15}])){m=1;k.KDC(2,t);k.KIO(-1,this.s15,2,t);}else if(k.KFCM(2,t,[{t:'a',a:this.s17},{t:'a',a:this.s17}])){m=1;k.KDC(2,t);k.KIO(-1,this.s17,2,t);}if(m) {}else if(k.KFCM(2,t,['្','្'])){m=1;k.KDC(2,t);k.KO(-1,t,"្");}else if(k.KFCM(2,t,['្',{t:'a',a:this.s20}])){m=1;k.KDC(2,t);k.KIO(-1,this.s20,2,t);}else if(k.KFCM(2,t,[{t:'a',a:this.s20},{t:'a',a:this.s29}])){m=1;k.KDC(2,t);k.KIO(-1,this.s29,2,t);k.KIO(-1,this.s20,1,t);}else if(k.KFCM(2,t,['ឫ','ុ'])){m=1;k.KDC(2,t);k.KO(-1,t,"ឬ");}else if(k.KFCM(2,t,['ឭ','ា'])){m=1;k.KDC(2,t);k.KO(-1,t,"ញ");}else if(k.KFCM(2,t,['ឮ','ា'])){m=1;k.KDC(2,t);k.KO(-1,t,"ញ");}else if(k.KFCM(2,t,['ឭ','ុ'])){m=1;k.KDC(2,t);k.KO(-1,t,"ឮ");}else if(k.KFCM(2,t,['ឧ','ិ'])){m=1;k.KDC(2,t);k.KO(-1,t,"ឱ");}else if(k.KFCM(2,t,['ឧ','៌'])){m=1;k.KDC(2,t);k.KO(-1,t,"ឱ");}else if(k.KFCM(2,t,['ឧ','៍'])){m=1;k.KDC(2,t);k.KO(-1,t,"ឱ");}return r;};} \ No newline at end of file diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/build/khmer_angkor.kmx b/developer/src/kmc-package/test/fixtures/khmer_angkor/build/khmer_angkor.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c3d0289f4863c7c4a998c348eb1d425caadca79d Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/khmer_angkor/build/khmer_angkor.kmx differ diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/build/khmer_angkor.kvk b/developer/src/kmc-package/test/fixtures/khmer_angkor/build/khmer_angkor.kvk new file mode 100644 index 0000000000000000000000000000000000000000..c64b3a5a544dc64ab3dcfd44a6875ea5f339b878 Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/khmer_angkor/build/khmer_angkor.kvk differ diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/ref/kmp.json b/developer/src/kmc-package/test/fixtures/khmer_angkor/ref/kmp.json new file mode 100644 index 0000000000000000000000000000000000000000..d5aa3271db398d24accfee83bec36a8c87e50945 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/khmer_angkor/ref/kmp.json @@ -0,0 +1,110 @@ +{ + "system": { + "keymanDeveloperVersion": "16.0.60.0", + "fileVersion": "12.0" + }, + "options": { + "readmeFile": "readme.htm", + "graphicFile": "splash.gif" + }, + "info": { + "name": { + "description": "Khmer Angkor" + }, + "copyright": { + "description": "\u00A9 2015-2022 SIL International" + }, + "author": { + "description": "Makara Sok", + "url": "mailto:makara_sok@sil.org" + }, + "version": { + "description": "1.3" + }, + "website": { + "description": "https://keyman.com/keyboards/khmer_angkor", + "url": "https://keyman.com/keyboards/khmer_angkor" + } + }, + "files": [ + { + "name": "khmer_angkor.js", + "description": "File khmer_angkor.js" + }, + { + "name": "khmer_angkor.kvk", + "description": "File khmer_angkor.kvk" + }, + { + "name": "khmer_angkor.kmx", + "description": "Keyboard Khmer Angkor" + }, + { + "name": "keyboard_layout.png", + "description": "File keyboard_layout.png" + }, + { + "name": "welcome.htm", + "description": "File welcome.htm" + }, + { + "name": "FONTLOG.txt", + "description": "File FONTLOG.txt" + }, + { + "name": "Mondulkiri-R.ttf", + "description": "Font Khmer Mondulkiri" + }, + { + "name": "OFL.txt", + "description": "File OFL.txt" + }, + { + "name": "OFL-FAQ.txt", + "description": "File OFL-FAQ.txt" + }, + { + "name": "KAK_Documentation_EN.pdf", + "description": "File KAK_Documentation_EN.pdf" + }, + { + "name": "KAK_Documentation_KH.pdf", + "description": "File KAK_Documentation_KH.pdf" + }, + { + "name": "readme.htm", + "description": "File readme.htm" + }, + { + "name": "image002.png", + "description": "File image002.png" + }, + { + "name": "khmer_busra_kbd.ttf", + "description": "Font KhmerBusraKbd" + }, + { + "name": "splash.gif", + "description": "File splash.gif" + }, + { + "name": "kmp.json", + "description": "Package information (JSON)" + } + ], + "keyboards": [ + { + "name": "Khmer Angkor", + "id": "khmer_angkor", + "version": "1.3", + "oskFont": "khmer_busra_kbd.ttf", + "displayFont": "Mondulkiri-R.ttf", + "languages": [ + { + "name": "Central Khmer (Khmer, Cambodia)", + "id": "km" + } + ] + } + ] +} diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/busrakbd/khmer_busra_kbd.ttf b/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/busrakbd/khmer_busra_kbd.ttf new file mode 100644 index 0000000000000000000000000000000000000000..2169a408930d95128f4d0944aa200718048e8c7d Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/busrakbd/khmer_busra_kbd.ttf differ diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/FONTLOG.txt b/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/FONTLOG.txt new file mode 100644 index 0000000000000000000000000000000000000000..7829f79efc43ec0c494c3afcf38d90d7bcef6e98 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/FONTLOG.txt @@ -0,0 +1,123 @@ +FONTLOG +The Mondulkiri Font Family +Khmer Unicode Fonts +======================== + + +This file provides detailed information on the Khmer Mondulkiri family of fonts. +This information should be distributed along with the Mondulkiri fonts and +any derivative works. + +Basic Font Information +---------------------- + +The Mondulkiri fonts provide Unicode support for the Khmer script. +"Mondulkiri" is the name of a province in north-eastern Cambodia, +These fonts are provided free of charge. Previous versions of the fonts have +been available since 2003 but are now available on the SIL website. + +The following fonts from the Mondulkiri typeface family are included in this +release: + + * Khmer Mondulkiri Regular + * Khmer Mondulkiri Bold + * Khmer Mondulkiri Italic + * Khmer Mondulkiri Bold Italic + * Khmer Busra Regular + * Khmer Busra Bold + * Khmer Busra Italic + * Khmer Busra Bold Italic + +ChangeLog +--------- +(This should list both major and minor changes, most recent first.) +8 September 2014 (Diethelm Kanjahn) Mondulkiri Font Family version 7.100 +- Mondulkiri changes: + * The hinting has been improved, the difference between regular and bold + is visible on screen in much smaller font sizes than before. + * A few bugs were addressed: the disappearing of glyphs on Mac in certain + strings that do not occur in correctly typed text, a positioning problem + in some Tampuan words on Mac, one syllable in Bunong text on Windows/Linux. + * Minor changes in diacritic placement, mostly on Mac. Coeng Kho and coeng + Ttha were modified. + * Glyphs were added - mostly in the phonetic symbols section. The shaping + tables for Mac were streamlined and are now the same as for the Busra font. +- Busra changes: + * The fonts now have AAT tables so that they work on Mac OS X + * many glyphs were added, the glyph range is the same as in Mondulkiri 7.100 + * many glyph shapes and diacritic placements were improved slightly + * the ligatures of some consonants with the ‘sra-a’, ‘sra-oo’ and ‘sra-ou’ + have changed and are now the same as in Mondulkiri. + * hinting has been improved + * most other changes from Mondulkiri 5.300 to 5.513 are now also in Busra 7.100 + * The descender value was changed which may affect line spacing. + +31 October 2012 (Diethelm Kanjahn) Mondulkiri Font Family version 5.300 +- Split Khmer Mondulkiri fonts from older fonts release +- Support for Apple's AAT rendering system (tested in OS X 10.6.8) as well as + Microsoft OpenType tables. +- Support for typographical features to be used under OS X with software that + does support them (like Pages or TextEdit, but apparently not MS Word or + LibreOffice). +- Support for 'Stylistic Sets' that provide similar options in OpenType as the + ‘typographical features’ in OS X. These Stylistic Sets work in Adobe software + (tested with CS5 and 5.5 on PC), but not in MS Word. MS Word 2010 does support + Stylistic Sets, but apparently only for Latin scripts. +- Support for Khmer Unicode in Adobe CS5 and CS5.5. Two of the Stylistic Sets + address the remaining problems. Please refer to the documentation on stylistic + sets. +- Many Latin script characters have been added. The bold fonts now have also + bold Latin characters. +- Some of the vowel-a ligatures have been changed (e.g. Cho-AA). +- Many characters have been slightly modified. Most significantly the ‘hooks’ or + ‘hair’ of some coengs have been removed(e.g. coeng-Kho, coeng-Ha, coeng-Qa). +- The positioning of many characters was modified. +- Many other smaller modifications of glyphs and rules. +- To prevent register shifters from being rendered as subscript + zero-width-non-joiner has now to be inserted before the register shifter in + accordance with The Unicode Standard. Also zero-width-joiner has to be in this + position now to force the alternative rendering. +- Increased the descender by a small amount so that second level elements are no + longer cut off. +- For users of the Tampuan language: coeng-vo after coeng-ro and shifting of + samyuk before reahmuk are now enabled by default. The Tampuan option now only + covers the width of space and the permission to use samyuk after reahmuk. +- The support for the use of vowels and coengs with independent vowels in OS X + is limited. If there is a real need for improvement please contact the font + designer. +- Changed position of quotes (U+2018-9, 201C-D) and mirrored U+201C. + +09 November 2010 (Diethelm Kanjahn) Mondulkiri Font Family version 5.300 +- First version released under the SIL Open Font License +- First version released on http://scripts.sil.org +- Added fonts: Ratanakiri, all italic typefaces +- Renamed fonts: Busra and Oureang +- Major OpenType code revisions +- Corrections of outlines to comply with TTF conventions +- Many small edits of the outlines +- Outlines are now TrueType outlines +- Improved hinting +- Added characters +- Size of Khmer base characters now equivalent to Roman capital letters. + +2005-09-16 (Diethelm Kanjahn) Mondulkiri Font Family version 1.1 + - OpenType and Graphite test fonts + +2003-04-12 (Diethelm Kanjahn) Mondulkiri Font Family version 0.9 +- first public release as legacy fonts + + +Acknowledgements +---------------- + +N: Diethelm Kanjahn +E: fonts@sil.org +W: http://scripts.sil.org/ +D: Designer and font engineer + +For more information please visit The Mondulkiri Font Family page on SIL +International's +Computers and Writing systems website: +http://scripts.sil.org/Mondulkiri + +Support through the website: http://scripts.sil.org/Support diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/Mondulkiri-R.ttf b/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/Mondulkiri-R.ttf new file mode 100644 index 0000000000000000000000000000000000000000..e109ed6028731ccec0909b5174c826428dec81cf Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/Mondulkiri-R.ttf differ diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/OFL-FAQ.txt b/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/OFL-FAQ.txt new file mode 100644 index 0000000000000000000000000000000000000000..0893d7cf52bd807e27a3768b01b087e647bef219 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/OFL-FAQ.txt @@ -0,0 +1,425 @@ +OFL FAQ - Frequently Asked Questions about the SIL Open Font License (OFL) +Version 1.1-update3 - Sept 2013 +(See http://scripts.sil.org/OFL for updates) + + +CONTENTS OF THIS FAQ +1 USING AND DISTRIBUTING FONTS LICENSED UNDER THE OFL +2 USING OFL FONTS FOR WEB PAGES AND ONLINE WEB FONT SERVICES +3 MODIFYING OFL-LICENSED FONTS +4 LICENSING YOUR ORIGINAL FONTS UNDER THE OFL +5 CHOOSING RESERVED FONT NAMES +6 ABOUT THE FONTLOG +7 MAKING CONTRIBUTIONS TO OFL PROJECTS +8 ABOUT THE LICENSE ITSELF +9 ABOUT SIL INTERNATIONAL +APPENDIX A - FONTLOG EXAMPLE + +1 USING AND DISTRIBUTING FONTS LICENSED UNDER THE OFL + +1.1 Can I use the fonts for a book or other print publication, to create logos or other graphics or even to manufacture objects based on their outlines? +Yes. You are very welcome to do so. Authors of fonts released under the OFL allow you to use their font software as such for any kind of design work. No additional license or permission is required, unlike with some other licenses. Some examples of these uses are: logos, posters, business cards, stationery, video titling, signage, t-shirts, personalised fabric, 3D-printed/laser-cut shapes, sculptures, rubber stamps, cookie cutters and lead type. + +1.1.1 Does that restrict the license or distribution of that artwork? +No. You remain the author and copyright holder of that newly derived graphic or object. You are simply using an open font in the design process. It is only when you redistribute, bundle or modify the font itself that other conditions of the license have to be respected (see below for more details). + +1.1.2 Is any kind of acknowledgement required? +No. Font authors may appreciate being mentioned in your artwork's acknowledgements alongside the name of the font, possibly with a link to their website, but that is not required. + +1.2 Can the fonts be included with Free/Libre and Open Source Software collections such as GNU/Linux and BSD distributions and repositories? +Yes! Fonts licensed under the OFL can be freely included alongside other software under FLOSS (Free/Libre and Open Source Software) licenses. Since fonts are typically aggregated with, not merged into, existing software, there is little need to be concerned about incompatibility with existing software licenses. You may also repackage the fonts and the accompanying components in a .rpm or .deb package (or other similar package formats or installers) and include them in distribution CD/DVDs and online repositories. (Also see section 5.9 about rebuilding from source.) + +1.3 I want to distribute the fonts with my program. Does this mean my program also has to be Free/Libre and Open Source Software? +No. Only the portions based on the Font Software are required to be released under the OFL. The intent of the license is to allow aggregation or bundling with software under restricted licensing as well. + +1.4 Can I sell a software package that includes these fonts? +Yes, you can do this with both the Original Version and a Modified Version of the fonts. Examples of bundling made possible by the OFL would include: word processors, design and publishing applications, training and educational software, games and entertainment software, mobile device applications, etc. + +1.5 Can I include the fonts on a CD of freeware or commercial fonts? +Yes, as long some other font or software is also on the disk, so the OFL font is not sold by itself. + +1.6 Why won't the OFL let me sell the fonts alone? +The intent is to keep people from making money by simply redistributing the fonts. The only people who ought to profit directly from the fonts should be the original authors, and those authors have kindly given up potential direct income to distribute their fonts under the OFL. Please honour and respect their contribution! + +1.7 What about sharing OFL fonts with friends on a CD, DVD or USB stick? +You are very welcome to share open fonts with friends, family and colleagues through removable media. Just remember to include the full font package, including any copyright notices and licensing information as available in OFL.txt. In the case where you sell the font, it has to come bundled with software. + +1.8 Can I host the fonts on a web site for others to use? +Yes, as long as you make the full font package available. In most cases it may be best to point users to the main site that distributes the Original Version so they always get the most recent stable and complete version. See also discussion of web fonts in Section 2. + +1.9 Can I host the fonts on a server for use over our internal network? +Yes. If the fonts are transferred from the server to the client computer by means that allow them to be used even if the computer is no longer attached to the network, the full package (copyright notices, licensing information, etc.) should be included. + +1.10 Does the full OFL license text always need to accompany the font? +The only situation in which an OFL font can be distributed without the text of the OFL (either in a separate file or in font metadata), is when a font is embedded in a document or bundled within a program. In the case of metadata included within a font, it is legally sufficient to include only a link to the text of the OFL on http://scripts.sil.org/OFL, but we strongly recommend against this. Most modern font formats include metadata fields that will accept the full OFL text, and full inclusion increases the likelihood that users will understand and properly apply the license. + +1.11 What do you mean by 'embedding'? How does that differ from other means of distribution? +By 'embedding' we mean inclusion of the font in a document or file in a way that makes extraction (and redistribution) difficult or clearly discouraged. In many cases the names of embedded fonts might also not be obvious to those reading the document, the font data format might be altered, and only a subset of the font - only the glyphs required for the text - might be included. Any other means of delivering a font to another person is considered 'distribution', and needs to be accompanied by any copyright notices and licensing information available in OFL.txt. + +1.12 So can I embed OFL fonts in my document? +Yes, either in full or a subset. The restrictions regarding font modification and redistribution do not apply, as the font is not intended for use outside the document. + +1.13 Does embedding alter the license of the document itself? +No. Referencing or embedding an OFL font in any document does not change the license of the document itself. The requirement for fonts to remain under the OFL does not apply to any document created using the fonts and their derivatives. Similarly, creating any kind of graphic using a font under OFL does not make the resulting artwork subject to the OFL. + +1.14 If OFL fonts are extracted from a document in which they are embedded (such as a PDF file), what can be done with them? Is this a risk to author(s)? +The few utilities that can extract fonts embedded in a PDF will typically output limited amounts of outlines - not a complete font. To create a working font from this method is much more difficult and time consuming than finding the source of the original OFL font. So there is little chance that an OFL font would be extracted and redistributed inappropriately through this method. Even so, copyright laws address any misrepresentation of authorship. All Font Software released under the OFL and marked as such by the author(s) is intended to remain under this license regardless of the distribution method, and cannot be redistributed under any other license. We strongly discourage any font extraction - we recommend directly using the font sources instead - but if you extract font outlines from a document, please be considerate: respect the work of the author(s) and the licensing model. + +1.15 What about distributing fonts with a document? Within a compressed folder structure? Is it distribution, bundling or embedding? +Certain document formats may allow the inclusion of an unmodified font within their file structure which may consist of a compressed folder containing the various resources forming the document (such as pictures and thumbnails). Including fonts within such a structure is understood as being different from embedding but rather similar to bundling (or mere aggregation) which the license explicitly allows. In this case the font is conveyed unchanged whereas embedding a font usually transforms it from the original format. The OFL does not allow anyone to extract the font from such a structure to then redistribute it under another license. The explicit permission to redistribute and embed does not cancel the requirement for the Font Software to remain under the license chosen by its author(s). Even if the font travels inside the document as one of its assets, it should not lose its authorship information and licensing. + +1.16 What about ebooks shipping with open fonts? +The requirements differ depending on whether the fonts are linked, embedded or distributed (bundled or aggregated). Some ebook formats use web technologies to do font linking via @font-face, others are designed for font embedding, some use fonts distributed with the document or reading software, and a few rely solely on the fonts already present on the target system. The license requirements depend on the type of inclusion as discussed in 1.15. + +1.17 Can Font Software released under the OFL be subject to URL-based access restrictions methods or DRM (Digital Rights Management) mechanisms? +Yes, but these issues are out-of-scope for the OFL. The license itself neither encourages their use nor prohibits them since such mechanisms are not implemented in the components of the Font Software but through external software. Such restrictions are put in place for many different purposes corresponding to various usage scenarios. One common example is to limit potentially dangerous cross-site scripting attacks. However, in the spirit of libre/open fonts and unrestricted writing systems, we strongly encourage open sharing and reuse of OFL fonts, and the establishment of an environment where such restrictions are unnecessary. Note that whether you wish to use such mechanisms or you prefer not to, you must still abide by the rules set forth by the OFL when using fonts released by their authors under this license. Derivative fonts must be licensed under the OFL, even if they are part of a service for which you charge fees and/or for which access to source code is restricted. You may not sell the fonts on their own - they must be part of a larger software package, bundle or subscription plan. For example, even if the OFL font is distributed in a software package or via an online service using a DRM mechanism, the user would still have the right to extract that font, use, study, modify and redistribute it under the OFL. + +1.18 I've come across a font released under the OFL. How can I easily get more information about the Original Version? How can I know where it stands compared to the Original Version or other Modified Versions? +Consult the copyright statement(s) in the license for ways to contact the original authors. Consult the FONTLOG (see section 6 for more details and examples) for information on how the font differs from the Original Version, and get in touch with the various contributors via the information in the acknowledgement section. Please consider using the Original Versions of the fonts whenever possible. + +1.19 What do you mean in condition 4 of the OFL's permissions and conditions? Can you provide examples of abusive promotion / endorsement / advertisement vs. normal acknowledgement? +The intent is that the goodwill and reputation of the author(s) should not be used in a way that makes it sound like the original author(s) endorse or approve of a specific Modified Version or software bundle. For example, it would not be right to advertise a word processor by naming the author(s) in a listing of software features, or to promote a Modified Version on a web site by saying "designed by ...". However, it would be appropriate to acknowledge the author(s) if your software package has a list of people who deserve thanks. We realize that this can seem to be a grey area, but the standard used to judge an acknowledgement is that if the acknowledgement benefits the author(s) it is allowed, but if it primarily benefits other parties, or could reflect poorly on the author(s), then it is not. + +1.20 I'm writing a small app for mobile platforms, do I need to include the whole package? +If you bundle a font under the OFL with your mobile app you must comply with the terms of the license. At a minimum you must include the copyright statement, the license notice and the license text. A mention of this information in your About box or Changelog, with a link to where the font package is from, is good practice, and the extra space needed to carry these items is very small. You do not, however, need to include the full contents of the font package - only the fonts you use and the copyright and license that apply to them. For example, if you only use the regular weight in your app, you do not need to include the italic and bold versions. + +1.21 What about including OFL fonts by default in my firmware or dedicated operating system? +Many such systems are restricted and turned into appliances so that users cannot study or modify them. Using open fonts to increase quality and language coverage is a great idea, but you need to be aware that if there is a way for users to extract fonts you cannot legally prevent them from doing that. The fonts themselves, including any changes you make to them, must be distributed under the OFL even if your firmware has a more restrictive license. If you do transform the fonts and change their formats when you include them in your firmware you must respect any names reserved by the font authors via the RFN mechanism and pick your own font name. Alternatively if you directly add a font under the OFL to the font folder of your firmware without modifying or optimizing it you are simply bundling the font like with any other software collection, and do not need to make any further changes. + +1.22 Can I make and publish CMS themes or templates that use OFL fonts? Can I include the fonts themselves in the themes or templates? Can I sell the whole package? +Yes, you are very welcome to integrate open fonts into themes and templates for your preferred CMS and make them more widely available. Remember that you can only sell the fonts and your CMS add-on as part of a software bundle. (See 1.4 for details and examples about selling bundles). + +1.23 Can OFL fonts be included in services that deliver fonts to the desktop from remote repositories? Even if they contain both OFL and non-OFL fonts? +Yes. Some foundries have set up services to deliver fonts to subscribers directly to desktops from their online repositories; similarly, plugins are available to preview and use fonts directly in your design tool or publishing suite. These services may mix open and restricted fonts in the same channel, however they should make a clear distinction between them to users. These services should also not hinder users (such as through DRM or obfuscation mechanisms) from extracting and using the OFL fonts in other environments, or continuing to use OFL fonts after subscription terms have ended, as those uses are specifically allowed by the OFL. + +1.24 Can services that provide or distribute OFL fonts restrict my use of them? +No. The terms of use of such services cannot replace or restrict the terms of the OFL, as that would be the same as distributing the fonts under a different license, which is not allowed. You are still entitled to use, modify and redistribute them as the original authors have intended outside of the sole control of that particular distribution channel. Note, however, that the fonts provided by these services may differ from the Original Versions. + + +2 USING OFL FONTS FOR WEBPAGES AND ONLINE WEB FONT SERVICES + +NOTE: This section often refers to a separate paper on 'Web Fonts & RFNs'. This is available at http://scripts.sil.org/OFL_web_fonts_and_RFNs + +2.1 Can I make webpages using these fonts? +Yes! Go ahead! Using CSS (Cascading Style Sheets) is recommended. Your three best options are: +- referring directly in your stylesheet to open fonts which may be available on the user's system +- providing links to download the full package of the font - either from your own website or from elsewhere - so users can install it themselves +- using @font-face to distribute the font directly to browsers. This is recommended and explicitly allowed by the licensing model because it is distribution. The font file itself is distributed with other components of the webpage. It is not embedded in the webpage but referenced through a web address which will cause the browser to retrieve and use the corresponding font to render the webpage (see 1.11 and 1.15 for details related to embedding fonts into documents). As you take advantage of the @font-face cross-platform standard, be aware that web fonts are often tuned for a web environment and not intended for installation and use outside a browser. The reasons in favour of using web fonts are to allow design of dynamic text elements instead of static graphics, to make it easier for content to be localized and translated, indexed and searched, and all this with cross-platform open standards without depending on restricted extensions or plugins. You should check the CSS cascade (the order in which fonts are being called or delivered to your users) when testing. + +2.2 Can I make and use WOFF (Web Open Font Format) versions of OFL fonts? +Yes, but you need to be careful. A change in font format normally is considered modification, and Reserved Font Names (RFNs) cannot be used. Because of the design of the WOFF format, however, it is possible to create a WOFF version that is not considered modification, and so would not require a name change. You are allowed to create, use and distribute a WOFF version of an OFL font without changing the font name, but only if: + +- the original font data remains unchanged except for WOFF compression, and +- WOFF-specific metadata is either omitted altogether or present and includes, unaltered, the contents of all equivalent metadata in the original font. + +If the original font data or metadata is changed, or the WOFF-specific metadata is incomplete, the font must be considered a Modified Version, the OFL restrictions would apply and the name of the font must be changed: any RFNs cannot be used and copyright notices and licensing information must be included and cannot be deleted or modified. You must come up with a unique name - we recommend one corresponding to your domain or your particular web application. Be aware that only the original author(s) can use RFNs. This is to prevent collisions between a derivative tuned to your audience and the original upstream version and so to reduce confusion. + +Please note that most WOFF conversion tools and online services do not meet the two requirements listed above, and so their output must be considered a Modified Version. So be very careful and check to be sure that the tool or service you're using is compressing unchanged data and completely and accurately reflecting the original font metadata. + +2.3 What about other web font formats such as EOT/EOTLite/CWT/etc.? +In most cases these formats alter the original font data more than WOFF, and do not completely support appropriate metadata, so their use must be considered modification and RFNs may not be used. However, there may be certain formats or usage scenarios that may allow the use of RFNs. See http://scripts.sil.org/OFL_web_fonts_and_RFNs + +2.4 Can I make OFL fonts available through web font online services? +Yes, you are welcome to include OFL fonts in online web font services as long as you properly meet all the conditions of the license. The origin and open status of the font should be clear among the other fonts you are hosting. Authorship, copyright notices and license information must be sufficiently visible to your users or subscribers so they know where the font comes from and the rights granted by the author(s). Make sure the font file contains the needed copyright notice(s) and licensing information in its metadata. Please double-check the accuracy of every field to prevent contradictory information. Other font formats, including EOT/EOTLite/CWT and superior alternatives like WOFF, already provide fields for this information. Remember that if you modify the font within your library or convert it to another format for any reason the OFL restrictions apply and you need to change the names accordingly. Please respect the author's wishes as expressed in the OFL and do not misrepresent original designers and their work. Don't lump quality open fonts together with dubious freeware or public domain fonts. Consider how you can best work with the original designers and foundries, support their efforts and generate goodwill that will benefit your service. (See 1.17 for details related to URL-based access restrictions methods or DRM mechanisms). + +2.5 Some web font formats and services provide ways of "optimizing" the font for a particular website or web application; is that allowed? +Yes, it is permitted, but remember that these optimized versions are Modified Versions and so must follow OFL requirements like appropriate renaming. Also you need to bear in mind the other important parameters beyond compression, speed and responsiveness: you need to consider the audience of your particular website or web application, as choosing some optimization parameters may turn out to be less than ideal for them. Subsetting by removing certain glyphs or features may seriously limit functionality of the font in various languages that your users expect. It may also introduce degradation of quality in the rendering or specific bugs on the various target platforms compared to the original font from upstream. In other words, remember that one person's optimized font may be another person's missing feature. Various advanced typographic features (OpenType, Graphite or AAT) are also available through CSS and may provide the desired effects without the need to modify the font. + +2.6 Is subsetting a web font considered modification? +Yes. Removing any parts of the font when delivering a web font to a browser, including unused glyphs and smart font code, is considered modification. This is permitted by the OFL but would not normally allow the use of RFNs. Some newer subsetting technologies may be able to subset in a way that allows users to effectively have access to the complete font, including smart font behaviour. See 2.8 and http://scripts.sil.org/OFL_web_fonts_and_RFNs + +2.7 Are there any situations in which a modified web font could use RFNs? +Yes. If a web font is optimized only in ways that preserve Functional Equivalence (see 2.8), then it may use RFNs, as it reasonably represents the Original Version and respects the intentions of the author(s) and the main purposes of the RFN mechanism (avoids collisions, protects authors, minimizes support, encourages derivatives). However this is technically very difficult and often impractical, so a much better scenario is for the web font service or provider to sign a separate agreement with the author(s) that allows the use of RFNs for Modified Versions. + +2.8 How do you know if an optimization to a web font preserves Functional Equivalence? +Functional Equivalence is described in full in the 'Web fonts and RFNs' paper at http://scripts.sil.org/OFL_web_fonts_and_RFNs, in general, an optimized font is deemed to be Functionally Equivalent (FE) to the Original Version if it: + +- Supports the same full character inventory. If a character can be properly displayed using the Original Version, then that same character, encoded correctly on a web page, will display properly. +- Provides the same smart font behavior. Any dynamic shaping behavior that works with the Original Version should work when optimized, unless the browser or environment does not support it. There does not need to be guaranteed support in the client, but there should be no forced degradation of smart font or shaping behavior, such as the removal or obfuscation of OpenType, Graphite or AAT tables. +- Presents text with no obvious degradation in visual quality. The lettershapes should be equally (or more) readable, within limits of the rendering platform. +- Preserves original author, project and license metadata. At a minimum, this should include: Copyright and authorship; The license as stated in the Original Version, whether that is the full text of the OFL or a link to the web version; Any RFN declarations; Information already present in the font or documentation that points back to the Original Version, such as a link to the project or the author's website. + +If an optimized font meets these requirements, and so is considered to be FE, then it's very likely that the original author would feel that the optimized font is a good and reasonable equivalent. If it falls short of any of these requirements, the optimized font does not reasonably represent the Original Version, and so should be considered to be a Modified Version. Like other Modified Versions, it would not be allowed to use any RFNs and you simply need to pick your own font name. + +2.9 Isn't use of web fonts another form of embedding? +No. Unlike embedded fonts in a PDF, web fonts are not an integrated part of the document itself. They are not specific to a single document and are often applied to thousands of documents around the world. The font data is not stored alongside the document data and often originates from a different location. The ease by which the web fonts used by a document may be identified and downloaded for desktop use demonstrates that they are philosophically and technically separate from the web pages that specify them. See http://scripts.sil.org/OFL_web_fonts_and_RFNs + +2.10 So would it be better to not use RFNs at all if you want your font to be distributed by a web fonts service? +No. Although the OFL does not require authors to use RFNs, the RFN mechanism is an important part of the OFL model and completely compatible with web font services. If that web font service modifies the fonts, then the best solution is to sign a separate agreement for the use of any RFNs. It is perfectly valid for an author to not declare any RFNs, but before they do so they need to fully understand the benefits they are giving up, and the overall negative effect of allowing many different versions bearing the same name to be widely distributed. As a result, we don't generally recommend it. + +2.11 What should an agreement for the use of RFNs say? Are there any examples? +There is no prescribed format for this agreement, as legal systems vary, and no recommended examples. Authors may wish to add specific clauses to further restrict use, require author review of Modified Versions, establish user support mechanisms or provide terms for ending the agreement. Such agreements are usually not public, and apply only to the main parties. However, it would be very beneficial for web font services to clearly state when they have established such agreements, so that the public understands clearly that their service is operating appropriately. + +See the separate paper on 'Web Fonts & RFNs' for in-depth discussion of issues related to the use of RFNs for web fonts. This is available at http://scripts.sil.org/OFL_web_fonts_and_RFNs + + +3 MODIFYING OFL-LICENSED FONTS + +3.1 Can I change the fonts? Are there any limitations to what things I can and cannot change? +You are allowed to change anything, as long as such changes do not violate the terms of the license. In other words, you are not allowed to remove the copyright statement(s) from the font, but you could put additional information into it that covers your contribution. See the placeholders in the OFL header template for recommendations on where to add your own statements. (Remember that, when authors have reserved names via the RFN mechanism, you need to change the internal names of the font to your own font name when making your modified version even if it is just a small change.) + +3.2 I have a font that needs a few extra glyphs - can I take them from an OFL licensed font and copy them into mine? +Yes, but if you distribute that font to others it must be under the OFL, and include the information mentioned in condition 2 of the license. + +3.3 Can I charge people for my additional work? In other words, if I add a bunch of special glyphs or OpenType/Graphite/AAT code, can I sell the enhanced font? +Not by itself. Derivative fonts must be released under the OFL and cannot be sold by themselves. It is permitted, however, to include them in a larger software package (such as text editors, office suites or operating systems), even if the larger package is sold. In that case, you are strongly encouraged, but not required, to also make that derived font easily and freely available outside of the larger package. + +3.4 Can I pay someone to enhance the fonts for my use and distribution? +Yes. This is a good way to fund the further development of the fonts. Keep in mind, however, that if the font is distributed to others it must be under the OFL. You won't be able to recover your investment by exclusively selling the font, but you will be making a valuable contribution to the community. Please remember how you have benefited from the contributions of others. + +3.5 I need to make substantial revisions to the font to make it work with my program. It will be a lot of work, and a big investment, and I want to be sure that it can only be distributed with my program. Can I restrict its use? +No. If you redistribute a Modified Version of the font it must be under the OFL. You may not restrict it in any way beyond what the OFL permits and requires. This is intended to ensure that all released improvements to the fonts become available to everyone. But you will likely get an edge over competitors by being the first to distribute a bundle with the enhancements. Again, please remember how you have benefited from the contributions of others. + +3.6 Do I have to make any derivative fonts (including extended source files, build scripts, documentation, etc.) publicly available? +No, but please consider sharing your improvements with others. You may find that you receive in return more than what you gave. + +3.7 If a trademark is claimed in the OFL font, does that trademark need to remain in modified fonts? +Yes. Any trademark notices must remain in any derivative fonts to respect trademark laws, but you may add any additional trademarks you claim, officially registered or not. For example if an OFL font called "Foo" contains a notice that "Foo is a trademark of Acme", then if you rename the font to "Bar" when creating a Modified Version, the new trademark notice could say "Foo is a trademark of Acme Inc. - Bar is a trademark of Roadrunner Technologies Ltd.". Trademarks work alongside the OFL and are not subject to the terms of the licensing agreement. The OFL does not grant any rights under trademark law. Bear in mind that trademark law varies from country to country and that there are no international trademark conventions as there are for copyright. You may need to significantly invest in registering and defending a trademark for it to remain valid in the countries you are interested in. This may be costly for an individual independent designer. + +3.8 If I commit changes to a font (or publish a branch in a DVCS) as part of a public open source software project, do I have to change the internal font names? +Only if there are declared RFNs. Making a public commit or publishing a public branch is effectively redistributing your modifications, so any change to the font will require that you do not use the RFNs. Even if there are no RFNs, it may be useful to change the name or add a suffix indicating that a particular version of the font is still in development and not released yet. This will clearly indicate to users and fellow designers that this particular font is not ready for release yet. See section 5 for more details. + + +4 LICENSING YOUR ORIGINAL FONTS UNDER THE OFL + +4.1 Can I use the SIL OFL for my own fonts? +Yes! We heartily encourage everyone to use the OFL to distribute their own original fonts. It is a carefully constructed license that allows great freedom along with enough artistic integrity protection for the work of the authors as well as clear rules for other contributors and those who redistribute the fonts. The licensing model is used successfully by various organisations, both for-profit and not-for-profit, to release fonts of varying levels of scope and complexity. + +4.2 What do I have to do to apply the OFL to my font? +If you want to release your fonts under the OFL, we recommend you do the following: + +4.2.1 Put your copyright and Reserved Font Names information at the beginning of the main OFL.txt file in place of the dedicated placeholders (marked with the <> characters). Include this file in your release package. + +4.2.2 Put your copyright and the OFL text with your chosen Reserved Font Name(s) into your font files (the copyright and license fields). A link to the OFL text on the OFL web site is an acceptable (but not recommended) alternative. Also add this information to any other components (build scripts, glyph databases, documentation, test files, etc). Accurate metadata in your font files is beneficial to you as an increasing number of applications are exposing this information to the user. For example, clickable links can bring users back to your website and let them know about other work you have done or services you provide. Depending on the format of your fonts and sources, you can use template human-readable headers or machine-readable metadata. You should also double-check that there is no conflicting metadata in the font itself contradicting the license, such as the fstype bits in the os2 table or fields in the name table. + +4.2.3 Write an initial FONTLOG.txt for your font and include it in the release package (see Section 6 and Appendix A for details including a template). + +4.2.4 Include the relevant practical documentation on the license by adding the current OFL-FAQ.txt file in your package. + +4.2.5 If you wish you can use the OFL graphics (http://scripts.sil.org/OFL_logo) on your website. + +4.3 Will you make my font OFL for me? +We won't do the work for you. We can, however, try to answer your questions, unfortunately we do not have the resources to review and check your font packages for correct use of the OFL. We recommend you turn to designers, foundries or consulting companies with experience in doing open font design to provide this service to you. + +4.4 Will you distribute my OFL font for me? +No, although if the font is of sufficient quality and general interest we may include a link to it on our partial list of OFL fonts on the OFL web site. You may wish to consider other open font catalogs or hosting services, such as the Unifont Font Guide (http://unifont.org/fontguide), The League of Movable Type (http://theleagueofmovabletype.com) or the Open Font Library (http://openfontlibrary.org/), which despite the name has no direct relationship to the OFL or SIL. We do not endorse any particular catalog or hosting service - it is your responsibility to determine if the service is right for you and if it treats authors with fairness. + +4.5 Why should I use the OFL for my fonts? +- to meet needs for fonts that can be modified to support lesser-known languages +- to provide a legal and clear way for people to respect your work but still use it (and reduce piracy) +- to involve others in your font project +- to enable your fonts to be expanded with new weights and improved writing system/language support +- to allow more technical font developers to add features to your design (such as OpenType, Graphite or AAT support) +- to renew the life of an old font lying on your hard drive with no business model +- to allow your font to be included in Libre Software operating systems like Ubuntu +- to give your font world status and wide, unrestricted distribution +- to educate students about quality typeface and font design +- to expand your test base and get more useful feedback +- to extend your reach to new markets when users see your metadata and go to your website +- to get your font more easily into one of the web font online services +- to attract attention for your commercial fonts +- to make money through web font services +- to make money by bundling fonts with applications +- to make money adjusting and extending existing open fonts +- to get a better chance that foundations/NGOs/charities/companies who commission fonts will pick you +- to be part of a sharing design and development community +- to give back and contribute to a growing body of font sources + + +5 CHOOSING RESERVED FONT NAMES + +5.1 What are Reserved Font Names? +These are font names, or portions of font names, that the author has chosen to reserve for use only with the Original Version of the font, or for Modified Version(s) created by the original author. + +5.2 Why can't I use the Reserved Font Names in my derivative font names? I'd like people to know where the design came from. +The best way to acknowledge the source of the design is to thank the original authors and any other contributors in the files that are distributed with your revised font (although no acknowledgement is required). The FONTLOG is a natural place to do this. Reserved Font Names ensure that the only fonts that have the original names are the unmodified Original Versions. This allows designers to maintain artistic integrity while allowing collaboration to happen. It eliminates potential confusion and name conflicts. When choosing a name, be creative and avoid names that reuse almost all the same letters in the same order or sound like the original. It will help everyone if Original Versions and Modified Versions can easily be distinguished from one another and from other derivatives. Any substitution and matching mechanism is outside the scope of the license. + +5.3 What do you mean by "primary name as presented to the user"? Are you referring to the font menu name? +Yes, this applies to the font menu name and other mechanisms that specify a font in a document. It would be fine, however, to keep a text reference to the original fonts in the description field, in your modified source file or in documentation provided alongside your derivative as long as no one could be confused that your modified source is the original. But you cannot use the Reserved Font Names in any way to identify the font to the user (unless the Copyright Holder(s) allow(s) it through a separate agreement). Users who install derivatives (Modified Versions) on their systems should not see any of the original Reserved Font Names in their font menus, for example. Again, this is to ensure that users are not confused and do not mistake one font for another and so expect features only another derivative or the Original Version can actually offer. + +5.4 Am I not allowed to use any part of the Reserved Font Names? +You may not use individual words from the Reserved Font Names, but you would be allowed to use parts of words, as long as you do not use any word from the Reserved Font Names entirely. We do not recommend using parts of words because of potential confusion, but it is allowed. For example, if "Foobar" was a Reserved Font Name, you would be allowed to use "Foo" or "bar", although we would not recommend it. Such an unfortunate choice would confuse the users of your fonts as well as make it harder for other designers to contribute. + +5.5 So what should I, as an author, identify as Reserved Font Names? +Original authors are encouraged to name their fonts using clear, distinct names, and only declare the unique parts of the name as Reserved Font Names. For example, the author of a font called "Foobar Sans" would declare "Foobar" as a Reserved Font Name, but not "Sans", as that is a common typographical term, and may be a useful word to use in a derivative font name. Reserved Font Names should also be single words for simplicity and legibility. A font called "Flowing River" should have Reserved Font Names "Flowing" and "River", not "Flowing River". You also need to be very careful about reserving font names which are already linked to trademarks (whether registered or not) which you do not own. + +5.6 Do I, as an author, have to identify any Reserved Font Names? +No. RFNs are optional and not required, but we encourage you to use them. This is primarily to avoid confusion between your work and Modified Versions. As an author you can release a font under the OFL and not declare any Reserved Font Names. There may be situations where you find that using no RFNs and letting your font be changed and modified - including any kind of modification - without having to change the original name is desirable. However you need to be fully aware of the consequences. There will be no direct way for end-users and other designers to distinguish your Original Version from many Modified Versions that may be created. You have to trust whoever is making the changes and the optimizations to not introduce problematic changes. The RFNs you choose for your own creation have value to you as an author because they allow you to maintain artistic integrity and keep some control over the distribution channel to your end-users. For discussion of RFNs and web fonts see section 2. + +5.7 Are any names (such as the main font name) reserved by default? +No. That is a change to the license as of version 1.1. If you want any names to be Reserved Font Names, they must be specified after the copyright statement(s). + +5.8 Is there any situation in which I can use Reserved Font Names for a Modified Version? +The Copyright Holder(s) can give certain trusted parties the right to use any of the Reserved Font Names through separate written agreements. For example, even if "Foobar" is a RFN, you could write up an agreement to give company "XYZ" the right to distribute a modified version with a name that includes "Foobar". This allows for freedom without confusion. The existence of such an agreement should be made as clear as possible to downstream users and designers in the distribution package and the relevant documentation. They need to know if they are a party to the agreement or not and what they are practically allowed to do or not even if all the details of the agreement are not public. + +5.9 Do font rebuilds require a name change? Do I have to change the name of the font when my packaging workflow includes a full rebuild from source? +Yes, all rebuilds which change the font data and the smart code are Modified Versions and the requirements of the OFL apply: you need to respect what the Author(s) have chosen in terms of Reserved Font Names. However if a package (or installer) is simply a wrapper or a compressed structure around the final font - leaving them intact on the inside - then no name change is required. Please get in touch with the author(s) and copyright holder(s) to inquire about the presence of font sources beyond the final font file(s) and the recommended build path. That build path may very well be non-trivial and hard to reproduce accurately by the maintainer. If a full font build path is made available by the upstream author(s) please be aware that any regressions and changes you may introduce when doing a rebuild for packaging purposes is your own responsibility as a package maintainer since you are effectively creating a separate branch. You should make it very clear to your users that your rebuilt version is not the canonical one from upstream. + +5.10 Can I add other Reserved Font Names when making a derivative font? +Yes. List your additional Reserved Font Names after your additional copyright statement, as indicated with example placeholders at the top of the OFL.txt file. Be sure you do not remove any existing RFNs but only add your own. RFN statements should be placed next to the copyright statement of the relevant author as indicated in the OFL.txt template to make them visible to designers wishing to make their separate version. + + +6 ABOUT THE FONTLOG + +6.1 What is this FONTLOG thing exactly? +It has three purposes: 1) to provide basic information on the font to users and other designers and developers, 2) to document changes that have been made to the font or accompanying files, either by the original authors or others, and 3) to provide a place to acknowledge authors and other contributors. Please use it! + +6.2 Is the FONTLOG required? +It is not a requirement of the license, but we strongly recommend you have one. + +6.3 Am I required to update the FONTLOG when making Modified Versions? +No, but users, designers and other developers might get very frustrated with you if you don't. People need to know how derivative fonts differ from the original, and how to take advantage of the changes, or build on them. There are utilities that can help create and maintain a FONTLOG, such as the FONTLOG support in FontForge. + +6.4 What should the FONTLOG look like? +It is typically a separate text file (FONTLOG.txt), but can take other formats. It commonly includes these four sections: + +- brief header describing the FONTLOG itself and name of the font family +- Basic Font Information - description of the font family, purpose and breadth +- ChangeLog - chronological listing of changes +- Acknowledgements - list of authors and contributors with contact information + +It could also include other sections, such as: where to find documentation, how to make contributions, information on contributing organizations, source code details, and a short design guide. See Appendix A for an example FONTLOG. + + +7 MAKING CONTRIBUTIONS TO OFL PROJECTS + +7.1 Can I contribute work to OFL projects? +In many cases, yes. It is common for OFL fonts to be developed by a team of people who welcome contributions from the wider community. Contact the original authors for specific information on how to participate in their projects. + +7.2 Why should I contribute my changes back to the original authors? +It would benefit many people if you contributed back in response to what you've received. Your contributions and improvements to the fonts and other components could be a tremendous help and would encourage others to contribute as well and 'give back'. You will then benefit from other people's contributions as well. Sometimes maintaining your own separate version takes more effort than merging back with the original. Be aware that any contributions, however, must be either your own original creation or work that you own, and you may be asked to affirm that clearly when you contribute. + +7.3 I've made some very nice improvements to the font. Will you consider adopting them and putting them into future Original Versions? +Most authors would be very happy to receive such contributions. Keep in mind that it is unlikely that they would want to incorporate major changes that would require additional work on their end. Any contributions would likely need to be made for all the fonts in a family and match the overall design and style. Authors are encouraged to include a guide to the design with the fonts. It would also help to have contributions submitted as patches or clearly marked changes - the use of smart source revision control systems like subversion, mercurial, git or bzr is a good idea. Please follow the recommendations given by the author(s) in terms of preferred source formats and configuration parameters for sending contributions. If this is not indicated in a FONTLOG or other documentation of the font, consider asking them directly. Examples of useful contributions are bug fixes, additional glyphs, stylistic alternates (and the smart font code to access them) or improved hinting. Keep in mind that some kinds of changes (esp. hinting) may be technically difficult to integrate. + +7.4 How can I financially support the development of OFL fonts? +It is likely that most authors of OFL fonts would accept financial contributions - contact them for instructions on how to do this. Such contributions would support future development. You can also pay for others to enhance the fonts and contribute the results back to the original authors for inclusion in the Original Version. + + +8 ABOUT THE LICENSE ITSELF + +8.1 I see that this is version 1.1 of the license. Will there be later changes? +Version 1.1 is the first minor revision of the OFL. We are confident that version 1.1 will meet most needs, but are open to future improvements. Any revisions would be for future font releases, and previously existing licenses would remain in effect. No retroactive changes are possible, although the Copyright Holder(s) can re-release the font under a revised OFL. All versions will be available on our web site: http://scripts.sil.org/OFL. + +8.2 Does this license restrict the rights of the Copyright Holder(s)? +No. The Copyright Holder(s) still retain(s) all the rights to their creation; they are only releasing a portion of it for use in a specific way. For example, the Copyright Holder(s) may choose to release a 'basic' version of their font under the OFL, but sell a restricted 'enhanced' version. Only the Copyright Holder(s) can do this. + +8.3 Is the OFL a contract or a license? +The OFL is a license and not a contract and so does not require you to sign it to have legal validity. By using, modifying and redistributing components under the OFL you indicate that you accept the license. + +8.4 I really like the terms of the OFL, but want to change it a little. Am I allowed to take ideas and actual wording from the OFL and put them into my own custom license for distributing my fonts? +We strongly recommend against creating your very own unique open licensing model. Using a modified or derivative license will likely cut you off - along with the font(s) under that license - from the community of designers using the OFL, potentially expose you and your users to legal liabilities, and possibly put your work and rights at risk. The OFL went though a community and legal review process that took years of effort, and that review is only applicable to an unmodified OFL. The text of the OFL has been written by SIL (with review and consultation from the community) and is copyright (c) 2005-2013 SIL International. You may re-use the ideas and wording (in part, not in whole) in another non-proprietary license provided that you call your license by another unambiguous name, that you do not use the preamble, that you do not mention SIL and that you clearly present your license as different from the OFL so as not to cause confusion by being too similar to the original. If you feel the OFL does not meet your needs for an open license, please contact us. + +8.5 Can I translate the license and the FAQ into other languages? +SIL certainly recognises the need for people who are not familiar with English to be able to understand the OFL and its use. Making the license very clear and readable has been a key goal for the OFL, but we know that people understand their own language best. + +If you are an experienced translator, you are very welcome to translate the OFL and OFL-FAQ so that designers and users in your language community can understand the license better. But only the original English version of the license has legal value and has been approved by the community. Translations do not count as legal substitutes and should only serve as a way to explain the original license. SIL - as the author and steward of the license for the community at large - does not approve any translation of the OFL as legally valid because even small translation ambiguities could be abused and create problems. + +SIL gives permission to publish unofficial translations into other languages provided that they comply with the following guidelines: + +- Put the following disclaimer in both English and the target language stating clearly that the translation is unofficial: + +"This is an unofficial translation of the SIL Open Font License into . It was not published by SIL International, and does not legally state the distribution terms for fonts that use the OFL. A release under the OFL is only valid when using the original English text. However, we recognize that this unofficial translation will help users and designers not familiar with English to better understand and use the OFL. We encourage designers who consider releasing their creation under the OFL to read the OFL-FAQ in their own language if it is available. Please go to http://scripts.sil.org/OFL for the official version of the license and the accompanying OFL-FAQ." + +- Keep your unofficial translation current and update it at our request if needed, for example if there is any ambiguity which could lead to confusion. + +If you start such a unofficial translation effort of the OFL and OFL-FAQ please let us know. + + +9 ABOUT SIL INTERNATIONAL + +9.1 Who is SIL International and what do they do? +SIL serves language communities worldwide, building their capacity for sustainable language development, by means of research, translation, training and materials development. SIL makes its services available to all without regard to religious belief, political ideology, gender, race, or ethnic background. SIL's members and volunteers share a Christian commitment. + +9.2 What does this have to do with font licensing? +The ability to read, write, type and publish in one's own language is one of the most critical needs for millions of people around the world. This requires fonts that are widely available and support lesser-known languages. SIL develops - and encourages others to develop - a complete stack of writing systems implementation components available under open licenses. This open stack includes input methods, smart fonts, smart rendering libraries and smart applications. There has been a need for a common open license that is specifically applicable to fonts and related software (a crucial component of this stack), so SIL developed the SIL Open Font License with the help of the Free/Libre and Open Source Software community. + +9.3 How can I contact SIL? +Our main web site is: http://www.sil.org/ +Our site about complex scripts is: http://scripts.sil.org/ +Information about this license (and contact information) is at: http://scripts.sil.org/OFL + + +APPENDIX A - FONTLOG EXAMPLE + +Here is an example of the recommended format for a FONTLOG, although other formats are allowed. + +----- +FONTLOG for the GlobalFontFamily fonts + +This file provides detailed information on the GlobalFontFamily Font Software. This information should be distributed along with the GlobalFontFamily fonts and any derivative works. + +Basic Font Information + +GlobalFontFamily is a Unicode typeface family that supports all languages that use the Latin script and its variants, and could be expanded to support other scripts. + +NewWorldFontFamily is based on the GlobalFontFamily and also supports Greek, Hebrew, Cyrillic and Armenian. + +More specifically, this release supports the following Unicode ranges... +This release contains... +Documentation can be found at... +To contribute to the project... + +ChangeLog + +10 December 2010 (Fred Foobar) GlobalFontFamily-devel version 1.4 +- fix new build and testing system (bug #123456) + +1 August 2008 (Tom Parker) GlobalFontFamily version 1.2.1 +- Tweaked the smart font code (Branch merged with trunk version) +- Provided improved build and debugging environment for smart behaviours + +7 February 2007 (Pat Johnson) NewWorldFontFamily Version 1.3 +- Added Greek and Cyrillic glyphs + +7 March 2006 (Fred Foobar) NewWorldFontFamily Version 1.2 +- Tweaked contextual behaviours + +1 Feb 2005 (Jane Doe) NewWorldFontFamily Version 1.1 +- Improved build script performance and verbosity +- Extended the smart code documentation +- Corrected minor typos in the documentation +- Fixed position of combining inverted breve below (U+032F) +- Added OpenType/Graphite smart code for Armenian +- Added Armenian glyphs (U+0531 -> U+0587) +- Released as "NewWorldFontFamily" + +1 Jan 2005 (Joe Smith) GlobalFontFamily Version 1.0 +- Initial release + +Acknowledgements + +If you make modifications be sure to add your name (N), email (E), web-address (if you have one) (W) and description (D). This list is in alphabetical order. + +N: Jane Doe +E: jane@university.edu +W: http://art.university.edu/projects/fonts +D: Contributor - Armenian glyphs and code + +N: Fred Foobar +E: fred@foobar.org +W: http://foobar.org +D: Contributor - misc Graphite fixes + +N: Pat Johnson +E: pat@fontstudio.org +W: http://pat.fontstudio.org +D: Designer - Greek & Cyrillic glyphs based on Roman design + +N: Tom Parker +E: tom@company.com +W: http://www.company.com/tom/projects/fonts +D: Engineer - original smart font code + +N: Joe Smith +E: joe@fontstudio.org +W: http://joe.fontstudio.org +D: Designer - original Roman glyphs + +Fontstudio.org is an not-for-profit design group whose purpose is... +Foobar.org is a distributed community of developers... +Company.com is a small business who likes to support community designers... +University.edu is a renowned educational institution with a strong design department... +----- + + diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/OFL.txt b/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/OFL.txt new file mode 100644 index 0000000000000000000000000000000000000000..aef2579114f48ceefbafc7f491de92a552d9b4ff --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/khmer_angkor/shared/fonts/khmer/mondulkiri/OFL.txt @@ -0,0 +1,95 @@ +This Font Software is Copyright (c) 2003-2014, SIL International +(http://scripts.sil.org/). with Reserved Font Names "Mondulkiri", +"Busra", "Oureang" and "Ratanakiri". + +This Font Software is licensed under the SIL Open Font License, Version 1.1. +This license is copied below, and is also available with a FAQ at: +http://scripts.sil.org/OFL + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/source/khmer_angkor.kps b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/khmer_angkor.kps new file mode 100644 index 0000000000000000000000000000000000000000..2272334352b39330302e07e51242e2e2152e75e5 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/khmer_angkor.kps @@ -0,0 +1,131 @@ + + + + 15.0.266.0 + 7.0 + + + + readme.htm + splash.gif + + + + + + + + + + Khmer Angkor + © 2015-2022 SIL International + Makara Sok + + https://keyman.com/keyboards/khmer_angkor + + + + ..\build\khmer_angkor.js + File khmer_angkor.js + 0 + .js + + + ..\build\khmer_angkor.kvk + File khmer_angkor.kvk + 0 + .kvk + + + ..\build\khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + welcome\keyboard_layout.png + File keyboard_layout.png + 0 + .png + + + welcome\welcome.htm + File welcome.htm + 0 + .htm + + + ..\shared\fonts\khmer\mondulkiri\FONTLOG.txt + File FONTLOG.txt + 0 + .txt + + + ..\shared\fonts\khmer\mondulkiri\Mondulkiri-R.ttf + Font Khmer Mondulkiri + 0 + .ttf + + + ..\shared\fonts\khmer\mondulkiri\OFL.txt + File OFL.txt + 0 + .txt + + + ..\shared\fonts\khmer\mondulkiri\OFL-FAQ.txt + File OFL-FAQ.txt + 0 + .txt + + + welcome\KAK_Documentation_EN.pdf + File KAK_Documentation_EN.pdf + 0 + .pdf + + + welcome\KAK_Documentation_KH.pdf + File KAK_Documentation_KH.pdf + 0 + .pdf + + + readme.htm + File readme.htm + 0 + .htm + + + welcome\image002.png + File image002.png + 0 + .png + + + ..\shared\fonts\khmer\busrakbd\khmer_busra_kbd.ttf + Font KhmerBusraKbd + 0 + .ttf + + + splash.gif + File splash.gif + 0 + .gif + + + + + Khmer Angkor + khmer_angkor + 1.3 + ..\shared\fonts\khmer\busrakbd\khmer_busra_kbd.ttf + ..\shared\fonts\khmer\mondulkiri\Mondulkiri-R.ttf + + Central Khmer (Khmer, Cambodia) + + + + + diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/source/readme.htm b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/readme.htm new file mode 100644 index 0000000000000000000000000000000000000000..36a95d924820fc8302f8fa27309358db6999118b --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/readme.htm @@ -0,0 +1,23 @@ + + + + + Khmer Angkor Keyboard + + + + +

Khmer Angkor Keyboard

+ +

+ With the users' pitfall in typing Khmer words in mind, Khmer Angkor focuses on the unification of the character orders and spelling rules. These make Khmer Angkor uniquely different from any other keyboards. Khmer Angkor's keyboard layouts were adopted from NiDA keyboard which is widely used at the present. +

+ +

© 2015-2022 SIL International

+ + + diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/source/splash.gif b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/splash.gif new file mode 100644 index 0000000000000000000000000000000000000000..93b44e9d16e3ec69bf9ed5e6d41d5d1af3d44989 Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/splash.gif differ diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/KAK_Documentation_EN.pdf b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/KAK_Documentation_EN.pdf new file mode 100644 index 0000000000000000000000000000000000000000..23b6f62b8fe30dc03dc5eb4f4c41ad26a5a5fe0a Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/KAK_Documentation_EN.pdf differ diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/KAK_Documentation_KH.pdf b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/KAK_Documentation_KH.pdf new file mode 100644 index 0000000000000000000000000000000000000000..85bd8c0b0b71909ce6290a5b86d521b2517de0f1 Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/KAK_Documentation_KH.pdf differ diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/image002.png b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/image002.png new file mode 100644 index 0000000000000000000000000000000000000000..40ea6a2e8e424424d9b2ba73ffaf8116458565c9 Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/image002.png differ diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/keyboard_layout.png b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/keyboard_layout.png new file mode 100644 index 0000000000000000000000000000000000000000..8ca8b04b3373f1512db9b5fa629cbad71c2fab5a Binary files /dev/null and b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/keyboard_layout.png differ diff --git a/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/welcome.htm b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/welcome.htm new file mode 100644 index 0000000000000000000000000000000000000000..124d9d20e66de2fd0d80c96840fdda261a0e89a3 --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/khmer_angkor/source/welcome/welcome.htm @@ -0,0 +1,54 @@ + + + + Khmer Angkor Keyboard + + +

Khmer Angkor Keyboard

+ +

+ Khmer Angkor Keyboard is an OpenSource. It is free and more than just a user you can also contribute to the betterment of the keyboard if you would like to. +

+ +

Keyboards

+

+ With the users' pitfall in typing Khmer words in mind, Khmer Angkor focuses on the unification of the character orders and spelling rules. These make Khmer Angkor uniquely different from any other keyboards. Khmer Angkor's keyboard layouts were adopted from NiDA keyboard which is widely used at the present. + Here is the keyboard layout: +

+ + + + +

You can simply use Khmer Angkor as you would for any NiDA based keyboard. You may type a word in an order of how it is spelled, not how it appears to be, especially when the vowel is to the left of the consonant. For example, to type the word “តែ” which means ‘tea’, one should type the consonant first and then the vowel (i.e. press key “T” and then “Shift E”).

+ +

The order of characters is:

+

Consonant + Subscript(s) + Consonant Shifter + Vowel + Diacritic

+ +

For more details on the Khmer Angkor Keyboard, please find the documentation included in this package.

+ +

Keyboard Documentations

+

For the documentation in English, click here.

+

For the documentation in Khmer, click here.

+ +

Fonts

+

+ To get Khmer fonts, you may visit one of the three sources below: +

+ +

More Information

+

+ +

+ + + + + \ No newline at end of file diff --git a/developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/build/withfolders.qaa.sencoten.model.js b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/build/withfolders.qaa.sencoten.model.js similarity index 100% rename from developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/build/withfolders.qaa.sencoten.model.js rename to developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/build/withfolders.qaa.sencoten.model.js diff --git a/developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/source/welcome.htm b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/welcome.htm similarity index 100% rename from developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/source/welcome.htm rename to developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/welcome.htm diff --git a/developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.kps b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.kps similarity index 93% rename from developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.kps rename to developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.kps index 8e8010a0aa07e5697a65e65f1bcdbe52b94b53c2..960502b6c6c458965f66059beaaebc404dea26eb 100644 --- a/developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.kps +++ b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.kps @@ -4,9 +4,6 @@ 12.0.1500.0 12.0 - - - SENĆOŦEN (Saanich Dialect) Lexical Model © 2019 National Research Council Canada @@ -31,7 +28,6 @@ SENĆOŦEN dictionary withfolders.qaa.sencoten - 1.0.3 North Straits Salish SENĆOŦEN diff --git a/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.ts b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.ts new file mode 100644 index 0000000000000000000000000000000000000000..2a5715fa94a7d3e405ca3148632d4f495d88a24f --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/withfolders.qaa.sencoten.model.ts @@ -0,0 +1,6 @@ +const source: LexicalModelSource = { + format: 'trie-1.0', + sources: ['wordlist.tsv'], + wordBreaker: 'default', +}; +export default source; diff --git a/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/wordlist.tsv b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/wordlist.tsv new file mode 100644 index 0000000000000000000000000000000000000000..a2a1ad5964d68562b455891989f3591b582d175a --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/source/wordlist.tsv @@ -0,0 +1,10 @@ +TŦE 13644 +E 9134 +SEN 4816 +Ȼ 3479 +SW̱ 2621 +NIȽ 2314 +U¸ 2298 +I¸ 1988 +ȻSE 1925 +I 1884 \ No newline at end of file diff --git a/developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/withfolders.qaa.sencoten.model.kmp.intermediate.json b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/withfolders.qaa.sencoten.model.kmp.intermediate.json similarity index 91% rename from developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/withfolders.qaa.sencoten.model.kmp.intermediate.json rename to developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/withfolders.qaa.sencoten.model.kmp.intermediate.json index e8d4ed34f495dfd18f9c9ab9fcbb2286ebe6d3bd..e02186e8d9b2baedd9aa3d0daa70f60cc4c1bd72 100644 --- a/developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/withfolders.qaa.sencoten.model.kmp.intermediate.json +++ b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/withfolders.qaa.sencoten.model.kmp.intermediate.json @@ -22,13 +22,15 @@ "files": [ { "name": "..\\build\\withfolders.qaa.sencoten.model.js", - "description": "Lexical model withfolders.qaa.sencoten.model.js", - "copyLocation": 0 + "description": "Lexical model withfolders.qaa.sencoten.model.js" }, { - "copyLocation": 0, "description": "Welcome file", "name": "welcome.htm" + }, + { + "description": "Package information (JSON)", + "name": "kmp.json" } ], "lexicalModels": [ @@ -47,4 +49,4 @@ ] } ] -} \ No newline at end of file +} diff --git a/developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/withfolders.qaa.sencoten.model.kmp.zipped.json b/developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/withfolders.qaa.sencoten.model.kmp.zipped.json similarity index 100% rename from developer/src/kmlmc/tests/fixtures/withfolders.qaa.sencoten/withfolders.qaa.sencoten.model.kmp.zipped.json rename to developer/src/kmc-package/test/fixtures/withfolders.qaa.sencoten/withfolders.qaa.sencoten.model.kmp.zipped.json diff --git a/developer/src/kmc-package/test/fixtures/xml_kvk_file/source/xml_kvk_file.kps b/developer/src/kmc-package/test/fixtures/xml_kvk_file/source/xml_kvk_file.kps new file mode 100644 index 0000000000000000000000000000000000000000..9378181ad1b28cbf9e9b362b57ff17d0271fd0af --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/xml_kvk_file/source/xml_kvk_file.kps @@ -0,0 +1,46 @@ + + + + 15.0.266.0 + 7.0 + + + + + + + + + + + + + + XML KVK File + 1.3 + + + + xml_kvk_file.kvk + File xml_kvk_file.kvk + 0 + .kvk + + + ../../invalid/khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Khmer + + + + diff --git a/developer/src/kmc-package/test/fixtures/xml_kvk_file/source/xml_kvk_file.kvk b/developer/src/kmc-package/test/fixtures/xml_kvk_file/source/xml_kvk_file.kvk new file mode 100644 index 0000000000000000000000000000000000000000..32f49e3b3363c90f6a0006f0a67ea5b75418d3ed --- /dev/null +++ b/developer/src/kmc-package/test/fixtures/xml_kvk_file/source/xml_kvk_file.kvk @@ -0,0 +1,15 @@ + + +
+ 10.0 + xml_kvk_file + + + +
+ + + ឞ + + +
diff --git a/developer/src/kmc-package/test/helpers/index.ts b/developer/src/kmc-package/test/helpers/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..8250dfd101a0a07fd2966cf3e5537ac3386a92f5 --- /dev/null +++ b/developer/src/kmc-package/test/helpers/index.ts @@ -0,0 +1,17 @@ +/** + * Helpers and utilities for the Mocha tests. + */ +import * as path from 'path'; +import { fileURLToPath } from 'url'; + +/** + * Builds a path to the fixture with the given path components. + * + * e.g., makePathToFixture('example.qaa.trivial') + * e.g., makePathToFixture('example.qaa.trivial', 'model.ts') + * + * @param components One or more path components. + */ + export function makePathToFixture(...components: string[]): string { + return fileURLToPath(new URL(path.join('..', '..', '..', 'test', 'fixtures', ...components), import.meta.url)); +} diff --git a/developer/src/kmc-package/test/test-messages.ts b/developer/src/kmc-package/test/test-messages.ts new file mode 100644 index 0000000000000000000000000000000000000000..48976fc6adbb8db7133ba399e03a6a6424505393 --- /dev/null +++ b/developer/src/kmc-package/test/test-messages.ts @@ -0,0 +1,9 @@ +import 'mocha'; +import { verifyCompilerMessagesObject } from '@keymanapp/developer-test-helpers'; +import { CompilerMessages } from '../src/compiler/messages.js'; + +describe('CompilerMessages', function () { + it('should have a valid CompilerMessages object', function() { + return verifyCompilerMessagesObject(CompilerMessages); + }); +}); diff --git a/developer/src/kmc-package/test/test-package-compiler.ts b/developer/src/kmc-package/test/test-package-compiler.ts new file mode 100644 index 0000000000000000000000000000000000000000..731925a25e64ee24c3b6cf3882ac26684ea9be45 --- /dev/null +++ b/developer/src/kmc-package/test/test-package-compiler.ts @@ -0,0 +1,327 @@ +import 'mocha'; +import * as fs from 'fs'; +import { assert } from 'chai'; +import JSZip from 'jszip'; + +import KEYMAN_VERSION from "@keymanapp/keyman-version"; +import { KmpJsonFile } from '@keymanapp/common-types'; +import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers'; + +import { makePathToFixture } from './helpers/index.js'; + +import { KmpCompiler } from '../src/compiler/kmp-compiler.js'; +import { PackageValidation } from '../src/compiler/package-validation.js'; +import { CompilerMessages } from '../src/compiler/messages.js'; + +const debug = true; + +describe('KmpCompiler', function () { + const MODELS : string[] = [ + 'example.qaa.sencoten', + 'withfolders.qaa.sencoten', + ]; + + const callbacks = new TestCompilerCallbacks(); + let kmpCompiler = new KmpCompiler(callbacks); + + for (let modelID of MODELS) { + const kpsPath = modelID.includes('withfolders') ? + makePathToFixture(modelID, 'source', `${modelID}.model.kps`) : makePathToFixture(modelID, `${modelID}.model.kps`); + const jsPath = modelID.includes('withfolders') ? + makePathToFixture(modelID, 'source', `${modelID}.model.js`) : makePathToFixture(modelID, `${modelID}.model.js`); + const kmpJsonIntermediatePath = makePathToFixture(modelID, `${modelID}.model.kmp.intermediate.json`); + const kmpJsonZippedPath = makePathToFixture(modelID, `${modelID}.model.kmp.zipped.json`); + const kmpJsonIntermediateFixture = JSON.parse(fs.readFileSync(kmpJsonIntermediatePath, 'utf-8')); + const kmpJsonZippedFixture = JSON.parse(fs.readFileSync(kmpJsonZippedPath, 'utf-8')); + + // We override the fixture version so that we can compare with the compiler output + kmpJsonIntermediateFixture.system.keymanDeveloperVersion = KEYMAN_VERSION.VERSION; + + // + // Test just the transform from kps to kmp.json + // + it(`should transform ${modelID}.model.kps to kmp.json`, function () { + let kmpJson: KmpJsonFile.KmpJsonFile; + + assert.doesNotThrow(() => { + kmpJson = kmpCompiler.transformKpsToKmpObject(kpsPath); + }); + + // Test that the kmp.json data is identical + assert.deepEqual(kmpJson, kmpJsonIntermediateFixture); + + // Note that in-memory kmp.json still contains paths in the files array. + // However, when building the .kmp, the final written kmp.json data is + // modified to strip paths. + + // This was used when building initial test data + //fs.writeFileSync(kmpJsonPath, JSON.stringify(kmpJson), 'utf-8'); + }); + it(`should build a full .kmp for ${modelID}`, async function() { + const zip = JSZip(); + // Build kmp.json in memory + const kmpJson: KmpJsonFile.KmpJsonFile = kmpCompiler.transformKpsToKmpObject(kpsPath); + // Build file.kmp in memory + const promise = kmpCompiler.buildKmpFile(kpsPath, kmpJson); + promise.then(data => { + // Check that file.kmp contains just 2 files - kmp.json and file.model.js, + // and that they match exactly what we expect + return zip.loadAsync(data, {checkCRC32: true}).then(zipFile => { + assert.equal(zipFile.length, 2); + return Promise.all([ + zipFile.file("kmp.json").async('uint8array').then(kmpJsonOutput => { + assert.deepEqual(kmpJsonOutput, kmpJsonZippedFixture); + }), + zipFile.file(`${modelID}.model.js`).async('uint8array').then(modelJsFile => { + assert.deepEqual(modelJsFile, fs.readFileSync(jsPath)); + }) + ]); + }); + }); + + return promise; + }); + } + + it('should generates a valid .kmp (zip) file', async function() { + this.timeout(10000); // building a zip file can sometimes be slow + + const kpsPath = makePathToFixture('khmer_angkor', 'source', 'khmer_angkor.kps'); + const kmpJsonRefPath = makePathToFixture('khmer_angkor', 'ref', 'kmp.json'); + + const kmpCompiler = new KmpCompiler(callbacks); + const kmpJsonFixture: KmpJsonFile.KmpJsonFile = JSON.parse(fs.readFileSync(kmpJsonRefPath, 'utf-8')); + + // We override the fixture version so that we can compare with the compiler output + kmpJsonFixture.system.keymanDeveloperVersion = KEYMAN_VERSION.VERSION; + + let kmpJson = null; + assert.doesNotThrow(() => { + kmpJson = kmpCompiler.transformKpsToKmpObject(kpsPath); + }); + + const kmpData = await kmpCompiler.buildKmpFile(kpsPath, kmpJson); + + const zip = JSZip(); + + let jszip = await zip.loadAsync(kmpData); + assert.isNotNull(jszip.file('kmp.json')); // kmp.json should be present + // kmp file should contain the following files + const expectedFiles = [ + 'FONTLOG.txt', 'image002.png', 'KAK_Documentation_EN.pdf', 'KAK_Documentation_KH.pdf', + 'keyboard_layout.png', 'khmer_angkor.js', 'khmer_angkor.kmx', 'khmer_angkor.kvk', + 'khmer_busra_kbd.ttf', 'Mondulkiri-R.ttf', 'OFL.txt', 'OFL-FAQ.txt', 'readme.htm', + 'splash.gif', 'welcome.htm', + 'kmp.json', // standard .kmp metadata file + ]; + + assert.sameMembers(Object.entries(jszip.files).map(([s, o]) => o.name).sort(), + expectedFiles.sort(), + 'khmer_angkor.kmp file should have exactly the expected files'); + + let kmpJsonData = JSON.parse(await jszip.file('kmp.json').async('string')); + assert.deepEqual(kmpJsonData, kmpJsonFixture); + }); + + /* + * Testing Warnings and Errors + */ + + it('should warn on absolute paths', async function() { + this.timeout(10000); // building a zip file can sometimes be slow + + callbacks.clear(); + + const kpsPath = makePathToFixture('absolute_path', 'source', 'absolute_path.kps'); + const kmpCompiler = new KmpCompiler(callbacks); + + let kmpJson: KmpJsonFile.KmpJsonFile = null; + + assert.doesNotThrow(() => { + kmpJson = kmpCompiler.transformKpsToKmpObject(kpsPath); + }); + + await assert.isNull(kmpCompiler.buildKmpFile(kpsPath, kmpJson)); + + if(debug) callbacks.printMessages(); + + assert.lengthOf(callbacks.messages, 2); + assert.deepEqual(callbacks.messages[0].code, CompilerMessages.WARN_AbsolutePath); + assert.deepEqual(callbacks.messages[1].code, CompilerMessages.ERROR_FileDoesNotExist); + }); + + // + // Message tests + // + + function testForMessage(context: Mocha.Context, fixture: string[], messageId?: number) { + context.timeout(10000); + + callbacks.clear(); + + const kpsPath = makePathToFixture(...fixture); + const kmpCompiler = new KmpCompiler(callbacks); + + let kmpJson = kmpCompiler.transformKpsToKmpObject(kpsPath); + if(kmpJson && callbacks.messages.length == 0) { + const validator = new PackageValidation(callbacks); + validator.validate(kpsPath, kmpJson); // we'll ignore return value and rely on the messages + } + + if(kmpJson && callbacks.messages.length == 0) { + // We'll try building the package if we have not yet received any messages + kmpCompiler.buildKmpFile(kpsPath, kmpJson) + } + + if(debug) callbacks.printMessages(); + + if(messageId) { + assert.lengthOf(callbacks.messages, 1); + assert.isTrue(callbacks.hasMessage(messageId)); + } else { + assert.lengthOf(callbacks.messages, 0); + } + } + + // WARN_FileIsNotABinaryKvkFile + + it('should generate WARN_FileIsNotABinaryKvkFile if a non-binary kvk file is included', async function() { + testForMessage(this, ['xml_kvk_file', 'source', 'xml_kvk_file.kps'], CompilerMessages.WARN_FileIsNotABinaryKvkFile); + }); + + it('should not warn if a binary kvk file is included', async function() { + testForMessage(this, ['binary_kvk_file', 'source', 'binary_kvk_file.kps']); + }); + + // ERROR_FollowKeyboardVersionNotAllowedForModelPackages + + it('should generate ERROR_FollowKeyboardVersionNotAllowedForModelPackages if is set for model packages', async function() { + testForMessage(this, ['invalid', 'followkeyboardversion.qaa.sencoten.model.kps'], CompilerMessages.ERROR_FollowKeyboardVersionNotAllowedForModelPackages); + }); + + // ERROR_FollowKeyboardVersionButNoKeyboards + + it('should generate ERROR_FollowKeyboardVersionButNoKeyboards if is set for a package with no keyboards', async function() { + testForMessage(this, ['invalid', 'followkeyboardversion.empty.kps'], CompilerMessages.ERROR_FollowKeyboardVersionButNoKeyboards); + }); + + // ERROR_KeyboardContentFileNotFound + + it('should generate ERROR_KeyboardContentFileNotFound if a is listed in a package but not found in ', async function() { + testForMessage(this, ['invalid', 'keyboardcontentfilenotfound.kps'], CompilerMessages.ERROR_KeyboardContentFileNotFound); + }); + + // ERROR_KeyboardFileNotValid + + it('should generate ERROR_KeyboardFileNotValid if a .kmx is not valid in ', async function() { + testForMessage(this, ['invalid', 'keyboardfilenotvalid.kps'], CompilerMessages.ERROR_KeyboardFileNotValid); + }); + + // INFO_KeyboardFileHasNoKeyboardVersion + + it('should generate INFO_KeyboardFileHasNoKeyboardVersion if is set but keyboard has no version', async function() { + testForMessage(this, ['invalid', 'nokeyboardversion.kps'], CompilerMessages.INFO_KeyboardFileHasNoKeyboardVersion); + }); + + // ERROR_PackageCannotContainBothModelsAndKeyboards + + it('should generate ERROR_PackageCannotContainBothModelsAndKeyboards if package has both keyboards and models', async function() { + testForMessage(this, ['invalid', 'error_package_cannot_contain_both_models_and_keyboards.kps'], CompilerMessages.ERROR_PackageCannotContainBothModelsAndKeyboards); + }); + + // WARN_PackageShouldNotRepeatLanguages (models) + + it('should generate WARN_PackageShouldNotRepeatLanguages if model has same language repeated', async function() { + testForMessage(this, ['invalid', 'keyman.en.warn_package_should_not_repeat_languages.model.kps'], CompilerMessages.WARN_PackageShouldNotRepeatLanguages); + }); + + // WARN_PackageShouldNotRepeatLanguages (keyboards) + + it('should generate WARN_PackageShouldNotRepeatLanguages if keyboard has same language repeated', async function() { + testForMessage(this, ['invalid', 'warn_package_should_not_repeat_languages.kps'], CompilerMessages.WARN_PackageShouldNotRepeatLanguages); + }); + + // WARN_PackageNameDoesNotFollowLexicalModelConventions + + it('should generate WARN_PackageNameDoesNotFollowLexicalModelConventions if filename has wrong conventions', async function() { + testForMessage(this, ['invalid', 'WARN_PackageNameDoesNotFollowLexicalModelConventions.kps'], CompilerMessages.WARN_PackageNameDoesNotFollowLexicalModelConventions); + }); + + // WARN_PackageNameDoesNotFollowKeyboardConventions + + it('should generate WARN_PackageNameDoesNotFollowKeyboardConventions if filename has wrong conventions', async function() { + testForMessage(this, ['invalid', 'WARN_PackageNameDoesNotFollowKeyboardConventions.kps'], CompilerMessages.WARN_PackageNameDoesNotFollowKeyboardConventions); + }); + + // WARN_FileInPackageDoesNotFollowFilenameConventions + + it('should generate WARN_FileInPackageDoesNotFollowFilenameConventions if content filename has wrong conventions', async function() { + testForMessage(this, ['invalid', 'warn_file_in_package_does_not_follow_filename_conventions.kps'], CompilerMessages.WARN_FileInPackageDoesNotFollowFilenameConventions); + testForMessage(this, ['invalid', 'warn_file_in_package_does_not_follow_filename_conventions_2.kps'], CompilerMessages.WARN_FileInPackageDoesNotFollowFilenameConventions); + }); + + // ERROR_PackageNameCannotBeBlank + + it('should generate ERROR_PackageNameCannotBeBlank if package info has empty name', async function() { + testForMessage(this, ['invalid', 'error_package_name_cannot_be_blank.kps'], CompilerMessages.ERROR_PackageNameCannotBeBlank); // blank field + testForMessage(this, ['invalid', 'error_package_name_cannot_be_blank_2.kps'], CompilerMessages.ERROR_PackageNameCannotBeBlank); // missing field + }); + + // ERROR_KeyboardFileNotFound + + it('should generate ERROR_KeyboardFileNotFound if a is listed in a package but not found in ', async function() { + testForMessage(this, ['invalid', 'keyboardfilenotfound.kps'], CompilerMessages.ERROR_KeyboardFileNotFound); + }); + + // WARN_KeyboardVersionsDoNotMatch + + it('should generate WARN_KeyboardVersionsDoNotMatch if two have different versions', async function() { + testForMessage(this, ['invalid', 'warn_keyboard_versions_do_not_match.kps'], CompilerMessages.WARN_KeyboardVersionsDoNotMatch); + }); + + // WARN_KeyboardVersionsDoNotMatchPackageVersion + + it('should generate WARN_KeyboardVersionsDoNotMatchPackageVersion if version does not match package version', async function() { + testForMessage(this, ['invalid', 'warn_keyboard_versions_do_not_match_package_version.kps'], CompilerMessages.WARN_KeyboardVersionsDoNotMatchPackageVersion); + }); + + // ERROR_LanguageTagIsNotValid + + it('should generate ERROR_LanguageTagIsNotValid if keyboard has an invalid language tag', async function() { + testForMessage(this, ['invalid', 'error_language_tag_is_not_valid.kps'], CompilerMessages.ERROR_LanguageTagIsNotValid); + }); + + // WARN_LanguageTagIsNotMinimal + + it('should generate WARN_LanguageTagIsNotMinimal if keyboard has a non-minimal language tag', async function() { + testForMessage(this, ['invalid', 'warn_language_tag_is_not_minimal.kps'], CompilerMessages.WARN_LanguageTagIsNotMinimal); + }); + + // ERROR_MustHaveAtLeastOneLanguage + + it('should generate ERROR_MustHaveAtLeastOneLanguage if model or keyboard has zero language tags', async function() { + testForMessage(this, ['invalid', 'keyman.en.error_must_have_at_least_one_language.model.kps'], + CompilerMessages.ERROR_MustHaveAtLeastOneLanguage); + }); + + // WARN_RedistFileShouldNotBeInPackage + + it('should generate WARN_RedistFileShouldNotBeInPackage if package contains a redist file', async function() { + testForMessage(this, ['invalid', 'warn_redist_file_should_not_be_in_package.kps'], + CompilerMessages.WARN_RedistFileShouldNotBeInPackage); + }); + + // WARN_DocFileDangerous + + it('should generate WARN_DocFileDangerous if package contains a .doc file', async function() { + testForMessage(this, ['invalid', 'warn_doc_file_dangerous.kps'], + CompilerMessages.WARN_DocFileDangerous); + }); + + // ERROR_PackageMustContainAPackageOrAKeyboard + + it('should generate ERROR_PackageMustContainAModelOrAKeyboard if package contains a .doc file', async function() { + testForMessage(this, ['invalid', 'error_package_must_contain_a_model_or_a_keyboard.kps'], + CompilerMessages.ERROR_PackageMustContainAModelOrAKeyboard); + }); +}); diff --git a/developer/src/kmc-package/test/tsconfig.json b/developer/src/kmc-package/test/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..9700969d6220af9e2837776691cc084cda01cf31 --- /dev/null +++ b/developer/src/kmc-package/test/tsconfig.json @@ -0,0 +1,24 @@ +{ + "extends": "../../kmc/tsconfig.kmc-base.json", + + "compilerOptions": { + "rootDir": ".", + "rootDirs": ["./", "../src/"], + "outDir": "../build/test", + "baseUrl": ".", + "allowSyntheticDefaultImports": true, // for jszip + "paths": { + "@keymanapp/developer-test-helpers": ["../../common/web/test-helpers/index"], + }, + }, + "include": [ + "**/test-*.ts", + "helpers/*.ts" + ], + "references": [ + { "path": "../" }, + { "path": "../../../../common/web/types" }, + { "path": "../../../../common/web/keyman-version/tsconfig.esm.json" }, + { "path": "../../common/web/test-helpers/" }, + ] +} \ No newline at end of file diff --git a/developer/src/kmc-package/tsconfig.json b/developer/src/kmc-package/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..8913057047eadc303181a6e070dbb16889d459ed --- /dev/null +++ b/developer/src/kmc-package/tsconfig.json @@ -0,0 +1,16 @@ +{ + "extends": "../kmc/tsconfig.kmc-base.json", + + "compilerOptions": { + "outDir": "build/src/", + "rootDir": "src/", + "allowSyntheticDefaultImports": true, // for jszip + }, + "include": [ + "src/**/*.ts", + ], + "references": [ + { "path": "../../../common/web/keyman-version/tsconfig.esm.json" }, + { "path": "../../../common/web/types" }, + ] +} diff --git a/developer/src/kmc/.eslintrc.cjs b/developer/src/kmc/.eslintrc.cjs new file mode 100644 index 0000000000000000000000000000000000000000..f348275f8a6aed22101ec03bfbfe9218998c4b8a --- /dev/null +++ b/developer/src/kmc/.eslintrc.cjs @@ -0,0 +1,9 @@ +module.exports = { + // extends: ["../../../common/web/eslint/eslintNoNodeImports.js"], + parserOptions: { + project: ["./tsconfig.json", "./test/tsconfig.json"], + }, + rules: { + "prefer-const": "off", // TODO: enable this once infrastructure is in place and cleanup the problem cases + }, +}; diff --git a/developer/src/kmc/Makefile b/developer/src/kmc/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..1078ab1a67f1d7a5fe1436d00bf44ba240547309 --- /dev/null +++ b/developer/src/kmc/Makefile @@ -0,0 +1,39 @@ +# +# Keyman Developer - next generation compiler Makefile +# + +!include ..\Defines.mak + +# We don't depend on configure here because kmc-ldml does that already, +# called from parent folder Makefile +build: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh build + +configure: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh configure + +clean: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh clean + +test: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh test + +# build.sh bundle must be run from shell as it requires a temp folder to be +# passed in. See inst/download.in.mak for instantiation. + +publish: .virtual + $(GIT_BASH_FOR_KEYMAN) build.sh publish + +signcode: + @rem nothing to do + +wrap-symbols: + @rem nothing to do + +test-manifest: + @rem nothing to do + +install: + @rem nothing to do + +!include ..\Target.mak diff --git a/developer/src/kmc/README.md b/developer/src/kmc/README.md new file mode 100644 index 0000000000000000000000000000000000000000..f0c816bbb54b46bdb7e7d5e2752c90d168097787 --- /dev/null +++ b/developer/src/kmc/README.md @@ -0,0 +1,96 @@ +Keyman Developer - Next Generation Compiler +================ + +This package provides the following Keyman **command line tools**: + + - `kmc` — takes **LDML Keyboard .xml sources** and compiles them in to a + KMXPlus **.kmx** file. + - `kmlmc` — takes **lexical model sources** and compiles them in to a **.js** + file. + - `kmlmp` — uses a `.model.kmp` file to generate a redistributable **lexical + model package**. + - `kmlmi` — merges Keyman lexical model `.model_info` files. + +`kmlmc` is intended to be used standalone, or as part of a build system. `kmlmp` +is used only by command line tools. `kmlmi` is used exclusively in the +[lexical-models repository][lexical models]. + +Note: `kmc` will in the future replace `kmlmc`, `kmlmp`, and `kmlmi`. + +In order to build [lexical models][], these tools must be built and compiled. + +[lexical models]: https://github.com/keymanapp/lexical-models + + +Install +------- + +Install `kmc` globally: + + npm install -g @keymanapp/kmc + +kmc Usage +--------- + +To compile an LDML keyboard from its `.xml` source, use `kmc`: + + kmc build my-keyboard.xml --outFile my-keyboard.kmx + +To see more command line options by using the `--help` option: + + kmc --help + +kmlmc Usage +----------- + +To compile a lexical model from its `.model.ts` source, use `kmlmc`: + + kmlmc my-lexical-model.model.ts --outFile my-lexical-model.js + +To see more command line options by using the `--help` option: + + kmlmc --help + kmlmp --help + kmlmi --help + +How to build from source +------------------------ + +Run `build.sh`: + + ./build.sh configure build + +or (less preferably -- build.sh is more efficient): + + nmake configure build + +Once you have `configure`d once, you should not normally need to do it again +unless dependencies change or you clean the build folder. `./build.sh` without +parameters will do the default action, which is `build`. + +TODO: Note that kmc currently depends on kmc-* to have been configured; while +the build of kmc will do the typescript component of the build, it will not be +able to do any other build steps, so you may wish to build each of the +components separately, one time. + +How to run the tests +-------------------- + + ./build.sh test + + +How to prepare bundling for installation +---------------------------------------- + + ./build.sh bundle --build-path + +The temp_path must be a path outside the repository to avoid npm getting +confused by the root package.json. This is called by inst/download.in.mak +normally when building the Keyman Developer installer. + +How to publish to NPM +--------------------- + + ./build.sh publish [--dry-run] + +Publishes the current release to NPM. This should only be run from CI. \ No newline at end of file diff --git a/developer/src/kmc/build.sh b/developer/src/kmc/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..61ccd3bdca7ae0e20829f1cf28dc7c3dff00dac6 --- /dev/null +++ b/developer/src/kmc/build.sh @@ -0,0 +1,145 @@ +#!/usr/bin/env bash +# +# Compiles the developer tools, including the language model compilers. +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +cd "$THIS_SCRIPT_PATH" + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + +builder_describe "Build Keyman Keyboard Compiler kmc" \ + "@/common/include" \ + "@/common/web/keyman-version" \ + "@/common/web/types" \ + "@/developer/src/kmc-kmn" \ + "@/developer/src/kmc-ldml" \ + "@/developer/src/kmc-model" \ + "@/developer/src/kmc-model-info" \ + "@/developer/src/kmc-package" \ + "configure runs 'npm ci' on root folder" \ + "build (default) builds kmc to build/" \ + "clean cleans build/ folder" \ + "bundle creates a bundled version of kmc" \ + "test run automated tests for kmc" \ + "pack build a local .tgz pack for testing (note: all npm modules in the repo will be packed by this script)" \ + "publish publish to npm (note: all npm modules in the repo will be published by this script)" \ + "--build-path=BUILD_PATH build directory for bundle" \ + "--dry-run,-n don't actually publish, just dry run" +builder_describe_outputs \ + configure /node_modules \ + build /developer/src/kmc/build/src/kmc.js + +builder_parse "$@" + +if builder_has_option --dry-run; then + DRY_RUN=--dry-run +else + DRY_RUN= +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action clean; then + rm -rf ./build/ ./tsconfig.tsbuildinfo + builder_finish_action success clean +fi + +function copy_schemas() { + # We need the schema file at runtime and bundled, so always copy it for all actions except `clean` + mkdir -p "$THIS_SCRIPT_PATH/build/src/util/" + cp "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboard.schema.json" "$THIS_SCRIPT_PATH/build/src/util/" + cp "$KEYMAN_ROOT/resources/standards-data/ldml-keyboards/techpreview/ldml-keyboardtest.schema.json" "$THIS_SCRIPT_PATH/build/src/util/" + cp "$KEYMAN_ROOT/common/schemas/kvks/kvks.schema.json" "$THIS_SCRIPT_PATH/build/src/util/" + cp "$KEYMAN_ROOT/common/schemas/kpj/kpj.schema.json" "$THIS_SCRIPT_PATH/build/src/util/" +} + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action configure; then + copy_schemas + verify_npm_setup + builder_finish_action success configure +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action build; then + copy_schemas + npm run build + builder_finish_action success build +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action test; then + copy_schemas + npm test + # TODO: enable c8 (disabled because no coverage at present) + # && c8 --reporter=lcov --reporter=text mocha + builder_finish_action success test +fi + +#------------------------------------------------------------------------------------------------------------------- + +if builder_start_action bundle; then + copy_schemas + + if ! builder_has_option --build-path; then + builder_finish_action "Parameter --build-path is required" bundle + exit 64 + fi + + mkdir -p build/cjs-src + npm run bundle + cp build/cjs-src/* "$BUILD_PATH" + + builder_finish_action success bundle +fi + +#------------------------------------------------------------------------------------------------------------------- + +readonly PACKAGES=( + common/web/keyman-version + common/web/types + common/models/types + core/include/ldml + developer/src/kmc-kmn + developer/src/kmc-ldml + developer/src/kmc-model + developer/src/kmc-model-info + developer/src/kmc-package +) + +if builder_start_action publish; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + + # For now, kmc will have responsibility for publishing keyman-version and + # common-types, as well as all the other dependent modules. In the future, we + # should probably have a top-level npm publish script that publishes all + # modules for a given release version From: #7595 + for package in "${PACKAGES[@]}"; do + "$KEYMAN_ROOT/$package/build.sh" publish $DRY_RUN + done + + # Finally, publish kmc + builder_publish_to_npm + builder_finish_action success publish +elif builder_start_action pack; then + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + + for package in "${PACKAGES[@]}"; do + "$KEYMAN_ROOT/$package/build.sh" pack $DRY_RUN + done + + builder_publish_to_pack + builder_finish_action success pack +fi diff --git a/developer/src/kmc/package.json b/developer/src/kmc/package.json new file mode 100644 index 0000000000000000000000000000000000000000..695ebc96e350528972b4b10e0dd72a40b11c4f24 --- /dev/null +++ b/developer/src/kmc/package.json @@ -0,0 +1,86 @@ +{ + "name": "@keymanapp/kmc", + "description": "Keyman Developer compiler command line tools", + "keywords": [ + "keyboard", + "keyman", + "ldml", + "unicode", + "lexical-model", + "predictive-text" + ], + "scripts": { + "build": "tsc -b", + "bundle": "npm run bundle-kmc && npm run bundle-kmlmc && npm run bundle-kmlmi && npm run bundle-kmlmp", + "bundle-kmc": "esbuild build/src/kmc.js --bundle --platform=node --target=es2022 > build/cjs-src/kmc.cjs", + "bundle-kmlmc": "esbuild build/src/kmlmc.js --bundle --platform=node --target=es2022 > build/cjs-src/kmlmc.cjs", + "bundle-kmlmi": "esbuild build/src/kmlmi.js --bundle --platform=node --target=es2022 > build/cjs-src/kmlmi.cjs", + "bundle-kmlmp": "esbuild build/src/kmlmp.js --bundle --platform=node --target=es2022 > build/cjs-src/kmlmp.cjs", + "test": "eslint . && cd test && tsc -b && cd .. && mocha", + "prepublishOnly": "npm run build" + }, + "type": "module", + "author": "Marc Durdin (https://github.com/mcdurdin)", + "contributors": [ + "Eddie Antonio Santos ", + "Joshua Horton" + ], + "license": "MIT", + "bugs": { + "url": "https://github.com/keymanapp/keyman/issues" + }, + "main": "build/src/kmc.js", + "bin": { + "kmc": "build/src/kmc.js", + "kmlmc": "build/src/kmlmc.js", + "kmlmp": "build/src/kmlmp.js", + "kmlmi": "build/src/kmlmi.js" + }, + "dependencies": { + "@keymanapp/keyman-version": "*", + "@keymanapp/common-types": "*", + "@keymanapp/kmc-kmn": "*", + "@keymanapp/kmc-ldml": "*", + "@keymanapp/kmc-model": "*", + "@keymanapp/kmc-model-info": "*", + "@keymanapp/kmc-package": "*", + "@keymanapp/models-types": "*", + "commander": "^10.0.0" + }, + "files": [ + "build/src/" + ], + "devDependencies": { + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "esbuild": "^0.15.8", + "mocha": "^8.4.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" + }, + "mocha": { + "spec": "build/test/**/test-*.js", + "require": [ + "source-map-support/register" + ] + }, + "c8": { + "all": true, + "src": [ + "src/" + ], + "exclude-after-remap": true, + "exclude": [ + "test/" + ] + }, + "repository": { + "type": "git", + "url": "git+https://github.com/keymanapp/keyman.git" + } +} diff --git a/developer/src/kmc/src/commands/build.ts b/developer/src/kmc/src/commands/build.ts new file mode 100644 index 0000000000000000000000000000000000000000..f21356577c2d953b3ba74eedae59c567dd9d5434 --- /dev/null +++ b/developer/src/kmc/src/commands/build.ts @@ -0,0 +1,76 @@ +import * as fs from 'fs'; +import { Command } from 'commander'; +import { BuildActivityOptions } from './build/BuildActivity.js'; +import { buildActivities } from './build/buildActivities.js'; +import { BuildProject, PROJECT_EXTENSION } from './build/BuildProject.js'; +import { NodeCompilerCallbacks } from '../messages/NodeCompilerCallbacks.js'; +import { InfrastructureMessages } from '../messages/messages.js'; + +export function declareBuild(program: Command) { + program + .command('build [infile...]') + .description('Build a source file into a final file') + .option('-d, --debug', 'Include debug information in output') + .option('-o, --out-file ', 'Override the default path and filename for the output file') + .option('--no-compiler-version', 'Exclude compiler version metadata from output') + .option('-w, --compiler-warnings-as-errors', 'Causes warnings to fail the build') + .option('--no-warn-deprecated-code', 'Turn off warnings for deprecated code styles') + .action(async (filenames: string[], options: any) => { + if(!filenames.length) { + // If there are no filenames provided, then we are building the current + // folder ('.') as a project-style build + filenames.push('.'); + } + + for(let filename of filenames) { + if(!await build(filename, options)) { + // Once a file fails to build, we bail on subsequent builds + // TODO: is this the most appropriate semantics? + process.exit(1); + } + } + }); +} + +async function build(filename: string, options: BuildActivityOptions): Promise { + let callbacks = new NodeCompilerCallbacks(); + + try { + callbacks.reportMessage(InfrastructureMessages.Info_BuildingFile({filename})); + + if(!fs.existsSync(filename)) { + callbacks.reportMessage(InfrastructureMessages.Error_FileDoesNotExist({filename})); + return false; + } + + let builder = null; + + // If infile is a directory, then we treat that as a project and build it + if(fs.statSync(filename).isDirectory() || filename.toLowerCase().endsWith(PROJECT_EXTENSION)) { + builder = new BuildProject(); + } else { + // Otherwise, if it's one of our known file extensions, we build it + let extensions: string[] = []; + builder = buildActivities.find(build => { + extensions.push(build.sourceExtension); + return filename.toLowerCase().endsWith(build.sourceExtension); + }); + if(!builder) { + callbacks.reportMessage(InfrastructureMessages.Error_FileTypeNotRecognized({filename, extensions: extensions.join(', ')})); + return false; + } + } + + let result = await builder.build(filename, callbacks, options); + if(result) { + callbacks.reportMessage(InfrastructureMessages.Info_FileBuiltSuccessfully({filename})); + } else { + callbacks.reportMessage(InfrastructureMessages.Info_FileNotBuiltSuccessfully({filename})); + } + + return result; + } catch(e) { + callbacks.reportMessage(InfrastructureMessages.Fatal_UnexpectedException({e})); + return false; + } +} diff --git a/developer/src/kmc/src/commands/build/BuildActivity.ts b/developer/src/kmc/src/commands/build/BuildActivity.ts new file mode 100644 index 0000000000000000000000000000000000000000..83f5aa4aba3a1ff04db184425445da099918475d --- /dev/null +++ b/developer/src/kmc/src/commands/build/BuildActivity.ts @@ -0,0 +1,23 @@ +import { CompilerCallbacks } from "@keymanapp/common-types"; +import { escapeRegExp } from "../../util/escapeRegExp.js"; + +export interface BuildActivityOptions { + debug?: boolean; + outFile?: string; + compilerVersion?: boolean; + warnDeprecatedCode?: boolean; + compilerWarningsAsErrors?: boolean; +}; + +export abstract class BuildActivity { + public abstract get name(): string; + public abstract get sourceExtension(): string; + public abstract get compiledExtension(): string; + public abstract get description(): string; + public abstract build(infile: string, callbacks: CompilerCallbacks, options: BuildActivityOptions): Promise; + protected getOutputFilename(infile: string, options: BuildActivityOptions): string { + return options.outFile ? + options.outFile : + infile.replace(new RegExp(escapeRegExp(this.sourceExtension), "g"), this.compiledExtension); + } +}; \ No newline at end of file diff --git a/developer/src/kmc/src/commands/build/BuildKmnKeyboard.ts b/developer/src/kmc/src/commands/build/BuildKmnKeyboard.ts new file mode 100644 index 0000000000000000000000000000000000000000..9055e2862b7b1c81e52eea12bf3d552e9b1e2e0a --- /dev/null +++ b/developer/src/kmc/src/commands/build/BuildKmnKeyboard.ts @@ -0,0 +1,52 @@ +import * as path from 'path'; +import { BuildActivity, BuildActivityOptions } from './BuildActivity.js'; +import { KmnCompiler } from '@keymanapp/kmc-kmn'; +import { platform } from 'os'; +import { CompilerCallbacks } from '@keymanapp/common-types'; + +export class BuildKmnKeyboard extends BuildActivity { + public get name(): string { return 'Keyman keyboard'; } + public get sourceExtension(): string { return '.kmn'; } + public get compiledExtension(): string { return '.kmx'; } + public get description(): string { return 'Build a Keyman keyboard'; } + public async build(infile: string, callbacks: CompilerCallbacks, options: BuildActivityOptions): Promise { + let compiler = new KmnCompiler(); + if(!await compiler.init(callbacks)) { + return false; + } + + // We need to resolve paths to absolute paths before calling kmc-kmn + let outfile = this.getOutputFilename(infile, options); + + infile = getPosixAbsolutePath(infile); + outfile = getPosixAbsolutePath(outfile); + + // TODO: Currently this only builds .kmn->.kmx, and targeting .js is as-yet unsupported + // TODO: Support additional options compilerWarningsAsErrors, warnDeprecatedCode + return compiler.run(infile, outfile, + { + saveDebug: options.debug, + shouldAddCompilerVersion: options.compilerVersion, + warnDeprecatedCode: options.warnDeprecatedCode, + compilerWarningsAsErrors: options.compilerWarningsAsErrors, + }); + } +} + +function getPosixAbsolutePath(filename: string): string { + if(platform() == 'win32') { + // On Win32, we need to use backslashes for path.resolve to work + filename = filename.replace(/\//g, '\\'); + } + + // Resolve to a fully qualified absolute path + filename = path.resolve(filename); + + if(platform() == 'win32') { + // Ensure that we convert the result back to posix-style paths which is what + // kmc-kmn expects. On posix platforms, we assume paths have forward slashes + // already + filename = filename.replace(/\\/g, '/'); + } + return filename; +} diff --git a/developer/src/kmc/src/commands/build/BuildLdmlKeyboard.ts b/developer/src/kmc/src/commands/build/BuildLdmlKeyboard.ts new file mode 100644 index 0000000000000000000000000000000000000000..024f7f534002f6231322b561c7b36c0315debe04 --- /dev/null +++ b/developer/src/kmc/src/commands/build/BuildLdmlKeyboard.ts @@ -0,0 +1,87 @@ +import * as path from 'path'; +import * as fs from 'fs'; +import * as kmcLdml from '@keymanapp/kmc-ldml'; +import { KvkFileWriter, CompilerCallbacks } from '@keymanapp/common-types'; +import { BuildActivity, BuildActivityOptions } from './BuildActivity.js'; + +export class BuildLdmlKeyboard extends BuildActivity { + public get name(): string { return 'LDML keyboard'; } + public get sourceExtension(): string { return '.xml'; } + public get compiledExtension(): string { return '.kmx'; } + public get description(): string { return 'Build a LDML keyboard'; } + public async build(infile: string, callbacks: CompilerCallbacks, options: BuildActivityOptions): Promise { + // TODO-LDML: consider hardware vs touch -- touch-only layout will not have a .kvk + // Compile: + let [kmx,kvk,kmw] = buildLdmlKeyboardToMemory(infile, callbacks, options); + // Output: + + const fileBaseName = options.outFile ?? infile; + const outFileBase = path.basename(fileBaseName, path.extname(fileBaseName)); + const outFileDir = path.dirname(fileBaseName); + + if(kmx && kvk) { + const outFileKmx = path.join(outFileDir, outFileBase + '.kmx'); + console.log(`Writing compiled keyboard to ${outFileKmx}`); + fs.writeFileSync(outFileKmx, kmx); + + const outFileKvk = path.join(outFileDir, outFileBase + '.kvk'); + console.log(`Writing compiled visual keyboard to ${outFileKvk}`); + fs.writeFileSync(outFileKvk, kvk); + } else { + console.error(`An error occurred compiling ${infile}`); + return false; + } + + if(kmw) { + const outFileKmw = path.join(outFileDir, outFileBase + '.js'); + console.log(`Writing compiled js keyboard to ${outFileKmw}`); + fs.writeFileSync(outFileKmw, kmw); + } + + return true; + } +} + +function buildLdmlKeyboardToMemory(inputFilename: string, callbacks: CompilerCallbacks, options: BuildActivityOptions): [Uint8Array, Uint8Array, Uint8Array] { + let compilerOptions: kmcLdml.CompilerOptions = { + debug: options.debug ?? false, + addCompilerVersion: options.compilerVersion ?? true, + // TODO: warnDeprecatedCode: options.warnDeprecatedCode, + // TODO: treatWarningsAsErrors: options.treatWarningsAsErrors, + } + + const k = new kmcLdml.LdmlKeyboardCompiler(callbacks, options); + let source = k.load(inputFilename); + if (!source) { + return [null, null, null]; + } + let kmx = k.compile(source); + if (!kmx) { + return [null, null, null]; + } + + // In order for the KMX file to be loaded by non-KMXPlus components, it is helpful + // to duplicate some of the metadata + kmcLdml.KMXPlusMetadataCompiler.addKmxMetadata(kmx.kmxplus, kmx.keyboard, compilerOptions); + + // Use the builder to generate the binary output file + const builder = new kmcLdml.KMXBuilder(kmx, options.debug); + const kmx_binary = builder.compile(); + + const vkcompiler = new kmcLdml.LdmlKeyboardVisualKeyboardCompiler(); + const vk = vkcompiler.compile(source); + const writer = new KvkFileWriter(); + const kvk_binary = writer.write(vk); + + // Note: we could have a step of generating source files here + // KvksFileWriter()... + // const tlcompiler = new kmc.TouchLayoutCompiler(); + // const tl = tlcompiler.compile(source); + // const tlwriter = new TouchLayoutFileWriter(); + const kmwcompiler = new kmcLdml.LdmlKeyboardKeymanWebCompiler(callbacks, compilerOptions); + const kmw_string = kmwcompiler.compile(inputFilename, source); + const encoder = new TextEncoder(); + const kmw_binary = encoder.encode(kmw_string); + + return [kmx_binary, kvk_binary, kmw_binary]; +} diff --git a/developer/src/kmc/src/commands/build/BuildModel.ts b/developer/src/kmc/src/commands/build/BuildModel.ts new file mode 100644 index 0000000000000000000000000000000000000000..c6819aa07b023c0c0ba0420c1589b68a968dc190 --- /dev/null +++ b/developer/src/kmc/src/commands/build/BuildModel.ts @@ -0,0 +1,33 @@ +import * as fs from 'fs'; +import { BuildActivity, BuildActivityOptions } from './BuildActivity.js'; +import { compileModel } from '@keymanapp/kmc-model'; +import { CompilerCallbacks } from '@keymanapp/common-types'; + +export class BuildModel extends BuildActivity { + public get name(): string { return 'Lexical model'; } + public get sourceExtension(): string { return '.model.ts'; } + public get compiledExtension(): string { return '.model.js'; } + public get description(): string { return 'Build a lexical model'; } + public async build(infile: string, callbacks: CompilerCallbacks, options: BuildActivityOptions): Promise { + let outputFilename: string = this.getOutputFilename(infile, options); + let code = null; + + // Compile: + try { + code = compileModel(infile, callbacks); + } catch(e) { + console.error(e); + return false; + } + + if(!code) { + console.error('Compilation failed.') + return false; + } + + // Output: + fs.writeFileSync(outputFilename, code, 'utf8'); + + return true; + } +} \ No newline at end of file diff --git a/developer/src/kmc/src/commands/build/BuildPackage.ts b/developer/src/kmc/src/commands/build/BuildPackage.ts new file mode 100644 index 0000000000000000000000000000000000000000..3c7c81f6a8bd2ba1358786e09203a7477764a53f --- /dev/null +++ b/developer/src/kmc/src/commands/build/BuildPackage.ts @@ -0,0 +1,46 @@ +import * as fs from 'fs'; +import { BuildActivity, BuildActivityOptions } from './BuildActivity.js'; +import { CompilerCallbacks } from '@keymanapp/common-types'; +import { KmpCompiler, PackageValidation } from '@keymanapp/kmc-package'; + +export class BuildPackage extends BuildActivity { + public get name(): string { return 'Package'; } + public get sourceExtension(): string { return '.kps'; } + public get compiledExtension(): string { return '.kmp'; } + public get description(): string { return 'Build a Keyman package'; } + public async build(infile: string, callbacks: CompilerCallbacks, options: BuildActivityOptions): Promise { + + const outfile = this.getOutputFilename(infile, options); + + // + // Load .kps source data + // + + const kmpCompiler = new KmpCompiler(callbacks); + const kmpJsonData = kmpCompiler.transformKpsToKmpObject(infile); + if(!kmpJsonData) { + return false; + } + + // + // Validate the package file + // + + const validation = new PackageValidation(callbacks); + if(!validation.validate(infile, kmpJsonData)) { + return false; + } + + // + // Build the .kmp package file + // + + const data = await kmpCompiler.buildKmpFile(infile, kmpJsonData); + if(!data) { + return false; + } + + fs.writeFileSync(outfile, data, 'binary'); + return true; + } +} diff --git a/developer/src/kmc/src/commands/build/BuildProject.ts b/developer/src/kmc/src/commands/build/BuildProject.ts new file mode 100644 index 0000000000000000000000000000000000000000..a6c7b249683546de38c58522d36be979b0d94dfd --- /dev/null +++ b/developer/src/kmc/src/commands/build/BuildProject.ts @@ -0,0 +1,131 @@ +import * as path from 'path'; +import * as fs from 'fs'; +import { CompilerCallbacks, KeymanDeveloperProject, KPJFileReader } from '@keymanapp/common-types'; +import { KeymanDeveloperProjectFile } from '../../../../../../common/web/types/src/kpj/keyman-developer-project.js'; +import { BuildActivity, BuildActivityOptions } from './BuildActivity.js'; +import { buildActivities } from './buildActivities.js'; +import { InfrastructureMessages } from '../../messages/messages.js'; + +export const PROJECT_EXTENSION = '.kpj'; + +export class BuildProject extends BuildActivity { + public get name(): string { return 'Project'; } + public get sourceExtension(): string { return PROJECT_EXTENSION; } + public get compiledExtension(): string { return null; } + public get description(): string { return 'Build a keyboard or lexical model project'; } + public async build(infile: string, callbacks: CompilerCallbacks, options: BuildActivityOptions): Promise { + let builder = new ProjectBuilder(infile, callbacks, options); + return builder.run(); + } +} + +class ProjectBuilder { + callbacks: CompilerCallbacks; + infile: string; + options: BuildActivityOptions; + project: KeymanDeveloperProject; + + constructor(infile: string, callbacks: CompilerCallbacks, options: BuildActivityOptions) { + this.infile = path.resolve(infile); + this.callbacks = callbacks; + this.options = options; + } + + async run(): Promise { + if(this.options.outFile) { + this.callbacks.reportMessage(InfrastructureMessages.Error_OutFileNotValidForProjects()); + return false; + } + + this.project = this.loadProject(); + if(!this.project) { + return false; + } + + // Go through the various file types and build them + for(let builder of buildActivities) { + if(builder.sourceExtension == PROJECT_EXTENSION) { + // We don't support nested projects + continue; + } + + if(!await this.buildProjectTargets(builder)) { + return false; + } + } + + // TODO: generate .keyboard_info from .kps + etc (and support merge of + // $PROJECTPATH/.keyboard_info for version 1.0 projects) + + return true; + } + + loadProject(): KeymanDeveloperProject { + // TODO: callbacks.reportMessage on exceptions + // TODO: version 2.0 projects are folder-based and scan source/ folder for valid + // files. .kpj need not exist, but if it does, is used just for options. + + this.infile = path.resolve(this.infile.replace(/\\/g, '/')); + + if(fs.statSync(this.infile).isDirectory()) { + // This is a project folder, look for folder-name.kpj + this.infile = path.join(this.infile, path.basename(this.infile) + '.kpj'); + } + + const project = fs.existsSync(this.infile) ? + this.loadProjectFromFile() : + this.loadDefaultProjectFromFolder(); + + return project; + } + + loadDefaultProjectFromFolder() { + // The folder does not contain a .kpj, so construct a default 2.0 .kpj + const project = new KeymanDeveloperProject(this.infile, '2.0', this.callbacks); + project.populateFiles(); + return project; + } + + loadProjectFromFile(): KeymanDeveloperProject { + const kpjData = this.callbacks.loadFile(this.infile); + const reader = new KPJFileReader(this.callbacks); + const kpj = reader.read(kpjData); + const schema = this.callbacks.loadSchema('kpj'); + try { + reader.validate(kpj, schema); + } catch(e) { + this.callbacks.reportMessage(InfrastructureMessages.Error_InvalidProjectFile({message: (e??'').toString()})); + return null; + } + const project = reader.transform(this.infile, kpj); + return project; + } + + async buildProjectTargets(activity: BuildActivity): Promise { + let result = true; + for(let file of this.project.files) { + if(file.fileType.toLowerCase() == activity.sourceExtension) { + result = await this.buildTarget(file, activity) && result; + } + } + return result; + } + + async buildTarget(file: KeymanDeveloperProjectFile, activity: BuildActivity): Promise { + const options = {...this.options}; + options.outFile = this.project.resolveOutputFilePath(file, activity.sourceExtension, activity.compiledExtension); + const infile = this.project.resolveInputFilePath(file); + this.callbacks.reportMessage(InfrastructureMessages.Info_BuildingFile({filename: infile})); + + fs.mkdirSync(path.dirname(options.outFile), {recursive:true}); + + let result = await activity.build(infile, this.callbacks, options); + if(result) { + this.callbacks.reportMessage(InfrastructureMessages.Info_FileBuiltSuccessfully({filename: path.basename(infile)})); + } else { + this.callbacks.reportMessage(InfrastructureMessages.Info_FileNotBuiltSuccessfully({filename: path.basename(infile)})); + } + return result; + } + +} \ No newline at end of file diff --git a/developer/src/kmc/src/commands/build/buildActivities.ts b/developer/src/kmc/src/commands/build/buildActivities.ts new file mode 100644 index 0000000000000000000000000000000000000000..4e87f55e6cb9d70cea2fb701681d92db90a59da5 --- /dev/null +++ b/developer/src/kmc/src/commands/build/buildActivities.ts @@ -0,0 +1,18 @@ +import { BuildActivity } from './BuildActivity.js'; +import { BuildKmnKeyboard } from './BuildKmnKeyboard.js'; +import { BuildLdmlKeyboard } from './BuildLdmlKeyboard.js'; +import { BuildModel } from './BuildModel.js'; +import { BuildPackage } from './BuildPackage.js'; + +// These builders are listed in the order that files need to be built in +// projects. Packages depend on .kmn, .xml and .model.ts file types +export const buildActivities: BuildActivity[] = [ + new BuildKmnKeyboard(), + new BuildLdmlKeyboard(), + new BuildModel(), + new BuildPackage() +]; + +// Note: BuildProject is not listed here to avoid circular references, +// because it depends on the other activities here. This means that +// BuildProject must be separately checked. diff --git a/developer/src/kmc/src/commands/buildTestData.ts b/developer/src/kmc/src/commands/buildTestData.ts new file mode 100644 index 0000000000000000000000000000000000000000..3878eedeee2e0cf540084c5ad2eb012a6100d26d --- /dev/null +++ b/developer/src/kmc/src/commands/buildTestData.ts @@ -0,0 +1,14 @@ + + +import { Command } from 'commander'; +import { buildTestData } from './buildTestData/index.js'; + +export function declareBuildTestData(program: Command) { + program + .command('build-test-data ') + .description('Convert keyboard test .xml to .json') + .option('-o, --out-file ', 'where to save the resulting .json file') + .action(buildTestData); +} + + diff --git a/developer/src/kmc/src/commands/buildTestData/index.ts b/developer/src/kmc/src/commands/buildTestData/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..0990b91edb55de750acdb544ffa0a6e1105cbd09 --- /dev/null +++ b/developer/src/kmc/src/commands/buildTestData/index.ts @@ -0,0 +1,38 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import * as kmc from '@keymanapp/kmc-ldml'; +import { CompilerCallbacks, LDMLKeyboardTestDataXMLSourceFile } from '@keymanapp/common-types'; +import { NodeCompilerCallbacks } from '../../messages/NodeCompilerCallbacks.js'; + +export interface BuildTestDataOptions { + outFile?: string; +}; + +export function buildTestData(infile: string, options: BuildTestDataOptions) { + let compilerOptions: kmc.CompilerOptions = { + debug: false, + addCompilerVersion: false + }; + + let testData = loadTestData(infile, compilerOptions); + if (!testData) { + return; + } + + const fileBaseName = options.outFile ?? infile; + const outFileBase = path.basename(fileBaseName, path.extname(fileBaseName)); + const outFileDir = path.dirname(fileBaseName); + const outFileJson = path.join(outFileDir, outFileBase + '.json'); + console.log(`Writing JSON test data to ${outFileJson}`); + fs.writeFileSync(outFileJson, JSON.stringify(testData, null, ' ')); +} + +function loadTestData(inputFilename: string, options: kmc.CompilerOptions): LDMLKeyboardTestDataXMLSourceFile { + const c: CompilerCallbacks = new NodeCompilerCallbacks(); + const k = new kmc.LdmlKeyboardCompiler(c, options); + let source = k.loadTestData(inputFilename); + if (!source) { + return null; + } + return source; +} diff --git a/developer/src/kmc/src/kmc.ts b/developer/src/kmc/src/kmc.ts new file mode 100644 index 0000000000000000000000000000000000000000..c75286c29eb7d67a9c98c1334e761327af8d253f --- /dev/null +++ b/developer/src/kmc/src/kmc.ts @@ -0,0 +1,47 @@ +#!/usr/bin/env node +/** + * kmc - Keyman Next Generation Compiler + */ + + +import { Command } from 'commander'; +import KEYMAN_VERSION from "@keymanapp/keyman-version"; +import { declareBuild } from './commands/build.js'; +import { declareBuildTestData } from './commands/buildTestData.js'; + +const program = new Command(); + +/* Arguments */ +program + .description('Keyman Developer Command Line Interface') + .version(KEYMAN_VERSION.VERSION_WITH_TAG); + +declareBuild(program); +declareBuildTestData(program); + +/* +program + .command('clean'); + +program + .command('copy'); + +program + .command('rename'); + +program + .command('generate'); + +program + .command('import'); + +program + .command('test'); + +program + .command('publish'); +*/ + +program.parseAsync(process.argv) + .catch(reason => console.error(reason)); + diff --git a/developer/src/kmlmc/source/kmlmc.ts b/developer/src/kmc/src/kmlmc.ts similarity index 50% rename from developer/src/kmlmc/source/kmlmc.ts rename to developer/src/kmc/src/kmlmc.ts index 659565a8f4860a258b3c46ad90453c36fd28dbad..ad607fcb473e8403b186608d06087b95b9cbdf96 100644 --- a/developer/src/kmlmc/source/kmlmc.ts +++ b/developer/src/kmc/src/kmlmc.ts @@ -2,17 +2,16 @@ /** * kmlmc - Keyman Lexical Model Compiler */ -/// import * as fs from 'fs'; -import * as program from 'commander'; - -import { compileModel } from './util/util'; -import { SysExits } from './util/sysexits'; +import { Command } from 'commander'; +import { compileModel } from '@keymanapp/kmc-model'; +import { SysExits } from './util/sysexits.js'; +import KEYMAN_VERSION from "@keymanapp/keyman-version"; +import { NodeCompilerCallbacks } from './messages/NodeCompilerCallbacks.js'; let inputFilename: string; - -const KEYMAN_VERSION = require("@keymanapp/keyman-version").KEYMAN_VERSION; +const program = new Command(); /* Arguments */ program @@ -29,18 +28,31 @@ if (!inputFilename) { exitDueToUsageError('Must provide a lexical model source file.'); } +const callbacks = new NodeCompilerCallbacks(); + +let code = null; // Compile: -let code = compileModel(inputFilename); +try { + code = compileModel(inputFilename, callbacks); +} catch(e) { + console.error(e); + process.exit(SysExits.EX_DATAERR); +} + +if(!code) { + console.error('Compilation failed.') + process.exit(SysExits.EX_DATAERR); +} // Output: -if (program.outFile) { - fs.writeFileSync(program.outFile, code, 'utf8'); +if (program.opts().outFile) { + fs.writeFileSync(program.opts().outFile, code, 'utf8'); } else { console.log(code); } function exitDueToUsageError(message: string): never { - console.error(`${program._name}: ${message}`); + console.error(`${program.name()}: ${message}`); console.error(); program.outputHelp(); return process.exit(SysExits.EX_USAGE); diff --git a/developer/src/kmc/src/kmlmi.ts b/developer/src/kmc/src/kmlmi.ts new file mode 100644 index 0000000000000000000000000000000000000000..0868e0ccfe442c21351aa11485b421a7b88a2ff3 --- /dev/null +++ b/developer/src/kmc/src/kmlmi.ts @@ -0,0 +1,91 @@ +#!/usr/bin/env node +/** + * kmlmi - Keyman Lexical Model model_info Compiler + */ + +import * as path from 'path'; +import { Command } from 'commander'; +import { KmpCompiler, PackageValidation } from '@keymanapp/kmc-package'; +import { ModelInfoOptions, writeMergedModelMetadataFile } from '@keymanapp/kmc-model-info'; +import { SysExits } from './util/sysexits.js'; +import KEYMAN_VERSION from "@keymanapp/keyman-version"; +import { NodeCompilerCallbacks } from './messages/NodeCompilerCallbacks.js'; + +let inputFilename: string; +const program = new Command(); + +/* Arguments */ +program + .description('Merges Keyman lexical model model_info files. Intended for use within the keymanapp/lexical-models repository.') + .version(KEYMAN_VERSION.VERSION_WITH_TAG) + .arguments('') + .action(infile => inputFilename = infile) + .option('-o, --outFile ', 'where to save the resultant file') + .option('-m, --model ', 'model id, defaults to basename of input file sans .model_info extension') + .option('-s, --source ', 'path to source of model, relative to lexical-models repo root') + .option('--kpsFilename ', 'path to .model.kps file, defaults to source/.model.kps') + .option('--kmpFilename ', 'path to .model.kmp file, defaults to build/.model.kmp') + .option('--jsFilename ', 'path to .model.js file, defaults to build/.model.js'); + +program.parse(process.argv); + +// Deal with input arguments: + +if (!inputFilename) { + exitDueToUsageError('Must provide a lexical model .model_info source file.'); +} + +let model_id: string = program.opts().model ? program.opts().model : path.basename(inputFilename).replace(/\.model_info$/, ""); +let outputFilename: string = program.opts().outFile ? program.opts().outFile : path.join(path.dirname(inputFilename), 'build', path.basename(inputFilename)); +let kpsFilename = program.opts().kpsFilename ? program.opts().kpsFilename : path.join(path.dirname(inputFilename), 'source', path.basename(inputFilename).replace(/\.model_info$/, '.model.kps')); +let kmpFilename = program.opts().kmpFilename ? program.opts().kmpFilename : path.join(path.dirname(inputFilename), 'build', path.basename(inputFilename).replace(/\.model_info$/, '.model.kmp')); +let jsFilename = program.opts().jsFilename ? program.opts().jsFilename : path.join(path.dirname(inputFilename), 'build', path.basename(inputFilename).replace(/\.model_info$/, '.model.js')); + +// +// Load .kps source data +// + +const callbacks = new NodeCompilerCallbacks(); +let kmpCompiler = new KmpCompiler(callbacks); +let kmpJsonData = kmpCompiler.transformKpsToKmpObject(kpsFilename); +if(!kmpJsonData) { + process.exit(1); +} + +// +// Validate the package file +// + +const validation = new PackageValidation(callbacks); +if(!validation.validate(kpsFilename, kmpJsonData)) { + process.exit(1); +} + +// +// Write out the merged .model_info file +// + +let modelInfoOptions: ModelInfoOptions = { + model_id: model_id, + kmpJsonData: kmpJsonData, + sourcePath: program.opts().source, + modelFileName: jsFilename, + kmpFileName: kmpFilename +}; + +try { + writeMergedModelMetadataFile( + inputFilename, + outputFilename, + modelInfoOptions); +} catch(e) { + console.error(e); + process.exit(SysExits.EX_DATAERR); +} + +function exitDueToUsageError(message: string): never { + console.error(`${program.name()}: ${message}`); + console.error(); + program.outputHelp(); + return process.exit(SysExits.EX_USAGE); +} diff --git a/developer/src/kmc/src/kmlmp.ts b/developer/src/kmc/src/kmlmp.ts new file mode 100644 index 0000000000000000000000000000000000000000..5a54a57d71bd015e75337aee9617b104780a7900 --- /dev/null +++ b/developer/src/kmc/src/kmlmp.ts @@ -0,0 +1,73 @@ +#!/usr/bin/env node +/** + * kmlmp - Keyman Lexical Model Package Compiler + */ + +// Note: this is a deprecated package and will be removed in Keyman 18.0 + +import * as fs from 'fs'; +import { Command } from 'commander'; +import { PackageValidation, KmpCompiler } from '@keymanapp/kmc-package'; +import { SysExits } from './util/sysexits.js'; +import KEYMAN_VERSION from "@keymanapp/keyman-version"; +import { NodeCompilerCallbacks } from './messages/NodeCompilerCallbacks.js'; + +let inputFilename: string; +const program = new Command(); + +/* Arguments */ +program + .description('Compiles Keyman lexical model packages\nDeprecated: use instead; will be removed in v18') + .version(KEYMAN_VERSION.VERSION_WITH_TAG) + .arguments('') + .action(infile => inputFilename = infile) + .option('-o, --outFile ', 'where to save the resultant file'); + +program.parse(process.argv); + +// Deal with input arguments: + +if (!inputFilename) { + exitDueToUsageError('Must provide a lexical model package source file.'); +} + +let outputFilename: string = program.opts().outFile ? program.opts().outFile : inputFilename.replace(/\.kps$/, ".kmp"); + +// +// Load .kps source data +// + +const callbacks = new NodeCompilerCallbacks(); +let kmpCompiler = new KmpCompiler(callbacks); +let kmpJsonData = kmpCompiler.transformKpsToKmpObject(inputFilename); +if(!kmpJsonData) { + process.exit(1); +} + +// +// Validate the package file +// + +const validation = new PackageValidation(callbacks); +if(!validation.validate(inputFilename, kmpJsonData)) { + process.exit(1); +} + +// +// Build the .kmp package file +// + +let promise = kmpCompiler.buildKmpFile(inputFilename, kmpJsonData); +promise.then(data => { + fs.writeFileSync(outputFilename, data, 'binary'); +}).catch(error => { + // Consumer decides how to handle errors + console.error('Failed to write kmp file'); +}); + +function exitDueToUsageError(message: string): never { + console.error(`${program.name()}: ${message}`); + console.error(); + program.outputHelp(); + return process.exit(SysExits.EX_USAGE); +} diff --git a/developer/src/kmc/src/messages/NodeCompilerCallbacks.ts b/developer/src/kmc/src/messages/NodeCompilerCallbacks.ts new file mode 100644 index 0000000000000000000000000000000000000000..ceae18c4c59e7f8165a39460fab40558621fd211 --- /dev/null +++ b/developer/src/kmc/src/messages/NodeCompilerCallbacks.ts @@ -0,0 +1,69 @@ +import * as fs from 'fs'; +import * as path from 'path'; +import { CompilerCallbacks, CompilerSchema, CompilerEvent, compilerErrorSeverityName, CompilerPathCallbacks, CompilerFileSystemCallbacks } from '@keymanapp/common-types'; + +/** + * Concrete implementation for CLI use + */ + +export class NodeCompilerCallbacks implements CompilerCallbacks { + // TODO: REMOVE! + loadFile(filename: string | URL): Buffer { + try { + return fs.readFileSync(filename); + } catch (e) { + if (e.code === 'ENOENT') { + return null; + } else { + throw e; + } + } + } + + get path(): CompilerPathCallbacks { + return path; + } + + get fs(): CompilerFileSystemCallbacks { + return fs; + } + + reportMessage(event: CompilerEvent): void { + const code = event.code.toString(16); + if(event.line) { + console.log(`${compilerErrorSeverityName(event.code)} ${code} [${event.line}]: ${event.message}`); + } else { + console.log(`${compilerErrorSeverityName(event.code)} ${code}: ${event.message}`); + } + } + + debug(msg: string) { + console.debug(msg); + } + + loadSchema(schema: CompilerSchema) { + let schemaPath = new URL('../util/' + schema + '.schema.json', import.meta.url); + return fs.readFileSync(schemaPath); + } + + fileExists(filename: string) { + return fs.existsSync(filename); + } + + resolveFilename(baseFilename: string, filename: string) { + const basePath = path.dirname(baseFilename); + // Transform separators to platform separators -- we are agnostic + // in our use here but path prefers files may use + // either / or \, although older kps files were always \. + if(path.sep == '/') { + filename = filename.replace(/\\/g, '/'); + } else { + filename = filename.replace(/\//g, '\\'); + } + if(!path.isAbsolute(filename)) { + filename = path.resolve(basePath, filename); + } + return filename; + } + +} diff --git a/developer/src/kmc/src/messages/messages.ts b/developer/src/kmc/src/messages/messages.ts new file mode 100644 index 0000000000000000000000000000000000000000..1f1761e715d6f70f523d95d074b2eebab1fe1500 --- /dev/null +++ b/developer/src/kmc/src/messages/messages.ts @@ -0,0 +1,43 @@ +import { CompilerErrorNamespace, CompilerErrorSeverity, CompilerMessageSpec as m } from "@keymanapp/common-types"; + +const Namespace = CompilerErrorNamespace.Infrastructure; +const SevInfo = CompilerErrorSeverity.Info | Namespace; +// const SevHint = CompilerErrorSeverity.Hint | Namespace; +// const SevWarn = CompilerErrorSeverity.Warn | Namespace; +const SevError = CompilerErrorSeverity.Error | Namespace; +const SevFatal = CompilerErrorSeverity.Fatal | Namespace; + +export class InfrastructureMessages { + static Fatal_UnexpectedException = (o:{e: any}) => m(this.FATAL_UnexpectedException, + `Unexpected exception: ${(o.e ?? 'unknown error').toString()}\n\nCall stack:\n${(o.e instanceof Error ? o.e.stack : (new Error()).stack)}`); + static FATAL_UnexpectedException = SevFatal | 0x0001; + + static Info_BuildingFile = (o:{filename:string}) => m(this.INFO_BuildingFile, + `Building ${o.filename}`); + static INFO_BuildingFile = SevInfo | 0x0002; + + static Error_FileDoesNotExist = (o:{filename:string}) => m(this.ERROR_FileDoesNotExist, + `File ${o.filename} does not exist`); + static ERROR_FileDoesNotExist = SevError | 0x0003; + + static Error_FileTypeNotRecognized = (o:{filename: string, extensions: string}) => m(this.ERROR_FileTypeNotRecognized, + `Unrecognised input file ${o.filename}, expecting ${o.extensions}, or project folder`); + static ERROR_FileTypeNotRecognized = SevError | 0x0004; + + static Error_OutFileNotValidForProjects = () => m(this.ERROR_OutFileNotValidForProjects, + `--out-file should not be specified for project builds`); + static ERROR_OutFileNotValidForProjects = SevError | 0x0005; + + static Info_FileBuiltSuccessfully = (o:{filename:string}) => m(this.INFO_FileBuiltSuccessfully, + `${o.filename} built successfully.`); + static INFO_FileBuiltSuccessfully = SevInfo | 0x0006; + + static Info_FileNotBuiltSuccessfully = (o:{filename:string}) => m(this.INFO_FileNotBuiltSuccessfully, + `${o.filename} failed to build.`); + static INFO_FileNotBuiltSuccessfully = SevInfo | 0x0007; + + static Error_InvalidProjectFile = (o:{message:string}) => m(this.ERROR_InvalidProjectFile, + `Project file is not valid: ${o.message}`); + static ERROR_InvalidProjectFile = SevError | 0x0008; +} + diff --git a/developer/src/kmc/src/util/escapeRegExp.ts b/developer/src/kmc/src/util/escapeRegExp.ts new file mode 100644 index 0000000000000000000000000000000000000000..8972b6bfedee501009c9857425eaf2741fe4d0d1 --- /dev/null +++ b/developer/src/kmc/src/util/escapeRegExp.ts @@ -0,0 +1,7 @@ + +const escapedRegexp = /[.*+?^${}()|[\]\\]/g; + +// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions#escaping +export function escapeRegExp(s: string) { + return s.replace(escapedRegexp, "\\$&"); // $& means the whole matched string +} diff --git a/developer/src/kmc/src/util/getDeveloperBinPath.ts b/developer/src/kmc/src/util/getDeveloperBinPath.ts new file mode 100644 index 0000000000000000000000000000000000000000..e59e6ac92f352f4b23f0da055c930242ae91cd9e --- /dev/null +++ b/developer/src/kmc/src/util/getDeveloperBinPath.ts @@ -0,0 +1,38 @@ +import { fileURLToPath } from 'url'; +import * as path from 'path'; +import * as fs from 'fs'; + +/** + * Locates the Keyman Developer bin folder, checking first if this is running + * from the source repository (using the presence of the KEYMAN_ROOT environment + * variable), and if not, checking for the presence of kmcomp.exe in each + * parent folder recursively until we reach the root of the filesystem. + * @returns string | null + */ +export function getDeveloperBinPath(): string { + // if running in source repo, then we always look in developer/bin/ + const keymanRoot = process.env['KEYMAN_ROOT']; + if (keymanRoot) { + // https://stackoverflow.com/a/45242825/1836776 (imperfect due to + // possibility of '..foo', but good enough) + const rel = path.relative(keymanRoot, import.meta.url); + if (rel && !rel.startsWith('..') && !path.isAbsolute(rel)) { + return path.join(keymanRoot, 'developer', 'bin'); + } + } + + // Otherwise, we will look in parent folders until we find kmcomp.exe + // TODO: once we eliminate kmcomp.exe, we'll need to do this some other way? + let p = fileURLToPath(import.meta.url); + const root = path.parse(p).root.toLowerCase(); // lower-case for drive letter on Windows + p = path.dirname(p); + do { + if (fs.existsSync(path.join(p, 'kmcomp.exe'))) { + return p; + } + p = path.dirname(p); + } while (p.toLowerCase() != root); + + // kmcomp.exe was not found on the path + return null; +} diff --git a/developer/src/kmlmc/source/util/sysexits.ts b/developer/src/kmc/src/util/sysexits.ts similarity index 100% rename from developer/src/kmlmc/source/util/sysexits.ts rename to developer/src/kmc/src/util/sysexits.ts diff --git a/developer/src/kmc/test/fixtures/.gitignore b/developer/src/kmc/test/fixtures/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..de01b143c30ef62192ed3231e735c7b34ca3c889 --- /dev/null +++ b/developer/src/kmc/test/fixtures/.gitignore @@ -0,0 +1,3 @@ +*/*/build +relative_paths/*.kmp +relative_paths/*.kmx diff --git a/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.ico b/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.ico new file mode 100644 index 0000000000000000000000000000000000000000..42c90c398daf08f560778dd383cc0f7dd5922ae1 Binary files /dev/null and b/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.ico differ diff --git a/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.keyman-touch-layout b/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.keyman-touch-layout new file mode 100644 index 0000000000000000000000000000000000000000..711f84900839ee67b03213427c5591a98e2a0080 --- /dev/null +++ b/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.keyman-touch-layout @@ -0,0 +1,1950 @@ +{ + "tablet": { + "displayUnderlying": false, + "layer": [ + { + "id": "default", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "១" + }, + { + "id": "K_2", + "text": "២" + }, + { + "id": "K_3", + "text": "៣" + }, + { + "id": "K_4", + "text": "៤" + }, + { + "id": "K_5", + "text": "៥" + }, + { + "id": "K_6", + "text": "៦" + }, + { + "id": "K_7", + "text": "៧" + }, + { + "id": "K_8", + "text": "៨" + }, + { + "id": "K_9", + "text": "៩" + }, + { + "id": "K_0", + "text": "០" + }, + { + "id": "K_HYPHEN", + "text": "ឥ" + }, + { + "id": "K_EQUAL", + "text": "ឲ" + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_Q", + "text": "ឆ", + "pad": "75" + }, + { + "id": "K_W", + "text": "" + }, + { + "id": "K_E", + "text": "" + }, + { + "id": "K_R", + "text": "រ" + }, + { + "id": "K_T", + "text": "ត" + }, + { + "id": "K_Y", + "text": "យ" + }, + { + "id": "K_U", + "text": "" + }, + { + "id": "K_I", + "text": "" + }, + { + "id": "K_O", + "text": "" + }, + { + "id": "K_P", + "text": "ផ" + }, + { + "id": "K_LBRKT", + "text": "" + }, + { + "id": "K_RBRKT", + "text": "ឪ" + }, + { + "id": "T_new_138", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_BKQUOTE", + "text": "«" + }, + { + "id": "K_A", + "text": "" + }, + { + "id": "K_S", + "text": "ស" + }, + { + "id": "K_D", + "text": "ដ" + }, + { + "id": "K_F", + "text": "ថ" + }, + { + "id": "K_G", + "text": "ង" + }, + { + "id": "K_H", + "text": "ហ" + }, + { + "id": "K_J", + "text": "" + }, + { + "id": "K_K", + "text": "ក" + }, + { + "id": "K_L", + "text": "ល" + }, + { + "id": "K_COLON", + "text": "" + }, + { + "id": "K_QUOTE", + "text": "" + }, + { + "id": "K_BKSLASH", + "text": "ឮ" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_SHIFT", + "text": "*Shift*", + "width": "160", + "sp": "1", + "nextlayer": "shift" + }, + { + "id": "K_oE2", + "text": "" + }, + { + "id": "K_Z", + "text": "ឋ" + }, + { + "id": "K_X", + "text": "ខ" + }, + { + "id": "K_C", + "text": "ច" + }, + { + "id": "K_V", + "text": "វ" + }, + { + "id": "K_B", + "text": "ប" + }, + { + "id": "K_N", + "text": "ន" + }, + { + "id": "K_M", + "text": "ម" + }, + { + "id": "K_COMMA", + "text": "" + }, + { + "id": "K_PERIOD", + "text": "។" + }, + { + "id": "K_SLASH", + "text": "" + }, + { + "id": "T_new_164", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 5, + "key": [ + { + "id": "K_LCONTROL", + "text": "*AltGr*", + "width": "160", + "sp": "1", + "nextlayer": "rightalt" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "160", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "​", + "width": "930" + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "160", + "sp": "1" + } + ] + } + ] + }, + { + "id": "rightalt", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "‌" + }, + { + "id": "K_2", + "text": "@" + }, + { + "id": "K_3", + "text": "" + }, + { + "id": "K_4", + "text": "$" + }, + { + "id": "K_5", + "text": "€" + }, + { + "id": "K_6", + "text": "៙" + }, + { + "id": "K_7", + "text": "៚" + }, + { + "id": "K_8", + "text": "*" + }, + { + "id": "K_9", + "text": "{" + }, + { + "id": "K_0", + "text": "}" + }, + { + "id": "K_HYPHEN", + "text": "≈" + }, + { + "id": "K_EQUAL", + "text": "" + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_Q", + "text": "ៜ", + "pad": "75" + }, + { + "id": "K_W", + "text": "" + }, + { + "id": "K_E", + "text": "ឯ" + }, + { + "id": "K_R", + "text": "ឫ" + }, + { + "id": "K_T", + "text": "ឨ" + }, + { + "id": "K_Y", + "text": "[" + }, + { + "id": "K_U", + "text": "]" + }, + { + "id": "K_I", + "text": "ឦ" + }, + { + "id": "K_O", + "text": "ឱ" + }, + { + "id": "K_P", + "text": "ឰ" + }, + { + "id": "K_LBRKT", + "text": "ឩ" + }, + { + "id": "K_RBRKT", + "text": "ឳ" + }, + { + "id": "T_new_307", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_BKQUOTE", + "text": "‍" + }, + { + "id": "K_A", + "text": "+" + }, + { + "id": "K_S", + "text": "-" + }, + { + "id": "K_D", + "text": "×" + }, + { + "id": "K_F", + "text": "÷" + }, + { + "id": "K_G", + "text": ":" + }, + { + "id": "K_H", + "text": "‘" + }, + { + "id": "K_J", + "text": "’" + }, + { + "id": "K_K", + "text": "ឝ" + }, + { + "id": "K_L", + "text": "៘" + }, + { + "id": "K_COLON", + "text": "៖" + }, + { + "id": "K_QUOTE", + "text": "ៈ" + }, + { + "id": "K_BKSLASH", + "text": "\\" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_SHIFT", + "text": "*Shift*", + "width": "160", + "sp": "1", + "nextlayer": "shift" + }, + { + "id": "K_oE2", + "text": "" + }, + { + "id": "K_Z", + "text": "<" + }, + { + "id": "K_X", + "text": ">" + }, + { + "id": "K_C", + "text": "#" + }, + { + "id": "K_V", + "text": "&" + }, + { + "id": "K_B", + "text": "ឞ" + }, + { + "id": "K_N", + "text": ";" + }, + { + "id": "K_M", + "text": "" + }, + { + "id": "K_COMMA", + "text": "," + }, + { + "id": "K_PERIOD", + "text": "." + }, + { + "id": "K_SLASH", + "text": "/" + }, + { + "id": "T_new_333", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 5, + "key": [ + { + "id": "K_LCONTROL", + "text": "*AltGr*", + "width": "160", + "sp": "2", + "nextlayer": "default" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "160", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": " ", + "width": "930" + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "160", + "sp": "1" + } + ] + } + ] + }, + { + "id": "shift", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "!" + }, + { + "id": "K_2", + "text": "ៗ" + }, + { + "id": "K_3", + "text": "\"" + }, + { + "id": "K_4", + "text": "៛" + }, + { + "id": "K_5", + "text": "%" + }, + { + "id": "K_6", + "text": "" + }, + { + "id": "K_7", + "text": "" + }, + { + "id": "K_8", + "text": "" + }, + { + "id": "K_9", + "text": "(" + }, + { + "id": "K_0", + "text": ")" + }, + { + "id": "K_HYPHEN", + "text": "" + }, + { + "id": "K_EQUAL", + "text": "=" + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_Q", + "text": "ឈ", + "pad": "75" + }, + { + "id": "K_W", + "text": "" + }, + { + "id": "K_E", + "text": "" + }, + { + "id": "K_R", + "text": "ឬ" + }, + { + "id": "K_T", + "text": "ទ" + }, + { + "id": "K_Y", + "text": "" + }, + { + "id": "K_U", + "text": "" + }, + { + "id": "K_I", + "text": "" + }, + { + "id": "K_O", + "text": "" + }, + { + "id": "K_P", + "text": "ភ" + }, + { + "id": "K_LBRKT", + "text": "" + }, + { + "id": "K_RBRKT", + "text": "ឧ" + }, + { + "id": "T_new_364", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_BKQUOTE", + "text": "»" + }, + { + "id": "K_A", + "text": "" + }, + { + "id": "K_S", + "text": "" + }, + { + "id": "K_D", + "text": "ឌ" + }, + { + "id": "K_F", + "text": "ធ" + }, + { + "id": "K_G", + "text": "អ" + }, + { + "id": "K_H", + "text": "ះ" + }, + { + "id": "K_J", + "text": "ញ" + }, + { + "id": "K_K", + "text": "គ" + }, + { + "id": "K_L", + "text": "ឡ" + }, + { + "id": "K_COLON", + "text": "" + }, + { + "id": "K_QUOTE", + "text": "" + }, + { + "id": "K_BKSLASH", + "text": "ឭ" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_SHIFT", + "text": "*Shift*", + "width": "160", + "sp": "2", + "nextlayer": "default" + }, + { + "id": "K_oE2", + "text": "" + }, + { + "id": "K_Z", + "text": "ឍ" + }, + { + "id": "K_X", + "text": "ឃ" + }, + { + "id": "K_C", + "text": "ជ" + }, + { + "id": "K_V", + "text": "" + }, + { + "id": "K_B", + "text": "ព" + }, + { + "id": "K_N", + "text": "ណ" + }, + { + "id": "K_M", + "text": "" + }, + { + "id": "K_COMMA", + "text": "" + }, + { + "id": "K_PERIOD", + "text": "៕" + }, + { + "id": "K_SLASH", + "text": "?" + }, + { + "id": "T_new_390", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 5, + "key": [ + { + "id": "K_LCONTROL", + "text": "*AltGr*", + "width": "160", + "sp": "1", + "nextlayer": "rightalt" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "160", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "", + "width": "930" + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "160", + "sp": "1" + } + ] + } + ] + } + ], + "font": "Khmer Busra Kbd", + "fontsize": "0.8em" + }, + "phone": { + "layer": [ + { + "id": "default", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_Q", + "text": "ឆ", + "pad": "", + "sk": [ + { + "text": "ឈ", + "id": "K_Q", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1786" + }, + { + "text": "", + "id": "T_17D2_1788" + } + ] + }, + { + "id": "K_W", + "text": "", + "sk": [ + { + "text": "", + "id": "K_W", + "layer": "shift" + } + ] + }, + { + "id": "K_E", + "text": "", + "sk": [ + { + "text": "", + "id": "K_E", + "layer": "shift" + }, + { + "text": "", + "id": "K_S", + "layer": "shift" + }, + { + "text": "", + "id": "K_V", + "layer": "shift" + }, + { + "text": "ឯ", + "id": "U_17AF" + }, + { + "text": "ឰ", + "id": "U_17B0" + } + ] + }, + { + "id": "K_R", + "text": "រ", + "sk": [ + { + "text": "", + "id": "T_17D2_179A" + }, + { + "text": "ឫ", + "id": "U_17AB" + }, + { + "text": "ឬ", + "id": "U_17AC" + } + ] + }, + { + "id": "K_T", + "text": "ត", + "sk": [ + { + "text": "ទ", + "id": "K_T", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_178F" + }, + { + "text": "", + "id": "T_17D2_1791", + "layer": "default" + } + ] + }, + { + "id": "K_Y", + "text": "យ", + "sk": [ + { + "text": "", + "id": "T_17D2_1799" + } + ] + }, + { + "id": "K_U", + "text": "", + "sk": [ + { + "text": "", + "id": "K_U", + "layer": "shift" + }, + { + "text": "", + "id": "K_Y", + "layer": "shift" + }, + { + "text": "ឧ", + "id": "U_17A7" + }, + { + "text": "ឪ", + "id": "U_17AA", + "layer": "shift" + }, + { + "text": "ឩ", + "id": "U_17A9", + "layer": "shift" + }, + { + "text": "ឨ", + "id": "U_17A8" + } + ] + }, + { + "id": "K_I", + "text": "", + "sk": [ + { + "text": "", + "id": "K_I", + "layer": "shift" + }, + { + "text": "ឥ", + "id": "U_17A5" + }, + { + "text": "ឦ", + "id": "U_17A6", + "layer": "shift" + } + ] + }, + { + "id": "K_O", + "text": "", + "sk": [ + { + "text": "", + "id": "K_O", + "layer": "shift" + }, + { + "text": "", + "id": "K_LBRKT" + }, + { + "text": "", + "id": "K_LBRKT", + "layer": "shift" + }, + { + "text": "", + "id": "K_COLON", + "layer": "shift" + }, + { + "text": "ឱ", + "id": "U_17B1" + }, + { + "text": "ឲ", + "id": "U_17B2" + }, + { + "text": "ឳ", + "id": "U_17B3", + "layer": "shift" + } + ] + }, + { + "id": "K_P", + "text": "ផ", + "sk": [ + { + "text": "ភ", + "id": "K_P", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1795" + }, + { + "text": "", + "id": "T_17D2_1797", + "layer": "default" + } + ] + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_A", + "text": "", + "pad": "", + "width": "100", + "sk": [ + { + "text": "", + "id": "K_A", + "layer": "shift" + } + ] + }, + { + "id": "K_S", + "text": "ស", + "sk": [ + { + "text": "", + "id": "T_17D2_179F" + }, + { + "text": "ឝ", + "id": "U_179D" + }, + { + "text": "ឞ", + "id": "U_179E" + } + ] + }, + { + "id": "K_D", + "text": "ដ", + "sk": [ + { + "text": "ឌ", + "id": "K_D", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_178A" + }, + { + "text": "", + "id": "T_17D2_178C", + "layer": "default" + } + ] + }, + { + "id": "K_F", + "text": "ថ", + "sk": [ + { + "text": "ធ", + "id": "K_F", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1790" + }, + { + "text": "", + "id": "T_17D2_1792", + "layer": "default" + } + ] + }, + { + "id": "K_G", + "text": "ង", + "sk": [ + { + "text": "អ", + "id": "K_G", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1784" + }, + { + "text": "", + "id": "T_17D2_17A2", + "layer": "default" + } + ] + }, + { + "id": "K_H", + "text": "ហ", + "sk": [ + { + "text": "", + "id": "T_17D2_17A0" + }, + { + "text": "ះ", + "id": "K_H", + "layer": "shift" + }, + { + "text": "ៈ", + "id": "U_17C8" + } + ] + }, + { + "id": "K_J", + "text": "ញ", + "layer": "shift", + "sk": [ + { + "text": "", + "id": "T_17D2_1789" + } + ] + }, + { + "id": "K_K", + "text": "ក", + "sk": [ + { + "text": "គ", + "id": "K_K", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1780" + }, + { + "text": "", + "id": "T_17D2_1782" + } + ] + }, + { + "id": "K_L", + "text": "ល", + "sk": [ + { + "text": "ឡ", + "id": "K_L", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_179B" + }, + { + "text": "ឭ", + "id": "U_17AD" + }, + { + "text": "ឮ", + "id": "U_17AE" + } + ] + }, + { + "id": "K_COLON", + "text": "" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_Z", + "text": "ឋ", + "pad": "", + "width": "", + "sk": [ + { + "text": "ឍ", + "id": "K_Z", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_178B" + }, + { + "text": "", + "id": "T_17D2_178D", + "layer": "default" + } + ] + }, + { + "id": "K_X", + "text": "ខ", + "sk": [ + { + "text": "ឃ", + "id": "K_X", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1781" + }, + { + "text": "", + "id": "T_17D2_1783", + "layer": "default" + } + ] + }, + { + "id": "K_C", + "text": "ច", + "sk": [ + { + "text": "ជ", + "id": "K_C", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1785" + }, + { + "text": "", + "id": "T_17D2_1787", + "layer": "default" + } + ] + }, + { + "id": "K_V", + "text": "វ", + "sk": [ + { + "text": "", + "id": "T_17D2_179C" + } + ] + }, + { + "id": "K_B", + "text": "ប", + "sk": [ + { + "text": "ព", + "id": "K_B", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1794" + }, + { + "text": "", + "id": "T_17D2_1796", + "layer": "default" + } + ] + }, + { + "id": "K_N", + "text": "ន", + "sk": [ + { + "text": "ណ", + "id": "K_N", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1793" + }, + { + "text": "", + "id": "T_17D2_178E", + "layer": "default" + } + ] + }, + { + "id": "K_M", + "text": "ម", + "sk": [ + { + "text": "", + "id": "T_17D2_1798" + }, + { + "text": "", + "id": "K_M", + "layer": "shift" + } + ] + }, + { + "id": "K_COMMA", + "text": "", + "sk": [ + { + "text": "", + "id": "K_COMMA", + "layer": "shift" + }, + { + "text": "", + "id": "K_6", + "layer": "shift" + }, + { + "text": "", + "id": "K_7", + "layer": "shift" + }, + { + "text": "", + "id": "K_8", + "layer": "shift" + }, + { + "text": "", + "id": "K_HYPHEN", + "layer": "shift" + }, + { + "text": "", + "id": "U_17D1", + "layer": "shift" + }, + { + "text": "", + "id": "U_17DD", + "layer": "shift" + }, + { + "text": "", + "id": "U_17CE", + "layer": "shift" + } + ] + }, + { + "id": "K_QUOTE", + "text": "", + "width": "100", + "sk": [ + { + "text": "", + "id": "K_QUOTE", + "layer": "shift" + }, + { + "text": "", + "id": "K_SLASH" + } + ] + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_NUMLOCK", + "text": "១២៣", + "width": "140", + "sp": "1", + "nextlayer": "numeric" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "120", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "​", + "width": "555", + "sp": "0", + "sk": [ + { + "text": " ", + "id": "U_0020", + "layer": "default" + } + ] + }, + { + "id": "K_PERIOD", + "text": "។", + "width": "120", + "sk": [ + { + "text": "៕", + "id": "K_PERIOD", + "layer": "shift" + }, + { + "text": "!", + "id": "U_0021" + }, + { + "text": "?", + "id": "U_003F" + } + ] + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "140", + "sp": "1" + } + ] + } + ] + }, + { + "id": "numeric", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "១", + "pad": "", + "sk": [ + { + "text": "1", + "id": "U_0031" + } + ] + }, + { + "id": "K_2", + "text": "២", + "sk": [ + { + "text": "2", + "id": "U_0032" + } + ] + }, + { + "id": "K_3", + "text": "៣", + "sk": [ + { + "text": "3", + "id": "U_0033" + } + ] + }, + { + "id": "K_4", + "text": "៤", + "sk": [ + { + "text": "4", + "id": "U_0034" + } + ] + }, + { + "id": "K_5", + "text": "៥", + "sk": [ + { + "text": "5", + "id": "U_0035" + } + ] + }, + { + "id": "K_6", + "text": "៦", + "sk": [ + { + "text": "6", + "id": "U_0036" + } + ] + }, + { + "id": "K_7", + "text": "៧", + "sk": [ + { + "text": "7", + "id": "U_0037" + } + ] + }, + { + "id": "K_8", + "text": "៨", + "sk": [ + { + "text": "8", + "id": "U_0038" + } + ] + }, + { + "id": "K_9", + "text": "៩", + "sk": [ + { + "text": "9", + "id": "U_0039" + } + ] + }, + { + "id": "K_0", + "text": "០", + "sk": [ + { + "text": "0", + "id": "U_0030" + }, + { + "text": "", + "id": "U_17D3" + } + ] + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "U_0040", + "text": "@", + "pad": "", + "sk": [ + { + "text": "©", + "id": "U_00A9" + }, + { + "text": "®", + "id": "U_00AE" + } + ] + }, + { + "id": "U_0023", + "text": "#", + "sk": [ + { + "text": "№", + "id": "U_2116" + }, + { + "text": "~", + "id": "U_007E" + } + ] + }, + { + "id": "U_17DB", + "text": "៛", + "sk": [ + { + "text": "$", + "id": "U_0024" + }, + { + "text": "฿", + "id": "U_0E3F" + }, + { + "text": "¢", + "id": "U_00A2" + }, + { + "text": "£", + "id": "U_00A3" + }, + { + "text": "¥", + "id": "U_00A5" + } + ] + }, + { + "id": "U_0026", + "text": "&" + }, + { + "id": "U_0025", + "text": "%", + "sk": [ + { + "text": "‰", + "id": "U_2030" + }, + { + "text": "‱", + "id": "U_2031" + } + ] + }, + { + "id": "U_002B", + "text": "+", + "sk": [ + { + "text": "-", + "id": "U_002D" + }, + { + "text": "×", + "id": "U_00D7" + }, + { + "text": "÷", + "id": "U_00F7" + }, + { + "text": "±", + "id": "U_00B1" + } + ] + }, + { + "id": "U_003D", + "text": "=", + "sk": [ + { + "text": "_", + "id": "U_005F" + }, + { + "text": "≠", + "id": "U_2260" + } + ] + }, + { + "id": "U_002A", + "text": "*", + "sk": [ + { + "text": "^", + "id": "U_005E" + } + ] + }, + { + "id": "U_003F", + "text": "?", + "sk": [ + { + "text": "¿", + "id": "U_00BF" + } + ] + }, + { + "id": "U_0021", + "text": "!", + "sk": [ + { + "text": "¡", + "id": "U_00A1" + } + ] + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "U_2018", + "text": "‘", + "sk": [ + { + "text": "’", + "id": "U_2019" + } + ] + }, + { + "id": "U_201C", + "text": "“", + "sk": [ + { + "text": "”", + "id": "U_201D" + } + ] + }, + { + "id": "U_00AB", + "text": "«", + "pad": "", + "sk": [ + { + "text": "»", + "id": "U_00BB" + } + ] + }, + { + "id": "U_002F", + "text": "/", + "sk": [ + { + "text": "\\", + "id": "U_005C" + }, + { + "text": "|", + "id": "U_007C" + }, + { + "text": "¦", + "id": "U_00A6" + } + ] + }, + { + "id": "U_0028", + "text": "(", + "sk": [ + { + "text": ")", + "id": "U_0029" + }, + { + "text": "[", + "id": "U_005B" + }, + { + "text": "]", + "id": "U_005D" + }, + { + "text": "{", + "id": "U_007B" + }, + { + "text": "}", + "id": "U_007D" + } + ] + }, + { + "id": "U_17D9", + "text": "៙", + "sk": [ + { + "text": "៚", + "id": "U_17DA" + }, + { + "text": "ៜ", + "id": "U_17DC" + }, + { + "text": "§", + "id": "U_00A7" + }, + { + "text": "Ø", + "id": "U_00D8" + } + ] + }, + { + "id": "U_17D7", + "text": "ៗ" + }, + { + "id": "U_003C", + "text": "<", + "sk": [ + { + "text": "≤", + "id": "U_2264" + }, + { + "text": ">", + "id": "U_003E" + }, + { + "text": "≥", + "id": "U_2265" + } + ] + }, + { + "id": "U_17D6", + "text": "៖", + "sk": [ + { + "text": ":", + "id": "U_003A" + }, + { + "text": ";", + "id": "U_003B" + }, + { + "text": "…", + "id": "U_2026" + } + ] + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "", + "sp": "1" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_LCONTROL", + "text": "១២៣", + "width": "140", + "sp": "2", + "nextlayer": "default" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "120", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "​", + "width": "555", + "sp": "0", + "layer": "shift", + "sk": [] + }, + { + "id": "K_PERIOD", + "text": "។", + "width": "120", + "sk": [ + { + "text": "៕", + "id": "K_PERIOD", + "layer": "shift" + }, + { + "text": "!", + "id": "U_0021" + }, + { + "text": "?", + "id": "U_003F" + } + ] + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "140", + "sp": "1" + } + ] + } + ] + } + ], + "displayUnderlying": false, + "font": "Khmer Busra Kbd", + "fontsize": "0.8em" + } +} \ No newline at end of file diff --git a/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.kmn b/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.kmn new file mode 100644 index 0000000000000000000000000000000000000000..b7919afca3e539a74834e23b2fe9eed97bdc4644 --- /dev/null +++ b/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.kmn @@ -0,0 +1,642 @@ +store(&VERSION) '10.0' +store(&NAME) "Khmer Angkor" +store(©RIGHT) '© 2015-2022 SIL International' +store(&MESSAGE) "More than just a Khmer Unicode keyboard." +store(&TARGETS) 'any' +store(&LAYOUTFILE) 'khmer_angkor.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.3' +store(&BITMAP) 'khmer_angkor.ico' +store(&VISUALKEYBOARD) 'khmer_angkor.kvks' + +begin Unicode > use(main) + + + +c ==============================================STORES============================================== + + + +c 33 consonants and two deprecated consonants + +store(c_key) [K_K] [K_X] [SHIFT K_K] [SHIFT K_X] [K_G] \ + [K_C] [K_Q] [SHIFT K_C] [SHIFT K_Q] [SHIFT K_J] \ + [K_D] [K_Z] [SHIFT K_D] [SHIFT K_Z] [SHIFT K_N] \ + [K_T] [K_F] [SHIFT K_T] [SHIFT K_F] [K_N] \ + [K_B] [K_P] [SHIFT K_B] [SHIFT K_P] [K_M] \ + [K_Y] [K_R] [K_L] [K_V] [K_S] [K_H] [SHIFT K_L] [SHIFT K_G] \ + [RALT K_K] [RALT K_B] +store(c_out) U+1780 U+1781 U+1782 U+1783 U+1784 \ + U+1785 U+1786 U+1787 U+1788 U+1789 \ + U+178A U+178B U+178C U+178D U+178E \ + U+178F U+1790 U+1791 U+1792 U+1793 \ + U+1794 U+1795 U+1796 U+1797 U+1798 \ + U+1799 U+179A U+179B U+179C U+179F U+17A0 U+17A1 U+17A2 \ + U+179D U+179E c deprecated, but they are used in minority languages + +c All genuine dependent vowels + +store(v_gen_key) [K_A] [K_I] [SHIFT K_I] [K_W] [SHIFT K_W] [K_U] [SHIFT K_U] [SHIFT K_Y] \ + [K_COLON] [SHIFT K_LBRKT] [K_LBRKT] [K_E] [SHIFT K_E] [SHIFT K_S] [K_O] [SHIFT K_O] +store(v_gen) U+17B6 U+17B7 U+17B8 U+17B9 U+17BA U+17BB U+17BC U+17BD \ + U+17BE U+17BF U+17C0 U+17C1 U+17C2 U+17C3 U+17C4 U+17C5 + +c All pseudo dependent vowels + +store(v_pseudo_key) [SHIFT K_M] [SHIFT K_H] [RALT K_QUOTE] +store(v_pseudo) U+17C6 U+17C7 U+17C8 + +c Both genuine and pseudo vowels + +store(v_key) outs(v_gen_key) outs(v_pseudo_key) +store(v_out) outs(v_gen) outs(v_pseudo) +store(v_any) outs(v_out) + +c These seven vowels can be concatenated with Reahmuk (U+17C7) to make េះ ោះ ុះ ិះ ីះ ឹះ and ែះ. + +store(v_combo_R) U+17C1 U+17C4 U+17BB U+17B7 U+17B8 U+17B9 U+17C2 + +c these two vowels can be concatenated with Nikahit (U+17C6) to make ាំ and ុំ. + +store(v_combo_N) U+17B6 U+17BB +store(v_combo) outs(v_combo_R) outs(v_combo_N) + +c Independent vowels + +store(ind_v_key) [K_HYPHEN] [RALT K_I] [SHIFT K_RBRKT] [RALT K_T] [RALT K_LBRKT] [K_RBRKT] [RALT K_R] [SHIFT K_R] \ + [SHIFT K_BKSLASH] [K_BKSLASH] [RALT K_E] [RALT K_P] [RALT K_O] [K_EQUAL] [RALT K_RBRKT] +store(ind_v_out) U+17A5 U+17A6 U+17A7 U+17A8 U+17A9 U+17AA U+17AB U+17AC \ + U+17AD U+17AE U+17AF U+17B0 U+17B1 U+17B2 U+17B3 + +c Diacritics + +store(diacritic_key) [K_QUOTE] [SHIFT K_7] [SHIFT K_HYPHEN] [SHIFT K_8] [SHIFT K_6] [RALT K_QUOTE] \ + [RALT K_EQUAL] [RALT K_3] [RALT K_W] [RALT K_Q] [K_J] +store(diacritic_out) U+17CB U+17D0 U+17CC U+17CF U+17CD U+17C8 \ + U+17CE U+17D1 U+17DD U+17DC U+17D2 + +c Consonant shifter--Muusikatoan(U+17C9) and Triisap(U+17CA) + +store(c_shifter_key) [SHIFT K_QUOTE] [K_SLASH] +store(c_shifter) U+17C9 U+17CA + +c punctuations + +store(punct_key) [K_PERIOD] [SHIFT K_PERIOD] [RALT K_COLON] [SHIFT K_2] [RALT K_L] [RALT K_6] [RALT K_7] [RALT K_M] +store(punct_out) U+17D4 U+17D5 U+17D6 U+17D7 U+17D8 U+17D9 U+17DA U+17D3 + +store(latin_punct_key) [K_BKQUOTE] [SHIFT K_BKQUOTE] [SHIFT K_9] [SHIFT K_0] [SHIFT K_1] [SHIFT K_3] \ + [SHIFT K_5] [SHIFT K_EQUAL] [SHIFT K_SLASH] [RALT K_9] [RALT K_0] [RALT K_BKSLASH] \ + [RALT K_2] [RALT K_8] [RALT K_COMMA] [RALT K_D] [RALT K_PERIOD] [RALT K_SLASH] \ + [RALT K_Y] [RALT K_U] [RALT K_BKQUOTE] [RALT K_1] [RALT K_A] [RALT K_S] \ + [RALT K_F] [RALT K_G] [RALT K_HYPHEN] [RALT K_H] [RALT K_J] [RALT K_N] \ + [RALT K_Z] [RALT K_X] [RALT K_C] [RALT K_V] +store(latin_punct_out) U+00AB U+00BB U+0028 U+0029 U+0021 U+0022 \ + U+0025 U+003D U+003F U+007B U+007D U+005C \ + U+0040 U+002A U+002C U+00D7 U+002E U+002F \ + U+005B U+005D U+200D U+200C U+002B U+002D \ + U+00F7 U+003A U+2248 U+2018 U+2019 U+003B \ + U+003C U+003E U+0023 U+0026 +c white space, ZWSP, ZWJ +store(spaces_key) [K_SPACE] [SHIFT K_SPACE] [RALT K_SPACE] +store(spaces_out) U+200B U+0020 U+00A0 + +c Currency: Riel, Dollar and Euro + +store(currency_key) [SHIFT K_4] [RALT K_4] [RALT K_5] +store(currency_out) U+17DB U+0024 U+20AC + +c Khmer digits 0 through 9 + +store(digit_key) [K_0] [K_1] [K_2] [K_3] [K_4] [K_5] [K_6] [K_7] [K_8] [K_9] +store(digit_out) U+17E0 U+17E1 U+17E2 U+17E3 U+17E4 U+17E5 U+17E6 U+17E7 U+17E8 U+17E9 + +c Khmer Lek Attak (a.k.a. divination lore) +store(lek_attak_key) [SHIFT RALT K_0] [SHIFT RALT K_1] [SHIFT RALT K_2] [SHIFT RALT K_3] [SHIFT RALT K_4] \ + [SHIFT RALT K_5] [SHIFT RALT K_6] [SHIFT RALT K_7] [SHIFT RALT K_8] [SHIFT RALT K_9] +store(lek_attak_out) U+17F0 U+17F1 U+17F2 U+17F3 U+17F4 \ + U+17F5 U+17F6 U+17F7 U+17F8 U+17F9 + +c Lunar date format (Khmer style) + +store(lunar_date_key) [SHIFT RALT K_A] [SHIFT RALT K_B] [SHIFT RALT K_C] [SHIFT RALT K_D] [SHIFT RALT K_E] \ + [SHIFT RALT K_F] [SHIFT RALT K_G] [SHIFT RALT K_H] [SHIFT RALT K_I] [SHIFT RALT K_J] \ + [SHIFT RALT K_K] [SHIFT RALT K_L] [SHIFT RALT K_M] [SHIFT RALT K_N] [SHIFT RALT K_O] \ + [SHIFT RALT K_P] [SHIFT RALT K_Q] [SHIFT RALT K_R] [SHIFT RALT K_S] [SHIFT RALT K_T] \ + [SHIFT RALT K_U] [SHIFT RALT K_V] [SHIFT RALT K_W] [SHIFT RALT K_X] [SHIFT RALT K_Y] \ + [SHIFT RALT K_Z] [SHIFT RALT K_COLON] [SHIFT RALT K_COMMA] [SHIFT RALT K_PERIOD] [SHIFT RALT K_LBRKT] \ + [SHIFT RALT K_RBRKT] [SHIFT RALT K_QUOTE] +store(lunar_date_out) U+19EC U+19FB U+19F9 U+19EE U+19E2 \ + U+19EF U+19F0 U+19F1 U+19E7 U+19F2 \ + U+19F3 U+19F4 U+19FD U+19FC U+19E8 \ + U+19E9 U+19E0 U+19E3 U+19ED U+19E4 \ + U+19E6 U+19FA U+19E1 U+19F8 U+19E5 \ + U+19F7 U+19F5 U+19FE U+19FF U+19EA \ + U+19EB U+19F6 + +c Subscripts​ for mobile/table layouts + +store(input_subcons) \ + [T_17D2_1780] [T_17D2_1781] [T_17D2_1782] [T_17D2_1783] [T_17D2_1784] [T_17D2_1785] [T_17D2_1786] [T_17D2_1787] \ + [T_17D2_1788] [T_17D2_1789] [T_17D2_178A] [T_17D2_178B] [T_17D2_178C] [T_17D2_178D] [T_17D2_178E] [T_17D2_178F] \ + [T_17D2_1790] [T_17D2_1791] [T_17D2_1792] [T_17D2_1793] [T_17D2_1794] [T_17D2_1795] [T_17D2_1796] [T_17D2_1797] \ + [T_17D2_1798] [T_17D2_1799] [T_17D2_179A] [T_17D2_179B] [T_17D2_179C] [T_17D2_179D] [T_17D2_179E] [T_17D2_179F] \ + [T_17D2_17A0] [T_17D2_17A1] [T_17D2_17A2] + +store(subcons) \ + U+1780 U+1781 U+1782 U+1783 U+1784 U+1785 U+1786 U+1787 \ + U+1788 U+1789 U+178A U+178B U+178C U+178D U+178E U+178F \ + U+1790 U+1791 U+1792 U+1793 U+1794 U+1795 U+1796 U+1797 \ + U+1798 U+1799 U+179A U+179B U+179C U+179D U+179E U+179F \ + U+17A0 U+17A1 U+17A2 + +c Arabic digits 0 through 9 + +store(arabic_digit_key) [U_0030] [U_0031] [U_0032] [U_0033] [U_0034] [U_0035] [U_0036] [U_0037] [U_0038] [U_0039] +store(arabic_digit_out) U+0030 U+0031 U+0032 U+0033 U+0034 U+0035 U+0036 U+0037 U+0038 U+0039 + +c These stores are for consonant (cluster) and consonant shifter configuration + +store(v_above) U+17B7 U+17B8 U+17B9 U+17BA \ + U+17BE U+17D0 c These vowels are rendered above the base consonant. +store(shiftable_c_1st) U+179F U+17A0 U+17A2 c These consonants shift to the 2nd series when adding U+17CA to them. +store(shiftable_BA) U+1794 c BA is unique because it can be used with both U+17CA (shift to 2nd) and and U+179C (shift to PA, still in 1st series). +store(shiftable_c_2nd) U+1784 U+1789 U+1798 U+1799 \ + U+179A U+179C U+1793 U+179B c These consonants shift to the 1st series when adding U+17C9 to them. +store(shiftable_c_2nd_with_BA) outs(shiftable_c_2nd) outs(shiftable_BA) +store(c_2nd_combo_LO) U+1799 U+1798 U+1784 U+1794 \ + U+179C c These can be combined with U+179B to make a 2nd series consonant cluster. +store(c_2nd_combo_MO) U+1799 U+179B U+1784 U+179A c These can be combined with U+1798 to make a 2nd series consonant cluster. +store(c_1st_combo_LO) U+1794 U+17A0 U+17A2 c they can be combined with U+179B to make a 1st series consonant cluster. +store(c_1st_combo_MO) U+17A0 U+179F U+17A2 c they can be combined with U+1798 to make a 1st series consonant cluster. +store(c_combo_SA) U+1794 U+1799 U+179B U+1798 \ + U+1793 U+1789 U+1784 U+179A \ + U+179C U+17A2 c they can be combined with U+179F to make a 1st series consonant cluster. +store(c_combo_QA) U+1786 U+1788 U+1794 U+1795 \ + U+178F U+1791 c they can be combined with U+17A2 to make a 1st series consonant cluster. +store(c_combo_HA) U+179C U+17A3 c they can be combined with U+17A0 to make a 1st series consonant cluster. + + + +c ==============================================BASIC RULES & CONSTRAINTS/ROTATIONS============================================== + + + +group(main) using keys + +c Basic rules with RALT key + + + any(c_key) > index(c_out,1) + + any(v_key) > index(v_out,1) + + any(ind_v_key) > index(ind_v_out,1) + + any(diacritic_key) > index(diacritic_out,1) + + any(c_shifter_key) > index(c_shifter,1) + + any(punct_key) > index(punct_out,1) + + any(latin_punct_key) > index(latin_punct_out,1) + + any(currency_key) > index(currency_out,1) + + any(digit_key) > index(digit_out,1) + + any(lek_attak_key) > index(lek_attak_out,1) + + any(lunar_date_key) > index(lunar_date_out,1) + + any(spaces_key) > index(spaces_out,1) + +c two-unicode-code-point vowels + ++ [SHIFT K_A] > U+17B6 U+17C6 ++ [SHIFT K_V] > U+17C1 U+17C7 ++ [SHIFT K_COLON] > U+17C4 U+17C7 ++ [K_COMMA] > U+17BB U+17C6 ++ [SHIFT K_COMMA] > U+17BB U+17C7 + +c Constraints + +any(v_gen) + [K_QUOTE] > context beep c no Bantoc after any genuine vowel +any(v_pseudo) + [K_QUOTE] > context beep c no Bantoc after any pseudo vowel +any(c_shifter) + [K_QUOTE] > context beep c no Bantoc after Triisap/Muusikatoan +U+17D2 any(c_out) + [K_QUOTE] > context beep c no Bantoc on a subscript +any(c_shifter) + any(c_shifter_key) > context beep c no two Triisap/Muusikatoan + +c Rotation + +U+17C7 + [SHIFT K_H] > U+17C8 c U+17C7 is changed to U+17C8 when pressing [SHIFT K_H]. +U+17C8 + [SHIFT K_H] > U+17C7 c U+17C8 is changed to U+17C7 when K_H is pressed. +c any(v_gen) U+17C7 + [SHIFT K_H] > context beep c Don't rotate between U+17C7 and U+17C8. + +c Press Space twice to get a White Space + +U+200B + [K_SPACE] > U+0020 + +c One backspace deletes a two-part vowels (i.e. psuedoVowel + U+17C7) + +any(v_combo_N) U+17C6 + [K_BKSP] > nul +any(v_combo_R) U+17C7 + [K_BKSP] > nul + +c When pressing [K_U] after ាំ and ុំ, the U+17BB is converted to a respective consonant shifter placing before them (ាំ and ុំ). + +any(shiftable_c_1st) U+17B6 U+17C6 + [K_U] > context(1) U+17CA context(2) context(3) c fix ស ាំ ុ > ស៊ាំ +any(shiftable_c_2nd_with_BA) U+17B6 U+17C6 + [K_U] > context(1) U+17C9 context(2) context(3) c fix ម ាំ ុ > ម៉ាំ + +c Consonant shifter constraints (beep when the consonant shifter is used in inappropriate environment) + +any(shiftable_c_1st) + [SHIFT K_QUOTE] > context U+17C9 beep +any(shiftable_c_2nd_with_BA) + [K_SLASH] > context U+17CA beep + +c 1st series consonant clusters + +any(c_combo_QA) U+17D2 U+17A2 + [SHIFT K_QUOTE] > context U+17C9 beep +U+179B U+17D2 any(c_1st_combo_LO) + [SHIFT K_QUOTE] > context U+17C9 beep +U+1798 U+17D2 any(c_1st_combo_MO) + [SHIFT K_QUOTE] > context U+17C9 beep +U+179F U+17D2 any(c_combo_SA) + [SHIFT K_QUOTE] > context U+17C9 beep +any(c_combo_HA) U+17D2 U+17A0 + [SHIFT K_QUOTE] > context U+17C9 beep +U+17A2 U+17D2 U+1784 + [SHIFT K_QUOTE] > context U+17C9 beep +U+17A2 U+17D2 U+179C + [SHIFT K_QUOTE] > context U+17C9 beep + +c 2nd series consonant clusters + +U+179B U+17D2 any(c_2nd_combo_LO) + [K_SLASH] > context U+17CA beep +U+1798 U+17D2 any(c_2nd_combo_MO) + [K_SLASH] > context U+17CA beep + + +c ==============================================MOBILE/TABLET TOUCH LAYOUT============================================== + + + ++ any(input_subcons) > U+17D2 index(subcons, 1) + +c delete a subscript (a subscript sign + a consonant) upon a backspace + +platform('touch') U+17D2 any(c_out) + [K_BKSP] > nul c working OK + + + [K_NPSTAR] > U+002A + + [SHIFT K_NPSTAR] > U+002A + + [K_NPPLUS] > U+002B + + [SHIFT K_NPPLUS] > U+002B + + [K_NPMINUS] > U+002D + + [SHIFT K_NPMINUS] > U+002D + + [K_NPDOT] > U+002E + + [SHIFT K_NPDOT] > U+002E + + [K_NPSLASH] > U+002F + + [SHIFT K_NPSLASH] > U+002F + + + +c ==============================================NORMALIZATION============================================== + + + +match > use(normalise) + +group(normalise) + +c Illegitimate vowel combinations should be transformed to the legitimate ones (Case #6 and #7). + +U+17C1 U+17B6 > U+17C4 c when type េ and ា, tranform them to ោ +U+17B6 U+17C1 > U+17C4 c when type ា and េ, tranform them to ោ +U+17C1 U+17B8 > U+17BE c when type េ and ី , tranform them to ើ +U+17B8 U+17C1 > U+17BE c when type ី and េ, tranform them to ើ + +c Illegitimate vowel combinations should be transformed to the legitimate ones (Case #5). + +U+17C6 U+17BB > U+17BB U+17C6 c when type ំ and ុ , tranform them to ុំ +U+17C6 U+17B6 > U+17B6 U+17C6 c when type ំ and ា, tranform them to ាំ + + +c Rotate vowels + +any(v_gen) any(v_gen) > context(2) c the last vowel stroke replaces the previous one. + +c Rotation of two-part vowels + +any(v_gen) any(v_pseudo) any(v_gen) > context(3) c a two-part vowel rotates to a genuine vowel. +any(v_gen) any(v_pseudo) any(v_pseudo) > context(3) c a two-part vowel rotates to a pseudo vowel. +any(v_gen) any(v_gen) any(v_pseudo) > context(2) context(3) c a genuine vowel rotates to a two-part vowel. +any(v_pseudo) any(v_gen) any(v_pseudo) > context(2) context(3) c a pseudo vowel roates to a two-part vowel. +any(v_gen) any(v_pseudo) any(v_gen) any(v_pseudo) > context(3) context(4) c a two-part vowel rotates to another two-part vowel. +any(v_pseudo) any(v_pseudo) > context(2) c a pseudo vowel rotates to another pseudo vowel. +c any(v_pseudo) any(v_gen) > context(2) c a pseudo vowel roates to a genuine vowel. + +c Delete extraneous coeng markers + +U+17D2 U+17D2 > context(1) c no two coengs are allowed. +U+17D2 any(v_any) > context(2) c The coeng is deleted when a vowel is put after it. +U+17D2 any(v_gen) any(v_pseudo) > context(2) context(3) c The coeng is deleted when a pseudo vowel is put after it. + +c Case #1: when a subscript is typed after a vowel, the subscript should be automatically moved to before the vowel. + +any(v_any) U+17D2 any(subcons) > context(2) context(3) context(1) c a vowel has to come after a subscript. +any(v_combo_N) U+17C6 U+17D2 any(subcons) > context(3) context(4) context(1) context(2) c these two-part vowels have to come after a subscript. +any(v_combo_R) U+17C7 U+17D2 any(subcons) > context(3) context(4) context(1) context(2) c these two-part vowels have to come after a subscript. + +c a subscript placed after a shifter and a vowel (a genuine/pseudo vowel or a two-part vowel) has to move to before them. + +any(c_shifter) any(v_any) U+17D2 any(subcons) > context(3) context(4) context(1) context(2) c after a genuine/pseudo vowel +any(c_shifter) any(v_combo_N) U+17C6 U+17D2 any(subcons) > context(4) context(5) context(1) context(2) context(3) c after a two-part vowel +any(c_shifter) any(v_combo_R) U+17C7 U+17D2 any(subcons) > context(4) context(5) context(1) context(2) context(3) c after a two-part vowel + +c Case #2: when [D2+9A] is typed before a subscript, it should be moved to after it. + +U+17D2 U+178A U+17D2 U+179A > context(1) U+178F context(3) context(4) c change subscript ្ដ to ្ត after ្រ +U+17D2 U+179A U+17D2 U+178A > context(3) U+178F context(1) context(2) c ្ដ placed after ្រ has to be changed to ្ត and placed before ្រ + +U+17D2 U+178A any(v_any) U+17D2 U+179A > context(1) U+178F context(4) context(5) context(3) c fixed 6e +U+17D2 U+178A any(v_combo_N) U+17C6 U+17D2 U+179A > context(1) U+178F context(5) context(6) context(3) context(4) +U+17D2 U+178A any(v_combo_R) U+17C7 U+17D2 U+179A > context(1) U+178F context(5) context(6) context(3) context(4) + +U+17D2 U+179A any(v_any) U+17D2 U+178A > context(1) U+178F context(4) context(2) context(3) c fixed 6g +U+17D2 U+179A any(v_combo_N) U+17C6 U+17D2 U+178A > context(1) U+178F context(5) context(2) context(3) context(4) +U+17D2 U+179A any(v_combo_R) U+17C7 U+17D2 U+178A > context(1) U+178F context(5) context(2) context(3) context(4) + +U+17D2 U+179A any(c_shifter) U+17D2 any(subcons) > context(4) context(5) context(1) context(2) context(3) c when a shifter intervenes, move it to the end. +U+17D2 U+179A U+17D2 any(subcons) > context(3) context(4) context(1) context(2) c move any subscript placed after [D2+DA] to before them +U+17D2 U+179A any(v_any) U+17D2 any(subcons) > context(4) context(5) context(1) context(2) context(3) c when a vowel intervenes, move it to the end +U+17D2 U+179A any(v_combo_N) U+17C6 U+17D2 any(subcons) > context(5) context(6) context(1) context(2) context(3) context(4) c when a two-part vowel intervenes, move it to the end too. +U+17D2 U+179A any(v_combo_R) U+17C7 U+17D2 any(subcons) > context(5) context(6) context(1) context(2) context(3) context(4) c (same as stated right above) + +c when a subscript is placed after a consonant shifter, they should be reversed. (Case #3) + +any(c_shifter) U+17D2 any(subcons) > context(2) context(3) context(1) + +c Reordering - Triisap and Muusikatoan store before a vowel and a vowelcomboR and pseudo vowel. + +any(v_any) any(c_shifter) > context(2) context(1) c place either a enguine or pseudo vowel after a consonant shifter +any(v_gen) any(v_pseudo) any(c_shifter) > context(3) context(1) context(2) c place a two-part vowel after a consonant shifter(i.e. មោះ៉ ) +any(c_shifter) any(v_any) any(c_shifter) > context(3) context(2) c when either a genuine or pseudo vowel is in between two consonant shifters, replace the one on the left with the one on the right. +any(c_shifter) any(v_gen) any(v_pseudo) any(c_shifter) > context(2) context(3) context(4) c when a two-part vowel is in between two consonants shifter, replace the one on the left with the one the right. + +c +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +c + when [BB] is place either before or after an above vowel (ិ ី ឹ ឺ ើ and ាំ) and a Samyok Sannya (Case #4) + +c + the [BB] should transform to a respective consonant shifter placed before the vowel. + +c + the consonant shifter is a Trisap if the base consonant is ស ហ អ + +c + the consonant shifter is a Muusikatoan if the base consonant is ង ញ ម យ រ វ ប and ន ល + +c +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +c consonant clusters --1st > 2nd series (with U+17BB) + +any(c_combo_QA) U+17D2 U+17A2 U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +any(c_combo_QA) U+17D2 U+17A2 U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +any(c_combo_QA) U+17D2 U+17A2 any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +any(c_combo_QA) U+17D2 U+17A2 U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+179B U+17D2 any(c_1st_combo_LO) U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+179B U+17D2 any(c_1st_combo_LO) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+179B U+17D2 any(c_1st_combo_LO) any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +U+179B U+17D2 any(c_1st_combo_LO) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+1798 U+17D2 any(c_1st_combo_MO) U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+1798 U+17D2 any(c_1st_combo_MO) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+1798 U+17D2 any(c_1st_combo_MO) any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +U+1798 U+17D2 any(c_1st_combo_MO) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+179F U+17D2 U+1794 U+17BB any(v_above) > context(1) context(2) context(3) U+17C9 context(5) c prevent ស្បុិ from transforming to ស្ប៊ិ​​​, but produce ស្ប៉ិ instead because ប never have Triisap shifted down. +U+179F U+17D2 U+1794 U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(5) context(6) +U+179F U+17D2 U+1794 any(v_above) U+17BB > context(1) context(2) context(3) U+17C9 context(4) +U+179F U+17D2 U+1794 U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(6) context(7) + +U+179F U+17D2 any(c_combo_SA) U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+179F U+17D2 any(c_combo_SA) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+179F U+17D2 any(c_combo_SA) any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +U+179F U+17D2 any(c_combo_SA) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +any(c_combo_HA) U+17D2 U+17A0 U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +any(c_combo_HA) U+17D2 U+17A0 U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +any(c_combo_HA) U+17D2 U+17A0 any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +any(c_combo_HA) U+17D2 U+17A0 U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+17A2 U+17D2 U+1784 U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+17A2 U+17D2 U+1784 U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+17A2 U+17D2 U+1784 any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +U+17A2 U+17D2 U+1784 U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+17A2 U+17D2 U+179C U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+17A2 U+17D2 U+179C U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+17A2 U+17D2 U+179C any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +U+17A2 U+17D2 U+179C U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+17A0 U+17D2 U+1794 U+17BB any(v_above) > context(1) context(2) context(3) U+17C9 context(5) c change U+17BB preceded by HA and coeng BA to U+17C9 before the above vowel +U+17A0 U+17D2 U+1794 U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(3) context(6) c change U+17BB preceded by HA and coeng BA to U+17C9 before ាំ +U+17A0 U+17D2 U+1794 any(v_above) U+17BB > context(1) context(2) context(3) U+17C9 context(4) c change U+17BB preceded by HA and coeng BA to U+17C9 before the above vowel +U+17A0 U+17D2 U+1794 U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(6) context(7) c change U+17BB preceded by HA and coeng BA to U+17C9 before U+17B6 U+17C6 + + +U+17A0 U+17D2 any(shiftable_c_2nd_with_BA) U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) c change U+17BB preceded by HA and coeng shiftable_c_2nd to U+17CA before the above vowel +U+17A0 U+17D2 any(shiftable_c_2nd_with_BA) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(3) context(6) c change U+17BB preceded by HA and coeng shiftable_c_2nd to U+17CA before ាំ +U+17A0 U+17D2 any(shiftable_c_2nd_with_BA) any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) c change U+17BB preceded by HA and coeng shiftable_c_2nd to U+17CA before the above vowel +U+17A0 U+17D2 any(shiftable_c_2nd_with_BA) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) c change U+17BB preceded by HA and coeng shiftable_c_2nd to U+17CA before U+17B6 U+17C6 + +c consonant clusters --2nd > 1st series (with U+17BB) + +U+179B U+17D2 any(c_2nd_combo_LO) U+17BB any(v_above) > context(1) context(2) context(3) U+17C9 context(5) +U+179B U+17D2 any(c_2nd_combo_LO) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(5) context(6) +U+179B U+17D2 any(c_2nd_combo_LO) any(v_above) U+17BB > context(1) context(2) context(3) U+17C9 context(4) +U+179B U+17D2 any(c_2nd_combo_LO) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(6) context(7) + +U+1798 U+17D2 any(c_2nd_combo_MO) U+17BB any(v_above) > context(1) context(2) context(3) U+17C9 context(5) +U+1798 U+17D2 any(c_2nd_combo_MO) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(5) context(6) +U+1798 U+17D2 any(c_2nd_combo_MO) any(v_above) U+17BB > context(1) context(2) context(3) U+17C9 context(4) +U+1798 U+17D2 any(c_2nd_combo_MO) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(6) context(7) + +c single consonants --1st > 2nd series (with U+17BB) + +any(shiftable_c_1st) U+17BB any(v_above) > context(1) U+17CA context(3) c change U+17BB to U+17CA before the above vowel +any(shiftable_c_1st) U+17BB U+17B6 U+17C6 > context(1) U+17CA context(3) context(4) c change U+17BB to U+17CA before ាំ +any(shiftable_c_1st) any(v_above) U+17BB > context(1) U+17CA context(2) c change U+17BB to U+17CA and place it before the above vowel +any(shiftable_c_1st) U+17BB U+17C6 U+17B6 U+17C6 > context(1) U+17CA context(4) context(5) c change U+17BB U+17C6 to U+17CA + +c single consonants --2nd > 1st series (with U+17BB) + +any(shiftable_c_2nd_with_BA) U+17BB any(v_above) > context(1) U+17C9 context(3) c change U+17BB to U+17C9 before the above vowel +any(shiftable_c_2nd_with_BA) U+17BB U+17B6 U+17C6 > context(1) U+17C9 context(3) context(4) c change U+17BB to U+17C9 before ាំ +any(shiftable_c_2nd_with_BA) any(v_above) U+17BB > context(1) U+17C9 context(2) c change U+17BB to U+17C9 before the above vowel +any(shiftable_c_2nd_with_BA) U+17BB U+17C6 U+17B6 U+17C6 > context(1) U+17C9 context(4) context(5) c change U+17BB U+17C6 to U+17C9 + +c prevent incorrect use of consonant shifter with 2nd series consonant clusters (without U+17BB) + +U+179B U+17D2 any(c_2nd_combo_LO) U+17CA any(v_above) > context(1) context(2) context(3) U+17C9 context(5) +U+1798 U+17D2 any(c_2nd_combo_MO) U+17CA any(v_above) > context(1) context(2) context(3) U+17C9 context(5) +U+179B U+17D2 any(c_2nd_combo_LO) U+17CA any(v_gen) any(v_pseudo) > context(1) context(2) context(3) U+17C9 context(5) context(6) +U+1798 U+17D2 any(c_2nd_combo_MO) U+17CA any(v_gen) any(v_pseudo) > context(1) context(2) context(3) U+17C9 context(5) context(6) + +c single consonants --2nd > 1st series (without U+17BB) + +any(shiftable_c_2nd) U+17CA any(v_above) > context(1) U+17C9 context(3) c change U+17CA to U+17C9 before the above vowel +any(shiftable_c_2nd) U+17CA any(v_gen) any(v_pseudo) > context(1) U+17C9 context(3) context(4) c change U+17CA to U+17C9 before ាំ + +U+17D2 any(shiftable_c_2nd) U+17CA any(v_above) > context c stop ស្រ៊ី from becoming ស្រ៉ី +U+17D2 any(shiftable_c_2nd) U+17CA any(v_gen) any(v_pseudo) > context + +c SPECIAL CASE -- the following clusters may accept either of the two consonant shifters. + +U+1794 U+17D2 U+1799 any(c_shifter) > context +U+179F U+17D2 U+1794 any(c_shifter) > context +U+1786 U+17D2 U+1794 any(c_shifter) > context +U+1794 U+17D2 U+1799 any(c_shifter) > context +U+179F U+17D2 U+1794 any(c_shifter) > context +U+1786 U+17D2 U+1794 any(c_shifter) > context + +c single --1st > 2nd series (without U+17BB) + +any(shiftable_c_1st) U+17C9 any(v_above) > context(1) U+17CA context(3) c change U+17C9 to U+17CA before the above vowel +any(shiftable_c_1st) U+17C9 any(v_gen) any(v_pseudo) > context(1) U+17CA context(3) context(4) c change U+17C9 to U+17CA before ាំ + +c consonant clusters --1st > 2nd series (without U+17BB) + +any(c_combo_QA) U+17D2 U+17A2 U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+179B U+17D2 any(c_1st_combo_LO) U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+1798 U+17D2 any(c_1st_combo_MO) U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+179F U+17D2 U+1794 U+17C9 any(v_above) > context(1) context(2) context(3) U+17C9 context(5) c prevent ស្ប៉ី from transforming to ស្ប៊ី +U+179F U+17D2 any(c_combo_SA) U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +any(c_combo_HA) U+17D2 U+17A0 U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+17A2 U+17D2 U+1784 U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+17A2 U+17D2 U+179C U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +any(c_combo_QA) U+17D2 U+17A2 U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+179B U+17D2 any(c_1st_combo_LO) U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+1798 U+17D2 any(c_1st_combo_MO) U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+179F U+17D2 U+1794 U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(5) context(6) c prevent ស្ប៉ាំ from transforming to ស្ប៊ាំ +U+179F U+17D2 any(c_combo_SA) U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +any(c_combo_HA) U+17D2 U+17A0 U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+17A2 U+17D2 U+1784 U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+17A2 U+17D2 U+179C U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) + +c U+17B6 U+17BB and U+17C6 in that order preceeded by any first series consonant (cluster) are transformed to U+17CA U+17B6 and U+17C6 + +any(shiftable_c_1st) U+17B6 U+17BB U+17C6 > context(1) U+17CA context(2) context(4) +any(shiftable_c_1st) U+17BB U+17C6 U+17B6 > context(1) U+17CA context(4) context(3) + +any(c_combo_QA) U+17D2 U+17A2 U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +any(c_combo_QA) U+17D2 U+17A2 U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +U+179B U+17D2 any(c_1st_combo_LO) U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +U+179B U+17D2 any(c_1st_combo_LO) U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +U+1798 U+17D2 any(c_1st_combo_MO) U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +U+1798 U+17D2 any(c_1st_combo_MO) U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +U+179F U+17D2 any(c_combo_SA) U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +U+179F U+17D2 any(c_combo_SA) U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +any(c_combo_HA) U+17D2 U+17A0 U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +any(c_combo_HA) U+17D2 U+17A0 U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +U+17A2 U+17D2 U+1784 U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +U+17A2 U+17D2 U+1784 U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +U+17A2 U+17D2 U+179C U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +U+17A2 U+17D2 U+179C U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(4) context(6) + +c U+17B6 U+17BB and U+17C6 in that order preceeded by any second series consonant (cluster) are transformed to U+17C9 U+17B6 and U+17C6 + +any(shiftable_c_2nd_with_BA) U+17B6 U+17BB U+17C6 > context(1) U+17C9 context(2) context(4) +any(shiftable_c_2nd_with_BA) U+17BB U+17C6 U+17B6 > context(1) U+17C9 context(4) context(3) + +U+179B U+17D2 any(c_2nd_combo_LO) U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17C9 context(4) context(6) +U+179B U+17D2 any(c_2nd_combo_LO) U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17C9 context(6) context(5) + +U+1798 U+17D2 any(c_2nd_combo_MO) U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17C9 context(4) context(6) +U+1798 U+17D2 any(c_2nd_combo_MO) U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17C9 context(6) context(5) + +c េុី/ុេី/៉េី > ៊ើ + +any(shiftable_c_1st) U+17C1 U+17BB U+17B8 > context(1) U+17CA U+17BE c cancel out by vowel rotation +any(shiftable_c_1st) U+17BB U+17C1 U+17B8 > context(1) U+17CA U+17BE c cancel out by vowel rotation +any(shiftable_c_1st) U+17C9 U+17C1 U+17B8 > context(1) U+17CA U+17BE + +any(c_combo_QA) U+17D2 U+17A2 U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +any(c_combo_QA) U+17D2 U+17A2 U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +any(c_combo_QA) U+17D2 U+17A2 U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +U+179B U+17D2 any(c_1st_combo_LO) U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+179B U+17D2 any(c_1st_combo_LO) U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+179B U+17D2 any(c_1st_combo_LO) U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +U+1798 U+17D2 any(c_1st_combo_MO) U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+1798 U+17D2 any(c_1st_combo_MO) U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+1798 U+17D2 any(c_1st_combo_MO) U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +U+179F U+17D2 any(c_combo_SA) U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+179F U+17D2 any(c_combo_SA) U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+179F U+17D2 any(c_combo_SA) U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +any(c_combo_HA) U+17D2 U+17A0 U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +any(c_combo_HA) U+17D2 U+17A0 U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +any(c_combo_HA) U+17D2 U+17A0 U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +U+17A2 U+17D2 U+1784 U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+17A2 U+17D2 U+1784 U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+17A2 U+17D2 U+1784 U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +U+17A2 U+17D2 U+179C U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+17A2 U+17D2 U+179C U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+17A2 U+17D2 U+179C U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +c េុី/ុេី/៊េី > ៉ើ + +any(shiftable_c_2nd) U+17C1 U+17BB U+17B8 > context(1) U+17C9 U+17BE c cancel out by vowel rotation +any(shiftable_c_2nd) U+17BB U+17C1 U+17B8 > context(1) U+17C9 U+17BE c cancel out by vowel rotation +any(shiftable_c_2nd) U+17CA U+17C1 U+17B8 > context(1) U+17C9 U+17BE + +U+179B U+17D2 any(c_2nd_combo_LO) U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE c cancel out by vowel rotation +U+179B U+17D2 any(c_2nd_combo_LO) U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE c cancel out by vowel rotation +U+179B U+17D2 any(c_2nd_combo_LO) U+17CA U+17C1 U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE + +U+1798 U+17D2 any(c_2nd_combo_MO) U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE c cancel out by vowel rotation +U+1798 U+17D2 any(c_2nd_combo_MO) U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE c cancel out by vowel rotation +U+1798 U+17D2 any(c_2nd_combo_MO) U+17CA U+17C1 U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE + +c place Robat after a base before any vowel + +any(c_out) any(v_gen) U+17CC > context(1) context(3) context(2) + +c Use appropriate identical subscript in two separate contexts. (Case #8) + +U+178E U+17D2 U+178F > context(1) context(2) U+178A +U+1793 U+17D2 U+178A > context(1) context(2) U+178F + +c BONUSES​(note that these combinations are invalid and they can't be found in the CN dictionary 1967 nor RH 1997, but users think they are) + +U+1791 U+17D2 U+1794 > U+17A1 c ទ្ប transforms to ឡ + +U+1794 U+17D2 U+1789 > U+17AB c ប្ញ transforms to ឫ +U+17AB U+17BB > U+17AC c ឫុ transforms to ឬ + +U+17AD U+17B6 > U+1789 c ឭា transforms to ញ +U+17AE U+17B6 > U+1789 c ឮា transforms to ញ + +U+1796 U+17D2 U+1789 > U+17AD c ព្ញ transforms to ឭ +U+17AD U+17BB > U+17AE c ឭុ transforms to ឮ + +U+1796 U+17D2 U+178B > U+17B0 c ព្ឋ transforms to ឰ + +U+17A7 U+17B7 > U+17B1 c ឧិ transforms to ឱ +U+17A7 U+17CC > U+17B1 c ឧ៌ transforms to ឱ +U+17A7 U+17CD > U+17B1 c ឧ៍ transforms to ឱ + +c U+17D4 U+179B U+17D4 > U+17D8 c ។ល។ transforms to U+17D8 + +U+178A U+17D2 U+1792 > U+178A U+17D2 U+178B c ដ្ធ > ដ្ឋ +U+1791 U+17D2 U+178B > U+1791 U+17D2 U+1792 c ទ្ឋ > ទ្ធ + +c additional rules + +U+1796 U+1793 U+17D2 U+178B > context(1) context(2) context(3) U+1792 c ពន្ឋ > ពន្ធ +U+1796 U+17D0 U+1793 U+17D2 U+178B > context(1) context(2) context(3) context(4) U+1792 c ព័ន្ឋ > ព័ន្ធ + + +U+17AA U+17D2 U+1799 > U+17B1 context(2) context(3) c ឪ្យ > ឱ្យ +U+17B3 U+17D2 U+1799 > U+17B1 context(2) context(3) c ឳ្យ > ឱ្យ + +U+1789 U+17D2 U+179C > U+1796 context(2) context(3) U+17B6 c ញ្វ (as in សញ្វវុធ) > ព្វា as in សញ្វវុធ + +U+17D2 U+1799 U+17C1 U+17BA > U+17BF c េ្យឺ > ឿ +U+17D2 U+1799 U+17C1 U+17B9 > U+17BF c េ្យឹ > ឿ +U+17D2 U+1799 U+17C1 U+17B8 > U+17BF c េ្យី > ឿ + +U+17D2 U+1799 U+17D2 any(c_out) U+17C1 U+17BA > context(3) context(4) U+17BF c គ្រេ្យឺង > គ្រឿង +U+17D2 U+1799 U+17D2 any(c_out) U+17C1 U+17B9 > context(3) context(4) U+17BF c គ្រេ្យឹង > គ្រឿង +U+17D2 U+1799 U+17D2 any(c_out) U+17C1 U+17B8 > context(3) context(4) U+17BF c គ្រេ្យីង > គ្រឿង + +c In everyday practice, both 'regular space' and 'no-break space' are not used before punctuation, i.e. ។ ! etc. +c An annoying issue of having line broken up at the end of the line dropping the punctuation (។, ! and also ៗ) to the next line. +c It may be helpful to include a rule where a 'Zero Width No-Break Space' should be output together with those punct. +c ref: https://www.unicode.org/L2/L2020/20008-core-text.pdf +c ref: https://www.unicode.org/versions/Unicode12.0.0/ch23.pdf#G12985 +c ref: https://www.compart.com/en/unicode/U+FEFF + +c EOF diff --git a/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.kps b/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.kps new file mode 100644 index 0000000000000000000000000000000000000000..a6b5ca26ce810dc9e815591fb03bafedf872aa6a --- /dev/null +++ b/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.kps @@ -0,0 +1,57 @@ + + + + 15.0.266.0 + 7.0 + + + + readme.htm + splash.gif + + + + + + + + + + Khmer Angkor + © 2015-2022 SIL International + Makara Sok + + https://keyman.com/keyboards/khmer_angkor + + + + ..\build\khmer_angkor.js + File khmer_angkor.js + 0 + .js + + + ..\build\khmer_angkor.kvk + File khmer_angkor.kvk + 0 + .kvk + + + ..\build\khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + + diff --git a/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.kvks b/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.kvks new file mode 100644 index 0000000000000000000000000000000000000000..e9c38a464ddd8d6d2c1732ebe06557abe083a5b8 --- /dev/null +++ b/developer/src/kmc/test/fixtures/folder-project-no-kpj/khmer_angkor/source/khmer_angkor.kvks @@ -0,0 +1,206 @@ + + +
+ 10.0 + khmer_angkor + + + +
+ + + ឞ + ឝ + ៈ + ឳ + ឨ + ឩ + ឰ + ឫ + ឦ + ឱ + ឯ + + + ៜ + + ៖ + ៙ + ៚ + + ៘ + ‌ + ‍ + ] + [ + / + . + ‘ + + + & + ’ + * + @ + \ + } + { + - + ÷ + : + , + ≈ + ; + < + # + > + × + $ + € +   + + + ៸ + ៰ + ៱ + ៲ + ៳ + ៴ + ៵ + ៶ + ៷ + ៹ + ᧿ + ᧾ + ᧪ + ᧫ + ᧶ + ᧵ + ᧬ + ᧷ + ᧥ + ᧸ + ᧡ + ᧻ + ᧹ + ᧮ + ᧢ + ᧯ + ᧰ + ᧦ + ᧱ + ᧤ + ᧭ + ᧣ + ᧧ + ᧠ + ᧺ + ᧲ + ᧳ + ᧴ + ᧩ + ᧨ + ᧼ + ᧽ + + + ​ + + + ឥ + ។ + + ០ + ១ + ២ + ៣ + ៤ + ៥ + ៦ + ៧ + ៨ + ៩ + + ឲ + + ឮ + ឪ + « + + ប + ច + ដ + + ថ + ង + ហ + + + ក + ល + ម + ន + + ផ + ឆ + រ + ស + ត + + វ + + ខ + យ + ឋ + + + + ! + + " + ៛ + % + + ( + ) + + = + + ៕ + ? + ៗ + + ព + ជ + ឌ + + ធ + អ + ះ + + ញ + គ + ឡ + + ណ + + ភ + ឈ + ឬ + + ទ + + + + ឃ + + ឍ + + + + ឭ + ឧ + » + + + +
diff --git a/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/khmer_angkor.kpj b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/khmer_angkor.kpj new file mode 100644 index 0000000000000000000000000000000000000000..2b5513fc52511f36911304f3f644b5b30504e5c9 --- /dev/null +++ b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/khmer_angkor.kpj @@ -0,0 +1,12 @@ + + + + $PROJECTPATH\build + $PROJECTPATH\source + True + True + False + keyboard + 2.0 + + diff --git a/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.ico b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.ico new file mode 100644 index 0000000000000000000000000000000000000000..42c90c398daf08f560778dd383cc0f7dd5922ae1 Binary files /dev/null and b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.ico differ diff --git a/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.keyman-touch-layout b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.keyman-touch-layout new file mode 100644 index 0000000000000000000000000000000000000000..711f84900839ee67b03213427c5591a98e2a0080 --- /dev/null +++ b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.keyman-touch-layout @@ -0,0 +1,1950 @@ +{ + "tablet": { + "displayUnderlying": false, + "layer": [ + { + "id": "default", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "១" + }, + { + "id": "K_2", + "text": "២" + }, + { + "id": "K_3", + "text": "៣" + }, + { + "id": "K_4", + "text": "៤" + }, + { + "id": "K_5", + "text": "៥" + }, + { + "id": "K_6", + "text": "៦" + }, + { + "id": "K_7", + "text": "៧" + }, + { + "id": "K_8", + "text": "៨" + }, + { + "id": "K_9", + "text": "៩" + }, + { + "id": "K_0", + "text": "០" + }, + { + "id": "K_HYPHEN", + "text": "ឥ" + }, + { + "id": "K_EQUAL", + "text": "ឲ" + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_Q", + "text": "ឆ", + "pad": "75" + }, + { + "id": "K_W", + "text": "" + }, + { + "id": "K_E", + "text": "" + }, + { + "id": "K_R", + "text": "រ" + }, + { + "id": "K_T", + "text": "ត" + }, + { + "id": "K_Y", + "text": "យ" + }, + { + "id": "K_U", + "text": "" + }, + { + "id": "K_I", + "text": "" + }, + { + "id": "K_O", + "text": "" + }, + { + "id": "K_P", + "text": "ផ" + }, + { + "id": "K_LBRKT", + "text": "" + }, + { + "id": "K_RBRKT", + "text": "ឪ" + }, + { + "id": "T_new_138", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_BKQUOTE", + "text": "«" + }, + { + "id": "K_A", + "text": "" + }, + { + "id": "K_S", + "text": "ស" + }, + { + "id": "K_D", + "text": "ដ" + }, + { + "id": "K_F", + "text": "ថ" + }, + { + "id": "K_G", + "text": "ង" + }, + { + "id": "K_H", + "text": "ហ" + }, + { + "id": "K_J", + "text": "" + }, + { + "id": "K_K", + "text": "ក" + }, + { + "id": "K_L", + "text": "ល" + }, + { + "id": "K_COLON", + "text": "" + }, + { + "id": "K_QUOTE", + "text": "" + }, + { + "id": "K_BKSLASH", + "text": "ឮ" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_SHIFT", + "text": "*Shift*", + "width": "160", + "sp": "1", + "nextlayer": "shift" + }, + { + "id": "K_oE2", + "text": "" + }, + { + "id": "K_Z", + "text": "ឋ" + }, + { + "id": "K_X", + "text": "ខ" + }, + { + "id": "K_C", + "text": "ច" + }, + { + "id": "K_V", + "text": "វ" + }, + { + "id": "K_B", + "text": "ប" + }, + { + "id": "K_N", + "text": "ន" + }, + { + "id": "K_M", + "text": "ម" + }, + { + "id": "K_COMMA", + "text": "" + }, + { + "id": "K_PERIOD", + "text": "។" + }, + { + "id": "K_SLASH", + "text": "" + }, + { + "id": "T_new_164", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 5, + "key": [ + { + "id": "K_LCONTROL", + "text": "*AltGr*", + "width": "160", + "sp": "1", + "nextlayer": "rightalt" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "160", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "​", + "width": "930" + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "160", + "sp": "1" + } + ] + } + ] + }, + { + "id": "rightalt", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "‌" + }, + { + "id": "K_2", + "text": "@" + }, + { + "id": "K_3", + "text": "" + }, + { + "id": "K_4", + "text": "$" + }, + { + "id": "K_5", + "text": "€" + }, + { + "id": "K_6", + "text": "៙" + }, + { + "id": "K_7", + "text": "៚" + }, + { + "id": "K_8", + "text": "*" + }, + { + "id": "K_9", + "text": "{" + }, + { + "id": "K_0", + "text": "}" + }, + { + "id": "K_HYPHEN", + "text": "≈" + }, + { + "id": "K_EQUAL", + "text": "" + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_Q", + "text": "ៜ", + "pad": "75" + }, + { + "id": "K_W", + "text": "" + }, + { + "id": "K_E", + "text": "ឯ" + }, + { + "id": "K_R", + "text": "ឫ" + }, + { + "id": "K_T", + "text": "ឨ" + }, + { + "id": "K_Y", + "text": "[" + }, + { + "id": "K_U", + "text": "]" + }, + { + "id": "K_I", + "text": "ឦ" + }, + { + "id": "K_O", + "text": "ឱ" + }, + { + "id": "K_P", + "text": "ឰ" + }, + { + "id": "K_LBRKT", + "text": "ឩ" + }, + { + "id": "K_RBRKT", + "text": "ឳ" + }, + { + "id": "T_new_307", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_BKQUOTE", + "text": "‍" + }, + { + "id": "K_A", + "text": "+" + }, + { + "id": "K_S", + "text": "-" + }, + { + "id": "K_D", + "text": "×" + }, + { + "id": "K_F", + "text": "÷" + }, + { + "id": "K_G", + "text": ":" + }, + { + "id": "K_H", + "text": "‘" + }, + { + "id": "K_J", + "text": "’" + }, + { + "id": "K_K", + "text": "ឝ" + }, + { + "id": "K_L", + "text": "៘" + }, + { + "id": "K_COLON", + "text": "៖" + }, + { + "id": "K_QUOTE", + "text": "ៈ" + }, + { + "id": "K_BKSLASH", + "text": "\\" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_SHIFT", + "text": "*Shift*", + "width": "160", + "sp": "1", + "nextlayer": "shift" + }, + { + "id": "K_oE2", + "text": "" + }, + { + "id": "K_Z", + "text": "<" + }, + { + "id": "K_X", + "text": ">" + }, + { + "id": "K_C", + "text": "#" + }, + { + "id": "K_V", + "text": "&" + }, + { + "id": "K_B", + "text": "ឞ" + }, + { + "id": "K_N", + "text": ";" + }, + { + "id": "K_M", + "text": "" + }, + { + "id": "K_COMMA", + "text": "," + }, + { + "id": "K_PERIOD", + "text": "." + }, + { + "id": "K_SLASH", + "text": "/" + }, + { + "id": "T_new_333", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 5, + "key": [ + { + "id": "K_LCONTROL", + "text": "*AltGr*", + "width": "160", + "sp": "2", + "nextlayer": "default" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "160", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": " ", + "width": "930" + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "160", + "sp": "1" + } + ] + } + ] + }, + { + "id": "shift", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "!" + }, + { + "id": "K_2", + "text": "ៗ" + }, + { + "id": "K_3", + "text": "\"" + }, + { + "id": "K_4", + "text": "៛" + }, + { + "id": "K_5", + "text": "%" + }, + { + "id": "K_6", + "text": "" + }, + { + "id": "K_7", + "text": "" + }, + { + "id": "K_8", + "text": "" + }, + { + "id": "K_9", + "text": "(" + }, + { + "id": "K_0", + "text": ")" + }, + { + "id": "K_HYPHEN", + "text": "" + }, + { + "id": "K_EQUAL", + "text": "=" + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_Q", + "text": "ឈ", + "pad": "75" + }, + { + "id": "K_W", + "text": "" + }, + { + "id": "K_E", + "text": "" + }, + { + "id": "K_R", + "text": "ឬ" + }, + { + "id": "K_T", + "text": "ទ" + }, + { + "id": "K_Y", + "text": "" + }, + { + "id": "K_U", + "text": "" + }, + { + "id": "K_I", + "text": "" + }, + { + "id": "K_O", + "text": "" + }, + { + "id": "K_P", + "text": "ភ" + }, + { + "id": "K_LBRKT", + "text": "" + }, + { + "id": "K_RBRKT", + "text": "ឧ" + }, + { + "id": "T_new_364", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_BKQUOTE", + "text": "»" + }, + { + "id": "K_A", + "text": "" + }, + { + "id": "K_S", + "text": "" + }, + { + "id": "K_D", + "text": "ឌ" + }, + { + "id": "K_F", + "text": "ធ" + }, + { + "id": "K_G", + "text": "អ" + }, + { + "id": "K_H", + "text": "ះ" + }, + { + "id": "K_J", + "text": "ញ" + }, + { + "id": "K_K", + "text": "គ" + }, + { + "id": "K_L", + "text": "ឡ" + }, + { + "id": "K_COLON", + "text": "" + }, + { + "id": "K_QUOTE", + "text": "" + }, + { + "id": "K_BKSLASH", + "text": "ឭ" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_SHIFT", + "text": "*Shift*", + "width": "160", + "sp": "2", + "nextlayer": "default" + }, + { + "id": "K_oE2", + "text": "" + }, + { + "id": "K_Z", + "text": "ឍ" + }, + { + "id": "K_X", + "text": "ឃ" + }, + { + "id": "K_C", + "text": "ជ" + }, + { + "id": "K_V", + "text": "" + }, + { + "id": "K_B", + "text": "ព" + }, + { + "id": "K_N", + "text": "ណ" + }, + { + "id": "K_M", + "text": "" + }, + { + "id": "K_COMMA", + "text": "" + }, + { + "id": "K_PERIOD", + "text": "៕" + }, + { + "id": "K_SLASH", + "text": "?" + }, + { + "id": "T_new_390", + "text": "", + "width": "10", + "sp": "10" + } + ] + }, + { + "id": 5, + "key": [ + { + "id": "K_LCONTROL", + "text": "*AltGr*", + "width": "160", + "sp": "1", + "nextlayer": "rightalt" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "160", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "", + "width": "930" + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "160", + "sp": "1" + } + ] + } + ] + } + ], + "font": "Khmer Busra Kbd", + "fontsize": "0.8em" + }, + "phone": { + "layer": [ + { + "id": "default", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_Q", + "text": "ឆ", + "pad": "", + "sk": [ + { + "text": "ឈ", + "id": "K_Q", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1786" + }, + { + "text": "", + "id": "T_17D2_1788" + } + ] + }, + { + "id": "K_W", + "text": "", + "sk": [ + { + "text": "", + "id": "K_W", + "layer": "shift" + } + ] + }, + { + "id": "K_E", + "text": "", + "sk": [ + { + "text": "", + "id": "K_E", + "layer": "shift" + }, + { + "text": "", + "id": "K_S", + "layer": "shift" + }, + { + "text": "", + "id": "K_V", + "layer": "shift" + }, + { + "text": "ឯ", + "id": "U_17AF" + }, + { + "text": "ឰ", + "id": "U_17B0" + } + ] + }, + { + "id": "K_R", + "text": "រ", + "sk": [ + { + "text": "", + "id": "T_17D2_179A" + }, + { + "text": "ឫ", + "id": "U_17AB" + }, + { + "text": "ឬ", + "id": "U_17AC" + } + ] + }, + { + "id": "K_T", + "text": "ត", + "sk": [ + { + "text": "ទ", + "id": "K_T", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_178F" + }, + { + "text": "", + "id": "T_17D2_1791", + "layer": "default" + } + ] + }, + { + "id": "K_Y", + "text": "យ", + "sk": [ + { + "text": "", + "id": "T_17D2_1799" + } + ] + }, + { + "id": "K_U", + "text": "", + "sk": [ + { + "text": "", + "id": "K_U", + "layer": "shift" + }, + { + "text": "", + "id": "K_Y", + "layer": "shift" + }, + { + "text": "ឧ", + "id": "U_17A7" + }, + { + "text": "ឪ", + "id": "U_17AA", + "layer": "shift" + }, + { + "text": "ឩ", + "id": "U_17A9", + "layer": "shift" + }, + { + "text": "ឨ", + "id": "U_17A8" + } + ] + }, + { + "id": "K_I", + "text": "", + "sk": [ + { + "text": "", + "id": "K_I", + "layer": "shift" + }, + { + "text": "ឥ", + "id": "U_17A5" + }, + { + "text": "ឦ", + "id": "U_17A6", + "layer": "shift" + } + ] + }, + { + "id": "K_O", + "text": "", + "sk": [ + { + "text": "", + "id": "K_O", + "layer": "shift" + }, + { + "text": "", + "id": "K_LBRKT" + }, + { + "text": "", + "id": "K_LBRKT", + "layer": "shift" + }, + { + "text": "", + "id": "K_COLON", + "layer": "shift" + }, + { + "text": "ឱ", + "id": "U_17B1" + }, + { + "text": "ឲ", + "id": "U_17B2" + }, + { + "text": "ឳ", + "id": "U_17B3", + "layer": "shift" + } + ] + }, + { + "id": "K_P", + "text": "ផ", + "sk": [ + { + "text": "ភ", + "id": "K_P", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1795" + }, + { + "text": "", + "id": "T_17D2_1797", + "layer": "default" + } + ] + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "K_A", + "text": "", + "pad": "", + "width": "100", + "sk": [ + { + "text": "", + "id": "K_A", + "layer": "shift" + } + ] + }, + { + "id": "K_S", + "text": "ស", + "sk": [ + { + "text": "", + "id": "T_17D2_179F" + }, + { + "text": "ឝ", + "id": "U_179D" + }, + { + "text": "ឞ", + "id": "U_179E" + } + ] + }, + { + "id": "K_D", + "text": "ដ", + "sk": [ + { + "text": "ឌ", + "id": "K_D", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_178A" + }, + { + "text": "", + "id": "T_17D2_178C", + "layer": "default" + } + ] + }, + { + "id": "K_F", + "text": "ថ", + "sk": [ + { + "text": "ធ", + "id": "K_F", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1790" + }, + { + "text": "", + "id": "T_17D2_1792", + "layer": "default" + } + ] + }, + { + "id": "K_G", + "text": "ង", + "sk": [ + { + "text": "អ", + "id": "K_G", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1784" + }, + { + "text": "", + "id": "T_17D2_17A2", + "layer": "default" + } + ] + }, + { + "id": "K_H", + "text": "ហ", + "sk": [ + { + "text": "", + "id": "T_17D2_17A0" + }, + { + "text": "ះ", + "id": "K_H", + "layer": "shift" + }, + { + "text": "ៈ", + "id": "U_17C8" + } + ] + }, + { + "id": "K_J", + "text": "ញ", + "layer": "shift", + "sk": [ + { + "text": "", + "id": "T_17D2_1789" + } + ] + }, + { + "id": "K_K", + "text": "ក", + "sk": [ + { + "text": "គ", + "id": "K_K", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1780" + }, + { + "text": "", + "id": "T_17D2_1782" + } + ] + }, + { + "id": "K_L", + "text": "ល", + "sk": [ + { + "text": "ឡ", + "id": "K_L", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_179B" + }, + { + "text": "ឭ", + "id": "U_17AD" + }, + { + "text": "ឮ", + "id": "U_17AE" + } + ] + }, + { + "id": "K_COLON", + "text": "" + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "K_Z", + "text": "ឋ", + "pad": "", + "width": "", + "sk": [ + { + "text": "ឍ", + "id": "K_Z", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_178B" + }, + { + "text": "", + "id": "T_17D2_178D", + "layer": "default" + } + ] + }, + { + "id": "K_X", + "text": "ខ", + "sk": [ + { + "text": "ឃ", + "id": "K_X", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1781" + }, + { + "text": "", + "id": "T_17D2_1783", + "layer": "default" + } + ] + }, + { + "id": "K_C", + "text": "ច", + "sk": [ + { + "text": "ជ", + "id": "K_C", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1785" + }, + { + "text": "", + "id": "T_17D2_1787", + "layer": "default" + } + ] + }, + { + "id": "K_V", + "text": "វ", + "sk": [ + { + "text": "", + "id": "T_17D2_179C" + } + ] + }, + { + "id": "K_B", + "text": "ប", + "sk": [ + { + "text": "ព", + "id": "K_B", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1794" + }, + { + "text": "", + "id": "T_17D2_1796", + "layer": "default" + } + ] + }, + { + "id": "K_N", + "text": "ន", + "sk": [ + { + "text": "ណ", + "id": "K_N", + "layer": "shift" + }, + { + "text": "", + "id": "T_17D2_1793" + }, + { + "text": "", + "id": "T_17D2_178E", + "layer": "default" + } + ] + }, + { + "id": "K_M", + "text": "ម", + "sk": [ + { + "text": "", + "id": "T_17D2_1798" + }, + { + "text": "", + "id": "K_M", + "layer": "shift" + } + ] + }, + { + "id": "K_COMMA", + "text": "", + "sk": [ + { + "text": "", + "id": "K_COMMA", + "layer": "shift" + }, + { + "text": "", + "id": "K_6", + "layer": "shift" + }, + { + "text": "", + "id": "K_7", + "layer": "shift" + }, + { + "text": "", + "id": "K_8", + "layer": "shift" + }, + { + "text": "", + "id": "K_HYPHEN", + "layer": "shift" + }, + { + "text": "", + "id": "U_17D1", + "layer": "shift" + }, + { + "text": "", + "id": "U_17DD", + "layer": "shift" + }, + { + "text": "", + "id": "U_17CE", + "layer": "shift" + } + ] + }, + { + "id": "K_QUOTE", + "text": "", + "width": "100", + "sk": [ + { + "text": "", + "id": "K_QUOTE", + "layer": "shift" + }, + { + "text": "", + "id": "K_SLASH" + } + ] + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "100", + "sp": "1" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_NUMLOCK", + "text": "១២៣", + "width": "140", + "sp": "1", + "nextlayer": "numeric" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "120", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "​", + "width": "555", + "sp": "0", + "sk": [ + { + "text": " ", + "id": "U_0020", + "layer": "default" + } + ] + }, + { + "id": "K_PERIOD", + "text": "។", + "width": "120", + "sk": [ + { + "text": "៕", + "id": "K_PERIOD", + "layer": "shift" + }, + { + "text": "!", + "id": "U_0021" + }, + { + "text": "?", + "id": "U_003F" + } + ] + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "140", + "sp": "1" + } + ] + } + ] + }, + { + "id": "numeric", + "row": [ + { + "id": 1, + "key": [ + { + "id": "K_1", + "text": "១", + "pad": "", + "sk": [ + { + "text": "1", + "id": "U_0031" + } + ] + }, + { + "id": "K_2", + "text": "២", + "sk": [ + { + "text": "2", + "id": "U_0032" + } + ] + }, + { + "id": "K_3", + "text": "៣", + "sk": [ + { + "text": "3", + "id": "U_0033" + } + ] + }, + { + "id": "K_4", + "text": "៤", + "sk": [ + { + "text": "4", + "id": "U_0034" + } + ] + }, + { + "id": "K_5", + "text": "៥", + "sk": [ + { + "text": "5", + "id": "U_0035" + } + ] + }, + { + "id": "K_6", + "text": "៦", + "sk": [ + { + "text": "6", + "id": "U_0036" + } + ] + }, + { + "id": "K_7", + "text": "៧", + "sk": [ + { + "text": "7", + "id": "U_0037" + } + ] + }, + { + "id": "K_8", + "text": "៨", + "sk": [ + { + "text": "8", + "id": "U_0038" + } + ] + }, + { + "id": "K_9", + "text": "៩", + "sk": [ + { + "text": "9", + "id": "U_0039" + } + ] + }, + { + "id": "K_0", + "text": "០", + "sk": [ + { + "text": "0", + "id": "U_0030" + }, + { + "text": "", + "id": "U_17D3" + } + ] + } + ] + }, + { + "id": 2, + "key": [ + { + "id": "U_0040", + "text": "@", + "pad": "", + "sk": [ + { + "text": "©", + "id": "U_00A9" + }, + { + "text": "®", + "id": "U_00AE" + } + ] + }, + { + "id": "U_0023", + "text": "#", + "sk": [ + { + "text": "№", + "id": "U_2116" + }, + { + "text": "~", + "id": "U_007E" + } + ] + }, + { + "id": "U_17DB", + "text": "៛", + "sk": [ + { + "text": "$", + "id": "U_0024" + }, + { + "text": "฿", + "id": "U_0E3F" + }, + { + "text": "¢", + "id": "U_00A2" + }, + { + "text": "£", + "id": "U_00A3" + }, + { + "text": "¥", + "id": "U_00A5" + } + ] + }, + { + "id": "U_0026", + "text": "&" + }, + { + "id": "U_0025", + "text": "%", + "sk": [ + { + "text": "‰", + "id": "U_2030" + }, + { + "text": "‱", + "id": "U_2031" + } + ] + }, + { + "id": "U_002B", + "text": "+", + "sk": [ + { + "text": "-", + "id": "U_002D" + }, + { + "text": "×", + "id": "U_00D7" + }, + { + "text": "÷", + "id": "U_00F7" + }, + { + "text": "±", + "id": "U_00B1" + } + ] + }, + { + "id": "U_003D", + "text": "=", + "sk": [ + { + "text": "_", + "id": "U_005F" + }, + { + "text": "≠", + "id": "U_2260" + } + ] + }, + { + "id": "U_002A", + "text": "*", + "sk": [ + { + "text": "^", + "id": "U_005E" + } + ] + }, + { + "id": "U_003F", + "text": "?", + "sk": [ + { + "text": "¿", + "id": "U_00BF" + } + ] + }, + { + "id": "U_0021", + "text": "!", + "sk": [ + { + "text": "¡", + "id": "U_00A1" + } + ] + } + ] + }, + { + "id": 3, + "key": [ + { + "id": "U_2018", + "text": "‘", + "sk": [ + { + "text": "’", + "id": "U_2019" + } + ] + }, + { + "id": "U_201C", + "text": "“", + "sk": [ + { + "text": "”", + "id": "U_201D" + } + ] + }, + { + "id": "U_00AB", + "text": "«", + "pad": "", + "sk": [ + { + "text": "»", + "id": "U_00BB" + } + ] + }, + { + "id": "U_002F", + "text": "/", + "sk": [ + { + "text": "\\", + "id": "U_005C" + }, + { + "text": "|", + "id": "U_007C" + }, + { + "text": "¦", + "id": "U_00A6" + } + ] + }, + { + "id": "U_0028", + "text": "(", + "sk": [ + { + "text": ")", + "id": "U_0029" + }, + { + "text": "[", + "id": "U_005B" + }, + { + "text": "]", + "id": "U_005D" + }, + { + "text": "{", + "id": "U_007B" + }, + { + "text": "}", + "id": "U_007D" + } + ] + }, + { + "id": "U_17D9", + "text": "៙", + "sk": [ + { + "text": "៚", + "id": "U_17DA" + }, + { + "text": "ៜ", + "id": "U_17DC" + }, + { + "text": "§", + "id": "U_00A7" + }, + { + "text": "Ø", + "id": "U_00D8" + } + ] + }, + { + "id": "U_17D7", + "text": "ៗ" + }, + { + "id": "U_003C", + "text": "<", + "sk": [ + { + "text": "≤", + "id": "U_2264" + }, + { + "text": ">", + "id": "U_003E" + }, + { + "text": "≥", + "id": "U_2265" + } + ] + }, + { + "id": "U_17D6", + "text": "៖", + "sk": [ + { + "text": ":", + "id": "U_003A" + }, + { + "text": ";", + "id": "U_003B" + }, + { + "text": "…", + "id": "U_2026" + } + ] + }, + { + "id": "K_BKSP", + "text": "*BkSp*", + "width": "", + "sp": "1" + } + ] + }, + { + "id": 4, + "key": [ + { + "id": "K_LCONTROL", + "text": "១២៣", + "width": "140", + "sp": "2", + "nextlayer": "default" + }, + { + "id": "K_LOPT", + "text": "*Menu*", + "width": "120", + "sp": "1" + }, + { + "id": "K_SPACE", + "text": "​", + "width": "555", + "sp": "0", + "layer": "shift", + "sk": [] + }, + { + "id": "K_PERIOD", + "text": "។", + "width": "120", + "sk": [ + { + "text": "៕", + "id": "K_PERIOD", + "layer": "shift" + }, + { + "text": "!", + "id": "U_0021" + }, + { + "text": "?", + "id": "U_003F" + } + ] + }, + { + "id": "K_ENTER", + "text": "*Enter*", + "width": "140", + "sp": "1" + } + ] + } + ] + } + ], + "displayUnderlying": false, + "font": "Khmer Busra Kbd", + "fontsize": "0.8em" + } +} \ No newline at end of file diff --git a/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.kmn b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.kmn new file mode 100644 index 0000000000000000000000000000000000000000..b7919afca3e539a74834e23b2fe9eed97bdc4644 --- /dev/null +++ b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.kmn @@ -0,0 +1,642 @@ +store(&VERSION) '10.0' +store(&NAME) "Khmer Angkor" +store(©RIGHT) '© 2015-2022 SIL International' +store(&MESSAGE) "More than just a Khmer Unicode keyboard." +store(&TARGETS) 'any' +store(&LAYOUTFILE) 'khmer_angkor.keyman-touch-layout' +store(&KEYBOARDVERSION) '1.3' +store(&BITMAP) 'khmer_angkor.ico' +store(&VISUALKEYBOARD) 'khmer_angkor.kvks' + +begin Unicode > use(main) + + + +c ==============================================STORES============================================== + + + +c 33 consonants and two deprecated consonants + +store(c_key) [K_K] [K_X] [SHIFT K_K] [SHIFT K_X] [K_G] \ + [K_C] [K_Q] [SHIFT K_C] [SHIFT K_Q] [SHIFT K_J] \ + [K_D] [K_Z] [SHIFT K_D] [SHIFT K_Z] [SHIFT K_N] \ + [K_T] [K_F] [SHIFT K_T] [SHIFT K_F] [K_N] \ + [K_B] [K_P] [SHIFT K_B] [SHIFT K_P] [K_M] \ + [K_Y] [K_R] [K_L] [K_V] [K_S] [K_H] [SHIFT K_L] [SHIFT K_G] \ + [RALT K_K] [RALT K_B] +store(c_out) U+1780 U+1781 U+1782 U+1783 U+1784 \ + U+1785 U+1786 U+1787 U+1788 U+1789 \ + U+178A U+178B U+178C U+178D U+178E \ + U+178F U+1790 U+1791 U+1792 U+1793 \ + U+1794 U+1795 U+1796 U+1797 U+1798 \ + U+1799 U+179A U+179B U+179C U+179F U+17A0 U+17A1 U+17A2 \ + U+179D U+179E c deprecated, but they are used in minority languages + +c All genuine dependent vowels + +store(v_gen_key) [K_A] [K_I] [SHIFT K_I] [K_W] [SHIFT K_W] [K_U] [SHIFT K_U] [SHIFT K_Y] \ + [K_COLON] [SHIFT K_LBRKT] [K_LBRKT] [K_E] [SHIFT K_E] [SHIFT K_S] [K_O] [SHIFT K_O] +store(v_gen) U+17B6 U+17B7 U+17B8 U+17B9 U+17BA U+17BB U+17BC U+17BD \ + U+17BE U+17BF U+17C0 U+17C1 U+17C2 U+17C3 U+17C4 U+17C5 + +c All pseudo dependent vowels + +store(v_pseudo_key) [SHIFT K_M] [SHIFT K_H] [RALT K_QUOTE] +store(v_pseudo) U+17C6 U+17C7 U+17C8 + +c Both genuine and pseudo vowels + +store(v_key) outs(v_gen_key) outs(v_pseudo_key) +store(v_out) outs(v_gen) outs(v_pseudo) +store(v_any) outs(v_out) + +c These seven vowels can be concatenated with Reahmuk (U+17C7) to make េះ ោះ ុះ ិះ ីះ ឹះ and ែះ. + +store(v_combo_R) U+17C1 U+17C4 U+17BB U+17B7 U+17B8 U+17B9 U+17C2 + +c these two vowels can be concatenated with Nikahit (U+17C6) to make ាំ and ុំ. + +store(v_combo_N) U+17B6 U+17BB +store(v_combo) outs(v_combo_R) outs(v_combo_N) + +c Independent vowels + +store(ind_v_key) [K_HYPHEN] [RALT K_I] [SHIFT K_RBRKT] [RALT K_T] [RALT K_LBRKT] [K_RBRKT] [RALT K_R] [SHIFT K_R] \ + [SHIFT K_BKSLASH] [K_BKSLASH] [RALT K_E] [RALT K_P] [RALT K_O] [K_EQUAL] [RALT K_RBRKT] +store(ind_v_out) U+17A5 U+17A6 U+17A7 U+17A8 U+17A9 U+17AA U+17AB U+17AC \ + U+17AD U+17AE U+17AF U+17B0 U+17B1 U+17B2 U+17B3 + +c Diacritics + +store(diacritic_key) [K_QUOTE] [SHIFT K_7] [SHIFT K_HYPHEN] [SHIFT K_8] [SHIFT K_6] [RALT K_QUOTE] \ + [RALT K_EQUAL] [RALT K_3] [RALT K_W] [RALT K_Q] [K_J] +store(diacritic_out) U+17CB U+17D0 U+17CC U+17CF U+17CD U+17C8 \ + U+17CE U+17D1 U+17DD U+17DC U+17D2 + +c Consonant shifter--Muusikatoan(U+17C9) and Triisap(U+17CA) + +store(c_shifter_key) [SHIFT K_QUOTE] [K_SLASH] +store(c_shifter) U+17C9 U+17CA + +c punctuations + +store(punct_key) [K_PERIOD] [SHIFT K_PERIOD] [RALT K_COLON] [SHIFT K_2] [RALT K_L] [RALT K_6] [RALT K_7] [RALT K_M] +store(punct_out) U+17D4 U+17D5 U+17D6 U+17D7 U+17D8 U+17D9 U+17DA U+17D3 + +store(latin_punct_key) [K_BKQUOTE] [SHIFT K_BKQUOTE] [SHIFT K_9] [SHIFT K_0] [SHIFT K_1] [SHIFT K_3] \ + [SHIFT K_5] [SHIFT K_EQUAL] [SHIFT K_SLASH] [RALT K_9] [RALT K_0] [RALT K_BKSLASH] \ + [RALT K_2] [RALT K_8] [RALT K_COMMA] [RALT K_D] [RALT K_PERIOD] [RALT K_SLASH] \ + [RALT K_Y] [RALT K_U] [RALT K_BKQUOTE] [RALT K_1] [RALT K_A] [RALT K_S] \ + [RALT K_F] [RALT K_G] [RALT K_HYPHEN] [RALT K_H] [RALT K_J] [RALT K_N] \ + [RALT K_Z] [RALT K_X] [RALT K_C] [RALT K_V] +store(latin_punct_out) U+00AB U+00BB U+0028 U+0029 U+0021 U+0022 \ + U+0025 U+003D U+003F U+007B U+007D U+005C \ + U+0040 U+002A U+002C U+00D7 U+002E U+002F \ + U+005B U+005D U+200D U+200C U+002B U+002D \ + U+00F7 U+003A U+2248 U+2018 U+2019 U+003B \ + U+003C U+003E U+0023 U+0026 +c white space, ZWSP, ZWJ +store(spaces_key) [K_SPACE] [SHIFT K_SPACE] [RALT K_SPACE] +store(spaces_out) U+200B U+0020 U+00A0 + +c Currency: Riel, Dollar and Euro + +store(currency_key) [SHIFT K_4] [RALT K_4] [RALT K_5] +store(currency_out) U+17DB U+0024 U+20AC + +c Khmer digits 0 through 9 + +store(digit_key) [K_0] [K_1] [K_2] [K_3] [K_4] [K_5] [K_6] [K_7] [K_8] [K_9] +store(digit_out) U+17E0 U+17E1 U+17E2 U+17E3 U+17E4 U+17E5 U+17E6 U+17E7 U+17E8 U+17E9 + +c Khmer Lek Attak (a.k.a. divination lore) +store(lek_attak_key) [SHIFT RALT K_0] [SHIFT RALT K_1] [SHIFT RALT K_2] [SHIFT RALT K_3] [SHIFT RALT K_4] \ + [SHIFT RALT K_5] [SHIFT RALT K_6] [SHIFT RALT K_7] [SHIFT RALT K_8] [SHIFT RALT K_9] +store(lek_attak_out) U+17F0 U+17F1 U+17F2 U+17F3 U+17F4 \ + U+17F5 U+17F6 U+17F7 U+17F8 U+17F9 + +c Lunar date format (Khmer style) + +store(lunar_date_key) [SHIFT RALT K_A] [SHIFT RALT K_B] [SHIFT RALT K_C] [SHIFT RALT K_D] [SHIFT RALT K_E] \ + [SHIFT RALT K_F] [SHIFT RALT K_G] [SHIFT RALT K_H] [SHIFT RALT K_I] [SHIFT RALT K_J] \ + [SHIFT RALT K_K] [SHIFT RALT K_L] [SHIFT RALT K_M] [SHIFT RALT K_N] [SHIFT RALT K_O] \ + [SHIFT RALT K_P] [SHIFT RALT K_Q] [SHIFT RALT K_R] [SHIFT RALT K_S] [SHIFT RALT K_T] \ + [SHIFT RALT K_U] [SHIFT RALT K_V] [SHIFT RALT K_W] [SHIFT RALT K_X] [SHIFT RALT K_Y] \ + [SHIFT RALT K_Z] [SHIFT RALT K_COLON] [SHIFT RALT K_COMMA] [SHIFT RALT K_PERIOD] [SHIFT RALT K_LBRKT] \ + [SHIFT RALT K_RBRKT] [SHIFT RALT K_QUOTE] +store(lunar_date_out) U+19EC U+19FB U+19F9 U+19EE U+19E2 \ + U+19EF U+19F0 U+19F1 U+19E7 U+19F2 \ + U+19F3 U+19F4 U+19FD U+19FC U+19E8 \ + U+19E9 U+19E0 U+19E3 U+19ED U+19E4 \ + U+19E6 U+19FA U+19E1 U+19F8 U+19E5 \ + U+19F7 U+19F5 U+19FE U+19FF U+19EA \ + U+19EB U+19F6 + +c Subscripts​ for mobile/table layouts + +store(input_subcons) \ + [T_17D2_1780] [T_17D2_1781] [T_17D2_1782] [T_17D2_1783] [T_17D2_1784] [T_17D2_1785] [T_17D2_1786] [T_17D2_1787] \ + [T_17D2_1788] [T_17D2_1789] [T_17D2_178A] [T_17D2_178B] [T_17D2_178C] [T_17D2_178D] [T_17D2_178E] [T_17D2_178F] \ + [T_17D2_1790] [T_17D2_1791] [T_17D2_1792] [T_17D2_1793] [T_17D2_1794] [T_17D2_1795] [T_17D2_1796] [T_17D2_1797] \ + [T_17D2_1798] [T_17D2_1799] [T_17D2_179A] [T_17D2_179B] [T_17D2_179C] [T_17D2_179D] [T_17D2_179E] [T_17D2_179F] \ + [T_17D2_17A0] [T_17D2_17A1] [T_17D2_17A2] + +store(subcons) \ + U+1780 U+1781 U+1782 U+1783 U+1784 U+1785 U+1786 U+1787 \ + U+1788 U+1789 U+178A U+178B U+178C U+178D U+178E U+178F \ + U+1790 U+1791 U+1792 U+1793 U+1794 U+1795 U+1796 U+1797 \ + U+1798 U+1799 U+179A U+179B U+179C U+179D U+179E U+179F \ + U+17A0 U+17A1 U+17A2 + +c Arabic digits 0 through 9 + +store(arabic_digit_key) [U_0030] [U_0031] [U_0032] [U_0033] [U_0034] [U_0035] [U_0036] [U_0037] [U_0038] [U_0039] +store(arabic_digit_out) U+0030 U+0031 U+0032 U+0033 U+0034 U+0035 U+0036 U+0037 U+0038 U+0039 + +c These stores are for consonant (cluster) and consonant shifter configuration + +store(v_above) U+17B7 U+17B8 U+17B9 U+17BA \ + U+17BE U+17D0 c These vowels are rendered above the base consonant. +store(shiftable_c_1st) U+179F U+17A0 U+17A2 c These consonants shift to the 2nd series when adding U+17CA to them. +store(shiftable_BA) U+1794 c BA is unique because it can be used with both U+17CA (shift to 2nd) and and U+179C (shift to PA, still in 1st series). +store(shiftable_c_2nd) U+1784 U+1789 U+1798 U+1799 \ + U+179A U+179C U+1793 U+179B c These consonants shift to the 1st series when adding U+17C9 to them. +store(shiftable_c_2nd_with_BA) outs(shiftable_c_2nd) outs(shiftable_BA) +store(c_2nd_combo_LO) U+1799 U+1798 U+1784 U+1794 \ + U+179C c These can be combined with U+179B to make a 2nd series consonant cluster. +store(c_2nd_combo_MO) U+1799 U+179B U+1784 U+179A c These can be combined with U+1798 to make a 2nd series consonant cluster. +store(c_1st_combo_LO) U+1794 U+17A0 U+17A2 c they can be combined with U+179B to make a 1st series consonant cluster. +store(c_1st_combo_MO) U+17A0 U+179F U+17A2 c they can be combined with U+1798 to make a 1st series consonant cluster. +store(c_combo_SA) U+1794 U+1799 U+179B U+1798 \ + U+1793 U+1789 U+1784 U+179A \ + U+179C U+17A2 c they can be combined with U+179F to make a 1st series consonant cluster. +store(c_combo_QA) U+1786 U+1788 U+1794 U+1795 \ + U+178F U+1791 c they can be combined with U+17A2 to make a 1st series consonant cluster. +store(c_combo_HA) U+179C U+17A3 c they can be combined with U+17A0 to make a 1st series consonant cluster. + + + +c ==============================================BASIC RULES & CONSTRAINTS/ROTATIONS============================================== + + + +group(main) using keys + +c Basic rules with RALT key + + + any(c_key) > index(c_out,1) + + any(v_key) > index(v_out,1) + + any(ind_v_key) > index(ind_v_out,1) + + any(diacritic_key) > index(diacritic_out,1) + + any(c_shifter_key) > index(c_shifter,1) + + any(punct_key) > index(punct_out,1) + + any(latin_punct_key) > index(latin_punct_out,1) + + any(currency_key) > index(currency_out,1) + + any(digit_key) > index(digit_out,1) + + any(lek_attak_key) > index(lek_attak_out,1) + + any(lunar_date_key) > index(lunar_date_out,1) + + any(spaces_key) > index(spaces_out,1) + +c two-unicode-code-point vowels + ++ [SHIFT K_A] > U+17B6 U+17C6 ++ [SHIFT K_V] > U+17C1 U+17C7 ++ [SHIFT K_COLON] > U+17C4 U+17C7 ++ [K_COMMA] > U+17BB U+17C6 ++ [SHIFT K_COMMA] > U+17BB U+17C7 + +c Constraints + +any(v_gen) + [K_QUOTE] > context beep c no Bantoc after any genuine vowel +any(v_pseudo) + [K_QUOTE] > context beep c no Bantoc after any pseudo vowel +any(c_shifter) + [K_QUOTE] > context beep c no Bantoc after Triisap/Muusikatoan +U+17D2 any(c_out) + [K_QUOTE] > context beep c no Bantoc on a subscript +any(c_shifter) + any(c_shifter_key) > context beep c no two Triisap/Muusikatoan + +c Rotation + +U+17C7 + [SHIFT K_H] > U+17C8 c U+17C7 is changed to U+17C8 when pressing [SHIFT K_H]. +U+17C8 + [SHIFT K_H] > U+17C7 c U+17C8 is changed to U+17C7 when K_H is pressed. +c any(v_gen) U+17C7 + [SHIFT K_H] > context beep c Don't rotate between U+17C7 and U+17C8. + +c Press Space twice to get a White Space + +U+200B + [K_SPACE] > U+0020 + +c One backspace deletes a two-part vowels (i.e. psuedoVowel + U+17C7) + +any(v_combo_N) U+17C6 + [K_BKSP] > nul +any(v_combo_R) U+17C7 + [K_BKSP] > nul + +c When pressing [K_U] after ាំ and ុំ, the U+17BB is converted to a respective consonant shifter placing before them (ាំ and ុំ). + +any(shiftable_c_1st) U+17B6 U+17C6 + [K_U] > context(1) U+17CA context(2) context(3) c fix ស ាំ ុ > ស៊ាំ +any(shiftable_c_2nd_with_BA) U+17B6 U+17C6 + [K_U] > context(1) U+17C9 context(2) context(3) c fix ម ាំ ុ > ម៉ាំ + +c Consonant shifter constraints (beep when the consonant shifter is used in inappropriate environment) + +any(shiftable_c_1st) + [SHIFT K_QUOTE] > context U+17C9 beep +any(shiftable_c_2nd_with_BA) + [K_SLASH] > context U+17CA beep + +c 1st series consonant clusters + +any(c_combo_QA) U+17D2 U+17A2 + [SHIFT K_QUOTE] > context U+17C9 beep +U+179B U+17D2 any(c_1st_combo_LO) + [SHIFT K_QUOTE] > context U+17C9 beep +U+1798 U+17D2 any(c_1st_combo_MO) + [SHIFT K_QUOTE] > context U+17C9 beep +U+179F U+17D2 any(c_combo_SA) + [SHIFT K_QUOTE] > context U+17C9 beep +any(c_combo_HA) U+17D2 U+17A0 + [SHIFT K_QUOTE] > context U+17C9 beep +U+17A2 U+17D2 U+1784 + [SHIFT K_QUOTE] > context U+17C9 beep +U+17A2 U+17D2 U+179C + [SHIFT K_QUOTE] > context U+17C9 beep + +c 2nd series consonant clusters + +U+179B U+17D2 any(c_2nd_combo_LO) + [K_SLASH] > context U+17CA beep +U+1798 U+17D2 any(c_2nd_combo_MO) + [K_SLASH] > context U+17CA beep + + +c ==============================================MOBILE/TABLET TOUCH LAYOUT============================================== + + + ++ any(input_subcons) > U+17D2 index(subcons, 1) + +c delete a subscript (a subscript sign + a consonant) upon a backspace + +platform('touch') U+17D2 any(c_out) + [K_BKSP] > nul c working OK + + + [K_NPSTAR] > U+002A + + [SHIFT K_NPSTAR] > U+002A + + [K_NPPLUS] > U+002B + + [SHIFT K_NPPLUS] > U+002B + + [K_NPMINUS] > U+002D + + [SHIFT K_NPMINUS] > U+002D + + [K_NPDOT] > U+002E + + [SHIFT K_NPDOT] > U+002E + + [K_NPSLASH] > U+002F + + [SHIFT K_NPSLASH] > U+002F + + + +c ==============================================NORMALIZATION============================================== + + + +match > use(normalise) + +group(normalise) + +c Illegitimate vowel combinations should be transformed to the legitimate ones (Case #6 and #7). + +U+17C1 U+17B6 > U+17C4 c when type េ and ា, tranform them to ោ +U+17B6 U+17C1 > U+17C4 c when type ា and េ, tranform them to ោ +U+17C1 U+17B8 > U+17BE c when type េ and ី , tranform them to ើ +U+17B8 U+17C1 > U+17BE c when type ី and េ, tranform them to ើ + +c Illegitimate vowel combinations should be transformed to the legitimate ones (Case #5). + +U+17C6 U+17BB > U+17BB U+17C6 c when type ំ and ុ , tranform them to ុំ +U+17C6 U+17B6 > U+17B6 U+17C6 c when type ំ and ា, tranform them to ាំ + + +c Rotate vowels + +any(v_gen) any(v_gen) > context(2) c the last vowel stroke replaces the previous one. + +c Rotation of two-part vowels + +any(v_gen) any(v_pseudo) any(v_gen) > context(3) c a two-part vowel rotates to a genuine vowel. +any(v_gen) any(v_pseudo) any(v_pseudo) > context(3) c a two-part vowel rotates to a pseudo vowel. +any(v_gen) any(v_gen) any(v_pseudo) > context(2) context(3) c a genuine vowel rotates to a two-part vowel. +any(v_pseudo) any(v_gen) any(v_pseudo) > context(2) context(3) c a pseudo vowel roates to a two-part vowel. +any(v_gen) any(v_pseudo) any(v_gen) any(v_pseudo) > context(3) context(4) c a two-part vowel rotates to another two-part vowel. +any(v_pseudo) any(v_pseudo) > context(2) c a pseudo vowel rotates to another pseudo vowel. +c any(v_pseudo) any(v_gen) > context(2) c a pseudo vowel roates to a genuine vowel. + +c Delete extraneous coeng markers + +U+17D2 U+17D2 > context(1) c no two coengs are allowed. +U+17D2 any(v_any) > context(2) c The coeng is deleted when a vowel is put after it. +U+17D2 any(v_gen) any(v_pseudo) > context(2) context(3) c The coeng is deleted when a pseudo vowel is put after it. + +c Case #1: when a subscript is typed after a vowel, the subscript should be automatically moved to before the vowel. + +any(v_any) U+17D2 any(subcons) > context(2) context(3) context(1) c a vowel has to come after a subscript. +any(v_combo_N) U+17C6 U+17D2 any(subcons) > context(3) context(4) context(1) context(2) c these two-part vowels have to come after a subscript. +any(v_combo_R) U+17C7 U+17D2 any(subcons) > context(3) context(4) context(1) context(2) c these two-part vowels have to come after a subscript. + +c a subscript placed after a shifter and a vowel (a genuine/pseudo vowel or a two-part vowel) has to move to before them. + +any(c_shifter) any(v_any) U+17D2 any(subcons) > context(3) context(4) context(1) context(2) c after a genuine/pseudo vowel +any(c_shifter) any(v_combo_N) U+17C6 U+17D2 any(subcons) > context(4) context(5) context(1) context(2) context(3) c after a two-part vowel +any(c_shifter) any(v_combo_R) U+17C7 U+17D2 any(subcons) > context(4) context(5) context(1) context(2) context(3) c after a two-part vowel + +c Case #2: when [D2+9A] is typed before a subscript, it should be moved to after it. + +U+17D2 U+178A U+17D2 U+179A > context(1) U+178F context(3) context(4) c change subscript ្ដ to ្ត after ្រ +U+17D2 U+179A U+17D2 U+178A > context(3) U+178F context(1) context(2) c ្ដ placed after ្រ has to be changed to ្ត and placed before ្រ + +U+17D2 U+178A any(v_any) U+17D2 U+179A > context(1) U+178F context(4) context(5) context(3) c fixed 6e +U+17D2 U+178A any(v_combo_N) U+17C6 U+17D2 U+179A > context(1) U+178F context(5) context(6) context(3) context(4) +U+17D2 U+178A any(v_combo_R) U+17C7 U+17D2 U+179A > context(1) U+178F context(5) context(6) context(3) context(4) + +U+17D2 U+179A any(v_any) U+17D2 U+178A > context(1) U+178F context(4) context(2) context(3) c fixed 6g +U+17D2 U+179A any(v_combo_N) U+17C6 U+17D2 U+178A > context(1) U+178F context(5) context(2) context(3) context(4) +U+17D2 U+179A any(v_combo_R) U+17C7 U+17D2 U+178A > context(1) U+178F context(5) context(2) context(3) context(4) + +U+17D2 U+179A any(c_shifter) U+17D2 any(subcons) > context(4) context(5) context(1) context(2) context(3) c when a shifter intervenes, move it to the end. +U+17D2 U+179A U+17D2 any(subcons) > context(3) context(4) context(1) context(2) c move any subscript placed after [D2+DA] to before them +U+17D2 U+179A any(v_any) U+17D2 any(subcons) > context(4) context(5) context(1) context(2) context(3) c when a vowel intervenes, move it to the end +U+17D2 U+179A any(v_combo_N) U+17C6 U+17D2 any(subcons) > context(5) context(6) context(1) context(2) context(3) context(4) c when a two-part vowel intervenes, move it to the end too. +U+17D2 U+179A any(v_combo_R) U+17C7 U+17D2 any(subcons) > context(5) context(6) context(1) context(2) context(3) context(4) c (same as stated right above) + +c when a subscript is placed after a consonant shifter, they should be reversed. (Case #3) + +any(c_shifter) U+17D2 any(subcons) > context(2) context(3) context(1) + +c Reordering - Triisap and Muusikatoan store before a vowel and a vowelcomboR and pseudo vowel. + +any(v_any) any(c_shifter) > context(2) context(1) c place either a enguine or pseudo vowel after a consonant shifter +any(v_gen) any(v_pseudo) any(c_shifter) > context(3) context(1) context(2) c place a two-part vowel after a consonant shifter(i.e. មោះ៉ ) +any(c_shifter) any(v_any) any(c_shifter) > context(3) context(2) c when either a genuine or pseudo vowel is in between two consonant shifters, replace the one on the left with the one on the right. +any(c_shifter) any(v_gen) any(v_pseudo) any(c_shifter) > context(2) context(3) context(4) c when a two-part vowel is in between two consonants shifter, replace the one on the left with the one the right. + +c +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +c + when [BB] is place either before or after an above vowel (ិ ី ឹ ឺ ើ and ាំ) and a Samyok Sannya (Case #4) + +c + the [BB] should transform to a respective consonant shifter placed before the vowel. + +c + the consonant shifter is a Trisap if the base consonant is ស ហ អ + +c + the consonant shifter is a Muusikatoan if the base consonant is ង ញ ម យ រ វ ប and ន ល + +c +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +c consonant clusters --1st > 2nd series (with U+17BB) + +any(c_combo_QA) U+17D2 U+17A2 U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +any(c_combo_QA) U+17D2 U+17A2 U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +any(c_combo_QA) U+17D2 U+17A2 any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +any(c_combo_QA) U+17D2 U+17A2 U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+179B U+17D2 any(c_1st_combo_LO) U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+179B U+17D2 any(c_1st_combo_LO) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+179B U+17D2 any(c_1st_combo_LO) any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +U+179B U+17D2 any(c_1st_combo_LO) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+1798 U+17D2 any(c_1st_combo_MO) U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+1798 U+17D2 any(c_1st_combo_MO) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+1798 U+17D2 any(c_1st_combo_MO) any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +U+1798 U+17D2 any(c_1st_combo_MO) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+179F U+17D2 U+1794 U+17BB any(v_above) > context(1) context(2) context(3) U+17C9 context(5) c prevent ស្បុិ from transforming to ស្ប៊ិ​​​, but produce ស្ប៉ិ instead because ប never have Triisap shifted down. +U+179F U+17D2 U+1794 U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(5) context(6) +U+179F U+17D2 U+1794 any(v_above) U+17BB > context(1) context(2) context(3) U+17C9 context(4) +U+179F U+17D2 U+1794 U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(6) context(7) + +U+179F U+17D2 any(c_combo_SA) U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+179F U+17D2 any(c_combo_SA) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+179F U+17D2 any(c_combo_SA) any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +U+179F U+17D2 any(c_combo_SA) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +any(c_combo_HA) U+17D2 U+17A0 U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +any(c_combo_HA) U+17D2 U+17A0 U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +any(c_combo_HA) U+17D2 U+17A0 any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +any(c_combo_HA) U+17D2 U+17A0 U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+17A2 U+17D2 U+1784 U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+17A2 U+17D2 U+1784 U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+17A2 U+17D2 U+1784 any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +U+17A2 U+17D2 U+1784 U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+17A2 U+17D2 U+179C U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+17A2 U+17D2 U+179C U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+17A2 U+17D2 U+179C any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) +U+17A2 U+17D2 U+179C U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) + +U+17A0 U+17D2 U+1794 U+17BB any(v_above) > context(1) context(2) context(3) U+17C9 context(5) c change U+17BB preceded by HA and coeng BA to U+17C9 before the above vowel +U+17A0 U+17D2 U+1794 U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(3) context(6) c change U+17BB preceded by HA and coeng BA to U+17C9 before ាំ +U+17A0 U+17D2 U+1794 any(v_above) U+17BB > context(1) context(2) context(3) U+17C9 context(4) c change U+17BB preceded by HA and coeng BA to U+17C9 before the above vowel +U+17A0 U+17D2 U+1794 U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(6) context(7) c change U+17BB preceded by HA and coeng BA to U+17C9 before U+17B6 U+17C6 + + +U+17A0 U+17D2 any(shiftable_c_2nd_with_BA) U+17BB any(v_above) > context(1) context(2) context(3) U+17CA context(5) c change U+17BB preceded by HA and coeng shiftable_c_2nd to U+17CA before the above vowel +U+17A0 U+17D2 any(shiftable_c_2nd_with_BA) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(3) context(6) c change U+17BB preceded by HA and coeng shiftable_c_2nd to U+17CA before ាំ +U+17A0 U+17D2 any(shiftable_c_2nd_with_BA) any(v_above) U+17BB > context(1) context(2) context(3) U+17CA context(4) c change U+17BB preceded by HA and coeng shiftable_c_2nd to U+17CA before the above vowel +U+17A0 U+17D2 any(shiftable_c_2nd_with_BA) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(6) context(7) c change U+17BB preceded by HA and coeng shiftable_c_2nd to U+17CA before U+17B6 U+17C6 + +c consonant clusters --2nd > 1st series (with U+17BB) + +U+179B U+17D2 any(c_2nd_combo_LO) U+17BB any(v_above) > context(1) context(2) context(3) U+17C9 context(5) +U+179B U+17D2 any(c_2nd_combo_LO) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(5) context(6) +U+179B U+17D2 any(c_2nd_combo_LO) any(v_above) U+17BB > context(1) context(2) context(3) U+17C9 context(4) +U+179B U+17D2 any(c_2nd_combo_LO) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(6) context(7) + +U+1798 U+17D2 any(c_2nd_combo_MO) U+17BB any(v_above) > context(1) context(2) context(3) U+17C9 context(5) +U+1798 U+17D2 any(c_2nd_combo_MO) U+17BB U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(5) context(6) +U+1798 U+17D2 any(c_2nd_combo_MO) any(v_above) U+17BB > context(1) context(2) context(3) U+17C9 context(4) +U+1798 U+17D2 any(c_2nd_combo_MO) U+17BB U+17C6 U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(6) context(7) + +c single consonants --1st > 2nd series (with U+17BB) + +any(shiftable_c_1st) U+17BB any(v_above) > context(1) U+17CA context(3) c change U+17BB to U+17CA before the above vowel +any(shiftable_c_1st) U+17BB U+17B6 U+17C6 > context(1) U+17CA context(3) context(4) c change U+17BB to U+17CA before ាំ +any(shiftable_c_1st) any(v_above) U+17BB > context(1) U+17CA context(2) c change U+17BB to U+17CA and place it before the above vowel +any(shiftable_c_1st) U+17BB U+17C6 U+17B6 U+17C6 > context(1) U+17CA context(4) context(5) c change U+17BB U+17C6 to U+17CA + +c single consonants --2nd > 1st series (with U+17BB) + +any(shiftable_c_2nd_with_BA) U+17BB any(v_above) > context(1) U+17C9 context(3) c change U+17BB to U+17C9 before the above vowel +any(shiftable_c_2nd_with_BA) U+17BB U+17B6 U+17C6 > context(1) U+17C9 context(3) context(4) c change U+17BB to U+17C9 before ាំ +any(shiftable_c_2nd_with_BA) any(v_above) U+17BB > context(1) U+17C9 context(2) c change U+17BB to U+17C9 before the above vowel +any(shiftable_c_2nd_with_BA) U+17BB U+17C6 U+17B6 U+17C6 > context(1) U+17C9 context(4) context(5) c change U+17BB U+17C6 to U+17C9 + +c prevent incorrect use of consonant shifter with 2nd series consonant clusters (without U+17BB) + +U+179B U+17D2 any(c_2nd_combo_LO) U+17CA any(v_above) > context(1) context(2) context(3) U+17C9 context(5) +U+1798 U+17D2 any(c_2nd_combo_MO) U+17CA any(v_above) > context(1) context(2) context(3) U+17C9 context(5) +U+179B U+17D2 any(c_2nd_combo_LO) U+17CA any(v_gen) any(v_pseudo) > context(1) context(2) context(3) U+17C9 context(5) context(6) +U+1798 U+17D2 any(c_2nd_combo_MO) U+17CA any(v_gen) any(v_pseudo) > context(1) context(2) context(3) U+17C9 context(5) context(6) + +c single consonants --2nd > 1st series (without U+17BB) + +any(shiftable_c_2nd) U+17CA any(v_above) > context(1) U+17C9 context(3) c change U+17CA to U+17C9 before the above vowel +any(shiftable_c_2nd) U+17CA any(v_gen) any(v_pseudo) > context(1) U+17C9 context(3) context(4) c change U+17CA to U+17C9 before ាំ + +U+17D2 any(shiftable_c_2nd) U+17CA any(v_above) > context c stop ស្រ៊ី from becoming ស្រ៉ី +U+17D2 any(shiftable_c_2nd) U+17CA any(v_gen) any(v_pseudo) > context + +c SPECIAL CASE -- the following clusters may accept either of the two consonant shifters. + +U+1794 U+17D2 U+1799 any(c_shifter) > context +U+179F U+17D2 U+1794 any(c_shifter) > context +U+1786 U+17D2 U+1794 any(c_shifter) > context +U+1794 U+17D2 U+1799 any(c_shifter) > context +U+179F U+17D2 U+1794 any(c_shifter) > context +U+1786 U+17D2 U+1794 any(c_shifter) > context + +c single --1st > 2nd series (without U+17BB) + +any(shiftable_c_1st) U+17C9 any(v_above) > context(1) U+17CA context(3) c change U+17C9 to U+17CA before the above vowel +any(shiftable_c_1st) U+17C9 any(v_gen) any(v_pseudo) > context(1) U+17CA context(3) context(4) c change U+17C9 to U+17CA before ាំ + +c consonant clusters --1st > 2nd series (without U+17BB) + +any(c_combo_QA) U+17D2 U+17A2 U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+179B U+17D2 any(c_1st_combo_LO) U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+1798 U+17D2 any(c_1st_combo_MO) U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+179F U+17D2 U+1794 U+17C9 any(v_above) > context(1) context(2) context(3) U+17C9 context(5) c prevent ស្ប៉ី from transforming to ស្ប៊ី +U+179F U+17D2 any(c_combo_SA) U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +any(c_combo_HA) U+17D2 U+17A0 U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+17A2 U+17D2 U+1784 U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +U+17A2 U+17D2 U+179C U+17C9 any(v_above) > context(1) context(2) context(3) U+17CA context(5) +any(c_combo_QA) U+17D2 U+17A2 U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+179B U+17D2 any(c_1st_combo_LO) U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+1798 U+17D2 any(c_1st_combo_MO) U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+179F U+17D2 U+1794 U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17C9 context(5) context(6) c prevent ស្ប៉ាំ from transforming to ស្ប៊ាំ +U+179F U+17D2 any(c_combo_SA) U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +any(c_combo_HA) U+17D2 U+17A0 U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+17A2 U+17D2 U+1784 U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) +U+17A2 U+17D2 U+179C U+17C9 U+17B6 U+17C6 > context(1) context(2) context(3) U+17CA context(5) context(6) + +c U+17B6 U+17BB and U+17C6 in that order preceeded by any first series consonant (cluster) are transformed to U+17CA U+17B6 and U+17C6 + +any(shiftable_c_1st) U+17B6 U+17BB U+17C6 > context(1) U+17CA context(2) context(4) +any(shiftable_c_1st) U+17BB U+17C6 U+17B6 > context(1) U+17CA context(4) context(3) + +any(c_combo_QA) U+17D2 U+17A2 U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +any(c_combo_QA) U+17D2 U+17A2 U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +U+179B U+17D2 any(c_1st_combo_LO) U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +U+179B U+17D2 any(c_1st_combo_LO) U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +U+1798 U+17D2 any(c_1st_combo_MO) U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +U+1798 U+17D2 any(c_1st_combo_MO) U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +U+179F U+17D2 any(c_combo_SA) U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +U+179F U+17D2 any(c_combo_SA) U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +any(c_combo_HA) U+17D2 U+17A0 U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +any(c_combo_HA) U+17D2 U+17A0 U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +U+17A2 U+17D2 U+1784 U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +U+17A2 U+17D2 U+1784 U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(6) context(5) + +U+17A2 U+17D2 U+179C U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17CA context(4) context(6) +U+17A2 U+17D2 U+179C U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17CA context(4) context(6) + +c U+17B6 U+17BB and U+17C6 in that order preceeded by any second series consonant (cluster) are transformed to U+17C9 U+17B6 and U+17C6 + +any(shiftable_c_2nd_with_BA) U+17B6 U+17BB U+17C6 > context(1) U+17C9 context(2) context(4) +any(shiftable_c_2nd_with_BA) U+17BB U+17C6 U+17B6 > context(1) U+17C9 context(4) context(3) + +U+179B U+17D2 any(c_2nd_combo_LO) U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17C9 context(4) context(6) +U+179B U+17D2 any(c_2nd_combo_LO) U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17C9 context(6) context(5) + +U+1798 U+17D2 any(c_2nd_combo_MO) U+17B6 U+17BB U+17C6 > context(1) context(2) context(3) U+17C9 context(4) context(6) +U+1798 U+17D2 any(c_2nd_combo_MO) U+17BB U+17C6 U+17B6 > context(1) context(2) context(3) U+17C9 context(6) context(5) + +c េុី/ុេី/៉េី > ៊ើ + +any(shiftable_c_1st) U+17C1 U+17BB U+17B8 > context(1) U+17CA U+17BE c cancel out by vowel rotation +any(shiftable_c_1st) U+17BB U+17C1 U+17B8 > context(1) U+17CA U+17BE c cancel out by vowel rotation +any(shiftable_c_1st) U+17C9 U+17C1 U+17B8 > context(1) U+17CA U+17BE + +any(c_combo_QA) U+17D2 U+17A2 U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +any(c_combo_QA) U+17D2 U+17A2 U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +any(c_combo_QA) U+17D2 U+17A2 U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +U+179B U+17D2 any(c_1st_combo_LO) U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+179B U+17D2 any(c_1st_combo_LO) U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+179B U+17D2 any(c_1st_combo_LO) U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +U+1798 U+17D2 any(c_1st_combo_MO) U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+1798 U+17D2 any(c_1st_combo_MO) U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+1798 U+17D2 any(c_1st_combo_MO) U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +U+179F U+17D2 any(c_combo_SA) U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+179F U+17D2 any(c_combo_SA) U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+179F U+17D2 any(c_combo_SA) U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +any(c_combo_HA) U+17D2 U+17A0 U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +any(c_combo_HA) U+17D2 U+17A0 U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +any(c_combo_HA) U+17D2 U+17A0 U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +U+17A2 U+17D2 U+1784 U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+17A2 U+17D2 U+1784 U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+17A2 U+17D2 U+1784 U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +U+17A2 U+17D2 U+179C U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+17A2 U+17D2 U+179C U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE c cancel out by vowel rotation +U+17A2 U+17D2 U+179C U+17C9 U+17C1 U+17B8 > context(1) context(2) context(3) U+17CA U+17BE + +c េុី/ុេី/៊េី > ៉ើ + +any(shiftable_c_2nd) U+17C1 U+17BB U+17B8 > context(1) U+17C9 U+17BE c cancel out by vowel rotation +any(shiftable_c_2nd) U+17BB U+17C1 U+17B8 > context(1) U+17C9 U+17BE c cancel out by vowel rotation +any(shiftable_c_2nd) U+17CA U+17C1 U+17B8 > context(1) U+17C9 U+17BE + +U+179B U+17D2 any(c_2nd_combo_LO) U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE c cancel out by vowel rotation +U+179B U+17D2 any(c_2nd_combo_LO) U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE c cancel out by vowel rotation +U+179B U+17D2 any(c_2nd_combo_LO) U+17CA U+17C1 U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE + +U+1798 U+17D2 any(c_2nd_combo_MO) U+17C1 U+17BB U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE c cancel out by vowel rotation +U+1798 U+17D2 any(c_2nd_combo_MO) U+17BB U+17C1 U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE c cancel out by vowel rotation +U+1798 U+17D2 any(c_2nd_combo_MO) U+17CA U+17C1 U+17B8 > context(1) context(2) context(3) U+17C9 U+17BE + +c place Robat after a base before any vowel + +any(c_out) any(v_gen) U+17CC > context(1) context(3) context(2) + +c Use appropriate identical subscript in two separate contexts. (Case #8) + +U+178E U+17D2 U+178F > context(1) context(2) U+178A +U+1793 U+17D2 U+178A > context(1) context(2) U+178F + +c BONUSES​(note that these combinations are invalid and they can't be found in the CN dictionary 1967 nor RH 1997, but users think they are) + +U+1791 U+17D2 U+1794 > U+17A1 c ទ្ប transforms to ឡ + +U+1794 U+17D2 U+1789 > U+17AB c ប្ញ transforms to ឫ +U+17AB U+17BB > U+17AC c ឫុ transforms to ឬ + +U+17AD U+17B6 > U+1789 c ឭា transforms to ញ +U+17AE U+17B6 > U+1789 c ឮា transforms to ញ + +U+1796 U+17D2 U+1789 > U+17AD c ព្ញ transforms to ឭ +U+17AD U+17BB > U+17AE c ឭុ transforms to ឮ + +U+1796 U+17D2 U+178B > U+17B0 c ព្ឋ transforms to ឰ + +U+17A7 U+17B7 > U+17B1 c ឧិ transforms to ឱ +U+17A7 U+17CC > U+17B1 c ឧ៌ transforms to ឱ +U+17A7 U+17CD > U+17B1 c ឧ៍ transforms to ឱ + +c U+17D4 U+179B U+17D4 > U+17D8 c ។ល។ transforms to U+17D8 + +U+178A U+17D2 U+1792 > U+178A U+17D2 U+178B c ដ្ធ > ដ្ឋ +U+1791 U+17D2 U+178B > U+1791 U+17D2 U+1792 c ទ្ឋ > ទ្ធ + +c additional rules + +U+1796 U+1793 U+17D2 U+178B > context(1) context(2) context(3) U+1792 c ពន្ឋ > ពន្ធ +U+1796 U+17D0 U+1793 U+17D2 U+178B > context(1) context(2) context(3) context(4) U+1792 c ព័ន្ឋ > ព័ន្ធ + + +U+17AA U+17D2 U+1799 > U+17B1 context(2) context(3) c ឪ្យ > ឱ្យ +U+17B3 U+17D2 U+1799 > U+17B1 context(2) context(3) c ឳ្យ > ឱ្យ + +U+1789 U+17D2 U+179C > U+1796 context(2) context(3) U+17B6 c ញ្វ (as in សញ្វវុធ) > ព្វា as in សញ្វវុធ + +U+17D2 U+1799 U+17C1 U+17BA > U+17BF c េ្យឺ > ឿ +U+17D2 U+1799 U+17C1 U+17B9 > U+17BF c េ្យឹ > ឿ +U+17D2 U+1799 U+17C1 U+17B8 > U+17BF c េ្យី > ឿ + +U+17D2 U+1799 U+17D2 any(c_out) U+17C1 U+17BA > context(3) context(4) U+17BF c គ្រេ្យឺង > គ្រឿង +U+17D2 U+1799 U+17D2 any(c_out) U+17C1 U+17B9 > context(3) context(4) U+17BF c គ្រេ្យឹង > គ្រឿង +U+17D2 U+1799 U+17D2 any(c_out) U+17C1 U+17B8 > context(3) context(4) U+17BF c គ្រេ្យីង > គ្រឿង + +c In everyday practice, both 'regular space' and 'no-break space' are not used before punctuation, i.e. ។ ! etc. +c An annoying issue of having line broken up at the end of the line dropping the punctuation (។, ! and also ៗ) to the next line. +c It may be helpful to include a rule where a 'Zero Width No-Break Space' should be output together with those punct. +c ref: https://www.unicode.org/L2/L2020/20008-core-text.pdf +c ref: https://www.unicode.org/versions/Unicode12.0.0/ch23.pdf#G12985 +c ref: https://www.compart.com/en/unicode/U+FEFF + +c EOF diff --git a/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.kps b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.kps new file mode 100644 index 0000000000000000000000000000000000000000..a6b5ca26ce810dc9e815591fb03bafedf872aa6a --- /dev/null +++ b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.kps @@ -0,0 +1,57 @@ + + + + 15.0.266.0 + 7.0 + + + + readme.htm + splash.gif + + + + + + + + + + Khmer Angkor + © 2015-2022 SIL International + Makara Sok + + https://keyman.com/keyboards/khmer_angkor + + + + ..\build\khmer_angkor.js + File khmer_angkor.js + 0 + .js + + + ..\build\khmer_angkor.kvk + File khmer_angkor.kvk + 0 + .kvk + + + ..\build\khmer_angkor.kmx + Keyboard Khmer Angkor + 0 + .kmx + + + + + Khmer Angkor + khmer_angkor + 1.3 + + Central Khmer (Khmer, Cambodia) + + + + + diff --git a/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.kvks b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.kvks new file mode 100644 index 0000000000000000000000000000000000000000..e9c38a464ddd8d6d2c1732ebe06557abe083a5b8 --- /dev/null +++ b/developer/src/kmc/test/fixtures/kpj-2.0/khmer_angkor/source/khmer_angkor.kvks @@ -0,0 +1,206 @@ + + +
+ 10.0 + khmer_angkor + + + +
+ + + ឞ + ឝ + ៈ + ឳ + ឨ + ឩ + ឰ + ឫ + ឦ + ឱ + ឯ + + + ៜ + + ៖ + ៙ + ៚ + + ៘ + ‌ + ‍ + ] + [ + / + . + ‘ + + + & + ’ + * + @ + \ + } + { + - + ÷ + : + , + ≈ + ; + < + # + > + × + $ + € +   + + + ៸ + ៰ + ៱ + ៲ + ៳ + ៴ + ៵ + ៶ + ៷ + ៹ + ᧿ + ᧾ + ᧪ + ᧫ + ᧶ + ᧵ + ᧬ + ᧷ + ᧥ + ᧸ + ᧡ + ᧻ + ᧹ + ᧮ + ᧢ + ᧯ + ᧰ + ᧦ + ᧱ + ᧤ + ᧭ + ᧣ + ᧧ + ᧠ + ᧺ + ᧲ + ᧳ + ᧴ + ᧩ + ᧨ + ᧼ + ᧽ + + + ​ + + + ឥ + ។ + + ០ + ១ + ២ + ៣ + ៤ + ៥ + ៦ + ៧ + ៨ + ៩ + + ឲ + + ឮ + ឪ + « + + ប + ច + ដ + + ថ + ង + ហ + + + ក + ល + ម + ន + + ផ + ឆ + រ + ស + ត + + វ + + ខ + យ + ឋ + + + + ! + + " + ៛ + % + + ( + ) + + = + + ៕ + ? + ៗ + + ព + ជ + ឌ + + ធ + អ + ះ + + ញ + គ + ឡ + + ណ + + ភ + ឈ + ឬ + + ទ + + + + ឃ + + ឍ + + + + ឭ + ឧ + » + + + +
diff --git a/developer/src/kmc/test/fixtures/relative_paths/k_000___null_keyboard.kmn b/developer/src/kmc/test/fixtures/relative_paths/k_000___null_keyboard.kmn new file mode 100644 index 0000000000000000000000000000000000000000..b1304c20c8c89d7423199e27582b212fccdeb51d --- /dev/null +++ b/developer/src/kmc/test/fixtures/relative_paths/k_000___null_keyboard.kmn @@ -0,0 +1,11 @@ +store(&NAME) '000 - null keyboard' +c Description: Tests null keyboard +c keys: [K_A][RALT K_B][SHIFT K_C] +c expected: aC +c context: + +store(&version) '6.0' + +begin Unicode > use(Main) + +group(Main) using keys diff --git a/developer/src/kmc/test/fixtures/relative_paths/k_000___null_keyboard.kpj b/developer/src/kmc/test/fixtures/relative_paths/k_000___null_keyboard.kpj new file mode 100644 index 0000000000000000000000000000000000000000..0fd69d214c09db24a953a4d89467310747a9bbd2 --- /dev/null +++ b/developer/src/kmc/test/fixtures/relative_paths/k_000___null_keyboard.kpj @@ -0,0 +1,34 @@ + + + + $PROJECTPATH + False + False + False + keyboard + + + + id_k_000___null_keyboard_1 + k_000___null_keyboard.kmn + k_000___null_keyboard.kmn + 1.0 + .kmn +
+ k_000___null_keyboard + Copyright (C) Keyman Team +
+
+ + id_k_000___null_keyboard_2 + k_000___null_keyboard.kps + k_000___null_keyboard.kps + + .kps +
+ k_000___null_keyboard + Copyright (C) Keyman Team +
+
+
+
diff --git a/developer/src/kmc/test/fixtures/relative_paths/k_000___null_keyboard.kps b/developer/src/kmc/test/fixtures/relative_paths/k_000___null_keyboard.kps new file mode 100644 index 0000000000000000000000000000000000000000..af65dd9269b0c054be8ca465e3e7058c2d581dec --- /dev/null +++ b/developer/src/kmc/test/fixtures/relative_paths/k_000___null_keyboard.kps @@ -0,0 +1,42 @@ + + + + 15.0 + 7.0 + + + + + + + + + + + + + k_000___null_keyboard + Copyright (C) Keyman Team + Keyman Team + 0.0 + + + + k_000___null_keyboard.kmx + + 0 + .kmx + + + + + k_000___null_keyboard + k_000___null_keyboard + 1.0 + + English + + + + + diff --git a/developer/src/kmc/test/helpers/index.ts b/developer/src/kmc/test/helpers/index.ts new file mode 100644 index 0000000000000000000000000000000000000000..8250dfd101a0a07fd2966cf3e5537ac3386a92f5 --- /dev/null +++ b/developer/src/kmc/test/helpers/index.ts @@ -0,0 +1,17 @@ +/** + * Helpers and utilities for the Mocha tests. + */ +import * as path from 'path'; +import { fileURLToPath } from 'url'; + +/** + * Builds a path to the fixture with the given path components. + * + * e.g., makePathToFixture('example.qaa.trivial') + * e.g., makePathToFixture('example.qaa.trivial', 'model.ts') + * + * @param components One or more path components. + */ + export function makePathToFixture(...components: string[]): string { + return fileURLToPath(new URL(path.join('..', '..', '..', 'test', 'fixtures', ...components), import.meta.url)); +} diff --git a/developer/src/kmc/test/test-messages.ts b/developer/src/kmc/test/test-messages.ts new file mode 100644 index 0000000000000000000000000000000000000000..7b591ad72de7a2e3dec348e55f52155c77030cbb --- /dev/null +++ b/developer/src/kmc/test/test-messages.ts @@ -0,0 +1,9 @@ +import 'mocha'; +import { InfrastructureMessages } from '../src/messages/messages.js'; +import { verifyCompilerMessagesObject } from '@keymanapp/developer-test-helpers'; + +describe('InfrastructureMessages', function () { + it('should have a valid InfrastructureMessages object', function() { + return verifyCompilerMessagesObject(InfrastructureMessages); + }); +}); diff --git a/developer/src/kmc/test/test-project-build.ts b/developer/src/kmc/test/test-project-build.ts new file mode 100644 index 0000000000000000000000000000000000000000..68b5926933fd2f23772a7cbd5624b8661ad35df7 --- /dev/null +++ b/developer/src/kmc/test/test-project-build.ts @@ -0,0 +1,24 @@ +import { TestCompilerCallbacks } from '@keymanapp/developer-test-helpers'; +import { assert } from 'chai'; +import 'mocha'; +import { BuildProject } from '../src/commands/build/BuildProject.js'; +import { makePathToFixture } from './helpers/index.js'; + +const callbacks = new TestCompilerCallbacks(); + +describe('BuildProject', function () { + it('should build a keyboard project', async function() { + const builder = new BuildProject(); + const path = makePathToFixture('relative_paths', 'k_000___null_keyboard.kpj'); + let result = await builder.build(path, callbacks, { + compilerVersion: false, + compilerWarningsAsErrors: true, + debug: false, + warnDeprecatedCode: true, + }); + // 5 messages == starting build, info: no keyboard version, build successful x 2 + // callbacks.printMessages(); + assert.equal(callbacks.messages.length, 5); + assert.isTrue(result); + }); +}); diff --git a/developer/src/kmc/test/tsconfig.json b/developer/src/kmc/test/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..ac8680daf74315e98188cdc229fcd64510eabed8 --- /dev/null +++ b/developer/src/kmc/test/tsconfig.json @@ -0,0 +1,23 @@ +{ + "extends": "../tsconfig.kmc-base.json", + + "compilerOptions": { + "rootDir": ".", + "rootDirs": ["./", "../src/"], + "outDir": "../build/test", + "baseUrl": ".", + "paths": { + "@keymanapp/common-types": ["../../../../common/web/types/src/main"], + "@keymanapp/developer-test-helpers": ["../../common/web/test-helpers/index"], + }, + }, + "include": [ + "**/test-*.ts", + "./helpers/index.ts", + ], + "references": [ + { "path": "../../../../common/web/types/" }, + { "path": "../../common/web/test-helpers/" }, + { "path": "../" } + ] +} \ No newline at end of file diff --git a/developer/src/kmc/tsconfig.json b/developer/src/kmc/tsconfig.json new file mode 100644 index 0000000000000000000000000000000000000000..9b6eb601acd121a775c5d7943a0c7477bb9e9fda --- /dev/null +++ b/developer/src/kmc/tsconfig.json @@ -0,0 +1,29 @@ +{ + "extends": "./tsconfig.kmc-base.json", + + "compilerOptions": { + "outDir": "build/src/", + "rootDir": "src/", + "baseUrl": ".", + "paths": { + "@keymanapp/common-types": [ "../../../common/web/types/src/main" ], + "@keymanapp/kmc-kmn": [ "../kmc-kmn/src/main" ], + "@keymanapp/kmc-ldml": [ "../kmc-ldml/src/main" ], + "@keymanapp/kmc-model": [ "../kmc-model/src/main" ], + "@keymanapp/kmc-model-info": [ "../kmc-model-info/src/model-info-compiler" ], + "@keymanapp/kmc-package": [ "../kmc-package/src/kmp-compiler" ], + } + }, + "include": [ + "src/**/*.ts" + ], + "references": [ + { "path": "../../../common/web/keyman-version/tsconfig.esm.json" }, + { "path": "../../../common/web/types" }, + { "path": "../kmc-kmn" }, + { "path": "../kmc-ldml" }, + { "path": "../kmc-model" }, + { "path": "../kmc-model-info" }, + { "path": "../kmc-package" }, + ] +} diff --git a/developer/src/kmc/tsconfig.kmc-base.json b/developer/src/kmc/tsconfig.kmc-base.json new file mode 100644 index 0000000000000000000000000000000000000000..f8cff50b3fa0cec3f72e89ce81afb17d398e69ee --- /dev/null +++ b/developer/src/kmc/tsconfig.kmc-base.json @@ -0,0 +1,3 @@ +{ + "extends": "../../../tsconfig.esm-base.json", +} diff --git a/developer/src/kmcmpdll/CasedKeys.cpp b/developer/src/kmcmpdll/CasedKeys.cpp index 004b2c5ef74c23aed217a708a6bcf91d99421b79..3118f1be15026978ca736a6fb23d4f4779d1bf7a 100644 --- a/developer/src/kmcmpdll/CasedKeys.cpp +++ b/developer/src/kmcmpdll/CasedKeys.cpp @@ -2,7 +2,7 @@ #include "pch.h" #include -#include +#include #include "../../../common/windows/cpp/include/vkeys.h" #include diff --git a/developer/src/kmcmpdll/CheckFilenameConsistency.cpp b/developer/src/kmcmpdll/CheckFilenameConsistency.cpp index c40302708b705b66de8462880be7399f3c27b9b6..1d553839f49ff830692ee8568f0c6375eda05548 100644 --- a/developer/src/kmcmpdll/CheckFilenameConsistency.cpp +++ b/developer/src/kmcmpdll/CheckFilenameConsistency.cpp @@ -2,7 +2,7 @@ #include "pch.h" #include -#include +#include #include #include #include diff --git a/developer/src/kmcmpdll/CheckForDuplicates.cpp b/developer/src/kmcmpdll/CheckForDuplicates.cpp index 599c3400735e5c8f4d22dda89903a145647e7f3d..d22bfa80e6fd7445dc00398a0652032978c3fcb8 100644 --- a/developer/src/kmcmpdll/CheckForDuplicates.cpp +++ b/developer/src/kmcmpdll/CheckForDuplicates.cpp @@ -2,7 +2,7 @@ #include "pch.h" #include -#include +#include #include #include "CheckForDuplicates.h" diff --git a/developer/src/kmcmpdll/CheckNCapsConsistency.cpp b/developer/src/kmcmpdll/CheckNCapsConsistency.cpp index 3d6d14315aef4ef2e1ee0821a3593ada607e338f..4c9e6853f99b50389cbd18d8e9be6aa6d8679811 100644 --- a/developer/src/kmcmpdll/CheckNCapsConsistency.cpp +++ b/developer/src/kmcmpdll/CheckNCapsConsistency.cpp @@ -2,7 +2,7 @@ #include "pch.h" #include -#include +#include #include #include "CharToKeyConversion.h" diff --git a/developer/src/kmcmpdll/Compiler.cpp b/developer/src/kmcmpdll/Compiler.cpp index a40ed7dcdc3f97cad941067e5abab8194c7dc956..8cc28d2ab7f18bfdc5e6e65dd78b99bf1fe8afe4 100644 --- a/developer/src/kmcmpdll/Compiler.cpp +++ b/developer/src/kmcmpdll/Compiler.cpp @@ -67,7 +67,7 @@ #include "pch.h" #include -#include +#include #include "../../../common/windows/cpp/include/vkeys.h" #include #include @@ -90,6 +90,8 @@ #include "UnreachableRules.h" #include "CheckForDuplicates.h" +#include "../kmcmplib/include/kmcmplibapi.h" + int xatoi(PWSTR *p); int atoiW(PWSTR p); void safe_wcsncpy(PWSTR out, PWSTR in, int cbMax); @@ -214,6 +216,7 @@ BOOL FSaveDebug, FCompilerWarningsAsErrors, FWarnDeprecatedCode; // I4865 // BOOL FShouldAddCompilerVersion = TRUE; BOOL FOldCharPosMatching = FALSE, FMnemonicLayout = FALSE; NamedCodeConstants *CodeConstants = NULL; + int BeginLine[4]; /* Compile target */ @@ -288,21 +291,33 @@ BOOL AddCompileMessage(DWORD msg) return FALSE; } -typedef struct _COMPILER_OPTIONS { - DWORD dwSize; - BOOL ShouldAddCompilerVersion; -} COMPILER_OPTIONS; - -typedef COMPILER_OPTIONS *PCOMPILER_OPTIONS; +bool flag_use_new_kmcomp = true; // flag to switch to new kmcompx extern "C" BOOL __declspec(dllexport) SetCompilerOptions(PCOMPILER_OPTIONS options) { if(!options || options->dwSize < sizeof(COMPILER_OPTIONS)) { return FALSE; } + + flag_use_new_kmcomp = options->UseKmcmpLib; + + //printf("\n---> started in SetCompilerOptions() of kmcmpdll\n"); + if ( flag_use_new_kmcomp ) + { + KMCMP_COMPILER_OPTIONS kmcmp_options = {0}; + kmcmp_options.dwSize = sizeof(KMCMP_COMPILER_OPTIONS); + kmcmp_options.ShouldAddCompilerVersion = options->ShouldAddCompilerVersion; + return kmcmp_SetCompilerOptions(&kmcmp_options); + } + //printf("---> stayed in SetCompilerOptions() of kmcmpdll\n"); + FShouldAddCompilerVersion = options->ShouldAddCompilerVersion; return TRUE; } +int kmcmpMsgproc(int line, uint32_t dwMsgCode, char* szText, void* context) { + return static_cast(context)(line, dwMsgCode, szText); +} + extern "C" BOOL __declspec(dllexport) CompileKeyboardFile(PSTR pszInfile, PSTR pszOutfile, BOOL ASaveDebug, BOOL ACompilerWarningsAsErrors, BOOL AWarnDeprecatedCode, CompilerMessageProc pMsgProc) // I4865 // I4866 { HANDLE hInfile = INVALID_HANDLE_VALUE, hOutfile = INVALID_HANDLE_VALUE; @@ -310,6 +325,15 @@ extern "C" BOOL __declspec(dllexport) CompileKeyboardFile(PSTR pszInfile, PSTR p DWORD len; char str[260]; + //printf("\n---> started in CompileKeyboardFile() of kmcmpdll\n"); + + if ( flag_use_new_kmcomp ) + { + return kmcmp_CompileKeyboardFile(pszInfile, pszOutfile, ASaveDebug, ACompilerWarningsAsErrors,AWarnDeprecatedCode, kmcmpMsgproc, (void*) pMsgProc); + } + + //printf("---> stayed in CompileKeyboardFile() of kmcmpdll\n"); + FSaveDebug = ASaveDebug; FCompilerWarningsAsErrors = ACompilerWarningsAsErrors; // I4865 FWarnDeprecatedCode = AWarnDeprecatedCode; // I4866 @@ -331,6 +355,8 @@ extern "C" BOOL __declspec(dllexport) CompileKeyboardFile(PSTR pszInfile, PSTR p currentLine = 0; nErrors = 0; + AddCompileString("NOTE: Using legacy compiler"); + hInfile = CreateFileA(pszInfile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if (hInfile == INVALID_HANDLE_VALUE) SetError(CERR_InfileNotExist); @@ -392,6 +418,15 @@ extern "C" BOOL __declspec(dllexport) CompileKeyboardFileToBuffer(PSTR pszInfile DWORD len; char str[260]; + //printf("\n---> started in CompileKeyboardFileToBuffer() of kmcmpdll\n"); + if ( flag_use_new_kmcomp ) + { + return kmcmp_CompileKeyboardFileToBuffer( pszInfile, (void*) pfkBuffer, ACompilerWarningsAsErrors, AWarnDeprecatedCode, kmcmpMsgproc, (void*) pMsgProc, Target); + } + + //printf("---> stayed in CompileKeyboardFileToBuffer() of kmcmpdll\n"); + + FSaveDebug = TRUE; // I3681 FCompilerWarningsAsErrors = ACompilerWarningsAsErrors; // I4865 FWarnDeprecatedCode = AWarnDeprecatedCode; // I4866 @@ -413,6 +448,8 @@ extern "C" BOOL __declspec(dllexport) CompileKeyboardFileToBuffer(PSTR pszInfile currentLine = 0; nErrors = 0; + AddCompileString("NOTE: Using legacy compiler"); + hInfile = CreateFileA(pszInfile, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, NULL); if (hInfile == INVALID_HANDLE_VALUE) SetError(CERR_InfileNotExist); @@ -521,7 +558,6 @@ BOOL CompileKeyboardHandle(HANDLE hInfile, PFILE_KEYBOARD fk) // must preprocess for group and store names -> this isn't really necessary, but never mind! while ((msg = ReadLine(hInfile, str, TRUE)) == CERR_None) { - if (GetAsyncKeyState(VK_ESCAPE) < 0) SetError(CERR_Break); p = str; switch (LineTokenType(&p)) { @@ -555,7 +591,6 @@ BOOL CompileKeyboardHandle(HANDLE hInfile, PFILE_KEYBOARD fk) /* ReadLine will automatically skip over $Keyman lines, and parse wrapped lines */ while ((msg = ReadLine(hInfile, str, FALSE)) == CERR_None) { - if (GetAsyncKeyState(VK_ESCAPE) < 0) SetError(CERR_Break); msg = ParseLine(fk, str); if (msg != CERR_None) SetError(msg); } @@ -613,7 +648,6 @@ DWORD ProcessBeginLine(PFILE_KEYBOARD fk, PWSTR p) if(BeginLine[BeginMode] != -1) { return CERR_RepeatedBegin; } - BeginLine[BeginMode] = currentLine; if ((msg = GetRHS(fk, p, tstr, 80, (int)(INT_PTR)(p - pp), FALSE)) != CERR_None) return msg; @@ -944,10 +978,23 @@ int cmpkeys(const void *key, const void *elem) { if (akey->Line < aelem->Line) return -1; if (akey->Line > aelem->Line) return 1; - return 0; + if(akey->Key == aelem->Key) { + if(akey->ShiftFlags == aelem->ShiftFlags) { + return akey->LineStoreIndex - aelem->LineStoreIndex; + } + return akey->ShiftFlags - aelem->ShiftFlags; + } + return akey->Key - aelem->Key; } if (l1 < l2) return 1; if (l1 > l2) return -1; + if(akey->Key == aelem->Key) { + if(akey->ShiftFlags == aelem->ShiftFlags) { + return akey->LineStoreIndex - aelem->LineStoreIndex; + } + return akey->ShiftFlags - aelem->ShiftFlags; + } + return akey->Key - aelem->Key; } return(char_key - char_elem); // akey->Key - aelem->Key); } @@ -1277,6 +1324,7 @@ DWORD ProcessSystemStore(PFILE_KEYBOARD fk, DWORD SystemID, PFILE_STORE sp) else if (wcsncmp(p, L"10.0", 4) == 0) fk->version = VERSION_100; else if (wcsncmp(p, L"14.0", 4) == 0) fk->version = VERSION_140; // Adds support for #917 -- context() with notany() for KeymanWeb else if (wcsncmp(p, L"15.0", 4) == 0) fk->version = VERSION_150; // Adds support for U_xxxx_yyyy #2858 + else if (wcsncmp(p, L"16.0", 4) == 0) fk->version = VERSION_160; // KMXPlus else return CERR_InvalidVersion; if (fk->version < VERSION_60) FOldCharPosMatching = TRUE; @@ -1729,6 +1777,7 @@ CheckOutputIsReadonly(const PFILE_KEYBOARD fk, const PWSTR output) { // I4867 wcscpy_s(kp->dpContext, wcslen(pklIn) + 1, pklIn); // I3481 kp->Line = currentLine; + kp->LineStoreIndex = 0; // Finished if we are not using keys @@ -1870,6 +1919,7 @@ DWORD ExpandKp(PFILE_KEYBOARD fk, PFILE_KEY kpp, DWORD storeIndex) k->ShiftFlags = 0; } k->Line = kpp->Line; + k->LineStoreIndex = (WORD)n; ExpandKp_ReplaceIndex(fk, k, keyIndex, n); } @@ -3316,6 +3366,7 @@ DWORD WriteCompiledKeyboard(PFILE_KEYBOARD fk, HANDLE hOutfile) offset += gp->cxKeyArray * sizeof(COMP_KEY); for (j = 0; j < gp->cxKeyArray; j++, kp++, fkp++) { + kp->_reserved = 0; kp->Key = fkp->Key; if (FSaveDebug) kp->Line = fkp->Line; else kp->Line = 0; kp->ShiftFlags = fkp->ShiftFlags; @@ -3338,7 +3389,12 @@ DWORD WriteCompiledKeyboard(PFILE_KEYBOARD fk, HANDLE hOutfile) return CERR_SomewhereIGotItWrong; } - SetChecksum(buf, &ck->dwCheckSum, (DWORD)size); + if (ck->dwFileVersion < VERSION_160) { + SetChecksum(buf, &ck->dwCheckSum, (DWORD)size); + } + else { + ck->dwCheckSum = 0; // checksum is deprecated for 16.0+ + } DWORD dwBytesWritten = 0; WriteFile(hOutfile, buf, (DWORD)size, &dwBytesWritten, NULL); diff --git a/developer/src/kmcmpdll/Compiler.rc b/developer/src/kmcmpdll/Compiler.rc index d5b2e5289fbd2f423797ecb3c7342c0bc7e7eeb1..4c58996cb191f619ce468ed9ddd06222b6a36971 100644 --- a/developer/src/kmcmpdll/Compiler.rc +++ b/developer/src/kmcmpdll/Compiler.rc @@ -1,5 +1,5 @@ #include -#include "comperr.h" +#include "kmn_compiler_errors.h" #include "version.rc" @@ -91,12 +91,6 @@ END STRINGTABLE BEGIN CERR_InvalidSystemStore "Invalid system store name found" - CERR_CallIsProfessionalFeature - "Call() is only available in Keyman Developer Professional" - CERR_IncludeCodesIsProfessionalFeature - "&IncludeCodes is only available in Keyman Developer Professional" - CERR_MnemonicLayoutIsProfessionalFeature - "&MnemonicLayout is only available in Keyman Developer Professional" CERR_60FeatureOnly_VirtualCharKey "Virtual character keys require VERSION 6.0" CERR_VersionAlreadyIncluded diff --git a/developer/src/kmcmpdll/DeprecationChecks.cpp b/developer/src/kmcmpdll/DeprecationChecks.cpp index a1e19cb27b743299f06730aaa1f96eb692399efe..d64f2279e06ac71e3e7cc79fd99141b4f2ffef9b 100644 --- a/developer/src/kmcmpdll/DeprecationChecks.cpp +++ b/developer/src/kmcmpdll/DeprecationChecks.cpp @@ -2,7 +2,7 @@ #include "pch.h" #include -#include +#include #include BOOL WarnDeprecatedHeader() { // I4866 diff --git a/developer/src/kmcmpdll/NamedCodeConstants.cpp b/developer/src/kmcmpdll/NamedCodeConstants.cpp index 981e25700b4ebe057286eeb38fd87ea6bb3c046a..14f523b35ec5bc718c3f07742d7397a4deeee2d7 100644 --- a/developer/src/kmcmpdll/NamedCodeConstants.cpp +++ b/developer/src/kmcmpdll/NamedCodeConstants.cpp @@ -1,18 +1,18 @@ /* Name: NamedCodeConstants Copyright: Copyright (C) 2003-2017 SIL International. - Documentation: - Description: + Documentation: + Description: Create Date: 19 Jul 2011 Modified Date: 13 Dec 2012 Authors: mcdurdin - Related Files: - Dependencies: + Related Files: + Dependencies: - Bugs: - Todo: - Notes: + Bugs: + Todo: + Notes: History: 19 Jul 2011 - mcdurdin - I2993 - Named code constants cause a warning 0x208D to appear 24 Oct 2012 - mcdurdin - I3481 - V9.0 - Eliminate unsafe calls in C++ 06 Feb 2012 - mcdurdin - I3056 - If file was not found in first search folder, named code constants failed to compile @@ -22,7 +22,7 @@ */ #include "pch.h" -#include +#include #include "NamedCodeConstants.h" #include "CheckFilenameConsistency.h" #include "kmcmpdll.h" @@ -139,7 +139,7 @@ BOOL NamedCodeConstants::IntLoadFile(const char *filename) } fclose(fp); - + return TRUE; } @@ -262,17 +262,17 @@ int IsHangulSyllable(const wchar_t *codename, int *code) int i, LIndex, VIndex, TIndex; - /* Find initial */ + /* Find initial */ - int ch = towupper(*codename); + int ch = towupper(*codename); if(strchr("GNDRMBSJCKTPH", ch)) { - /* Has an initial syllable */ + /* Has an initial syllable */ int fdouble = towupper(*(codename+1)) == ch; LIndex = -1; for(i = 0; i < HangulLCount; i++) - if(Hangul_JAMO_L_TABLE[i][0] == ch && + if(Hangul_JAMO_L_TABLE[i][0] == ch && (!fdouble || (Hangul_JAMO_L_TABLE[i][1] == ch && fdouble))) { LIndex = i; @@ -282,9 +282,9 @@ int IsHangulSyllable(const wchar_t *codename, int *code) codename++; if(fdouble) codename++; } - else LIndex = 11; /* no initial */ + else LIndex = 11; /* no initial */ - /* Find vowel */ + /* Find vowel */ wchar_t V[4] = L""; V[0] = *codename; @@ -299,16 +299,16 @@ int IsHangulSyllable(const wchar_t *codename, int *code) codename += wcslen(V); - /* Find final */ + /* Find final */ TIndex = -1; - + for(i = 0; i < HangulTCount; i++) if(!_wcsicmp(Hangul_JAMO_T_TABLE[i], codename)) { TIndex = i; break; } if(TIndex == -1) return 0; - /* Composition */ + /* Composition */ *code = (HangulSBase + (LIndex * HangulVCount + VIndex) * HangulTCount) + TIndex; diff --git a/developer/src/kmcmpdll/UnreachableRules.cpp b/developer/src/kmcmpdll/UnreachableRules.cpp index a5c6519ef323ffb771cfe46ff86e05100d29c538..268360904d6a486260faf5c312f8c6b6d07221f7 100644 --- a/developer/src/kmcmpdll/UnreachableRules.cpp +++ b/developer/src/kmcmpdll/UnreachableRules.cpp @@ -2,7 +2,7 @@ #include "pch.h" #include -#include +#include #include "../../../common/windows/cpp/include/vkeys.h" #include @@ -16,7 +16,8 @@ std::wstring MakeHashKeyFromFileKey(PFILE_KEY kp) { std::wstringstream key; key << kp->Key << "," << kp->ShiftFlags << ","; - if (kp->dpContext) key << kp->dpContext; + if (kp->dpContext) + key << kp->dpContext; return key.str(); } diff --git a/developer/src/kmcmpdll/compfile.h b/developer/src/kmcmpdll/compfile.h index f58e041830645e5979c7b8ba48b360a7a0d9d663..4fd6e68eb546a87d7f41ed22bca6421b36a13501 100644 --- a/developer/src/kmcmpdll/compfile.h +++ b/developer/src/kmcmpdll/compfile.h @@ -86,6 +86,7 @@ typedef FILE_STORE *PFILE_STORE; struct FILE_KEY { WCHAR Key; // WCHAR for consistency; only a byte used however + WORD LineStoreIndex; DWORD Line; DWORD ShiftFlags; PWSTR dpOutput; // from start of key structure diff --git a/developer/src/kmcmpdll/json-validation.cpp b/developer/src/kmcmpdll/json-validation.cpp index 9516925ad0d9969896d76069b42a590768c34d00..e35dc0485dcae1480b00b1f002bad5fa75b56d26 100644 --- a/developer/src/kmcmpdll/json-validation.cpp +++ b/developer/src/kmcmpdll/json-validation.cpp @@ -1,9 +1,14 @@ #include #include +#include "../kmcmplib/include/kmcmplibapi.h" #include +typedef bool (*kmcmp_ValidateJsonMessageProc)(int64_t offset, const char* szText, void* context); + +extern bool flag_use_new_kmcomp; + using nlohmann::json; using nlohmann::json_uri; using nlohmann::json_schema_draft4::json_validator; @@ -24,7 +29,19 @@ static void loader(const json_uri &uri, json &schema) } } +bool kmcmpMessageProc(int64_t offset, const char* szText, void* context) { + return ((ValidateJsonMessageProc)context)(offset, szText); +} + extern "C" BOOL __declspec(dllexport) ValidateJsonFile(PWSTR pwszSchemaFile, PWSTR pwszJsonFile, ValidateJsonMessageProc MessageProc) { + + if ( flag_use_new_kmcomp ) + { + std::fstream f(pwszSchemaFile); + std::fstream fd(pwszJsonFile); + return kmcmp_ValidateJsonFile(f, fd, kmcmpMessageProc, (void*)MessageProc); + } + std::fstream f(pwszSchemaFile); if (!f.good()) { MessageProc(-1, "Schema file could not be loaded."); diff --git a/developer/src/kmcmpdll/kcframe/kcframe.vcxproj b/developer/src/kmcmpdll/kcframe/kcframe.vcxproj index cc92af4fc18f31f5d45b64ce8e4921c41ed79b2f..24cb578d733302b28eb9ddeceb4d9a19beb46444 100644 --- a/developer/src/kmcmpdll/kcframe/kcframe.vcxproj +++ b/developer/src/kmcmpdll/kcframe/kcframe.vcxproj @@ -114,7 +114,7 @@ MaxSpeed OnlyExplicitInline - .;..\..\..\global\inc;%(AdditionalIncludeDirectories) + .;..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreaded @@ -149,7 +149,7 @@ MaxSpeed OnlyExplicitInline - .;..\..\..\global\inc;%(AdditionalIncludeDirectories) + .;..;%(AdditionalIncludeDirectories) WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions) true MultiThreaded @@ -182,7 +182,7 @@ Disabled - .;..\..\..\global\inc;%(AdditionalIncludeDirectories) + .;..;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) true EnableFastChecks @@ -218,7 +218,7 @@ Disabled - .;..\..\..\global\inc;%(AdditionalIncludeDirectories) + .;..;%(AdditionalIncludeDirectories) WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions) EnableFastChecks MultiThreadedDebug diff --git a/developer/src/kmcmpdll/kmcmpdll.vcxproj b/developer/src/kmcmpdll/kmcmpdll.vcxproj index 9d6a5f192149ecbdaa830786c2ba48122b6c6d6c..c7f7e1f48f062c068d8cc15e1846f86f25942d9f 100644 --- a/developer/src/kmcmpdll/kmcmpdll.vcxproj +++ b/developer/src/kmcmpdll/kmcmpdll.vcxproj @@ -87,23 +87,27 @@ - $(VC_IncludePath);$(WindowsSDK_IncludePath);$(KEYMAN_ROOT)\developer\src\ext\json;$(KEYMAN_ROOT)\developer\src\ext\json-schema-validator + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(KEYMAN_ROOT)\developer\src\common\include;$(KEYMAN_ROOT)\developer\src\ext\json;$(KEYMAN_ROOT)\developer\src\ext\json-schema-validator $(ProjectDir)bin\$(Platform)\$(Configuration)\ + $(KEYMAN_ROOT)\developer\src\kmcmplib\build\x86\$(Configuration)\src;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86) - $(VC_IncludePath);$(WindowsSDK_IncludePath);$(KEYMAN_ROOT)\developer\src\ext\json;$(KEYMAN_ROOT)\developer\src\ext\json-schema-validator + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(KEYMAN_ROOT)\developer\src\common\include;$(KEYMAN_ROOT)\developer\src\ext\json;$(KEYMAN_ROOT)\developer\src\ext\json-schema-validator $(ProjectDir)obj\$(Platform)\$(Configuration)\ $(ProjectName).x64 $(ProjectDir)bin\$(Platform)\$(Configuration)\ + $(KEYMAN_ROOT)\developer\src\kmcmplib\build\x64\$(Configuration)\src;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64) - $(VC_IncludePath);$(WindowsSDK_IncludePath);$(KEYMAN_ROOT)\developer\src\ext\json;$(KEYMAN_ROOT)\developer\src\ext\json-schema-validator + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(KEYMAN_ROOT)\developer\src\common\include;$(KEYMAN_ROOT)\developer\src\ext\json;$(KEYMAN_ROOT)\developer\src\ext\json-schema-validator + $(KEYMAN_ROOT)\developer\src\kmcmplib\build\x86\$(Configuration)\src;$(VC_LibraryPath_x86);$(WindowsSDK_LibraryPath_x86) - $(VC_IncludePath);$(WindowsSDK_IncludePath);$(KEYMAN_ROOT)\developer\src\ext\json;$(KEYMAN_ROOT)\developer\src\ext\json-schema-validator + $(VC_IncludePath);$(WindowsSDK_IncludePath);$(KEYMAN_ROOT)\developer\src\common\include;$(KEYMAN_ROOT)\developer\src\ext\json;$(KEYMAN_ROOT)\developer\src\ext\json-schema-validator $(ProjectDir)obj\$(Platform)\$(Configuration)\ $(ProjectName).x64 $(ProjectDir)bin\$(Platform)\$(Configuration)\ + $(KEYMAN_ROOT)\developer\src\kmcmplib\build\x64\$(Configuration)\src;$(VC_LibraryPath_x64);$(WindowsSDK_LibraryPath_x64) @@ -138,7 +142,7 @@ $(KEYMAN_ROOT)\windows\src\global\inc - version.lib;setupapi.lib;iphlpapi.lib;imm32.lib;crypt32.lib;wintrust.lib;imagehlp.lib;ws2_32.lib;%(AdditionalDependencies) + libkmcmplib.a;version.lib;setupapi.lib;iphlpapi.lib;imm32.lib;crypt32.lib;wintrust.lib;imagehlp.lib;ws2_32.lib;%(AdditionalDependencies) true true @@ -186,7 +190,7 @@ $(KEYMAN_ROOT)\windows\src\global\inc - version.lib;setupapi.lib;iphlpapi.lib;imm32.lib;crypt32.lib;wintrust.lib;imagehlp.lib;ws2_32.lib;%(AdditionalDependencies) + libkmcmplib.a;version.lib;setupapi.lib;iphlpapi.lib;imm32.lib;crypt32.lib;wintrust.lib;imagehlp.lib;ws2_32.lib;%(AdditionalDependencies) true true Windows @@ -229,7 +233,7 @@ $(KEYMAN_ROOT)\windows\src\global\inc - version.lib;setupapi.lib;iphlpapi.lib;imm32.lib;crypt32.lib;wintrust.lib;imagehlp.lib;ws2_32.lib;%(AdditionalDependencies) + libkmcmplib.a;version.lib;setupapi.lib;iphlpapi.lib;imm32.lib;crypt32.lib;wintrust.lib;imagehlp.lib;ws2_32.lib;%(AdditionalDependencies) true true true @@ -273,7 +277,7 @@ $(KEYMAN_ROOT)\windows\src\global\inc - version.lib;setupapi.lib;iphlpapi.lib;imm32.lib;crypt32.lib;wintrust.lib;imagehlp.lib;ws2_32.lib;%(AdditionalDependencies) + libkmcmplib.a;version.lib;setupapi.lib;iphlpapi.lib;imm32.lib;crypt32.lib;wintrust.lib;imagehlp.lib;ws2_32.lib;%(AdditionalDependencies) true true true @@ -289,7 +293,7 @@ - + diff --git a/developer/src/kmcmpdll/kmcmpdll.vcxproj.filters b/developer/src/kmcmpdll/kmcmpdll.vcxproj.filters index 5ad97480ac6db26cab14da78078fcdc370f9158f..4131bedac41ce91cbaa45ce50d4739733d72a6c9 100644 --- a/developer/src/kmcmpdll/kmcmpdll.vcxproj.filters +++ b/developer/src/kmcmpdll/kmcmpdll.vcxproj.filters @@ -7,7 +7,7 @@
- + Header files diff --git a/developer/src/kmcmpdll/pch.h b/developer/src/kmcmpdll/pch.h index 473c0799a2edb47838fcbec0af7b810b444e933c..dcba976ea74dadadba3d36762e305c13a45f2cc9 100644 --- a/developer/src/kmcmpdll/pch.h +++ b/developer/src/kmcmpdll/pch.h @@ -11,12 +11,12 @@ #include #include -#include "../../../../common/windows/cpp/include/legacy_kmx_file.h" -#include "../../../../common/windows/cpp/include/xstring.h" +#include "../../../common/windows/cpp/include/legacy_kmx_file.h" +#include "../../../common/windows/cpp/include/xstring.h" -#include "../../../../common/windows/cpp/include/registry.h" -#include "../../../../common/windows/cpp/include/unicode.h" -#include "../../../../common/windows/cpp/include/crc32.h" +#include "../../../common/windows/cpp/include/registry.h" +#include "../../../common/windows/cpp/include/unicode.h" +#include "../../../common/windows/cpp/include/crc32.h" #include #include diff --git a/developer/src/kmcmpdll/versioning.cpp b/developer/src/kmcmpdll/versioning.cpp index 7604fb11b3a35bc42c7f02649119d307a2323452..1601e955632a8237530911f644dbcd785f339563 100644 --- a/developer/src/kmcmpdll/versioning.cpp +++ b/developer/src/kmcmpdll/versioning.cpp @@ -1,6 +1,6 @@ #include "pch.h" #include -#include +#include #include BOOL CheckKeyboardFinalVersion(PFILE_KEYBOARD fk) { diff --git a/developer/src/kmcmplib/.gitignore b/developer/src/kmcmplib/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..9418ac1e3e286b280fc3efd20658b21cc98f277d --- /dev/null +++ b/developer/src/kmcmplib/.gitignore @@ -0,0 +1,4 @@ +build/ +wasm.build +tests/keyboards/ +resources/ \ No newline at end of file diff --git a/developer/src/kmcmplib/Makefile b/developer/src/kmcmplib/Makefile new file mode 100644 index 0000000000000000000000000000000000000000..4acc7d3cfbf792efae24e4782debc9c6d61fd0b0 --- /dev/null +++ b/developer/src/kmcmplib/Makefile @@ -0,0 +1,39 @@ +# +# KMCmpLib Makefile +# + +!include ..\Defines.mak + +!ifdef GIT_BASH_FOR_KEYMAN +CALLER=$(GIT_BASH_FOR_KEYMAN) +!else +CALLER=start /wait +!endif +!ifdef DEBUG +BUILD_DEBUG=-d +!else +BUILD_DEBUG= +!endif + +build: .virtual + $(CALLER) ./build.sh clean configure build $(BUILD_DEBUG) + +clean: + $(CALLER) ./build.sh clean $(BUILD_DEBUG) + +signcode: + @rem Not required + +wrap-symbols: + @rem Not required + +test-manifest: + @rem This target needed as dependency for TIKE and KMCMPDLL + +test: + $(CALLER) ./build.sh test $(BUILD_DEBUG) + +install: + @rem Not required + +!include ..\Target.mak diff --git a/developer/src/kmcmplib/build.bat b/developer/src/kmcmplib/build.bat new file mode 100644 index 0000000000000000000000000000000000000000..7b5dcf110d82a93e380f7daf0a3c91202897a64e --- /dev/null +++ b/developer/src/kmcmplib/build.bat @@ -0,0 +1,121 @@ +@echo off +rem **************************************************************** +rem Run build.sh, not this file directly, to build on Windows. +rem **************************************************************** +setlocal enabledelayedexpansion + +if "%1"=="" goto help +if "%1"=="all" goto all +if "%1"=="x86" goto build +if "%1"=="x64" goto build + +echo "Invalid parameter." +goto help + +rem ---------------------------------- + +:help +echo Usage: %0 x86^|x64^|all debug^|release [configure] [build] [test] [additional params for meson/ninja] +echo or +echo Usage: %0 x86^|x64 -c +echo -c will leave your environment configured for Visual Studio for selected platform. +echo. +echo Otherwise, %0 is intended to be used by build.sh, not directly. +echo At least one of 'configure', 'build', or 'test' is required. +goto :eof + +rem ---------------------------------- + +:all + +setlocal +cd %KEYMAN_ROOT%\developer\src\kmcmplib +cmd /c build.bat x86 %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! + +cd %KEYMAN_ROOT%\developer\src\kmcmplib +cmd /c build.bat x64 %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! + +goto :eof + +rem ---------------------------------- + +:build + +set ARCH=%1 +shift + +if "%1"=="-c" goto :setup + +echo === Locating Visual Studio === + +rem From https://github.com/microsoft/vswhere +for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do ( + set VsDevCmd_Path=%%a\Common7\Tools\VsDevCmd.bat +) + +if errorlevel 1 ( + echo vswhere failed [!errorlevel!] + exit /b !errorlevel! +) + +if not exist "!VsDevCmd_Path!" ( + echo Could not find vsdevcmd.bat [!VsDevCmd_Path!] + exit /b 1 +) + +echo === Configuring VC++ === +set VSCMD_SKIP_SENDTELEMETRY=1 +call "!VsDevCmd_Path!" -arch=!ARCH! -no_logo -startdir=none || exit !errorlevel! + +cd %KEYMAN_ROOT%\developer\src\kmcmplib + +set BUILDTYPE=%1 +shift + +set STATIC_LIBRARY=--default-library both + +set COMMAND=%1 +shift + +if "!COMMAND!" == "configure" ( + echo === Configuring Keyman KMX Compiler for Windows !ARCH! !BUILDTYPE! === + if exist build\!ARCH!\!BUILDTYPE! rd /s/q build\!ARCH!\!BUILDTYPE! + meson setup build\!ARCH!\!BUILDTYPE! !STATIC_LIBRARY! --buildtype !BUILDTYPE! --werror %1 %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! + shift +) + +if "!COMMAND!" == "build" ( + echo === Building Keyman KMX Compiler for Windows !ARCH! !BUILDTYPE! === + cd build\!ARCH!\!BUILDTYPE! || exit !errorlevel! + ninja %1 %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! + cd ..\..\.. + shift +) + +if "!COMMAND!" == "test" ( + echo === Testing Keyman KMX Compiler for Windows !ARCH! !BUILDTYPE! === + cd build\!ARCH!\!BUILDTYPE! || exit !errorlevel! + meson test --print-errorlogs %1 %2 %3 %4 %5 %6 %7 %8 %9 || exit !errorlevel! + cd ..\..\.. + shift +) + +goto :eof + +rem ---------------------------------- + +:setup + +rem Standalone build, so we'll make the environment available to the caller +rem Also setup +rem Note: Visual Studio 2022 doesn't provide vcvarsall.bat, so we'll have to find a different solution +endlocal +for /f "usebackq delims=#" %%a in (`"%programfiles(x86)%\Microsoft Visual Studio\Installer\vswhere" -latest -property installationPath`) do ( + set VsDevCmd_Path=%%a\Common7\Tools\VsDevCmd.bat +) + +set VSCMD_SKIP_SENDTELEMETRY=1 +"!VsDevCmd_Path!" -arch=!ARCH! -no_logo -startdir=none +goto :eof + +rem ---------------------------------- diff --git a/developer/src/kmcmplib/build.sh b/developer/src/kmcmplib/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..1ccd13575c42857614ed6576bf75a4939904de08 --- /dev/null +++ b/developer/src/kmcmplib/build.sh @@ -0,0 +1,117 @@ +#!/usr/bin/env bash + +set -e +set -u + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" +. "$THIS_SCRIPT_PATH/checkout-keyboards.inc.sh" +. "$THIS_SCRIPT_PATH/commands.inc.sh" + +cd "$THIS_SCRIPT_PATH" + +################################ Main script ################################ + +# +# Restrict available targets to those that can be built on the current system +# + +archtargets=(":wasm WASM build") + +case $BUILDER_OS in + win) + archtargets+=( + ":x86 32-bit Windows (x86) build" + ":x64 64-bit Windows (x64) build" + ) + ;; + mac|linux) + archtargets+=( + ":arch Linux or mac build -- current architecture" + ) + ;; +esac + +# TODO: consider using "linux" and "mac" instead of "arch"? +# ":linux Build for current Linux architecture" +# ":mac Build for current macOS architecture" + +builder_describe \ + "Build Keyman KMX Compiler Static Library +Libraries will be built in 'build///src'. + * : 'debug' or 'release' (see --debug flag) + * All parameters after '--' are passed to meson or ninja +" \ + "clean" \ + "configure" \ + "build" \ + "test" \ + "${archtargets[@]}" \ + "--full-test also run expensive tests that rely on keyboards repo" \ + "--test=opt_tests,-t test[s] to run (space separated)" + +builder_parse "$@" + +builder_describe_outputs \ + configure:x86 build/x86/$BUILDER_CONFIGURATION/build.ninja \ + configure:x64 build/x64/$BUILDER_CONFIGURATION/build.ninja \ + configure:arch build/arch/$BUILDER_CONFIGURATION/build.ninja \ + configure:wasm build/wasm/$BUILDER_CONFIGURATION/build.ninja \ + build:x86 build/x86/$BUILDER_CONFIGURATION/src/libkmcmplib.a \ + build:x64 build/x64/$BUILDER_CONFIGURATION/src/libkmcmplib.a \ + build:arch build/arch/$BUILDER_CONFIGURATION/src/libkmcmplib.a \ + build:wasm build/wasm/$BUILDER_CONFIGURATION/src/libkmcmplib.a + +TARGET_PATH="$THIS_SCRIPT_PATH/build" + +# Iterate through all possible targets; note that targets that cannot be built +# on the current platform have already been excluded through the archtargets +# settings above +targets=(wasm x86 x64 arch) + +do_action() { + local action_function=do_$1 + for target in "${targets[@]}"; do + MESON_PATH="$TARGET_PATH/$target/$BUILDER_CONFIGURATION" + $action_function $target + done +} + +if builder_has_option --full-test; then + locate_keyboards_repo +fi + +# Note, we have a 'global' clean and also a per-arch clean +if builder_start_action clean; then + rm -rf "$THIS_SCRIPT_PATH/tests/keyboards" + builder_finish_action success clean +fi + +do_action clean + +# Note, we have a 'global' configure and also a per-arch configure +if builder_start_action configure; then + # Import our standard compiler defines; this is copied from + # /resources/build/meson/standard.meson.build by build.sh, because meson doesn't + # allow us to reference a file outside its root + mkdir -p "$THIS_SCRIPT_PATH/resources" + cp "$KEYMAN_ROOT/resources/build/meson/standard.meson.build" "$THIS_SCRIPT_PATH/resources/meson.build" + + # We have to checkout the keyboards repo in a 'configure' action because + # otherwise meson will not get the right list of keyboard source files, + # even though we only use it in the 'test' action + if builder_has_option --full-test; then + checkout_keyboards + fi + + builder_finish_action success configure +fi + +do_action configure +do_action build +do_action test \ No newline at end of file diff --git a/developer/src/kmcmplib/checkout-keyboards.inc.sh b/developer/src/kmcmplib/checkout-keyboards.inc.sh new file mode 100644 index 0000000000000000000000000000000000000000..defcb479ef4070a759b2767115d1949e7cc78ac1 --- /dev/null +++ b/developer/src/kmcmplib/checkout-keyboards.inc.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash + +# +# Look for the keyboards repo, either at $KEYBOARDS_ROOT, or, if that is not +# set, prepare to clone from GitHub. It will always be cloned to ./keyboards/ +# +function locate_keyboards_repo() { + if [[ ! -f "$THIS_SCRIPT_PATH/tests/keyboards_commit_ref.txt" ]]; then + builder_die "keyboards_commit_ref.txt does not exist, run prep.sh" + fi + + if [[ ! -d "$THIS_SCRIPT_PATH/tests/fixtures" ]]; then + builder_die "fixtures folder does not exist, run prep.sh" + fi + + if [[ -z "${KEYBOARDS_ROOT+x}" ]]; then + # KEYBOARDS_ROOT is not set, so we'll clone from GitHub + export KEYBOARDS_SOURCE_REPO=https://github.com/keymanapp/keyboards + builder_echo warning "\$KEYBOARDS_ROOT variable not set, using $KEYBOARDS_SOURCE_REPO" + builder_echo warning "For faster test builds, setup a local clone of that repo and set" + builder_echo warning "\$KEYBOARDS_ROOT to point to it" + else + builder_echo "\$KEYBOARDS_ROOT variable is $KEYBOARDS_ROOT" + export KEYBOARDS_SOURCE_REPO="$KEYBOARDS_ROOT" + fi +} + +# +# Shallow-clone of keyboards repo at commit found in keyboards_commit_ref.txt +# +function checkout_keyboards() { + local KEYBOARDS_COMMIT=$(cat $THIS_SCRIPT_PATH/tests/keyboards_commit_ref.txt) + + mkdir -p "$THIS_SCRIPT_PATH/tests/keyboards" + pushd "$THIS_SCRIPT_PATH/tests/keyboards" > /dev/null + + if [[ ! -f "build.sh" ]]; then + # We'll have to init the folder and clone the repo + builder_echo "Checking out keyboards repository at $THIS_SCRIPT_PATH/tests/keyboards" + git init + git remote add origin "$KEYBOARDS_SOURCE_REPO" + fi + + # Make sure we have fetched the commit, as it may have changed + # from a previous build + builder_echo "Fetching commit $KEYBOARDS_COMMIT in repo at $THIS_SCRIPT_PATH/tests/keyboards" + git fetch --depth=1 --no-tags origin "$KEYBOARDS_COMMIT" + git reset --hard "$KEYBOARDS_COMMIT" + + popd > /dev/null +} diff --git a/developer/src/kmcmplib/commands.inc.sh b/developer/src/kmcmplib/commands.inc.sh new file mode 100644 index 0000000000000000000000000000000000000000..bdb8e0f139bfa19b078db1e94e0508dbf24fb2a7 --- /dev/null +++ b/developer/src/kmcmplib/commands.inc.sh @@ -0,0 +1,153 @@ +#!/usr/bin/env bash + +# ---------------------------------------------------------------------------- +# clean +# ---------------------------------------------------------------------------- + +do_clean() { + # clean: note build/ will be left, but build// should be gone + local target=$1 + builder_start_action clean:$target || return 0 + + rm -rf "$MESON_PATH" + builder_finish_action success clean:$target +} + +# ---------------------------------------------------------------------------- +# configure +# ---------------------------------------------------------------------------- + +do_configure() { + local target=$1 + builder_start_action configure:$target || return 0 + + local STANDARD_MESON_ARGS= + + if [[ $target == wasm ]]; then + # do_configure_wasm + locate_emscripten + build_meson_cross_file_for_wasm + STANDARD_MESON_ARGS="--cross-file wasm.defs.build --cross-file wasm.build --default-library static" + fi + + if [[ $target =~ ^(x86|x64)$ ]]; then + cmd //C build.bat $target $BUILDER_CONFIGURATION configure "${builder_extra_params[@]}" + else + pushd "$THIS_SCRIPT_PATH" > /dev/null + # Additional arguments are used by Linux build, e.g. -Dprefix=${INSTALLDIR} + meson setup "$MESON_PATH" --werror --buildtype $BUILDER_CONFIGURATION $STANDARD_MESON_ARGS "${builder_extra_params[@]}" + popd > /dev/null + fi + builder_finish_action success configure:$target +} + +# ---------------------------------------------------------------------------- +# build +# ---------------------------------------------------------------------------- + +do_build() { + local target=$1 + builder_start_action build:$target || return 0 + + if [[ $target =~ ^(x86|x64)$ ]]; then + # Build the meson targets, both x86 and x64 also + # We need to use a batch file here so we can get + # the Visual Studio build environment with vcvarsall.bat + # TODO: if PATH is the only variable required, let's try and + # eliminate this difference in the build process + cmd //C build.bat $target $BUILDER_CONFIGURATION build "${builder_extra_params[@]}" + else + pushd "$MESON_PATH" > /dev/null + ninja + popd > /dev/null + fi + builder_finish_action success build:$target +} + +# ---------------------------------------------------------------------------- +# test +# ---------------------------------------------------------------------------- + +do_test() { + local target=$1 + builder_start_action test:$target || return 0 + + # Works on a local clone of keyboards repository, to avoid clobbering + # user's existing keyboards repo, if present + + if builder_has_option --full-test; then + checkout_keyboards + fi + + if [[ $target =~ ^(x86|x64)$ ]]; then + cmd //C build.bat $target $BUILDER_CONFIGURATION test "${builder_extra_params[@]}" + else + pushd "$MESON_PATH" > /dev/null + meson test "${builder_extra_params[@]}" + popd > /dev/null + fi + builder_finish_action success test:$target +} + +# ---------------------------------------------------------------------------- +# install and uninstall +# ---------------------------------------------------------------------------- + +do_install() { + do_command install $1 +} + +do_uninstall() { + do_command uninstall $1 +} + +do_command() { + local command=$1 + local target=$2 + builder_start_action $command:$target || return 0 + pushd "$MESON_PATH" > /dev/null + ninja $command + popd > /dev/null + builder_finish_action success $command:$target +} + +# ---------------------------------------------------------------------------- +# utility functions +# ---------------------------------------------------------------------------- + +# +# We don't want to rely on emcc being on the path, because Emscripten puts far +# too many things onto the path (in particular for us, node). +# +# The following comment suggests that we don't need emcc on the path. +# https://github.com/emscripten-core/emscripten/issues/4848#issuecomment-1097357775 +# +# So we try and locate emcc in common locations ourselves. The search pattern +# is: +# +# 1. Look for $EMSCRIPTEN_BASE (our primary emscripten variable), which should +# point to the folder that emcc is located in +# 2. Look for $EMCC which should point to the emcc executable +# 3. Look for emcc on the path +# +locate_emscripten() { + if [[ -z ${EMSCRIPTEN_BASE+x} ]]; then + if [[ -z ${EMCC+x} ]]; then + local EMCC=`which emcc` + [[ -z $EMCC ]] && builder_die "locate_emscripten: Could not locate emscripten (emcc) on the path or with \$EMCC or \$EMSCRIPTEN_BASE" + fi + [[ -x $EMCC ]] || builder_die "locate_emscripten: Variable EMCC ($EMCC) does not point to a valid executable emcc" + EMSCRIPTEN_BASE="$(dirname "$EMCC")" + fi + + [[ -x ${EMSCRIPTEN_BASE}/emcc ]] || builder_die "locate_emscripten: Variable EMSCRIPTEN_BASE ($EMSCRIPTEN_BASE) does not point to emcc's folder" +} + +build_meson_cross_file_for_wasm() { + if [ $BUILDER_OS == win ]; then + local R=$(cygpath -w $(echo $EMSCRIPTEN_BASE) | sed 's_\\_\\\\_g') + else + local R=$(echo $EMSCRIPTEN_BASE | sed 's_/_\\/_g') + fi + sed -e "s/\$EMSCRIPTEN_BASE/$R/g" wasm.build.$BUILDER_OS.in > wasm.build +} \ No newline at end of file diff --git a/developer/src/kmcmplib/getversion.bat b/developer/src/kmcmplib/getversion.bat new file mode 100644 index 0000000000000000000000000000000000000000..dcab02e4d95e572491d8648757ed9fffa50e0850 --- /dev/null +++ b/developer/src/kmcmplib/getversion.bat @@ -0,0 +1,3 @@ +@echo off +REM Get the version number from VERSION.md +more ..\..\..\VERSION.md diff --git a/developer/src/kmcmplib/getversion.sh b/developer/src/kmcmplib/getversion.sh new file mode 100755 index 0000000000000000000000000000000000000000..cd02c07929fd1f8707c2ecfcb4f874a3d9373700 --- /dev/null +++ b/developer/src/kmcmplib/getversion.sh @@ -0,0 +1,4 @@ +#!/bin/bash +# Get the version number from VERSION.md +VERSIONFILE=../../../VERSION.md +cat $VERSIONFILE diff --git a/developer/src/kmcmplib/include/keyman_version.h.in b/developer/src/kmcmplib/include/keyman_version.h.in new file mode 100644 index 0000000000000000000000000000000000000000..e55e7b70c745f32f547d79e322b0300450b58ee2 --- /dev/null +++ b/developer/src/kmcmplib/include/keyman_version.h.in @@ -0,0 +1,9 @@ +#define keyman_version_stringify(x) keyman_version_to_string(x) +#define keyman_version_to_string(x) #x + +// Product versioning + +#define KEYMAN_VERSION_MAJOR @majorver@ +#define KEYMAN_VERSION_MINOR @minorver@ +#define KEYMAN_VERSION_PATCH @patchver@ +#define KEYMAN_VERSION_STRING keyman_version_stringify(@majorver@ ## . ## @minorver@ ## . ## @patchver@ ## .0) diff --git a/developer/src/kmcmplib/include/kmcmplibapi.h b/developer/src/kmcmplib/include/kmcmplibapi.h new file mode 100644 index 0000000000000000000000000000000000000000..97d46c3c364c777fd3c8fe4c89009844d2d4635b --- /dev/null +++ b/developer/src/kmcmplib/include/kmcmplibapi.h @@ -0,0 +1,104 @@ +#pragma once + +#include + +#ifdef __EMSCRIPTEN__ +#include +#else +#define EMSCRIPTEN_KEEPALIVE +#endif + +#ifdef __cplusplus +#define EXTERN extern "C" EMSCRIPTEN_KEEPALIVE +#else +#define EXTERN EMSCRIPTEN_KEEPALIVE +#endif + +typedef struct _KMCMP_COMPILER_OPTIONS { + uint32_t dwSize; + bool ShouldAddCompilerVersion; +} KMCMP_COMPILER_OPTIONS; + +EXTERN bool kmcmp_SetCompilerOptions( + KMCMP_COMPILER_OPTIONS* options +); + +typedef int (*kmcmp_CompilerMessageProc)(int line, uint32_t dwMsgCode, char* szText, void* context); + +EXTERN bool kmcmp_CompileKeyboardFile( + char* pszInfile, + char* pszOutfile, + bool ASaveDebug, + bool ACompilerWarningsAsErrors, + bool AWarnDeprecatedCode, + kmcmp_CompilerMessageProc pMsgproc, + void* AmsgprocContext +); + +/* Compile target */ + +#define CKF_KEYMAN 0 +#define CKF_KEYMANWEB 1 + +EXTERN bool kmcmp_CompileKeyboardFileToBuffer( + char* pszInfile, + void* pfkBuffer, + bool ACompilerWarningsAsErrors, + bool AWarnDeprecatedCode, + kmcmp_CompilerMessageProc pMsgproc, + void* AmsgprocContext, + int Target +); + +typedef bool (*kmcmp_ValidateJsonMessageProc)(int64_t offset, const char* szText, void* context); + +EXTERN bool kmcmp_ValidateJsonFile( + std::fstream& f, + std::fstream& fd, + kmcmp_ValidateJsonMessageProc MessageProc, + void* context +); + +/** + * kmcmp_ParseUnicodeSet is successful if it returns >= USET_OK + */ +static const int KMCMP_USET_OK = 0; + +/** + * Error: Unknown syntax err, failed to parse + */ +static const int KMCMP_ERROR_SYNTAX_ERR = -1; +/** + * Error: Invalid, contains strings (`{abc}` form) + */ +static const int KMCMP_ERROR_HAS_STRINGS = -2; +/** + * Error: Invalid, uses properties \p{Mn} or [:Mn:] + */ +static const int KMCMP_ERROR_UNSUPPORTED_PROPERTY = -3; +/** + * Fatal: output buffer too small + */ +static const int KMCMP_FATAL_OUT_OF_RANGE = -4; + +/** + * Function pointer to kmcmp_ParseUnicodeSet + */ +typedef int (*kmcmp_ParseUnicodeSetProc)(const char* szText, uint32_t* output, uint32_t outputLength); + +/** + * Parse a UnicodeSet into 32-bit ranges. + * For example, "[]" will return 0 (KMCMP_USET_OK) as a zero-length set. + * "[" will return KMCMP_ERROR_SYNTAX_ERR, + * and "[x A-C]" will return 2 and [0x41, 0x43, 0x78, 0x78] + * @param szText input txt, null terminated, in UTF-8 format + * @param outputBuffer output buffer, owned by caller: Pairs of ranges in order + * @param outputBufferSize length of output buffer. Needs to be twice the number of expected ranges + * @return If >= KMCMP_USET_OK, number of ranges, otherwise one of the negative error values. + */ +EXTERN int kmcmp_ParseUnicodeSet( + const char* szText, + uint32_t* outputBuffer, + uint32_t outputBufferSize +); + diff --git a/developer/src/kmcmplib/include/kmcompx.h b/developer/src/kmcmplib/include/kmcompx.h new file mode 100644 index 0000000000000000000000000000000000000000..a1403ad02fdaea0839023ff900bf0efdc26f36e7 --- /dev/null +++ b/developer/src/kmcmplib/include/kmcompx.h @@ -0,0 +1,49 @@ +#pragma once +#include + +// TODO: merge with kmcmplib.h + +typedef wchar_t KMX_WCHART; +typedef KMX_DWORD * PKMX_DWORD; +typedef char * PKMX_STR; +typedef KMX_WCHAR* PKMX_WCHAR ; + +// TODO: these defines are copied out of unicode.h, because unicode.h still +// has windows-specific types. These should be remerged at a future date + +#define Uni_IsSurrogate1(ch) ((ch) >= 0xD800 && (ch) <= 0xDBFF) +#define Uni_IsSurrogate2(ch) ((ch) >= 0xDC00 && (ch) <= 0xDFFF) +#define Uni_IsSMP(ch) ((ch) >= 0x10000) + +#define Uni_SurrogateToUTF32(ch, cl) (((ch) - 0xD800) * 0x400 + ((cl) - 0xDC00) + 0x10000) + +#define Uni_UTF32ToSurrogate1(ch) (((ch) - 0x10000) / 0x400 + 0xD800) +#define Uni_UTF32ToSurrogate2(ch) (((ch) - 0x10000) % 0x400 + 0xDC00) + +#define Uni_UTF16ToUTF32(p) (Uni_IsSurrogate1(*(p)) && Uni_IsSurrogate2(*((p)+1)) ? Uni_SurrogateToUTF32(*(p), *((p)+1)) : *(p)) + +// +// C++17 definition of Windows _countof +// TODO: remove use of _countof throughout +// + +#ifndef _MSC_VER +#include + +template < typename T, size_t N > +size_t _countof( T ( & /*arr*/ )[ N ] ) +{ + return std::extent< T[ N ] >::value; +} + +#endif + +// For MSVC, we want to use the std CRT library functions +// and ignore security warnings at this time, so we are +// not forced to use the non-portable _s variants. +#define _CRT_SECURE_NO_DEPRECATE + +// strtok_s on MSVC works the same as strtok_r +#ifdef _MSC_VER +#define strtok_r strtok_s +#endif diff --git a/developer/src/kmcmplib/include/meson.build b/developer/src/kmcmplib/include/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..f98a4d8c762da2134f33054a4b18948aa3a5e658 --- /dev/null +++ b/developer/src/kmcmplib/include/meson.build @@ -0,0 +1,26 @@ +# +# Keyman is copyright (C) SIL International. MIT License. +# +# Cross platform build script to build headers +# + +project_ver = meson.project_version().split('.') + +cfg = configuration_data() +cfg.set('majorver', project_ver[0]) +cfg.set('minorver', project_ver[1]) +cfg.set('patchver', project_ver[2]) + +configure_file( + configuration: cfg, + input: 'keyman_version.h.in', + output: 'keyman_version.h', +) + +inc = include_directories( + '.', + '../../common/include', + '../../../../common/include', + '../../ext/json', + '../../ext/json-schema-validator' +) diff --git a/developer/src/kmcmplib/meson.build b/developer/src/kmcmplib/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..ae8fd6ac62130addd0b3a1a7642b1f4530571b4b --- /dev/null +++ b/developer/src/kmcmplib/meson.build @@ -0,0 +1,24 @@ +# +# Keyman is copyright (C) SIL International. MIT License. +# +# Cross platform build script to compile kmcmplib and tests +# + +project('kmcmplib', 'cpp', 'c', + version: run_command(find_program('getversion.bat', 'getversion.sh')).stdout().strip(), + license: 'MIT', + default_options : ['buildtype=release', + 'cpp_std=c++14', + 'b_vscrt=static_from_buildtype', + 'default_library=static']) + +# Import our standard compiler defines; this is copied from +# /resources/build/standard.meson.build by build.sh, because +# meson doesn't allow us to reference a file outside its root +subdir('resources') + +# ------------------------------------------------------------ + +subdir('include') +subdir('src') +subdir('tests') diff --git a/developer/src/kmcmplib/meson_options.txt b/developer/src/kmcmplib/meson_options.txt new file mode 100644 index 0000000000000000000000000000000000000000..bef0777abee7e38e97d3a8339a18e4ec45cfb62b --- /dev/null +++ b/developer/src/kmcmplib/meson_options.txt @@ -0,0 +1 @@ +option('full_test', type: 'boolean', value: false) \ No newline at end of file diff --git a/developer/src/kmcmplib/src/CasedKeys.cpp b/developer/src/kmcmplib/src/CasedKeys.cpp new file mode 100644 index 0000000000000000000000000000000000000000..88d3b190ab36d9871a998f04069f69e3baaaca54 --- /dev/null +++ b/developer/src/kmcmplib/src/CasedKeys.cpp @@ -0,0 +1,154 @@ + +#include "pch.h" + +#include "compfile.h" +#include "kmn_compiler_errors.h" +#include "../../../../common/windows/cpp/include/vkeys.h" +#include "kmcmplib.h" + +#include "CharToKeyConversion.h" +#include "kmx_u16.h" +#include "xstring.h" + +namespace kmcmp { + extern KMX_BOOL FMnemonicLayout; // TODO: these globals should be consolidated one day +} + +KMX_DWORD ExpandCapsRule(PFILE_GROUP gp, PFILE_KEY kpp, PFILE_STORE sp); + +KMX_DWORD VerifyCasedKeys(PFILE_STORE sp) { + assert(sp != NULL); + + if (kmcmp::FMnemonicLayout) { + // The &CasedKeys system store is not supported for + // mnemonic layouts in 14.0 + return CERR_CasedKeysNotSupportedWithMnemonicLayout; + } + + // We will rewrite this store with virtual keys + + PKMX_WCHAR p = sp->dpString; + PKMX_WCHAR buf = new KMX_WCHAR[u16len(p) * 5 + 1]; // extended keys are 5 units long, so this is the max length + PKMX_WCHAR q = buf; + + while (*p) { + KMX_UINT key = 0, shift = 0; + if (*p != UC_SENTINEL) { + if (!kmcmp::MapUSCharToVK(*p, &key, &shift)) { + return CERR_CasedKeysMustContainOnlyVirtualKeys; + } + if (shift & K_SHIFTFLAG) { + return CERR_CasedKeysMustNotIncludeShiftStates; + } + } + else { + if (*(p + 1) != CODE_EXTENDED) { + return CERR_CasedKeysMustContainOnlyVirtualKeys; + } + shift = *(p + 2); + key = *(p + 3); + if (shift != ISVIRTUALKEY) { + return CERR_CasedKeysMustNotIncludeShiftStates; + } + } + *q++ = UC_SENTINEL; + *q++ = CODE_EXTENDED; + *q++ = shift; + *q++ = key; + *q++ = UC_SENTINEL_EXTENDEDEND; + *q = 0; + + p = incxstr(p); + } + + delete[] sp->dpString; + sp->dpString = buf; + + return CERR_None; +} + +KMX_DWORD ExpandCapsRulesForGroup(PFILE_KEYBOARD fk, PFILE_GROUP gp) { + assert(fk != NULL); + assert(gp != NULL); + + if (kmcmp::FMnemonicLayout) { + // The &CasedKeys system store is not supported for + // mnemonic layouts in 14.0 + return CERR_None; + } + + PFILE_STORE sp = FindSystemStore(fk, TSS_CASEDKEYS); + if (!sp) { + // If there is no &CasedKeys system store, then we do not + // process the key + return CERR_None; + } + + KMX_DWORD msg; + // ExpandCapsRule may add extra rules at the end of gp->dpKeyArray, + // reallocating it, so we (a) cache the original length, and (b) + // dereference the array every call + int cxKeyArray = gp->cxKeyArray; + for (int i = 0; i < cxKeyArray; i++) { + if ((msg = ExpandCapsRule(gp, &gp->dpKeyArray[i], sp)) != CERR_None) { + return msg; + } + } + return CERR_None; +} + +KMX_DWORD ExpandCapsRule(PFILE_GROUP gp, PFILE_KEY kpp, PFILE_STORE sp) { + KMX_UINT key = kpp->Key; + KMX_UINT shift = kpp->ShiftFlags; + + if (shift == 0) { + // Convert US key cap to a virtual key + if (!kmcmp::MapUSCharToVK(kpp->Key, &key, &shift)) { + return CERR_None; + } + } + + if (shift & (CAPITALFLAG | NOTCAPITALFLAG)) { + // Don't attempt expansion if either Caps Lock flag is specified in the key rule + return CERR_None; + } + + PKMX_WCHAR p = sp->dpString; + for (; *p; p = incxstr(p)) { + // We've already verified that the store contains only virtual keys in VerifyCasedKeys + if (*(p + 3) == key) { + break; + } + } + + if (!*p) { + // This key is not modified by Caps Lock + return CERR_None; + } + + // This key is modified by Caps Lock, so we need to duplicate this rule + PFILE_KEY k = new FILE_KEY[gp->cxKeyArray + 1]; + if (!k) return CERR_CannotAllocateMemory; + memcpy(k, gp->dpKeyArray, gp->cxKeyArray * sizeof(FILE_KEY)); + + kpp = &k[(int)(kpp - gp->dpKeyArray)]; + + delete gp->dpKeyArray; + gp->dpKeyArray = k; + gp->cxKeyArray++; + + k = &k[gp->cxKeyArray - 1]; + k->dpContext = new KMX_WCHAR[u16len(kpp->dpContext) + 1]; + k->dpOutput = new KMX_WCHAR[u16len(kpp->dpOutput) + 1]; + u16cpy(k->dpContext, kpp->dpContext ); // copy the context. + u16cpy(k->dpOutput, kpp->dpOutput ); // copy the output. + + k->Key = key; + k->Line = kpp->Line; + // Add the CAPITAL FLAG, invert shift flag for the rule + k->ShiftFlags = (shift ^ K_SHIFTFLAG) | CAPITALFLAG; + kpp->Key = key; + kpp->ShiftFlags = shift | NOTCAPITALFLAG; + + return CERR_None; +} diff --git a/developer/src/kmcmplib/src/CasedKeys.h b/developer/src/kmcmplib/src/CasedKeys.h new file mode 100644 index 0000000000000000000000000000000000000000..e97cc593898cd32b3dcb516bd4bb660b49f9ef6a --- /dev/null +++ b/developer/src/kmcmplib/src/CasedKeys.h @@ -0,0 +1,4 @@ +#pragma once + +KMX_DWORD VerifyCasedKeys(PFILE_STORE sp); +KMX_DWORD ExpandCapsRulesForGroup(PFILE_KEYBOARD fk, PFILE_GROUP gp); diff --git a/developer/src/kmcmplib/src/CharToKeyConversion.cpp b/developer/src/kmcmplib/src/CharToKeyConversion.cpp new file mode 100644 index 0000000000000000000000000000000000000000..0c2b652d095d57ed9a647e942902df00243e482b --- /dev/null +++ b/developer/src/kmcmplib/src/CharToKeyConversion.cpp @@ -0,0 +1,207 @@ + +#include "pch.h" +#include "CharToKeyConversion.h" + +/* Following VKeys come from Windows */ + +#define VK_COLON 0xBA +#define VK_EQUAL 0xBB +#define VK_COMMA 0xBC +#define VK_HYPHEN 0xBD +#define VK_PERIOD 0xBE +#define VK_SLASH 0xBF +#define VK_ACCENT 0xC0 +#define VK_LBRKT 0xDB +#define VK_BKSLASH 0xDC +#define VK_RBRKT 0xDD +#define VK_QUOTE 0xDE +#define VK_xDF 0xDF + +#define VK_NUMPAD0 0x60 +#define VK_NUMPAD9 0x69 +#define VK_SPACE 0x20 + + +/* Following code lifted from syskbd.cpp and tweaked for compiler use. Todo: consolidate */ + +KMX_WCHAR kmcmp::VKToChar(KMX_WORD keyCode, KMX_UINT shiftFlags) +{ + KMX_CHAR shiftedDigit[] = ")!@#$%^&*("; + int n, Shift; + + if (!(shiftFlags & ISVIRTUALKEY)) return keyCode; + + if (shiftFlags & (LCTRLFLAG | RCTRLFLAG | LALTFLAG | RALTFLAG)) return 0; + + if (keyCode >= '0' && keyCode <= '9') + { + n = keyCode - '0'; + return ((shiftFlags & K_SHIFTFLAG) ? shiftedDigit[n] : keyCode); + } + + if (keyCode >= 'A' && keyCode <= 'Z') + { + Shift = (shiftFlags & K_SHIFTFLAG); + if (shiftFlags & (CAPITALFLAG)) Shift = !Shift; + return (Shift ? keyCode : keyCode + 32); + } + + if (keyCode >= VK_NUMPAD0 && keyCode <= VK_NUMPAD9) + { + if (!(shiftFlags & NUMLOCKFLAG)) return 0; + return keyCode - (VK_NUMPAD0 - '0'); + } + + Shift = (shiftFlags & K_SHIFTFLAG); + + switch (keyCode) + { + case VK_ACCENT: + return Shift ? '~' : '`'; + case VK_HYPHEN: + return Shift ? '_' : '-'; + case VK_EQUAL: + return Shift ? '+' : '='; + case VK_BKSLASH: + return Shift ? '|' : 92; + case VK_LBRKT: + return Shift ? '{' : '['; + case VK_RBRKT: + return Shift ? '}' : ']'; + case VK_COLON: + return Shift ? ':' : ';'; + case VK_QUOTE: + return Shift ? '"' : 39; + case VK_COMMA: + return Shift ? '<' : ','; + case VK_PERIOD: + return Shift ? '>' : '.'; + case VK_SLASH: + return Shift ? '?' : '/'; + case VK_SPACE: + return ' '; + } + return 0; + //keyCode; +} + + +/* This array is lifted from preservedkeymap.cpp */ +// TODO: share this +const struct +{ + KMX_UINT key; + KMX_BOOL shift; +} USCharMap[] = { + { VK_SPACE, FALSE }, // 20 ' ' + { '1', TRUE }, // 21 '!' + { VK_QUOTE, TRUE }, // 22 '"' + { '3', TRUE }, // 23 '#' + { '4', TRUE }, // 24 '$' + { '5', TRUE }, // 25 '%' + { '7', TRUE }, // 26 '&' + { VK_QUOTE, FALSE }, // 27 ''' + { '9', TRUE }, // 28 '(' + { '0', TRUE }, // 29 ')' + { '8', TRUE }, // 2A '*' + { VK_EQUAL, TRUE }, // 2B '+' + { VK_COMMA, FALSE }, // 2C ',' + { VK_HYPHEN, FALSE }, // 2D '-' + { VK_PERIOD, FALSE }, // 2E '.' + { VK_SLASH, FALSE }, // 2F '/' + + { '0', FALSE }, // 30 '0' + { '1', FALSE }, // 31 '1' + { '2', FALSE }, // 32 '2' + { '3', FALSE }, // 33 '3' + { '4', FALSE }, // 34 '4' + { '5', FALSE }, // 35 '5' + { '6', FALSE }, // 36 '6' + { '7', FALSE }, // 37 '7' + { '8', FALSE }, // 38 '8' + { '9', FALSE }, // 39 '9' + { VK_COLON, TRUE }, // 3A ':' + { VK_COLON, FALSE }, // 3B ';' + { VK_COMMA, TRUE }, // 3C '<' + { VK_EQUAL, FALSE }, // 3D '=' + { VK_PERIOD, TRUE }, // 3E '>' + { VK_SLASH, TRUE }, // 3F '?' + + { '2', TRUE }, // 40 '@' + { 'A', TRUE }, // 41 'A' + { 'B', TRUE }, // 42 'B' + { 'C', TRUE }, // 43 'C' + { 'D', TRUE }, // 44 'D' + { 'E', TRUE }, // 45 'E' + { 'F', TRUE }, // 46 'F' + { 'G', TRUE }, // 47 'G' + { 'H', TRUE }, // 48 'H' + { 'I', TRUE }, // 49 'I' + { 'J', TRUE }, // 4A 'J' + { 'K', TRUE }, // 4B 'K' + { 'L', TRUE }, // 4C 'L' + { 'M', TRUE }, // 4D 'M' + { 'N', TRUE }, // 4E 'N' + { 'O', TRUE }, // 4F 'O' + + { 'P', TRUE }, // 50 'P' + { 'Q', TRUE }, // 51 'Q' + { 'R', TRUE }, // 52 'R' + { 'S', TRUE }, // 53 'S' + { 'T', TRUE }, // 54 'T' + { 'U', TRUE }, // 55 'U' + { 'V', TRUE }, // 56 'V' + { 'W', TRUE }, // 57 'W' + { 'X', TRUE }, // 58 'X' + { 'Y', TRUE }, // 59 'Y' + { 'Z', TRUE }, // 5A 'Z' + { VK_LBRKT, FALSE }, // 5B '[' + { VK_BKSLASH, FALSE }, // 5C '\' + { VK_RBRKT, FALSE }, // 5D ']' + { '6', TRUE }, // 5E '^' + { VK_HYPHEN, TRUE }, // 5F '_' + + { VK_ACCENT, FALSE }, // 60 '`' + { 'A', FALSE }, // 61 'a' + { 'B', FALSE }, // 62 'b' + { 'C', FALSE }, // 63 'c' + { 'D', FALSE }, // 64 'd' + { 'E', FALSE }, // 65 'e' + { 'F', FALSE }, // 66 'f' + { 'G', FALSE }, // 67 'g' + { 'H', FALSE }, // 68 'h' + { 'I', FALSE }, // 69 'i' + { 'J', FALSE }, // 6A 'j' + { 'K', FALSE }, // 6B 'k' + { 'L', FALSE }, // 6C 'l' + { 'M', FALSE }, // 6D 'm' + { 'N', FALSE }, // 6E 'n' + { 'O', FALSE }, // 6F 'o' + + { 'P', FALSE }, // 70 'p' + { 'Q', FALSE }, // 71 'q' + { 'R', FALSE }, // 72 'r' + { 'S', FALSE }, // 73 's' + { 'T', FALSE }, // 74 't' + { 'U', FALSE }, // 75 'u' + { 'V', FALSE }, // 76 'v' + { 'W', FALSE }, // 77 'w' + { 'X', FALSE }, // 78 'x' + { 'Y', FALSE }, // 79 'y' + { 'Z', FALSE }, // 7A 'z' + { VK_LBRKT, TRUE }, // 7B '{' + { VK_BKSLASH, TRUE }, // 7C '|' + { VK_RBRKT, TRUE }, // 7D '}' + { VK_ACCENT, TRUE } // 7E '~' +}; + +KMX_BOOL kmcmp::MapUSCharToVK(KMX_UINT ch, KMX_UINT *puKey, KMX_UINT *puShiftFlags) { + assert(puKey != NULL); + assert(puShiftFlags != NULL); + if (ch >= 0x20 && ch < 0x7F) { + *puKey = USCharMap[ch - 0x20].key; + *puShiftFlags = ISVIRTUALKEY | (USCharMap[ch - 0x20].shift ? K_SHIFTFLAG : 0); + return TRUE; + } + return FALSE; +} diff --git a/developer/src/kmcmplib/src/CharToKeyConversion.h b/developer/src/kmcmplib/src/CharToKeyConversion.h new file mode 100644 index 0000000000000000000000000000000000000000..dd71ccbc0b1137027bec9ac46abd4904be562d12 --- /dev/null +++ b/developer/src/kmcmplib/src/CharToKeyConversion.h @@ -0,0 +1,6 @@ +#pragma once + +namespace kmcmp { + KMX_BOOL MapUSCharToVK(KMX_UINT ch, KMX_UINT *puKey, KMX_UINT *puShiftFlags); + KMX_WCHAR VKToChar(KMX_WORD keyCode, KMX_UINT shiftFlags); +} \ No newline at end of file diff --git a/developer/src/kmcmplib/src/CheckFilenameConsistency.cpp b/developer/src/kmcmplib/src/CheckFilenameConsistency.cpp new file mode 100644 index 0000000000000000000000000000000000000000..627298bf375de6155aeae55fb1ddff96a157df14 --- /dev/null +++ b/developer/src/kmcmplib/src/CheckFilenameConsistency.cpp @@ -0,0 +1,145 @@ + +#define _SILENCE_EXPERIMENTAL_FILESYSTEM_DEPRECATION_WARNING 1 +#include "pch.h" +#include "compfile.h" +#include +#include "kmcmplib.h" +#include +#include "CheckFilenameConsistency.h" +#include "kmx_u16.h" +#include "filesystem.h" + +#ifdef _MSC_VER +#include +#endif + +namespace kmcmp { + extern KMX_CHAR CompileDir[260]; // TODO: this should not be a fixed buffer +} +bool IsRelativePath(KMX_CHAR const * p) { + // Relative path (returns TRUE): + // ..\...\BITMAP.BMP + // PATH\BITMAP.BMP + // BITMAP.BMP + + // Semi-absolute path (returns FALSE): + // \...\BITMAP.BMP + + // Absolute path (returns FALSE): + // C:\...\BITMAP.BMP + // \\SERVER\SHARE\...\BITMAP.BMP + + if ((*p == '\\') || (*p == '/')) return FALSE; + if (*p && *(p + 1) == ':') return FALSE; + + return TRUE; +} + +bool IsRelativePath(KMX_WCHAR const * p) { + // Relative path (returns TRUE): + // ..\...\BITMAP.BMP + // PATH\BITMAP.BMP + // BITMAP.BMP + + // Semi-absolute path (returns FALSE): + // \...\BITMAP.BMP + + // Absolute path (returns FALSE): + // C:\...\BITMAP.BMP + // \\SERVER\SHARE\...\BITMAP.BMP + + if ((*p == u'\\') || (*p == u'/'))return FALSE; + if (*p && *(p + 1) == u':') return FALSE; + + return TRUE; +} + +KMX_DWORD CheckFilenameConsistency( KMX_CHAR const * Filename, bool ReportMissingFile) { + PKMX_WCHAR WFilename = strtowstr(( KMX_CHAR *)Filename); + KMX_DWORD const result = CheckFilenameConsistency(WFilename, ReportMissingFile); + delete WFilename; + return result; +} + +KMX_DWORD CheckFilenameConsistency(KMX_WCHAR const * Filename, bool ReportMissingFile) { + // not ready yet: needs more attention-> common includes for non-Windows platforms + KMX_WCHAR Name[260]; // TODO: fixed buffer sizes bad + + + if (IsRelativePath(Filename)) { + PKMX_WCHAR WCompileDir = strtowstr(kmcmp::CompileDir); + u16ncpy(Name, WCompileDir, _countof(Name)); // I3481 + u16ncat(Name, Filename, _countof(Name)); // I3481 + delete[] WCompileDir; + } else { + u16ncpy(Name, Filename, _countof(Name)); // I3481 + } + +#ifndef _MSC_VER + // Filename consistency only needs to be checked on Windows, because other + // platforms are going to fail if the filename is inconsistent anyway! + if(!kmcmp_FileExists(Name)) { + if (ReportMissingFile) { + u16cpy(ErrExtraW, u"referenced file '"); + u16ncat(ErrExtraW, Filename, 256); + u16ncat(ErrExtraW, u"'", 256); + strcpy(ErrExtraLIB, string_from_u16string(ErrExtraW).c_str()); + AddWarning(CWARN_MissingFile); + } + return CERR_None; + } + return CERR_None; +#else + _wfinddata_t fi; + intptr_t n; + if ((n = _wfindfirst((const wchar_t*) Name, &fi)) == -1) { + if (ReportMissingFile) { + sprintf(ErrExtraLIB, "referenced file '%ls'", (wchar_t*) Filename); + AddWarning(CWARN_MissingFile); + } + return CERR_None; + } + + _findclose(n); + + KMX_WCHAR FName[_MAX_FNAME], Ext[_MAX_EXT]; + wchar_t WChName[_MAX_PATH]; + _wsplitpath_s((const wchar_t*)Filename, nullptr, 0, nullptr, 0, (wchar_t*) FName, _MAX_FNAME, (wchar_t*) Ext, _MAX_EXT); + _wmakepath_s(WChName, _MAX_PATH, nullptr, nullptr, (const wchar_t*) FName, (const wchar_t*) Ext); + if (wcscmp(WChName, fi.name) != 0) { + sprintf(ErrExtraLIB, "reference '%ls' does not match actual filename '%ls'", WChName, fi.name); + + AddWarning(CHINT_FilenameHasDifferingCase); + + } +#endif + + return CERR_None; +} + +KMX_DWORD CheckFilenameConsistencyForCalls(PFILE_KEYBOARD fk) { + // call() statements depend on a fairly ugly hack for js, + // where store(DllFunction) "my.dll:func" will look for a + // file called function.call_js. ( or should this be func.call_js ? ) + // This is ripe for rewrite! + // But let's check what we have anyway + + PFILE_STORE sp; + KMX_DWORD i, msg; + for (i = 0, sp = fk->dpStoreArray; i < fk->cxStoreArray; i++, sp++) { + if (!sp->fIsCall) continue; + + const std::u16string callsite(sp->dpString); + const auto colon = callsite.find(':'); + if (colon == std::u16string::npos) continue; + + auto func1 = callsite.substr(colon + 1); + std::u16string str_js(u".call_js"); + std::u16string func = func1+ str_js; + + if ((msg = CheckFilenameConsistency(func.c_str(), FALSE)) != CERR_None) { + return msg; + } + } + return CERR_None; +} diff --git a/developer/src/kmcmplib/src/CheckFilenameConsistency.h b/developer/src/kmcmplib/src/CheckFilenameConsistency.h new file mode 100644 index 0000000000000000000000000000000000000000..39f86db391b1ac6b870d7a521f297372059bd9b4 --- /dev/null +++ b/developer/src/kmcmplib/src/CheckFilenameConsistency.h @@ -0,0 +1,11 @@ +#pragma once + +#include "compfile.h" +#include "kmcmplib.h" + +KMX_DWORD CheckFilenameConsistencyForCalls(PFILE_KEYBOARD fk); +KMX_DWORD CheckFilenameConsistency(KMX_CHAR const * Filename, bool ReportMissingFile); +KMX_DWORD CheckFilenameConsistency(KMX_WCHAR const * Filename, bool ReportMissingFile); + +bool IsRelativePath(KMX_CHAR const * p); +bool IsRelativePath(KMX_WCHAR const * p); diff --git a/developer/src/kmcmplib/src/CheckForDuplicates.cpp b/developer/src/kmcmplib/src/CheckForDuplicates.cpp new file mode 100644 index 0000000000000000000000000000000000000000..71268a4db59ac9eac0ef8fcdeed64931e6ab5d86 --- /dev/null +++ b/developer/src/kmcmplib/src/CheckForDuplicates.cpp @@ -0,0 +1,48 @@ + +#include "pch.h" + +#include "compfile.h" +#include +#include "kmcmplib.h" +#include +#include "kmx_u16.h" +#include + +#include "CheckForDuplicates.h" + +KMX_DWORD CheckForDuplicateGroup(PFILE_KEYBOARD fk, PFILE_GROUP gp) noexcept { + KMX_DWORD i; + PFILE_GROUP gp0 = fk->dpGroupArray; + for (i = 0; i < fk->cxGroupArray; i++, gp0++) { + if (gp0 == gp) { + continue; + } + if (u16icmp(gp0->szName, gp->szName) == 0) { + u16sprintf(ErrExtraW, 256, L" Group '%ls' declared on line %d", u16fmt(gp0->szName).c_str(), gp0->Line); + strcpy(ErrExtraLIB, string_from_u16string(ErrExtraW).c_str()); + return CERR_DuplicateGroup; + } + } + return CERR_None; +} + +KMX_DWORD CheckForDuplicateStore(PFILE_KEYBOARD fk, PFILE_STORE sp) noexcept { + if (!sp->szName[0]) { + // Stores with zero length names are reserved system stores. + // They cannot be defined in user code. This is not an issue. + return CERR_None; + } + KMX_DWORD i; + PFILE_STORE sp0 = fk->dpStoreArray; + for (i = 0; i < fk->cxStoreArray; i++, sp0++) { + if (sp0 == sp) { + continue; + } + if (u16icmp(sp0->szName, sp->szName) == 0) { + u16sprintf(ErrExtraW,256, L" Store '%ls' declared on line %d", u16fmt(sp0->szName).c_str(), sp0->line); + strcpy(ErrExtraLIB, string_from_u16string(ErrExtraW).c_str()); + return CERR_DuplicateStore; + } + } + return CERR_None; +} diff --git a/developer/src/kmcmplib/src/CheckForDuplicates.h b/developer/src/kmcmplib/src/CheckForDuplicates.h new file mode 100644 index 0000000000000000000000000000000000000000..20789dd5e2cdae8ab9c5ae7c7ba5a76e63518909 --- /dev/null +++ b/developer/src/kmcmplib/src/CheckForDuplicates.h @@ -0,0 +1,4 @@ +#pragma once + +KMX_DWORD CheckForDuplicateGroup(PFILE_KEYBOARD fk, PFILE_GROUP gp) noexcept; +KMX_DWORD CheckForDuplicateStore(PFILE_KEYBOARD fk, PFILE_STORE sp) noexcept; diff --git a/developer/src/kmcmplib/src/CheckNCapsConsistency.cpp b/developer/src/kmcmplib/src/CheckNCapsConsistency.cpp new file mode 100644 index 0000000000000000000000000000000000000000..c86c62702e7e312cf1fc75fb6bb449cfbfcaa0e3 --- /dev/null +++ b/developer/src/kmcmplib/src/CheckNCapsConsistency.cpp @@ -0,0 +1,99 @@ + +#include "pch.h" + +#include +#include +#include +#include "CharToKeyConversion.h" + +/** + * If any rule uses CAPS or NCAPS for a given key, then every rule that + * uses that key must also use CAPS or NCAPS, as otherwise the results are + * inconsistent. For example, if Caps Lock is on, then [K_F] may still be + * matched: + * + * + [K_F] > 'foo' + * + [CAPS K_F] > 'bar' + * + * Because of the way that KeymanWeb compiles rules, this may even apply when + * we have a key rule that would otherwise be ignored due to context. In the + * following example, [Caps Lock] + [y] would result in no output (or default + * output) rather than 'bar', because the preceding rule would capture the + * Y key, ignoring Caps Lock, meaning that the subsequent rule would never + * even get tested. (Note that this was introduced in the KeymanWeb compiler + * fix for extremely long if/else ladders in Keyman 12 in #1561, and this is + * technically slightly inconsistent with Keyman Core, although in my analysis + * only in this already ambiguous situation. + * + * 'x' + [K_Y] > 'foo' + * [CAPS K_Y] > 'bar' + * + * Given all this, we'll warn any time we find a key that has inconsistent use + * of CAPS/NCAPS in its rules. + * + * @param fk Keyboard to check + */ +bool CheckNCapsConsistency(PFILE_KEYBOARD fk) { + struct CapsUsage { + int ncaps_line, caps_line, neither_line; + }; + + const int oldCurrentLine = kmcmp::currentLine; + + // 256 virtual key codes + sizeof the virtual key dictionary is max key code possible + const int nkeys = 256 + fk->cxVKDictionary; + auto caps_ncaps_usage = new CapsUsage [nkeys]; + + memset(caps_ncaps_usage, 0, nkeys * sizeof(CapsUsage)); + + PFILE_GROUP gp; + KMX_DWORD gn; + for (gn = 0, gp = fk->dpGroupArray; gn < fk->cxGroupArray; gn++, gp++) { + if (!gp->fUsingKeys) { + continue; + } + + PFILE_KEY kp; + KMX_DWORD kn; + for (kn = 0, kp = gp->dpKeyArray; kn < gp->cxKeyArray; kn++, kp++) { + KMX_UINT key; + KMX_UINT shift; + if (kp->ShiftFlags & ISVIRTUALKEY) { + if (kp->Key >= nkeys) { + assert(false); + continue; + } + key = kp->Key; + shift = kp->ShiftFlags; + } + else if (!kmcmp::MapUSCharToVK(kp->Key, &key, &shift)) { + // Not a valid key + continue; + } + + if (shift & NOTCAPITALFLAG) { + if (!caps_ncaps_usage[key].ncaps_line) caps_ncaps_usage[key].ncaps_line = (kp->Line == 0 ? 1 : kp->Line); + } + else if (shift & CAPITALFLAG) { + if (!caps_ncaps_usage[key].caps_line) caps_ncaps_usage[key].caps_line = (kp->Line == 0 ? 1 : kp->Line); + } + else { + if (!caps_ncaps_usage[key].neither_line) caps_ncaps_usage[key].neither_line = (kp->Line == 0 ? 1 : kp->Line); + } + } + } + + for (int i = 0; i < nkeys; i++) { + if (caps_ncaps_usage[i].neither_line && (caps_ncaps_usage[i].caps_line || caps_ncaps_usage[i].ncaps_line)) { + // We set the current line to one needing work: the developer should add the NCAPS flag + kmcmp::currentLine = caps_ncaps_usage[i].neither_line; + AddWarningBool(CWARN_KeyShouldIncludeNCaps); + } + } + + delete[] caps_ncaps_usage; + + kmcmp::currentLine = oldCurrentLine; + + return TRUE; +} diff --git a/developer/src/kmcmplib/src/CheckNCapsConsistency.h b/developer/src/kmcmplib/src/CheckNCapsConsistency.h new file mode 100644 index 0000000000000000000000000000000000000000..50fa744c4ac5819c648e7c21784f540c17edec96 --- /dev/null +++ b/developer/src/kmcmplib/src/CheckNCapsConsistency.h @@ -0,0 +1,5 @@ +#pragma once + +#include + +bool CheckNCapsConsistency(PFILE_KEYBOARD fk); diff --git a/developer/src/kmcmplib/src/CompMsg.cpp b/developer/src/kmcmplib/src/CompMsg.cpp new file mode 100644 index 0000000000000000000000000000000000000000..2fa0d68322dc1217207bb8541a62e304fee40f76 --- /dev/null +++ b/developer/src/kmcmplib/src/CompMsg.cpp @@ -0,0 +1,158 @@ +#include + +struct CompilerError { + KMX_DWORD ErrorCode; + const KMX_CHAR* Text; + }; + +const struct CompilerError CompilerErrors[] = { + { CERR_InvalidLayoutLine , "Invalid 'layout' command"}, + { CERR_NoVersionLine , "No version line found for file"}, + { CERR_InvalidGroupLine , "Invalid 'group' command"}, + { CERR_InvalidStoreLine , "Invalid 'store' command"}, + { CERR_InvalidCodeInKeyPartOfRule , "Invalid command or code found in key part of rule"}, + { CERR_InvalidDeadkey , "Invalid 'deadkey' or 'dk' command"}, + { CERR_InvalidValue , "Invalid value in extended string"}, + { CERR_ZeroLengthString , "A string of zero characters was found"}, + { CERR_TooManyIndexToKeyRefs , "Too many index commands refering to key string"}, + { CERR_UnterminatedString , "Unterminated string in line"}, + { CERR_StringInVirtualKeySection , "extend string illegal in virtual key section"}, + { CERR_AnyInVirtualKeySection , "'any' command is illegal in virtual key section"}, + { CERR_InvalidAny , "Invalid 'any' command"}, + { CERR_StoreDoesNotExist , "Store referenced does not exist"}, + { CERR_BeepInVirtualKeySection , "'beep' command is illegal in virtual key section"}, + { CERR_IndexInVirtualKeySection , "'index' command is illegal in virtual key section"}, + { CERR_BadCallParams , "CompileKeyboardFile was called with bad parameters"}, + { CERR_InfileNotExist , "Cannot find the input file"}, + { CERR_CannotCreateOutfile , "Cannot open output file for writing"}, + { CERR_UnableToWriteFully , "Unable to write the file completely"}, + { CERR_CannotReadInfile , "Cannot read the input file"}, + { CERR_SomewhereIGotItWrong , "Internal error: contact Keyman"}, + { CERR_BufferOverflow , "The compiler memory buffer overflowed"}, + { CERR_Break , "Compiler interrupted by user"}, + { CERR_CannotAllocateMemory , "Out of memory"}, + { CERR_InvalidBitmapLine , "Invalid 'bitmaps' command"}, + { CERR_CannotReadBitmapFile , "Cannot open the bitmap or icon file for reading"}, + { CERR_IndexDoesNotPointToAny , "An index() in the output does not have a corresponding any() statement"}, + { CERR_ReservedCharacter , "A reserved character was found"}, + { CERR_InvalidCharacter , "A character was found that is outside the valid Unicode range (U+0000 - U+10FFFF)"}, + { CERR_InvalidCall , "The 'call' command is invalid"}, + { CERR_CallInVirtualKeySection , "'call' command is illegal in virtual key section"}, + { CERR_CodeInvalidInKeyStore , "The command is invalid inside a store that is used in a key part of the rule"}, + { CERR_CannotLoadIncludeFile , "Cannot load the included file: it is either invalid or does not exist"}, + { CERR_60FeatureOnly_EthnologueCode , "EthnologueCode system store requires VERSION 6.0 or higher"}, + { CERR_60FeatureOnly_MnemonicLayout , "MnemonicLayout functionality requires VERSION 6.0 or higher"}, + { CERR_60FeatureOnly_OldCharPosMatching , "OldCharPosMatching system store requires VERSION 6.0 or higher"}, + { CERR_60FeatureOnly_NamedCodes , "Named character constants requires VERSION 6.0 or higher"}, + { CERR_60FeatureOnly_Contextn , "Context(n) requires VERSION 6.0 or higher"}, + { CERR_501FeatureOnly_Call , "Call() requires VERSION 5.01 or higher"}, + { CERR_InvalidNamedCode , "Invalid named code constant"}, + { CERR_InvalidSystemStore , "Invalid system store name found"}, + { CERR_60FeatureOnly_VirtualCharKey , "Virtual character keys require VERSION 6.0 or higher"}, + { CERR_VersionAlreadyIncluded , "Only one VERSION or store(version) line allowed in a source file."}, + { CERR_70FeatureOnly , "This feature requires store(version) '7.0' or higher"}, + { CERR_80FeatureOnly , "This feature requires store(version) '8.0' or higher"}, + { CERR_InvalidInVirtualKeySection , "This statement is not valid in a virtual key section"}, + { CERR_InvalidIf , "The if() statement is not valid"}, + { CERR_InvalidReset , "The reset() statement is not valid"}, + { CERR_InvalidSet , "The set() statement is not valid"}, + { CERR_InvalidSave , "The save() statement is not valid"}, + { CERR_InvalidEthnologueCode , "Invalid ethnologuecode format"}, + { CERR_90FeatureOnly_IfSystemStores , "if(store) requires store(version) '9.0' or higher"}, + { CERR_IfSystemStore_NotFound , "System store in if() not found"}, + { CERR_90FeatureOnly_SetSystemStores , "set(store) requires store(version) '9.0' or higher"}, + { CERR_SetSystemStore_NotFound , "System store in set() not found"}, + { CERR_90FeatureOnlyVirtualKeyDictionary , "Custom virtual key names require store(version) '9.0'"}, + { CERR_InvalidIndex , "Invalid 'index' command"}, + { CERR_OutsInVirtualKeySection , "'outs' command is illegal in virtual key section"}, + { CERR_InvalidOuts , "Invalid 'outs' command"}, + { CERR_ContextInVirtualKeySection , "'context' command is illegal in virtual key section"}, + { CERR_InvalidUse , "Invalid 'use' command"}, + { CERR_GroupDoesNotExist , "Group does not exist"}, + { CERR_VirtualKeyNotAllowedHere , "Virtual key is not allowed here"}, + { CERR_InvalidSwitch , "Invalid 'switch' command"}, + { CERR_NoTokensFound , "No tokens found in line"}, + { CERR_InvalidLineContinuation , "Invalid line continuation"}, + { CERR_LineTooLong , "Line too long"}, + { CERR_InvalidCopyright , "Invalid 'copyright' command"}, + { CERR_CodeInvalidInThisSection , "This line is invalid in this section of the file"}, + { CERR_InvalidMessage , "Invalid 'message' command"}, + { CERR_InvalidLanguageName , "Invalid 'languagename' command"}, + { CERR_EndOfFile , "(no error - reserved code)"}, + { CERR_InvalidToken , "Invalid token found"}, + { CERR_InvalidBegin , "Invalid 'begin' command"}, + { CERR_InvalidName , "Invalid 'name' command"}, + { CERR_InvalidVersion , "Invalid 'version' command"}, + { CERR_InvalidLanguageLine , "Invalid 'language' command"}, + { CERR_LayoutButNoLanguage , "Layout command found but no language command"}, + { CERR_CannotCreateTempfile , "Cannot create temp file"}, + { CERR_90FeatureOnlyLayoutFile , "Touch layout file reference requires store(version) '9.0'or higher"}, + { CERR_90FeatureOnlyKeyboardVersion , "KeyboardVersion system store requires store(version) '9.0'or higher"}, + { CERR_KeyboardVersionFormatInvalid , "KeyboardVersion format is invalid, expecting dot-separated integers"}, + { CERR_ContextExHasInvalidOffset , "context() statement has offset out of range"}, + { CERR_90FeatureOnlyEmbedCSS , "Embedding CSS requires store(version) '9.0'or higher"}, + { CERR_90FeatureOnlyTargets , "TARGETS system store requires store(version) '9.0'or higher"}, + { CERR_ContextAndIndexInvalidInMatchNomatch , "context and index statements cannot be used in a match or nomatch statement"}, + { CERR_140FeatureOnlyContextAndNotAnyWeb , "For web and touch platforms, context() statement referring to notany() requires store(version) '14.0'or higher"}, + { CERR_ExpansionMustFollowCharacterOrVKey , "An expansion must follow a character or a virtual key"}, + { CERR_VKeyExpansionMustBeFollowedByVKey , "A virtual key expansion must be terminated by a virtual key"}, + { CERR_CharacterExpansionMustBeFollowedByCharacter , "A character expansion must be terminated by a character key"}, + { CERR_VKeyExpansionMustUseConsistentShift , "A virtual key expansion must use the same shift state for both terminators"}, + { CERR_ExpansionMustBePositive , "An expansion must have positive difference (i.e. A-Z, not Z-A)"}, + { CERR_CasedKeysMustContainOnlyVirtualKeys , "The &CasedKeys system store must contain only virtual keys or characters found on a US English keyboard"}, + { CERR_CasedKeysMustNotIncludeShiftStates , "The &CasedKeys system store must not include shift states"}, + { CERR_CasedKeysNotSupportedWithMnemonicLayout , "The &CasedKeys system store is not supported with mnemonic layouts"}, + { CERR_CannotUseReadWriteGroupFromReadonlyGroup , "Group used from a readonly group must also be readonly"}, + { CERR_StatementNotPermittedInReadonlyGroup , "Statement is not permitted in output of readonly group"}, + { CERR_OutputInReadonlyGroup , "Output is not permitted in a readonly group"}, + { CERR_NewContextGroupMustBeReadonly , "Group used in begin newContext must be readonly"}, + { CERR_PostKeystrokeGroupMustBeReadonly , "Group used in begin postKeystroke must be readonly"}, + { CERR_DuplicateGroup , "A group with this name has already been defined."}, + { CERR_DuplicateStore , "A store with this name has already been defined."}, + { CERR_RepeatedBegin , "Begin has already been set"}, + + { CHINT_FilenameHasDifferingCase , "Casing differences may fail on some platforms: "}, + { CHINT_UnreachableRule , "This rule will never be matched as another rule takes precedence"}, + + { CWARN_TooManyWarnings , "Too many warnings or errors"}, + { CWARN_OldVersion , "The keyboard file is an old version"}, + { CWARN_BitmapNotUsed , "The 'bitmaps' statement is obsolete and only the first bitmap referred to will be used, you should use 'bitmap'."}, + { CWARN_CustomLanguagesNotSupported , "Languages over 0x1FF, 0x1F are not supported correctly by Windows. You should use no LANGUAGE line instead."}, + { CWARN_KeyBadLength , "There are too many characters in the keystroke part of the rule."}, + { CWARN_IndexStoreShort , "The store referenced in index() is shorter than the store referenced in any()"}, + { CWARN_UnicodeInANSIGroup , "A Unicode character was found in an ANSI group"}, + { CWARN_ANSIInUnicodeGroup , "An ANSI character was found in a Unicode group"}, + { CWARN_UnicodeSurrogateUsed , "A Unicode surrogate character was found. You should use Unicode scalar values to represent values > U+FFFF"}, + { CWARN_ReservedCharacter , "A Unicode character was found that should not be used"}, + { CWARN_Info , "Information"}, + { CWARN_VirtualKeyWithMnemonicLayout , "Virtual key used instead of virtual character key with a mnemonic layout"}, + { CWARN_VirtualCharKeyWithPositionalLayout , "Virtual character key used with a positional layout instead of mnemonic layout"}, + { CWARN_StoreAlreadyUsedAsOptionOrCall , "Store already used as an option or in a call statement and should not be used as a normal store"}, + { CWARN_StoreAlreadyUsedAsStoreOrCall , "Store already used as a normal store or in a call statement and should not be used as an option"}, + { CWARN_StoreAlreadyUsedAsStoreOrOption , "Store already used as a normal store or as an option and should not be used in a call statement"}, + { CWARN_PunctuationInEthnologueCode , "Punctuation should not be used to separate Ethnologue codes; instead use spaces"}, + { CWARN_PlatformNotInTargets , "The specified platform is not a target platform"}, + { CWARN_HeaderStatementIsDeprecated , "Header statements are deprecated; use instead the equivalent system store"}, + { CWARN_UseNotLastStatementInRule , "A rule with use() statements in the output should not have other content following the use() statements"}, + { CWARN_KVKFileIsInSourceFormat , ".kvk file should be binary but is an XML file"}, + { CWARN_DontMixChiralAndNonChiralModifiers , "Don't mix the use of left/right modifiers with non-left/right modifiers in the same platform"}, + { CWARN_MixingLeftAndRightModifiers , "Left and right modifiers should not both be used in the same rule"}, + { CWARN_LanguageHeadersDeprecatedInKeyman10 , "This language header has been deprecated in Keyman 10. Instead, add language metadata in the package file"}, + { CWARN_HotkeyHasInvalidModifier , "Hotkey has modifiers that are not supported. Use only SHIFT, CTRL and ALT"}, + { CWARN_NulNotFirstStatementInContext , "nul must be the first statement in the context"}, + { CWARN_IfShouldBeAtStartOfContext , "if, platform and baselayout should be at start of context (after nul, if present)"}, + { CWARN_KeyShouldIncludeNCaps , "Other rules which reference this key include CAPS or NCAPS modifiers, so this rule must include NCAPS modifier to avoid inconsistent matches"}, + { CWARN_MissingFile , "The referenced file could not be found: "}, + + { 0, nullptr } + }; + +KMX_CHAR *GetCompilerErrorString(KMX_DWORD code) +{ + for(int i = 0; CompilerErrors[i].ErrorCode; i++) { + if(CompilerErrors[i].ErrorCode == code) { + return ( KMX_CHAR*) CompilerErrors[i].Text; + } + } + return nullptr; +} diff --git a/developer/src/kmcmplib/src/CompMsg.h b/developer/src/kmcmplib/src/CompMsg.h new file mode 100644 index 0000000000000000000000000000000000000000..5517ea88112251f73b36f902884ec564e5de2376 --- /dev/null +++ b/developer/src/kmcmplib/src/CompMsg.h @@ -0,0 +1,5 @@ + +#include "km_types.h" +#include + +KMX_CHAR *GetCompilerErrorString(KMX_DWORD code) ; diff --git a/developer/src/kmcmplib/src/Compiler.cpp b/developer/src/kmcmplib/src/Compiler.cpp new file mode 100644 index 0000000000000000000000000000000000000000..06e707e7ea1153f7738f3a1d8b52b94931a5a29c --- /dev/null +++ b/developer/src/kmcmplib/src/Compiler.cpp @@ -0,0 +1,3520 @@ +/* + Name: Compiler + Copyright: Copyright (C) SIL International. + Documentation: + Description: + Create Date: 20 Jun 2006 + + Modified Date: 25 Oct 2016 + Authors: mcdurdin + Related Files: + Dependencies: + + Bugs: + Todo: + Notes: + History: 20 Jun 2006 - mcdurdin - Initial version + 23 Aug 2006 - mcdurdin - Add VISUALKEYBOARD, KMW_RTL, KMW_HELPFILE, KMW_HELPTEXT, KMW_EMBEDJS system stores + 14 Sep 2006 - mcdurdin - Support icons in version 7 + 28 Sep 2006 - mcdurdin - Added product validation + 28 Sep 2006 - mcdurdin - Added test for version 7.0 icon support + 06 Oct 2006 - mcdurdin - Fix buffer overflow in UTF8 conversion + 04 Dec 2006 - mcdurdin - Fix readfile buffer bug + 04 Jan 2007 - mcdurdin - Add notany support + 22 Jan 2007 - mcdurdin - Add K_NPENTER reference + 25 Jan 2007 - mcdurdin - Resize buffers to 4095 + 30 May 2007 - mcdurdin - I786 - Compiler crash if zero length string in keystroke any + 23 Aug 2007 - mcdurdin - I1011 - Fix buffer clobbering for UTF8 conversion of large files + 27 Mar 2008 - mcdurdin - I1358 - Support for multiple languages for office config + 14 Jun 2008 - mcdurdin - Support documenting language id as a single WORD instead of by PRIMARY/SUB + 14 Jun 2008 - mcdurdin - Support Windows languages list + 28 Jul 2008 - mcdurdin - I1569 - line prefixes + 22 Mar 2010 - mcdurdin - Compiler fixup - x64 support + 25 May 2010 - mcdurdin - I1632 - Keyboard Options + 24 Jun 2010 - mcdurdin - I2432 - Use local buffers so GetXString can be re-entrant (used by if()) + 26 Jul 2010 - mcdurdin - I2467 - 8.0 renumber + 18 Mar 2011 - mcdurdin - I2646 - Compiler warning on invalid Ethnologue codes + 18 Mar 2011 - mcdurdin - I2525 - Unterminated string can crash compiler + 19 Jul 2011 - mcdurdin - I2993 - Named code constants cause a warning 0x208D to appear + 26 Jun 2012 - mcdurdin - I3377 - KM9 - Update code references from 8.0 to 9.0 + 17 Aug 2012 - mcdurdin - I3431 - V9.0 - Spaces in values in if comparisons break the compiler parser + 27 Aug 2012 - mcdurdin - I3439 - V9.0 - Refactor xstring support in C++ code + 27 Aug 2012 - mcdurdin - I3437 - V9.0 - Add support for set(&layer) and layer() + 27 Aug 2012 - mcdurdin - I3438 - V9.0 - Add support for custom virtual keys + 27 Aug 2012 - mcdurdin - I3430 - V9.0 - Add support for if(&platform) and if(&baselayout) to compilers + 27 Aug 2012 - mcdurdin - I3440 - V9.0 - Tidy up set statement delimiter recognition + 24 Oct 2012 - mcdurdin - I3483 - V9.0 - Add support for compiling in the layout file + 24 Oct 2012 - mcdurdin - I3481 - V9.0 - Eliminate unsafe calls in C++ + 24 Jan 2012 - mcdurdin - I3137 - If key part of VK rule is missing, compiler generates invalid file + 06 Feb 2012 - mcdurdin - I3228 - kmcmpdll sometimes tries to write temp files to Program Files + 03 Nov 2012 - mcdurdin - I3510 - V9.0 - Merge of I3228 - kmcmpdll sometimes tries to write temp files to Program Files + 03 Nov 2012 - mcdurdin - I3511 - V9.0 - Merge of I3137 - If key part of VK rule is missing, compiler generates invalid file + 13 Dec 2012 - mcdurdin - I3654 - V9.0 - Compiler appears to create unregistered keyboards even when registered + 13 Dec 2012 - mcdurdin - I3641 - V9.0 - compiler dll buffer overrun bugs + 13 Dec 2012 - mcdurdin - I3681 - V9.0 - KeymanWeb compiler should output formatted js when debug=1 + 13 Dec 2012 - mcdurdin - I3686 - V9.0 - AddStore attaches property flags to wrong store structure + 19 Mar 2014 - mcdurdin - I4140 - V9.0 - Add keyboard version information to keyboards + 04 Nov 2014 - mcdurdin - I4504 - V9.0 - Consolidate the compile action into single command + 02 Jul 2015 - mcdurdin - I4784 - Compiler does not recognise baselayout, layer or platform at the start of a line + 02 Jul 2015 - mcdurdin - I4785 - baselayout(), layer() and platform() produce incorrect compiled code + 24 Aug 2015 - mcdurdin - I4865 - Add treat hints and warnings as errors into project + 24 Aug 2015 - mcdurdin - I4866 - Add warn on deprecated features to project and compile + 24 Aug 2015 - mcdurdin - I4867 - Add test for code after use warning to compile + 06 Nov 2015 - mcdurdin - I4914 - kmcmpdll does not pick an index() statement that has an offset one past the key + 23 Feb 2016 - mcdurdin - I4982 - Defined character constants cannot be referenced correctly in other stores + 25 Oct 2016 - mcdurdin - I5135 - Remove product and licensing references from Developer projects +*/ +#include "pch.h" + +#include + +#include "compfile.h" +#include +#include "../../../../common/windows/cpp/include/vkeys.h" +#include +#include "versioning.h" +#include "kmcmplib.h" +#include "DeprecationChecks.h" + +#include "virtualcharkeys.h" + +// TODO: These three should be under common/cpp/include -- not windows specific +#include "../../../../common/windows/cpp/include/keymanversion.h" +#include "../../../../common/windows/cpp/include/crc32.h" +#include "../../../../common/windows/cpp/include/ConvertUTF.h" + +#include "debugstore.h" +#include "NamedCodeConstants.h" + +#include "xstring.h" + +#include "Edition.h" + +#include "CharToKeyConversion.h" +#include "CasedKeys.h" +#include +#include +#include "CheckFilenameConsistency.h" +#include "UnreachableRules.h" +#include "CheckForDuplicates.h" +#include "kmx_u16.h" +#include "filesystem.h" +#include + +/* These macros are adapted from winnt.h and legacy use only */ +#define MAKELANGID(p, s) ((((uint16_t)(s)) << 10) | (uint16_t)(p)) +#define PRIMARYLANGID(lgid) ((uint16_t)(lgid) & 0x3ff) +#define SUBLANGID(lgid) ((uint16_t)(lgid) >> 10) + +#define COMPILE_ERROR_MAX_LEN (SZMAX_ERRORTEXT + 1 + 280) + +using namespace kmcmp; + + char ErrExtraLIB[ERR_EXTRA_LIB_LEN]; + KMX_WCHAR ErrExtraW[ERR_EXTRA_W_LEN]; + KMX_BOOL AWarnDeprecatedCode_GLOBAL_LIB; + +namespace kmcmp{ + KMX_BOOL FShouldAddCompilerVersion = TRUE; + KMX_BOOL FSaveDebug, FCompilerWarningsAsErrors; // I4865 // I4866 + int ErrChr; + int nErrors = 0; + KMX_BOOL FMnemonicLayout = FALSE; + KMX_BOOL FOldCharPosMatching = FALSE; + int CompileTarget; + KMX_CHAR CompileDir[260]; // TODO: this should not be a fixed buffer + int BeginLine[4]; + + KMX_BOOL IsValidCallStore(PFILE_STORE fs); + KMX_BOOL CheckStoreUsage(PFILE_KEYBOARD fk, int storeIndex, KMX_BOOL fIsStore, KMX_BOOL fIsOption, KMX_BOOL fIsCall); + KMX_DWORD UTF32ToUTF16(int n, int *n1, int *n2); + KMX_DWORD CheckUTF16(int n); + int cmpkeys(const void *key, const void *elem); +} + +int xatoi(PKMX_WCHAR *p); +int atoiW(PKMX_WCHAR p); +void safe_wcsncpy(PKMX_WCHAR out, PKMX_WCHAR in, int cbMax); +int GetDeadKey(PFILE_KEYBOARD fk, PKMX_WCHAR p); + +KMX_BOOL IsSameToken(PKMX_WCHAR *p, KMX_WCHAR const * token); +KMX_DWORD GetRHS(PFILE_KEYBOARD fk, PKMX_WCHAR p, PKMX_WCHAR buf, int bufsize, int offset, int IsUnicode); +PKMX_WCHAR GetDelimitedString(PKMX_WCHAR *p, KMX_WCHAR const * Delimiters, KMX_WORD Flags); +KMX_DWORD GetXString(PFILE_KEYBOARD fk, PKMX_WCHAR str, KMX_WCHAR const * token, PKMX_WCHAR output, int max, int offset, PKMX_WCHAR *newp, int isVKey, int isUnicode); + +int GetGroupNum(PFILE_KEYBOARD fk, PKMX_WCHAR p); + +KMX_DWORD AddDebugStore(PFILE_KEYBOARD fk, KMX_WCHAR const * str); +KMX_DWORD ProcessKeyLine(PFILE_KEYBOARD fk, PKMX_WCHAR str, KMX_BOOL IsUnicode); +KMX_DWORD ProcessEthnologueStore(PKMX_WCHAR p); // I2646 +KMX_DWORD ProcessHotKey(PKMX_WCHAR p, KMX_DWORD *hk); +KMX_DWORD ImportBitmapFile(PFILE_KEYBOARD fk, PKMX_WCHAR szName, PKMX_DWORD FileSize, PKMX_BYTE *Buf); + +KMX_DWORD ExpandKp(PFILE_KEYBOARD fk, PFILE_KEY kpp, KMX_DWORD storeIndex); + +int GetVKCode(PFILE_KEYBOARD fk, PKMX_WCHAR p); // I3438 // TODO: Consolidate GetDeadKey and GetVKCode? +KMX_DWORD ProcessSystemStore(PFILE_KEYBOARD fk, KMX_DWORD SystemID, PFILE_STORE sp); + +KMX_DWORD process_if(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx); +KMX_DWORD process_reset(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx); +KMX_DWORD process_set(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx); +KMX_DWORD process_save(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx); +KMX_DWORD process_platform(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx); // I3430 +KMX_DWORD process_baselayout(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx); // I3430 +KMX_DWORD process_set_synonym(KMX_DWORD dwSystemID, PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx); // I3437 +KMX_DWORD process_expansion(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx, int max); + +KMX_BOOL IsValidKeyboardVersion(KMX_WCHAR *dpString); + +const KMX_WCHAR * LineTokens[] = { + u"SVNBHBGMNSCCLLCMLB", u"store", u"VERSION ", u"NAME ", + u"BITMAP ", u"HOTKEY ", u"begin", u"group", u"match", u"nomatch", + u"SHIFT FREES CAPS", u"CAPS ON ONLY", u"CAPS ALWAYS OFF", + u"LANGUAGE ", u"LAYOUT ", u"COPYRIGHT ", u"MESSAGE ", u"LANGUAGENAME ", + u"BITMAPS " }; + +#define SSN__PREFIX u"&" + +const KMX_WCHAR * StoreTokens[TSS__MAX + 2] = { + u"", + SSN__PREFIX u"BITMAP", + SSN__PREFIX u"COPYRIGHT", + SSN__PREFIX u"HOTKEY", + SSN__PREFIX u"LANGUAGE", + SSN__PREFIX u"LAYOUT", + SSN__PREFIX u"MESSAGE", + SSN__PREFIX u"NAME", + SSN__PREFIX u"VERSION", + SSN__PREFIX u"CAPSONONLY", + SSN__PREFIX u"CAPSALWAYSOFF", + SSN__PREFIX u"SHIFTFREESCAPS", + SSN__PREFIX u"LANGUAGENAME", + u"", + u"", + SSN__PREFIX u"ETHNOLOGUECODE", + u"", + SSN__PREFIX u"MNEMONICLAYOUT", + SSN__PREFIX u"INCLUDECODES", + SSN__PREFIX u"OLDCHARPOSMATCHING", + u"", + u"", + u"", + u"", + SSN__PREFIX u"VISUALKEYBOARD", + SSN__PREFIX u"KMW_RTL", + SSN__PREFIX u"KMW_HELPFILE", + SSN__PREFIX u"KMW_HELPTEXT", + SSN__PREFIX u"KMW_EMBEDJS", + SSN__PREFIX u"WINDOWSLANGUAGES", + u"", + SSN__PREFIX u"PLATFORM", // read only // I3430 + SSN__PREFIX u"BASELAYOUT", // read only // I3430 + SSN__PREFIX u"LAYER", // read-write via set? // I3430 + u"", // I3438 + SSN__PREFIX u"LAYOUTFILE", // I3483 + SSN__PREFIX u"KEYBOARDVERSION", // I4140 + SSN__PREFIX u"KMW_EMBEDCSS", + SSN__PREFIX u"TARGETS", // I4504 + SSN__PREFIX u"CASEDKEYS", // #2241 + SSN__PREFIX u"", // TSS_BEGIN_NEWCONTEXT + SSN__PREFIX u"", // TSS_BEGIN_POSTKEYSTROKE + SSN__PREFIX u"NEWLAYER", + SSN__PREFIX u"OLDLAYER", + NULL +}; + +static_assert(sizeof(StoreTokens) / sizeof(StoreTokens[0]) == TSS__MAX + 2, "StoreTokens should have exactly TSS__MAX+2 elements"); + +enum LinePrefixType { lptNone, lptKeymanAndKeymanWeb, lptKeymanWebOnly, lptKeymanOnly, lptOther }; + +/* Compile target */ + +kmcmp_CompilerMessageProc msgproc = NULL; +void* msgprocContext = NULL; + +int kmcmp::currentLine = 0; + +kmcmp::NamedCodeConstants *kmcmp::CodeConstants = NULL; + +PKMX_WCHAR strtowstr(PKMX_STR in) +{ + PKMX_WCHAR result; + + auto c = u16string_from_string(in); + + result = new KMX_WCHAR[c.length() + 1]; + u16cpy(result, c.c_str()); + return result; +} + +PKMX_STR wstrtostr(PKMX_WCHAR in) +{ + PKMX_STR result; + + auto c = string_from_u16string(in); + + result = new KMX_CHAR[c.length() + 1]; + strcpy(result, c.c_str()); + return result; +} + +KMX_BOOL kmcmp::AddCompileWarning(PKMX_CHAR buf) +{ + (*msgproc)(kmcmp::currentLine + 1, CWARN_Info, buf, msgprocContext); + return FALSE; +} + +KMX_BOOL AddCompileError(KMX_DWORD msg) +{ + KMX_CHAR szText[COMPILE_ERROR_MAX_LEN]; + KMX_CHAR* szTextp = NULL; + + if (msg & CERR_FATAL) + { + szTextp = GetCompilerErrorString(msg); + (*msgproc)(kmcmp::currentLine + 1, msg, szTextp, msgprocContext); + kmcmp::nErrors++; + return TRUE; + } + + if (msg & CERR_ERROR) + kmcmp::nErrors++; + szTextp = GetCompilerErrorString(msg); + + if (szTextp) { + strcpy(szText, szTextp); + } else { + snprintf(szText, COMPILE_ERROR_MAX_LEN, "Unknown error %x", msg); + } + + if (kmcmp::ErrChr > 0) { + char *szTextNull = strchr(szText, 0); + snprintf(szTextNull, COMPILE_ERROR_MAX_LEN-(szTextNull-szText), " character offset: %d", kmcmp::ErrChr); + } + + if (*ErrExtraLIB) { + char *szTextNull = strchr(szText, 0); + snprintf(szTextNull, COMPILE_ERROR_MAX_LEN-(szTextNull-szText), "%s", ErrExtraLIB); + } + + ErrChr = 0; *ErrExtraLIB =0; + if (!(*msgproc)(kmcmp::currentLine, msg, szText, msgprocContext)) return TRUE; + return FALSE; +} + +KMX_DWORD ProcessBeginLine(PFILE_KEYBOARD fk, PKMX_WCHAR p) +{ + KMX_WCHAR tstr[128]; + PKMX_WCHAR q, pp; + int BeginMode; + KMX_DWORD msg; + + pp = p; + + q = ( PKMX_WCHAR) u16chr(p, '>'); + if (!q) return CERR_NoTokensFound; + + while (iswspace(*p)) p++; + if (u16nicmp(p, u"unicode", 7) == 0) BeginMode = BEGIN_UNICODE; + else if (u16nicmp(p, u"ansi", 4) == 0) BeginMode = BEGIN_ANSI; + else if (u16nicmp(p, u"newContext", 10) == 0) BeginMode = BEGIN_NEWCONTEXT; + else if (u16nicmp(p, u"postKeystroke", 13) == 0) BeginMode = BEGIN_POSTKEYSTROKE; + else if (*p != '>') return CERR_InvalidToken; + else BeginMode = BEGIN_ANSI; + + if(kmcmp::BeginLine[BeginMode] != -1) { + return CERR_RepeatedBegin; + } + + kmcmp::BeginLine[BeginMode] = kmcmp::currentLine; + + if ((msg = GetRHS(fk, p, tstr, 80, (int)(p - pp), FALSE)) != CERR_None) return msg; + + if (tstr[0] != UC_SENTINEL || tstr[1] != CODE_USE) { + return CERR_InvalidBegin; + } + if (tstr[3] != 0) { + return CERR_InvalidToken; + } + + if (BeginMode == BEGIN_ANSI || BeginMode == BEGIN_UNICODE) { + fk->StartGroup[BeginMode] = tstr[2] - 1; + //mcd-03-01-2000: removed the secondary group idea; this was undocumented and + //is not supported under Keyman 5.0: ugly!! + //if(tstr[3] == UC_SENTINEL && tstr[4] == CODE_USE) fk->StartGroup[1] = tstr[5] - 1; + + if (kmcmp::FSaveDebug) { + /* Record a system store for the line number of the begin statement */ + AddDebugStore(fk, BeginMode == BEGIN_UNICODE ? DEBUGSTORE_BEGIN u"Unicode" : DEBUGSTORE_BEGIN u"ANSI"); + } + } + else { + PFILE_GROUP gp = &fk->dpGroupArray[tstr[2] - 1]; + if (!gp->fReadOnly) { + return BeginMode == BEGIN_NEWCONTEXT ? + CERR_NewContextGroupMustBeReadonly : + CERR_PostKeystrokeGroupMustBeReadonly; + } + return AddStore(fk, BeginMode == BEGIN_NEWCONTEXT ? TSS_BEGIN_NEWCONTEXT : TSS_BEGIN_POSTKEYSTROKE, tstr, NULL); + } + + + + return CERR_None; +} + +KMX_DWORD ValidateMatchNomatchOutput(PKMX_WCHAR p) { + while (p && *p) { + if (*p == UC_SENTINEL) { + switch (*(p + 1)) { + case CODE_CONTEXT: + case CODE_CONTEXTEX: + case CODE_INDEX: + return CERR_ContextAndIndexInvalidInMatchNomatch; + } + } + p = incxstr(p); + } + return CERR_None; +} + +KMX_DWORD ParseLine(PFILE_KEYBOARD fk, PKMX_WCHAR str) +{ + PKMX_WCHAR p, q, pp; + PFILE_GROUP gp; + KMX_DWORD msg; + int IsUnicode = TRUE; // For NOW! + + KMX_WCHAR sep[2] = u"\n"; + PKMX_WCHAR p_sep =sep; + p = str; + pp = str; + + switch (LineTokenType(&p)) + { + case T_BLANK: + case T_COMMENT: + break; // Ignore the line + case T_VERSION: + case T_STORE: + break; // The line has already been processed + + case T_BEGIN: + // after a begin can be "Unicode" or "ANSI" or nothing (=ANSI) + if ((msg = ProcessBeginLine(fk, p)) != CERR_None) return msg; + break; + + case T_GROUP: + if (fk->currentGroup == 0xFFFFFFFF) fk->currentGroup = 0; + else + { + if ((msg = ProcessGroupFinish(fk)) != CERR_None) return msg; // finish off previous group first? + fk->currentGroup++; + } + // if( (err = ProcessGroupLine( fk, p )) != CERR_None ) return err; + break; + + case T_NAME: + kmcmp::WarnDeprecatedHeader(); // I4866 + q = GetDelimitedString(&p, u"\"\"", 0); + if (!q) return CERR_InvalidName; + + if ((msg = AddStore(fk, TSS_NAME, q)) != CERR_None) return msg; + break; + + case T_COPYRIGHT: + kmcmp::WarnDeprecatedHeader(); // I4866 + q = GetDelimitedString(&p, u"\"\"", 0); + if (!q) return CERR_InvalidCopyright; + + if ((msg = AddStore(fk, TSS_COPYRIGHT, q)) != CERR_None) return msg; + break; + + case T_MESSAGE: + kmcmp::WarnDeprecatedHeader(); // I4866 + q = GetDelimitedString(&p, u"\"\"", 0); + if (!q) return CERR_InvalidMessage; + + if ((msg = AddStore(fk, TSS_MESSAGE, q)) != CERR_None) return msg; + break; + + case T_LANGUAGENAME: + kmcmp::WarnDeprecatedHeader(); // I4866 + q = GetDelimitedString(&p, u"\"\"", 0); + if (!q) return CERR_InvalidLanguageName; + + if ((msg = AddStore(fk, TSS_LANGUAGENAME, q)) != CERR_None) return msg; + break; + + case T_LANGUAGE: + { + kmcmp::WarnDeprecatedHeader(); // I4866 + KMX_WCHAR *tokcontext = NULL; + q = u16tok(p, p_sep, &tokcontext); // I3481 + + if ((msg = AddStore(fk, TSS_LANGUAGE, q)) != CERR_None) return msg; + break; + } + case T_LAYOUT: + { + kmcmp::WarnDeprecatedHeader(); // I4866 + KMX_WCHAR *tokcontext = NULL; + q = u16tok(p, p_sep, &tokcontext); // I3481 + if ((msg = AddStore(fk, TSS_LAYOUT, q)) != CERR_None) return msg; + break; + } + case T_CAPSOFF: + kmcmp::WarnDeprecatedHeader(); // I4866 + if ((msg = AddStore(fk, TSS_CAPSALWAYSOFF, u"1")) != CERR_None) return msg; + break; + + case T_CAPSON: + kmcmp::WarnDeprecatedHeader(); // I4866 + if ((msg = AddStore(fk, TSS_CAPSONONLY, u"1")) != CERR_None) return msg; + break; + + case T_SHIFT: + kmcmp::WarnDeprecatedHeader(); // I4866 + if ((msg = AddStore(fk, TSS_SHIFTFREESCAPS, u"1")) != CERR_None) return msg; + break; + + case T_HOTKEY: + { + kmcmp::WarnDeprecatedHeader(); // I4866 + KMX_WCHAR *tokcontext = NULL; + if ((q = u16tok(p, p_sep, &tokcontext)) == NULL) return CERR_CodeInvalidInThisSection; // I3481 + if ((msg = AddStore(fk, TSS_HOTKEY, q)) != CERR_None) return msg; + break; + } + case T_BITMAP: + { + kmcmp::WarnDeprecatedHeader(); // I4866 + KMX_WCHAR *tokcontext = NULL; + if ((q = u16tok(p, p_sep, &tokcontext)) == NULL) return CERR_InvalidBitmapLine; // I3481 + + while (iswspace(*q)) q++; + if (*q == '"') { + p = q; + q = GetDelimitedString(&p, u"\"\"", 0); + if (!q) return CERR_InvalidBitmapLine; + } + + if ((msg = AddStore(fk, TSS_BITMAP, q)) != CERR_None) return msg; + break; + } + case T_BITMAPS: + { + kmcmp::WarnDeprecatedHeader(); // I4866 + KMX_WCHAR *tokcontext = NULL; + AddWarning(CWARN_BitmapNotUsed); + + if ((q = u16tok(p, p_sep, &tokcontext)) == NULL) return CERR_InvalidBitmapLine; // I3481 + + if ((PKMX_WCHAR) u16chr(q, ',')) *(PKMX_WCHAR) u16chr(q, ',') = 0; + if ((msg = AddStore(fk, TSS_BITMAP, q)) != CERR_None) return msg; + + break; + } + case T_KEYTOKEY: // A rule + if (fk->currentGroup == 0xFFFFFFFF) return CERR_CodeInvalidInThisSection; + if ((msg = ProcessKeyLine(fk, p, IsUnicode)) != CERR_None) return msg; + break; + + case T_MATCH: + if (fk->currentGroup == 0xFFFFFFFF) return CERR_CodeInvalidInThisSection; + { + PKMX_WCHAR buf = new KMX_WCHAR[GLOBAL_BUFSIZE]; + if ((msg = GetRHS(fk, p, buf, GLOBAL_BUFSIZE - 1, (int)(p - pp), IsUnicode)) != CERR_None) + { + delete[] buf; + return msg; + } + + if ((msg = ValidateMatchNomatchOutput(buf)) != CERR_None) { + delete[] buf; + return msg; + } + + gp = &fk->dpGroupArray[fk->currentGroup]; + + gp->dpMatch = new KMX_WCHAR[u16len(buf) + 1]; + u16ncpy(gp->dpMatch, buf, u16len(buf) + 1); // I3481 + + delete[] buf; + + if (kmcmp::FSaveDebug) + { + KMX_WCHAR tstr[128]; + //swprintf(tstr, "%d", fk->currentGroup); + /* Record a system store for the line number of the begin statement */ + //wcscpy(tstr, DEBUGSTORE_MATCH); + u16sprintf(tstr, _countof(tstr), L"%ls%d ", u16fmt(DEBUGSTORE_MATCH).c_str(), (int) fk->currentGroup); + u16ncat(tstr, gp->szName, _countof(tstr)); + + AddDebugStore(fk, tstr); + } + } + break; + + case T_NOMATCH: + if (fk->currentGroup == 0xFFFFFFFF) return CERR_CodeInvalidInThisSection; + { + PKMX_WCHAR buf = new KMX_WCHAR[GLOBAL_BUFSIZE]; + if ((msg = GetRHS(fk, p, buf, GLOBAL_BUFSIZE, (int)(p - pp), IsUnicode)) != CERR_None) + { + delete[] buf; + return msg; + } + + if ((msg = ValidateMatchNomatchOutput(buf)) != CERR_None) { + delete[] buf; + return msg; + } + + gp = &fk->dpGroupArray[fk->currentGroup]; + + gp->dpNoMatch = new KMX_WCHAR[u16len(buf) + 1]; + u16ncpy(gp->dpNoMatch, buf, u16len(buf) + 1); // I3481 + + delete[] buf; + + if (kmcmp::FSaveDebug) + { + KMX_WCHAR tstr[128]; + /* Record a system store for the line number of the begin statement */ + u16sprintf(tstr, _countof(tstr), L"%ls%d ", u16fmt(DEBUGSTORE_NOMATCH).c_str(), (int) fk->currentGroup); + u16ncat(tstr, gp->szName, _countof(tstr)); + AddDebugStore(fk, tstr); + } + } + break; + + default: + return CERR_InvalidToken; + } + + return CERR_None; +} + +//********************************************************************************************************************** + +KMX_DWORD ProcessGroupLine(PFILE_KEYBOARD fk, PKMX_WCHAR p) +{ + PFILE_GROUP gp; + PKMX_WCHAR q; + + gp = new FILE_GROUP[fk->cxGroupArray + 1]; + if (!gp) return CERR_CannotAllocateMemory; + + if (fk->dpGroupArray) + { + memcpy(gp, fk->dpGroupArray, sizeof(FILE_GROUP) * fk->cxGroupArray); + delete fk->dpGroupArray; + } + + fk->dpGroupArray = gp; + gp = &fk->dpGroupArray[fk->cxGroupArray]; + fk->cxGroupArray++; + + gp->dpKeyArray = NULL; + gp->dpMatch = NULL; + gp->dpNoMatch = NULL; + gp->cxKeyArray = 0; + + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q) return CERR_InvalidGroupLine; + + gp->fUsingKeys = FALSE; + gp->fReadOnly = IsSameToken(&p, u"readonly"); + if (!gp->fReadOnly) { + if (IsSameToken(&p, u"using") && IsSameToken(&p, u"keys")) + gp->fUsingKeys = TRUE; + } + + safe_wcsncpy(gp->szName, q, SZMAX_GROUPNAME); + + gp->Line = kmcmp::currentLine; + + if (kmcmp::FSaveDebug) + { + KMX_WCHAR tstr[128]; + /* Record a system store for the line number of the begin statement */ + u16sprintf(tstr, _countof(tstr), L"%ls%d ", u16fmt(DEBUGSTORE_GROUP).c_str(), fk->cxGroupArray - 1); + u16ncat(tstr, gp->szName, _countof(tstr)); + AddDebugStore(fk, tstr); + } + + return CheckForDuplicateGroup(fk, gp); +} + +int kmcmp::cmpkeys(const void *key, const void *elem) +{ + PFILE_KEY akey; + PFILE_KEY aelem; + int l1, l2; + KMX_WCHAR char_key, char_elem; + akey = (PFILE_KEY)key; + aelem = (PFILE_KEY)elem; + char_key = kmcmp::VKToChar(akey->Key, akey->ShiftFlags); + char_elem = kmcmp::VKToChar(aelem->Key, aelem->ShiftFlags); + if (char_key == char_elem) //akey->Key == aelem->Key) + { + l1 = xstrlen(akey->dpContext); l2 = xstrlen(aelem->dpContext); + if (l1 == l2) + { + if (akey->Line < aelem->Line) return -1; + if (akey->Line > aelem->Line) return 1; + if(akey->Key == aelem->Key) { + if(akey->ShiftFlags == aelem->ShiftFlags) { + return akey->LineStoreIndex - aelem->LineStoreIndex; + } + return akey->ShiftFlags - aelem->ShiftFlags; + } + return akey->Key - aelem->Key; + } + if (l1 < l2) return 1; + if (l1 > l2) return -1; + if(akey->Key == aelem->Key) { + if(akey->ShiftFlags == aelem->ShiftFlags) { + return akey->LineStoreIndex - aelem->LineStoreIndex; + } + return akey->ShiftFlags - aelem->ShiftFlags; + } + return akey->Key - aelem->Key; + } + return(char_key - char_elem); // akey->Key - aelem->Key); +} + +KMX_DWORD ProcessGroupFinish(PFILE_KEYBOARD fk) +{ + PFILE_GROUP gp; + KMX_DWORD msg; + + if (fk->currentGroup == 0xFFFFFFFF) return CERR_None; + // Just got to first group - so nothing to finish yet + + gp = &fk->dpGroupArray[fk->currentGroup]; + + // Finish off the previous group stuff! + if ((msg = ExpandCapsRulesForGroup(fk, gp)) != CERR_None) return msg; + qsort(gp->dpKeyArray, gp->cxKeyArray, sizeof(FILE_KEY), kmcmp::cmpkeys); + + return VerifyUnreachableRules(gp); +} + +/*************************************** +* Store management +*/ + +KMX_DWORD ProcessStoreLine(PFILE_KEYBOARD fk, PKMX_WCHAR p) +{ + PKMX_WCHAR q, pp; + PFILE_STORE sp; + //WCHAR temp[GLOBAL_BUFSIZE]; + KMX_DWORD msg; + int i = 0; + + pp = p; + + if ((q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL)) == NULL) return CERR_InvalidStoreLine; + + if (*q == *SSN__PREFIX) + { + for (i = 0; StoreTokens[i]; i++) + if (!u16icmp(q, StoreTokens[i])) // I3481 + break; + if (!StoreTokens[i]) return CERR_InvalidSystemStore; + } + + sp = new FILE_STORE[fk->cxStoreArray + 1]; + if (!sp) return CERR_CannotAllocateMemory; + + if (fk->dpStoreArray) + { + memcpy(sp, fk->dpStoreArray, sizeof(FILE_STORE) * fk->cxStoreArray); + delete fk->dpStoreArray; + } + + fk->dpStoreArray = sp; + sp = &fk->dpStoreArray[fk->cxStoreArray]; + + sp->line = kmcmp::currentLine; + sp->fIsOption = FALSE; + sp->fIsReserved = FALSE; + sp->fIsStore = FALSE; + sp->fIsDebug = FALSE; + sp->fIsCall = FALSE; + + safe_wcsncpy(sp->szName, q, SZMAX_STORENAME); + { + PKMX_WCHAR temp = new KMX_WCHAR[GLOBAL_BUFSIZE]; + + if ((msg = GetXString(fk, p, u"c\n", temp, GLOBAL_BUFSIZE - 1, (int)(p - pp), &p, FALSE, TRUE)) != CERR_None) + { + delete[] temp; + return msg; + } + + sp->dwSystemID = i; + sp->dpString = new KMX_WCHAR[u16len(temp) + 1]; + u16ncpy(sp->dpString, temp, u16len(temp) + 1); // I3481 + + delete[] temp; + } + + if (xstrlen(sp->dpString) == 1 && *sp->dpString != UC_SENTINEL && + sp->dwSystemID == 0 && (fk->version >= VERSION_60 || fk->version == 0)) + { + // In this case, we want to change behaviour for older versioned keyboards so that + // we don't mix up named character codes which weren't supported in 5.x + VERIFY_KEYBOARD_VERSION(fk, VERSION_60, CERR_60FeatureOnly_NamedCodes); + // Add a single char store as a defined character constant + if (Uni_IsSurrogate1(*sp->dpString)) + kmcmp::CodeConstants->AddCode(Uni_SurrogateToUTF32(sp->dpString[0], sp->dpString[1]), sp->szName, fk->cxStoreArray); + else + kmcmp::CodeConstants->AddCode(sp->dpString[0], sp->szName, fk->cxStoreArray); + kmcmp::CodeConstants->reindex(); // has to be done after every character add due to possible use in another store. // I4982 + } + + fk->cxStoreArray++; // increment now, because GetXString refers to stores + + if (i > 0) + if ((msg = ProcessSystemStore(fk, i, sp)) != CERR_None) return msg; + + return CheckForDuplicateStore(fk, sp); +} + +KMX_DWORD AddStore(PFILE_KEYBOARD fk, KMX_DWORD SystemID, KMX_WCHAR const * str, KMX_DWORD *dwStoreID) +{ + PFILE_STORE sp; + sp = new FILE_STORE[fk->cxStoreArray + 1]; + if (!sp) return CERR_CannotAllocateMemory; + + if (fk->dpStoreArray) + { + memcpy(sp, fk->dpStoreArray, sizeof(FILE_STORE) * fk->cxStoreArray); + delete fk->dpStoreArray; + } + + fk->dpStoreArray = sp; + sp = &fk->dpStoreArray[fk->cxStoreArray]; + + sp->line = kmcmp::currentLine; + sp->fIsOption = FALSE; // I3686 + sp->fIsReserved = (SystemID != TSS_NONE); + sp->fIsStore = FALSE; + sp->fIsDebug = FALSE; + sp->fIsCall = FALSE; + + safe_wcsncpy(sp->szName, (PKMX_WCHAR) StoreTokens[SystemID], SZMAX_STORENAME); + + sp->dpString = new KMX_WCHAR[u16len(str) + 1]; + u16ncpy(sp->dpString, str, u16len(str) + 1); // I3481 + + sp->dwSystemID = SystemID; + + if (dwStoreID) *dwStoreID = fk->cxStoreArray; + + fk->cxStoreArray++; + + return ProcessSystemStore( fk, SystemID, sp); +} + +KMX_DWORD AddDebugStore(PFILE_KEYBOARD fk, KMX_WCHAR const * str) +{ + PFILE_STORE sp; + KMX_WCHAR tstr[16]; + u16sprintf(tstr, _countof(tstr), L"%d", kmcmp::currentLine); // I3481 + + sp = new FILE_STORE[fk->cxStoreArray + 1]; + if (!sp) return CERR_CannotAllocateMemory; + + if (fk->dpStoreArray) + { + memcpy(sp, fk->dpStoreArray, sizeof(FILE_STORE) * fk->cxStoreArray); + delete[] fk->dpStoreArray; + } + + fk->dpStoreArray = sp; + sp = &fk->dpStoreArray[fk->cxStoreArray]; + + safe_wcsncpy(sp->szName, (PKMX_WCHAR) str, SZMAX_STORENAME); + + sp->dpString = new KMX_WCHAR[u16len(tstr) + 1]; + u16ncpy(sp->dpString, tstr, u16len(tstr) + 1); // I3481 + sp->line = 0; + sp->fIsOption = FALSE; + sp->fIsReserved = TRUE; + sp->fIsStore = FALSE; + sp->fIsDebug = TRUE; + sp->fIsCall = FALSE; + sp->dwSystemID = TSS_DEBUG_LINE; + fk->cxStoreArray++; + + return CERR_None; +} + +PKMX_WCHAR pssBuf = NULL; + +KMX_DWORD ProcessSystemStore(PFILE_KEYBOARD fk, KMX_DWORD SystemID, PFILE_STORE sp) +{ + //WCHAR buf[GLOBAL_BUFSIZE]; + int i, j; + KMX_DWORD msg; + PKMX_WCHAR p, q; + KMX_CHAR *pp; + + if (!pssBuf) pssBuf = new KMX_WCHAR[GLOBAL_BUFSIZE]; + PKMX_WCHAR buf = pssBuf; + + switch (SystemID) + { + case TSS_BITMAP: + if ((msg = ImportBitmapFile(fk, sp->dpString, &fk->dwBitmapSize, &fk->lpBitmap)) != CERR_None) + return msg; + break; + + case TSS_CALLDEFINITION: + break; + + case TSS_CALLDEFINITION_LOADFAILED: + break; + + case TSS_CAPSALWAYSOFF: + if (*sp->dpString == u'1') fk->dwFlags |= KF_CAPSALWAYSOFF; + break; + + case TSS_CAPSONONLY: + if (*sp->dpString == u'1') fk->dwFlags |= KF_CAPSONONLY; + break; + + case TSS_COMPILEDVERSION: + break; + + case TSS_COPYRIGHT: + break; + + case TSS_DEBUG_LINE: + break; + + case TSS_ETHNOLOGUECODE: + VERIFY_KEYBOARD_VERSION(fk, VERSION_60, CERR_60FeatureOnly_EthnologueCode); + if ((msg = ProcessEthnologueStore(sp->dpString)) != CERR_None) return msg; // I2646 + break; + + case TSS_HOTKEY: + if ((msg = ProcessHotKey(sp->dpString, &fk->dwHotKey)) != CERR_None) return msg; + u16sprintf(buf, GLOBAL_BUFSIZE, L"%d", (int)fk->dwHotKey); // I3481 + delete[] sp->dpString; + sp->dpString = new KMX_WCHAR[u16len(buf) + 1]; + u16ncpy(sp->dpString, buf, u16len(buf) + 1); // I3481 + break; + + case TSS_INCLUDECODES: + VERIFY_KEYBOARD_VERSION(fk, VERSION_60, CERR_60FeatureOnly_NamedCodes); + pp = wstrtostr(sp->dpString); + if (!kmcmp::CodeConstants->LoadFile(pp)) + { + delete[] pp; + return CERR_CannotLoadIncludeFile; + } + delete[] pp; + kmcmp::CodeConstants->reindex(); // I4982 + break; + + case TSS_LANGUAGE: + { + KMX_WCHAR *context = NULL; + KMX_WCHAR sep_c[3] = u", "; + PKMX_WCHAR p_sep_c = sep_c; + q = u16tok(sp->dpString, p_sep_c, &context); // I3481 + if (!q) return CERR_InvalidLanguageLine; + + i = xatoi(&q); + KMX_WCHAR sep_n[4] = u" c\n"; + PKMX_WCHAR p_sep_n = sep_n; + q = u16tok(NULL, p_sep_n, &context); // I3481 + if (!q) + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_70, CERR_InvalidLanguageLine); + j = SUBLANGID(i); + i = PRIMARYLANGID(i); + } + else + j = xatoi(&q); + + if (i < 1 || j < 1 || i > 0x3FF || j > 0x3F) return CERR_InvalidLanguageLine; + if (i >= 0x200 || j >= 0x20) AddWarning(CWARN_CustomLanguagesNotSupported); + + fk->KeyboardID = (KMX_DWORD)MAKELANGID(i, j); + + u16sprintf(buf, GLOBAL_BUFSIZE, L"%x %x", i, j); // I3481 + delete[] sp->dpString; + sp->dpString = new KMX_WCHAR[u16len(buf) + 1]; + u16ncpy(sp->dpString, buf, u16len(buf) + 1); // I3481 + + break; + } + case TSS_LANGUAGENAME: + break; + + case TSS_LAYOUT: + if (fk->KeyboardID == 0) return CERR_LayoutButNoLanguage; + + q = sp->dpString; + + fk->KeyboardID |= (xatoi(&q) << 16L); + break; + + case TSS_MESSAGE: + break; + + case TSS_MNEMONIC: + VERIFY_KEYBOARD_VERSION(fk, VERSION_60, CERR_60FeatureOnly_MnemonicLayout); + kmcmp::FMnemonicLayout = atoiW(sp->dpString) == 1; + if (kmcmp::FMnemonicLayout && FindSystemStore(fk, TSS_CASEDKEYS) != NULL) { + // The &CasedKeys system store is not supported for + // mnemonic layouts + return CERR_CasedKeysNotSupportedWithMnemonicLayout; + } + break; + + case TSS_NAME: + break; + + case TSS_OLDCHARPOSMATCHING: + VERIFY_KEYBOARD_VERSION(fk, VERSION_60, CERR_60FeatureOnly_OldCharPosMatching); + kmcmp::FOldCharPosMatching = atoiW(sp->dpString); + break; + + case TSS_SHIFTFREESCAPS: + if (*sp->dpString == u'1') fk->dwFlags |= KF_SHIFTFREESCAPS; + break; + + case TSS_VERSION: + if ((fk->dwFlags & KF_AUTOMATICVERSION) == 0) return CERR_VersionAlreadyIncluded; + p = sp->dpString; + if (u16tof (p) < 5.0) { + AddWarning(CWARN_OldVersion); + } + + if (u16ncmp(p, u"3.0", 3) == 0) fk->version = VERSION_50; //0x0a0b000n= a.bn + else if (u16ncmp(p, u"3.1", 3) == 0) fk->version = VERSION_50; //all versions < 5.0 + else if (u16ncmp(p, u"3.2", 3) == 0) fk->version = VERSION_50; //we compile as if + else if (u16ncmp(p, u"4.0", 3) == 0) fk->version = VERSION_50; //they are 5.0.100.0 + else if (u16ncmp(p, u"5.01", 4) == 0) fk->version = VERSION_501; + else if (u16ncmp(p, u"5.0", 3) == 0) fk->version = VERSION_50; + else if (u16ncmp(p, u"6.0", 3) == 0) fk->version = VERSION_60; + else if (u16ncmp(p, u"7.0", 3) == 0) fk->version = VERSION_70; + else if (u16ncmp(p, u"8.0", 3) == 0) fk->version = VERSION_80; + else if (u16ncmp(p, u"9.0", 3) == 0) fk->version = VERSION_90; + else if (u16ncmp(p, u"10.0", 4) == 0) fk->version = VERSION_100; + else if (u16ncmp(p, u"14.0", 4) == 0) fk->version = VERSION_140; // Adds support for #917 -- context() with notany() for KeymanWeb + else if (u16ncmp(p, u"15.0", 4) == 0) fk->version = VERSION_150; // Adds support for U_xxxx_yyyy #2858 + + else return CERR_InvalidVersion; + + if (fk->version < VERSION_60) kmcmp::FOldCharPosMatching = TRUE; + + fk->dwFlags &= ~KF_AUTOMATICVERSION; + + break; + + case TSS_VISUALKEYBOARD: + VERIFY_KEYBOARD_VERSION(fk, VERSION_70, CERR_70FeatureOnly); + { + // Strip path from the store, leaving bare filename only + p = sp->dpString; + + KMX_WCHAR *pp2 = (KMX_WCHAR*) u16rchr_slash((const PKMX_WCHAR) p); + + if (!pp2) { + pp2 = p; + } else { + pp2++; + } + q = new KMX_WCHAR[u16len(pp2) + 1]; + u16ncpy(q, pp2, u16len(pp2) + 1); + + // Change compiled reference file extension to .kvk + pp2 = ( km_kbp_cp *) u16chr(q, 0) - 5; + if (pp2 > q && u16icmp(pp2, u".kvks") == 0) { + pp2[4] = 0; + } + + delete[] sp->dpString; + sp->dpString = q; + + if ((msg = CheckFilenameConsistency( (sp->dpString), FALSE)) != CERR_None) { + return msg; + } + } + break; + case TSS_KMW_RTL: + case TSS_KMW_HELPTEXT: + VERIFY_KEYBOARD_VERSION(fk, VERSION_70, CERR_70FeatureOnly); + break; + + case TSS_KMW_HELPFILE: + case TSS_KMW_EMBEDJS: + VERIFY_KEYBOARD_VERSION(fk, VERSION_70, CERR_70FeatureOnly); + if ((msg = CheckFilenameConsistency(sp->dpString, FALSE)) != CERR_None) { + return msg; + } + break; + + case TSS_KMW_EMBEDCSS: + VERIFY_KEYBOARD_VERSION(fk, VERSION_90, CERR_90FeatureOnlyEmbedCSS); + if ((msg = CheckFilenameConsistency(sp->dpString, FALSE)) != CERR_None) { + return msg; + } + break; + + case TSS_TARGETS: // I4504 + VERIFY_KEYBOARD_VERSION(fk, VERSION_90, CERR_90FeatureOnlyTargets); + break; + + case TSS_WINDOWSLANGUAGES: + { + KMX_WCHAR *context = NULL; + VERIFY_KEYBOARD_VERSION(fk, VERSION_70, CERR_70FeatureOnly); + size_t szQ = u16len(sp->dpString) * 6 + 1; // I3481 + q = new KMX_WCHAR[szQ]; // guaranteed to be enough space for recoding + *q = 0; KMX_WCHAR *r = q; + KMX_WCHAR sep_s[4] = u" "; + PKMX_WCHAR p_sep_s = sep_s; + p = u16tok(sp->dpString, p_sep_s, &context); // I3481 + while (p) + { + int n = xatoi(&p); + + j = SUBLANGID(n); + i = PRIMARYLANGID(n); + + if (i < 1 || j < 1 || i > 0x3FF || j > 0x3F) { + delete[] q; + return CERR_InvalidLanguageLine; + } + + u16sprintf(r, szQ - (size_t)(r - q), L"x%04.4x ", n); // I3481 + p = u16tok(NULL, sep_s, &context); // I3481 + r = (KMX_WCHAR*) u16chr(q, 0); // I3481 + } + delete[] sp->dpString; + if (*q) { + *((KMX_WCHAR*) u16chr(q, 0) - 1) = 0; // delete final space - safe because we control the formatting - ugly? scared? + } + sp->dpString = q; + break; + } + case TSS_COMPARISON: + VERIFY_KEYBOARD_VERSION(fk, VERSION_80, CERR_80FeatureOnly); + break; + + case TSS_VKDICTIONARY: // I3438 + VERIFY_KEYBOARD_VERSION(fk, VERSION_90, CERR_90FeatureOnlyVirtualKeyDictionary); + break; + + case TSS_LAYOUTFILE: // I3483 + VERIFY_KEYBOARD_VERSION(fk, VERSION_90, CERR_90FeatureOnlyLayoutFile); // I4140 + if ((msg = CheckFilenameConsistency(sp->dpString, FALSE)) != CERR_None) { + return msg; + } + // Used by KMW compiler + break; + + case TSS_KEYBOARDVERSION: // I4140 + VERIFY_KEYBOARD_VERSION(fk, VERSION_90, CERR_90FeatureOnlyKeyboardVersion); + if (!IsValidKeyboardVersion(sp->dpString)) { + return CERR_KeyboardVersionFormatInvalid; + } + break; + + case TSS_CASEDKEYS: + if ((msg = VerifyCasedKeys(sp)) != CERR_None) { + return msg; + } + break; + + case TSS_BEGIN_NEWCONTEXT: + case TSS_BEGIN_POSTKEYSTROKE: + break; + + case TSS_NEWLAYER: + case TSS_OLDLAYER: + break; + + default: + return CERR_InvalidSystemStore; + } + return CERR_None; +} + +KMX_BOOL IsValidKeyboardVersion(KMX_WCHAR *dpString) { // I4140 + /* version format \d+(\.\d+)* e.g. 9.0.3, 1.0, 1.2.3.4, 6.2.1.4.6.4, blank is not allowed */ + + do { + if (!iswdigit(*dpString)) { + return FALSE; + } + while (iswdigit(*dpString)) { + dpString++; + } + if (*dpString == '.') { + dpString++; + if (!iswdigit(*dpString)) { + return FALSE; + } + } + } while (*dpString != 0); + + return TRUE; +} + + +KMX_DWORD kmcmp::AddCompilerVersionStore(PFILE_KEYBOARD fk) +{ + KMX_DWORD msg; + + if(!kmcmp::FShouldAddCompilerVersion) { + return CERR_None; + } + + if ((msg = AddStore(fk, TSS_COMPILEDVERSION, KEYMAN_VersionWin_W16)) != CERR_None) return msg; + + return CERR_None; +} + +/**************************** +* Rule lines +*/ + +KMX_DWORD CheckStatementOffsets(PFILE_KEYBOARD fk, PFILE_GROUP gp, PKMX_WCHAR context, PKMX_WCHAR output, PKMX_WCHAR key) { + PKMX_WCHAR p, q; + int i; + for (p = output; *p; p = incxstr(p)) { + if (*p == UC_SENTINEL) { + if (*(p + 1) == CODE_INDEX) { + int indexStore = *(p + 2) - 1; + int contextOffset = *(p + 3); + for (q = context, i = 1; *q && i < contextOffset; q = incxstr(q), i++); + + if (*q == 0) { + if (!gp->fUsingKeys) + // no key in the rule, so offset is past end of context + return CERR_IndexDoesNotPointToAny; + if (i < contextOffset) // I4914 + // offset is beyond the key + return CERR_IndexDoesNotPointToAny; + q = key; + } + + // find the any + if (*q != UC_SENTINEL || *(q + 1) != CODE_ANY) + return CERR_IndexDoesNotPointToAny; + + int anyStore = *(q + 2) - 1; + + if (xstrlen(fk->dpStoreArray[indexStore].dpString) < xstrlen(fk->dpStoreArray[anyStore].dpString)) { + AddWarning(CWARN_IndexStoreShort); //TODO: if this fails, then we return FALSE instead of an error + } + } else if (*(p + 1) == CODE_CONTEXTEX) { + int contextOffset = *(p + 2); + if (contextOffset > xstrlen(context)) + return CERR_ContextExHasInvalidOffset; + + // Due to a limitation in earlier versions of KeymanWeb, the minimum version + // for context() referring to notany() is 14.0. See #917 for details. + if (kmcmp::CompileTarget == CKF_KEYMANWEB) { + for (q = context, i = 1; *q && i < contextOffset; q = incxstr(q), i++); + if (*q == UC_SENTINEL && *(q + 1) == CODE_NOTANY) { + VERIFY_KEYBOARD_VERSION(fk, VERSION_140, CERR_140FeatureOnlyContextAndNotAnyWeb); + } + } + } + } + } + return CERR_None; +} + +/** + *Checks that the order of statements in the context matches the specification + * Rule structure: [context] ['+' key] '>' output + * Context structure: [nul] [if()|baselayout()|platform()]+ [char|any|context()|deadkey()|dk()|index()|notany()|outs()] + * Test that nul is first, then if(), baselayout(), platform() statements are before any other content + */ +KMX_BOOL CheckContextStatementPositions(PKMX_WCHAR context) { + KMX_BOOL hadContextChar = FALSE; + for (PKMX_WCHAR p = context; *p; p = incxstr(p)) { + if (*p == UC_SENTINEL) { + switch (*(p + 1)) { + case CODE_NUL: + if (p > context) { + AddWarningBool(CWARN_NulNotFirstStatementInContext); + } + break; + case CODE_IFOPT: + case CODE_IFSYSTEMSTORE: + if (hadContextChar) { + AddWarningBool(CWARN_IfShouldBeAtStartOfContext); + } + break; + default: + hadContextChar = TRUE; + } + } + else { + hadContextChar = TRUE; + } + } + + return TRUE; +} +/** + * Checks if a use() statement is followed by other content in the output of a rule + */ +KMX_DWORD CheckUseStatementsInOutput(PKMX_WCHAR output) { + KMX_BOOL hasUse = FALSE; + PKMX_WCHAR p; + for (p = output; *p; p = incxstr(p)) { + if (*p == UC_SENTINEL && *(p + 1) == CODE_USE) { + hasUse = TRUE; + } else if (hasUse) { + AddWarning(CWARN_UseNotLastStatementInRule); + break; + } + } + return CERR_None; +} + +/** + * Adds implicit `context` to start of output of rules for readonly groups + */ +KMX_DWORD InjectContextToReadonlyOutput(PKMX_WCHAR pklOut) { + if (pklOut[0] != UC_SENTINEL || pklOut[1] != CODE_CONTEXT) { + if (u16len(pklOut) > GLOBAL_BUFSIZE - 3) { + return CERR_CannotAllocateMemory; + } + memmove(pklOut + 2, pklOut, (u16len(pklOut) + 1) * 2); + pklOut[0] = UC_SENTINEL; + pklOut[1] = CODE_CONTEXT; + } + return CERR_None; +} + +/** + * Verifies that a keyboard does not attempt to emit characters or + * other changes to text store when processing a readonly group + */ +KMX_DWORD CheckOutputIsReadonly(const PFILE_KEYBOARD fk, const PKMX_WCHAR output) { // I4867 + PKMX_WCHAR p; + for (p = output; *p; p = incxstr(p)) { + if (*p != UC_SENTINEL) { + return CERR_OutputInReadonlyGroup; + } + switch (*(p + 1)) { + case CODE_CALL: + // We cannot be sure that the callee is going to be readonly + // but we have to operate on a trust basis for call() in any + // case, so we'll allow it. + continue; + case CODE_USE: + // We only allow use() of other readonly groups + { + PFILE_GROUP targetGroup = &fk->dpGroupArray[*(p + 2) - 1]; + if (!targetGroup->fReadOnly) { + return CERR_CannotUseReadWriteGroupFromReadonlyGroup; + } + } + continue; + case CODE_SETOPT: + case CODE_RESETOPT: + case CODE_SAVEOPT: + // it is okay to set, reset or save keyboard options + // although it's hard to see good use cases for this + continue; + case CODE_SETSYSTEMSTORE: + // it is okay to set system stores; Engine or Core will + // ignore set(&) that are not permissible in the given context + continue; + case CODE_CONTEXT: + // We allow `context` but only as the very first statement in output + if (p == output) { + continue; + } + return CERR_OutputInReadonlyGroup; + default: + // Note: conceptually, CODE_NUL could be transformed to CODE_CONTEXT + // if the context was also empty, but it is probably safest to avoid this, + // given CODE_CONTEXT does what we need anyway + return CERR_StatementNotPermittedInReadonlyGroup; + } + } + return CERR_None; +} + +KMX_DWORD ProcessKeyLineImpl(PFILE_KEYBOARD fk, PKMX_WCHAR str, KMX_BOOL IsUnicode, PKMX_WCHAR pklIn, PKMX_WCHAR pklKey, PKMX_WCHAR pklOut); + +KMX_DWORD ProcessKeyLine(PFILE_KEYBOARD fk, PKMX_WCHAR str, KMX_BOOL IsUnicode) +{ + PKMX_WCHAR pklIn, pklKey, pklOut; + + pklIn = new KMX_WCHAR[GLOBAL_BUFSIZE]; // I2432 - Allocate buffers each line -- slightly slower but safer than keeping a single buffer + pklKey = new KMX_WCHAR[GLOBAL_BUFSIZE]; + pklOut = new KMX_WCHAR[GLOBAL_BUFSIZE]; + if (!pklIn || !pklKey || !pklOut) + return CERR_CannotAllocateMemory; // forget about the little leak if pklKey or pklOut fail... + + KMX_DWORD result = ProcessKeyLineImpl(fk, str, IsUnicode, pklIn, pklKey, pklOut); + + delete[] pklIn; // I2432 - Allocate buffers each line -- slightly slower but safer than keeping a single buffer + delete[] pklKey; + delete[] pklOut; + + return result; +} + +KMX_DWORD ProcessKeyLineImpl(PFILE_KEYBOARD fk, PKMX_WCHAR str, KMX_BOOL IsUnicode, PKMX_WCHAR pklIn, PKMX_WCHAR pklKey, PKMX_WCHAR pklOut) { + PKMX_WCHAR p, pp; + KMX_DWORD msg; + PFILE_GROUP gp; + PFILE_KEY kp; + + gp = &fk->dpGroupArray[fk->currentGroup]; + + pp = str; + + if (gp->fUsingKeys) { + if ((msg = GetXString(fk, str, u"+", pklIn, GLOBAL_BUFSIZE - 1, (int)(str - pp), &p, TRUE, IsUnicode)) != CERR_None) return msg; + + str = p + 1; + if ((msg = GetXString(fk, str, u">", pklKey, GLOBAL_BUFSIZE - 1, (int)(str - pp), &p, TRUE, IsUnicode)) != CERR_None) return msg; + if (pklKey[0] == 0) return CERR_ZeroLengthString; + if (xstrlen(pklKey) > 1) AddWarning(CWARN_KeyBadLength); + } else { + if ((msg = GetXString(fk, str, u">", pklIn, GLOBAL_BUFSIZE - 1, (int)(str - pp), &p, TRUE, IsUnicode)) != CERR_None) return msg; + if (pklIn[0] == 0) return CERR_ZeroLengthString; + } + + str = p + 1; + if ((msg = GetXString(fk, str, u"c\n", pklOut, GLOBAL_BUFSIZE - 1, (int)(str - pp), &p, TRUE, IsUnicode)) != CERR_None) return msg; + + if (pklOut[0] == 0) return CERR_ZeroLengthString; + + CheckContextStatementPositions(pklIn); + + // Test index and context offsets in context + if ((msg = CheckStatementOffsets(fk, gp, pklIn, pklOut, pklKey)) != CERR_None) return msg; + + // Test that use() statements are not followed by other content + if ((msg = CheckUseStatementsInOutput(pklOut)) != CERR_None) { + return msg; // I4867 + } + + if (gp->fReadOnly) { + // Ensure no output is made from the rule, and that + // use() statements meet required readonly semantics + if ((msg = CheckOutputIsReadonly(fk, pklOut)) != CERR_None) { + return msg; + } + + // Inject `context` to start of output if group is readonly + // to keep the output internally consistent + if ((msg = InjectContextToReadonlyOutput(pklOut)) != CERR_None) { + return msg; + } + } + + kp = new FILE_KEY[gp->cxKeyArray + 1]; + if (!kp) return CERR_CannotAllocateMemory; + if (gp->dpKeyArray) + { + memcpy(kp, gp->dpKeyArray, gp->cxKeyArray * sizeof(FILE_KEY)); + delete gp->dpKeyArray; + } + + gp->dpKeyArray = kp; + kp = &gp->dpKeyArray[gp->cxKeyArray]; + + gp->cxKeyArray++; + + kp->dpOutput = new KMX_WCHAR[u16len(pklOut) + 1]; + u16ncpy(kp->dpOutput, pklOut, u16len(pklOut) + 1); // I3481 + + kp->dpContext = new KMX_WCHAR[u16len(pklIn) + 1]; + u16ncpy(kp->dpContext, pklIn, u16len(pklIn) + 1); // I3481 + + kp->Line = kmcmp::currentLine; + kp->LineStoreIndex = 0; + + // Finished if we are not using keys + + if (!gp->fUsingKeys) + { + kp->Key = 0; + kp->ShiftFlags = 0; + return CERR_None; + } + + // Expand each rule out into multiple rules - much faster processing at the key hit time + + if (*pklKey == 0) return CERR_ZeroLengthString; + + if (*pklKey == UC_SENTINEL) + switch (*(pklKey + 1)) + { + case CODE_ANY: + kp->ShiftFlags = 0; + if ((msg = ExpandKp(fk, kp, *(pklKey + 2) - 1)) != CERR_None) return msg; + break; + + case CODE_EXTENDED: + kp->Key = *(pklKey + 3); + kp->ShiftFlags = *(pklKey + 2); + break; + + default: + return CERR_InvalidCodeInKeyPartOfRule; + } + else + { + kp->ShiftFlags = 0; + kp->Key = *pklKey; + } + + return CERR_None; +} + + + +KMX_DWORD ExpandKp_ReplaceIndex(PFILE_KEYBOARD fk, PFILE_KEY k, KMX_DWORD keyIndex, int nAnyIndex) +{ + /* Replace each index(xx,keyIndex) in k->dpOutput with appropriate char as based on nAnyIndex */ + PFILE_STORE s; + int i; + PKMX_WCHAR pIndex, pStore; + + for (pIndex = k->dpOutput; *pIndex; pIndex = incxstr(pIndex)) + { + if (*pIndex == UC_SENTINEL && *(pIndex + 1) == CODE_INDEX && *(pIndex + 3) == keyIndex) + { + s = &fk->dpStoreArray[*(pIndex + 2) - 1]; + for (i = 0, pStore = s->dpString; i < nAnyIndex; i++, pStore = incxstr(pStore)); + PKMX_WCHAR qStore = incxstr(pStore); + + int w = (int)(qStore - pStore); + if (w > 4) + { + *pIndex = UC_SENTINEL; + *(pIndex + 1) = CODE_BEEP; + memmove(pIndex + 2, pIndex + 4, u16len(pIndex + 3) * 2); + } + else + { + memcpy(pIndex, pStore, w * 2); + if (w < 4) memmove(pIndex + w, pIndex + 4, u16len(pIndex + 3) * 2); + } + } + } + + return CERR_None; +} + + +KMX_DWORD ExpandKp(PFILE_KEYBOARD fk, PFILE_KEY kpp, KMX_DWORD storeIndex) +{ + PFILE_KEY k; + PKMX_WCHAR pn; + KMX_DWORD nchrs, n; + int keyIndex; + + PFILE_STORE sp = &fk->dpStoreArray[storeIndex]; + PFILE_GROUP gp = &fk->dpGroupArray[fk->currentGroup]; + + PKMX_WCHAR dpContext = kpp->dpContext; + PKMX_WCHAR dpOutput = kpp->dpOutput; + + nchrs = xstrlen(sp->dpString); + pn = sp->dpString; + keyIndex = xstrlen(dpContext) + 1; + + /* + Now we change them to plain characters in the output in multiple rules, + and set the keystroke to the appropriate character in the store. + */ + + k = new FILE_KEY[gp->cxKeyArray + nchrs - 1]; + if (!k) return CERR_CannotAllocateMemory; + memcpy(k, gp->dpKeyArray, gp->cxKeyArray * sizeof(FILE_KEY)); + + kpp = &k[(int)(kpp - gp->dpKeyArray)]; + + delete gp->dpKeyArray; + gp->dpKeyArray = k; + gp->cxKeyArray += nchrs - 1; + + for (k = kpp, n = 0, pn = sp->dpString; *pn; pn = incxstr(pn), k++, n++) + { + k->dpContext = new KMX_WCHAR[u16len(dpContext) + 1]; + k->dpOutput = new KMX_WCHAR[u16len(dpOutput) + 1]; + + u16ncpy(k->dpContext, dpContext, u16len(dpContext) + 1); // copy the context. // I3481 + u16ncpy(k->dpOutput, dpOutput, u16len(dpOutput) + 1); // copy the output. + + if (*pn == UC_SENTINEL) + { + switch (*(pn + 1)) + { + case CODE_EXTENDED: + k->Key = *(pn + 3); // set the key to store offset. + k->ShiftFlags = *(pn + 2); + break; + default: + return CERR_CodeInvalidInKeyStore; + } + } + else + { + k->Key = *pn; // set the key to store offset. + k->ShiftFlags = 0; + } + k->Line = kpp->Line; + k->LineStoreIndex = n; + ExpandKp_ReplaceIndex(fk, k, keyIndex, n); + } + + delete dpContext; + delete dpOutput; + + return CERR_None; +} + + +PKMX_WCHAR GetDelimitedString(PKMX_WCHAR *p, KMX_WCHAR const * Delimiters, KMX_WORD Flags) +{ + PKMX_WCHAR q, r; + KMX_WCHAR dOpen, dClose; + + dOpen = *Delimiters; dClose = *(Delimiters + 1); + + q = *p; + while (iswspace(*q)) q++; //***QUERY + + if (*q != dOpen) return NULL; + + q++; + + r = xstrchr(q, &dClose); // Find closing delimiter + if (!r) return NULL; + + if (Flags & GDS_CUTLEAD) + while (iswspace(*q)) q++; // cut off leading spaces + + if (Flags & GDS_CUTFOLL) + if (!iswspace(*(r - 1))) *r = 0; + else + { + r--; // Cut off following spaces + while (iswspace(*r) && r > q) r--; + r++; + *r = 0; r = xstrchr((r + 1), &dClose); + } + else *r = 0; + + r++; while (iswspace(*r)) r++; // Ignore spaces after the close + if (*r == 0) r--; // Safety for terminating strings. + + *p = r; // Update pointer position + + return q; // Return delimited string +} + +#ifndef __iswcsym +#define __iswcsym(_c) (iswalnum(_c) || ((_c)=='_')) +#endif + +LinePrefixType GetLinePrefixType(PKMX_WCHAR *p) +{ + PKMX_WCHAR s = *p; + + while (iswspace(*s)) s++; + + PKMX_WCHAR q = s; + + if (*s != '$') return lptNone; + + /* I1569 - fix named constants at the start of the line */ + s++; + while (__iswcsym(*s)) s++; + if (*s != ':') return lptNone; + + if (u16nicmp(q, u"$keyman:", 8) == 0) + { + *p += 8; + return lptKeymanAndKeymanWeb; + } + if (u16nicmp(q, u"$keymanweb:", 11) == 0) + { + *p += 11; + return lptKeymanWebOnly; + } + if (u16nicmp(q, u"$keymanonly:", 12) == 0) + { + *p += 12; + return lptKeymanOnly; + } + + return lptOther; +} + +int LineTokenType(PKMX_WCHAR *str) +{ + int i; + size_t l; + PKMX_WCHAR p = *str; + + LinePrefixType lpt = GetLinePrefixType(&p); + if (lpt == lptOther) return T_BLANK; + + /* Test KeymanWeb, Keyman and KeymanOnly prefixes */ + if (kmcmp::CompileTarget == CKF_KEYMAN && lpt == lptKeymanWebOnly) return T_BLANK; + if (kmcmp::CompileTarget == CKF_KEYMANWEB && lpt == lptKeymanOnly) return T_BLANK; + + while (iswspace(*p)) p++; + + if (u16chr(LineTokens[0], towupper(*p))) + for (i = 0; i <= T_W_END - T_W_START; i++) + { + l = u16len(LineTokens[i + 1]); + if (u16nicmp(p, LineTokens[i + 1], l) == 0) + { + p += l; while (iswspace(*p)) p++; *str = p; + return i + T_W_START; + } + } + + switch (towupper(*p)) + { + case 'C': + if (iswspace(*(p + 1))) return T_COMMENT; + break; + case 0: + return T_BLANK; + default: + if (u16chr(u"\"aAbBlLpPnN[OoxXdD0123456789\'+UuiI$", *p)) // I4784 + { + *str = p; + return T_KEYTOKEY; + } + } + return T_UNKNOWN; +} + +KMX_WCHAR const * DeadKeyChars = +u"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_"; + +KMX_BOOL StrValidChrs(PKMX_WCHAR q, KMX_WCHAR const * chrs) +{ + for (; *q; q++) + if (!u16chr(chrs, *q)) return FALSE; + return TRUE; +} + +KMX_DWORD GetXStringImpl(PKMX_WCHAR tstr, PFILE_KEYBOARD fk, PKMX_WCHAR str, KMX_WCHAR const * token, + PKMX_WCHAR output, int max, int offset, PKMX_WCHAR *newp, int isUnicode +); + +KMX_DWORD GetXString(PFILE_KEYBOARD fk, PKMX_WCHAR str, KMX_WCHAR const * token, + PKMX_WCHAR output, int max, int offset, PKMX_WCHAR *newp, int /*isVKey*/, int isUnicode +) { + PKMX_WCHAR tstr = new KMX_WCHAR[max]; // I2432 - Allocate buffers each line -- slightly slower but safer than keeping a single buffer - GetXString is re-entrant with if() + KMX_DWORD err = GetXStringImpl(tstr, fk, str, token, output, max, offset, newp, isUnicode); + delete[] tstr; + return err; +} + +KMX_DWORD GetXStringImpl(PKMX_WCHAR tstr, PFILE_KEYBOARD fk, PKMX_WCHAR str, KMX_WCHAR const * token, + PKMX_WCHAR output, int max, int offset, PKMX_WCHAR *newp, int isUnicode +) { + KMX_DWORD err; + PKMX_WCHAR p = str, q, r; + int type, mx = 0, n, n1, n2, tokenFound = FALSE, z, sFlag = 0, j; + KMX_DWORD i; + KMX_BOOL finished = FALSE; + KMX_WCHAR c; + + *tstr = 0; + + *output = 0; + + p = str; + do + { + tokenFound = FALSE; + while (iswspace(*p) && !u16chr(token, *p)) p++; + if (!*p) break; + + ErrChr = (int)(p - str) + offset + 1; + + /* + char *tokenTypes[] = { + "clearcontext", "deadkey", "context", "return", "switch", + "index", "outs", "beep", "nul", "use", "any", "fix", "dk", "k_", "x", "d", "c", + "[", "]" }; + */ + + switch (towupper(*p)) + { + case 'X': + case 'D': type = 0; break; // xFF, d130: chars, deadkey(n) + case '\"': type = 1; break; // "xxxx": chars + case '\'': type = 2; break; // 'xxxx': chars + case 'A': type = 3; break; // any(s) + case 'B': type = 4; break; // beep, baselayout (synonym for if(&baselayout)) // I3430 + case 'I': type = 5; break; // index(s,n), if + case 'O': type = 6; break; // outs(s) + case 'C': type = 7; break; // context, comments, clearcontext, call(s) + case 'N': type = 8; break; // nul, notany + case 'U': type = 9; break; // use(g) + case 'R': type = 10; break; // return, reset + case '[': type = 11; break; // start of vkey section + //case ']': type = 12; break; // end of vkey section + //case 'K': type = 13; break; // virtual key name or "key" + case 'S': type = 14; break; // switch, set, save + case 'F': type = 15; break; // fix (synonym for clearcontext) + case '$': type = 16; break; // named code constants + case 'P': type = 17; break; // platform (synonym for if(&platform)) // I3430 + case 'L': type = 18; break; // layer (synonym for set(&layer)) // I3437 + case '.': type = 19; break; // .. allows us to specify ranges -- either vkeys or characters + default: + if (iswdigit(*p)) type = 0; // octal number + else type = 99; // error! + } + if (u16chr(token, *p)) tokenFound = TRUE; + + switch (type) + { + case 99: + if (tokenFound) break; + { + snprintf(ErrExtraLIB, ERR_EXTRA_LIB_LEN, "token: %c",(int)*p); + } + return CERR_InvalidToken; + case 0: + if (u16nicmp(p, u"deadkey", z = 7) == 0 || + u16nicmp(p, u"dk", z = 2) == 0) + { + p += z; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidDeadkey; + + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_DEADKEY; + if (!StrValidChrs(q, DeadKeyChars)) return CERR_InvalidDeadkey; + tstr[mx++] = GetDeadKey(fk, q); //atoiW(q); 7-5-01: named deadkeys + tstr[mx] = 0; + } + else + { + n = xatoi(&p); + if (*p != '\0' && !iswspace(*p)) return CERR_InvalidValue; + if ((err = kmcmp::UTF32ToUTF16(n, &n1, &n2)) != CERR_None) return err; + tstr[mx++] = n1; + if (n2 >= 0) tstr[mx++] = n2; + tstr[mx] = 0; + } + continue; + + case 1: + q = (PKMX_WCHAR) u16chr(p + 1, '\"'); + if (!q) return CERR_UnterminatedString; + if ((int)(q - p) - 1 + mx > max) return CERR_UnterminatedString; + if (sFlag) return CERR_StringInVirtualKeySection; + u16ncat(tstr, p + 1, (int)(q - p) - 1); // I3481 + mx += (int)(q - p) - 1; + tstr[mx] = 0; + p = q + 1; + continue; + case 2: + q = (PKMX_WCHAR) u16chr(p + 1, '\''); + if (!q) return CERR_UnterminatedString; + if ((int)(q - p) - 1 + mx > max) return CERR_UnterminatedString; + if (sFlag) return CERR_StringInVirtualKeySection; + u16ncat(tstr, p + 1, (int)(q - p) - 1); // I3481 + mx += (int)(q - p) - 1; + tstr[mx] = 0; + p = q + 1; + continue; + case 3: + if (u16nicmp(p, u"any", 3) != 0) return CERR_InvalidToken; + if (sFlag) return CERR_AnyInVirtualKeySection; + p += 3; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidAny; + + for (i = 0; i < fk->cxStoreArray; i++) + { + if (u16icmp(q, fk->dpStoreArray[i].szName) == 0) break; + } + if (i == fk->cxStoreArray) return CERR_StoreDoesNotExist; + + if (!*fk->dpStoreArray[i].dpString) return CERR_ZeroLengthString; + kmcmp::CheckStoreUsage(fk, i, TRUE, FALSE, FALSE); + + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_ANY; + tstr[mx++] = (KMX_WCHAR)i + 1; // store to index + 1, avoids End-of-string + tstr[mx] = 0; + continue; + case 4: + if (u16nicmp(p, u"beep", 4) == 0) + { + if (sFlag) return CERR_BeepInVirtualKeySection; + p += 4; + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_BEEP; + tstr[mx] = 0; + } + else if (u16nicmp(p, u"baselayout", 10) == 0) // I3430 + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_90, CERR_90FeatureOnly_IfSystemStores); + if (sFlag) return CERR_InvalidInVirtualKeySection; + p += 10; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidToken; + err = process_baselayout(fk, q, tstr, &mx); + if (err != CERR_None) return err; + } + else + return CERR_InvalidToken; + + continue; + case 5: + if (u16nicmp(p, u"if", 2) == 0) + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_80, CERR_80FeatureOnly); + if (sFlag) return CERR_InvalidInVirtualKeySection; + p += 2; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidIf; + + err = process_if(fk, q, tstr, &mx); + if (err != CERR_None) return err; + } + else + { + if (u16nicmp(p, u"index", 5) != 0) return CERR_InvalidToken; + if (sFlag) return CERR_IndexInVirtualKeySection; + p += 5; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + + if (!q || !*q) return CERR_InvalidIndex; + + { + KMX_WCHAR *context = NULL; + KMX_WCHAR sep_com[3] = u" ,"; + PKMX_WCHAR p_sep_com = sep_com; + r = u16tok(q, p_sep_com, &context); // I3481 + if (!r) return CERR_InvalidIndex; + + for (i = 0; i < fk->cxStoreArray; i++) + { + if (u16icmp(r, fk->dpStoreArray[i].szName) == 0) break; + } + if (i == fk->cxStoreArray) return CERR_StoreDoesNotExist; + + kmcmp::CheckStoreUsage(fk, i, TRUE, FALSE, FALSE); + + r = u16tok(NULL, p_sep_com, &context); // I3481 + if (!r) return CERR_InvalidIndex; + } + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_INDEX; + tstr[mx++] = (KMX_WCHAR)i + 1; // avoid EOS for stores + tstr[mx++] = atoiW(r); // character offset of original any. + + tstr[mx] = 0; + } + continue; + case 6: + if (u16nicmp(p, u"outs", 4) != 0) return CERR_InvalidToken; + if (sFlag) return CERR_OutsInVirtualKeySection; + p += 4; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidOuts; + + for (i = 0; i < fk->cxStoreArray; i++) + { + if (u16icmp(q, fk->dpStoreArray[i].szName) == 0) break; + } + if (i == fk->cxStoreArray) return CERR_StoreDoesNotExist; + + kmcmp::CheckStoreUsage(fk, i, TRUE, FALSE, FALSE); + + for (q = fk->dpStoreArray[i].dpString; *q; q++) + { + tstr[mx++] = *q; + if (mx >= max - 1) return CERR_BufferOverflow; + } + tstr[mx] = 0; + continue; + case 7: + if (iswspace(*(p + 1))) break; // is a comment -- pre-stripped - so why this test? + if (u16nicmp(p, u"context", 7) == 0) + { + if (sFlag) return CERR_ContextInVirtualKeySection; + p += 7; + + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (q && *q) + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_60, CERR_60FeatureOnly_Contextn); + int n1b; + n1b = atoiW(q); + if (n1b < 1 || n1b >= 0xF000) return CERR_InvalidToken; + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_CONTEXTEX; + tstr[mx++] = n1b; + tstr[mx] = 0; + } + else + { + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_CONTEXT; + tstr[mx] = 0; + } + } + else if (u16nicmp(p, u"clearcontext", 12) == 0) + { + p += 12; + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_CLEARCONTEXT; + tstr[mx] = 0; + } + else if (u16nicmp(p, u"call", 4) == 0) + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_501, CERR_501FeatureOnly_Call); + if (sFlag) return CERR_CallInVirtualKeySection; + p += 4; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidCall; + + for (i = 0; i < fk->cxStoreArray; i++) + { + if (u16icmp(q, fk->dpStoreArray[i].szName) == 0) break; + } + + if (!kmcmp::IsValidCallStore(&fk->dpStoreArray[i])) return CERR_InvalidCall; + kmcmp::CheckStoreUsage(fk, i, FALSE, FALSE, TRUE); + + if (i == fk->cxStoreArray) return CERR_StoreDoesNotExist; + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_CALL; + tstr[mx++] = (KMX_WCHAR)i + 1; + tstr[mx] = 0; + + fk->dpStoreArray[i].dwSystemID = TSS_CALLDEFINITION; + } + else + return CERR_InvalidToken; + continue; + case 8: + if (u16nicmp(p, u"notany", 6) == 0) + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_70, CERR_70FeatureOnly) + if (sFlag) return CERR_AnyInVirtualKeySection; + p += 6; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidAny; + + for (i = 0; i < fk->cxStoreArray; i++) + { + if (u16icmp(q, fk->dpStoreArray[i].szName) == 0) break; + } + if (i == fk->cxStoreArray) return CERR_StoreDoesNotExist; + kmcmp::CheckStoreUsage(fk, i, TRUE, FALSE, FALSE); + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_NOTANY; + tstr[mx++] = (KMX_WCHAR)i + 1; // store to index + 1, avoids End-of-string + tstr[mx] = 0; + continue; + } + if (u16nicmp(p, u"nul", 3) != 0) return CERR_InvalidToken; + + p += 3; + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_NUL; + tstr[mx] = 0; + continue; + case 9: + if (u16nicmp(p, u"use", 3) != 0) + { + if (*(p + 1) == '+') + { + n = xatoi(&p); + if (*p != '\0' && !iswspace(*p)) return CERR_InvalidValue; + if ((err = kmcmp::UTF32ToUTF16(n, &n1, &n2)) != CERR_None) return err; + tstr[mx++] = n1; + if (n2 >= 0) tstr[mx++] = n2; + tstr[mx] = 0; + if (!isUnicode) AddWarning(CWARN_UnicodeInANSIGroup); + continue; + } + return CERR_InvalidToken; + } + p += 3; + + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidUse; + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_USE; + tstr[mx] = GetGroupNum(fk, q); + if (tstr[mx] == 0) return CERR_GroupDoesNotExist; + tstr[++mx] = 0; + continue; + case 10: + if (u16nicmp(p, u"reset", 5) == 0) + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_80, CERR_80FeatureOnly); + if (sFlag) return CERR_InvalidInVirtualKeySection; + p += 5; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidReset; + + err = process_reset(fk, q, tstr, &mx); + if (err != CERR_None) return err; + } + else + { + if (u16nicmp(p, u"return", 6) != 0) return CERR_InvalidToken; + + p += 6; + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_RETURN; + tstr[mx] = 0; + u16ncpy(output, tstr, max); // I3481 + output[max - 1] = 0; + return 0; + } + continue; + case 11: + p++; sFlag = ISVIRTUALKEY /* 0 */; finished = FALSE; + + //printf("--EXTENDEDSTRING--\n"); + + do + { + while (iswspace(*p)) p++; + + switch (towupper(*p)) + { + case 'N': + if (u16nicmp(p, u"NCAPS", 5) == 0) + sFlag |= NOTCAPITALFLAG, p += 5; + else finished = TRUE; + break; + case 'L': + if (u16nicmp(p, u"LALT", 4) == 0) + sFlag |= LALTFLAG, p += 4; + else if (u16nicmp(p, u"LCTRL", 5) == 0) + sFlag |= LCTRLFLAG, p += 5; + else finished = TRUE; + break; + case 'R': + if (u16nicmp(p, u"RALT", 4) == 0) + sFlag |= RALTFLAG, p += 4; + else if (u16nicmp(p, u"RCTRL", 5) == 0) + sFlag |= RCTRLFLAG, p += 5; + else finished = TRUE; + break; + case 'A': + if (u16nicmp(p, u"ALT", 3) == 0) + sFlag |= K_ALTFLAG, p += 3; + else finished = TRUE; + break; + case 'C': + if (u16nicmp(p, u"CTRL", 4) == 0) + sFlag |= K_CTRLFLAG, p += 4; + else if (u16nicmp(p, u"CAPS", 4) == 0) + sFlag |= CAPITALFLAG, p += 4; + else finished = TRUE; + break; + case 'S': + if (u16nicmp(p, u"SHIFT", 5) == 0) + sFlag |= K_SHIFTFLAG, p += 5; + else finished = TRUE; + break; + default: + finished = TRUE; + break; + } + } while (!finished); + + if ((sFlag & (LCTRLFLAG | LALTFLAG)) && (sFlag & (RCTRLFLAG | RALTFLAG))) { + AddWarning(CWARN_MixingLeftAndRightModifiers); + } + + // If we use chiral modifiers, or we use state keys, and we target web in the keyboard, and we don't manually specify a keyboard version, bump the minimum + // version to 10.0. This makes an assumption that if we are using these features in a keyboard and it has no version specified, that we want to use the features + // in the web target platform, even if there are platform() rules excluding this possibility. In that (rare) situation, the keyboard developer should simply specify + // the &version to be 9.0 or whatever to avoid this behaviour. + if (sFlag & (LCTRLFLAG | LALTFLAG | RCTRLFLAG | RALTFLAG | CAPITALFLAG | NOTCAPITALFLAG | NUMLOCKFLAG | NOTNUMLOCKFLAG | SCROLLFLAG | NOTSCROLLFLAG) && + kmcmp::CompileTarget == CKF_KEYMANWEB && + fk->dwFlags & KF_AUTOMATICVERSION) { + VERIFY_KEYBOARD_VERSION(fk, VERSION_100, 0); + } + //printf("sFlag: %x\n", sFlag); + + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_EXTENDED; + tstr[mx++] = sFlag; + + while (iswspace(*p)) p++; + + q = p; + + if (*q == ']') + { + return CERR_InvalidToken; // I3137 - key portion of VK is missing e.g. "[CTRL ALT]", this generates invalid kmx file that can crash Keyman or compiler later on // I3511 + } + + while (*q != ']') + { + if (*q == '\'' || *q == '"') + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_60, CERR_60FeatureOnly_VirtualCharKey); + if (!kmcmp::FMnemonicLayout) AddWarning(CWARN_VirtualCharKeyWithPositionalLayout); + KMX_WCHAR chQuote = *q; + q++; if (*q == chQuote || *q == '\n' || *q == 0) return CERR_InvalidToken; + tstr[mx - 1] |= VIRTUALCHARKEY; + tstr[mx++] = *q; + q++; if (*q != chQuote) return CERR_InvalidToken; + q++; + while (iswspace(*q)) q++; + if (*q != ']') return CERR_InvalidToken; + break; /* out of while loop */ + } + + for (j = 0; !iswspace(*q) && *q != ']' && *q != 0; q++, j++); + + if (*q == 0) return CERR_InvalidToken; + + KMX_WCHAR vkname[SZMAX_VKDICTIONARYNAME]; // I3438 + + if (j >= SZMAX_VKDICTIONARYNAME) return CERR_InvalidToken; + + u16ncpy(vkname, p, j); // I3481 + vkname[j] = 0; + + if (u16icmp(vkname, u"K_NPENTER") == 0) + i = 5; // I649 - K_NPENTER hack + else + { + for (i = 0; i <= VK__MAX; i++) + { + if (u16icmp(vkname, VKeyNames[i]) == 0 || u16icmp(vkname, VKeyISO9995Names[i]) == 0) + break; + } + } + + if (i == VK__MAX + 1) + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_90, CERR_InvalidToken); + + i = GetVKCode(fk, vkname); // I3438 + if (i == 0) + return CERR_InvalidToken; + } + + p = q; + + tstr[mx++] = (int)i; + + if (kmcmp::FMnemonicLayout && (i <= VK__MAX) && VKeyMayBeVCKey[i]) AddWarning(CWARN_VirtualKeyWithMnemonicLayout); // I3438 + + while (iswspace(*q)) q++; + } + tstr[mx++] = UC_SENTINEL_EXTENDEDEND; + tstr[mx] = 0; + //printf("--EXTENDEDEND--\n"); + + p = q + 1; + + sFlag = 0; + + continue; + case 14: + if (u16nicmp(p, u"set", 3) == 0) + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_80, CERR_80FeatureOnly); + p += 3; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidSet; + + err = process_set(fk, q, tstr, &mx); + if (err != CERR_None) return err; + } + else if (u16nicmp(p, u"save", 4) == 0) + { + VERIFY_KEYBOARD_VERSION(fk, VERSION_80, CERR_80FeatureOnly); + p += 4; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidSave; + + err = process_save(fk, q, tstr, &mx); + if (err != CERR_None) return err; + } + else + { + if (u16nicmp(p, u"switch", 6) != 0) return CERR_InvalidToken; + p += 6; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidSwitch; + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_SWITCH; + tstr[mx++] = atoiW(q); + tstr[mx] = 0; + } + continue; + case 15: + if (u16nicmp(p, u"fix", 3) == 0) + { + p += 3; + tstr[mx++] = UC_SENTINEL; + tstr[mx++] = CODE_CLEARCONTEXT; + tstr[mx] = 0; + } + else + return CERR_InvalidToken; + continue; + case 16: + VERIFY_KEYBOARD_VERSION(fk, VERSION_60, CERR_60FeatureOnly_NamedCodes); + q = p + 1; + while (*q && !iswspace(*q)) q++; + c = *q; *q = 0; + n = kmcmp::CodeConstants->GetCode(p + 1, &i); + *q = c; + if (n == 0) return CERR_InvalidNamedCode; + if (i < 0xFFFFFFFFL) kmcmp::CheckStoreUsage(fk, i, TRUE, FALSE, FALSE); // I2993 + if (n > 0xFFFF) + { + tstr[mx++] = Uni_UTF32ToSurrogate1(n); + tstr[mx++] = Uni_UTF32ToSurrogate2(n); + } + else + tstr[mx++] = n; + tstr[mx] = 0; + p = q; + continue; + case 17: + if (u16nicmp(p, u"platform", 8) != 0) return CERR_InvalidToken; // I3430 + VERIFY_KEYBOARD_VERSION(fk, VERSION_90, CERR_90FeatureOnly_IfSystemStores); + if (sFlag) return CERR_InvalidInVirtualKeySection; + p += 8; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidToken; + err = process_platform(fk, q, tstr, &mx); + if (err != CERR_None) return err; + continue; + case 18: // I3437 + if (u16nicmp(p, u"layer", 5) != 0) return CERR_InvalidToken; + VERIFY_KEYBOARD_VERSION(fk, VERSION_90, CERR_90FeatureOnly_SetSystemStores); + if (sFlag) return CERR_InvalidInVirtualKeySection; + p += 5; + q = GetDelimitedString(&p, u"()", GDS_CUTLEAD | GDS_CUTFOLL); + if (!q || !*q) return CERR_InvalidToken; + err = process_set_synonym(TSS_LAYER, fk, q, tstr, &mx); + if (err != CERR_None) return err; + continue; + case 19: // #2241 + if (*(p + 1) != '.') return CERR_InvalidToken; + if (sFlag) return CERR_InvalidInVirtualKeySection; + p += 2; + err = process_expansion(fk, p, tstr, &mx, max); + if (err != CERR_None) return err; + continue; + default: + return CERR_InvalidToken; + } + if (tokenFound) + { + *newp = p; + u16ncpy(output, tstr, max); // I3481 + output[max - 1] = 0; + ErrChr = 0; + return CERR_None; + } + if (mx >= max) return CERR_BufferOverflow; + } while (*p); + + if (!*token) + { + *newp = p; + u16ncpy(output, tstr, max); // I3481 + output[max - 1] = 0; + ErrChr = 0; + return CERR_None; + } + + return CERR_NoTokensFound; +} + +KMX_DWORD process_if_synonym(KMX_DWORD dwSystemID, PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx); // I3430 + +KMX_DWORD process_baselayout(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx) // I3430 +{ + /* baselayout() */ + return process_if_synonym(TSS_BASELAYOUT, fk, q, tstr, mx); +} + +KMX_DWORD process_platform(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx) // I3430 +{ + /* platform() */ + return process_if_synonym(TSS_PLATFORM, fk, q, tstr, mx); +} + +KMX_DWORD process_if_synonym(KMX_DWORD dwSystemID, PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx) // I3430 +{ + PKMX_WCHAR temp = new KMX_WCHAR[GLOBAL_BUFSIZE]; + + KMX_DWORD msg; + + PKMX_WCHAR r; + + if ((msg = GetXString(fk, q, u"", temp, GLOBAL_BUFSIZE - 1, 0, &r, FALSE, TRUE)) != CERR_None) + { + delete[] temp; + return msg; + } + + KMX_DWORD dwStoreID; + + if ((msg = AddStore(fk, TSS_COMPARISON, temp, &dwStoreID)) != CERR_None) + { + delete[] temp; + return msg; + } + + tstr[(*mx)++] = UC_SENTINEL; + tstr[(*mx)++] = (KMX_WCHAR)CODE_IFSYSTEMSTORE; + tstr[(*mx)++] = (KMX_WCHAR)(dwSystemID + 1); // I4785 + tstr[(*mx)++] = 2; + tstr[(*mx)++] = (KMX_WCHAR)(dwStoreID + 1); + tstr[(*mx)] = 0; + + delete[] temp; + + return CERR_None; +} + +KMX_DWORD process_if(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx) // I3431 +{ + /* if( <'='|'!='> ) */ + KMX_DWORD i, code; + KMX_DWORD nnot = FALSE; + PKMX_WCHAR r = q, s = q; + while (*s && *s != u' ' && *s != u'!' && *s !=u'=') s++; + r = s; + while (*s == u' ') s++; + if (*s == u'!') + { + s++; + nnot = TRUE; + } + + if (*s != '=') return CERR_InvalidIf; + s++; + while (*s == ' ') s++; + *r = 0; + r = q; + + if (r[0] == '&') + { + VERIFY_KEYBOARD_VERSION( fk, VERSION_90, CERR_90FeatureOnly_IfSystemStores); + for (i = 0; StoreTokens[i]; i++) + { + if (u16icmp(r, StoreTokens[i]) == 0) break; + } + if (!StoreTokens[i]) return CERR_IfSystemStore_NotFound; + code = CODE_IFSYSTEMSTORE; + } + else + { + code = CODE_IFOPT; + + for (i = 0; i < fk->cxStoreArray; i++) + { + if (u16icmp(r, fk->dpStoreArray[i].szName) == 0) break; + } + if (i == fk->cxStoreArray) return CERR_StoreDoesNotExist; + kmcmp::CheckStoreUsage(fk, i, FALSE, TRUE, FALSE); + } + + PKMX_WCHAR temp = new KMX_WCHAR[GLOBAL_BUFSIZE]; + + KMX_DWORD msg; + + if ((msg = GetXString(fk, s, u"", temp, GLOBAL_BUFSIZE - 1, 0, &r, FALSE, TRUE)) != CERR_None) + { + delete[] temp; + return msg; + } + + KMX_DWORD dwStoreID; + + if ((msg = AddStore(fk, TSS_COMPARISON, temp, &dwStoreID)) != CERR_None) + { + delete[] temp; + return msg; + } + + tstr[(*mx)++] = UC_SENTINEL; + tstr[(*mx)++] = (KMX_WCHAR)code; + tstr[(*mx)++] = (KMX_WCHAR)(i + 1); + tstr[(*mx)++] = nnot ? 1 : 2; + tstr[(*mx)++] = (KMX_WCHAR)(dwStoreID + 1); + tstr[(*mx)] = 0; + + return CERR_None; +} + +KMX_DWORD process_reset(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx) +{ + /* reset() */ + KMX_DWORD i; + for (i = 0; i < fk->cxStoreArray; i++) + { + if (u16icmp(q, fk->dpStoreArray[i].szName) == 0) break; + } + if (i == fk->cxStoreArray) return CERR_StoreDoesNotExist; + kmcmp::CheckStoreUsage(fk, i, FALSE, TRUE, FALSE); + + tstr[(*mx)++] = UC_SENTINEL; + tstr[(*mx)++] = CODE_RESETOPT; + tstr[(*mx)++] = (KMX_WCHAR)(i + 1); + tstr[(*mx)] = 0; + + return CERR_None; +} + +KMX_DWORD process_expansion(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx, int max) { + KMX_BOOL isVKey = FALSE; + + KMX_WORD BaseKey=0, BaseShiftFlags=0; + KMX_DWORD BaseChar=0; + + if (*mx == 0) { + return CERR_ExpansionMustFollowCharacterOrVKey; + } + PKMX_WCHAR p = &tstr[*mx]; + p = decxstr(p, tstr); + if (*p == UC_SENTINEL) { + if (*(p + 1) != CODE_EXTENDED) { + return CERR_ExpansionMustFollowCharacterOrVKey; + } + isVKey = TRUE; + BaseKey = *(p + 3); + BaseShiftFlags = *(p + 2); + } + else { + BaseChar = Uni_UTF16ToUTF32(p); + } + + // Look ahead at next element + KMX_WCHAR temp[GLOBAL_BUFSIZE]; + PKMX_WCHAR r = NULL; + + KMX_DWORD msg; + + if ((msg = GetXString(fk, q, u"", temp, (KMX_DWORD)_countof(temp) - 1, 0, &r, FALSE, TRUE)) != CERR_None) + { + return msg; + } + + KMX_WORD HighKey, HighShiftFlags; + KMX_DWORD HighChar; + + switch(temp[0]) { + case 0: + return isVKey ? CERR_VKeyExpansionMustBeFollowedByVKey : CERR_CharacterExpansionMustBeFollowedByCharacter; + case UC_SENTINEL: + // Verify that range is valid virtual key range + if(!isVKey) { + return CERR_CharacterExpansionMustBeFollowedByCharacter; + } + if (temp[1] != CODE_EXTENDED) { + return CERR_VKeyExpansionMustBeFollowedByVKey; + } + HighKey = temp[3], HighShiftFlags = temp[2]; + if (HighShiftFlags != BaseShiftFlags) { + return CERR_VKeyExpansionMustUseConsistentShift; + } + if (HighKey <= BaseKey) { + return CERR_ExpansionMustBePositive; + } + // Verify space in buffer + if (*mx + (HighKey - BaseKey) * 5 + 1 >= max) return CERR_BufferOverflow; + // Inject an expansion. + for (BaseKey++; BaseKey < HighKey; BaseKey++) { + // < HighKey because caller will add HighKey to output + tstr[(*mx)++] = UC_SENTINEL; + tstr[(*mx)++] = CODE_EXTENDED; + tstr[(*mx)++] = BaseShiftFlags; + tstr[(*mx)++] = BaseKey; + tstr[(*mx)++] = UC_SENTINEL_EXTENDEDEND; + } + tstr[*mx] = 0; + break; + default: + // Verify that range is a valid character range + if (isVKey) { + return CERR_VKeyExpansionMustBeFollowedByVKey; + } + + HighChar = Uni_UTF16ToUTF32(temp); + if (HighChar <= BaseChar) { + return CERR_ExpansionMustBePositive; + } + // Inject an expansion. + for (BaseChar++; BaseChar < HighChar; BaseChar++) { + // < HighChar because caller will add HighChar to output + if (Uni_IsSMP(BaseChar)) { + // We'll test on each char to avoid complex calculations crossing SMP boundary + if (*mx + 3 >= max) return CERR_BufferOverflow; + tstr[(*mx)++] = (KMX_WCHAR) Uni_UTF32ToSurrogate1(BaseChar); + tstr[(*mx)++] = (KMX_WCHAR) Uni_UTF32ToSurrogate2(BaseChar); + } + else { + if (*mx + 2 >= max) return CERR_BufferOverflow; + tstr[(*mx)++] = (KMX_WCHAR) BaseChar; + } + } + tstr[*mx] = 0; + } + + return CERR_None; +} + +KMX_DWORD process_set_synonym(KMX_DWORD dwSystemID, PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx) // I3437 +{ + /* set( <'='> ), layer */ + PKMX_WCHAR temp = new KMX_WCHAR[GLOBAL_BUFSIZE], r; + KMX_DWORD msg; + + if ((msg = GetXString(fk, q, u"", temp, GLOBAL_BUFSIZE - 1, 0, &r, FALSE, TRUE)) != CERR_None) + { + delete[] temp; + return msg; + } + + KMX_DWORD dwStoreID; + + msg = AddStore(fk, TSS_COMPARISON, temp, &dwStoreID); + delete[] temp; + if (msg != CERR_None) return msg; + + tstr[(*mx)++] = UC_SENTINEL; + tstr[(*mx)++] = (KMX_WCHAR)CODE_SETSYSTEMSTORE; + tstr[(*mx)++] = (KMX_WCHAR)(dwSystemID + 1); + tstr[(*mx)++] = (KMX_WCHAR)(dwStoreID + 1); + tstr[(*mx)] = 0; + return CERR_None; +} + +KMX_DWORD process_set(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx) +{ + /* set( <'='> */ + PKMX_WCHAR r = q, s = q; // I3440 + while (*s && *s != u' ' && *s != u'=') s++; + r = s; + while (*s == u' ') s++; + if (*s != '=') return CERR_InvalidSet; + s++; + while (*s == ' ') s++; + *r = 0; + r = q; + + KMX_DWORD i, code; + + if (r[0] == '&') + { + VERIFY_KEYBOARD_VERSION((PFILE_KEYBOARD) fk, VERSION_90, CERR_90FeatureOnly_SetSystemStores); // I3437 + for (i = 0; StoreTokens[i]; i++) + { + if (u16icmp(r, StoreTokens[i]) == 0) break; + } + if (!StoreTokens[i]) return CERR_SetSystemStore_NotFound; + code = CODE_SETSYSTEMSTORE; + } + else + { + KMX_WCHAR *context = NULL; + KMX_WCHAR sep_eq[3] = u" ="; + PKMX_WCHAR r2 = u16tok(q, sep_eq, &context); // I3481 + + for (i = 0; i < fk->cxStoreArray; i++) + { + if (u16icmp(r2, fk->dpStoreArray[i].szName) == 0) break; + } + if (i == fk->cxStoreArray) return CERR_StoreDoesNotExist; + kmcmp::CheckStoreUsage(fk, i, FALSE, TRUE, FALSE); + code = CODE_SETOPT; + } + + PKMX_WCHAR temp = new KMX_WCHAR[GLOBAL_BUFSIZE]; + + KMX_DWORD msg; + + //r = wcstok(NULL, L" ="); + + if ((msg = GetXString(fk, s, u"", temp, GLOBAL_BUFSIZE - 1, 0, &r, FALSE, TRUE)) != CERR_None) + { + delete[] temp; + return msg; + } + + KMX_DWORD dwStoreID; + + msg = AddStore(fk, TSS_COMPARISON, temp, &dwStoreID); + delete[] temp; + if (msg != CERR_None) return msg; + + tstr[(*mx)++] = UC_SENTINEL; + tstr[(*mx)++] = (KMX_WCHAR)code; + tstr[(*mx)++] = (KMX_WCHAR)(i + 1); + tstr[(*mx)++] = (KMX_WCHAR)(dwStoreID + 1); + tstr[(*mx)] = 0; + return CERR_None; +} + +KMX_DWORD process_save(PFILE_KEYBOARD fk, PKMX_WCHAR q, PKMX_WCHAR tstr, int *mx) +{ + /* save() */ + KMX_DWORD i; + for (i = 0; i < fk->cxStoreArray; i++) + { + if (u16icmp(q, fk->dpStoreArray[i].szName) == 0) break; + } + if (i == fk->cxStoreArray) return CERR_StoreDoesNotExist; + kmcmp::CheckStoreUsage(fk, i, FALSE, TRUE, FALSE); + + tstr[(*mx)++] = UC_SENTINEL; + tstr[(*mx)++] = CODE_SAVEOPT; + tstr[(*mx)++] = (KMX_WCHAR)(i + 1); + tstr[(*mx)] = 0; + return CERR_None; +} + +int xatoi(PKMX_WCHAR *p) +{ + PKMX_WCHAR endptr; + int n; + + switch (towupper(**p)) + { + case 'U': + (*p)++; + if (**p != '+') return 0; + (*p)++; + n = (int)u16tol(*p, &endptr, 16); + *p = endptr; + break; + case 'X': + (*p)++; + n = (int)u16tol(*p, &endptr, 16); + *p = endptr; + break; + case 'D': + (*p)++; + n = (int)u16tol(*p, &endptr, 10); + *p = endptr; + break; + default: + n = (int)u16tol(*p, &endptr, 8); + *p = endptr; + break; + } + return n; +} + +int GetGroupNum(PFILE_KEYBOARD fk, PKMX_WCHAR p) +{ + PFILE_GROUP gp; + KMX_DWORD i; + + for (i = 0, gp = fk->dpGroupArray; i < fk->cxGroupArray; gp++, i++) + { + if (u16icmp(gp->szName, p) == 0) return i + 1; + } + return 0; +} + + +KMX_DWORD ProcessEthnologueStore(PKMX_WCHAR p) // I2646 +{ + KMX_DWORD res = CERR_None; + PKMX_WCHAR q = NULL; + while (*p) + { + while (u16chr(u" ,;", *p)) + { + if (*p != ' ') res = CWARN_PunctuationInEthnologueCode; + p++; + } + if (q == p) return CERR_InvalidEthnologueCode; + if (*p) + { + for (int i = 0; i < 3; i++) + { + if (!iswalpha(*p)) return CERR_InvalidEthnologueCode; + p++; + } + } + q = p; + } + return res; +} + +#define K_HOTKEYSHIFTFLAGS (K_SHIFTFLAG | K_CTRLFLAG | K_ALTFLAG | ISVIRTUALKEY) + +KMX_DWORD ProcessHotKey(PKMX_WCHAR p, KMX_DWORD *hk) +{ + PKMX_WCHAR q, r; + KMX_DWORD sFlag; + int j, i; + + *hk = 0; + + if (*p == UC_SENTINEL && *(p + 1) == CODE_EXTENDED) { + KMX_WORD Key = *(p + 3); + KMX_WORD ShiftFlags = *(p + 2); + + // Convert virtual key to hotkey (different bitflags) + + if (ShiftFlags & ~K_HOTKEYSHIFTFLAGS) { + AddWarning(CWARN_HotkeyHasInvalidModifier); + } + + if (ShiftFlags & K_SHIFTFLAG) *hk |= HK_SHIFT; + if (ShiftFlags & K_CTRLFLAG) *hk |= HK_CTRL; + if (ShiftFlags & K_ALTFLAG) *hk |= HK_ALT; + + *hk |= Key; + + return CERR_None; + } + + q = (PKMX_WCHAR) u16chr(p, '['); + if (q) + { + q++; + sFlag = 0; + + do + { + while (iswspace(*q)) q++; + + if (u16nicmp(q, u"ALT", 3) == 0) sFlag |= HK_ALT, q += 3; + else if (u16nicmp(q, u"CTRL", 4) == 0) sFlag |= HK_CTRL, q += 4; + else if (u16nicmp(q, u"SHIFT", 5) == 0) sFlag |= HK_SHIFT, q += 5; + else if (towupper(*q) != 'K') return CERR_InvalidToken; + } while (towupper(*q) != 'K'); + + r = (PKMX_WCHAR) u16chr(q, ']'); + if (r) + { + r--; + while (iswspace(*r) && r > q) r--; + r++; + } + else return CERR_NoTokensFound; + + j = (int)(r - q); + + for (i = 0; i <= VK__MAX; i++) // I3438 + if (j == (int) u16len(VKeyNames[i]) && u16nicmp(q, VKeyNames[i], j) == 0) break; + + if (i == VK__MAX + 1) return CERR_InvalidToken; // I3438 + + *hk = i | sFlag; + + return CERR_None; + } + + q = GetDelimitedString(&p, u"\"\"", GDS_CUTLEAD | GDS_CUTFOLL); + if (q) + { + if (u16chr(q, '^')) *hk |= HK_CTRL; + if (u16chr(q, '+')) *hk |= HK_SHIFT; + if (u16chr(q, '%')) *hk |= HK_ALT; + q = (PKMX_WCHAR) u16chr(q, 0) - 1; + *hk |= *q; + return CERR_None; + } + + return CERR_CodeInvalidInThisSection; +} + + +void SetChecksum(PKMX_BYTE buf, PKMX_DWORD CheckSum, KMX_DWORD sz) +{ + BuildCRCTable(); + *CheckSum = (KMX_DWORD)CalculateBufferCRC(buf, sz); +} + + +KMX_BOOL kmcmp::CheckStoreUsage(PFILE_KEYBOARD fk, int storeIndex, KMX_BOOL fIsStore, KMX_BOOL fIsOption, KMX_BOOL fIsCall) +{ + PFILE_STORE sp = &fk->dpStoreArray[storeIndex]; + if (fIsStore && !sp->fIsStore) + { + if (sp->fIsDebug || sp->fIsOption || sp->fIsReserved || sp->fIsCall) + AddWarningBool(CWARN_StoreAlreadyUsedAsOptionOrCall); + sp->fIsStore = TRUE; + } + else if (fIsOption && !sp->fIsOption) + { + if (sp->fIsDebug || sp->fIsStore || sp->fIsReserved || sp->fIsCall) + AddWarningBool(CWARN_StoreAlreadyUsedAsStoreOrCall); + sp->fIsOption = TRUE; + } + else if (fIsCall && !sp->fIsCall) + { + if (sp->fIsDebug || sp->fIsStore || sp->fIsReserved || sp->fIsOption) + AddWarningBool(CWARN_StoreAlreadyUsedAsStoreOrOption); + sp->fIsCall = TRUE; + } + + return TRUE; +} + +KMX_DWORD WriteCompiledKeyboard(PFILE_KEYBOARD fk, FILE* fp_out) +{ + PFILE_GROUP fgp; + PFILE_STORE fsp; + PFILE_KEY fkp; + + PCOMP_KEYBOARD ck; + PCOMP_GROUP gp; + PCOMP_STORE sp; + PCOMP_KEY kp; + PKMX_BYTE buf; + size_t offset; + size_t size; + KMX_DWORD i, j; + + // Calculate how much memory to allocate + + size = sizeof(COMP_KEYBOARD) + + fk->cxGroupArray * sizeof(COMP_GROUP) + + fk->cxStoreArray * sizeof(COMP_STORE) + + /*wcslen(fk->szName)*2 + 2 + + wcslen(fk->szCopyright)*2 + 2 + + wcslen(fk->szLanguageName)*2 + 2 + + wcslen(fk->szMessage)*2 + 2 +*/ + fk->dwBitmapSize; + + for (i = 0, fgp = fk->dpGroupArray; i < fk->cxGroupArray; i++, fgp++) + { + if (kmcmp::FSaveDebug) size += u16len(fgp->szName) * 2 + 2; + size += fgp->cxKeyArray * sizeof(COMP_KEY); + for (j = 0, fkp = fgp->dpKeyArray; j < fgp->cxKeyArray; j++, fkp++) + { + size += u16len(fkp->dpOutput) * 2 + 2; + size += u16len(fkp->dpContext) * 2 + 2; + } + + if (fgp->dpMatch) size += u16len(fgp->dpMatch) * 2 + 2; + if (fgp->dpNoMatch) size += u16len(fgp->dpNoMatch) * 2 + 2; + } + + for (i = 0; i < fk->cxStoreArray; i++) + { + size += u16len(fk->dpStoreArray[i].dpString) * 2 + 2; + if (kmcmp::FSaveDebug || fk->dpStoreArray[i].fIsOption) size += u16len(fk->dpStoreArray[i].szName) * 2 + 2; + } + + buf = new KMX_BYTE[size]; + if (!buf) return CERR_CannotAllocateMemory; + memset(buf, 0, size); + + ck = (PCOMP_KEYBOARD)buf; + + ck->dwIdentifier = FILEID_COMPILED; + ck->dwFileVersion = fk->version; + ck->dwCheckSum = 0; // do checksum afterwards. + ck->KeyboardID = fk->KeyboardID; + ck->IsRegistered = TRUE; // I5135 + ck->cxStoreArray = fk->cxStoreArray; + ck->cxGroupArray = fk->cxGroupArray; + ck->StartGroup[0] = fk->StartGroup[0]; + ck->StartGroup[1] = fk->StartGroup[1]; + ck->dwHotKey = fk->dwHotKey; + + ck->dwFlags = fk->dwFlags; + + offset = sizeof(COMP_KEYBOARD); + + /*ck->dpLanguageName = offset; + wcscpy((PWSTR)(buf + offset), fk->szLanguageName); + offset += wcslen(fk->szLanguageName)*2 + 2; + + ck->dpName = offset; + wcscpy((PWSTR)(buf + offset), fk->szName); + offset += wcslen(fk->szName)*2 + 2; + + ck->dpCopyright = offset; + wcscpy((PWSTR)(buf + offset), fk->szCopyright); + offset += wcslen(fk->szCopyright)*2 + 2; + + ck->dpMessage = offset; + wcscpy((PWSTR)(buf + offset), fk->szMessage); + offset += wcslen(fk->szMessage)*2 + 2;*/ + + ck->dpStoreArray = (KMX_DWORD)offset; + sp = (PCOMP_STORE)(buf + offset); + fsp = fk->dpStoreArray; + offset += sizeof(COMP_STORE) * ck->cxStoreArray; + for (i = 0; i < ck->cxStoreArray; i++, sp++, fsp++) + { + sp->dwSystemID = fsp->dwSystemID; + sp->dpString = (KMX_DWORD)offset; + u16ncpy((PKMX_WCHAR)(buf + offset), fsp->dpString, (size - offset) / sizeof(KMX_WCHAR)); // I3481 // I3641 + offset += u16len(fsp->dpString) * 2 + 2; + + if (kmcmp::FSaveDebug || fsp->fIsOption) + { + sp->dpName = (KMX_DWORD)offset; + u16ncpy((PKMX_WCHAR)(buf + offset), fsp->szName, (size - offset) / sizeof(KMX_WCHAR)); // I3481 // I3641 + offset += u16len(fsp->szName) * 2 + 2; + } + else sp->dpName = 0; + } + + ck->dpGroupArray = (KMX_DWORD)offset; + gp = (PCOMP_GROUP)(buf + offset); + fgp = fk->dpGroupArray; + + offset += sizeof(COMP_GROUP) * ck->cxGroupArray; + + for (i = 0; i < ck->cxGroupArray; i++, gp++, fgp++) + { + gp->cxKeyArray = fgp->cxKeyArray; + gp->fUsingKeys = fgp->fUsingKeys; + + gp->dpMatch = gp->dpNoMatch = 0; + + if (fgp->dpMatch) + { + gp->dpMatch = (KMX_DWORD)offset; + u16ncpy((PKMX_WCHAR)(buf + offset), fgp->dpMatch, (size - offset) / sizeof(KMX_WCHAR)); // I3481 // I3641 + offset += u16len(fgp->dpMatch) * 2 + 2; + } + if (fgp->dpNoMatch) + { + gp->dpNoMatch = (KMX_DWORD)offset; + u16ncpy((PKMX_WCHAR)(buf + offset), fgp->dpNoMatch, (size - offset) / sizeof(KMX_WCHAR)); // I3481 // I3641 + offset += u16len(fgp->dpNoMatch) * 2 + 2; + } + + if (kmcmp::FSaveDebug) + { + gp->dpName = (KMX_DWORD)offset; + u16ncpy((PKMX_WCHAR)(buf + offset), fgp->szName, (size - offset) / sizeof(KMX_WCHAR)); // I3481 // I3641 + offset += u16len(fgp->szName) * 2 + 2; + } + else gp->dpName = 0; + + gp->dpKeyArray = (KMX_DWORD)offset; + kp = (PCOMP_KEY )(buf + offset); + fkp = fgp->dpKeyArray; + offset += gp->cxKeyArray * sizeof(COMP_KEY); + for (j = 0; j < gp->cxKeyArray; j++, kp++, fkp++) + { + kp->_reserved = 0; + kp->Key = fkp->Key; + if (kmcmp::FSaveDebug) kp->Line = fkp->Line; else kp->Line = 0; + kp->ShiftFlags = fkp->ShiftFlags; + kp->dpOutput = (KMX_DWORD)offset; + u16ncpy((PKMX_WCHAR)(buf + offset), fkp->dpOutput, (size - offset) / sizeof(KMX_WCHAR)); // I3481 // I3641 + offset += u16len(fkp->dpOutput) * 2 + 2; + kp->dpContext = (KMX_DWORD)offset; + u16ncpy((PKMX_WCHAR)(buf + offset), fkp->dpContext, (size - offset) / sizeof(KMX_WCHAR)); // I3481 // I3641 + offset += u16len(fkp->dpContext) * 2 + 2; + } + } + + ck->dwBitmapSize = fk->dwBitmapSize; + ck->dpBitmapOffset = (KMX_DWORD)offset; + memcpy(buf + offset, fk->lpBitmap, fk->dwBitmapSize); + offset += fk->dwBitmapSize; + + if (offset != size) { + delete[] buf; + return CERR_SomewhereIGotItWrong; + } + + SetChecksum(buf, &ck->dwCheckSum, (KMX_DWORD)size); + + KMX_DWORD dwBytesWritten = 0; + dwBytesWritten = (KMX_DWORD)fwrite(buf,1, (KMX_DWORD)size , fp_out); + + if (dwBytesWritten != size) { + delete[] buf; + return CERR_UnableToWriteFully; + } + + delete[] buf; + + return CERR_None; +} + +KMX_DWORD ReadLine(FILE* fp_in , PKMX_WCHAR wstr, KMX_BOOL PreProcess) +{ + KMX_DWORD len; + PKMX_WCHAR p; + KMX_BOOL LineCarry = FALSE, InComment = FALSE; + KMX_DWORD n; + KMX_WCHAR currentQuotes = 0; + KMX_WCHAR str[LINESIZE + 3]; + len = (KMX_DWORD)fread( str , 1 ,LINESIZE * 2,fp_in); + if (ferror(fp_in) ) return CERR_CannotReadInfile; + len /= 2; + str[len] = 0; auto cur = ftell(fp_in); + fseek(fp_in, 0, SEEK_END); + auto fsize = ftell(fp_in); + fseek(fp_in, cur, SEEK_SET); + + if (cur == fsize) + + // \r\n is still added here even though Linux doesn`t use \r. + // This is to ensure to still have a working windows-only-version + u16ncat(str, u"\r\n", _countof(str)); // I3481 // Always a "\r\n" to the EOF, avoids funny bugs + + if (len == 0) return CERR_EndOfFile; + + // neccessary to add this block for using on non-windows platforms (removes all \r for platforms that use \n instead of \r\n) + for (p = str, n = 0; n < len; n++, p++) { + if (*p == L'\r') + *p = L' '; + } + + // \r is still left in this block even though Linux doesn`t use \r. + // This is to ensure to still have a working windows-only-version + for (p = str, n = 0; n < len; n++, p++) + { + if (currentQuotes != 0) + { + if (*p == L'\n') + { + *p = 0; // I2525 + u16ncpy(wstr, str, LINESIZE); // I3481 + return (PreProcess ? CERR_None : CERR_UnterminatedString); + } + if (*p == currentQuotes) currentQuotes = 0; + continue; + } + if (InComment) { + if (*p == L'\n') break; + *p = L' '; + continue; + } + if(*p == L'\\') { + LineCarry = TRUE; + *p = L' '; + continue; + } + if (LineCarry) + { + switch (*p) + { + case L' ': + case L'\t': + case L'\r': + *p = L' '; + continue; + case L'\n': + kmcmp::currentLine++; + LineCarry = FALSE; + *p = L' '; + continue; + } + *p = 0; // I2525 + u16ncpy(wstr, str, LINESIZE); // I3481 + return (PreProcess ? CERR_None : CERR_InvalidLineContinuation); + } + + if (*p == L'\n') break; + switch (*p) + { + case L'c': + case L'C': + if ((p == str || iswspace(*(p - 1))) && iswspace(*(p + 1))) { + InComment = TRUE; + *p = L' '; + } + continue; + case L'\r': + case L'\t': + *p = L' '; + continue; + case L'\'': + case L'\"': + currentQuotes = *p; + continue; + } + } + + if (n == len) + { + str[LINESIZE - 1] = 0; // I2525 + u16ncpy(wstr, str, LINESIZE); // I3481 + if (len == LINESIZE) + return (PreProcess ? CERR_None : CERR_LineTooLong); + } + + if (*p == L'\n') kmcmp::currentLine++; + + fseek(fp_in, -(int)(len * 2 - (int)(p - str) * 2 - 2), SEEK_CUR); + + p--; + while (p >= str && iswspace(*p)) p--; + p++; + *p++ = L'\n'; + *p = 0; + // trim spaces now, why not? + u16ncpy(wstr, str, LINESIZE); // I3481 + + return CERR_None; +} + +KMX_DWORD GetRHS(PFILE_KEYBOARD fk, PKMX_WCHAR p, PKMX_WCHAR buf, int bufsize, int offset, int IsUnicode) +{ + PKMX_WCHAR q; + p = (const PKMX_WCHAR) u16chr(p, '>'); + + if (!p) return CERR_NoTokensFound; + + p++; + + return GetXString(fk, p, u"c\n", buf, bufsize, offset, &q, TRUE, IsUnicode); +} + +void safe_wcsncpy(PKMX_WCHAR out, PKMX_WCHAR in, int cbMax) +{ + u16ncpy(out, in, cbMax - 1); // I3481 + out[cbMax - 1] = 0; +} + +KMX_BOOL IsSameToken(PKMX_WCHAR *p, KMX_WCHAR const * token) +{ + PKMX_WCHAR q; + q = *p; + while (iswspace(*q)) q++; + if (u16nicmp(q, token, u16len(token)) == 0) + { + q += u16len(token); + while (iswspace(*q)) q++; + *p = q; + return TRUE; + } + return FALSE; +} + +KMX_DWORD ImportBitmapFile(PFILE_KEYBOARD fk, PKMX_WCHAR szName, PKMX_DWORD FileSize, PKMX_BYTE *Buf) +{ + FILE *fp; + KMX_WCHAR szNewName[260]; + + if (IsRelativePath(szName)) + { + PKMX_WCHAR WCompileDir = strtowstr(kmcmp::CompileDir); + u16ncpy(szNewName, WCompileDir, _countof(szNewName)); // I3481 + u16ncat(szNewName,szName, _countof(szNewName )); // I3481 + } + else + u16ncpy(szNewName, szName, _countof(szNewName)); // I3481 + + fp=Open_File(szNewName, u"rb"); + + if ( fp == NULL) + { + // else if filename.bmp is not in the folder -> attempt to open filename.bmp.bmp ! + if ( u16cmp(szNewName+u16len(szNewName)-4, u".bmp") ) + u16ncat(szNewName, u".bmp", _countof(szNewName)); // I3481 + + fp= Open_File(szNewName, u"rb"); + + if ( fp == NULL) + return CERR_CannotReadBitmapFile; + } + + KMX_DWORD msg; + if ((msg = CheckFilenameConsistency(szNewName, FALSE)) != CERR_None) { + return msg; + } + + fseek(fp, 0, SEEK_END); + *FileSize = (KMX_DWORD)ftell(fp); + fseek(fp ,0,SEEK_SET); + if (*FileSize < 0) { + fclose(fp); + return CERR_CannotReadBitmapFile; + } + + if (*FileSize < 2) return CERR_CannotReadBitmapFile; + *Buf = new KMX_BYTE[*FileSize]; + + if (fread(*Buf, 1, *FileSize, fp) < (size_t) *FileSize) { + delete[] * Buf; + *Buf = NULL; + return CERR_CannotReadBitmapFile; + } + + fclose(fp); + + /* Test for version 7.0 icon support */ + if (*((PKMX_CHAR)*Buf) != 'B' && *(((PKMX_CHAR)*Buf) + 1) != 'M') { + VERIFY_KEYBOARD_VERSION(fk, VERSION_70, CERR_70FeatureOnly); + } + + return CERR_None; +} + +int atoiW(PKMX_WCHAR p) +{ + PKMX_STR q = wstrtostr(p); + int i = atoi(q); + delete[] q; + return i; +} + +KMX_DWORD kmcmp::CheckUTF16(int n) +{ + const int res[] = { + 0xFDD0, 0xFDD1, 0xFDD2, 0xFDD3, 0xFDD4, 0xFDD5, 0xFDD6, 0xFDD7, + 0xFDD8, 0xFDD9, 0xFDDA, 0xFDDB, 0xFDDC, 0xFDDD, 0xFDDE, 0xFDDF, + 0xFDE0, 0xFDE1, 0xFDE2, 0xFDE3, 0xFDE4, 0xFDE5, 0xFDE6, 0xFDE7, + 0xFDE8, 0xFDE9, 0xFDEA, 0xFDEB, 0xFDEC, 0xFDED, 0xFDEE, 0xFDEF, + 0xFFFF, 0xFFFE, 0 }; + + if (n == 0) return CERR_ReservedCharacter; + for (int i = 0; res[i] > 0; i++) + if (n == res[i]) + { + AddWarning(CWARN_ReservedCharacter); + break; + } + return CERR_None; +} + +KMX_DWORD kmcmp::UTF32ToUTF16(int n, int *n1, int *n2) +{ + *n2 = -1; + if (n <= 0xFFFF) + { + *n1 = n; + if (n >= 0xD800 && n <= 0xDFFF) AddWarning(CWARN_UnicodeSurrogateUsed); + return kmcmp::CheckUTF16(*n1); + } + + if ((n & 0xFFFF) == 0xFFFF || (n & 0xFFFF) == 0xFFFE) AddWarning(CWARN_ReservedCharacter); + if (n < 0 || n > 0x10FFFF) return CERR_InvalidCharacter; + n = n - 0x10000; + *n1 = (n / 0x400) + 0xD800; + *n2 = (n % 0x400) + 0xDC00; + KMX_DWORD msg; + if ((msg = kmcmp::CheckUTF16(*n1)) != CERR_None) return msg; + return kmcmp::CheckUTF16(*n2); +} + +KMX_DWORD BuildVKDictionary(PFILE_KEYBOARD fk) +{ + KMX_DWORD i; + size_t len = 0; + if (fk->cxVKDictionary == 0) return CERR_None; + for (i = 0; i < fk->cxVKDictionary; i++) + { + len += u16len(fk->dpVKDictionary[i].szName) + 1; + } + PKMX_WCHAR storeval = new KMX_WCHAR[len], p = storeval; + for (i = 0; i < fk->cxVKDictionary; i++) + { + u16ncpy(p, fk->dpVKDictionary[i].szName, len - (size_t)(p - storeval)); // I3481 + p = (PKMX_WCHAR) u16chr(p, 0); + *p = ' '; + p++; + } + + p--; + *p = 0; + + KMX_DWORD dwStoreID; + KMX_DWORD msg = AddStore(fk, TSS_VKDICTIONARY, storeval, &dwStoreID); + delete[] storeval; + return msg; +} + +int GetVKCode(PFILE_KEYBOARD fk, PKMX_WCHAR p) +{ + KMX_DWORD i; + + for (i = 0; i < fk->cxVKDictionary; i++) + if (u16icmp(fk->dpVKDictionary[i].szName, p) == 0) + return i + VK__MAX + 1; // 256 + + if (fk->cxVKDictionary % 10 == 0) + { + PFILE_VKDICTIONARY pvk = new FILE_VKDICTIONARY[fk->cxVKDictionary + 10]; + memcpy(pvk, fk->dpVKDictionary, fk->cxVKDictionary * sizeof(FILE_VKDICTIONARY)); + delete fk->dpVKDictionary; + fk->dpVKDictionary = pvk; + } + u16ncpy(fk->dpVKDictionary[fk->cxVKDictionary].szName, p, _countof(fk->dpVKDictionary[fk->cxVKDictionary].szName) ); // I3481 + fk->dpVKDictionary[fk->cxVKDictionary].szName[SZMAX_VKDICTIONARYNAME - 1] = 0; + + fk->cxVKDictionary++; + return fk->cxVKDictionary + VK__MAX; // 256-1 +} + +int GetDeadKey(PFILE_KEYBOARD fk, PKMX_WCHAR p) +{ + KMX_DWORD i; + + for (i = 0; i < fk->cxDeadKeyArray; i++) + if (u16icmp(fk->dpDeadKeyArray[i].szName, p) == 0) + return i + 1; + + if (fk->cxDeadKeyArray % 10 == 0) + { + PFILE_DEADKEY dk = new FILE_DEADKEY[fk->cxDeadKeyArray + 10]; + memcpy(dk, fk->dpDeadKeyArray, fk->cxDeadKeyArray * sizeof(FILE_DEADKEY)); + delete[] fk->dpDeadKeyArray; + fk->dpDeadKeyArray = dk; + } + u16ncpy(fk->dpDeadKeyArray[fk->cxDeadKeyArray].szName,p, _countof(fk->dpDeadKeyArray[fk->cxDeadKeyArray].szName)); // I3481 + fk->dpDeadKeyArray[fk->cxDeadKeyArray].szName[SZMAX_DEADKEYNAME - 1] = 0; + + fk->cxDeadKeyArray++; + return fk->cxDeadKeyArray; +} + +void kmcmp::RecordDeadkeyNames(PFILE_KEYBOARD fk) +{ + KMX_WCHAR buf[SZMAX_DEADKEYNAME + 16]; + KMX_DWORD i; + for (i = 0; i < fk->cxDeadKeyArray; i++) + { + u16sprintf(buf, _countof(buf), L"%ls%d ", u16fmt(DEBUGSTORE_DEADKEY).c_str(), (int)i); + u16ncat(buf, fk->dpDeadKeyArray[i].szName, _countof(buf)); + + AddDebugStore(fk, buf); + } +} + +KMX_BOOL kmcmp::IsValidCallStore(PFILE_STORE fs) +{ + int i; + PKMX_WCHAR p; + for (i = 0, p = fs->dpString; *p; p++) + if (*p == ':') i++; + else if (!((*p >= 'a' && *p <= 'z') || + (*p >= 'A' && *p <= 'Z') || + (*p >= '0' && *p <= '9') || + *p == '.' || + *p == '_')) + return FALSE; + + return i == 1; +} + +FILE* CreateTempFile() +{ + return tmpfile(); +} + +/////////////////// + +FILE* UTF16TempFromUTF8(FILE* fp_in , KMX_BOOL hasPreamble) +{ + FILE *fp_out = CreateTempFile(); + if(fp_out == NULL) // I3228 // I3510 + { + fclose(fp_in); + return NULL; //return INVALID_HANDLE_VALUE; _S2 can I exchange that? + } + + PKMX_BYTE buf, p; + PKMX_WCHAR outbuf, poutbuf; + KMX_DWORD len; + KMX_DWORD len2; + KMX_WCHAR prolog = 0xFEFF; + fwrite(&prolog,2, 1, fp_out); + + fseek(fp_in, 0, SEEK_END); + len = (KMX_DWORD)ftell(fp_in); + fseek(fp_in, 0, SEEK_SET); + if (hasPreamble) { + fseek( fp_in,3,SEEK_SET); // Cut off UTF-8 marker + len -= 3; + } + + buf = new KMX_BYTE[len + 1]; // null terminated + outbuf = new KMX_WCHAR[len + 1]; + + len2= (KMX_DWORD)fread(buf,1,len,fp_in); + if (len2) { + buf[len2] = 0; + p = buf; + poutbuf = outbuf; + if (hasPreamble) { + // We have a preamble, so we attempt to read as UTF-8 and allow conversion errors to be filtered. This is not great for a + // compiler but matches existing behaviour -- in future versions we may not do lenient conversion. + ConvertUTF8toUTF16(&p, &buf[len2], (UTF16 **)&poutbuf, (const UTF16 *)&outbuf[len], lenientConversion); + fwrite(outbuf, (KMX_DWORD)(poutbuf - outbuf) * 2 , 1, fp_out); + } + else { + // No preamble, so we attempt to read as strict UTF-8 and fall back to ANSI if that fails + ConversionResult cr = ConvertUTF8toUTF16(&p, &buf[len2], (UTF16 **)&poutbuf, (const UTF16 *)&outbuf[len], strictConversion); + if (cr == sourceIllegal) { + // Not a valid UTF-8 file, so fall back to ANSI + // AddCompileError(CHINT_NonUnicodeFile); + // note, while this message is defined, for now we will not emit it + // because we don't support HINT/INFO messages yet and we don't want + // this to cause a blocking compile at this stage + // do strtowstr only when no invalid characters are found + if( p==0){ + poutbuf = strtowstr((PKMX_STR)buf); + fwrite(poutbuf, (KMX_DWORD)u16len(poutbuf) * 2 , 1, fp_out); + delete[] poutbuf; + } + else + AddCompileError(CERR_InvalidCharacter); + } + + else { + fwrite(outbuf, (KMX_DWORD)(poutbuf - outbuf) * 2 , 1, fp_out); + } + } + } + + fclose( fp_in); + delete[] buf; + delete[] outbuf; + fseek( fp_out,2,SEEK_SET); + return fp_out; +} + +PFILE_STORE FindSystemStore(PFILE_KEYBOARD fk, KMX_DWORD dwSystemID) +{ + assert(fk != NULL); + assert(dwSystemID != 0); + + PFILE_STORE sp = fk->dpStoreArray; + for (KMX_DWORD i = 0; i < fk->cxStoreArray; i++, sp++) { + if (sp->dwSystemID == dwSystemID) { + return sp; + } + } + return NULL; +} diff --git a/developer/src/kmcmplib/src/CompilerInterfaces.cpp b/developer/src/kmcmplib/src/CompilerInterfaces.cpp new file mode 100644 index 0000000000000000000000000000000000000000..89c4655d16e4a04e42f1cfb86551e31f87abd3eb --- /dev/null +++ b/developer/src/kmcmplib/src/CompilerInterfaces.cpp @@ -0,0 +1,377 @@ +#include "pch.h" + +#include +#include +#include "kmcmplib.h" +#include "filesystem.h" +#include "CheckFilenameConsistency.h" +#include "CheckNCapsConsistency.h" +#include "DeprecationChecks.h" +#include "versioning.h" +#include "../../../../common/windows/cpp/include/ConvertUTF.h" +#include "../../../../common/windows/cpp/include/keymanversion.h" + +#define SetError(err) { if(AddCompileError(err) || (err & CERR_FATAL)) return FALSE; } + +bool CompileKeyboardHandle(FILE* fp_in, PFILE_KEYBOARD fk); + +EXTERN bool kmcmp_SetCompilerOptions(KMCMP_COMPILER_OPTIONS* options) { + //printf("°°-> changed to SetCompilerOptions() of kmcmplib \n"); + if(!options || options->dwSize < sizeof(KMCMP_COMPILER_OPTIONS)) { + return FALSE; + } + kmcmp::FShouldAddCompilerVersion = options->ShouldAddCompilerVersion; + return TRUE; +} + +#ifdef __EMSCRIPTEN__ + +/* + WASM interface for compiler message callback +*/ +EM_JS(int, wasm_msgproc, (int line, int msgcode, char* text, char* context), { + const proc = globalThis[UTF8ToString(context)]; + if(!proc || typeof proc != 'function') { + console.log(`[${line}: ${msgcode}: ${UTF8ToString(text)}]`); + return 0; + } else { + return proc(line, msgcode, UTF8ToString(text)); + } +}); + +int wasm_CompilerMessageProc(int line, uint32_t dwMsgCode, char* szText, void* context) { + char* msgProc = static_cast(context); + return wasm_msgproc(line, dwMsgCode, szText, msgProc); +} + +EXTERN bool kmcmp_Wasm_SetCompilerOptions(int ShouldAddCompilerVersion) { + KMCMP_COMPILER_OPTIONS options; + options.dwSize = sizeof(KMCMP_COMPILER_OPTIONS); + options.ShouldAddCompilerVersion = ShouldAddCompilerVersion; + return kmcmp_SetCompilerOptions(&options); +} + +EXTERN bool kmcmp_Wasm_CompileKeyboardFile(char* pszInfile, + char* pszOutfile, int ASaveDebug, int ACompilerWarningsAsErrors, + int AWarnDeprecatedCode, char* msgProc +) { + return kmcmp_CompileKeyboardFile( + pszInfile, + pszOutfile, + ASaveDebug, + ACompilerWarningsAsErrors, + AWarnDeprecatedCode, + wasm_CompilerMessageProc, + msgProc + ); +} + +EXTERN int kmcmp_Wasm_ParseUnicodeSet(char* pat, + uint32_t* buf, int length +) { + return kmcmp_ParseUnicodeSet( + pat, buf, length + ); +} + +#endif + +EXTERN bool kmcmp_CompileKeyboardFile(char* pszInfile, + char* pszOutfile, bool ASaveDebug, bool ACompilerWarningsAsErrors, + bool AWarnDeprecatedCode, kmcmp_CompilerMessageProc pMsgproc, void* AmsgprocContext +) { + FILE* fp_in = NULL; + FILE* fp_out = NULL; + KMX_CHAR str[260]; + + //printf("°°-> changed to CompileKeyboardFile() of kmcmplib \n"); + + kmcmp::FSaveDebug = ASaveDebug; + kmcmp::FCompilerWarningsAsErrors = ACompilerWarningsAsErrors; // I4865 + AWarnDeprecatedCode_GLOBAL_LIB = AWarnDeprecatedCode; + + kmcmp::CompileTarget = CKF_KEYMAN; + + if (!pMsgproc || !pszInfile || !pszOutfile) SetError(CERR_BadCallParams); + + PKMX_STR p; + + if ((p = strrchr_slash(pszInfile)) != nullptr) + { + strncpy(kmcmp::CompileDir, pszInfile, (int)(p - pszInfile + 1)); // I3481 + kmcmp::CompileDir[(int)(p - pszInfile + 1)] = 0; + } + else + kmcmp::CompileDir[0] = 0; + + msgproc = pMsgproc; + msgprocContext = AmsgprocContext; + kmcmp::currentLine = 0; + kmcmp::nErrors = 0; + + fp_in = Open_File(pszInfile, "rb"); + + if (fp_in == NULL) { + SetError(CERR_InfileNotExist); + } + + // Transfer the file to a memory stream for processing UTF-8 or ANSI to UTF-16? + // What about really large files? Transfer to a temp file... + if (!fread(str, 1, 3, fp_in)) { + fclose(fp_in); + SetError(CERR_CannotReadInfile); + } + + fseek(fp_in, 0, SEEK_SET); + if (str[0] == UTF8Sig[0] && str[1] == UTF8Sig[1] && str[2] == UTF8Sig[2]) + fp_in = UTF16TempFromUTF8(fp_in, TRUE); + else if (str[0] == UTF16Sig[0] && str[1] == UTF16Sig[1]) + fseek(fp_in, 2, SEEK_SET); + else + fp_in = UTF16TempFromUTF8(fp_in, FALSE); + if (fp_in == NULL) { + SetError(CERR_CannotCreateTempfile); + } + + fp_out = Open_File(pszOutfile, "wb"); + + if (fp_out == NULL) { + SetError(CERR_CannotCreateOutfile); + } + + FILE_KEYBOARD fk; + kmcmp::CodeConstants = new kmcmp::NamedCodeConstants; + bool result = CompileKeyboardHandle(fp_in, &fk); + if(result) { + KMX_DWORD msg; + if ((msg = WriteCompiledKeyboard(&fk, fp_out)) != CERR_None) { + result = FALSE; + AddCompileError(msg); + } + } else { + AddCompileError(CERR_InvalidValue); + } + + fclose(fp_in); + fclose(fp_out); + + delete kmcmp::CodeConstants; + + if (kmcmp::nErrors > 0) + { + remove(pszOutfile); + return FALSE; + } + + return result; +} + + + +EXTERN bool kmcmp_CompileKeyboardFileToBuffer(char* pszInfile, void* pfkBuffer, bool ACompilerWarningsAsErrors, bool AWarnDeprecatedCode, + kmcmp_CompilerMessageProc pMsgproc, void* AmsgprocContext, int Target) // I4865 // I4866 +{ + //printf("°°-> changed to CompileKeyboardFileToBuffer() of kmcmplib \n"); + FILE* fp_in = NULL; + KMX_CHAR str[260]; + + kmcmp::FSaveDebug = TRUE; // I3681 + kmcmp::FCompilerWarningsAsErrors = ACompilerWarningsAsErrors; // I4865 + AWarnDeprecatedCode_GLOBAL_LIB = AWarnDeprecatedCode; + kmcmp::CompileTarget = Target; + + if (!pMsgproc || !pszInfile || !pfkBuffer) { + SetError(CERR_BadCallParams); + } + + PKMX_STR p; + + if ((p = strrchr_slash(pszInfile)) != nullptr) { + strncpy(kmcmp::CompileDir, pszInfile, (int)(p - pszInfile + 1)); // I3481 + kmcmp::CompileDir[(int)(p - pszInfile + 1)] = 0; + } + else { + kmcmp::CompileDir[0] = 0; + } + + msgproc = pMsgproc; + msgprocContext = AmsgprocContext; + kmcmp::currentLine = 0; + kmcmp::nErrors = 0; + + fp_in = Open_File(pszInfile,"rb"); + + if (fp_in == NULL) { + SetError(CERR_InfileNotExist); + } + + // Transfer the file to a memory stream for processing UTF-8 or ANSI to UTF-16? + // What about really large files? Transfer to a temp file... + + if( !fread(str,1,3,fp_in)) + { + fclose(fp_in); + SetError(CERR_CannotReadInfile); + } + + fseek( fp_in,0,SEEK_SET); + if (str[0] == UTF8Sig[0] && str[1] == UTF8Sig[1] && str[2] == UTF8Sig[2]) + fp_in = UTF16TempFromUTF8(fp_in, TRUE); + else if (str[0] == UTF16Sig[0] && str[1] == UTF16Sig[1]) + fseek( fp_in,2,SEEK_SET); + else + fp_in = UTF16TempFromUTF8(fp_in, FALSE); + + kmcmp::CodeConstants = new kmcmp::NamedCodeConstants; + + bool result = CompileKeyboardHandle(fp_in, static_cast(pfkBuffer)); + delete kmcmp::CodeConstants; + fclose(fp_in); + + if (kmcmp::nErrors > 0) { + return FALSE; + } + return result; +} + +bool CompileKeyboardHandle(FILE* fp_in, PFILE_KEYBOARD fk) +{ + PKMX_WCHAR str, p; + + KMX_DWORD msg; + + kmcmp::FMnemonicLayout = FALSE; + + if (!fk) { + SetError(CERR_SomewhereIGotItWrong); + } + + str = new KMX_WCHAR[LINESIZE]; + if (!str) { + SetError(CERR_CannotAllocateMemory); + } + + fk->KeyboardID = 0; + fk->version = 0; + fk->dpStoreArray = NULL; + fk->dpGroupArray = NULL; + fk->cxStoreArray = 0; + fk->cxGroupArray = 0; + fk->StartGroup[0] = fk->StartGroup[1] = -1; + fk->szName[0] = 0; + fk->szCopyright[0] = 0; + fk->dwFlags = KF_AUTOMATICVERSION; + fk->currentGroup = 0xFFFFFFFF; + fk->currentStore = 0; + fk->cxDeadKeyArray = 0; + fk->dpDeadKeyArray = NULL; + fk->cxVKDictionary = 0; // I3438 + fk->dpVKDictionary = NULL; // I3438 + +/* fk->szMessage[0] = 0; + fk->szLanguageName[0] = 0;*/ + fk->dwBitmapSize = 0; + fk->dwHotKey = 0; + + kmcmp::BeginLine[BEGIN_ANSI] = -1; + kmcmp::BeginLine[BEGIN_UNICODE] = -1; + kmcmp::BeginLine[BEGIN_NEWCONTEXT] = -1; + kmcmp::BeginLine[BEGIN_POSTKEYSTROKE] = -1; + + + /* Add a store for the Keyman 6.0 copyright information string */ + + if(kmcmp::FShouldAddCompilerVersion) { + u16sprintf(str,LINESIZE, L"Created with Keyman Developer version %d.%d.%d.%d", KEYMAN_VersionMajor, KEYMAN_VersionMinor, KEYMAN_VersionPatch, 0); + AddStore(fk, TSS_KEYMANCOPYRIGHT, str); + } + + /* Add a system store for the Keyman edition number */ + u16sprintf(str, LINESIZE, L"%d", 0); // I3481 + AddStore(fk, TSS_CUSTOMKEYMANEDITION, str); + + PKMX_WCHAR tbuf = strtowstr((KMX_CHAR*) "Keyman"); + AddStore(fk, TSS_CUSTOMKEYMANEDITIONNAME, tbuf); + delete tbuf; + + // must preprocess for group and store names -> this isn't really necessary, but never mind! + while ((msg = ReadLine(fp_in, str, TRUE)) == CERR_None) + { + p = str; + switch (LineTokenType(&p)) + { + case T_VERSION: + *(p + 4) = 0; + if ((msg = AddStore(fk, TSS_VERSION, p)) != CERR_None) SetError(msg); + break; + + case T_GROUP: + if ((msg = ProcessGroupLine(fk, p)) != CERR_None) SetError(msg); + break; + + case T_STORE: + if ((msg = ProcessStoreLine(fk, p)) != CERR_None) SetError(msg); + break; + + default: + break; + } + } + + if (msg != CERR_EndOfFile) { + SetError(msg); + } + + fseek( fp_in,2,SEEK_SET); + kmcmp::currentLine = 0; + + /* Reindex the list of codeconstants after stores added */ + + kmcmp::CodeConstants->reindex(); + + /* ReadLine will automatically skip over $Keyman lines, and parse wrapped lines */ + while ((msg = ReadLine(fp_in, str, FALSE)) == CERR_None) + { + msg = ParseLine(fk, str); + if (msg != CERR_None) { + SetError(msg); + } + } + + if (msg != CERR_EndOfFile) { + SetError(msg); + } + + ProcessGroupFinish(fk); + + if (kmcmp::FSaveDebug) kmcmp::RecordDeadkeyNames(fk); + + /* Add the compiler version as a system store */ + if ((msg = kmcmp::AddCompilerVersionStore(fk)) != CERR_None) { + SetError(msg); + } + + if ((msg = BuildVKDictionary(fk)) != CERR_None) { + SetError(msg); // I3438 + } + + if ((msg = CheckFilenameConsistencyForCalls(fk)) != CERR_None) { + SetError(msg); + } + + delete str; + + if (!kmcmp::CheckKeyboardFinalVersion(fk)) { + return FALSE; + } + + /* Warn on inconsistent use of NCAPS */ + if (!kmcmp::FMnemonicLayout) { + CheckNCapsConsistency(fk); + } + + /* Flag presence of deprecated features */ + kmcmp::CheckForDeprecatedFeatures(fk); + + return TRUE; +} diff --git a/developer/src/kmcmplib/src/DeprecationChecks.cpp b/developer/src/kmcmplib/src/DeprecationChecks.cpp new file mode 100644 index 0000000000000000000000000000000000000000..11042f0c132b69bcb02b0e7a30e481dd4e0d29a8 --- /dev/null +++ b/developer/src/kmcmplib/src/DeprecationChecks.cpp @@ -0,0 +1,53 @@ + +#include "pch.h" + +#include "compfile.h" +#include +#include "kmcmplib.h" +#include "DeprecationChecks.h" + +KMX_BOOL kmcmp::WarnDeprecatedHeader() { // I4866 +if( AWarnDeprecatedCode_GLOBAL_LIB){ + AddWarningBool(CWARN_HeaderStatementIsDeprecated); + } + return TRUE; +} + +/* Flag presence of deprecated features */ +KMX_BOOL kmcmp::CheckForDeprecatedFeatures(PFILE_KEYBOARD fk) { + /* + For Keyman 10, we deprecated: + // < Keyman 7 + #define TSS_LANGUAGE 4 + #define TSS_LAYOUT 5 + #define TSS_LANGUAGENAME 12 + #define TSS_ETHNOLOGUECODE 15 + + // Keyman 7 + #define TSS_WINDOWSLANGUAGES 29 + */ + int oldCurrentLine = kmcmp::currentLine; + KMX_DWORD i; + PFILE_STORE sp; + + if (!AWarnDeprecatedCode_GLOBAL_LIB) { + return TRUE; + } + + if (fk->version >= VERSION_100) { + for (i = 0, sp = fk->dpStoreArray; i < fk->cxStoreArray; i++, sp++) { + if (sp->dwSystemID == TSS_LANGUAGE || + sp->dwSystemID == TSS_LAYOUT || + sp->dwSystemID == TSS_LANGUAGENAME || + sp->dwSystemID == TSS_ETHNOLOGUECODE || + sp->dwSystemID == TSS_WINDOWSLANGUAGES) { + kmcmp::currentLine = sp->line; + AddWarningBool(CWARN_LanguageHeadersDeprecatedInKeyman10); + } + } + } + + kmcmp::currentLine = oldCurrentLine; + + return TRUE; +} diff --git a/developer/src/kmcmplib/src/DeprecationChecks.h b/developer/src/kmcmplib/src/DeprecationChecks.h new file mode 100644 index 0000000000000000000000000000000000000000..941b87f1a4d5dc367892d7ee8209d27a5fca88b6 --- /dev/null +++ b/developer/src/kmcmplib/src/DeprecationChecks.h @@ -0,0 +1,9 @@ +#pragma once + +#include "compfile.h" +#include "kmcmplib.h" + +namespace kmcmp{ +KMX_BOOL WarnDeprecatedHeader(); +KMX_BOOL CheckForDeprecatedFeatures(PFILE_KEYBOARD fk); +} diff --git a/developer/src/kmcmplib/src/Edition.cpp b/developer/src/kmcmplib/src/Edition.cpp new file mode 100644 index 0000000000000000000000000000000000000000..cdf82ee2f8f3c0da311c853f891b70096089e23e --- /dev/null +++ b/developer/src/kmcmplib/src/Edition.cpp @@ -0,0 +1,8 @@ + +#include "pch.h" +#include "Edition.h" + +int GetEdition() +{ + return ED_STANDARD; +} diff --git a/developer/src/kmcmplib/src/Edition.h b/developer/src/kmcmplib/src/Edition.h new file mode 100644 index 0000000000000000000000000000000000000000..26eb44c61609a1b7352f45b13f178a821ce5c424 --- /dev/null +++ b/developer/src/kmcmplib/src/Edition.h @@ -0,0 +1,12 @@ + +#ifndef _EDITION_H +#define _EDITION_H + +int GetEdition(); + +#define ED_DEMO 0 +#define ED_STANDARD 1 +#define ED_PRO 2 +#define ED_OEM 3 + +#endif diff --git a/developer/src/kmcmplib/src/NamedCodeConstants.cpp b/developer/src/kmcmplib/src/NamedCodeConstants.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e6b1ae6d70ce20846ba23d24e0ab0efd05d2120a --- /dev/null +++ b/developer/src/kmcmplib/src/NamedCodeConstants.cpp @@ -0,0 +1,355 @@ +/*2012 + Name: NamedCodeConstants + Copyright: Copyright (C) 2003-2017 SIL International. + Documentation: + Description: + Create Date: 19 Jul 2011 + + Modified Date: 13 Dec 2012 + Authors: mcdurdin + Related Files: + Dependencies: + + Bugs: + Todo: + Notes: + History: 19 Jul 2011 - mcdurdin - I2993 - Named code constants cause a warning 0x208D to appear + 24 Oct 2012 - mcdurdin - I3481 - V9.0 - Eliminate unsafe calls in C++ + 06 Feb 2012 - mcdurdin - I3056 - If file was not found in first search folder, named code constants failed to compile + 06 Feb 2012 - mcdurdin - I3056 - UTF-8 support for named code constants file + 03 Nov 2012 - mcdurdin - I3512 - V9.0 - Merge of I3056 - If file was not found in first search folder, named code constants failed to compile + 13 Dec 2012 - mcdurdin - I3641 - V9.0 - compiler dll buffer overrun bugs +*/ + +#include "pch.h" +#include +#include "NamedCodeConstants.h" +#include "CheckFilenameConsistency.h" +#include +#include "kmcompx.h" +#include "filesystem.h" + +using namespace kmcmp; + +int IsHangulSyllable(const KMX_WCHAR *codename, int *code); + +namespace kmcmp { + extern KMX_CHAR CompileDir[]; + + int __cdecl sort_entries(const void *elem1, const void *elem2) + { + return u16icmp( + ((NCCENTRY *)elem1)->name, + ((NCCENTRY *)elem2)->name); + } +} + +NamedCodeConstants::NamedCodeConstants() +{ + nEntries = 0; + entries = NULL; + nEntries_file = 0; + entries_file = NULL; + reindex(); +} + +NamedCodeConstants::~NamedCodeConstants() +{ + if(entries) delete entries; + if(entries_file) delete entries_file; +} + +void NamedCodeConstants::AddCode(int n, const KMX_WCHAR *p, KMX_DWORD storeIndex) +{ + if((nEntries_file % ALLOC_SIZE) == 0) + { + NCCENTRY *bn = new NCCENTRY[nEntries_file + ALLOC_SIZE]; + if(nEntries_file > 0) + { + memcpy(bn, entries_file, sizeof(NCCENTRY) * nEntries_file); + delete entries_file; + } + entries_file = bn; + } + + entries_file[nEntries_file].code = n; + u16ncpy(entries_file[nEntries_file].name, p, _countof(entries_file[nEntries_file].name)); // I3481 + entries_file[nEntries_file].name[MAX_ENAME] = 0; + + for (KMX_WCHAR *r = entries_file[nEntries_file].name; *r; r++) + if (iswblank(*r) && *r != '-') *r = '_'; + + entries_file[nEntries_file].storeIndex = storeIndex; + nEntries_file++; +} + +void NamedCodeConstants::AddCode_IncludedCodes(int n, const KMX_WCHAR *p) +{ + if((nEntries % ALLOC_SIZE) == 0) + { + NCCENTRY *bn = new NCCENTRY[nEntries + ALLOC_SIZE]; + if(nEntries > 0) + { + memcpy(bn, entries, sizeof(NCCENTRY) * nEntries); + delete entries; + } + entries = bn; + } + + entries[nEntries].code = n; + u16ncpy(entries[nEntries].name, p, MAX_ENAME); // I3481 + entries[nEntries].name[MAX_ENAME] = 0; + for (KMX_WCHAR *r = entries[nEntries].name; *r; r++) + if (iswblank(*r)) *r = '_'; + + entries[nEntries].storeIndex = 0xFFFFFFFFL; + nEntries++; +} + +// int __cdecl sort_entries(const void *elem1, const void *elem2) moved into namespace further up + +char *kmc_strupr(char *s) { + char *p = s; + while (*p) { + *p = ::toupper(*p); + p++; + } + return s; +} + +KMX_BOOL NamedCodeConstants::IntLoadFile(const KMX_CHAR *filename) +{ + const int str_size = 256; + FILE *fp = NULL; + + if (CheckFilenameConsistency(filename, FALSE) != 0) { + return FALSE; + } + + fp = Open_File(filename, "rt"); + if(fp == NULL) { + return FALSE; // I3481 + } + + KMX_CHAR str[str_size], *p, *q, *context = NULL; + KMX_BOOL isEol , first = TRUE; + + while(fgets(str, str_size, fp)) + { + isEol = *(strchr(str, 0) - 1) == '\n'; + p = strtok_r(str, ";", &context); // I3481 + q = strtok_r(NULL, ";\n", &context); + if(p && q) + { + if(first && *p == (KMX_CHAR)0xEF && *(p+1) == (KMX_CHAR)0xBB && *(p+2) == (KMX_CHAR)0xBF) p += 3; // I3056 UTF-8 // I3512 + first = FALSE; + kmc_strupr(q); // I3481 // I3641 + long n = strtol(p, NULL, 16); + if (*q != '<') { + PKMX_WCHAR q0 = strtowstr(q); + AddCode_IncludedCodes((int)n, q0); + delete[] q0; + } + } + if(!isEol ) + { + while(fgets(str, str_size, fp)) if(*(strchr(str, 0)-1) == '\n') break; + } + } + + fclose(fp); + + return TRUE; +} + +KMX_BOOL NamedCodeConstants::LoadFile(const KMX_CHAR *filename) +{ + const int buf_size = 260; + KMX_CHAR buf[buf_size]; + // Look in current directory first -- REMOVED AS DANGEROUS + /* strncpy(buf, filename, (buf_size-1)); buf[buf_size-1] = 0; // I3481 + if(kmcmp_FileExists(buf)) + return IntLoadFile(buf); + */ + // Then look in keyboard file directory (CompileDir) + strncpy(buf, CompileDir, (buf_size-1)); buf[buf_size-1] = 0; // I3481 + strncat(buf, filename, (buf_size-1)-strlen(CompileDir)); buf[buf_size-1] = 0; + if(kmcmp_FileExists(buf)) + return IntLoadFile(buf); + + //TODO: sort out how to find common includes in non-Windows platforms: + #ifdef _WINDOWS_ + // Finally look in kmcmpdll.dll directory + GetModuleFileName(0, buf, buf_size); + + KMX_CHAR *p = strrchr_slash(buf); + if(p) + p++; + else + p = buf; + *p = 0; + strncat_s(buf, _countof(buf), filename, (buf_size-1)-strlen(buf)); buf[buf_size-1] = 0; // I3481 // I3641 + if(kmcmp_FileExists(buf)) + return IntLoadFile(buf); + #endif + + reindex(); + + return FALSE; +} + +void NamedCodeConstants::reindex() +{ + if (entries != NULL) { + qsort(entries, nEntries, sizeof(NCCENTRY), sort_entries); + } + + KMX_WCHAR c = u'.', d; + int i; + + for(i = 0; i < 128; i++) chrindexes[i] = -1; + + if (entries != NULL) { + for (i = 0; i < nEntries; i++) + { + d = towupper(entries[i].name[0]); + if (d != c && d >= 32 && d <= 127) + chrindexes[c = d] = i; + } + } +} + +int NamedCodeConstants::GetCode(const KMX_WCHAR *codename, KMX_DWORD *storeIndex) +{ + *storeIndex = 0xFFFFFFFFL; // I2993 + int code = GetCode_IncludedCodes(codename); + if(code) return code; + for(int i = 0; i < nEntries_file; i++) { + if(!u16icmp(entries_file[i].name, codename)) { + *storeIndex = entries_file[i].storeIndex; + return entries_file[i].code; + } + } + return 0; +} + +int NamedCodeConstants::GetCode_IncludedCodes(const KMX_WCHAR *codename) +{ + KMX_WCHAR c = towupper(*codename); + int code; + + if(IsHangulSyllable(codename, &code)) return code; + + if(c < 32 || c > 127 || chrindexes[c] < 0) return 0; + for(int n = chrindexes[c]; n < nEntries && towupper(entries[n].name[0]) == c; n++) + { + int cmp = u16icmp(codename, entries[n].name); + if(cmp == 0) return entries[n].code; + if(cmp < 0) break; + } + return 0; +} + +/* + + Hangul Syllables + +*/ + +const int + HangulSBase = 0xAC00, + //HangulLBase = 0x1100, + //HangulVBase = 0x1161, + //HangulTBase = 0x11A7, + HangulLCount = 19, + HangulVCount = 21, + HangulTCount = 28; + //HangulNCount = HangulVCount * HangulTCount; // 588 + //HangulSCount = HangulLCount * HangulNCount; // 11172 + +const KMX_WCHAR * + Hangul_JAMO_L_TABLE[] = { + u"G", u"GG", u"N", u"D", u"DD", u"R", u"M", u"B", u"BB", + u"S", u"SS", u"", u"J", u"JJ", u"C", u"K", u"T", u"P", u"H" }; + +const KMX_WCHAR * + Hangul_JAMO_V_TABLE[] = { + u"A", u"AE", u"YA", u"YAE", u"EO", u"E", u"YEO", u"YE", u"O", + u"WA", u"WAE", u"OE", u"YO", u"U", u"WEO", u"WE", u"WI", + u"YU", u"EU", u"YI", u"I" }; + + +const KMX_WCHAR * + Hangul_JAMO_T_TABLE[] = { + u"", u"G", u"GG", u"GS", u"N", u"NJ", u"NH", u"D", u"u", u"LG", u"LM", + u"LB", u"LS", u"LT", u"LP", u"LH", u"M", u"B", u"BS", + u"S", u"SS", u"NG", u"J", u"C", u"K", u"T", u"P", u"H" }; + + +int IsHangulSyllable(const KMX_WCHAR *codename, int *code) +{ + if(u16nicmp(codename, u"HANGUL_SYLLABLE_", 16)) return 0; + codename += 16; + if(!*codename) return 0; + + int i, LIndex, VIndex, TIndex; + + /* Find initial */ + + int ch = towupper(*codename); + if(strchr("GNDRMBSJCKTPH", ch)) + { + /* Has an initial syllable */ + int isDoubled = towupper(*(codename+1)) == ch; + + LIndex = -1; + for(i = 0; i < HangulLCount; i++) { + if(Hangul_JAMO_L_TABLE[i][0] == ch && (!isDoubled || (Hangul_JAMO_L_TABLE[i][1] == ch && isDoubled))) { + LIndex = i; + break; + } + } + if(LIndex == -1) return 0; + codename++; + if(isDoubled) codename++; + } + else LIndex = 11; /* no initial */ + + /* Find vowel */ + + KMX_WCHAR V[4] = u""; + V[0] = *codename; + if(V[0] && strchr("AEIOUWY", towupper(*(codename+1)))) V[1] = *(codename+1); + if(V[1] && strchr("AEIOUWY", towupper(*(codename+2)))) V[2] = *(codename+2); + + VIndex = -1; + for(i = 0; i < HangulVCount; i++) { + if(!u16icmp(Hangul_JAMO_V_TABLE[i], V)) { + VIndex = i; + break; + } + } + + if(VIndex == -1) return 0; + + codename += u16len(V); + + /* Find final */ + + TIndex = -1; + + for(i = 0; i < HangulTCount; i++) { + if(!u16icmp(Hangul_JAMO_T_TABLE[i], codename)) { + TIndex = i; + break; + } + } + + if(TIndex == -1) return 0; + + /* Composition */ + + *code = (HangulSBase + (LIndex * HangulVCount + VIndex) * HangulTCount) + TIndex; + + return 1; +} diff --git a/developer/src/kmcmplib/src/NamedCodeConstants.h b/developer/src/kmcmplib/src/NamedCodeConstants.h new file mode 100644 index 0000000000000000000000000000000000000000..83d707d092cc4535a24cf3676aaa3d2a44d7b859 --- /dev/null +++ b/developer/src/kmcmplib/src/NamedCodeConstants.h @@ -0,0 +1,37 @@ + +#ifndef NAMEDCODECONSTANTS_H +#define NAMEDCODECONSTANTS_H + +#define MAX_ENAME 128 +#define ALLOC_SIZE 256 + +struct NCCENTRY +{ + KMX_WCHAR name[MAX_ENAME+1]; + int code; + KMX_DWORD storeIndex; +}; + +namespace kmcmp{ + class NamedCodeConstants + { + private: + NCCENTRY *entries; // entries from &includecodes + NCCENTRY *entries_file; // entries from store(myconst) x + int nEntries, nEntries_file; + int chrindexes[128]; // A-Z, 0-9, -, _; simple index + + int GetCode_IncludedCodes(const KMX_WCHAR *codename); + void AddCode_IncludedCodes(int n, const KMX_WCHAR *p); + KMX_BOOL IntLoadFile(const KMX_CHAR *filename); + public: + NamedCodeConstants(); + ~NamedCodeConstants(); + + void reindex(); + void AddCode(int n, const KMX_WCHAR *p, KMX_DWORD storeIndex); + KMX_BOOL LoadFile(const KMX_CHAR *filename); + int GetCode(const KMX_WCHAR *codename, KMX_DWORD *storeIndex); + }; +} +#endif //NAMEDCODECONSTANTS_H diff --git a/developer/src/kmcmplib/src/UnreachableRules.cpp b/developer/src/kmcmplib/src/UnreachableRules.cpp new file mode 100644 index 0000000000000000000000000000000000000000..9c6aaa23adb32e2e7162794bda48f19d9d182ee8 --- /dev/null +++ b/developer/src/kmcmplib/src/UnreachableRules.cpp @@ -0,0 +1,57 @@ + +#include "pch.h" + +#include "compfile.h" +#include +#include "../../../../common/windows/cpp/include/vkeys.h" +#include "kmcmplib.h" + +#include +#include +#include +#include + +#include "UnreachableRules.h" + +namespace kmcmp { + std::wstring MakeHashKeyFromFileKey(PFILE_KEY kp) { + std::wstringstream key; + key << kp->Key << "," << kp->ShiftFlags << ","; + if (kp->dpContext) { + std::wstring Context_ws = u16fmt((const PKMX_WCHAR) kp->dpContext); + key << Context_ws; + } + return key.str(); + } + +} +KMX_DWORD VerifyUnreachableRules(PFILE_GROUP gp) { + PFILE_KEY kp = gp->dpKeyArray; + KMX_DWORD i; + + int oldCurrentLine = kmcmp::currentLine; + + std::unordered_map map; + std::unordered_set reportedLines; + + for (i = 0; i < gp->cxKeyArray; i++, kp++) { + std::wstring key = kmcmp::MakeHashKeyFromFileKey(kp); + if (map.count(key) > 0) { + FILE_KEY const & k1 = map.at(key); + if (kp->Line != k1.Line && reportedLines.count(kp->Line) == 0) { + reportedLines.insert(kp->Line); + kmcmp::currentLine = kp->Line; + u16sprintf(ErrExtraW, ERR_EXTRA_W_LEN, L" Overridden by rule on line %d", k1.Line); + strcpy(ErrExtraLIB, string_from_u16string(ErrExtraW).c_str()); + AddWarning(CHINT_UnreachableRule); + } + } + else { + map.insert({ key, *kp }); + } + } + + kmcmp::currentLine = oldCurrentLine; + + return CERR_None; +} diff --git a/developer/src/kmcmplib/src/UnreachableRules.h b/developer/src/kmcmplib/src/UnreachableRules.h new file mode 100644 index 0000000000000000000000000000000000000000..d9eac65ce3cbec70fa2a88795db96fd28e0e6bf0 --- /dev/null +++ b/developer/src/kmcmplib/src/UnreachableRules.h @@ -0,0 +1,3 @@ +#pragma once + +KMX_DWORD VerifyUnreachableRules(PFILE_GROUP gp); diff --git a/developer/src/kmcmplib/src/compfile.h b/developer/src/kmcmplib/src/compfile.h new file mode 100644 index 0000000000000000000000000000000000000000..48be5f20482f444dde7ec9b516b835b1d15ba77e --- /dev/null +++ b/developer/src/kmcmplib/src/compfile.h @@ -0,0 +1,220 @@ +/* + Name: Compfile + Copyright: Copyright (C) SIL International. + Documentation: + Description: + Create Date: 25 Jan 2007 + + Modified Date: 25 May 2010 + Authors: mcdurdin + Related Files: + Dependencies: + + Bugs: + Todo: + Notes: + History: 25 Jan 2007 - mcdurdin - Add GLOBAL_BUFSIZE, enlarge LINESIZE + 25 May 2010 - mcdurdin - I1632 - Keyboard Options +*/ + +#ifndef _COMPFILE_H +#define _COMPFILE_H + +#include "kmcompx.h" +#include + +#define LINESIZE 8192 +#define GLOBAL_BUFSIZE 4096 + +#define SZMAX_STORENAME 80 +#define SZMAX_GROUPNAME 80 +#define SZMAX_DEADKEYNAME 80 +#define SZMAX_ERRORTEXT 512 +#define SZMAX_VKDICTIONARYNAME 80 + +#define MAX_WARNINGS 100 + +#define T_COMMENT 1 // A comment line +#define T_KEYTOKEY 2 // A rule line +#define T_BLANK 3 // A blank line + +#define T_W_START 4 // Start of easily matched line types +#define T_STORE 4 // A store line +#define T_VERSION 5 // A 'VERSION 3.2/3.1/3.0' line +#define T_NAME 6 // A 'NAME "xxxx"' line +#define T_BITMAP 7 // A 'BITMAP bmpfile' line +#define T_HOTKEY 8 // A 'HOTKEY "^%+C"' line +#define T_BEGIN 9 // A 'begin > use(xxxx)' line +#define T_GROUP 10 // A 'group(xxxx)' line +#define T_MATCH 11 // A 'match > "XXXX"' line +#define T_NOMATCH 12 // A 'nomatch > "XXXX"' line +#define T_SHIFT 13 // A 'SHIFT FREES CAPS' line +#define T_CAPSON 14 // A 'CAPS ON ONLY' line +#define T_CAPSOFF 15 // A 'CAPS ALWAYS OFF' line +#define T_LANGUAGE 16 // A 'LANGUAGE xxxh, xxh' line +#define T_LAYOUT 17 // A 'LAYOUT xxxxh' line +#define T_COPYRIGHT 18 // A 'COPYRIGHT "so and so"' line +#define T_MESSAGE 19 // A 'MESSAGE "so and so"' line +#define T_LANGUAGENAME 20 // A 'LANGUAGENAME "xxxx"' line +#define T_BITMAPS 21 // An unused 'BITMAPS' line (version 3.x) +#define T_W_END 21 // End of easily matched rule types + +#define T_UNKNOWN 99 // Unrecognized line type (illegal line) + +#define GDS_CUTLEAD 0x01 // GetDelimitedString: cut leading spaces +#define GDS_CUTFOLL 0x02 // GetDelimitedString: cut following spaces + +#define GXS_LINE 0x00 // GetExtendedString error: in a "line" +#define GXS_RULE 0x01 // GetExtendedString error: in a "rule" +#define GXS_STORE 0x02 // GetExtendedString error: in a "store" + +enum FileStoreType { FST_STORE, FST_OPTION, FST_RESERVED }; + +struct FILE_STORE { + KMX_DWORD dwSystemID; + KMX_WCHAR szName[SZMAX_STORENAME]; // the name of the store + PKMX_WCHAR dpString; // from start of store structure + //FileStoreType fstType; + KMX_BOOL fIsStore; + KMX_BOOL fIsReserved; + KMX_BOOL fIsOption; + KMX_BOOL fIsDebug; + KMX_BOOL fIsCall; + int line; + }; + +typedef FILE_STORE * PFILE_STORE; + + +struct FILE_KEY { + KMX_WCHAR Key; // WCHAR for consistency; only a byte used however + KMX_WORD LineStoreIndex; + KMX_DWORD Line; + KMX_DWORD ShiftFlags; + PKMX_WCHAR dpOutput; // from start of key structure + PKMX_WCHAR dpContext; // from start of key structure + }; +typedef FILE_KEY *PFILE_KEY; + + +struct FILE_GROUP { + KMX_WCHAR szName[SZMAX_GROUPNAME]; + PFILE_KEY dpKeyArray; // address of first item in key array, from start of group structure + PKMX_WCHAR dpMatch; // from start of group structure + PKMX_WCHAR dpNoMatch; // from start of group structure + KMX_DWORD cxKeyArray; // in array items + KMX_BOOL fUsingKeys; // group(xx) [using keys] <-- specified or not + KMX_BOOL fReadOnly; // group(xx) [readonly] <-- specified or not + KMX_DWORD Line; + }; +typedef FILE_GROUP *PFILE_GROUP; + +struct FILE_DEADKEY +{ + KMX_WCHAR szName[SZMAX_DEADKEYNAME]; +}; +typedef FILE_DEADKEY *PFILE_DEADKEY; + +struct FILE_VKDICTIONARY +{ + KMX_WCHAR szName[SZMAX_VKDICTIONARYNAME]; +}; +typedef FILE_VKDICTIONARY *PFILE_VKDICTIONARY; + +struct FILE_KEYBOARD { + KMX_DWORD KeyboardID; // as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts + + KMX_DWORD version; // keyboard file version with VERSION keyword + + PFILE_STORE dpStoreArray; // address of first item in store array, from start of store structure + PFILE_GROUP dpGroupArray; // address of first item in group array, from start of group structure + + KMX_DWORD cxStoreArray; // in number of items + KMX_DWORD cxGroupArray; // in number of items + KMX_DWORD StartGroup[2]; // index of starting groups [ANSI=0, Unicode=1] + + KMX_DWORD dwHotKey; // standard windows hotkey (hiword=shift/ctrl/alt stuff, loword=vkey) + + KMX_WCHAR szName[SZMAX_KEYBOARDNAME]; // Keyboard layout name + KMX_WCHAR szLanguageName[SZMAX_LANGUAGENAME]; // Language name + KMX_WCHAR szCopyright[SZMAX_COPYRIGHT]; // Copyright information + KMX_WCHAR szMessage[SZMAX_MESSAGE]; // General information about the keyboard + PKMX_BYTE lpBitmap; + KMX_DWORD dwBitmapSize; + KMX_DWORD dwFlags; // Flags for the keyboard file + + KMX_DWORD currentGroup; // temp - current processing group + KMX_DWORD currentStore; // temp - current processing store + KMX_DWORD cxDeadKeyArray; + PFILE_DEADKEY dpDeadKeyArray; // temp - dead key array + KMX_DWORD cxVKDictionary; + PFILE_VKDICTIONARY dpVKDictionary; // temp - virtual key dictionary + }; + +typedef FILE_KEYBOARD *PFILE_KEYBOARD; + +/* +These size values are used in unit tests to ensure +that the structure sizes correspond precisely across +compilers (pas and c++). +*/ + +const KMX_DWORD sz_FILE_STORE = sizeof(FILE_STORE); +const KMX_DWORD sz_FILE_KEY = sizeof(FILE_KEY); +const KMX_DWORD sz_FILE_GROUP = sizeof(FILE_GROUP); +const KMX_DWORD sz_FILE_DEADKEY = sizeof(FILE_DEADKEY); +const KMX_DWORD sz_FILE_VKDICTIONARY = sizeof(FILE_VKDICTIONARY); +const KMX_DWORD sz_FILE_KEYBOARD = sizeof(FILE_KEYBOARD); + +struct COMPMSG { + KMX_CHAR szText[SZMAX_ERRORTEXT]; + KMX_DWORD Line; + KMX_DWORD dwMsgCode; + }; + +typedef COMPMSG *PCOMPMSG; + +struct COMPILEMESSAGES { + int nMessages; + int nErrors; + + PCOMPMSG cm; + + KMX_DWORD fatalCode; + KMX_CHAR szFatalText[SZMAX_ERRORTEXT]; + + KMX_DWORD currentLine; + }; + +typedef COMPILEMESSAGES *PCOMPILEMESSAGES; + +/* +struct TVersion +{ + //int MinVersion; // 0x0500 usually + //int CompilerVersion[4]; + //int MinCompilerVersion[4]; + int KeyboardVersion; // 0x0500 usually +}; + +extern TVersion FVersionInfo; +*/ + +/* +#define bstrcpy(c,d) (LPBYTE)strcpy((LPSTR)(c),(LPSTR)(d)) +#define bstrlen(c) strlen((LPSTR)(c)) +#define bstrcmp(c,d) strcmp((LPSTR)(c),(LPSTR)(d)) +#define bstrncmp(c,d,n) strncmp((LPSTR)(c),(LPSTR)(d),(n)) +#define bstrnicmp(c,d,n) strnicmp((LPSTR)(c),(LPSTR)(d),(n)) +#define bstricmp(c,d) stricmp((LPSTR)(c),(LPSTR)(d)) +#define bstrchr(c,ch) (LPBYTE)strchr((LPSTR)(c),(char)ch) +#define bstrncpy(c,d,n) (LPBYTE)strncpy((LPSTR)(c),(LPSTR)(d),(n)) +#define bstrtok(c,d) (LPBYTE)strtok((LPSTR)(c),(LPSTR)(d)) +#define bstrcat(c,d) (LPBYTE)strcat((LPSTR)(c),(LPSTR)(d)) +#define bstrncat(c,d,n) (LPBYTE)strncat((LPSTR)(c),(LPSTR)(d),(n)) +#define bstrrev(c) (LPBYTE)strrev((LPSTR)(c)) +#define batoi(c) atoi((LPSTR)(c)) +#define bstrtol(c,d,n) strtol((LPSTR)(c),(LPSTR *)(d),(n)) +*/ + +#endif // _COMPFILE_H diff --git a/developer/src/kmcmplib/src/debugstore.h b/developer/src/kmcmplib/src/debugstore.h new file mode 100644 index 0000000000000000000000000000000000000000..c54e3b45c343cb1eb3fdf006134253d706c8d915 --- /dev/null +++ b/developer/src/kmcmplib/src/debugstore.h @@ -0,0 +1,20 @@ + +#ifndef DEBUGSTORE_H +#define DEBUGSTORE_H + +#define DEBUGSTORE_BEGIN u"B" +#define DEBUGSTORE_BEGIN_C u'B' + +#define DEBUGSTORE_MATCH u"M" +#define DEBUGSTORE_MATCH_C u'M' + +#define DEBUGSTORE_NOMATCH u"N" +#define DEBUGSTORE_NOMATCH_C u'N' + +#define DEBUGSTORE_GROUP u"G" +#define DEBUGSTORE_GROUP_C u'G' + +#define DEBUGSTORE_DEADKEY u"D" +#define DEBUGSTORE_DEADKEY_C u'D' + +#endif /* DEBUGSTORE_H */ diff --git a/developer/src/kmcmplib/src/filesystem.cpp b/developer/src/kmcmplib/src/filesystem.cpp new file mode 100644 index 0000000000000000000000000000000000000000..a343641acc128ed5537e0e1835d45a2253c29f2e --- /dev/null +++ b/developer/src/kmcmplib/src/filesystem.cpp @@ -0,0 +1,188 @@ + +#ifdef __EMSCRIPTEN__ +#include +#include +#endif + +#include +#include +#include +#include "filesystem.h" + +#ifdef _MSC_VER +#include +#else +#include +#endif + +//#define _DEBUG_FOPEN 1 + +#ifdef __EMSCRIPTEN__ + +const std::string get_wasm_file_path(const std::string& filename) { + // Verify that we are passing a fully-qualified path + // TODO: we need to support relative paths based on CWD +#if _DEBUG_FOPEN + std::cout << "get_wasm_file_path ENTER (" << filename << ")" << std::endl; +#endif + + assert( + (filename.length() > 0 && filename.at(0) == '/') || + (filename.length() > 1 && filename.at(1) == ':') + ); + +#if _DEBUG_FOPEN + std::cout << "get_wasm_file_path assert passed " << std::endl; +#endif + + EM_ASM_({ + //console.log('EM_ASM enter'); + let path = Module.UTF8ToString($0); + const isWin32Path = path.match(/^[a-zA-Z]:/); + + //console.log('EM_ASM path = '+path); + let root = '/nodefs-mount'; + if(!FS.analyzePath(root).exists) { + //console.log('EM_ASM mkdir '+root); + FS.mkdir(root); + if(!isWin32Path) { + //console.log('EM_ASM mount '+root); + FS.mount(NODEFS, {root : '/'}, root); + } + } + + if(isWin32Path) { + // Win32 path, one mount per drive + root += "/" + path.charAt(0); + if(!FS.analyzePath(root).exists) { + //console.log('EM_ASM mkdir '+root); + FS.mkdir(root); + //console.log('EM_ASM mount '+root); + FS.mount(NODEFS, {root : path.substr(0,3) }, root); + } + } + }, filename.c_str()); + +#if _DEBUG_FOPEN + std::cout << "get_wasm_file_path EM_ASM_ passed " << std::endl; +#endif + + std::string f = std::string("/nodefs-mount"); + + if(filename.length() > 2 && filename.at(1) == ':') { + f += std::string("/") + filename.at(0) + filename.substr(2); + } else { + f += filename; + } + +#if _DEBUG_FOPEN + std::cout << "get_wasm_file_path opening virtual path: " << f << std::endl; +#endif + + return f; +} + +FILE* fopen_wasm(const std::string& filename, const std::string& mode) { + std::string f = get_wasm_file_path(filename); + FILE* fp = fopen(f.c_str(), mode.c_str()); + +#if _DEBUG_FOPEN + std::cout << "get_wasm_file_path fopen called, returned " << fp << std::endl; +#endif + + return fp; +} + +#endif + +#ifndef _MSC_VER +#ifdef __EMSCRIPTEN__ +#define fopen_wrapper fopen_wasm +#else +#define fopen_wrapper fopen +#endif +#endif + +FILE* Open_File(const KMX_CHAR* Filename, const KMX_CHAR* mode) { +#ifdef _MSC_VER + std::string cpath = Filename; //, cmode = mode; + std::replace(cpath.begin(), cpath.end(), '/', '\\'); + return fopen(cpath.c_str(), (const KMX_CHAR*) mode); +#else + return fopen_wrapper(Filename, mode); + std::string cpath, cmode; + cpath = (const KMX_CHAR*) Filename; + cmode = (const KMX_CHAR*) mode; + return fopen_wrapper(cpath.c_str(), cmode.c_str()); +#endif +}; + +FILE* Open_File(const KMX_WCHART* Filename, const KMX_WCHART* mode) { +#ifdef _MSC_VER + std::wstring cpath = Filename; //, cmode = mode; + std::replace(cpath.begin(), cpath.end(), '/', '\\'); + return _wfsopen(cpath.c_str(), mode, _SH_DENYWR); +#else + std::string cpath, cmode; + cpath = string_from_wstring(Filename); + cmode = string_from_wstring(mode); + return fopen_wrapper(cpath.c_str(), cmode.c_str()); +#endif +}; + +FILE* Open_File(const KMX_WCHAR* Filename, const KMX_WCHAR* mode) { +#ifdef _MSC_VER + std::wstring cpath = convert_pchar16T_To_wstr((KMX_WCHAR*) Filename); + std::wstring cmode = convert_pchar16T_To_wstr((KMX_WCHAR*) mode); + std::replace(cpath.begin(), cpath.end(), '/', '\\'); + return _wfsopen(cpath.c_str(), cmode.c_str(), _SH_DENYWR); +#else + std::string cpath, cmode; + cpath = string_from_u16string(Filename); + cmode = string_from_u16string(mode); + return fopen_wrapper(cpath.c_str(), cmode.c_str()); +#endif +}; + +KMX_BOOL kmcmp_FileExists(const KMX_CHAR *filename) { + +#ifdef _MSC_VER + intptr_t n; + _finddata_t fi; + if((n = _findfirst(filename, &fi)) != -1) { + _findclose(n); + return TRUE; + } +#else //!_MSC_VER + +#ifdef __EMSCRIPTEN__ + std::string f = get_wasm_file_path(filename); +#else //!__EMSCRIPTEN__ + std::string f = filename; +#endif // !__EMSCRIPTEN__ + + if(access(f.c_str(), F_OK) != -1) { + return TRUE; + } + +#endif // !_MSC_VER + + return FALSE; +} + +KMX_BOOL kmcmp_FileExists(const KMX_WCHAR* filename) { +#ifdef _MSC_VER + intptr_t n; + _wfinddata_t fi; + if((n = _wfindfirst((wchar_t*) filename, &fi)) != -1) { + _findclose(n); + return TRUE; + } +#else + std::string cpath; + cpath = string_from_u16string(filename); + return kmcmp_FileExists(cpath.c_str()); +#endif + + return FALSE; +}; diff --git a/developer/src/kmcmplib/src/filesystem.h b/developer/src/kmcmplib/src/filesystem.h new file mode 100644 index 0000000000000000000000000000000000000000..786b7268ac0c09bdda634296445e7e448404cc1e --- /dev/null +++ b/developer/src/kmcmplib/src/filesystem.h @@ -0,0 +1,12 @@ +#pragma once + +#include +#include "kmx_u16.h" + +// Opens files on windows and non-windows platforms. Datatypes for Filename and mode must be the same. +// returns FILE* if file could be opened; FILE needs to be closed in calling function +FILE* Open_File(const KMX_CHAR* Filename, const KMX_CHAR* mode); +FILE* Open_File(const KMX_WCHART* Filename, const KMX_WCHART* mode); +FILE* Open_File(const KMX_WCHAR* Filename, const KMX_WCHAR* mode); +KMX_BOOL kmcmp_FileExists(const KMX_CHAR *filename); +KMX_BOOL kmcmp_FileExists(const KMX_WCHAR *filename); diff --git a/developer/src/kmcmplib/src/json-validation.cpp b/developer/src/kmcmplib/src/json-validation.cpp new file mode 100644 index 0000000000000000000000000000000000000000..f58d8c950534943427285a4f400fb39c190217ff --- /dev/null +++ b/developer/src/kmcmplib/src/json-validation.cpp @@ -0,0 +1,68 @@ + +#include +#include + +#include +#include "kmcompx.h" + +using nlohmann::json; +using nlohmann::json_uri; +using nlohmann::json_schema_draft4::json_validator; + +static void loader(const json_uri &uri, json &schema) +{ + std::fstream lf("." + uri.path()); + if (!lf.good()) + throw std::invalid_argument("could not open " + uri.url() + " tried with " + uri.path()); + + lf >> schema; +} + +EXTERN bool kmcmp_ValidateJsonFile(std::fstream& f, std::fstream& fd, kmcmp_ValidateJsonMessageProc MessageProc, void* context) { + if (!f.good()) { + MessageProc(-1, "Schema file could not be loaded.", context); + return FALSE; + } + + // 1) Read the schema for the document you want to validate + json schema; + try { + f >> schema; + } + catch (std::exception &e) { + MessageProc(f.tellp(), e.what(), context); + return FALSE; + } + + // 2) create the validator and + json_validator validator(loader, [](const std::string &, const std::string &) {}); + + try { + // insert this schema as the root to the validator + // this resolves remote-schemas, sub-schemas and references via the given loader-function + validator.set_root_schema(schema); + } + catch (std::exception &e) { + MessageProc(-2, e.what(), context); + return FALSE; + } + + // 3) do the actual validation of the document + json document; + + if (!fd.good()) { + MessageProc(-3, "Json file could not be loaded.", context); + return FALSE; + } + + try { + fd >> document; + validator.validate(document); + } + catch (std::exception &e) { + MessageProc(fd.tellp(), e.what(), context); + return FALSE; + } + + return TRUE; +} \ No newline at end of file diff --git a/developer/src/kmcmplib/src/kmcmplib.h b/developer/src/kmcmplib/src/kmcmplib.h new file mode 100644 index 0000000000000000000000000000000000000000..a851915de2b13ec9257e6e9ab44e4178968b86dc --- /dev/null +++ b/developer/src/kmcmplib/src/kmcmplib.h @@ -0,0 +1,52 @@ +#pragma once + +#include +#include "compfile.h" +#include "NamedCodeConstants.h" + +namespace kmcmp { + KMX_BOOL AddCompileWarning(char* buf); + extern int currentLine; + extern KMX_BOOL FShouldAddCompilerVersion; + extern KMX_BOOL FSaveDebug, FCompilerWarningsAsErrors; // I4865 // I4866 + extern int ErrChr; + extern int nErrors; + extern KMX_BOOL FMnemonicLayout; + extern KMX_BOOL FOldCharPosMatching; + extern int CompileTarget; + extern KMX_CHAR CompileDir[260]; // TODO: this should not be a fixed buffer + extern int BeginLine[4]; + extern int currentLine; + extern NamedCodeConstants *CodeConstants; + + void RecordDeadkeyNames(PFILE_KEYBOARD fk); + KMX_DWORD AddCompilerVersionStore(PFILE_KEYBOARD fk); +} + +extern kmcmp_CompilerMessageProc msgproc; +extern void* msgprocContext; + +extern KMX_BOOL AWarnDeprecatedCode_GLOBAL_LIB; +#define ERR_EXTRA_LIB_LEN 256 +#define ERR_EXTRA_W_LEN 256 +extern char ErrExtraLIB[ERR_EXTRA_LIB_LEN]; +extern KMX_WCHAR ErrExtraW[ERR_EXTRA_W_LEN]; +KMX_BOOL AddCompileError(KMX_DWORD msg); + +/// Use AddWarningBool for functions that return bool or KMX_BOOL +#define AddWarningBool(warn) { if(AddCompileError(warn)) return FALSE; } +/// Use AddWarning for functions that return KMX_DWORD +#define AddWarning(warn) { if(AddCompileError(warn)) return CERR_Break; } + +PKMX_WCHAR strtowstr(PKMX_STR in); +PFILE_STORE FindSystemStore(PFILE_KEYBOARD fk, KMX_DWORD dwSystemID); +FILE* UTF16TempFromUTF8(FILE* fp_in , KMX_BOOL hasPreamble); +KMX_DWORD WriteCompiledKeyboard(PFILE_KEYBOARD fk, FILE* fp_out); +KMX_DWORD AddStore(PFILE_KEYBOARD fk, KMX_DWORD SystemID, KMX_WCHAR const * str, KMX_DWORD *dwStoreID= NULL); +KMX_DWORD ReadLine(FILE* fp_in , PKMX_WCHAR wstr, KMX_BOOL PreProcess); +KMX_DWORD ParseLine(PFILE_KEYBOARD fk, PKMX_WCHAR str); +KMX_DWORD ProcessGroupLine(PFILE_KEYBOARD fk, PKMX_WCHAR p); +KMX_DWORD ProcessGroupFinish(PFILE_KEYBOARD fk); +KMX_DWORD ProcessStoreLine(PFILE_KEYBOARD fk, PKMX_WCHAR p); +int LineTokenType(PKMX_WCHAR *str); +KMX_DWORD BuildVKDictionary(PFILE_KEYBOARD fk); // I3438 diff --git a/developer/src/kmcmplib/src/kmx_u16.cpp b/developer/src/kmcmplib/src/kmx_u16.cpp new file mode 100644 index 0000000000000000000000000000000000000000..582ef1ad97c905c2c31f8764a781b6eaad3446c3 --- /dev/null +++ b/developer/src/kmcmplib/src/kmx_u16.cpp @@ -0,0 +1,296 @@ + +//#include "../../kmcompx/include/kmcompx.h" +#include +#include "kmx_u16.h" + +#include +#include +#include +#include +#include +#include + +//String <- wstring +std::string string_from_wstring(std::wstring const str) { + std::wstring_convert, wchar_t> converter; + return converter.to_bytes(str); +} +//wstring <- string +std::wstring wstring_from_string(std::string const str) { + std::wstring_convert, wchar_t> converter; + return converter.from_bytes(str); +} + +//u16String <- string +std::u16string u16string_from_string(std::string const str) { + std::wstring_convert, char16_t> converter; + return converter.from_bytes(str); +} + +//string <- u16string +std::string string_from_u16string(std::u16string const str) { + std::wstring_convert, char16_t> converter; + return converter.to_bytes(str); +} + +// often used with c_str() e.g. u16fmt( DEBUGSTORE_MATCH).c_str() +// UTF16 (= const char16_t*) -> UTF8 (= std::string) -> UTF16 ( = std::wstring 16 bit) +std::wstring u16fmt(const KMX_WCHAR * str) { + std::wstring_convert, wchar_t> convert_wstring; + std::wstring_convert, char16_t> convert; + + // UTF16 (= const char16_t*) -> UTF8 (= std::string) -> UTF16 ( = std::wstring 16 bit) + std::string utf8str = convert.to_bytes(str); // UTF16 (= const char16_t*) -> UTF8 (= std::string) + std::wstring wstr = convert_wstring.from_bytes(utf8str); // UTF8 (= std::string) -> UTF16 ( = std::wstring 16 bit) + return wstr; +} + +void u16sprintf(KMX_WCHAR * dst, const size_t sz, const wchar_t* fmt, ...) { + // UTF16 (=const wchar_t*) -> -> std::string -> std::u16string -> UTF16 ( = char16_t*) + wchar_t* wbuf = new wchar_t[sz]; + va_list args; + va_start(args, fmt); + vswprintf(wbuf, sz, fmt, args); + va_end(args); + + std::wstring_convert, wchar_t> convert_wstring; + std::wstring_convert, char16_t> convert; + + // UTF16 (=const wchar_t*) -> -> std::string -> std::u16string -> UTF16 ( = char16_t*) + std::string utf8str = convert_wstring.to_bytes(wbuf); // UTF16 ( = const wchar_t*) -> std::string + std::u16string u16str = convert.from_bytes(utf8str); // std::string -> std::u16string + u16ncpy(dst, u16str.c_str(), sz); // std::u16string.c_str() -> char16_t* + delete[] wbuf; +} + + std::wstring convert_pchar16T_To_wstr(KMX_WCHAR *Name){ + // convert char16_t* -> std::u16string -> std::string -> std::wstring + // char16_t* -> std::u16string + std::u16string u16str(Name); + // std::u16string -> std::string + std::string stri = string_from_u16string(u16str); + // std::string -> std::wstring + std::wstring wstr = wstring_from_string(stri); + return wstr; + } + +long int u16tol(const KMX_WCHAR* str, KMX_WCHAR** endptr, int base) +{ + auto s = string_from_u16string(str); + char* t; + long int result = strtol(s.c_str(), &t, base); + if (endptr != nullptr) *endptr = (KMX_WCHAR*)str + (t - s.c_str()); + return result; +} + +std::string toHex(int num1) { + if (num1 == 0) + return "0"; + int num = num1; + std::string s = ""; + while (num) { + int temp = num % 16; + if (temp <= 9) + s += (48 + temp); + else + s += (87 + temp); + num = num / 16; + } + reverse(s.begin(), s.end()); + return s; +} + +const KMX_WCHAR * u16ncat(KMX_WCHAR *dst, const KMX_WCHAR *src, size_t max) { + KMX_WCHAR* o = dst; + dst = (KMX_WCHAR*) u16chr(dst, 0); + //max -= (dst-o); + while (*src && max > 0) { + *dst++ = *src++; + max--; + } + if(max > 0) + *dst = 0; + return o; +} + +const KMX_WCHAR* u16rchr_slash(KMX_WCHAR const* Name) +{ + const KMX_WCHAR* cp = NULL; + cp = u16rchr(Name, '\\'); + if (cp == NULL) + cp = u16rchr(Name, '/'); + return cp; +} + +KMX_CHAR* strrchr_slash(KMX_CHAR* Name) +{ + KMX_CHAR* cp = NULL; + cp = strrchr(Name, '\\'); + if (cp == NULL) + cp = strrchr(Name, '/'); + return cp; +} + +// u16rchr returns last occurence of ch in p; It returns NULL if ch = '\0' and NULL if ch is not found +const KMX_WCHAR* u16rchr(const KMX_WCHAR* p, KMX_WCHAR ch) { + const KMX_WCHAR* p_end = p + u16len(p) - 1; + + if (ch == '\0') return p_end + 1; + while (p_end >= p) { + if (*p_end == ch) return p_end; + p_end--; + } + return NULL; +} + +const KMX_WCHAR * u16chr(const KMX_WCHAR *p, KMX_WCHAR ch) { + while (*p) { + if (*p == ch) return p; + p++; + } + return ch == 0 ? p : NULL; +} + +const KMX_WCHAR * u16cpy(KMX_WCHAR *dst, const KMX_WCHAR *src) { + KMX_WCHAR *o = dst; + while (*src) { + *dst++ = *src++; + } + *dst = 0; + return o; +} + +const KMX_WCHAR * u16ncpy(KMX_WCHAR *dst, const KMX_WCHAR *src, size_t max) { + KMX_WCHAR *o = dst; + while (*src && max > 0) { + *dst++ = *src++; + max--; + } + while(max > 0) { + *dst++ = 0; + max--; + } + return o; +} + +size_t u16len(const KMX_WCHAR *p) { + int i = 0; + while (*p) { + p++; + i++; + } + return i; +} + +int u16cmp(const KMX_WCHAR *p, const KMX_WCHAR *q) { + while (*p && *q) { + if (*p != *q) return *p - *q; + p++; + q++; + } + return *p - *q; +} + +int u16nicmp(const KMX_WCHAR *p, const KMX_WCHAR *q, size_t count) { + while (*p && *q && count) { + if (toupper(*p) != toupper(*q)) return *p - *q; + p++; + q++; + count--; + } + if (count) + return *p - *q; + return 0; +} + +int u16icmp(const KMX_WCHAR *p, const KMX_WCHAR *q) { + while (*p && *q) { + if (toupper(*p) != toupper(*q)) return *p - *q; + p++; + q++; + } + return *p - *q; +} + +int u16ncmp(const KMX_WCHAR *p, const KMX_WCHAR *q, size_t count) { + while (*p && *q && count) { + if (*p != *q) return *p - *q; + p++; + q++; + count--; + } + if (count) + return *p - *q; + return 0; +} + +KMX_WCHAR * u16tok(KMX_WCHAR *p, KMX_WCHAR ch, KMX_WCHAR **ctx) { + if (!p) { + p = *ctx; + if (!p) return NULL; + } + + KMX_WCHAR *q = p; + while (*q && *q != ch) { + q++; + } + if (*q) { + *q = 0; + q++; + while (*q == ch) q++; + *ctx = q; + } + else { + *ctx = NULL; + } + return p; +} + +KMX_WCHAR * u16tok(KMX_WCHAR* p, KMX_WCHAR* delim, KMX_WCHAR** ctx) { + if (!p) { + p = *ctx; + if (!p) return NULL; + } + + KMX_WCHAR * q = p; + while (*q && !u16chr(delim, *q)) { + q++; + } + if (*q) { + *q = 0; + q++; + while (u16chr(delim, *q)) q++; + *ctx = q; + } + else { + *ctx = NULL; + } + return p; +} + +double u16tof( KMX_WCHAR* str) +{ + double val = 0; + int offsetdot=0; + char digit; + + PKMX_WCHAR q = (PKMX_WCHAR)u16chr(str, '.'); + size_t pos_dot = q-str ; + + if (pos_dot < 0) + pos_dot = u16len(str); + + for (size_t i = 0; i < u16len(str); i++) + { + digit = static_cast(towupper(*str)); + + if (i > pos_dot - 1) + offsetdot = 1; + + if (digit != '.') + val =val+ ((int(digit)) - 48) * pow(10, (pos_dot - 1- i + offsetdot)); + + str++; + } + return val; +} diff --git a/developer/src/kmcmplib/src/kmx_u16.h b/developer/src/kmcmplib/src/kmx_u16.h new file mode 100644 index 0000000000000000000000000000000000000000..99ad2006bbbe57c57734a1a57c71e4538e318972 --- /dev/null +++ b/developer/src/kmcmplib/src/kmx_u16.h @@ -0,0 +1,37 @@ +#pragma once + +#include +#include +#include +#include +#include "kmcompx.h" + +std::string string_from_wstring(std::wstring const str); +std::wstring wstring_from_string(std::string const str); +std::u16string u16string_from_string(std::string const str); +std::string string_from_u16string(std::u16string const str); + +std::wstring u16fmt(const KMX_WCHAR * str); +void u16sprintf(KMX_WCHAR * dst, const size_t sz, const wchar_t* fmt, ...) ; + +std::wstring convert_pchar16T_To_wstr(KMX_WCHAR *Name); + +size_t u16len(const KMX_WCHAR *p); +int u16cmp(const KMX_WCHAR *p, const KMX_WCHAR *q); +int u16icmp(const KMX_WCHAR *p, const KMX_WCHAR *q); +int u16ncmp(const KMX_WCHAR *p, const KMX_WCHAR *q, size_t count); +int u16nicmp(const KMX_WCHAR *p, const KMX_WCHAR *q, size_t count) ; +const KMX_WCHAR * u16ncpy(KMX_WCHAR *dst, const KMX_WCHAR *src, size_t max); +const KMX_WCHAR * u16cpy(KMX_WCHAR *dst, const KMX_WCHAR *src); +const KMX_WCHAR * u16rchr(const KMX_WCHAR *p, KMX_WCHAR ch) ; +const KMX_WCHAR * u16chr(const KMX_WCHAR *p, KMX_WCHAR ch) ; +const KMX_WCHAR * u16ncat(KMX_WCHAR *dst, const KMX_WCHAR *src, size_t max); +KMX_WCHAR * u16tok(KMX_WCHAR *p, KMX_WCHAR ch, KMX_WCHAR **ctx) ; +KMX_WCHAR * u16tok(KMX_WCHAR* p, KMX_WCHAR* ch, KMX_WCHAR** ctx) ; +long int u16tol(const KMX_WCHAR* str, KMX_WCHAR** endptr, int base) ; +double u16tof( KMX_WCHAR* str); + +KMX_CHAR* strrchr_slash(KMX_CHAR* Name); +const KMX_WCHAR* u16rchr_slash(KMX_WCHAR const* Name); + +std::string toHex(int num1); diff --git a/developer/src/kmcmplib/src/meson.build b/developer/src/kmcmplib/src/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..fa51ca28a502faf4405f20967bd2aedb70b2b915 --- /dev/null +++ b/developer/src/kmcmplib/src/meson.build @@ -0,0 +1,88 @@ +# +# Keyman is copyright (C) SIL International. MIT License. +# +# Cross platform build script to compile kmcompx +# + +# TODO: is this required? It should be Keyman Core only +defns += ['-DKMN_KBP_EXPORTING'] +version_res = [] + +if cpp_compiler.get_id() == 'gcc' or cpp_compiler.get_id() == 'clang' + warns += [ + '-Wall', + '-Wextra' + ] +endif + +if cpp_compiler.get_id() == 'msvc' + # /n = append null + # /c65001 = utf-8 file format + version_res += import('windows').compile_resources('version.rc', args:['/n','/c65001']) +endif + +name_suffix = [] + +if cpp_compiler.get_id() == 'emscripten' + links += ['-lnodefs.js', '-sMODULARIZE', '-sEXPORT_ES6', '-sEXPORTED_RUNTIME_METHODS=[\'cwrap\', \'UTF8ToString\']'] + # tests are building as ES6 so we need to declare the file extension + # note that meson currently struggles with the sanitycheckc_cross.exe + # program, because it has a hard coded extension (.exe) which is not + # valid for node programs in module mode. + name_suffix = '.mjs' +endif + +icu = subproject('icu-for-uset', default_options: [ 'default_library=static', 'cpp_std=c++17', 'warning_level=0', 'werror=false']) +icuuc_dep = icu.get_variable('icuuc_dep') + +lib = library('kmcmplib', + 'CasedKeys.cpp', + 'CharToKeyConversion.cpp', + 'Compiler.cpp', + 'CompilerInterfaces.cpp', + 'DeprecationChecks.cpp', + 'Edition.cpp', + 'filesystem.cpp', + 'json-validation.cpp', + 'NamedCodeConstants.cpp', + 'versioning.cpp', + 'virtualcharkeys.cpp', + 'xstring.cpp', + 'CharToKeyConversion.cpp', + 'CheckFilenameConsistency.cpp', + 'CheckForDuplicates.cpp', + 'CheckNCapsConsistency.cpp', + 'UnreachableRules.cpp', + 'kmx_u16.cpp', + 'CompMsg.cpp', + 'uset-api.cpp', + + '../../../../common/windows/cpp/src/ConvertUTF.c', + '../../../../common/windows/cpp/src/crc32.cpp', + '../../../../common/windows/cpp/src/vkeys.cpp', + 'xstring.cpp', + + '../../ext/json-schema-validator/json-schema-draft4.json.cpp', + '../../ext/json-schema-validator/json-uri.cpp', + '../../ext/json-schema-validator/json-validator.cpp', + version_res, + cpp_args: defns + warns + flags, + link_args: links, + version: meson.project_version(), + include_directories: inc, + install: true, + dependencies: icuuc_dep) + +kmcmplib = declare_dependency(link_with: lib, include_directories: inc) + + +if cpp_compiler.get_id() == 'emscripten' + # Build an executable + host = executable('wasm-host', #'wasm-host.cpp', + cpp_args: defns, + include_directories: inc, + link_args: links, + objects: lib.extract_all_objects(), + dependencies: icuuc_dep) +endif + diff --git a/developer/src/kmcmplib/src/pch.cpp b/developer/src/kmcmplib/src/pch.cpp new file mode 100644 index 0000000000000000000000000000000000000000..17305716aacd2a39a54423c3fb2000dc2266794a --- /dev/null +++ b/developer/src/kmcmplib/src/pch.cpp @@ -0,0 +1 @@ +#include "pch.h" \ No newline at end of file diff --git a/developer/src/kmcmplib/src/pch.h b/developer/src/kmcmplib/src/pch.h new file mode 100644 index 0000000000000000000000000000000000000000..f878ad11be4f892ad4e9f0ece5864712c6af5c6b --- /dev/null +++ b/developer/src/kmcmplib/src/pch.h @@ -0,0 +1,15 @@ +#pragma once + +#include + +#define USE_CHAR16_T +#include +#include "kmx_u16.h" +#include + +#include "../../../../common/windows/cpp/include/crc32.h" + +#include +#include + +#include diff --git a/developer/src/kmcmplib/src/uset-api.cpp b/developer/src/kmcmplib/src/uset-api.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1aa22477b2b63465a8cb0db8b7d624409d9ce083 --- /dev/null +++ b/developer/src/kmcmplib/src/uset-api.cpp @@ -0,0 +1,55 @@ +#include +#include "kmcompx.h" + +#include "unicode/uniset.h" +#include "unicode/unistr.h" + +EXTERN int kmcmp_ParseUnicodeSet( + const char* szText, + uint32_t* outputBuffer, + uint32_t outputBufferSize +) { + if (szText == nullptr) { + // null string coming in + return KMCMP_ERROR_SYNTAX_ERR; + } + const icu::UnicodeString str = icu::UnicodeString::fromUTF8(szText); + if (str.isBogus() || str.isEmpty()) { + // empty string + return KMCMP_ERROR_SYNTAX_ERR; + } + UErrorCode status = U_ZERO_ERROR; + + icu::UnicodeSet uset(str, status); + // TODO-LDML: check for properties + + if (U_FAILURE(status)) { + if (status == U_MISSING_RESOURCE_ERROR) { + // Our special ICU returns this + return KMCMP_ERROR_UNSUPPORTED_PROPERTY; + } else { + // Any other error. + return KMCMP_ERROR_SYNTAX_ERR; + } + } else if (uset.hasStrings()) { + // Error, strings are not allowed + return KMCMP_ERROR_HAS_STRINGS; + } else if (outputBuffer == nullptr) { + // fail if nullptr passed + return KMCMP_FATAL_OUT_OF_RANGE; + } + + const int32_t count = uset.getRangeCount(); + if ((count * 2L) > outputBufferSize) { + // output buffer too small + return KMCMP_FATAL_OUT_OF_RANGE; + } + + // set all ranges + for (int32_t i=0; i +#include "kmcmplib.h" +#include "versioning.h" + +KMX_BOOL kmcmp::CheckKeyboardFinalVersion(PFILE_KEYBOARD fk) { + KMX_CHAR buf[128]; + + if (fk->dwFlags & KF_AUTOMATICVERSION) { + if (fk->version <= 0) { + fk->version = VERSION_60; // minimum version that we can be safe with + } + + snprintf(buf, 128, "The compiler has assigned a minimum engine version of %d.%d based on features used in this keyboard", (int)((fk->version & 0xFF00) >> 8), (int)(fk->version & 0xFF)); + AddCompileWarning(buf); + } + + return TRUE; +} + +// Note: max is not a standard c api function or macro +#ifndef max +#define max(a,b) (((a) > (b)) ? (a) : (b)) +#endif + +KMX_BOOL VerifyKeyboardVersion(PFILE_KEYBOARD fk, KMX_DWORD ver) { + if (fk->dwFlags & KF_AUTOMATICVERSION) { + fk->version = max(fk->version, ver); + return TRUE; + } + + return fk->version >= ver; +} diff --git a/developer/src/kmcmplib/src/versioning.h b/developer/src/kmcmplib/src/versioning.h new file mode 100644 index 0000000000000000000000000000000000000000..a3a1c597bf668930e76dc4989ced254ad62ea0f3 --- /dev/null +++ b/developer/src/kmcmplib/src/versioning.h @@ -0,0 +1,15 @@ +#pragma once + +#include "compfile.h" +#include "../../../../common/include/km_types.h" + +#define VERIFY_KEYBOARD_VERSION(fk, ver, err) { \ + if(!VerifyKeyboardVersion((fk), (ver))) \ + return (err); \ +} + +namespace kmcmp { + KMX_BOOL CheckKeyboardFinalVersion(PFILE_KEYBOARD fk); +} + +KMX_BOOL VerifyKeyboardVersion(PFILE_KEYBOARD fk, KMX_DWORD ver); diff --git a/developer/src/kmcmplib/src/virtualcharkeys.cpp b/developer/src/kmcmplib/src/virtualcharkeys.cpp new file mode 100644 index 0000000000000000000000000000000000000000..eaef45aac4eb3bef64e47d7abb4a8b39e906bcf0 --- /dev/null +++ b/developer/src/kmcmplib/src/virtualcharkeys.cpp @@ -0,0 +1,274 @@ +#include "pch.h" +#include "virtualcharkeys.h" + +KMX_BOOL VKeyMayBeVCKey[256] = { + FALSE, // L"K_?00", // &H0 + FALSE, // L"K_LBUTTON", // &H1 + FALSE, // L"K_RBUTTON", // &H2 + FALSE, // L"K_CANCEL", // &H3 + FALSE, // L"K_MBUTTON", // &H4 + FALSE, // L"K_?05", // &H5 + FALSE, // L"K_?06", // &H6 + FALSE, // L"K_?07", // &H7 + FALSE, // L"K_BKSP", // &H8 + FALSE, // L"K_TAB", // &H9 + FALSE, // L"K_?0A", // &HA + FALSE, // L"K_?0B", // &HB + FALSE, // L"K_KP5", // &HC + FALSE, // L"K_ENTER", // &HD + FALSE, // L"K_?0E", // &HE + FALSE, // L"K_?0F", // &HF + FALSE, // L"K_SHIFT", // &H10 + FALSE, // L"K_CONTROL", // &H11 + FALSE, // L"K_ALT", // &H12 + FALSE, // L"K_PAUSE", // &H13 + FALSE, // L"K_CAPS", // &H14 + FALSE, // L"K_KANJI?15", // &H15 + FALSE, // L"K_KANJI?16", // &H16 + FALSE, // L"K_KANJI?17", // &H17 + FALSE, // L"K_KANJI?18", // &H18 + FALSE, // L"K_KANJI?19", // &H19 + FALSE, // L"K_?1A", // &H1A + FALSE, // L"K_ESC", // &H1B + FALSE, // L"K_KANJI?1C", // &H1C + FALSE, // L"K_KANJI?1D", // &H1D + FALSE, // L"K_KANJI?1E", // &H1E + FALSE, // L"K_KANJI?1F", // &H1F + TRUE, // L"K_SPACE", // &H20 + FALSE, // L"K_PGUP", // &H21 + FALSE, // L"K_PGDN", // &H22 + FALSE, // L"K_END", // &H23 + FALSE, // L"K_HOME", // &H24 + FALSE, // L"K_LEFT", // &H25 + FALSE, // L"K_UP", // &H26 + FALSE, // L"K_RIGHT", // &H27 + FALSE, // L"K_DOWN", // &H28 + FALSE, // L"K_SEL", // &H29 + FALSE, // L"K_PRINT", // &H2A + FALSE, // L"K_EXEC", // &H2B + FALSE, // L"K_PRTSCN", // &H2C + FALSE, // L"K_INS", // &H2D + FALSE, // L"K_DEL", // &H2E + FALSE, // L"K_HELP", // &H2F + TRUE, // L"K_0", // &H30 + TRUE, // L"K_1", // &H31 + TRUE, // L"K_2", // &H32 + TRUE, // L"K_3", // &H33 + TRUE, // L"K_4", // &H34 + TRUE, // L"K_5", // &H35 + TRUE, // L"K_6", // &H36 + TRUE, // L"K_7", // &H37 + TRUE, // L"K_8", // &H38 + TRUE, // L"K_9", // &H39 + FALSE, // L"K_?3A", // &H3A + FALSE, // L"K_?3B", // &H3B + FALSE, // L"K_?3C", // &H3C + FALSE, // L"K_?3D", // &H3D + FALSE, // L"K_?3E", // &H3E + FALSE, // L"K_?3F", // &H3F + FALSE, // L"K_?40", // &H40 + + TRUE, // L"K_A", // &H41 + TRUE, // L"K_B", // &H42 + TRUE, // L"K_C", // &H43 + TRUE, // L"K_D", // &H44 + TRUE, // L"K_E", // &H45 + TRUE, // L"K_F", // &H46 + TRUE, // L"K_G", // &H47 + TRUE, // L"K_H", // &H48 + TRUE, // L"K_I", // &H49 + TRUE, // L"K_J", // &H4A + TRUE, // L"K_K", // &H4B + TRUE, // L"K_L", // &H4C + TRUE, // L"K_M", // &H4D + TRUE, // L"K_N", // &H4E + TRUE, // L"K_O", // &H4F + TRUE, // L"K_P", // &H50 + TRUE, // L"K_Q", // &H51 + TRUE, // L"K_R", // &H52 + TRUE, // L"K_S", // &H53 + TRUE, // L"K_T", // &H54 + TRUE, // L"K_U", // &H55 + TRUE, // L"K_V", // &H56 + TRUE, // L"K_W", // &H57 + TRUE, // L"K_X", // &H58 + TRUE, // L"K_Y", // &H59 + TRUE, // L"K_Z", // &H5A + FALSE, // L"K_?5B", // &H5B + FALSE, // L"K_?5C", // &H5C + FALSE, // L"K_?5D", // &H5D + FALSE, // L"K_?5E", // &H5E + FALSE, // L"K_?5F", // &H5F + FALSE, // L"K_NP0", // &H60 + FALSE, // L"K_NP1", // &H61 + FALSE, // L"K_NP2", // &H62 + FALSE, // L"K_NP3", // &H63 + FALSE, // L"K_NP4", // &H64 + FALSE, // L"K_NP5", // &H65 + FALSE, // L"K_NP6", // &H66 + FALSE, // L"K_NP7", // &H67 + FALSE, // L"K_NP8", // &H68 + FALSE, // L"K_NP9", // &H69 + FALSE, // L"K_NPSTAR", // &H6A + FALSE, // L"K_NPPLUS", // &H6B + FALSE, // L"K_SEPARATOR", // &H6C + FALSE, // L"K_NPMINUS", // &H6D + FALSE, // L"K_NPDOT", // &H6E + FALSE, // L"K_NPSLASH", // &H6F + FALSE, // L"K_F1", // &H70 + FALSE, // L"K_F2", // &H71 + FALSE, // L"K_F3", // &H72 + FALSE, // L"K_F4", // &H73 + FALSE, // L"K_F5", // &H74 + FALSE, // L"K_F6", // &H75 + FALSE, // L"K_F7", // &H76 + FALSE, // L"K_F8", // &H77 + FALSE, // L"K_F9", // &H78 + FALSE, // L"K_F10", // &H79 + FALSE, // L"K_F11", // &H7A + FALSE, // L"K_F12", // &H7B + FALSE, // L"K_F13", // &H7C + FALSE, // L"K_F14", // &H7D + FALSE, // L"K_F15", // &H7E + FALSE, // L"K_F16", // &H7F + FALSE, // L"K_F17", // &H80 + FALSE, // L"K_F18", // &H81 + FALSE, // L"K_F19", // &H82 + FALSE, // L"K_F20", // &H83 + FALSE, // L"K_F21", // &H84 + FALSE, // L"K_F22", // &H85 + FALSE, // L"K_F23", // &H86 + FALSE, // L"K_F24", // &H87 + + FALSE, // L"K_?88", // &H88 + FALSE, // L"K_?89", // &H89 + FALSE, // L"K_?8A", // &H8A + FALSE, // L"K_?8B", // &H8B + FALSE, // L"K_?8C", // &H8C + FALSE, // L"K_?8D", // &H8D + FALSE, // L"K_?8E", // &H8E + FALSE, // L"K_?8F", // &H8F + + FALSE, // L"K_NUMLOCK", // &H90 + FALSE, // L"K_SCROLL", // &H91 + + FALSE, // L"K_?92", // &H92 + FALSE, // L"K_?93", // &H93 + FALSE, // L"K_?94", // &H94 + FALSE, // L"K_?95", // &H95 + FALSE, // L"K_?96", // &H96 + FALSE, // L"K_?97", // &H97 + FALSE, // L"K_?98", // &H98 + FALSE, // L"K_?99", // &H99 + FALSE, // L"K_?9A", // &H9A + FALSE, // L"K_?9B", // &H9B + FALSE, // L"K_?9C", // &H9C + FALSE, // L"K_?9D", // &H9D + FALSE, // L"K_?9E", // &H9E + FALSE, // L"K_?9F", // &H9F + FALSE, // L"K_?A0", // &HA0 + FALSE, // L"K_?A1", // &HA1 + FALSE, // L"K_?A2", // &HA2 + FALSE, // L"K_?A3", // &HA3 + FALSE, // L"K_?A4", // &HA4 + FALSE, // L"K_?A5", // &HA5 + FALSE, // L"K_?A6", // &HA6 + FALSE, // L"K_?A7", // &HA7 + FALSE, // L"K_?A8", // &HA8 + FALSE, // L"K_?A9", // &HA9 + FALSE, // L"K_?AA", // &HAA + FALSE, // L"K_?AB", // &HAB + FALSE, // L"K_?AC", // &HAC + FALSE, // L"K_?AD", // &HAD + FALSE, // L"K_?AE", // &HAE + FALSE, // L"K_?AF", // &HAF + FALSE, // L"K_?B0", // &HB0 + FALSE, // L"K_?B1", // &HB1 + FALSE, // L"K_?B2", // &HB2 + FALSE, // L"K_?B3", // &HB3 + FALSE, // L"K_?B4", // &HB4 + FALSE, // L"K_?B5", // &HB5 + FALSE, // L"K_?B6", // &HB6 + FALSE, // L"K_?B7", // &HB7 + FALSE, // L"K_?B8", // &HB8 + FALSE, // L"K_?B9", // &HB9 + + TRUE, // L"K_COLON", // &HBA + TRUE, // L"K_EQUAL", // &HBB + TRUE, // L"K_COMMA", // &HBC + TRUE, // L"K_HYPHEN", // &HBD + TRUE, // L"K_PERIOD", // &HBE + TRUE, // L"K_SLASH", // &HBF + TRUE, // L"K_BKQUOTE", // &HC0 + + TRUE, // L"K_?C1", // &HC1 -- 103rd key on Brazilian - /? + FALSE, // L"K_?C2", // &HC2 -- 104th key on Brazilian - numpad . + FALSE, // L"K_?C3", // &HC3 + FALSE, // L"K_?C4", // &HC4 + FALSE, // L"K_?C5", // &HC5 + FALSE, // L"K_?C6", // &HC6 + FALSE, // L"K_?C7", // &HC7 + FALSE, // L"K_?C8", // &HC8 + FALSE, // L"K_?C9", // &HC9 + FALSE, // L"K_?CA", // &HCA + FALSE, // L"K_?CB", // &HCB + FALSE, // L"K_?CC", // &HCC + FALSE, // L"K_?CD", // &HCD + FALSE, // L"K_?CE", // &HCE + FALSE, // L"K_?CF", // &HCF + FALSE, // L"K_?D0", // &HD0 + FALSE, // L"K_?D1", // &HD1 + FALSE, // L"K_?D2", // &HD2 + FALSE, // L"K_?D3", // &HD3 + FALSE, // L"K_?D4", // &HD4 + FALSE, // L"K_?D5", // &HD5 + FALSE, // L"K_?D6", // &HD6 + FALSE, // L"K_?D7", // &HD7 + FALSE, // L"K_?D8", // &HD8 + FALSE, // L"K_?D9", // &HD9 + FALSE, // L"K_?DA", // &HDA + + TRUE, // L"K_LBRKT", // &HDB + TRUE, // L"K_BKSLASH", // &HDC + TRUE, // L"K_RBRKT", // &HDD + TRUE, // L"K_QUOTE", // &HDE + TRUE, // L"K_oDF", // &HDF + TRUE, // L"K_oE0", // &HE0 + TRUE, // L"K_oE1", // &HE1 + TRUE, // L"K_oE2", // &HE2 + TRUE, // L"K_oE3", // &HE3 + TRUE, // L"K_oE4", // &HE4 + + FALSE, // L"K_?E5", // &HE5 + + TRUE, // L"K_oE6", // &HE6 + + FALSE, // L"K_?E7", // &HE7 + FALSE, // L"K_?E8", // &HE8 + + TRUE, // L"K_oE9", // &HE9 + TRUE, // L"K_oEA", // &HEA + TRUE, // L"K_oEB", // &HEB + TRUE, // L"K_oEC", // &HEC + TRUE, // L"K_oED", // &HED + TRUE, // L"K_oEE", // &HEE + TRUE, // L"K_oEF", // &HEF + TRUE, // L"K_oF0", // &HF0 + TRUE, // L"K_oF1", // &HF1 + TRUE, // L"K_oF2", // &HF2 + TRUE, // L"K_oF3", // &HF3 + TRUE, // L"K_oF4", // &HF4 + TRUE, // L"K_oF5", // &HF5 + + FALSE, // L"K_?F6", // &HF6 + FALSE, // L"K_?F7", // &HF7 + FALSE, // L"K_?F8", // &HF8 + FALSE, // L"K_?F9", // &HF9 + FALSE, // L"K_?FA", // &HFA + FALSE, // L"K_?FB", // &HFB + FALSE, // L"K_?FC", // &HFC + FALSE, // L"K_?FD", // &HFD + FALSE, // L"K_?FE", // &HFE + FALSE, // L"K_?FF" // &HFF + }; + diff --git a/developer/src/kmcmplib/src/virtualcharkeys.h b/developer/src/kmcmplib/src/virtualcharkeys.h new file mode 100644 index 0000000000000000000000000000000000000000..539c5c5d4075e19e95f38ecee901bb409634bbd6 --- /dev/null +++ b/developer/src/kmcmplib/src/virtualcharkeys.h @@ -0,0 +1,7 @@ +#ifndef _VIRTUALCHARKEYS_H +#define _VIRTUALCHARKEYS_H + +extern KMX_BOOL VKeyMayBeVCKey[256]; + +#endif + diff --git a/developer/src/kmcmplib/src/xstring.cpp b/developer/src/kmcmplib/src/xstring.cpp new file mode 100644 index 0000000000000000000000000000000000000000..870e991656c08d95dd461fab4613ea61eb62aee5 --- /dev/null +++ b/developer/src/kmcmplib/src/xstring.cpp @@ -0,0 +1,152 @@ + +#include "pch.h" +#include "xstring.h" +// used to be windows/src/global/vc/xstring.cpp +/* +* int xstrlen( PKMX_BYTE p ); +* +* Parameters: p Pointer to string to get length of +* +* Returns: length of string +* +* Called by: various functions +* +* xstrlen calculates the length of a string, ignoring some special chars. +*/ +PKMX_WCHAR incxstr(PKMX_WCHAR p) { + + if (*p == 0) + return p; + if (*p != UC_SENTINEL) { + if (*p >= 0xD800 && *p <= 0xDBFF && *(p + 1) >= 0xDC00 && *(p + 1) <= 0xDFFF) + return p + 2; + return p + 1; + } + // UC_SENTINEL(FFFF) with UC_SENTINEL_EXTENDEDEND(0x10) == variable length + if (*(p + 1) == CODE_EXTENDED) { + p += 2; + while (*p && *p != UC_SENTINEL_EXTENDEDEND) + p++; + + if (*p == 0) return p; + return p + 1; + } + + if (*(p + 1) > CODE_LASTCODE || CODE__SIZE[*(p + 1)] == -1) { + return p + 1; + } + + int deltaptr = 2 + CODE__SIZE[*(p + 1)]; + + // check for \0 between UC_SENTINEL(FFFF) and next printable character + for (int i = 0; i < deltaptr; i++) { + if (*p == 0) + return p; + p++; + } + return p; +} + +PKMX_WCHAR decxstr(PKMX_WCHAR p, PKMX_WCHAR pStart) +{ + PKMX_WCHAR q; + + if(p <= pStart) { + return NULL; + } + + p--; + if(*p == UC_SENTINEL_EXTENDEDEND) { + int n = 0; + while (p > pStart && *p != UC_SENTINEL && n < 10) { + p--; + n++; + } + + return p; + } + + if (p == pStart) { + // Don't allow test before pStart + return p; + } + + if(*p >= 0xDC00 && *p <= 0xDFFF && *(p-1) >= 0xD800 && *(p-1) <= 0xDBFF) { + return p-1; + } + + // Look for a UC_SENTINEL to jump to + // note: If we are pointing to the middle of a UC_SENTINEL CODE_x, then we won't treat it as valid, + // and will just go back a single wchar + q = p; + for (int i = 0; i < CODE__SIZE_MAX && q >= pStart; i++, q--) { + // *q == UC_SENTINEL && *(q + 1) is within CODE__SIZE && next CODE_ right of UC_SENTINEL ( looked up in CODE__SIZE+1) has value i + if (*q == UC_SENTINEL && *(q + 1) <= CODE_LASTCODE && CODE__SIZE[*(q + 1)] + 1 == i) + return q; + } + + return p; +} + +int xstrlen_ignoreifopt(PKMX_WCHAR p) +{ + int i; + for(i = 0; *p; i++, p=incxstr(p)) + { + if(*p == UC_SENTINEL && (*(p+1) == CODE_IFOPT || *(p+1) == CODE_IFSYSTEMSTORE)) i--; // I3432 + } + return i; +} + +int xstrlen(PKMX_WCHAR p) +{ + int i; + for(i = 0; *p; i++, p=incxstr(p)); + return i; +} + +int xstrpos(PKMX_WCHAR p1, PKMX_WCHAR p) +{ + int i; + for(i = 0; p < p1; p = incxstr(p), i++); + return i; +} + +PKMX_WCHAR xstrchr(PKMX_WCHAR buf, PKMX_WCHAR chr) +{ + for(PKMX_WCHAR q = incxstr(buf); *buf; buf = q, q = incxstr(buf)) + if(!u16ncmp(buf, chr, (intptr_t)(q-buf))) + return buf; + return NULL; +} + +const int CODE__SIZE[] = { + -1, // undefined 0x00 + 1, // CODE_ANY 0x01 + 2, // CODE_INDEX 0x02 + 0, // CODE_CONTEXT 0x03 + 0, // CODE_NUL 0x04 + 1, // CODE_USE 0x05 + 0, // CODE_RETURN 0x06 + 0, // CODE_BEEP 0x07 + 1, // CODE_DEADKEY 0x08 + -1, // unused 0x09 + 2, // CODE_EXTENDED 0x0A + -1, // CODE_EXTENDEDEND 0x0B (unused) + 1, // CODE_SWITCH 0x0C + -1, // CODE_KEY 0x0D (never used) + 0, // CODE_CLEARCONTEXT 0x0E + 1, // CODE_CALL 0x0F + -1, // UC_SENTINEL_EXTENDEDEND 0x10 (not valid with UC_SENTINEL) + 1, // CODE_CONTEXTEX 0x11 + 1, // CODE_NOTANY 0x12 + 2, // CODE_SETOPT 0x13 + 3, // CODE_IFOPT 0x14 + 1, // CODE_SAVEOPT 0x15 + 1, // CODE_RESETOPT 0x16 + 3, // CODE_IFSYSTEMSTORE 0x17 + 2 // CODE_SETSYSTEMSTORE 0x18 +}; + +// Ensure that all CODE_### sizes are defined +static_assert(sizeof(CODE__SIZE) / sizeof(CODE__SIZE[0]) == (CODE_LASTCODE + 1), "Size of array CODE__SIZE not correct"); diff --git a/developer/src/kmcmplib/src/xstring.h b/developer/src/kmcmplib/src/xstring.h new file mode 100644 index 0000000000000000000000000000000000000000..ae08cfe64a2ef22a941fe67c5ba1047551735cef --- /dev/null +++ b/developer/src/kmcmplib/src/xstring.h @@ -0,0 +1,15 @@ +// TODO: merge with xstring.h from common +#pragma once +#ifndef XSTRING_H +#define SXTRING_H +#include + +KMX_UCHAR* incxstr(KMX_UCHAR* p); +KMX_UCHAR* decxstr(KMX_UCHAR* p, KMX_UCHAR* pStart); +int xstrlen(KMX_UCHAR* p); +int xstrlen_ignoreifopt(KMX_UCHAR* p); +int xstrpos(KMX_UCHAR* p1, KMX_UCHAR* p); +KMX_UCHAR* xstrchr(KMX_UCHAR* buf, KMX_UCHAR* chr); +int xchrcmp(KMX_UCHAR* ch1, KMX_UCHAR* ch2); + +#endif // XSTRING_H diff --git a/developer/src/kmcmplib/subprojects/.gitignore b/developer/src/kmcmplib/subprojects/.gitignore new file mode 100644 index 0000000000000000000000000000000000000000..99479aa952cd339f9d98c7bab6dd21ad9700355e --- /dev/null +++ b/developer/src/kmcmplib/subprojects/.gitignore @@ -0,0 +1,4 @@ +/icu +/*.zip +/*.tgz +/packagecache diff --git a/developer/src/kmcmplib/subprojects/README.md b/developer/src/kmcmplib/subprojects/README.md new file mode 100644 index 0000000000000000000000000000000000000000..188cbe6c26257ab3d9338f71971a954ac7cb60de --- /dev/null +++ b/developer/src/kmcmplib/subprojects/README.md @@ -0,0 +1,11 @@ +# developer/src/kmcmplib/subprojects/README.md + +## What's this? What _is_ this? + +- These are subprojects accessible to the `kmcmplib` meson project. + +## icu + +- ICU is used for the UnicodeSet parser, only. +- Patches for icu (i.e. meson build files) are in [`packagefiles/icu`](./packagefiles/icu/) +- ICU is lightly patched to remove support for UnicodeSet properties. diff --git a/developer/src/kmcmplib/subprojects/icu-for-uset.wrap b/developer/src/kmcmplib/subprojects/icu-for-uset.wrap new file mode 100644 index 0000000000000000000000000000000000000000..7c2dcddb4620473bac382807936fd56505b68eb7 --- /dev/null +++ b/developer/src/kmcmplib/subprojects/icu-for-uset.wrap @@ -0,0 +1,13 @@ +# ICU, only for UnicodeSet + +[wrap-file] +directory = icu +source_url = https://github.com/unicode-org/icu/releases/download/release-73-1/icu4c-73_1-src.tgz +source_filename = icu4c-73_1-src.tgz +source_hash = a457431de164b4aa7eca00ed134d00dfbf88a77c6986a10ae7774fc076bb8c45 +patch_directory = icu + +# Based on: wrapdb_version = 72.1-3 + +[provide] +icu-uc = icuuc_dep diff --git a/developer/src/kmcmplib/subprojects/packagefiles/icu/LICENSE.icu b/developer/src/kmcmplib/subprojects/packagefiles/icu/LICENSE.icu new file mode 100644 index 0000000000000000000000000000000000000000..22472dc2ec219cd7d4d97a66e9a3cce6e2a4acc1 --- /dev/null +++ b/developer/src/kmcmplib/subprojects/packagefiles/icu/LICENSE.icu @@ -0,0 +1,519 @@ +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + +See Terms of Use +for definitions of Unicode Inc.’s Data Files and Software. + +NOTICE TO USER: Carefully read the following legal agreement. +BY DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S +DATA FILES ("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), +YOU UNEQUIVOCALLY ACCEPT, AND AGREE TO BE BOUND BY, ALL OF THE +TERMS AND CONDITIONS OF THIS AGREEMENT. +IF YOU DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE +THE DATA FILES OR SOFTWARE. + +COPYRIGHT AND PERMISSION NOTICE + +Copyright © 1991-2023 Unicode, Inc. All rights reserved. +Distributed under the Terms of Use in https://www.unicode.org/copyright.html. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Unicode data files and any associated documentation +(the "Data Files") or Unicode software and any associated documentation +(the "Software") to deal in the Data Files or Software +without restriction, including without limitation the rights to use, +copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files +or Software are furnished to do so, provided that either +(a) this copyright and permission notice appear with all copies +of the Data Files or Software, or +(b) this copyright and permission notice appear in associated +Documentation. + +THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF +ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE +WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +NONINFRINGEMENT OF THIRD PARTY RIGHTS. +IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THE DATA FILES OR SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, +use or other dealings in these Data Files or Software without prior +written authorization of the copyright holder. + +---------------------------------------------------------------------- + +Third-Party Software Licenses + +This section contains third-party software notices and/or additional +terms for licensed third-party software components included within ICU +libraries. + +---------------------------------------------------------------------- + +ICU License - ICU 1.8.1 to ICU 57.1 + +COPYRIGHT AND PERMISSION NOTICE + +Copyright (c) 1995-2016 International Business Machines Corporation and others +All rights reserved. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, and/or sell copies of the Software, and to permit persons +to whom the Software is furnished to do so, provided that the above +copyright notice(s) and this permission notice appear in all copies of +the Software and that both the above copyright notice(s) and this +permission notice appear in supporting documentation. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR +HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY CLAIM, OR ANY +SPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER +RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF +CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN +CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + +Except as contained in this notice, the name of a copyright holder +shall not be used in advertising or otherwise to promote the sale, use +or other dealings in this Software without prior written authorization +of the copyright holder. + +All trademarks and registered trademarks mentioned herein are the +property of their respective owners. + +---------------------------------------------------------------------- + +Chinese/Japanese Word Break Dictionary Data (cjdict.txt) + + # The Google Chrome software developed by Google is licensed under + # the BSD license. Other software included in this distribution is + # provided under other licenses, as set forth below. + # + # The BSD License + # http://opensource.org/licenses/bsd-license.php + # Copyright (C) 2006-2008, Google Inc. + # + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, + # this list of conditions and the following disclaimer. + # Redistributions in binary form must reproduce the above + # copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided with + # the distribution. + # Neither the name of Google Inc. nor the names of its + # contributors may be used to endorse or promote products derived from + # this software without specific prior written permission. + # + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE + # LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + # CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + # SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR + # BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF + # LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING + # NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS + # SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + # + # + # The word list in cjdict.txt are generated by combining three word lists + # listed below with further processing for compound word breaking. The + # frequency is generated with an iterative training against Google web + # corpora. + # + # * Libtabe (Chinese) + # - https://sourceforge.net/project/?group_id=1519 + # - Its license terms and conditions are shown below. + # + # * IPADIC (Japanese) + # - http://chasen.aist-nara.ac.jp/chasen/distribution.html + # - Its license terms and conditions are shown below. + # + # ---------COPYING.libtabe ---- BEGIN-------------------- + # + # /* + # * Copyright (c) 1999 TaBE Project. + # * Copyright (c) 1999 Pai-Hsiang Hsiao. + # * All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the TaBE Project nor the names of its + # * contributors may be used to endorse or promote products derived + # * from this software without specific prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # /* + # * Copyright (c) 1999 Computer Systems and Communication Lab, + # * Institute of Information Science, Academia + # * Sinica. All rights reserved. + # * + # * Redistribution and use in source and binary forms, with or without + # * modification, are permitted provided that the following conditions + # * are met: + # * + # * . Redistributions of source code must retain the above copyright + # * notice, this list of conditions and the following disclaimer. + # * . Redistributions in binary form must reproduce the above copyright + # * notice, this list of conditions and the following disclaimer in + # * the documentation and/or other materials provided with the + # * distribution. + # * . Neither the name of the Computer Systems and Communication Lab + # * nor the names of its contributors may be used to endorse or + # * promote products derived from this software without specific + # * prior written permission. + # * + # * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # * REGENTS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, + # * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # * OF THE POSSIBILITY OF SUCH DAMAGE. + # */ + # + # Copyright 1996 Chih-Hao Tsai @ Beckman Institute, + # University of Illinois + # c-tsai4@uiuc.edu http://casper.beckman.uiuc.edu/~c-tsai4 + # + # ---------------COPYING.libtabe-----END-------------------------------- + # + # + # ---------------COPYING.ipadic-----BEGIN------------------------------- + # + # Copyright 2000, 2001, 2002, 2003 Nara Institute of Science + # and Technology. All Rights Reserved. + # + # Use, reproduction, and distribution of this software is permitted. + # Any copy of this software, whether in its original form or modified, + # must include both the above copyright notice and the following + # paragraphs. + # + # Nara Institute of Science and Technology (NAIST), + # the copyright holders, disclaims all warranties with regard to this + # software, including all implied warranties of merchantability and + # fitness, in no event shall NAIST be liable for + # any special, indirect or consequential damages or any damages + # whatsoever resulting from loss of use, data or profits, whether in an + # action of contract, negligence or other tortuous action, arising out + # of or in connection with the use or performance of this software. + # + # A large portion of the dictionary entries + # originate from ICOT Free Software. The following conditions for ICOT + # Free Software applies to the current dictionary as well. + # + # Each User may also freely distribute the Program, whether in its + # original form or modified, to any third party or parties, PROVIDED + # that the provisions of Section 3 ("NO WARRANTY") will ALWAYS appear + # on, or be attached to, the Program, which is distributed substantially + # in the same form as set out herein and that such intended + # distribution, if actually made, will neither violate or otherwise + # contravene any of the laws and regulations of the countries having + # jurisdiction over the User or the intended distribution itself. + # + # NO WARRANTY + # + # The program was produced on an experimental basis in the course of the + # research and development conducted during the project and is provided + # to users as so produced on an experimental basis. Accordingly, the + # program is provided without any warranty whatsoever, whether express, + # implied, statutory or otherwise. The term "warranty" used herein + # includes, but is not limited to, any warranty of the quality, + # performance, merchantability and fitness for a particular purpose of + # the program and the nonexistence of any infringement or violation of + # any right of any third party. + # + # Each user of the program will agree and understand, and be deemed to + # have agreed and understood, that there is no warranty whatsoever for + # the program and, accordingly, the entire risk arising from or + # otherwise connected with the program is assumed by the user. + # + # Therefore, neither ICOT, the copyright holder, or any other + # organization that participated in or was otherwise related to the + # development of the program and their respective officials, directors, + # officers and other employees shall be held liable for any and all + # damages, including, without limitation, general, special, incidental + # and consequential damages, arising out of or otherwise in connection + # with the use or inability to use the program or any product, material + # or result produced or otherwise obtained by using the program, + # regardless of whether they have been advised of, or otherwise had + # knowledge of, the possibility of such damages at any time during the + # project or thereafter. Each user will be deemed to have agreed to the + # foregoing by his or her commencement of use of the program. The term + # "use" as used herein includes, but is not limited to, the use, + # modification, copying and distribution of the program and the + # production of secondary products from the program. + # + # In the case where the program, whether in its original form or + # modified, was distributed or delivered to or received by a user from + # any person, organization or entity other than ICOT, unless it makes or + # grants independently of ICOT any specific warranty to the user in + # writing, such person, organization or entity, will also be exempted + # from and not be held liable to the user for any such damages as noted + # above as far as the program is concerned. + # + # ---------------COPYING.ipadic-----END---------------------------------- + +---------------------------------------------------------------------- + +Lao Word Break Dictionary Data (laodict.txt) + + # Copyright (C) 2016 and later: Unicode, Inc. and others. + # License & terms of use: http://www.unicode.org/copyright.html + # Copyright (c) 2015 International Business Machines Corporation + # and others. All Rights Reserved. + # + # Project: https://github.com/rober42539/lao-dictionary + # Dictionary: https://github.com/rober42539/lao-dictionary/laodict.txt + # License: https://github.com/rober42539/lao-dictionary/LICENSE.txt + # (copied below) + # + # This file is derived from the above dictionary version of Nov 22, 2020 + # ---------------------------------------------------------------------- + # Copyright (C) 2013 Brian Eugene Wilson, Robert Martin Campbell. + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions are met: + # + # Redistributions of source code must retain the above copyright notice, this + # list of conditions and the following disclaimer. Redistributions in binary + # form must reproduce the above copyright notice, this list of conditions and + # the following disclaimer in the documentation and/or other materials + # provided with the distribution. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS + # "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT + # LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS + # FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE + # COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, + # INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES + # (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR + # SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) + # HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, + # STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) + # ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED + # OF THE POSSIBILITY OF SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Burmese Word Break Dictionary Data (burmesedict.txt) + + # Copyright (c) 2014 International Business Machines Corporation + # and others. All Rights Reserved. + # + # This list is part of a project hosted at: + # github.com/kanyawtech/myanmar-karen-word-lists + # + # -------------------------------------------------------------------------- + # Copyright (c) 2013, LeRoy Benjamin Sharon + # All rights reserved. + # + # Redistribution and use in source and binary forms, with or without + # modification, are permitted provided that the following conditions + # are met: Redistributions of source code must retain the above + # copyright notice, this list of conditions and the following + # disclaimer. Redistributions in binary form must reproduce the + # above copyright notice, this list of conditions and the following + # disclaimer in the documentation and/or other materials provided + # with the distribution. + # + # Neither the name Myanmar Karen Word Lists, nor the names of its + # contributors may be used to endorse or promote products derived + # from this software without specific prior written permission. + # + # THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND + # CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, + # INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF + # MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + # DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS + # BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, + # EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED + # TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, + # DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON + # ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR + # TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF + # THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + # SUCH DAMAGE. + # -------------------------------------------------------------------------- + +---------------------------------------------------------------------- + +Time Zone Database + + ICU uses the public domain data and code derived from Time Zone +Database for its time zone support. The ownership of the TZ database +is explained in BCP 175: Procedure for Maintaining the Time Zone +Database section 7. + + # 7. Database Ownership + # + # The TZ database itself is not an IETF Contribution or an IETF + # document. Rather it is a pre-existing and regularly updated work + # that is in the public domain, and is intended to remain in the + # public domain. Therefore, BCPs 78 [RFC5378] and 79 [RFC3979] do + # not apply to the TZ Database or contributions that individuals make + # to it. Should any claims be made and substantiated against the TZ + # Database, the organization that is providing the IANA + # Considerations defined in this RFC, under the memorandum of + # understanding with the IETF, currently ICANN, may act in accordance + # with all competent court orders. No ownership claims will be made + # by ICANN or the IETF Trust on the database or the code. Any person + # making a contribution to the database or code waives all rights to + # future claims in that contribution or in the TZ Database. + +---------------------------------------------------------------------- + +Google double-conversion + +Copyright 2006-2011, the V8 project authors. All rights reserved. +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are +met: + + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above + copyright notice, this list of conditions and the following + disclaimer in the documentation and/or other materials provided + with the distribution. + * Neither the name of Google Inc. nor the names of its + contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS +"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT +LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR +A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT +OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE +OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +---------------------------------------------------------------------- + +File: aclocal.m4 (only for ICU4C) +Section: pkg.m4 - Macros to locate and utilise pkg-config. + + +Copyright © 2004 Scott James Remnant . +Copyright © 2012-2015 Dan Nicholson + +This program is free software; you can redistribute it and/or modify +it under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 2 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, write to the Free Software +Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA +02111-1307, USA. + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. + + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: config.guess (only for ICU4C) + + +This file is free software; you can redistribute it and/or modify it +under the terms of the GNU General Public License as published by +the Free Software Foundation; either version 3 of the License, or +(at your option) any later version. + +This program is distributed in the hope that it will be useful, but +WITHOUT ANY WARRANTY; without even the implied warranty of +MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +General Public License for more details. + +You should have received a copy of the GNU General Public License +along with this program; if not, see . + +As a special exception to the GNU General Public License, if you +distribute this file as part of a program that contains a +configuration script generated by Autoconf, you may include it under +the same distribution terms that you use for the rest of that +program. This Exception is an additional permission under section 7 +of the GNU General Public License, version 3 ("GPLv3"). + + +(The condition for the exception is fulfilled because +ICU4C includes a configuration script generated by Autoconf, +namely the `configure` script.) + +---------------------------------------------------------------------- + +File: install-sh (only for ICU4C) + + +Copyright 1991 by the Massachusetts Institute of Technology + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of M.I.T. not be used in advertising or +publicity pertaining to distribution of the software without specific, +written prior permission. M.I.T. makes no representations about the +suitability of this software for any purpose. It is provided "as is" +without express or implied warranty. diff --git a/developer/src/kmcmplib/subprojects/packagefiles/icu/LICENSE.meson b/developer/src/kmcmplib/subprojects/packagefiles/icu/LICENSE.meson new file mode 100644 index 0000000000000000000000000000000000000000..b59833dedbe2e4a84304431f4acca5dc4599cec7 --- /dev/null +++ b/developer/src/kmcmplib/subprojects/packagefiles/icu/LICENSE.meson @@ -0,0 +1,19 @@ +Copyright (c) 2021 The Meson development team + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/developer/src/kmcmplib/subprojects/packagefiles/icu/README-keyman.md b/developer/src/kmcmplib/subprojects/packagefiles/icu/README-keyman.md new file mode 100644 index 0000000000000000000000000000000000000000..50d90c5f1b223aec565dc76ab50f74dcee096c98 --- /dev/null +++ b/developer/src/kmcmplib/subprojects/packagefiles/icu/README-keyman.md @@ -0,0 +1,12 @@ +# ICU4C, for kmpcmplib + +Enclosed herein find: +- a subset of [ICU4C 73.1](https://icu.unicode.org), overlaid with +- a subset of [mesonbuild/wrapdb ](https://github.com/mesonbuild/wrapdb) build files + +This subset is used to provide UnicodeSet operations to the developer side. + +## Licenses + +- ICU4C [LICENSE.icu](./LICENSE.icu) - SPDX: `Unicode-DFS-2016` +- Wrapdb [LICENSE.meson](./LICENSE.meson) - SPDX: `MIT` diff --git a/developer/src/kmcmplib/subprojects/packagefiles/icu/meson.build b/developer/src/kmcmplib/subprojects/packagefiles/icu/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..dd8a2c4c3ae0c4e9451c020a0163a1a744c393c8 --- /dev/null +++ b/developer/src/kmcmplib/subprojects/packagefiles/icu/meson.build @@ -0,0 +1,31 @@ +project( + 'icu', + 'c', + 'cpp', + version: '73.1', + meson_version: '>=0.57.0', + default_options: [ 'cpp_std=c++17' ], +) + +U_ICU_VERSION = meson.project_version() +PACKAGE_ICU_DESCRIPTION = 'International Components for Unicode' +PACKAGE_ICU_URL = 'http://icu-project.org' + +if host_machine.system() == 'windows' + add_project_arguments('-DU_PLATFORM_USES_ONLY_WIN32_API', language: 'cpp') + add_project_arguments('-DWIN32', '-DWIN64', '-D_MBCS', language: 'cpp') + add_project_arguments('-DU_PLATFORM_USES_ONLY_WIN32_API', language: 'c') + add_project_arguments('-DWIN32', '-DWIN64', '-D_MBCS', language: 'c') +endif + +usage_args = [ + '-DU_STATIC_IMPLEMENTATION', + '-DU_ATTRIBUTE_DEPRECATED=', + '-DUCONFIG_USE_LOCAL=1', + '-DU_NOEXCEPT=' +] + +library_prefix = '' +library_suffix = '' + +subdir('source') diff --git a/developer/src/kmcmplib/subprojects/packagefiles/icu/source/common/meson.build b/developer/src/kmcmplib/subprojects/packagefiles/icu/source/common/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..efde33baf3881600a0d067aa22f80caf0d1afe88 --- /dev/null +++ b/developer/src/kmcmplib/subprojects/packagefiles/icu/source/common/meson.build @@ -0,0 +1,340 @@ +sources = files( + 'appendable.cpp', + 'bmpset.cpp', + # 'brkeng.cpp', + # 'brkiter.cpp', + 'bytesinkutil.cpp', + 'bytestream.cpp', + 'bytestrie.cpp', + 'bytestriebuilder.cpp', + 'bytestrieiterator.cpp', + # 'caniter.cpp', + 'characterproperties.cpp', + 'chariter.cpp', + 'charstr.cpp', + 'cmemory.cpp', + 'cstr.cpp', + 'cstring.cpp', + # 'cwchar.cpp', + # 'dictbe.cpp', + # 'dictionarydata.cpp', + 'dtintrv.cpp', + 'edits.cpp', + 'emojiprops.cpp', + 'errorcode.cpp', + # 'filteredbrk.cpp', + # 'filterednormalizer2.cpp', + 'icudataver.cpp', + # 'icuplug.cpp', + # 'loadednormalizer2impl.cpp', + 'localebuilder.cpp', + 'locavailable.cpp', + 'locbased.cpp', + 'locdispnames.cpp', + # 'locdspnm.cpp', + 'locid.cpp', + 'loclikely.cpp', + 'locmap.cpp', + 'locresdata.cpp', + # 'locutil.cpp', + # 'lstmbe.cpp', + # 'messagepattern.cpp', + # 'normalizer2.cpp', + # 'normalizer2impl.cpp', + # 'normlzr.cpp', + 'parsepos.cpp', + 'patternprops.cpp', + 'propname.cpp', + 'propsvec.cpp', + # 'punycode.cpp', + 'putil.cpp', + # 'rbbi.cpp', + # 'rbbi_cache.cpp', + # 'rbbidata.cpp', + # 'rbbinode.cpp', + # 'rbbirb.cpp', + # 'rbbiscan.cpp', + # 'rbbisetb.cpp', + # 'rbbistbl.cpp', + # 'rbbitblb.cpp', + 'resbund.cpp', + 'resbund_cnv.cpp', + 'resource.cpp', + 'ruleiter.cpp', + 'schriter.cpp', + # 'serv.cpp', + # 'servlk.cpp', + # 'servlkf.cpp', + # 'servls.cpp', + # 'servnotf.cpp', + # 'servrbf.cpp', + # 'servslkf.cpp', + 'sharedobject.cpp', + 'simpleformatter.cpp', + # 'static_unicode_sets.cpp', + 'stringpiece.cpp', + 'stringtriebuilder.cpp', + 'uarrsort.cpp', + 'ubidi.cpp', + 'ubidi_props.cpp', + 'ubidiln.cpp', + 'ubidiwrt.cpp', + # 'ubrk.cpp', + 'ucase.cpp', + 'ucasemap.cpp', + # 'ucasemap_titlecase_brkiter.cpp', + 'ucat.cpp', + # 'uchar.cpp', + 'ucharstrie.cpp', + 'ucharstriebuilder.cpp', + 'ucharstrieiterator.cpp', + 'uchriter.cpp', + 'ucln_cmn.cpp', + 'ucmndata.cpp', + 'ucnv.cpp', + # 'ucnv2022.cpp', + 'ucnv_bld.cpp', + 'ucnv_cb.cpp', + 'ucnv_cnv.cpp', + # 'ucnv_ct.cpp', + 'ucnv_err.cpp', + # 'ucnv_ext.cpp', + 'ucnv_io.cpp', + # 'ucnv_lmb.cpp', + 'ucnv_set.cpp', + 'ucnv_u16.cpp', + 'ucnv_u32.cpp', + 'ucnv_u7.cpp', + 'ucnv_u8.cpp', + 'ucnvbocu.cpp', + 'ucnvdisp.cpp', + # 'ucnvhz.cpp', + # 'ucnvisci.cpp', + 'ucnvlat1.cpp', + # 'ucnvmbcs.cpp', + 'ucnvscsu.cpp', + 'ucnvsel.cpp', + # 'ucol_swp.cpp', + 'ucptrie.cpp', + # 'ucurr.cpp', + 'udata.cpp', + 'udatamem.cpp', + 'udataswp.cpp', + 'uenum.cpp', + 'uhash.cpp', + 'uhash_us.cpp', + # 'uidna.cpp', + 'uinit.cpp', + 'uinvchar.cpp', + 'uiter.cpp', + 'ulist.cpp', + 'uloc.cpp', + 'uloc_keytype.cpp', + 'uloc_tag.cpp', + 'umapfile.cpp', + 'umath.cpp', + 'umutablecptrie.cpp', + 'umutex.cpp', + 'unames.cpp', + 'unifiedcache.cpp', + 'unifilt.cpp', + 'unifunct.cpp', + 'uniset.cpp', + 'uniset_closure.cpp', + 'uniset_props.cpp', + 'unisetspan.cpp', + 'unistr.cpp', + 'unistr_case.cpp', + 'unistr_case_locale.cpp', + 'unistr_cnv.cpp', + 'unistr_props.cpp', + # 'unistr_titlecase_brkiter.cpp', + # 'unorm.cpp', + # 'unormcmp.cpp', + 'uobject.cpp', + 'uprops.cpp', + 'ures_cnv.cpp', + 'uresbund.cpp', + 'uresdata.cpp', + 'usc_impl.cpp', + 'uscript.cpp', + 'uscript_props.cpp', + 'uset.cpp', + 'uset_props.cpp', + 'usetiter.cpp', + 'ushape.cpp', + # 'usprep.cpp', + 'ustack.cpp', + 'ustr_cnv.cpp', + # 'ustr_titlecase_brkiter.cpp', + 'ustr_wcs.cpp', + 'ustrcase.cpp', + 'ustrcase_locale.cpp', + 'ustrenum.cpp', + 'ustrfmt.cpp', + 'ustring.cpp', + 'ustrtrns.cpp', + 'utext.cpp', + 'utf_impl.cpp', + 'util.cpp', + 'util_props.cpp', + 'utrace.cpp', + 'utrie.cpp', + 'utrie2.cpp', + 'utrie2_builder.cpp', + 'utrie_swap.cpp', + # 'uts46.cpp', + 'utypes.cpp', + 'uvector.cpp', + 'uvectr32.cpp', + 'uvectr64.cpp', + 'wintz.cpp', +) + +icuuc_name = '@0@icuuc@1@'.format(library_prefix, library_suffix) + +common_lib = static_library( + icuuc_name, + sources, + include_directories: [incdir,'../..'], + c_args: ['-DU_COMMON_IMPLEMENTATION'] + usage_args, + cpp_args: ['-DU_COMMON_IMPLEMENTATION'] + usage_args, + link_with: stubdata_lib, + # dependencies: dl_dep, + # version: U_ICU_VERSION, + # install: true, +) + + +uconfig = configuration_data() + +uconfig.set('U_ENABLE_DYLOAD', 0) # no DLL +uconfig.set('U_CHECK_DYLOAD', 0) # no DLL +uconfig.set('UCONFIG_NO_FILE_IO', 1) +uconfig.set('UCONFIG_NO_LEGACY_CONVERSION', 1) # turn off file based codepage conversion +uconfig.set('UCONFIG_NO_NORMALIZATION', 1) # TODO-LDML: may want this +uconfig.set('UCONFIG_NO_BREAK_ITERATION', 1) # TODO-LDML: may want this +uconfig.set('UCONFIG_NO_IDNA', 1) +uconfig.set('UCONFIG_NO_COLLATION', 1) +uconfig.set('UCONFIG_NO_FORMATTING', 1) +uconfig.set('UCONFIG_NO_TRANSLITERATION', 1) +uconfig.set('UCONFIG_NO_REGULAR_EXPRESSIONS', 1) # TODO-LDML: Will probably want this for transforms #7375 +uconfig.set('UCONFIG_NO_SERVICE', 1) + +# This next one is custom to this patch: +uconfig.set('UCONFIG_NO_PROPERTIES', 1) + +uconfig_local = configure_file( + configuration : uconfig, + output : 'uconfig_local.h', +) + + +icuuc_dep = declare_dependency( + link_with: common_lib, + compile_args: usage_args, + include_directories: incdir, + # dependencies: stubdata_dep, +) + +headers = files( + 'unicode/appendable.h', + 'unicode/brkiter.h', + 'unicode/bytestream.h', + 'unicode/bytestrie.h', + 'unicode/bytestriebuilder.h', + 'unicode/caniter.h', + 'unicode/casemap.h', + 'unicode/char16ptr.h', + 'unicode/chariter.h', + 'unicode/dbbi.h', + 'unicode/docmain.h', + 'unicode/dtintrv.h', + 'unicode/edits.h', + 'unicode/enumset.h', + 'unicode/errorcode.h', + 'unicode/filteredbrk.h', + 'unicode/icudataver.h', + 'unicode/icuplug.h', + 'unicode/idna.h', + 'unicode/localebuilder.h', + 'unicode/localematcher.h', + 'unicode/localpointer.h', + 'unicode/locdspnm.h', + 'unicode/locid.h', + 'unicode/messagepattern.h', + 'unicode/normalizer2.h', + 'unicode/normlzr.h', + 'unicode/parseerr.h', + 'unicode/parsepos.h', + 'unicode/platform.h', + 'unicode/ptypes.h', + 'unicode/putil.h', + 'unicode/rbbi.h', + 'unicode/rep.h', + 'unicode/resbund.h', + 'unicode/schriter.h', + 'unicode/simpleformatter.h', + 'unicode/std_string.h', + 'unicode/strenum.h', + 'unicode/stringoptions.h', + 'unicode/stringpiece.h', + 'unicode/stringtriebuilder.h', + 'unicode/symtable.h', + 'unicode/ubidi.h', + 'unicode/ubiditransform.h', + 'unicode/ubrk.h', + 'unicode/ucasemap.h', + 'unicode/ucat.h', + 'unicode/uchar.h', + 'unicode/ucharstrie.h', + 'unicode/ucharstriebuilder.h', + 'unicode/uchriter.h', + 'unicode/uclean.h', + 'unicode/ucnv.h', + 'unicode/ucnv_cb.h', + 'unicode/ucnv_err.h', + 'unicode/ucnvsel.h', + 'unicode/uconfig.h', + 'unicode/ucpmap.h', + 'unicode/ucptrie.h', + 'unicode/ucurr.h', + 'unicode/udata.h', + 'unicode/udisplaycontext.h', + 'unicode/uenum.h', + 'unicode/uidna.h', + 'unicode/uiter.h', + 'unicode/uldnames.h', + 'unicode/uloc.h', + 'unicode/umachine.h', + 'unicode/umisc.h', + 'unicode/umutablecptrie.h', + 'unicode/unifilt.h', + 'unicode/unifunct.h', + 'unicode/unimatch.h', + 'unicode/uniset.h', + 'unicode/unistr.h', + 'unicode/unorm.h', + 'unicode/unorm2.h', + 'unicode/uobject.h', + 'unicode/urename.h', + 'unicode/urep.h', + 'unicode/ures.h', + 'unicode/uscript.h', + 'unicode/uset.h', + 'unicode/usetiter.h', + 'unicode/ushape.h', + 'unicode/usprep.h', + 'unicode/ustring.h', + 'unicode/ustringtrie.h', + 'unicode/utext.h', + 'unicode/utf.h', + 'unicode/utf16.h', + 'unicode/utf32.h', + 'unicode/utf8.h', + 'unicode/utf_old.h', + 'unicode/utrace.h', + 'unicode/utypes.h', + 'unicode/uvernum.h', + 'unicode/uversion.h', +) diff --git a/developer/src/kmcmplib/subprojects/packagefiles/icu/source/common/uniset_props.cpp b/developer/src/kmcmplib/subprojects/packagefiles/icu/source/common/uniset_props.cpp new file mode 100644 index 0000000000000000000000000000000000000000..e960c0e9654bd9a72b38d625c2cae724f3fe2ab6 --- /dev/null +++ b/developer/src/kmcmplib/subprojects/packagefiles/icu/source/common/uniset_props.cpp @@ -0,0 +1,1161 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +******************************************************************************* +* +* Copyright (C) 1999-2014, International Business Machines +* Corporation and others. All Rights Reserved. +* +******************************************************************************* +* file name: uniset_props.cpp +* encoding: UTF-8 +* tab size: 8 (not used) +* indentation:4 +* +* created on: 2004aug25 +* created by: Markus W. Scherer +* +* Character property dependent functions moved here from uniset.cpp +*/ + +#include "unicode/utypes.h" +#include "unicode/uniset.h" +#include "unicode/parsepos.h" +#if !defined(UCONFIG_NO_PROPERTIES) +#include "unicode/uchar.h" +#include "unicode/uscript.h" +#endif +#include "unicode/symtable.h" +#include "unicode/uset.h" +#include "unicode/locid.h" +#include "unicode/brkiter.h" +#include "uset_imp.h" +#include "ruleiter.h" +#include "cmemory.h" +#include "ucln_cmn.h" +#include "util.h" +#if !defined(UCONFIG_NO_PROPERTIES) +#include "uvector.h" +#include "uprops.h" +#include "propname.h" +#include "normalizer2impl.h" +#endif +#include "uinvchar.h" +#if !defined(UCONFIG_NO_PROPERTIES) +#include "uprops.h" +#endif +#include "charstr.h" +#include "cstring.h" +#include "mutex.h" +#include "umutex.h" +#include "uassert.h" +#include "hash.h" + +U_NAMESPACE_USE + +// Special property set IDs +#if !defined(UCONFIG_NO_PROPERTIES) +static const char ANY[] = "ANY"; // [\u0000-\U0010FFFF] +static const char ASCII[] = "ASCII"; // [\u0000-\u007F] +static const char ASSIGNED[] = "Assigned"; // [:^Cn:] +#endif + + +// Unicode name property alias +#define NAME_PROP "na" +#define NAME_PROP_LENGTH 2 + +// Cached sets ------------------------------------------------------------- *** + +U_CDECL_BEGIN +static UBool U_CALLCONV uset_cleanup(); + +static UnicodeSet *uni32Singleton; +static icu::UInitOnce uni32InitOnce {}; + +/** + * Cleanup function for UnicodeSet + */ +static UBool U_CALLCONV uset_cleanup() { + delete uni32Singleton; + uni32Singleton = nullptr; + uni32InitOnce.reset(); + return true; +} + +U_CDECL_END + +U_NAMESPACE_BEGIN + +namespace { + +// Cache some sets for other services -------------------------------------- *** +void U_CALLCONV createUni32Set(UErrorCode &errorCode) { + U_ASSERT(uni32Singleton == nullptr); + uni32Singleton = new UnicodeSet(UNICODE_STRING_SIMPLE("[:age=3.2:]"), errorCode); + if(uni32Singleton==nullptr) { + errorCode=U_MEMORY_ALLOCATION_ERROR; + } else { + uni32Singleton->freeze(); + } + ucln_common_registerCleanup(UCLN_COMMON_USET, uset_cleanup); +} + + +U_CFUNC UnicodeSet * +uniset_getUnicode32Instance(UErrorCode &errorCode) { + umtx_initOnce(uni32InitOnce, &createUni32Set, errorCode); + return uni32Singleton; +} + +// helper functions for matching of pattern syntax pieces ------------------ *** +// these functions are parallel to the PERL_OPEN etc. strings above + +// using these functions is not only faster than UnicodeString::compare() and +// caseCompare(), but they also make UnicodeSet work for simple patterns when +// no Unicode properties data is available - when caseCompare() fails + +static inline UBool +isPerlOpen(const UnicodeString &pattern, int32_t pos) { + char16_t c; + return pattern.charAt(pos)==u'\\' && ((c=pattern.charAt(pos+1))==u'p' || c==u'P'); +} + +/*static inline UBool +isPerlClose(const UnicodeString &pattern, int32_t pos) { + return pattern.charAt(pos)==u'}'; +}*/ + +static inline UBool +isNameOpen(const UnicodeString &pattern, int32_t pos) { + return pattern.charAt(pos)==u'\\' && pattern.charAt(pos+1)==u'N'; +} + +static inline UBool +isPOSIXOpen(const UnicodeString &pattern, int32_t pos) { + return pattern.charAt(pos)==u'[' && pattern.charAt(pos+1)==u':'; +} + +/*static inline UBool +isPOSIXClose(const UnicodeString &pattern, int32_t pos) { + return pattern.charAt(pos)==u':' && pattern.charAt(pos+1)==u']'; +}*/ + +// TODO memory debugging provided inside uniset.cpp +// could be made available here but probably obsolete with use of modern +// memory leak checker tools +#define _dbgct(me) + +} // namespace + +//---------------------------------------------------------------- +// Constructors &c +//---------------------------------------------------------------- + +/** + * Constructs a set from the given pattern, optionally ignoring + * white space. See the class description for the syntax of the + * pattern language. + * @param pattern a string specifying what characters are in the set + */ +UnicodeSet::UnicodeSet(const UnicodeString& pattern, + UErrorCode& status) { + applyPattern(pattern, status); + _dbgct(this); +} + +//---------------------------------------------------------------- +// Public API +//---------------------------------------------------------------- + +UnicodeSet& UnicodeSet::applyPattern(const UnicodeString& pattern, + UErrorCode& status) { + // Equivalent to + // return applyPattern(pattern, USET_IGNORE_SPACE, nullptr, status); + // but without dependency on closeOver(). + ParsePosition pos(0); + applyPatternIgnoreSpace(pattern, pos, nullptr, status); + if (U_FAILURE(status)) return *this; + + int32_t i = pos.getIndex(); + // Skip over trailing whitespace + ICU_Utility::skipWhitespace(pattern, i, true); + if (i != pattern.length()) { + status = U_ILLEGAL_ARGUMENT_ERROR; + } + return *this; +} + +void +UnicodeSet::applyPatternIgnoreSpace(const UnicodeString& pattern, + ParsePosition& pos, + const SymbolTable* symbols, + UErrorCode& status) { + if (U_FAILURE(status)) { + return; + } + if (isFrozen()) { + status = U_NO_WRITE_PERMISSION; + return; + } + // Need to build the pattern in a temporary string because + // _applyPattern calls add() etc., which set pat to empty. + UnicodeString rebuiltPat; + RuleCharacterIterator chars(pattern, symbols, pos); + applyPattern(chars, symbols, rebuiltPat, USET_IGNORE_SPACE, nullptr, 0, status); + if (U_FAILURE(status)) return; + if (chars.inVariable()) { + // syntaxError(chars, "Extra chars in variable value"); + status = U_MALFORMED_SET; + return; + } + setPattern(rebuiltPat); +} + +/** + * Return true if the given position, in the given pattern, appears + * to be the start of a UnicodeSet pattern. + */ +UBool UnicodeSet::resemblesPattern(const UnicodeString& pattern, int32_t pos) { + return ((pos+1) < pattern.length() && + pattern.charAt(pos) == (char16_t)91/*[*/) || + resemblesPropertyPattern(pattern, pos); +} + +//---------------------------------------------------------------- +// Implementation: Pattern parsing +//---------------------------------------------------------------- + +namespace { + +/** + * A small all-inline class to manage a UnicodeSet pointer. Add + * operator->() etc. as needed. + */ +class UnicodeSetPointer { + UnicodeSet* p; +public: + inline UnicodeSetPointer() : p(0) {} + inline ~UnicodeSetPointer() { delete p; } + inline UnicodeSet* pointer() { return p; } + inline UBool allocate() { + if (p == 0) { + p = new UnicodeSet(); + } + return p != 0; + } +}; + +constexpr int32_t MAX_DEPTH = 100; + +} // namespace + +/** + * Parse the pattern from the given RuleCharacterIterator. The + * iterator is advanced over the parsed pattern. + * @param chars iterator over the pattern characters. Upon return + * it will be advanced to the first character after the parsed + * pattern, or the end of the iteration if all characters are + * parsed. + * @param symbols symbol table to use to parse and dereference + * variables, or null if none. + * @param rebuiltPat the pattern that was parsed, rebuilt or + * copied from the input pattern, as appropriate. + * @param options a bit mask of zero or more of the following: + * IGNORE_SPACE, CASE. + */ +void UnicodeSet::applyPattern(RuleCharacterIterator& chars, + const SymbolTable* symbols, + UnicodeString& rebuiltPat, + uint32_t options, + UnicodeSet& (UnicodeSet::*caseClosure)(int32_t attribute), + int32_t depth, + UErrorCode& ec) { + if (U_FAILURE(ec)) return; + if (depth > MAX_DEPTH) { + ec = U_ILLEGAL_ARGUMENT_ERROR; + return; + } + + // Syntax characters: [ ] ^ - & { } + + // Recognized special forms for chars, sets: c-c s-s s&s + + int32_t opts = RuleCharacterIterator::PARSE_VARIABLES | + RuleCharacterIterator::PARSE_ESCAPES; + if ((options & USET_IGNORE_SPACE) != 0) { + opts |= RuleCharacterIterator::SKIP_WHITESPACE; + } + + UnicodeString patLocal, buf; + UBool usePat = false; + UnicodeSetPointer scratch; + RuleCharacterIterator::Pos backup; + + // mode: 0=before [, 1=between [...], 2=after ] + // lastItem: 0=none, 1=char, 2=set + int8_t lastItem = 0, mode = 0; + UChar32 lastChar = 0; + char16_t op = 0; + + UBool invert = false; + + clear(); + + while (mode != 2 && !chars.atEnd()) { + U_ASSERT((lastItem == 0 && op == 0) || + (lastItem == 1 && (op == 0 || op == u'-')) || + (lastItem == 2 && (op == 0 || op == u'-' || op == u'&'))); + + UChar32 c = 0; + UBool literal = false; + UnicodeSet* nested = 0; // alias - do not delete + + // -------- Check for property pattern + + // setMode: 0=none, 1=unicodeset, 2=propertypat, 3=preparsed + int8_t setMode = 0; + if (resemblesPropertyPattern(chars, opts)) { + setMode = 2; + } + + // -------- Parse '[' of opening delimiter OR nested set. + // If there is a nested set, use `setMode' to define how + // the set should be parsed. If the '[' is part of the + // opening delimiter for this pattern, parse special + // strings "[", "[^", "[-", and "[^-". Check for stand-in + // characters representing a nested set in the symbol + // table. + + else { + // Prepare to backup if necessary + chars.getPos(backup); + c = chars.next(opts, literal, ec); + if (U_FAILURE(ec)) return; + + if (c == u'[' && !literal) { + if (mode == 1) { + chars.setPos(backup); // backup + setMode = 1; + } else { + // Handle opening '[' delimiter + mode = 1; + patLocal.append(u'['); + chars.getPos(backup); // prepare to backup + c = chars.next(opts, literal, ec); + if (U_FAILURE(ec)) return; + if (c == u'^' && !literal) { + invert = true; + patLocal.append(u'^'); + chars.getPos(backup); // prepare to backup + c = chars.next(opts, literal, ec); + if (U_FAILURE(ec)) return; + } + // Fall through to handle special leading '-'; + // otherwise restart loop for nested [], \p{}, etc. + if (c == u'-') { + literal = true; + // Fall through to handle literal '-' below + } else { + chars.setPos(backup); // backup + continue; + } + } + } else if (symbols != 0) { + const UnicodeFunctor *m = symbols->lookupMatcher(c); + if (m != 0) { + const UnicodeSet *ms = dynamic_cast(m); + if (ms == nullptr) { + ec = U_MALFORMED_SET; + return; + } + // casting away const, but `nested' won't be modified + // (important not to modify stored set) + nested = const_cast(ms); + setMode = 3; + } + } + } + + // -------- Handle a nested set. This either is inline in + // the pattern or represented by a stand-in that has + // previously been parsed and was looked up in the symbol + // table. + + if (setMode != 0) { + if (lastItem == 1) { + if (op != 0) { + // syntaxError(chars, "Char expected after operator"); + ec = U_MALFORMED_SET; + return; + } + add(lastChar, lastChar); + _appendToPat(patLocal, lastChar, false); + lastItem = 0; + op = 0; + } + + if (op == u'-' || op == u'&') { + patLocal.append(op); + } + + if (nested == 0) { + // lazy allocation + if (!scratch.allocate()) { + ec = U_MEMORY_ALLOCATION_ERROR; + return; + } + nested = scratch.pointer(); + } + switch (setMode) { + case 1: + nested->applyPattern(chars, symbols, patLocal, options, caseClosure, depth + 1, ec); + break; + case 2: + chars.skipIgnored(opts); + nested->applyPropertyPattern(chars, patLocal, ec); + if (U_FAILURE(ec)) return; + break; + case 3: // `nested' already parsed + nested->_toPattern(patLocal, false); + break; + } + + usePat = true; + + if (mode == 0) { + // Entire pattern is a category; leave parse loop + *this = *nested; + mode = 2; + break; + } + + switch (op) { + case u'-': + removeAll(*nested); + break; + case u'&': + retainAll(*nested); + break; + case 0: + addAll(*nested); + break; + } + + op = 0; + lastItem = 2; + + continue; + } + + if (mode == 0) { + // syntaxError(chars, "Missing '['"); + ec = U_MALFORMED_SET; + return; + } + + // -------- Parse special (syntax) characters. If the + // current character is not special, or if it is escaped, + // then fall through and handle it below. + + if (!literal) { + switch (c) { + case u']': + if (lastItem == 1) { + add(lastChar, lastChar); + _appendToPat(patLocal, lastChar, false); + } + // Treat final trailing '-' as a literal + if (op == u'-') { + add(op, op); + patLocal.append(op); + } else if (op == u'&') { + // syntaxError(chars, "Trailing '&'"); + ec = U_MALFORMED_SET; + return; + } + patLocal.append(u']'); + mode = 2; + continue; + case u'-': + if (op == 0) { + if (lastItem != 0) { + op = (char16_t) c; + continue; + } else { + // Treat final trailing '-' as a literal + add(c, c); + c = chars.next(opts, literal, ec); + if (U_FAILURE(ec)) return; + if (c == u']' && !literal) { + patLocal.append(u"-]", 2); + mode = 2; + continue; + } + } + } + // syntaxError(chars, "'-' not after char or set"); + ec = U_MALFORMED_SET; + return; + case u'&': + if (lastItem == 2 && op == 0) { + op = (char16_t) c; + continue; + } + // syntaxError(chars, "'&' not after set"); + ec = U_MALFORMED_SET; + return; + case u'^': + // syntaxError(chars, "'^' not after '['"); + ec = U_MALFORMED_SET; + return; + case u'{': + if (op != 0) { + // syntaxError(chars, "Missing operand after operator"); + ec = U_MALFORMED_SET; + return; + } + if (lastItem == 1) { + add(lastChar, lastChar); + _appendToPat(patLocal, lastChar, false); + } + lastItem = 0; + buf.truncate(0); + { + UBool ok = false; + while (!chars.atEnd()) { + c = chars.next(opts, literal, ec); + if (U_FAILURE(ec)) return; + if (c == u'}' && !literal) { + ok = true; + break; + } + buf.append(c); + } + if (!ok) { + // syntaxError(chars, "Invalid multicharacter string"); + ec = U_MALFORMED_SET; + return; + } + } + // We have new string. Add it to set and continue; + // we don't need to drop through to the further + // processing + add(buf); + patLocal.append(u'{'); + _appendToPat(patLocal, buf, false); + patLocal.append(u'}'); + continue; + case SymbolTable::SYMBOL_REF: + // symbols nosymbols + // [a-$] error error (ambiguous) + // [a$] anchor anchor + // [a-$x] var "x"* literal '$' + // [a-$.] error literal '$' + // *We won't get here in the case of var "x" + { + chars.getPos(backup); + c = chars.next(opts, literal, ec); + if (U_FAILURE(ec)) return; + UBool anchor = (c == u']' && !literal); + if (symbols == 0 && !anchor) { + c = SymbolTable::SYMBOL_REF; + chars.setPos(backup); + break; // literal '$' + } + if (anchor && op == 0) { + if (lastItem == 1) { + add(lastChar, lastChar); + _appendToPat(patLocal, lastChar, false); + } + add(U_ETHER); + usePat = true; + patLocal.append((char16_t) SymbolTable::SYMBOL_REF); + patLocal.append(u']'); + mode = 2; + continue; + } + // syntaxError(chars, "Unquoted '$'"); + ec = U_MALFORMED_SET; + return; + } + default: + break; + } + } + + // -------- Parse literal characters. This includes both + // escaped chars ("\u4E01") and non-syntax characters + // ("a"). + + switch (lastItem) { + case 0: + lastItem = 1; + lastChar = c; + break; + case 1: + if (op == u'-') { + if (lastChar >= c) { + // Don't allow redundant (a-a) or empty (b-a) ranges; + // these are most likely typos. + // syntaxError(chars, "Invalid range"); + ec = U_MALFORMED_SET; + return; + } + add(lastChar, c); + _appendToPat(patLocal, lastChar, false); + patLocal.append(op); + _appendToPat(patLocal, c, false); + lastItem = 0; + op = 0; + } else { + add(lastChar, lastChar); + _appendToPat(patLocal, lastChar, false); + lastChar = c; + } + break; + case 2: + if (op != 0) { + // syntaxError(chars, "Set expected after operator"); + ec = U_MALFORMED_SET; + return; + } + lastChar = c; + lastItem = 1; + break; + } + } + + if (mode != 2) { + // syntaxError(chars, "Missing ']'"); + ec = U_MALFORMED_SET; + return; + } + + chars.skipIgnored(opts); + + /** + * Handle global flags (invert, case insensitivity). If this + * pattern should be compiled case-insensitive, then we need + * to close over case BEFORE COMPLEMENTING. This makes + * patterns like /[^abc]/i work. + */ + if ((options & USET_CASE_MASK) != 0) { + (this->*caseClosure)(options); + } + if (invert) { + complement().removeAllStrings(); // code point complement + } + + // Use the rebuilt pattern (patLocal) only if necessary. Prefer the + // generated pattern. + if (usePat) { + rebuiltPat.append(patLocal); + } else { + _generatePattern(rebuiltPat, false); + } + if (isBogus() && U_SUCCESS(ec)) { + // We likely ran out of memory. AHHH! + ec = U_MEMORY_ALLOCATION_ERROR; + } +} + +//---------------------------------------------------------------- +// Property set implementation +//---------------------------------------------------------------- + +namespace { + +#if !defined(UCONFIG_NO_PROPERTIES) +static UBool numericValueFilter(UChar32 ch, void* context) { + return u_getNumericValue(ch) == *(double*)context; +} + +static UBool generalCategoryMaskFilter(UChar32 ch, void* context) { + int32_t value = *(int32_t*)context; + return (U_GET_GC_MASK((UChar32) ch) & value) != 0; +} + +static UBool versionFilter(UChar32 ch, void* context) { + static const UVersionInfo none = { 0, 0, 0, 0 }; + UVersionInfo v; + u_charAge(ch, v); + UVersionInfo* version = (UVersionInfo*)context; + return uprv_memcmp(&v, &none, sizeof(v)) > 0 && uprv_memcmp(&v, version, sizeof(v)) <= 0; +} + +typedef struct { + UProperty prop; + int32_t value; +} IntPropertyContext; + +static UBool intPropertyFilter(UChar32 ch, void* context) { + IntPropertyContext* c = (IntPropertyContext*)context; + return u_getIntPropertyValue((UChar32) ch, c->prop) == c->value; +} + +static UBool scriptExtensionsFilter(UChar32 ch, void* context) { + return uscript_hasScript(ch, *(UScriptCode*)context); +} +#endif + +} // namespace + +/** + * Generic filter-based scanning code for UCD property UnicodeSets. + */ +void UnicodeSet::applyFilter(UnicodeSet::Filter filter, + void* context, + const UnicodeSet* inclusions, + UErrorCode &status) { + if (U_FAILURE(status)) return; + + // Logically, walk through all Unicode characters, noting the start + // and end of each range for which filter.contain(c) is + // true. Add each range to a set. + // + // To improve performance, use an inclusions set which + // encodes information about character ranges that are known + // to have identical properties. + // inclusions contains the first characters of + // same-value ranges for the given property. + + clear(); + + UChar32 startHasProperty = -1; + int32_t limitRange = inclusions->getRangeCount(); + + for (int j=0; jgetRangeStart(j); + UChar32 end = inclusions->getRangeEnd(j); + + // for all the code points in the range, process + for (UChar32 ch = start; ch <= end; ++ch) { + // only add to this UnicodeSet on inflection points -- + // where the hasProperty value changes to false + if ((*filter)(ch, context)) { + if (startHasProperty < 0) { + startHasProperty = ch; + } + } else if (startHasProperty >= 0) { + add(startHasProperty, ch-1); + startHasProperty = -1; + } + } + } + if (startHasProperty >= 0) { + add((UChar32)startHasProperty, (UChar32)0x10FFFF); + } + if (isBogus() && U_SUCCESS(status)) { + // We likely ran out of memory. AHHH! + status = U_MEMORY_ALLOCATION_ERROR; + } +} + +namespace { + +#if !defined(UCONFIG_NO_PROPERTIES) +static UBool mungeCharName(char* dst, const char* src, int32_t dstCapacity) { + /* Note: we use ' ' in compiler code page */ + int32_t j = 0; + char ch; + --dstCapacity; /* make room for term. zero */ + while ((ch = *src++) != 0) { + if (ch == ' ' && (j==0 || (j>0 && dst[j-1]==' '))) { + continue; + } + if (j >= dstCapacity) return false; + dst[j++] = ch; + } + if (j > 0 && dst[j-1] == ' ') --j; + dst[j] = 0; + return true; +} +#endif + +} // namespace + +//---------------------------------------------------------------- +// Property set API +//---------------------------------------------------------------- + +#define FAIL(ec) UPRV_BLOCK_MACRO_BEGIN { \ + ec=U_ILLEGAL_ARGUMENT_ERROR; \ + return *this; \ +} UPRV_BLOCK_MACRO_END + +UnicodeSet& +UnicodeSet::applyIntPropertyValue(UProperty prop, int32_t value, UErrorCode& ec) { + if (U_FAILURE(ec) || isFrozen()) { return *this; } +#if defined(UCONFIG_NO_PROPERTIES) + ec = U_MISSING_RESOURCE_ERROR; +#else + if (prop == UCHAR_GENERAL_CATEGORY_MASK) { + const UnicodeSet* inclusions = CharacterProperties::getInclusionsForProperty(prop, ec); + applyFilter(generalCategoryMaskFilter, &value, inclusions, ec); + } else if (prop == UCHAR_SCRIPT_EXTENSIONS) { + const UnicodeSet* inclusions = CharacterProperties::getInclusionsForProperty(prop, ec); + UScriptCode script = (UScriptCode)value; + applyFilter(scriptExtensionsFilter, &script, inclusions, ec); + } else if (0 <= prop && prop < UCHAR_BINARY_LIMIT) { + if (value == 0 || value == 1) { + const USet *set = u_getBinaryPropertySet(prop, &ec); + if (U_FAILURE(ec)) { return *this; } + copyFrom(*UnicodeSet::fromUSet(set), true); + if (value == 0) { + complement().removeAllStrings(); // code point complement + } + } else { + clear(); + } + } else if (UCHAR_INT_START <= prop && prop < UCHAR_INT_LIMIT) { + const UnicodeSet* inclusions = CharacterProperties::getInclusionsForProperty(prop, ec); + IntPropertyContext c = {prop, value}; + applyFilter(intPropertyFilter, &c, inclusions, ec); + } else { + ec = U_ILLEGAL_ARGUMENT_ERROR; + } +#endif + return *this; +} + +UnicodeSet& +UnicodeSet::applyPropertyAlias(const UnicodeString& prop, + const UnicodeString& value, + UErrorCode& ec) { + if (U_FAILURE(ec) || isFrozen()) return *this; +#if !defined(UCONFIG_NO_PROPERTIES) + + // prop and value used to be converted to char * using the default + // converter instead of the invariant conversion. + // This should not be necessary because all Unicode property and value + // names use only invariant characters. + // If there are any variant characters, then we won't find them anyway. + // Checking first avoids assertion failures in the conversion. + if( !uprv_isInvariantUString(prop.getBuffer(), prop.length()) || + !uprv_isInvariantUString(value.getBuffer(), value.length()) + ) { + FAIL(ec); + } + CharString pname, vname; + pname.appendInvariantChars(prop, ec); + vname.appendInvariantChars(value, ec); + if (U_FAILURE(ec)) return *this; + + UProperty p; + int32_t v; + UBool invert = false; + + if (value.length() > 0) { + p = u_getPropertyEnum(pname.data()); + if (p == UCHAR_INVALID_CODE) FAIL(ec); + + // Treat gc as gcm + if (p == UCHAR_GENERAL_CATEGORY) { + p = UCHAR_GENERAL_CATEGORY_MASK; + } + + if ((p >= UCHAR_BINARY_START && p < UCHAR_BINARY_LIMIT) || + (p >= UCHAR_INT_START && p < UCHAR_INT_LIMIT) || + (p >= UCHAR_MASK_START && p < UCHAR_MASK_LIMIT)) { + v = u_getPropertyValueEnum(p, vname.data()); + if (v == UCHAR_INVALID_CODE) { + // Handle numeric CCC + if (p == UCHAR_CANONICAL_COMBINING_CLASS || + p == UCHAR_TRAIL_CANONICAL_COMBINING_CLASS || + p == UCHAR_LEAD_CANONICAL_COMBINING_CLASS) { + char* end; + double val = uprv_strtod(vname.data(), &end); + // Anything between 0 and 255 is valid even if unused. + // Cast double->int only after range check. + // We catch NaN here because comparing it with both 0 and 255 will be false + // (as are all comparisons with NaN). + if (*end != 0 || !(0 <= val && val <= 255) || + (v = (int32_t)val) != val) { + // non-integral value or outside 0..255, or trailing junk + FAIL(ec); + } + } else { + FAIL(ec); + } + } + } + + else { + + switch (p) { + case UCHAR_NUMERIC_VALUE: + { + char* end; + double val = uprv_strtod(vname.data(), &end); + if (*end != 0) { + FAIL(ec); + } + applyFilter(numericValueFilter, &val, + CharacterProperties::getInclusionsForProperty(p, ec), ec); + return *this; + } + case UCHAR_NAME: + { + // Must munge name, since u_charFromName() does not do + // 'loose' matching. + char buf[128]; // it suffices that this be > uprv_getMaxCharNameLength + if (!mungeCharName(buf, vname.data(), sizeof(buf))) FAIL(ec); + UChar32 ch = u_charFromName(U_EXTENDED_CHAR_NAME, buf, &ec); + if (U_SUCCESS(ec)) { + clear(); + add(ch); + return *this; + } else { + FAIL(ec); + } + } + case UCHAR_UNICODE_1_NAME: + // ICU 49 deprecates the Unicode_1_Name property APIs. + FAIL(ec); + case UCHAR_AGE: + { + // Must munge name, since u_versionFromString() does not do + // 'loose' matching. + char buf[128]; + if (!mungeCharName(buf, vname.data(), sizeof(buf))) FAIL(ec); + UVersionInfo version; + u_versionFromString(version, buf); + applyFilter(versionFilter, &version, + CharacterProperties::getInclusionsForProperty(p, ec), ec); + return *this; + } + case UCHAR_SCRIPT_EXTENSIONS: + v = u_getPropertyValueEnum(UCHAR_SCRIPT, vname.data()); + if (v == UCHAR_INVALID_CODE) { + FAIL(ec); + } + // fall through to calling applyIntPropertyValue() + break; + default: + // p is a non-binary, non-enumerated property that we + // don't support (yet). + FAIL(ec); + } + } + } + + else { + // value is empty. Interpret as General Category, Script, or + // Binary property. + p = UCHAR_GENERAL_CATEGORY_MASK; + v = u_getPropertyValueEnum(p, pname.data()); + if (v == UCHAR_INVALID_CODE) { + p = UCHAR_SCRIPT; + v = u_getPropertyValueEnum(p, pname.data()); + if (v == UCHAR_INVALID_CODE) { + p = u_getPropertyEnum(pname.data()); + if (p >= UCHAR_BINARY_START && p < UCHAR_BINARY_LIMIT) { + v = 1; + } else if (0 == uprv_comparePropertyNames(ANY, pname.data())) { + set(MIN_VALUE, MAX_VALUE); + return *this; + } else if (0 == uprv_comparePropertyNames(ASCII, pname.data())) { + set(0, 0x7F); + return *this; + } else if (0 == uprv_comparePropertyNames(ASSIGNED, pname.data())) { + // [:Assigned:]=[:^Cn:] + p = UCHAR_GENERAL_CATEGORY_MASK; + v = U_GC_CN_MASK; + invert = true; + } else { + FAIL(ec); + } + } + } + } + + applyIntPropertyValue(p, v, ec); + if(invert) { + complement().removeAllStrings(); // code point complement + } + + if (isBogus() && U_SUCCESS(ec)) { + // We likely ran out of memory. AHHH! + ec = U_MEMORY_ALLOCATION_ERROR; + } +#else + ec = U_MISSING_RESOURCE_ERROR; + return *this; +#endif + return *this; +} + +//---------------------------------------------------------------- +// Property set patterns +//---------------------------------------------------------------- + +/** + * Return true if the given position, in the given pattern, appears + * to be the start of a property set pattern. + */ +UBool UnicodeSet::resemblesPropertyPattern(const UnicodeString& pattern, + int32_t pos) { + // Patterns are at least 5 characters long + if ((pos+5) > pattern.length()) { + return false; + } + + // Look for an opening [:, [:^, \p, or \P + return isPOSIXOpen(pattern, pos) || isPerlOpen(pattern, pos) || isNameOpen(pattern, pos); +} + +/** + * Return true if the given iterator appears to point at a + * property pattern. Regardless of the result, return with the + * iterator unchanged. + * @param chars iterator over the pattern characters. Upon return + * it will be unchanged. + * @param iterOpts RuleCharacterIterator options + */ +UBool UnicodeSet::resemblesPropertyPattern(RuleCharacterIterator& chars, + int32_t iterOpts) { + // NOTE: literal will always be false, because we don't parse escapes. + UBool result = false, literal; + UErrorCode ec = U_ZERO_ERROR; + iterOpts &= ~RuleCharacterIterator::PARSE_ESCAPES; + RuleCharacterIterator::Pos pos; + chars.getPos(pos); + UChar32 c = chars.next(iterOpts, literal, ec); + if (c == u'[' || c == u'\\') { + UChar32 d = chars.next(iterOpts & ~RuleCharacterIterator::SKIP_WHITESPACE, + literal, ec); + result = (c == u'[') ? (d == u':') : + (d == u'N' || d == u'p' || d == u'P'); + } + chars.setPos(pos); + return result && U_SUCCESS(ec); +} + +/** + * Parse the given property pattern at the given parse position. + */ +UnicodeSet& UnicodeSet::applyPropertyPattern(const UnicodeString& pattern, + ParsePosition& ppos, + UErrorCode &ec) { + int32_t pos = ppos.getIndex(); + + UBool posix = false; // true for [:pat:], false for \p{pat} \P{pat} \N{pat} + UBool isName = false; // true for \N{pat}, o/w false + UBool invert = false; + + if (U_FAILURE(ec)) return *this; + + // Minimum length is 5 characters, e.g. \p{L} + if ((pos+5) > pattern.length()) { + FAIL(ec); + } + + // On entry, ppos should point to one of the following locations: + // Look for an opening [:, [:^, \p, or \P + if (isPOSIXOpen(pattern, pos)) { + posix = true; + pos += 2; + pos = ICU_Utility::skipWhitespace(pattern, pos); + if (pos < pattern.length() && pattern.charAt(pos) == u'^') { + ++pos; + invert = true; + } + } else if (isPerlOpen(pattern, pos) || isNameOpen(pattern, pos)) { + char16_t c = pattern.charAt(pos+1); + invert = (c == u'P'); + isName = (c == u'N'); + pos += 2; + pos = ICU_Utility::skipWhitespace(pattern, pos); + if (pos == pattern.length() || pattern.charAt(pos++) != u'{') { + // Syntax error; "\p" or "\P" not followed by "{" + FAIL(ec); + } + } else { + // Open delimiter not seen + FAIL(ec); + } + + // Look for the matching close delimiter, either :] or } + int32_t close; + if (posix) { + close = pattern.indexOf(u":]", 2, pos); + } else { + close = pattern.indexOf(u'}', pos); + } + if (close < 0) { + // Syntax error; close delimiter missing + FAIL(ec); + } + + // Look for an '=' sign. If this is present, we will parse a + // medium \p{gc=Cf} or long \p{GeneralCategory=Format} + // pattern. + int32_t equals = pattern.indexOf(u'=', pos); + UnicodeString propName, valueName; + if (equals >= 0 && equals < close && !isName) { + // Equals seen; parse medium/long pattern + pattern.extractBetween(pos, equals, propName); + pattern.extractBetween(equals+1, close, valueName); + } + + else { + // Handle case where no '=' is seen, and \N{} + pattern.extractBetween(pos, close, propName); + + // Handle \N{name} + if (isName) { + // This is a little inefficient since it means we have to + // parse NAME_PROP back to UCHAR_NAME even though we already + // know it's UCHAR_NAME. If we refactor the API to + // support args of (UProperty, char*) then we can remove + // NAME_PROP and make this a little more efficient. + valueName = propName; + propName = UnicodeString(NAME_PROP, NAME_PROP_LENGTH, US_INV); + } + } + + applyPropertyAlias(propName, valueName, ec); + + if (U_SUCCESS(ec)) { + if (invert) { + complement().removeAllStrings(); // code point complement + } + + // Move to the limit position after the close delimiter if the + // parse succeeded. + ppos.setIndex(close + (posix ? 2 : 1)); + } + + return *this; +} + +/** + * Parse a property pattern. + * @param chars iterator over the pattern characters. Upon return + * it will be advanced to the first character after the parsed + * pattern, or the end of the iteration if all characters are + * parsed. + * @param rebuiltPat the pattern that was parsed, rebuilt or + * copied from the input pattern, as appropriate. + */ +void UnicodeSet::applyPropertyPattern(RuleCharacterIterator& chars, + UnicodeString& rebuiltPat, + UErrorCode& ec) { + if (U_FAILURE(ec)) return; + UnicodeString pattern; + chars.lookahead(pattern); + ParsePosition pos(0); + applyPropertyPattern(pattern, pos, ec); + if (U_FAILURE(ec)) return; + if (pos.getIndex() == 0) { + // syntaxError(chars, "Invalid property pattern"); + ec = U_MALFORMED_SET; + return; + } + chars.jumpahead(pos.getIndex()); + rebuiltPat.append(pattern, 0, pos.getIndex()); +} + +U_NAMESPACE_END diff --git a/developer/src/kmcmplib/subprojects/packagefiles/icu/source/common/uresdata.cpp b/developer/src/kmcmplib/subprojects/packagefiles/icu/source/common/uresdata.cpp new file mode 100644 index 0000000000000000000000000000000000000000..36c9e7510a5525e5c424b0374e36d682580f4789 --- /dev/null +++ b/developer/src/kmcmplib/subprojects/packagefiles/icu/source/common/uresdata.cpp @@ -0,0 +1,1513 @@ +// © 2016 and later: Unicode, Inc. and others. +// License & terms of use: http://www.unicode.org/copyright.html +/* +******************************************************************************* +* Copyright (C) 1999-2016, International Business Machines Corporation +* and others. All Rights Reserved. +******************************************************************************* +* file name: uresdata.cpp +* encoding: UTF-8 +* tab size: 8 (not used) +* indentation:4 +* +* created on: 1999dec08 +* created by: Markus W. Scherer +* Modification History: +* +* Date Name Description +* 06/20/2000 helena OS/400 port changes; mostly typecast. +* 06/24/02 weiv Added support for resource sharing +*/ + +#include "unicode/utypes.h" +#include "unicode/udata.h" +#include "unicode/ustring.h" +#include "unicode/utf16.h" +#include "cmemory.h" +#include "cstring.h" +#include "resource.h" +#include "uarrsort.h" +#include "uassert.h" +#include "ucol_swp.h" +#include "udataswp.h" +#include "uinvchar.h" +#include "uresdata.h" +#include "uresimp.h" +#include "utracimp.h" + +/* + * Resource access helpers + */ + +/* get a const char* pointer to the key with the keyOffset byte offset from pRoot */ +#define RES_GET_KEY16(pResData, keyOffset) \ + ((keyOffset)<(pResData)->localKeyLimit ? \ + (const char *)(pResData)->pRoot+(keyOffset) : \ + (pResData)->poolBundleKeys+(keyOffset)-(pResData)->localKeyLimit) + +#define RES_GET_KEY32(pResData, keyOffset) \ + ((keyOffset)>=0 ? \ + (const char *)(pResData)->pRoot+(keyOffset) : \ + (pResData)->poolBundleKeys+((keyOffset)&0x7fffffff)) + +#define URESDATA_ITEM_NOT_FOUND -1 + +/* empty resources, returned when the resource offset is 0 */ +static const uint16_t gEmpty16=0; + +static const struct { + int32_t length; + int32_t res; +} gEmpty32={ 0, 0 }; + +static const struct { + int32_t length; + char16_t nul; + char16_t pad; +} gEmptyString={ 0, 0, 0 }; + +/* + * All the type-access functions assume that + * the resource is of the expected type. + */ + +static int32_t +_res_findTableItem(const ResourceData *pResData, const uint16_t *keyOffsets, int32_t length, + const char *key, const char **realKey) { + const char *tableKey; + int32_t mid, start, limit; + int result; + + /* do a binary search for the key */ + start=0; + limit=length; + while(startuseNativeStrcmp) { + result = uprv_strcmp(key, tableKey); + } else { + result = uprv_compareInvCharsAsAscii(key, tableKey); + } + if (result < 0) { + limit = mid; + } else if (result > 0) { + start = mid + 1; + } else { + /* We found it! */ + *realKey=tableKey; + return mid; + } + } + return URESDATA_ITEM_NOT_FOUND; /* not found or table is empty. */ +} + +static int32_t +_res_findTable32Item(const ResourceData *pResData, const int32_t *keyOffsets, int32_t length, + const char *key, const char **realKey) { + const char *tableKey; + int32_t mid, start, limit; + int result; + + /* do a binary search for the key */ + start=0; + limit=length; + while(startuseNativeStrcmp) { + result = uprv_strcmp(key, tableKey); + } else { + result = uprv_compareInvCharsAsAscii(key, tableKey); + } + if (result < 0) { + limit = mid; + } else if (result > 0) { + start = mid + 1; + } else { + /* We found it! */ + *realKey=tableKey; + return mid; + } + } + return URESDATA_ITEM_NOT_FOUND; /* not found or table is empty. */ +} + +/* helper for res_load() ---------------------------------------------------- */ + +static UBool U_CALLCONV +isAcceptable(void *context, + const char * /*type*/, const char * /*name*/, + const UDataInfo *pInfo) { + uprv_memcpy(context, pInfo->formatVersion, 4); + return (UBool)( + pInfo->size>=20 && + pInfo->isBigEndian==U_IS_BIG_ENDIAN && + pInfo->charsetFamily==U_CHARSET_FAMILY && + pInfo->sizeofUChar==U_SIZEOF_UCHAR && + pInfo->dataFormat[0]==0x52 && /* dataFormat="ResB" */ + pInfo->dataFormat[1]==0x65 && + pInfo->dataFormat[2]==0x73 && + pInfo->dataFormat[3]==0x42 && + (1<=pInfo->formatVersion[0] && pInfo->formatVersion[0]<=3)); +} + +/* semi-public functions ---------------------------------------------------- */ + +static void +res_init(ResourceData *pResData, + UVersionInfo formatVersion, const void *inBytes, int32_t length, + UErrorCode *errorCode) { + UResType rootType; + + /* get the root resource */ + pResData->pRoot=(const int32_t *)inBytes; + pResData->rootRes=(Resource)*pResData->pRoot; + pResData->p16BitUnits=&gEmpty16; + + /* formatVersion 1.1 must have a root item and at least 5 indexes */ + if(length>=0 && (length/4)<((formatVersion[0]==1 && formatVersion[1]==0) ? 1 : 1+5)) { + *errorCode=U_INVALID_FORMAT_ERROR; + res_unload(pResData); + return; + } + + /* currently, we accept only resources that have a Table as their roots */ + rootType=(UResType)RES_GET_TYPE(pResData->rootRes); + if(!URES_IS_TABLE(rootType)) { + *errorCode=U_INVALID_FORMAT_ERROR; + res_unload(pResData); + return; + } + + if(formatVersion[0]==1 && formatVersion[1]==0) { + pResData->localKeyLimit=0x10000; /* greater than any 16-bit key string offset */ + } else { + /* bundles with formatVersion 1.1 and later contain an indexes[] array */ + const int32_t *indexes=pResData->pRoot+1; + int32_t indexLength=indexes[URES_INDEX_LENGTH]&0xff; + if(indexLength<=URES_INDEX_MAX_TABLE_LENGTH) { + *errorCode=U_INVALID_FORMAT_ERROR; + res_unload(pResData); + return; + } + if( length>=0 && + (length<((1+indexLength)<<2) || + length<(indexes[URES_INDEX_BUNDLE_TOP]<<2)) + ) { + *errorCode=U_INVALID_FORMAT_ERROR; + res_unload(pResData); + return; + } + if(indexes[URES_INDEX_KEYS_TOP]>(1+indexLength)) { + pResData->localKeyLimit=indexes[URES_INDEX_KEYS_TOP]<<2; + } + if(formatVersion[0]>=3) { + // In formatVersion 1, the indexLength took up this whole int. + // In version 2, bits 31..8 were reserved and always 0. + // In version 3, they contain bits 23..0 of the poolStringIndexLimit. + // Bits 27..24 are in indexes[URES_INDEX_ATTRIBUTES] bits 15..12. + pResData->poolStringIndexLimit=(int32_t)((uint32_t)indexes[URES_INDEX_LENGTH]>>8); + } + if(indexLength>URES_INDEX_ATTRIBUTES) { + int32_t att=indexes[URES_INDEX_ATTRIBUTES]; + pResData->noFallback=(UBool)(att&URES_ATT_NO_FALLBACK); + pResData->isPoolBundle=(UBool)((att&URES_ATT_IS_POOL_BUNDLE)!=0); + pResData->usesPoolBundle=(UBool)((att&URES_ATT_USES_POOL_BUNDLE)!=0); + pResData->poolStringIndexLimit|=(att&0xf000)<<12; // bits 15..12 -> 27..24 + pResData->poolStringIndex16Limit=(int32_t)((uint32_t)att>>16); + } + if((pResData->isPoolBundle || pResData->usesPoolBundle) && indexLength<=URES_INDEX_POOL_CHECKSUM) { + *errorCode=U_INVALID_FORMAT_ERROR; + res_unload(pResData); + return; + } + if( indexLength>URES_INDEX_16BIT_TOP && + indexes[URES_INDEX_16BIT_TOP]>indexes[URES_INDEX_KEYS_TOP] + ) { + pResData->p16BitUnits=(const uint16_t *)(pResData->pRoot+indexes[URES_INDEX_KEYS_TOP]); + } + } + + if(formatVersion[0]==1 || U_CHARSET_FAMILY==U_ASCII_FAMILY) { + /* + * formatVersion 1: compare key strings in native-charset order + * formatVersion 2 and up: compare key strings in ASCII order + */ + pResData->useNativeStrcmp=true; + } +} + +U_CAPI void U_EXPORT2 +res_read(ResourceData *pResData, + const UDataInfo *pInfo, const void *inBytes, int32_t length, + UErrorCode *errorCode) { + UVersionInfo formatVersion; + + uprv_memset(pResData, 0, sizeof(ResourceData)); + if(U_FAILURE(*errorCode)) { + return; + } + if(!isAcceptable(formatVersion, nullptr, nullptr, pInfo)) { + *errorCode=U_INVALID_FORMAT_ERROR; + return; + } + res_init(pResData, formatVersion, inBytes, length, errorCode); +} + +U_CFUNC void +res_load(ResourceData *pResData, + const char *path, const char *name, UErrorCode *errorCode) { + UVersionInfo formatVersion; + + uprv_memset(pResData, 0, sizeof(ResourceData)); + + /* load the ResourceBundle file */ + pResData->data=udata_openChoice(path, "res", name, isAcceptable, formatVersion, errorCode); + if(U_FAILURE(*errorCode)) { + return; + } + + /* get its memory and initialize *pResData */ + res_init(pResData, formatVersion, udata_getMemory(pResData->data), -1, errorCode); +} + +U_CFUNC void +res_unload(ResourceData *pResData) { + if(pResData->data!=nullptr) { + udata_close(pResData->data); + pResData->data=nullptr; + } +} + +static const int8_t gPublicTypes[URES_LIMIT] = { + URES_STRING, + URES_BINARY, + URES_TABLE, + URES_ALIAS, + + URES_TABLE, /* URES_TABLE32 */ + URES_TABLE, /* URES_TABLE16 */ + URES_STRING, /* URES_STRING_V2 */ + URES_INT, + + URES_ARRAY, + URES_ARRAY, /* URES_ARRAY16 */ + URES_NONE, + URES_NONE, + + URES_NONE, + URES_NONE, + URES_INT_VECTOR, + URES_NONE +}; + +U_CAPI UResType U_EXPORT2 +res_getPublicType(Resource res) { + return (UResType)gPublicTypes[RES_GET_TYPE(res)]; +} + +U_CAPI const char16_t * U_EXPORT2 +res_getStringNoTrace(const ResourceData *pResData, Resource res, int32_t *pLength) { + const char16_t *p; + uint32_t offset=RES_GET_OFFSET(res); + int32_t length; + if(RES_GET_TYPE(res)==URES_STRING_V2) { + int32_t first; + if((int32_t)offsetpoolStringIndexLimit) { + p=(const char16_t *)pResData->poolBundleStrings+offset; + } else { + p=(const char16_t *)pResData->p16BitUnits+(offset-pResData->poolStringIndexLimit); + } + first=*p; + if(!U16_IS_TRAIL(first)) { + length=u_strlen(p); + } else if(first<0xdfef) { + length=first&0x3ff; + ++p; + } else if(first<0xdfff) { + length=((first-0xdfef)<<16)|p[1]; + p+=2; + } else { + length=((int32_t)p[1]<<16)|p[2]; + p+=3; + } + } else if(res==offset) /* RES_GET_TYPE(res)==URES_STRING */ { + const int32_t *p32= res==0 ? &gEmptyString.length : pResData->pRoot+res; + length=*p32++; + p=(const char16_t *)p32; + } else { + p=nullptr; + length=0; + } + if(pLength) { + *pLength=length; + } + return p; +} + +namespace { + +/** + * CLDR string value (three empty-set symbols)=={2205, 2205, 2205} + * prevents fallback to the parent bundle. + * TODO: combine with other code that handles this marker, use EMPTY_SET constant. + * TODO: maybe move to uresbund.cpp? + */ +UBool isNoInheritanceMarker(const ResourceData *pResData, Resource res) { + uint32_t offset=RES_GET_OFFSET(res); + if (offset == 0) { + // empty string + } else if (res == offset) { + const int32_t *p32=pResData->pRoot+res; + int32_t length=*p32; + const char16_t *p=(const char16_t *)p32; + return length == 3 && p[2] == 0x2205 && p[3] == 0x2205 && p[4] == 0x2205; + } else if (RES_GET_TYPE(res) == URES_STRING_V2) { + const char16_t *p; + if((int32_t)offsetpoolStringIndexLimit) { + p=(const char16_t *)pResData->poolBundleStrings+offset; + } else { + p=(const char16_t *)pResData->p16BitUnits+(offset-pResData->poolStringIndexLimit); + } + int32_t first=*p; + if (first == 0x2205) { // implicit length + return p[1] == 0x2205 && p[2] == 0x2205 && p[3] == 0; + } else if (first == 0xdc03) { // explicit length 3 (should not occur) + return p[1] == 0x2205 && p[2] == 0x2205 && p[3] == 0x2205; + } else { + // Assume that the string has not been stored with more length units than necessary. + return false; + } + } + return false; +} + +int32_t getStringArray(const ResourceData *pResData, const icu::ResourceArray &array, + icu::UnicodeString *dest, int32_t capacity, + UErrorCode &errorCode) { + if(U_FAILURE(errorCode)) { + return 0; + } + if(dest == nullptr ? capacity != 0 : capacity < 0) { + errorCode = U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + int32_t length = array.getSize(); + if(length == 0) { + return 0; + } + if(length > capacity) { + errorCode = U_BUFFER_OVERFLOW_ERROR; + return length; + } + for(int32_t i = 0; i < length; ++i) { + int32_t sLength; + // No tracing: handled by the caller + const char16_t *s = res_getStringNoTrace(pResData, array.internalGetResource(pResData, i), &sLength); + if(s == nullptr) { + errorCode = U_RESOURCE_TYPE_MISMATCH; + return 0; + } + dest[i].setTo(true, s, sLength); + } + return length; +} + +} // namespace + +U_CAPI const char16_t * U_EXPORT2 +res_getAlias(const ResourceData *pResData, Resource res, int32_t *pLength) { + const char16_t *p; + uint32_t offset=RES_GET_OFFSET(res); + int32_t length; + if(RES_GET_TYPE(res)==URES_ALIAS) { + const int32_t *p32= offset==0 ? &gEmptyString.length : pResData->pRoot+offset; + length=*p32++; + p=(const char16_t *)p32; + } else { + p=nullptr; + length=0; + } + if(pLength) { + *pLength=length; + } + return p; +} + +U_CAPI const uint8_t * U_EXPORT2 +res_getBinaryNoTrace(const ResourceData *pResData, Resource res, int32_t *pLength) { + const uint8_t *p; + uint32_t offset=RES_GET_OFFSET(res); + int32_t length; + if(RES_GET_TYPE(res)==URES_BINARY) { + const int32_t *p32= offset==0 ? (const int32_t*)&gEmpty32 : pResData->pRoot+offset; + length=*p32++; + p=(const uint8_t *)p32; + } else { + p=nullptr; + length=0; + } + if(pLength) { + *pLength=length; + } + return p; +} + + +U_CAPI const int32_t * U_EXPORT2 +res_getIntVectorNoTrace(const ResourceData *pResData, Resource res, int32_t *pLength) { + const int32_t *p; + uint32_t offset=RES_GET_OFFSET(res); + int32_t length; + if(RES_GET_TYPE(res)==URES_INT_VECTOR) { + p= offset==0 ? (const int32_t *)&gEmpty32 : pResData->pRoot+offset; + length=*p++; + } else { + p=nullptr; + length=0; + } + if(pLength) { + *pLength=length; + } + return p; +} + +U_CAPI int32_t U_EXPORT2 +res_countArrayItems(const ResourceData *pResData, Resource res) { + uint32_t offset=RES_GET_OFFSET(res); + switch(RES_GET_TYPE(res)) { + case URES_STRING: + case URES_STRING_V2: + case URES_BINARY: + case URES_ALIAS: + case URES_INT: + case URES_INT_VECTOR: + return 1; + case URES_ARRAY: + case URES_TABLE32: + return offset==0 ? 0 : *(pResData->pRoot+offset); + case URES_TABLE: + return offset==0 ? 0 : *((const uint16_t *)(pResData->pRoot+offset)); + case URES_ARRAY16: + case URES_TABLE16: + return pResData->p16BitUnits[offset]; + default: + return 0; + } +} + +U_NAMESPACE_BEGIN + +ResourceDataValue::~ResourceDataValue() {} + +UResType ResourceDataValue::getType() const { + return res_getPublicType(res); +} + +const char16_t *ResourceDataValue::getString(int32_t &length, UErrorCode &errorCode) const { + if(U_FAILURE(errorCode)) { + return nullptr; + } + const char16_t *s = res_getString(fTraceInfo, &getData(), res, &length); + if(s == nullptr) { + errorCode = U_RESOURCE_TYPE_MISMATCH; + } + return s; +} + +const char16_t *ResourceDataValue::getAliasString(int32_t &length, UErrorCode &errorCode) const { + if(U_FAILURE(errorCode)) { + return nullptr; + } + const char16_t *s = res_getAlias(&getData(), res, &length); + if(s == nullptr) { + errorCode = U_RESOURCE_TYPE_MISMATCH; + } + return s; +} + +int32_t ResourceDataValue::getInt(UErrorCode &errorCode) const { + if(U_FAILURE(errorCode)) { + return 0; + } + if(RES_GET_TYPE(res) != URES_INT) { + errorCode = U_RESOURCE_TYPE_MISMATCH; + } + return res_getInt(fTraceInfo, res); +} + +uint32_t ResourceDataValue::getUInt(UErrorCode &errorCode) const { + if(U_FAILURE(errorCode)) { + return 0; + } + if(RES_GET_TYPE(res) != URES_INT) { + errorCode = U_RESOURCE_TYPE_MISMATCH; + } + return res_getUInt(fTraceInfo, res); +} + +const int32_t *ResourceDataValue::getIntVector(int32_t &length, UErrorCode &errorCode) const { + if(U_FAILURE(errorCode)) { + return nullptr; + } + const int32_t *iv = res_getIntVector(fTraceInfo, &getData(), res, &length); + if(iv == nullptr) { + errorCode = U_RESOURCE_TYPE_MISMATCH; + } + return iv; +} + +const uint8_t *ResourceDataValue::getBinary(int32_t &length, UErrorCode &errorCode) const { + if(U_FAILURE(errorCode)) { + return nullptr; + } + const uint8_t *b = res_getBinary(fTraceInfo, &getData(), res, &length); + if(b == nullptr) { + errorCode = U_RESOURCE_TYPE_MISMATCH; + } + return b; +} + +ResourceArray ResourceDataValue::getArray(UErrorCode &errorCode) const { + if(U_FAILURE(errorCode)) { + return ResourceArray(); + } + const uint16_t *items16 = nullptr; + const Resource *items32 = nullptr; + uint32_t offset=RES_GET_OFFSET(res); + int32_t length = 0; + switch(RES_GET_TYPE(res)) { + case URES_ARRAY: + if (offset!=0) { // empty if offset==0 + items32 = (const Resource *)getData().pRoot+offset; + length = *items32++; + } + break; + case URES_ARRAY16: + items16 = getData().p16BitUnits+offset; + length = *items16++; + break; + default: + errorCode = U_RESOURCE_TYPE_MISMATCH; + return ResourceArray(); + } + return ResourceArray(items16, items32, length, fTraceInfo); +} + +ResourceTable ResourceDataValue::getTable(UErrorCode &errorCode) const { + if(U_FAILURE(errorCode)) { + return ResourceTable(); + } + const uint16_t *keys16 = nullptr; + const int32_t *keys32 = nullptr; + const uint16_t *items16 = nullptr; + const Resource *items32 = nullptr; + uint32_t offset = RES_GET_OFFSET(res); + int32_t length = 0; + switch(RES_GET_TYPE(res)) { + case URES_TABLE: + if (offset != 0) { // empty if offset==0 + keys16 = (const uint16_t *)(getData().pRoot+offset); + length = *keys16++; + items32 = (const Resource *)(keys16+length+(~length&1)); + } + break; + case URES_TABLE16: + keys16 = getData().p16BitUnits+offset; + length = *keys16++; + items16 = keys16 + length; + break; + case URES_TABLE32: + if (offset != 0) { // empty if offset==0 + keys32 = getData().pRoot+offset; + length = *keys32++; + items32 = (const Resource *)keys32 + length; + } + break; + default: + errorCode = U_RESOURCE_TYPE_MISMATCH; + return ResourceTable(); + } + return ResourceTable(keys16, keys32, items16, items32, length, fTraceInfo); +} + +UBool ResourceDataValue::isNoInheritanceMarker() const { + return ::isNoInheritanceMarker(&getData(), res); +} + +int32_t ResourceDataValue::getStringArray(UnicodeString *dest, int32_t capacity, + UErrorCode &errorCode) const { + return ::getStringArray(&getData(), getArray(errorCode), dest, capacity, errorCode); +} + +int32_t ResourceDataValue::getStringArrayOrStringAsArray(UnicodeString *dest, int32_t capacity, + UErrorCode &errorCode) const { + if(URES_IS_ARRAY(res)) { + return ::getStringArray(&getData(), getArray(errorCode), dest, capacity, errorCode); + } + if(U_FAILURE(errorCode)) { + return 0; + } + if(dest == nullptr ? capacity != 0 : capacity < 0) { + errorCode = U_ILLEGAL_ARGUMENT_ERROR; + return 0; + } + if(capacity < 1) { + errorCode = U_BUFFER_OVERFLOW_ERROR; + return 1; + } + int32_t sLength; + const char16_t *s = res_getString(fTraceInfo, &getData(), res, &sLength); + if(s != nullptr) { + dest[0].setTo(true, s, sLength); + return 1; + } + errorCode = U_RESOURCE_TYPE_MISMATCH; + return 0; +} + +UnicodeString ResourceDataValue::getStringOrFirstOfArray(UErrorCode &errorCode) const { + UnicodeString us; + if(U_FAILURE(errorCode)) { + return us; + } + int32_t sLength; + const char16_t *s = res_getString(fTraceInfo, &getData(), res, &sLength); + if(s != nullptr) { + us.setTo(true, s, sLength); + return us; + } + ResourceArray array = getArray(errorCode); + if(U_FAILURE(errorCode)) { + return us; + } + if(array.getSize() > 0) { + // Tracing is already performed above (unimportant for trace that this is an array) + s = res_getStringNoTrace(&getData(), array.internalGetResource(&getData(), 0), &sLength); + if(s != nullptr) { + us.setTo(true, s, sLength); + return us; + } + } + errorCode = U_RESOURCE_TYPE_MISMATCH; + return us; +} + +U_NAMESPACE_END + +static Resource +makeResourceFrom16(const ResourceData *pResData, int32_t res16) { + if(res16poolStringIndex16Limit) { + // Pool string, nothing to do. + } else { + // Local string, adjust the 16-bit offset to a regular one, + // with a larger pool string index limit. + res16=res16-pResData->poolStringIndex16Limit+pResData->poolStringIndexLimit; + } + return URES_MAKE_RESOURCE(URES_STRING_V2, res16); +} + +U_CAPI Resource U_EXPORT2 +res_getTableItemByKey(const ResourceData *pResData, Resource table, + int32_t *indexR, const char **key) { + uint32_t offset=RES_GET_OFFSET(table); + int32_t length; + int32_t idx; + if(key == nullptr || *key == nullptr) { + return RES_BOGUS; + } + switch(RES_GET_TYPE(table)) { + case URES_TABLE: { + if (offset!=0) { /* empty if offset==0 */ + const uint16_t *p= (const uint16_t *)(pResData->pRoot+offset); + length=*p++; + *indexR=idx=_res_findTableItem(pResData, p, length, *key, key); + if(idx>=0) { + const Resource *p32=(const Resource *)(p+length+(~length&1)); + return p32[idx]; + } + } + break; + } + case URES_TABLE16: { + const uint16_t *p=pResData->p16BitUnits+offset; + length=*p++; + *indexR=idx=_res_findTableItem(pResData, p, length, *key, key); + if(idx>=0) { + return makeResourceFrom16(pResData, p[length+idx]); + } + break; + } + case URES_TABLE32: { + if (offset!=0) { /* empty if offset==0 */ + const int32_t *p= pResData->pRoot+offset; + length=*p++; + *indexR=idx=_res_findTable32Item(pResData, p, length, *key, key); + if(idx>=0) { + return (Resource)p[length+idx]; + } + } + break; + } + default: + break; + } + return RES_BOGUS; +} + +U_CAPI Resource U_EXPORT2 +res_getTableItemByIndex(const ResourceData *pResData, Resource table, + int32_t indexR, const char **key) { + uint32_t offset=RES_GET_OFFSET(table); + int32_t length; + if (indexR < 0) { + return RES_BOGUS; + } + switch(RES_GET_TYPE(table)) { + case URES_TABLE: { + if (offset != 0) { /* empty if offset==0 */ + const uint16_t *p= (const uint16_t *)(pResData->pRoot+offset); + length=*p++; + if(indexRp16BitUnits+offset; + length=*p++; + if(indexRpRoot+offset; + length=*p++; + if(indexRrootRes, &idx, &realKey); +} + + +UBool icu::ResourceTable::getKeyAndValue(int32_t i, + const char *&key, icu::ResourceValue &value) const { + if(0 <= i && i < length) { + icu::ResourceDataValue &rdValue = static_cast(value); + if (keys16 != nullptr) { + key = RES_GET_KEY16(&rdValue.getData(), keys16[i]); + } else { + key = RES_GET_KEY32(&rdValue.getData(), keys32[i]); + } + Resource res; + if (items16 != nullptr) { + res = makeResourceFrom16(&rdValue.getData(), items16[i]); + } else { + res = items32[i]; + } + // Note: the ResourceTracer keeps a reference to the field of this + // ResourceTable. This is OK because the ResourceTable should remain + // alive for the duration that fields are being read from it + // (including nested fields). + rdValue.setResource(res, ResourceTracer(fTraceInfo, key)); + return true; + } + return false; +} + +UBool icu::ResourceTable::findValue(const char *key, ResourceValue &value) const { + icu::ResourceDataValue &rdValue = static_cast(value); + const char *realKey = nullptr; + int32_t i; + if (keys16 != nullptr) { + i = _res_findTableItem(&rdValue.getData(), keys16, length, key, &realKey); + } else { + i = _res_findTable32Item(&rdValue.getData(), keys32, length, key, &realKey); + } + if (i >= 0) { + Resource res; + if (items16 != nullptr) { + res = makeResourceFrom16(&rdValue.getData(), items16[i]); + } else { + res = items32[i]; + } + // Same note about lifetime as in getKeyAndValue(). + rdValue.setResource(res, ResourceTracer(fTraceInfo, key)); + return true; + } + return false; +} + +U_CAPI Resource U_EXPORT2 +res_getArrayItem(const ResourceData *pResData, Resource array, int32_t indexR) { + uint32_t offset=RES_GET_OFFSET(array); + if (indexR < 0) { + return RES_BOGUS; + } + switch(RES_GET_TYPE(array)) { + case URES_ARRAY: { + if (offset!=0) { /* empty if offset==0 */ + const int32_t *p= pResData->pRoot+offset; + if(indexR<*p) { + return (Resource)p[1+indexR]; + } + } + break; + } + case URES_ARRAY16: { + const uint16_t *p=pResData->p16BitUnits+offset; + if(indexR<*p) { + return makeResourceFrom16(pResData, p[1+indexR]); + } + break; + } + default: + break; + } + return RES_BOGUS; +} + +uint32_t icu::ResourceArray::internalGetResource(const ResourceData *pResData, int32_t i) const { + if (items16 != nullptr) { + return makeResourceFrom16(pResData, items16[i]); + } else { + return items32[i]; + } +} + +UBool icu::ResourceArray::getValue(int32_t i, icu::ResourceValue &value) const { + if(0 <= i && i < length) { + icu::ResourceDataValue &rdValue = static_cast(value); + // Note: the ResourceTracer keeps a reference to the field of this + // ResourceArray. This is OK because the ResourceArray should remain + // alive for the duration that fields are being read from it + // (including nested fields). + rdValue.setResource( + internalGetResource(&rdValue.getData(), i), + ResourceTracer(fTraceInfo, i)); + return true; + } + return false; +} + +U_CFUNC Resource +res_findResource(const ResourceData *pResData, Resource r, char** path, const char** key) { + char *pathP = *path, *nextSepP = *path; + char *closeIndex = nullptr; + Resource t1 = r; + Resource t2; + int32_t indexR = 0; + UResType type = (UResType)RES_GET_TYPE(t1); + + /* if you come in with an empty path, you'll be getting back the same resource */ + if(!uprv_strlen(pathP)) { + return r; + } + + /* one needs to have an aggregate resource in order to search in it */ + if(!URES_IS_CONTAINER(type)) { + return RES_BOGUS; + } + + while(nextSepP && *pathP && t1 != RES_BOGUS && URES_IS_CONTAINER(type)) { + /* Iteration stops if: the path has been consumed, we found a non-existing + * resource (t1 == RES_BOGUS) or we found a scalar resource (including alias) + */ + nextSepP = uprv_strchr(pathP, RES_PATH_SEPARATOR); + /* if there are more separators, terminate string + * and set path to the remaining part of the string + */ + if(nextSepP != nullptr) { + if(nextSepP == pathP) { + // Empty key string. + return RES_BOGUS; + } + *nextSepP = 0; /* overwrite the separator with a NUL to terminate the key */ + *path = nextSepP+1; + } else { + *path = uprv_strchr(pathP, 0); + } + + /* if the resource is a table */ + /* try the key based access */ + if(URES_IS_TABLE(type)) { + *key = pathP; + t2 = res_getTableItemByKey(pResData, t1, &indexR, key); + } else if(URES_IS_ARRAY(type)) { + indexR = uprv_strtol(pathP, &closeIndex, 10); + if(indexR >= 0 && *closeIndex == 0) { + t2 = res_getArrayItem(pResData, t1, indexR); + } else { + t2 = RES_BOGUS; /* have an array, but don't have a valid index */ + } + *key = nullptr; + } else { /* can't do much here, except setting t2 to bogus */ + t2 = RES_BOGUS; + } + t1 = t2; + type = (UResType)RES_GET_TYPE(t1); + /* position pathP to next resource key/index */ + pathP = *path; + } + + return t1; +} + +/* resource bundle swapping ------------------------------------------------- */ + +/* + * Need to always enumerate the entire item tree, + * track the lowest address of any item to use as the limit for char keys[], + * track the highest address of any item to return the size of the data. + * + * We should have thought of storing those in the data... + * It is possible to extend the data structure by putting additional values + * in places that are inaccessible by ordinary enumeration of the item tree. + * For example, additional integers could be stored at the beginning or + * end of the key strings; this could be indicated by a minor version number, + * and the data swapping would have to know about these values. + * + * The data structure does not forbid keys to be shared, so we must swap + * all keys once instead of each key when it is referenced. + * + * These swapping functions assume that a resource bundle always has a length + * that is a multiple of 4 bytes. + * Currently, this is trivially true because genrb writes bundle tree leaves + * physically first, before their branches, so that the root table with its + * array of resource items (uint32_t values) is always last. + */ + +/* definitions for table sorting ------------------------ */ + +/* + * row of a temporary array + * + * gets platform-endian key string indexes and sorting indexes; + * after sorting this array by keys, the actual key/value arrays are permutated + * according to the sorting indexes + */ +typedef struct Row { + int32_t keyIndex, sortIndex; +} Row; + +static int32_t U_CALLCONV +ures_compareRows(const void *context, const void *left, const void *right) { + const char *keyChars=(const char *)context; + return (int32_t)uprv_strcmp(keyChars+((const Row *)left)->keyIndex, + keyChars+((const Row *)right)->keyIndex); +} + +typedef struct TempTable { + const char *keyChars; + Row *rows; + int32_t *resort; + uint32_t *resFlags; + int32_t localKeyLimit; + uint8_t majorFormatVersion; +} TempTable; + +enum { + STACK_ROW_CAPACITY=200 +}; + +/* The table item key string is not locally available. */ +static const char *const gUnknownKey=""; + +// TODO-LDML: #if due to https://unicode-org.atlassian.net/browse/ICU-22374 +#if !UCONFIG_NO_COLLATION +/* resource table key for collation binaries: "%%CollationBin" */ +static const char16_t gCollationBinKey[]={ + 0x25, 0x25, + 0x43, 0x6f, 0x6c, 0x6c, 0x61, 0x74, 0x69, 0x6f, 0x6e, + 0x42, 0x69, 0x6e, + 0 +}; +#endif + +/* + * swap one resource item + */ +static void +ures_swapResource(const UDataSwapper *ds, + const Resource *inBundle, Resource *outBundle, + Resource res, /* caller swaps res itself */ + const char *key, + TempTable *pTempTable, + UErrorCode *pErrorCode) { + const Resource *p; + Resource *q; + int32_t offset, count; + + switch(RES_GET_TYPE(res)) { + case URES_TABLE16: + case URES_STRING_V2: + case URES_INT: + case URES_ARRAY16: + /* integer, or points to 16-bit units, nothing to do here */ + return; + default: + break; + } + + /* all other types use an offset to point to their data */ + offset=(int32_t)RES_GET_OFFSET(res); + if(offset==0) { + /* special offset indicating an empty item */ + return; + } + if(pTempTable->resFlags[offset>>5]&((uint32_t)1<<(offset&0x1f))) { + /* we already swapped this resource item */ + return; + } else { + /* mark it as swapped now */ + pTempTable->resFlags[offset>>5]|=((uint32_t)1<<(offset&0x1f)); + } + + p=inBundle+offset; + q=outBundle+offset; + + switch(RES_GET_TYPE(res)) { + case URES_ALIAS: + /* physically same value layout as string, fall through */ + U_FALLTHROUGH; + case URES_STRING: + count=udata_readInt32(ds, (int32_t)*p); + /* swap length */ + ds->swapArray32(ds, p, 4, q, pErrorCode); + /* swap each char16_t (the terminating NUL would not change) */ + ds->swapArray16(ds, p+1, 2*count, q+1, pErrorCode); + break; + case URES_BINARY: + count=udata_readInt32(ds, (int32_t)*p); + /* swap length */ + ds->swapArray32(ds, p, 4, q, pErrorCode); + /* no need to swap or copy bytes - ures_swap() copied them all */ + + /* swap known formats */ +#if !UCONFIG_NO_COLLATION + if( key!=nullptr && /* the binary is in a table */ + (key!=gUnknownKey ? + /* its table key string is "%%CollationBin" */ + 0==ds->compareInvChars(ds, key, -1, + gCollationBinKey, UPRV_LENGTHOF(gCollationBinKey)-1) : + /* its table key string is unknown but it looks like a collation binary */ + ucol_looksLikeCollationBinary(ds, p+1, count)) + ) { + ucol_swap(ds, p+1, count, q+1, pErrorCode); + } +#endif + break; + case URES_TABLE: + case URES_TABLE32: + { + const uint16_t *pKey16; + uint16_t *qKey16; + + const int32_t *pKey32; + int32_t *qKey32; + + Resource item; + int32_t i, oldIndex; + + if(RES_GET_TYPE(res)==URES_TABLE) { + /* get table item count */ + pKey16=(const uint16_t *)p; + qKey16=(uint16_t *)q; + count=ds->readUInt16(*pKey16); + + pKey32=qKey32=nullptr; + + /* swap count */ + ds->swapArray16(ds, pKey16++, 2, qKey16++, pErrorCode); + + offset+=((1+count)+1)/2; + } else { + /* get table item count */ + pKey32=(const int32_t *)p; + qKey32=(int32_t *)q; + count=udata_readInt32(ds, *pKey32); + + pKey16=qKey16=nullptr; + + /* swap count */ + ds->swapArray32(ds, pKey32++, 4, qKey32++, pErrorCode); + + offset+=1+count; + } + + if(count==0) { + break; + } + + p=inBundle+offset; /* pointer to table resources */ + q=outBundle+offset; + + /* recurse */ + for(i=0; ireadUInt16(pKey16[i]); + if(keyOffsetlocalKeyLimit) { + itemKey=(const char *)outBundle+keyOffset; + } + } else { + int32_t keyOffset=udata_readInt32(ds, pKey32[i]); + if(keyOffset>=0) { + itemKey=(const char *)outBundle+keyOffset; + } + } + item=ds->readUInt32(p[i]); + ures_swapResource(ds, inBundle, outBundle, item, itemKey, pTempTable, pErrorCode); + if(U_FAILURE(*pErrorCode)) { + udata_printError(ds, "ures_swapResource(table res=%08x)[%d].recurse(%08x) failed\n", + res, i, item); + return; + } + } + + if(pTempTable->majorFormatVersion>1 || ds->inCharset==ds->outCharset) { + /* no need to sort, just swap the offset/value arrays */ + if(pKey16!=nullptr) { + ds->swapArray16(ds, pKey16, count*2, qKey16, pErrorCode); + ds->swapArray32(ds, p, count*4, q, pErrorCode); + } else { + /* swap key offsets and items as one array */ + ds->swapArray32(ds, pKey32, count*2*4, qKey32, pErrorCode); + } + break; + } + + /* + * We need to sort tables by outCharset key strings because they + * sort differently for different charset families. + * ures_swap() already set pTempTable->keyChars appropriately. + * First we set up a temporary table with the key indexes and + * sorting indexes and sort that. + * Then we permutate and copy/swap the actual values. + */ + if(pKey16!=nullptr) { + for(i=0; irows[i].keyIndex=ds->readUInt16(pKey16[i]); + pTempTable->rows[i].sortIndex=i; + } + } else { + for(i=0; irows[i].keyIndex=udata_readInt32(ds, pKey32[i]); + pTempTable->rows[i].sortIndex=i; + } + } + uprv_sortArray(pTempTable->rows, count, sizeof(Row), + ures_compareRows, pTempTable->keyChars, + false, pErrorCode); + if(U_FAILURE(*pErrorCode)) { + udata_printError(ds, "ures_swapResource(table res=%08x).uprv_sortArray(%d items) failed\n", + res, count); + return; + } + + /* + * copy/swap/permutate items + * + * If we swap in-place, then the permutation must use another + * temporary array (pTempTable->resort) + * before the results are copied to the outBundle. + */ + /* keys */ + if(pKey16!=nullptr) { + uint16_t *rKey16; + + if(pKey16!=qKey16) { + rKey16=qKey16; + } else { + rKey16=(uint16_t *)pTempTable->resort; + } + for(i=0; irows[i].sortIndex; + ds->swapArray16(ds, pKey16+oldIndex, 2, rKey16+i, pErrorCode); + } + if(qKey16!=rKey16) { + uprv_memcpy(qKey16, rKey16, 2*count); + } + } else { + int32_t *rKey32; + + if(pKey32!=qKey32) { + rKey32=qKey32; + } else { + rKey32=pTempTable->resort; + } + for(i=0; irows[i].sortIndex; + ds->swapArray32(ds, pKey32+oldIndex, 4, rKey32+i, pErrorCode); + } + if(qKey32!=rKey32) { + uprv_memcpy(qKey32, rKey32, 4*count); + } + } + + /* resources */ + { + Resource *r; + + + if(p!=q) { + r=q; + } else { + r=(Resource *)pTempTable->resort; + } + for(i=0; irows[i].sortIndex; + ds->swapArray32(ds, p+oldIndex, 4, r+i, pErrorCode); + } + if(q!=r) { + uprv_memcpy(q, r, 4*count); + } + } + } + break; + case URES_ARRAY: + { + Resource item; + int32_t i; + + count=udata_readInt32(ds, (int32_t)*p); + /* swap length */ + ds->swapArray32(ds, p++, 4, q++, pErrorCode); + + /* recurse */ + for(i=0; ireadUInt32(p[i]); + ures_swapResource(ds, inBundle, outBundle, item, nullptr, pTempTable, pErrorCode); + if(U_FAILURE(*pErrorCode)) { + udata_printError(ds, "ures_swapResource(array res=%08x)[%d].recurse(%08x) failed\n", + res, i, item); + return; + } + } + + /* swap items */ + ds->swapArray32(ds, p, 4*count, q, pErrorCode); + } + break; + case URES_INT_VECTOR: + count=udata_readInt32(ds, (int32_t)*p); + /* swap length and each integer */ + ds->swapArray32(ds, p, 4*(1+count), q, pErrorCode); + break; + default: + /* also catches RES_BOGUS */ + *pErrorCode=U_UNSUPPORTED_ERROR; + break; + } +} + +U_CAPI int32_t U_EXPORT2 +ures_swap(const UDataSwapper *ds, + const void *inData, int32_t length, void *outData, + UErrorCode *pErrorCode) { + const UDataInfo *pInfo; + const Resource *inBundle; + Resource rootRes; + int32_t headerSize, maxTableLength; + + Row rows[STACK_ROW_CAPACITY]; + int32_t resort[STACK_ROW_CAPACITY]; + TempTable tempTable; + + const int32_t *inIndexes; + + /* the following integers count Resource item offsets (4 bytes each), not bytes */ + int32_t bundleLength, indexLength, keysBottom, keysTop, resBottom, top; + + /* udata_swapDataHeader checks the arguments */ + headerSize=udata_swapDataHeader(ds, inData, length, outData, pErrorCode); + if(pErrorCode==nullptr || U_FAILURE(*pErrorCode)) { + return 0; + } + + /* check data format and format version */ + pInfo=(const UDataInfo *)((const char *)inData+4); + if(!( + pInfo->dataFormat[0]==0x52 && /* dataFormat="ResB" */ + pInfo->dataFormat[1]==0x65 && + pInfo->dataFormat[2]==0x73 && + pInfo->dataFormat[3]==0x42 && + /* formatVersion 1.1+ or 2.x or 3.x */ + ((pInfo->formatVersion[0]==1 && pInfo->formatVersion[1]>=1) || + pInfo->formatVersion[0]==2 || pInfo->formatVersion[0]==3) + )) { + udata_printError(ds, "ures_swap(): data format %02x.%02x.%02x.%02x (format version %02x.%02x) is not a resource bundle\n", + pInfo->dataFormat[0], pInfo->dataFormat[1], + pInfo->dataFormat[2], pInfo->dataFormat[3], + pInfo->formatVersion[0], pInfo->formatVersion[1]); + *pErrorCode=U_UNSUPPORTED_ERROR; + return 0; + } + tempTable.majorFormatVersion=pInfo->formatVersion[0]; + + /* a resource bundle must contain at least one resource item */ + if(length<0) { + bundleLength=-1; + } else { + bundleLength=(length-headerSize)/4; + + /* formatVersion 1.1 must have a root item and at least 5 indexes */ + if(bundleLength<(1+5)) { + udata_printError(ds, "ures_swap(): too few bytes (%d after header) for a resource bundle\n", + length-headerSize); + *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; + return 0; + } + } + + inBundle=(const Resource *)((const char *)inData+headerSize); + rootRes=ds->readUInt32(*inBundle); + + /* formatVersion 1.1 adds the indexes[] array */ + inIndexes=(const int32_t *)(inBundle+1); + + indexLength=udata_readInt32(ds, inIndexes[URES_INDEX_LENGTH])&0xff; + if(indexLength<=URES_INDEX_MAX_TABLE_LENGTH) { + udata_printError(ds, "ures_swap(): too few indexes for a 1.1+ resource bundle\n"); + *pErrorCode=U_INDEX_OUTOFBOUNDS_ERROR; + return 0; + } + keysBottom=1+indexLength; + keysTop=udata_readInt32(ds, inIndexes[URES_INDEX_KEYS_TOP]); + if(indexLength>URES_INDEX_16BIT_TOP) { + resBottom=udata_readInt32(ds, inIndexes[URES_INDEX_16BIT_TOP]); + } else { + resBottom=keysTop; + } + top=udata_readInt32(ds, inIndexes[URES_INDEX_BUNDLE_TOP]); + maxTableLength=udata_readInt32(ds, inIndexes[URES_INDEX_MAX_TABLE_LENGTH]); + + if(0<=bundleLength && bundleLength(1+indexLength)) { + tempTable.localKeyLimit=keysTop<<2; + } else { + tempTable.localKeyLimit=0; + } + + if(length>=0) { + Resource *outBundle=(Resource *)((char *)outData+headerSize); + + /* track which resources we have already swapped */ + uint32_t stackResFlags[STACK_ROW_CAPACITY]; + int32_t resFlagsLength; + + /* + * We need one bit per 4 resource bundle bytes so that we can track + * every possible Resource for whether we have swapped it already. + * Multiple Resource words can refer to the same bundle offsets + * for sharing identical values. + * We could optimize this by allocating only for locations above + * where Resource values are stored (above keys & strings). + */ + resFlagsLength=(length+31)>>5; /* number of bytes needed */ + resFlagsLength=(resFlagsLength+3)&~3; /* multiple of 4 bytes for uint32_t */ + if(resFlagsLength<=(int32_t)sizeof(stackResFlags)) { + tempTable.resFlags=stackResFlags; + } else { + tempTable.resFlags=(uint32_t *)uprv_malloc(resFlagsLength); + if(tempTable.resFlags==nullptr) { + udata_printError(ds, "ures_swap(): unable to allocate memory for tracking resources\n"); + *pErrorCode=U_MEMORY_ALLOCATION_ERROR; + return 0; + } + } + uprv_memset(tempTable.resFlags, 0, resFlagsLength); + + /* copy the bundle for binary and inaccessible data */ + if(inData!=outData) { + uprv_memcpy(outBundle, inBundle, 4*top); + } + + /* swap the key strings, but not the padding bytes (0xaa) after the last string and its NUL */ + udata_swapInvStringBlock(ds, inBundle+keysBottom, 4*(keysTop-keysBottom), + outBundle+keysBottom, pErrorCode); + if(U_FAILURE(*pErrorCode)) { + udata_printError(ds, "ures_swap().udata_swapInvStringBlock(keys[%d]) failed\n", 4*(keysTop-keysBottom)); + return 0; + } + + /* swap the 16-bit units (strings, table16, array16) */ + if(keysTopswapArray16(ds, inBundle+keysTop, (resBottom-keysTop)*4, outBundle+keysTop, pErrorCode); + if(U_FAILURE(*pErrorCode)) { + udata_printError(ds, "ures_swap().swapArray16(16-bit units[%d]) failed\n", 2*(resBottom-keysTop)); + return 0; + } + } + + /* allocate the temporary table for sorting resource tables */ + tempTable.keyChars=(const char *)outBundle; /* sort by outCharset */ + if(tempTable.majorFormatVersion>1 || maxTableLength<=STACK_ROW_CAPACITY) { + tempTable.rows=rows; + tempTable.resort=resort; + } else { + tempTable.rows=(Row *)uprv_malloc(maxTableLength*sizeof(Row)+maxTableLength*4); + if(tempTable.rows==nullptr) { + udata_printError(ds, "ures_swap(): unable to allocate memory for sorting tables (max length: %d)\n", + maxTableLength); + *pErrorCode=U_MEMORY_ALLOCATION_ERROR; + if(tempTable.resFlags!=stackResFlags) { + uprv_free(tempTable.resFlags); + } + return 0; + } + tempTable.resort=(int32_t *)(tempTable.rows+maxTableLength); + } + + /* swap the resources */ + ures_swapResource(ds, inBundle, outBundle, rootRes, nullptr, &tempTable, pErrorCode); + if(U_FAILURE(*pErrorCode)) { + udata_printError(ds, "ures_swapResource(root res=%08x) failed\n", + rootRes); + } + + if(tempTable.rows!=rows) { + uprv_free(tempTable.rows); + } + if(tempTable.resFlags!=stackResFlags) { + uprv_free(tempTable.resFlags); + } + + /* swap the root resource and indexes */ + ds->swapArray32(ds, inBundle, keysBottom*4, outBundle, pErrorCode); + } + + return headerSize+4*top; +} diff --git a/developer/src/kmcmplib/subprojects/packagefiles/icu/source/meson.build b/developer/src/kmcmplib/subprojects/packagefiles/icu/source/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..406b88ad94bbf943a2f20e964a83ddf1cabc3786 --- /dev/null +++ b/developer/src/kmcmplib/subprojects/packagefiles/icu/source/meson.build @@ -0,0 +1,22 @@ +incdir = include_directories('common') + +# if host_machine.system() == 'windows' +# icudata_name = '@0@icudt@1@'.format(library_prefix, library_suffix) +# else + icudata_name = '@0@icudata@1@'.format(library_prefix, library_suffix) +# endif + +subdir('stubdata') +subdir('common') + +# TODO-LDML: Not used now, will need for regex +# subdir('i18n') + +## Note: The following subdirs are not used by Keyman (at present) + +# subdir('data') +# subdir('io') +# subdir('layout') +# subdir('layoutex') +# subdir('test') +# subdir('tools') diff --git a/developer/src/kmcmplib/subprojects/packagefiles/icu/source/stubdata/meson.build b/developer/src/kmcmplib/subprojects/packagefiles/icu/source/stubdata/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..ee116a9bf02def142bef739a3f294bf0f403c003 --- /dev/null +++ b/developer/src/kmcmplib/subprojects/packagefiles/icu/source/stubdata/meson.build @@ -0,0 +1,31 @@ +sources = files( + 'stubdata.cpp', +) + +stubdata_lib = static_library( + icudata_name, + sources, + c_args: ['-DSTUBDATA_BUILD'] + usage_args, + cpp_args:[ '-DSTUBDATA_BUILD' ]+ usage_args, + include_directories: incdir, + # version: U_ICU_VERSION, +) + +stubdata_dep = declare_dependency( + link_with: stubdata_lib, +) + + +# if meson.can_run_host_binaries() + stubdata_native_lib = stubdata_lib +# else +# stubdata_native_lib = library( +# '@0@-native'.format(icudata_name), +# sources, +# c_args: '-DSTUBDATA_BUILD', +# cpp_args: '-DSTUBDATA_BUILD', +# include_directories: incdir, +# version: U_ICU_VERSION, +# native: true, +# ) +# endif diff --git a/developer/src/kmcmplib/tests/README.md b/developer/src/kmcmplib/tests/README.md new file mode 100644 index 0000000000000000000000000000000000000000..5d3b2804d41554d2a1e79883de4c39f612a83f67 --- /dev/null +++ b/developer/src/kmcmplib/tests/README.md @@ -0,0 +1,33 @@ +# Unit tests for kmcmplib + +**Note:** the keyboards repository tests only run if --full-test is passed to +build.sh. + +kmcmplib tests include building all keyboards in the keyboards repository and +comparing against a 'known good' legacy compiler set. This is trickier than it +sounds because the legacy compiler only runs under Windows/WINE and we don't +want to introduce a dependency on that for running the tests. + +Instead we've gone the route of adding a pre-compiled set of .kmx fixtures, +alongside a commit ref in keyboards_commit_ref.txt. The test script will +checkout that specific ref in its own private clone of the keyboards repository +(including a shallow clone of the keyboards repo if it isn't already present), +and compiling the sources from that specific commit. + +For performance reasons, it is useful to setup KEYBOARDS_ROOT env var to point +to your local clone of the keyboards repository. The build will make a private +clone of this repo rather than the remote clone if it is available, which is +typically much faster. + +# Preparing fixtures + +prep.sh allows us to regenerate the fixtures with the legacy compiler for +testing. It depends on the regression test scripts in keyboards.sh, and specific +changes introduced into those scripts in +https://github.com/keymanapp/keyboards/pull/2169. + +It is essential that the keyboards repository is clean and checked out to the +commit that you want to be using (usually this will be HEAD of master). All of +Keyman Developer must be built locally and binaries should be in developer/bin/. + +prep.sh has only been tested on Windows, because it relies on kmcomp.exe. diff --git a/developer/src/kmcmplib/tests/api-test.cpp b/developer/src/kmcmplib/tests/api-test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4c46b1f1a408c166cda98dda0ef43d7449471a1e --- /dev/null +++ b/developer/src/kmcmplib/tests/api-test.cpp @@ -0,0 +1,89 @@ +/* + * Keyman is copyright (C) SIL International. MIT License. + * + * API endpoint unit tests for kmcmplib + */ + +#include + +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include "../src/compfile.h" +#include + +void setup(); +void test_kmcmp_CompileKeyboardFile(); +void test_kmcmp_CompileKeyboardFileToBuffer(); + +std::vector error_vec; + +int msgproc(int line, uint32_t dwMsgCode, char* szText, void* context) { + error_vec.push_back(dwMsgCode); + const char*t = "unknown"; + switch(dwMsgCode & 0xF000) { + case CERR_HINT: t=" hint"; break; + case CERR_WARNING: t="warning"; break; + case CERR_ERROR: t=" error"; break; + case CERR_FATAL: t=" fatal"; break; + } + printf("line %d %s %04.4x: %s\n", line, t, (unsigned int)dwMsgCode, szText); + return 1; +} + +int main(int argc, char *argv[]) { + setup(); + test_kmcmp_CompileKeyboardFile(); + + setup(); + test_kmcmp_CompileKeyboardFileToBuffer(); + + return 0; +} + +void setup() { + error_vec.clear(); +} + +void test_kmcmp_CompileKeyboardFile() { + char kmn_file[L_tmpnam], kmx_file[L_tmpnam]; + tmpnam(kmn_file); + tmpnam(kmx_file); + + // Create an empty file + FILE *fp = fopen(kmn_file, "w"); + fclose(fp); + + // It should fail when a zero-byte file is passed in + assert(!kmcmp_CompileKeyboardFile(kmn_file, kmx_file, true, false, true, msgproc, nullptr)); + assert(error_vec.size() == 1); + assert(error_vec[0] == CERR_CannotReadInfile); + + unlink(kmn_file); +} + +void test_kmcmp_CompileKeyboardFileToBuffer() { + char kmn_file[L_tmpnam], kmx_file[L_tmpnam]; + tmpnam(kmn_file); + tmpnam(kmx_file); + + // Create an empty file + FILE *fp = fopen(kmn_file, "w"); + fclose(fp); + + FILE_KEYBOARD fk; + + // It should fail when a zero-byte file is passed in + assert(!kmcmp_CompileKeyboardFileToBuffer(kmn_file, &fk, true, false, msgproc, nullptr, CKF_KEYMAN)); + assert(error_vec.size() == 1); + assert(error_vec[0] == CERR_CannotReadInfile); + + unlink(kmn_file); +} \ No newline at end of file diff --git a/developer/src/kmcmplib/tests/fixtures/adiga_danef.kmx b/developer/src/kmcmplib/tests/fixtures/adiga_danef.kmx new file mode 100644 index 0000000000000000000000000000000000000000..022254f30cb8d418d80a307b4450d3f7d3f7d58f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/adiga_danef.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/ahom_star.kmx b/developer/src/kmcmplib/tests/fixtures/ahom_star.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bb4a25dc3ed3d5223a66e941d659c7b24327526c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/ahom_star.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/aksarabali_panlex.kmx b/developer/src/kmcmplib/tests/fixtures/aksarabali_panlex.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8ef0107686cda89ffea8ef62630f98b9c5c380d1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/aksarabali_panlex.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/alephwithbeth.kmx b/developer/src/kmcmplib/tests/fixtures/alephwithbeth.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2e2140a47de066096d67d83be4b29e16eae46dd4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/alephwithbeth.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/anii.kmx b/developer/src/kmcmplib/tests/fixtures/anii.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b7364fc6499a0370197eed458058f63aca6624bf Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/anii.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/arabic_izza.kmx b/developer/src/kmcmplib/tests/fixtures/arabic_izza.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c573fecd20687968fce217b28d26ef2de91efee9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/arabic_izza.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/aramaic_hebrew.kmx b/developer/src/kmcmplib/tests/fixtures/aramaic_hebrew.kmx new file mode 100644 index 0000000000000000000000000000000000000000..583078c41843337c1471ae45d1b8498643212912 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/aramaic_hebrew.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/armenian_mnemonic.kmx b/developer/src/kmcmplib/tests/fixtures/armenian_mnemonic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8010790e3da2f267e51bd25083d90030c6604ca6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/armenian_mnemonic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/armenian_mnemonic_r.kmx b/developer/src/kmcmplib/tests/fixtures/armenian_mnemonic_r.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d54f85abee2f4a5ce1d42cc39afb0a0a0dcad394 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/armenian_mnemonic_r.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/athinkra_vai.kmx b/developer/src/kmcmplib/tests/fixtures/athinkra_vai.kmx new file mode 100644 index 0000000000000000000000000000000000000000..127914ffe52d26515f0b8332d4857d58fa8f8b96 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/athinkra_vai.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/athinkra_vai_typewriter.kmx b/developer/src/kmcmplib/tests/fixtures/athinkra_vai_typewriter.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cab129cf0b11cdd1eb523e7324d2179128d863bd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/athinkra_vai_typewriter.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/ausephon.kmx b/developer/src/kmcmplib/tests/fixtures/ausephon.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5e1d99345156581ffa851c9a21bb26a8cd90eaee Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/ausephon.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/balochi_inpage.kmx b/developer/src/kmcmplib/tests/fixtures/balochi_inpage.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2d7e0606880adadb6e7e3e6611f7cf5145e4f5dc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/balochi_inpage.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/balochi_latin.kmx b/developer/src/kmcmplib/tests/fixtures/balochi_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5718c9ed54b10dfa73645fd3edcecbbdc185c05b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/balochi_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/balochi_persian.kmx b/developer/src/kmcmplib/tests/fixtures/balochi_persian.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0aa472e7d719e58b40718c238411539d6b091fdc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/balochi_persian.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/balochi_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/balochi_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..38714eb7888a0b8fabf64ca6fbb09c823e680d62 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/balochi_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/balochi_scientific.kmx b/developer/src/kmcmplib/tests/fixtures/balochi_scientific.kmx new file mode 100644 index 0000000000000000000000000000000000000000..20ca365b71c9086fbdfc5d6b58a6e22264688932 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/balochi_scientific.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/balochi_urdu.kmx b/developer/src/kmcmplib/tests/fixtures/balochi_urdu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..43112d0ad470c442a5da3b1e0094af9762a701a7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/balochi_urdu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bangla_joy.kmx b/developer/src/kmcmplib/tests/fixtures/bangla_joy.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6228742eca089c60966479c016e811ba2df6b6b7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bangla_joy.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bangla_munir.kmx b/developer/src/kmcmplib/tests/fixtures/bangla_munir.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ba449452e698810b89b48545b9f637e650fcd26b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bangla_munir.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bangla_probhat.kmx b/developer/src/kmcmplib/tests/fixtures/bangla_probhat.kmx new file mode 100644 index 0000000000000000000000000000000000000000..582b517ef5e54e4751a5b9c2f106911241874aea Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bangla_probhat.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbda1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbda1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a4e8a01c0136104c2ee07323f872e32411c98c5c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbda1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbda2.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbda2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..87712cb69cf30d04a15f3f2e084a90fa655910cd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbda2.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbda3.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbda3.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dacb36e258a277f875068760172e15002a835105 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbda3.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdadlm.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdadlm.kmx new file mode 100644 index 0000000000000000000000000000000000000000..81159040eea2a41a080e5b21a25ab4f8171e438c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdadlm.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdal.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdal.kmx new file mode 100644 index 0000000000000000000000000000000000000000..797300726e58b26366f5a9dd044b49dca88899bd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdal.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdarme.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdarme.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9210a7fa3a951d9d06fbce7a81b65ae71861f6f4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdarme.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdarmph.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdarmph.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e77ad47a93adb60880dd9238a150d7ca990065c0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdarmph.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdarmty.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdarmty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a02cdd54ba4c8715c64ce37553ae3ba24f3d4425 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdarmty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdarmw.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdarmw.kmx new file mode 100644 index 0000000000000000000000000000000000000000..073ce6d16f55b81a0f5f7dfae9228f6c38bec54e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdarmw.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdaze.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdaze.kmx new file mode 100644 index 0000000000000000000000000000000000000000..490aaac05fe5aeab1cde4bb44d3d677b918895d7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdaze.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdazel.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdazel.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d12f8d6f92749aa8d4fe1ce0c04dfc5db675411a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdazel.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdazst.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdazst.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3c56347f51c3b624f892aec6a3b610d9ffcae01e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdazst.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdbash.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdbash.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b5c2783d685ceacd2ac104faefb9cf615afae6f2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdbash.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdbe.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdbe.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9000c86436324f8d6f1984de49823aef46366feb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdbe.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdbene.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdbene.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b0d15fa23a599c23e7dae149e6c3e4c1f3ded254 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdbene.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdbgph.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdbgph.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ddd9bded810372f9d5084f3164b033c238142bd1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdbgph.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdbgph1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdbgph1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..284a8878a1f92fbcf178f67c93993ad08675ee36 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdbgph1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdbhc.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdbhc.kmx new file mode 100644 index 0000000000000000000000000000000000000000..937f755ea95c1572c13d38a80bfac9caba3f619b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdbhc.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdblr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdblr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2a36c250446e40dfaeb4b30b9da077fd3c27c3b8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdblr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdbr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdbr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f3d117172c4fb1353ee91451c21b96184ef1dd4b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdbr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdbu.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdbu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8e27a0dbc67e28267ff91e9d03b8a485f3cfac23 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdbu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdbug.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdbug.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c1021e5c7fa13c2b375b21fb8a2ea83ea83b6561 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdbug.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdbulg.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdbulg.kmx new file mode 100644 index 0000000000000000000000000000000000000000..88c242a58fa3333c4f6a68cd8f139a4ccede3dd0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdbulg.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdca.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdca.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ebb3bae6ce546dae6b050c07992a2f8d2e74e8df Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdca.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdcan.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdcan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..65e70a2c70643d1155e043aa1acd4d5d82f4a778 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdcan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdcher.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdcher.kmx new file mode 100644 index 0000000000000000000000000000000000000000..792054a8903f8319da5d740621e278754e7e6236 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdcher.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdcherp.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdcherp.kmx new file mode 100644 index 0000000000000000000000000000000000000000..91c769d249377d4342dc979222b295ccaf954188 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdcherp.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdcr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdcr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fe0e9c70486314de772cff54606ebdc746f1762e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdcr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdcz.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdcz.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e293b056cdd0b30acc9a2b52a13442bd9b0ac5a8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdcz.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdcz1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdcz1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5a7243bd93c34d954e2811cf559f036a44bee2a6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdcz1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdcz2.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdcz2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8cf0d820b9d749dfb3fde7ce074b4fc78b1a6fda Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdcz2.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdda.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdda.kmx new file mode 100644 index 0000000000000000000000000000000000000000..aa282296e347cee97f1bb0dcb2f432ec3ea0a0de Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdda.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbddiv1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbddiv1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..eea19450598ecb64afc91dc6f520fb1c17edba2f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbddiv1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbddiv2.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbddiv2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a2bf45f00cdff79abc305ac7cb7c553ea1a6c0c0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbddiv2.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbddv.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbddv.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f4731412f03e665988e89e21e763aa16c1118d45 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbddv.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbddzo.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbddzo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1b2b2584510ee4d22d429b96e9a07f7fa5a65c01 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbddzo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdes.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdes.kmx new file mode 100644 index 0000000000000000000000000000000000000000..97cd31535da991e80f11fd05e198184cb6c69438 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdes.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdest.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdest.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d66c6984b51ff54618b6b395296b7c212993c5e7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdest.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdfa.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdfa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5c4f44b6ada77244cd511143e11a6fbed224a35c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdfa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdfar.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdfar.kmx new file mode 100644 index 0000000000000000000000000000000000000000..59bcae67d18e2f35a068ef78b0b97642ac88feab Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdfar.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdfi.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdfi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cc53ecc0c6873f956cacc66f947cb9f171ca2d3b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdfi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdfi1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdfi1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fa9d6c4c731b921917261800d55da17e624371f5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdfi1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdfo.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdfo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8aa400b50bed17f949766b8ea20f40dcad2ae5b1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdfo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdfr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdfr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a243166c2ddf8e5c8fb4d38486cb41af1d3e7b3a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdfr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdfthrk.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdfthrk.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bc26f816056204241042f01fb053eeeae0ac635d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdfthrk.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgae.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgae.kmx new file mode 100644 index 0000000000000000000000000000000000000000..31a621f17b6eb2199acd14bda278fa866c78c381 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgae.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgeo.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgeo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..458e4ec060bff672178330c1792926f602288ab1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgeo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgeoer.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgeoer.kmx new file mode 100644 index 0000000000000000000000000000000000000000..107967ba6f6a05b6ef02d3895f515db48680dbe7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgeoer.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgeome.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgeome.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1ac4c9083d5139c0c83dfae1e945a1982fa54fab Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgeome.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgeooa.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgeooa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c356eecd7b0f80b6d2dfbf242f9b4c1b12767bdb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgeooa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgeoqw.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgeoqw.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7e251ebc113aafcaa45faaca87fa58e721d5932a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgeoqw.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgkl.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgkl.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d264860a10731fbea01245b35413e6b0377b9b8e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgkl.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgn.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgn.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cfd3cf5c319211f6b9501734cd053cefb7b9b934 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgn.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..116ee9be91a190128993eb728c32f06700063574 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgr1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgr1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8672a9c7c10c7dd0f1efee665e51fed7ef08c266 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgr1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgrlnd.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgrlnd.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dfbc61f0ee8938d292bf1fc7faebc06f56eae6e9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgrlnd.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdgthc.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdgthc.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c8ffe27cf7ac2364214d8fce23e6f50d00050136 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdgthc.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhau.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhau.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8486d0af507978fe632a7408628d7bfe53760c67 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhau.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhaw.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhaw.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9cf3c48b9a47602e637ba8b61ed125b5105d9539 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhaw.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhe.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhe.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2268775a7d98bbdfe3ff2deace0509202d0daaac Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhe.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhe220.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhe220.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bdfc400f7537137cc3b4ee438d3e3201a9ac30d5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhe220.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhe319.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhe319.kmx new file mode 100644 index 0000000000000000000000000000000000000000..100fe70446bee6b910d3714743f69a53d898b0fd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhe319.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdheb.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdheb.kmx new file mode 100644 index 0000000000000000000000000000000000000000..72fb99e682fafa1c94c455b2a6417a35d3150b61 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdheb.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhebl3.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhebl3.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b28ab2f42bc09ce6294d8d8f647a65dddb858b37 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhebl3.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhela2.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhela2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e52d1e212251c9163e6d75969399161ee51d714e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhela2.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhela3.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhela3.kmx new file mode 100644 index 0000000000000000000000000000000000000000..044cc06f26c19c0796a89c79061e77cf1b82d76e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhela3.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhept.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhept.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e629ffda18f00a74a37845a236f9b51e4edd857a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhept.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhu.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..92205a9bd96ecc92cfb6b24327b39829be2930a7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdhu1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdhu1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5d9ff3d278325f97734c741e0307fc9610e2a9f9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdhu1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdibo.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdibo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..081025252b168bc4242f95a02847885950d66052 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdibo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdic.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6d9df2e7a070a4efffde7464d9bc701bcc0d4611 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinasa.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinasa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cac244378355ad3b72d8088ce762300d532823f8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinasa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinbe2.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinbe2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..78a5acd3013f77194d0b29d7624dab1e899c7bf7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinbe2.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinben.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinben.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a660d951b8d4d394cc6eafaedef45ef0060fefe0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinben.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdindev.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdindev.kmx new file mode 100644 index 0000000000000000000000000000000000000000..32d454daaa42013bb3f4e709222beaa2fc20a18c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdindev.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinen.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinen.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0ce474be7cdf76d9b13884d6488480fb6b2213a6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinen.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinguj.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinguj.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3529d62f77935613be5bd00844a461fc228bd01a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinguj.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinhin.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinhin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..754d7fc8c8b8f735ab7e89ebe211be9fb0da37dd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinhin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinkan.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinkan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..33a2802a734b856c394fe12126018a98c3579ff7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinkan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinmal.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinmal.kmx new file mode 100644 index 0000000000000000000000000000000000000000..00f6e8c4e8d90a996450fe092dddc7763fbaa9ab Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinmal.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinmar.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinmar.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6d7289da4a33dbd7feee2c477d7d028e23600047 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinmar.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinori.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinori.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dfd8244e332eac1875a1116a3f7438229bbb408c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinori.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinpun.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinpun.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5ccb95ae1cf2ae39a1a5b9e5983f8f18131badbb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinpun.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdintam.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdintam.kmx new file mode 100644 index 0000000000000000000000000000000000000000..61fd2637dbfbba3f5315d408429eafe6839f1493 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdintam.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdintel.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdintel.kmx new file mode 100644 index 0000000000000000000000000000000000000000..217f05338f0aee310c33f778522dc108b8c911df Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdintel.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdinuk2.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdinuk2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..00b4e83b704c346638a165a753032ee012e4e3cc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdinuk2.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdir.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdir.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2df897edd98028fd2febe69f24434e9612c9a81e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdir.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdit.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdit.kmx new file mode 100644 index 0000000000000000000000000000000000000000..97488aaf6305aa9ed89337e66af3b58f53b7254a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdit.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdit142.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdit142.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d8b9d5f487c39b2caf00b5e2c7a66f4f0db0df2d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdit142.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdiulat.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdiulat.kmx new file mode 100644 index 0000000000000000000000000000000000000000..29b9e8cd621fc7eba5b4d8b385cde8a6f37ee970 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdiulat.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdjav.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdjav.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2d903c534f986212184b64a88f035094eb99bbfd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdjav.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdkaz.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdkaz.kmx new file mode 100644 index 0000000000000000000000000000000000000000..aec72e3a967ea872077e58a620d3081ecedce3c2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdkaz.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdkhmr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdkhmr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e1ad6cff7e97e02486fc02403c440d9a8a72512c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdkhmr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdkni.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdkni.kmx new file mode 100644 index 0000000000000000000000000000000000000000..06a5b460b0719d2b77b01cdae5e5f20a86a61a96 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdkni.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdkurd.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdkurd.kmx new file mode 100644 index 0000000000000000000000000000000000000000..86e3cf268033f3ed18a8250c430d6724efc398d2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdkurd.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdkyr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdkyr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a6a34652547aff4d9fc9736059b62e43975c4db8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdkyr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdla.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdla.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8bdf865cf2e7d4d5d2032cb4ef089c999a1a3641 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdla.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdlao.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdlao.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3d9a1552827db8445b383ff98e1de14a8861fee7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdlao.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdlisub.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdlisub.kmx new file mode 100644 index 0000000000000000000000000000000000000000..584fe2cdabd727c9c137f9b45434011b2163e5f3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdlisub.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdlisus.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdlisus.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4fc843fb72f70905942e858fe29f6e77195533ff Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdlisus.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdlt.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdlt.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fc3d74e8e24fa4a5e975682bcf64ce4cb900df57 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdlt.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdlt1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdlt1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0d4a108b46a5751a9b1269a23d9a11347748fde8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdlt1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdlt2.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdlt2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c250d4afbf9ac64f17fc450d75efdfb0ea60ba98 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdlt2.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdlv.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdlv.kmx new file mode 100644 index 0000000000000000000000000000000000000000..417a7f5a7cb92840619f3f9ed6cddfefddbd11f9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdlv.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdlv1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdlv1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9b599d3f0ff7b0ea13545d693e0f26cbdef605bf Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdlv1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdlvst.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdlvst.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a1f6d165d3f7b6e3df01c0111d1436d01edc9420 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdlvst.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdmac.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdmac.kmx new file mode 100644 index 0000000000000000000000000000000000000000..031d3308d35d4e61a5419a619b15730a0fb18c8f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdmac.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdmacst.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdmacst.kmx new file mode 100644 index 0000000000000000000000000000000000000000..300b2b4bfc3f43b6d0a9d82bb6368fca8ff1f95a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdmacst.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdmaori.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdmaori.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b4a23b82c60f332eb3efe6795f168dc46a01b58a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdmaori.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdmlt47.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdmlt47.kmx new file mode 100644 index 0000000000000000000000000000000000000000..16a9866e00416290c169d234eeec44895ad51624 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdmlt47.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdmlt48.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdmlt48.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8168c69548710ac5b694e74e978dfa0775b64c9b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdmlt48.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdmon.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdmon.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7e5e01839e9b29408703e3451b43c1de7a4fbc05 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdmon.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdmonmo.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdmonmo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0eb2da7dfca5662ecff6f0c169ff19f3ec4743ba Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdmonmo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdmonst.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdmonst.kmx new file mode 100644 index 0000000000000000000000000000000000000000..92e3394b6b8974f7510a715df0738b4a1b14a00c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdmonst.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdmyan.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdmyan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0b9e74cd8831e382bcf5b7d40dc66f3a3f4cd1a1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdmyan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdne.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdne.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bf71710dbf0890345b13d11f817bd6d2e9117f28 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdne.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdnepr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdnepr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6d828eb350aa115af814062fcf6a9ca7338c19f5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdnepr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdnko.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdnko.kmx new file mode 100644 index 0000000000000000000000000000000000000000..099947ed552dbe68cbb1bd7cfbe7a2b8a6be0da6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdnko.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdno.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdno.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ed63bae4f81ab4de9fab4adc89685872d9c8b0be Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdno.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdno1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdno1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6daa96d5429b64409433d26ae8c344dfd616e1c0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdno1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdnso.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdnso.kmx new file mode 100644 index 0000000000000000000000000000000000000000..342556e10dc02ea8dd5782e81ae188ebe7413e4f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdnso.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdntl.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdntl.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e090efd2e6a0c36911d3881f7ba4f8bb74111944 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdntl.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdogham.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdogham.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b92652758f2e37d19a07e92e9ef0d0b977f92959 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdogham.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdolch.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdolch.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3b2c0e1f950d80a0d7c8ce2fa4dd545ca97f3a08 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdolch.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdoldit.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdoldit.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d4d21fc9bbe685ac90920097e268b1b640f34ab6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdoldit.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdosa.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdosa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..49e2f06fce1239ee3e6c351c556272bd9f6fc6ee Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdosa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdosm.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdosm.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ef355a0eed9b1d94b80b15fcfb71257800fdf13d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdosm.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdpash.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdpash.kmx new file mode 100644 index 0000000000000000000000000000000000000000..56461e805022edc750dba2e14c9b0c925923228b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdpash.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdphags.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdphags.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f76a7c010eb510cef972538b70dbfc1c33136db9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdphags.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdpl.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdpl.kmx new file mode 100644 index 0000000000000000000000000000000000000000..28ebf385cf22e82be75922eb15d3c3dca7961c9d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdpl.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdpl1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdpl1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5034a1f819e48a5aa5b78006f8d6d285db9afadf Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdpl1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdpo.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdpo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dbb01e139190c6f7cee5eee943a34ec0ad68ed2f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdpo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdropr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdropr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b5697f6ce5c102e31a79ed35d0fc3619ef322263 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdropr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdrost.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdrost.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8da352fb796608ac33269c83dfae9ac4dadb9b68 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdrost.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdru.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdru.kmx new file mode 100644 index 0000000000000000000000000000000000000000..39963e29cddb310a21b6ab7916325d279fc835f5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdru.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdru1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdru1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3dd977a73b36515a68276eb35471af8f78d92d93 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdru1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdrum.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdrum.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d32a78212f04ae3aac89b4f80aaeb1d8cf158647 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdrum.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsf.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsf.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e990000b160bb4f64f0dd078926479e6c076d326 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsf.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsg.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsg.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8e48bbca743a6bdd2a2608038825613c51ec4b38 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsg.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsl.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsl.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c744b176573babaf6c706539744bd21d3eb53d63 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsl.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsl1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsl1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8b7e53848ae945398ff9dd97f6ad9ae2dbb8cd6b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsl1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsmsfi.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsmsfi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d7156aeeb198f168f744e8b1c00165ca700e1c17 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsmsfi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsmsno.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsmsno.kmx new file mode 100644 index 0000000000000000000000000000000000000000..43b8227761ba7c3f20127044fa2b49501fdaa256 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsmsno.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsn1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsn1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ac06d938dd7d1da6b2037746db3cf61b6500fbbb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsn1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsora.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsora.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5780bffad658c15edda6ea7ae90f71ddf485b72a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsora.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsorex.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsorex.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8ee12d5340b087a2e6d62111842fb3dd9570d706 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsorex.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsors1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsors1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4ffb2ac210062eafa30ae45cc8c27d0c1ef3ae9d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsors1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsp.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsp.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ddfb512ac08f0560a56cbe1508ffc9ad6505fc8c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsp.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsw.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsw.kmx new file mode 100644 index 0000000000000000000000000000000000000000..79ad8b9191bef369ccdf195eae0ef069a2198d09 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsw.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsw09.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsw09.kmx new file mode 100644 index 0000000000000000000000000000000000000000..10a92aa9fdde8e1e0c0c5567a96153f2b36e6f09 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsw09.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsyr1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsyr1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..03faa96bdef87d7bc8cbb0d9c561d8607dd92cd8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsyr1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdsyr2.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdsyr2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0bb6cd7737c48c838f7196a894e56539bf8ac964 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdsyr2.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdtaile.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdtaile.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f6965e49f32217b1423ec0993b7f4ba02aa788f6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdtaile.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdtajik.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdtajik.kmx new file mode 100644 index 0000000000000000000000000000000000000000..34fa144e1ddab8a1c862b66913ab94bd6a660281 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdtajik.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdtam99.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdtam99.kmx new file mode 100644 index 0000000000000000000000000000000000000000..10581a036093ce46c7027b6d240f45e9670350f8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdtam99.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdth0.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdth0.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4111fffc0322fa88d432ee3a53cae74774bfa98a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdth0.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdth1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdth1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..25ebec813b0cacaf855fd1920e180402a1bf6ddb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdth1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdth2.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdth2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..50e9501d624f1572be0fe8826170ff7ad7110948 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdth2.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdth3.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdth3.kmx new file mode 100644 index 0000000000000000000000000000000000000000..388a30f355f7d6da912aa05256ceabe19644c969 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdth3.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdtifi.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdtifi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ea957fb340f6cb49b7296d2b52e5d120c28c33ab Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdtifi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdtifi2.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdtifi2.kmx new file mode 100644 index 0000000000000000000000000000000000000000..62538f2a1aa7980c2c8ad068e7f41c2bf7b7ee28 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdtifi2.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdtiprd.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdtiprd.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3fdba0e5908435a8d8ade2cd7a0bc4106d3de931 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdtiprd.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdtt102.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdtt102.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6140e900a41bea07ee2ed062198e825269bf142a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdtt102.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdtuf.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdtuf.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3b377481f5f410767f22302ab1e24863dd5ed641 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdtuf.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdtuq.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdtuq.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cbd7edec80661f676770c5dac7dd892e2f794f82 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdtuq.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdturme.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdturme.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e90d4804e68592fcacaf40ef6b3a377e7d830fc4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdturme.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdtzm.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdtzm.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6fa483fdd123026f0f7237a092a855f7e4825538 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdtzm.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdughr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdughr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b2cd49ec3672c0b728130660b184f30bb6eab10e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdughr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdughr1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdughr1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c15af76e8fb1a8373cc268cdda5a760718509397 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdughr1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbduk.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbduk.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4422e72bd3dfc2046830bd27368d1018f585aa45 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbduk.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdukx.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdukx.kmx new file mode 100644 index 0000000000000000000000000000000000000000..aa6a5df2dde595120b48ea7f7a20a371766770db Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdukx.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdur.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdur.kmx new file mode 100644 index 0000000000000000000000000000000000000000..79a262c7d68f7d80eee1e4c452cad29bed3e716f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdur.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdur1.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdur1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0f1831265812eccc7f88f5b3497a906f9b468146 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdur1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdurdu.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdurdu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..96270285970706cf8b5bff60e6a595849fb20dbc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdurdu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdus.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdus.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ddf9eb6bec5629bf9d8c86432c0d843bd71232b1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdus.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdusa.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdusa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..77b0662814678f80e75dbcb0ffe6eac0777a9798 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdusa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdusl.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdusl.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1866a0da59cc221891ac223007fd10011c11a321 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdusl.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdusr.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdusr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f03ab9148716777d1c96511b062193cf9a3cf5ea Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdusr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdusx.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdusx.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4f1639ebf3de2cd0f267e4c0a66ecd56f671e23e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdusx.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbduzb.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbduzb.kmx new file mode 100644 index 0000000000000000000000000000000000000000..26270dcfb3843ac380c4261bb9f32229703023f9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbduzb.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdvntc.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdvntc.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cf3c5f2bddecf79fc21e35afd1199e83bbcb81d4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdvntc.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdwol.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdwol.kmx new file mode 100644 index 0000000000000000000000000000000000000000..616dd09565d5dc2df0f71ca42a6b17293f35c3cf Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdwol.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdyak.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdyak.kmx new file mode 100644 index 0000000000000000000000000000000000000000..32f30e18ba265e7a5a87b65769d7e02c59b0bf41 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdyak.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdyba.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdyba.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a30ea443abe55c1a6608ef97c34af0eb5c2081eb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdyba.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdycc.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdycc.kmx new file mode 100644 index 0000000000000000000000000000000000000000..38cdb5844bf0f70719b291bcbc79a8814e9685c8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdycc.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/basic_kbdycl.kmx b/developer/src/kmcmplib/tests/fixtures/basic_kbdycl.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b6a0c27592e3cea916ceba55467637e3cd1e2724 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/basic_kbdycl.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/batak.kmx b/developer/src/kmcmplib/tests/fixtures/batak.kmx new file mode 100644 index 0000000000000000000000000000000000000000..953244d282a6b529d84f055d9c0393afaac7a6c7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/batak.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/baybayin.kmx b/developer/src/kmcmplib/tests/fixtures/baybayin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a98eb66f7f741c35c3d684e0a415283506295070 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/baybayin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bhaiksuki_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/bhaiksuki_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..59dbfdf7b677eb64c15479c5b3d09dee4d31ed8b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bhaiksuki_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_cree_east.kmx b/developer/src/kmcmplib/tests/fixtures/bj_cree_east.kmx new file mode 100644 index 0000000000000000000000000000000000000000..db3ae952840d7387e35ba3dcfe32c16b7b05e149 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_cree_east.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_cree_east_james_bay.kmx b/developer/src/kmcmplib/tests/fixtures/bj_cree_east_james_bay.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c4ffe3262f314b79b78ad5b9d3bd0421b1c3e058 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_cree_east_james_bay.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_cree_east_latn.kmx b/developer/src/kmcmplib/tests/fixtures/bj_cree_east_latn.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f8a7734542e5ea6e5c1b6287309f35644ac683e4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_cree_east_latn.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_cree_west_latn.kmx b/developer/src/kmcmplib/tests/fixtures/bj_cree_west_latn.kmx new file mode 100644 index 0000000000000000000000000000000000000000..da25ab5de88e916913f552e2119b2c3d61c95dac Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_cree_west_latn.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_cree_woods.kmx b/developer/src/kmcmplib/tests/fixtures/bj_cree_woods.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a4da2173b7c1a740d9eb3d6333912f82cf087016 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_cree_woods.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_innu.kmx b/developer/src/kmcmplib/tests/fixtures/bj_innu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3071a9c18dc8628363d4b5883bd182908b1684d0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_innu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_innu_phonemic.kmx b/developer/src/kmcmplib/tests/fixtures/bj_innu_phonemic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fef5055f9921b55df24acb81cdf8494067814539 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_innu_phonemic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_mista_wasaha_cree.kmx b/developer/src/kmcmplib/tests/fixtures/bj_mista_wasaha_cree.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bc297ffb33ba8ad9f798dcc995525ee51e486b46 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_mista_wasaha_cree.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_naskapi_classic.kmx b/developer/src/kmcmplib/tests/fixtures/bj_naskapi_classic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3308462a43cfc2829fe65b659e944c9cb4cf8319 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_naskapi_classic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_naskapi_common.kmx b/developer/src/kmcmplib/tests/fixtures/bj_naskapi_common.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c7e3cba86992dbf8bf693db89bf26ae614611033 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_naskapi_common.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bj_oji_cree.kmx b/developer/src/kmcmplib/tests/fixtures/bj_oji_cree.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d81548c7cbce5833c925d91cc552924d857cf993 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bj_oji_cree.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/brahmi_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/brahmi_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c2a6a0210e97ad9f02bad1ac184379b96b133e63 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/brahmi_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/btl_kenya.kmx b/developer/src/kmcmplib/tests/fixtures/btl_kenya.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ce701d60552742aa52fbf0d91b86b4dcf1474085 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/btl_kenya.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/bu_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/bu_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bf5f8b54a221a6431ae78976d1711c22ac6bc42c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/bu_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/buhid.kmx b/developer/src/kmcmplib/tests/fixtures/buhid.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b379b84bb7cc0fd195e01e400fbb7a4535b64d53 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/buhid.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/burushaski_girminas.kmx b/developer/src/kmcmplib/tests/fixtures/burushaski_girminas.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e472e1e658a5cd6cde16d0bfd61f63f886423aca Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/burushaski_girminas.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/cabecar.kmx b/developer/src/kmcmplib/tests/fixtures/cabecar.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3122d53320713b7c74d33d4bb6938c8e6f520e3f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/cabecar.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/carian.kmx b/developer/src/kmcmplib/tests/fixtures/carian.kmx new file mode 100644 index 0000000000000000000000000000000000000000..28788cf0904f9fb4938e678fe4840d49ad5db040 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/carian.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/chalchiteko.kmx b/developer/src/kmcmplib/tests/fixtures/chalchiteko.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d8a7799b3b7851e202e03bd4cbdadb1d1e802971 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/chalchiteko.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/chechen_latin.kmx b/developer/src/kmcmplib/tests/fixtures/chechen_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..619a3b42ca28f22a4cf48b4e9582522920cc8142 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/chechen_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/chinuk_wawa.kmx b/developer/src/kmcmplib/tests/fixtures/chinuk_wawa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e902d3fda7795477097133c31be865e930415784 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/chinuk_wawa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/choctaw_modern.kmx b/developer/src/kmcmplib/tests/fixtures/choctaw_modern.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b995728e16734a9ec38ae36fc0457e14f88d2803 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/choctaw_modern.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/cim.kmx b/developer/src/kmcmplib/tests/fixtures/cim.kmx new file mode 100644 index 0000000000000000000000000000000000000000..25096b14a305e53fd44604a1ff9dc5e926fa4544 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/cim.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/clavbur9.kmx b/developer/src/kmcmplib/tests/fixtures/clavbur9.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3a7c6594a389ecf55e376752ca7367a3e8638bb9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/clavbur9.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/colchis_latin.kmx b/developer/src/kmcmplib/tests/fixtures/colchis_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ab7f85d3d7b2aa1b7edb3b668772f0725ae5b8ee Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/colchis_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/colchis_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/colchis_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6eadc7175738b4cfd4ce2bfbe614233c5e5dab68 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/colchis_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/common_devanagari.kmx b/developer/src/kmcmplib/tests/fixtures/common_devanagari.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ec1329475e129d8d65d917b840408b2c357f53f5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/common_devanagari.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/coptic_greek.kmx b/developer/src/kmcmplib/tests/fixtures/coptic_greek.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e380cea9530c6f1a56354f0cb33cf049071ace65 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/coptic_greek.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/coptic_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/coptic_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b65388efb15306edab1f536d33f0031c34186214 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/coptic_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/dagbani.kmx b/developer/src/kmcmplib/tests/fixtures/dagbani.kmx new file mode 100644 index 0000000000000000000000000000000000000000..31cfe3998102576fbdb4840cac412db8235d0fd3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/dagbani.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/dega.kmx b/developer/src/kmcmplib/tests/fixtures/dega.kmx new file mode 100644 index 0000000000000000000000000000000000000000..31e3373f7620d3422bf9860149e72ba7cf8d16d1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/dega.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/dene.kmx b/developer/src/kmcmplib/tests/fixtures/dene.kmx new file mode 100644 index 0000000000000000000000000000000000000000..835bbf1a6386deded575d414686f0244b16cf06c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/dene.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/deseret.kmx b/developer/src/kmcmplib/tests/fixtures/deseret.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a9f264657267b916487d671128b587793dad4e2e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/deseret.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/dogra_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/dogra_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bae47782435070bd0d7827be7732eaf648818b81 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/dogra_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/easy_chakma.kmx b/developer/src/kmcmplib/tests/fixtures/easy_chakma.kmx new file mode 100644 index 0000000000000000000000000000000000000000..df87cec7e7cadcc1278dd21a81994a93b0c8203a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/easy_chakma.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/ekwtamil99uni.kmx b/developer/src/kmcmplib/tests/fixtures/ekwtamil99uni.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5b2bf899f9faca2030272add94c56cdab52c57dc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/ekwtamil99uni.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/el_dinka.kmx b/developer/src/kmcmplib/tests/fixtures/el_dinka.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5d0983836de38f86344012fe99c0eb835bed5adc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/el_dinka.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/el_harari_latin.kmx b/developer/src/kmcmplib/tests/fixtures/el_harari_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1dd0c497b2bb3fb655ba3ea944188574be8ff49a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/el_harari_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/el_naija.kmx b/developer/src/kmcmplib/tests/fixtures/el_naija.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9a5456e2140d1e3afec1d348cbfdce888af479c5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/el_naija.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/el_nuer.kmx b/developer/src/kmcmplib/tests/fixtures/el_nuer.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1b418368fb99612d4ddc01c304b9785cf2e4b3e5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/el_nuer.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/el_pasifika.kmx b/developer/src/kmcmplib/tests/fixtures/el_pasifika.kmx new file mode 100644 index 0000000000000000000000000000000000000000..08a6cc250ea90368353cbccfb0a63e07dc3d6efa Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/el_pasifika.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/el_yolngu.kmx b/developer/src/kmcmplib/tests/fixtures/el_yolngu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0233d5c10f5117bef330618cb72f743a2db59dbe Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/el_yolngu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/embera_north.kmx b/developer/src/kmcmplib/tests/fixtures/embera_north.kmx new file mode 100644 index 0000000000000000000000000000000000000000..601a25116c877a9f3ab6c1ea0ff7086bc8511d5f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/embera_north.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/enga.kmx b/developer/src/kmcmplib/tests/fixtures/enga.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9543f557b9d4230dc4f53be848695885adacd21c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/enga.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/enggano.kmx b/developer/src/kmcmplib/tests/fixtures/enggano.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4e8ddd14db1a8bc550ce6474daa8fb5ea65c6760 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/enggano.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/english_shavian_igc.kmx b/developer/src/kmcmplib/tests/fixtures/english_shavian_igc.kmx new file mode 100644 index 0000000000000000000000000000000000000000..628d7479471acba2abec59f96b2b03062bca1ddb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/english_shavian_igc.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/english_shavian_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/english_shavian_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..92ac37c693a1eb690136d15b6c128925b9bfb65f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/english_shavian_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/engram.kmx b/developer/src/kmcmplib/tests/fixtures/engram.kmx new file mode 100644 index 0000000000000000000000000000000000000000..83f5d167f1d264bffe4d245317cd1b7c3b152471 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/engram.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/esperuni.kmx b/developer/src/kmcmplib/tests/fixtures/esperuni.kmx new file mode 100644 index 0000000000000000000000000000000000000000..093a94a107b73e0746e84e5b9b64d5befc7c2b0e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/esperuni.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/farsiman.kmx b/developer/src/kmcmplib/tests/fixtures/farsiman.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f5ac429891f5d2897a63b5a7b5ad53aa29d1ede3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/farsiman.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/finongan.kmx b/developer/src/kmcmplib/tests/fixtures/finongan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..122cd34d4562d9223a9afcde898107cfc45bb98c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/finongan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fulfulde_ajami_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/fulfulde_ajami_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9bf05cacc81564e5415893275616b25e7db8cac1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fulfulde_ajami_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fulfulde_latin_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/fulfulde_latin_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9df1ae0728213a99f413b6db1ad7cb40ba9eaebe Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fulfulde_latin_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_dakelh.kmx b/developer/src/kmcmplib/tests/fixtures/fv_dakelh.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1ab7508254240f730c718a4b75b0d0039e97d962 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_dakelh.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_dane_zaa_zaage.kmx b/developer/src/kmcmplib/tests/fixtures/fv_dane_zaa_zaage.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4f5f5c2343cb1b1c443cf504843cfc3b83a239b6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_dane_zaa_zaage.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_denesuline_epsilon.kmx b/developer/src/kmcmplib/tests/fixtures/fv_denesuline_epsilon.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a55a6f0e731ac910277eaba75290e8d587fbb59b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_denesuline_epsilon.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_diitiidatx.kmx b/developer/src/kmcmplib/tests/fixtures/fv_diitiidatx.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dfae3c8f99da1aa4cbb92dbf3462021980c21aba Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_diitiidatx.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_gitsenimx.kmx b/developer/src/kmcmplib/tests/fixtures/fv_gitsenimx.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3cf3b42f11f4f0e53005bbb04642ee58263c08b7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_gitsenimx.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_gwichin.kmx b/developer/src/kmcmplib/tests/fixtures/fv_gwichin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f99115394adcf306c53205ac9d88df600c052ea9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_gwichin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_hailzaqvla.kmx b/developer/src/kmcmplib/tests/fixtures/fv_hailzaqvla.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d39dde6a48a5b0f717a563f5620ceb8f182b8eca Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_hailzaqvla.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_haisla.kmx b/developer/src/kmcmplib/tests/fixtures/fv_haisla.kmx new file mode 100644 index 0000000000000000000000000000000000000000..90b43453b2cef92d876a25a0fd1e1817daf6ee4b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_haisla.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_halqemeylem.kmx b/developer/src/kmcmplib/tests/fixtures/fv_halqemeylem.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0572a5f9fcc56c53b1ae448d44154398fda637de Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_halqemeylem.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_han.kmx b/developer/src/kmcmplib/tests/fixtures/fv_han.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0de6f7d9226fa9aed0834bc0184c133dd0f10b2c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_han.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_henqeminem.kmx b/developer/src/kmcmplib/tests/fixtures/fv_henqeminem.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e2d4968e537c176bde029e7b45e258fec88664e3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_henqeminem.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_hlgaagilda_xaayda_kil.kmx b/developer/src/kmcmplib/tests/fixtures/fv_hlgaagilda_xaayda_kil.kmx new file mode 100644 index 0000000000000000000000000000000000000000..127e612a29259d059a634e5e661f50cb963640b5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_hlgaagilda_xaayda_kil.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_kanienkeha_e.kmx b/developer/src/kmcmplib/tests/fixtures/fv_kanienkeha_e.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cfaf38533b9a0a836c41dbd8b82d83fb406d0b67 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_kanienkeha_e.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_ktunaxa.kmx b/developer/src/kmcmplib/tests/fixtures/fv_ktunaxa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e893954de83c15c3dde7d48ceea393269965ea11 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_ktunaxa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_kwakwala.kmx b/developer/src/kmcmplib/tests/fixtures/fv_kwakwala.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d4f0f395b42eb0db6c468c4832150233e9bf9398 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_kwakwala.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_kwakwala_liqwala.kmx b/developer/src/kmcmplib/tests/fixtures/fv_kwakwala_liqwala.kmx new file mode 100644 index 0000000000000000000000000000000000000000..13444e38f321b0e7e67e217ae33e8ba83b0fa4ba Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_kwakwala_liqwala.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_migmaq.kmx b/developer/src/kmcmplib/tests/fixtures/fv_migmaq.kmx new file mode 100644 index 0000000000000000000000000000000000000000..05cab8441f0bd949a229b2f24a709b4aeab746c7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_migmaq.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_natwits.kmx b/developer/src/kmcmplib/tests/fixtures/fv_natwits.kmx new file mode 100644 index 0000000000000000000000000000000000000000..55f1f49e2b3cc67cecb8e6cbbcaebf36d5576536 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_natwits.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_nisgaa.kmx b/developer/src/kmcmplib/tests/fixtures/fv_nisgaa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4e020950bca6db5389ffa79827d784f0bfadf453 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_nisgaa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_nlekepmxcin.kmx b/developer/src/kmcmplib/tests/fixtures/fv_nlekepmxcin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c99549d94ffc9c23474c064807f6ec86057c23a2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_nlekepmxcin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_northern_tutchone.kmx b/developer/src/kmcmplib/tests/fixtures/fv_northern_tutchone.kmx new file mode 100644 index 0000000000000000000000000000000000000000..27e05e8115182ef449af96a11721d4fdcb40c5f2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_northern_tutchone.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_nsilxcen.kmx b/developer/src/kmcmplib/tests/fixtures/fv_nsilxcen.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1732ce5c3731594d1b5d2b4877d11343b35123e1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_nsilxcen.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_nuucaanul.kmx b/developer/src/kmcmplib/tests/fixtures/fv_nuucaanul.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0fa9e4ca53c46d2ee5b8e5c187d19c308ccf854a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_nuucaanul.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_secwepemctsin.kmx b/developer/src/kmcmplib/tests/fixtures/fv_secwepemctsin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c87c548e0a777de94549ec64329cbf7c18df399e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_secwepemctsin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_sencoten.kmx b/developer/src/kmcmplib/tests/fixtures/fv_sencoten.kmx new file mode 100644 index 0000000000000000000000000000000000000000..049ac7008585a3303179eac180659df286591ba0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_sencoten.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_shashishalhem.kmx b/developer/src/kmcmplib/tests/fixtures/fv_shashishalhem.kmx new file mode 100644 index 0000000000000000000000000000000000000000..200d72f3a349322ce43d6a251c50257234c7c634 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_shashishalhem.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_smalgyax.kmx b/developer/src/kmcmplib/tests/fixtures/fv_smalgyax.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cdc7b6b3be8e99ac3636a901d6763a00199528a2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_smalgyax.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_southern_tutchone.kmx b/developer/src/kmcmplib/tests/fixtures/fv_southern_tutchone.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d500f6ea9d568d3192d62125af138a3dc0ddcd67 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_southern_tutchone.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_statimcets.kmx b/developer/src/kmcmplib/tests/fixtures/fv_statimcets.kmx new file mode 100644 index 0000000000000000000000000000000000000000..012755488ab0cd35c25a664ff5798fa799cffa1d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_statimcets.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_stlatlimxec.kmx b/developer/src/kmcmplib/tests/fixtures/fv_stlatlimxec.kmx new file mode 100644 index 0000000000000000000000000000000000000000..01b8ba7bdb9e84e39d4576f13d59f3184e94d175 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_stlatlimxec.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_tagizi_dene.kmx b/developer/src/kmcmplib/tests/fixtures/fv_tagizi_dene.kmx new file mode 100644 index 0000000000000000000000000000000000000000..838054ba56178428342ee8504d724f9c0126d6bb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_tagizi_dene.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_taltan.kmx b/developer/src/kmcmplib/tests/fixtures/fv_taltan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5d7f52ce64e6329ead9cef9387cae765c6b380b4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_taltan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_tlingit.kmx b/developer/src/kmcmplib/tests/fixtures/fv_tlingit.kmx new file mode 100644 index 0000000000000000000000000000000000000000..80f13d6898224217be7d37b385db2e095ccd7f19 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_tlingit.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_tsekehne.kmx b/developer/src/kmcmplib/tests/fixtures/fv_tsekehne.kmx new file mode 100644 index 0000000000000000000000000000000000000000..277d17c7e3c2e30c25273021c3bc0656e80158f2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_tsekehne.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_tsilhqotin.kmx b/developer/src/kmcmplib/tests/fixtures/fv_tsilhqotin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..346221385782533a2c685470ffd34f39e317c435 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_tsilhqotin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_uwikala.kmx b/developer/src/kmcmplib/tests/fixtures/fv_uwikala.kmx new file mode 100644 index 0000000000000000000000000000000000000000..129819a755e08fe4285c2af889f74849724a06fc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_uwikala.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/fv_xaislakala.kmx b/developer/src/kmcmplib/tests/fixtures/fv_xaislakala.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5a98769f3bc6230d6643bd0d5dc90bceafd7394b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/fv_xaislakala.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/galaxie_greek_mnemonic.kmx b/developer/src/kmcmplib/tests/fixtures/galaxie_greek_mnemonic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..111e206752c64c8c542ab949580a76974be3be53 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/galaxie_greek_mnemonic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/galaxie_greek_positional.kmx b/developer/src/kmcmplib/tests/fixtures/galaxie_greek_positional.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dbdcfc4e41b4d7971a8abc24fc1542407f6f7aff Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/galaxie_greek_positional.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/galaxie_hebrew_mnemonic.kmx b/developer/src/kmcmplib/tests/fixtures/galaxie_hebrew_mnemonic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1773d43a20ce7aafd29af816897f3adadccece85 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/galaxie_hebrew_mnemonic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/galaxie_hebrew_positional.kmx b/developer/src/kmcmplib/tests/fixtures/galaxie_hebrew_positional.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ca089a872773c2ef123f6521394010db71754063 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/galaxie_hebrew_positional.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gandhari.kmx b/developer/src/kmcmplib/tests/fixtures/gandhari.kmx new file mode 100644 index 0000000000000000000000000000000000000000..880b46b6ed31e0ee448b2fe9315cca412feea015 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gandhari.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/geezbrhan.kmx b/developer/src/kmcmplib/tests/fixtures/geezbrhan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..57d4f37e9359609f8fa01db63a223661a30ff404 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/geezbrhan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gff_amh_7.kmx b/developer/src/kmcmplib/tests/fixtures/gff_amh_7.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e265cc988d7904e2d9a6777c36b1fcd98eeffd81 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gff_amh_7.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gff_amharic.kmx b/developer/src/kmcmplib/tests/fixtures/gff_amharic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ba94ba13cc3d415af322360496db419baf861570 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gff_amharic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gff_blin.kmx b/developer/src/kmcmplib/tests/fixtures/gff_blin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5c69d20dfc445dd73de9a63cbdd9877007f7cb77 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gff_blin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gff_ethiopic_7.kmx b/developer/src/kmcmplib/tests/fixtures/gff_ethiopic_7.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6dbb905de67c2428b1d13c112c953462ada8b3e5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gff_ethiopic_7.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gff_geez.kmx b/developer/src/kmcmplib/tests/fixtures/gff_geez.kmx new file mode 100644 index 0000000000000000000000000000000000000000..08cd45f84ca618d648850971fbaf712a26618c34 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gff_geez.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gff_gurage.kmx b/developer/src/kmcmplib/tests/fixtures/gff_gurage.kmx new file mode 100644 index 0000000000000000000000000000000000000000..eb108c5d528031b73c848bcabe8ffbd73e35f6f7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gff_gurage.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gff_gurage_legacy.kmx b/developer/src/kmcmplib/tests/fixtures/gff_gurage_legacy.kmx new file mode 100644 index 0000000000000000000000000000000000000000..35456108f22df91d110264281d9d1b9d58aae34d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gff_gurage_legacy.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gff_musnad.kmx b/developer/src/kmcmplib/tests/fixtures/gff_musnad.kmx new file mode 100644 index 0000000000000000000000000000000000000000..be00b433cd84ecd44e1dcec2b0c7f285652f5e87 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gff_musnad.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gff_tigrinya_eritrea.kmx b/developer/src/kmcmplib/tests/fixtures/gff_tigrinya_eritrea.kmx new file mode 100644 index 0000000000000000000000000000000000000000..32e7202e58bff33c41c8f105a57b50ae613994e9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gff_tigrinya_eritrea.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gff_tigrinya_ethiopia.kmx b/developer/src/kmcmplib/tests/fixtures/gff_tigrinya_ethiopia.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e2aab809091d3a481e0972ae70f15bc67f7c8b51 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gff_tigrinya_ethiopia.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/ghana.kmx b/developer/src/kmcmplib/tests/fixtures/ghana.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5ef98ec4d8a2cb2303b506de4c98723e88ab8cd0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/ghana.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gilaki.kmx b/developer/src/kmcmplib/tests/fixtures/gilaki.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6e73cdb3007642b99f4d32edb0eddfcfd1dc9032 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gilaki.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gilaki_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/gilaki_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b6d7c24ae246cb89e146f4126601f60b84305253 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gilaki_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gondi_dev.kmx b/developer/src/kmcmplib/tests/fixtures/gondi_dev.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a11e9dbc652818d10d31a69e7390ef5f32ba3e4e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gondi_dev.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gondi_gunjala.kmx b/developer/src/kmcmplib/tests/fixtures/gondi_gunjala.kmx new file mode 100644 index 0000000000000000000000000000000000000000..40635fdec156f72101dc15b0f153154f8467c6ff Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gondi_gunjala.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/gondi_tel.kmx b/developer/src/kmcmplib/tests/fixtures/gondi_tel.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f53e419795040f7ccd55d1f92d65f9869ed0e0f9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/gondi_tel.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/greekclassical.kmx b/developer/src/kmcmplib/tests/fixtures/greekclassical.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b52d6446635a8519646b522ea71806d3f40adf17 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/greekclassical.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/hanunoo.kmx b/developer/src/kmcmplib/tests/fixtures/hanunoo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e27248f01e2fcfe720efcde8e778508f044eb0fe Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/hanunoo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/haroi.kmx b/developer/src/kmcmplib/tests/fixtures/haroi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ab97cbb1b95937c779dac0be6ed0885849d7eff3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/haroi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/hatran_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/hatran_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a9c7206c16ba3ea953d6c9693fe259e9653ed94c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/hatran_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/hausa_ajami_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/hausa_ajami_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3893c37d1245a19623d58474a1776a1d044f95b2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/hausa_ajami_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/hausa_kano.kmx b/developer/src/kmcmplib/tests/fixtures/hausa_kano.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8b670fa110fa8c59703bf693a3354ee2d8e0b789 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/hausa_kano.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/hcesar.kmx b/developer/src/kmcmplib/tests/fixtures/hcesar.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bd2ac004d673e80d7c6f675b40316bd264c02b20 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/hcesar.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/hieroglyphic.kmx b/developer/src/kmcmplib/tests/fixtures/hieroglyphic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..20e616e0e0c73f4d06299ff03f28bc97110d414d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/hieroglyphic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/himyarit_musnad.kmx b/developer/src/kmcmplib/tests/fixtures/himyarit_musnad.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8d6dd77e25fa8250c4010f55f3022e591cd17bf2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/himyarit_musnad.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/hindi_modular.kmx b/developer/src/kmcmplib/tests/fixtures/hindi_modular.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ff755dabe0a6975f4385c0ab926dab23d90b7f29 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/hindi_modular.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/indigenous_nt.kmx b/developer/src/kmcmplib/tests/fixtures/indigenous_nt.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d5c20049c17e30fe7b04a4a42a8f5b65584e87b3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/indigenous_nt.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/indonesia.kmx b/developer/src/kmcmplib/tests/fixtures/indonesia.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4141cd42785a7820c5726feafd8fc7a7338d627c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/indonesia.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/indonesian_suku.kmx b/developer/src/kmcmplib/tests/fixtures/indonesian_suku.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c7c77ad062f0b0bff7546e177585408449135a1a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/indonesian_suku.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/inuktitut_naqittaut.kmx b/developer/src/kmcmplib/tests/fixtures/inuktitut_naqittaut.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6cd4ba4462739e4b699f8baabdf360574653d27f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/inuktitut_naqittaut.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/ishkashimi_cyrillic.kmx b/developer/src/kmcmplib/tests/fixtures/ishkashimi_cyrillic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..512a576c4a39f0a295ad3d3bb1380cdcadf513fd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/ishkashimi_cyrillic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/itrans_bengali.kmx b/developer/src/kmcmplib/tests/fixtures/itrans_bengali.kmx new file mode 100644 index 0000000000000000000000000000000000000000..49103e231a450590c650734b9307208c1c4020b7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/itrans_bengali.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/itrans_devanagari_hindi.kmx b/developer/src/kmcmplib/tests/fixtures/itrans_devanagari_hindi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..69a3bed26648b58ce109c15bb496d470807ca383 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/itrans_devanagari_hindi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/itrans_devanagari_sanskrit_vedic.kmx b/developer/src/kmcmplib/tests/fixtures/itrans_devanagari_sanskrit_vedic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..06adc62f382f179e372a4196c3084770ccbe1933 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/itrans_devanagari_sanskrit_vedic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/itrans_gujarati.kmx b/developer/src/kmcmplib/tests/fixtures/itrans_gujarati.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d46598d8d257e5ae384b0f8e8f182ef4f394fff1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/itrans_gujarati.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/itrans_gurmukhi.kmx b/developer/src/kmcmplib/tests/fixtures/itrans_gurmukhi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c56a17b39c0c50d271acfe95ee76d39be392b2e9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/itrans_gurmukhi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/itrans_odia.kmx b/developer/src/kmcmplib/tests/fixtures/itrans_odia.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7cc9c171e1485322a6503a8d811cdae0d87daffa Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/itrans_odia.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/itrans_roman.kmx b/developer/src/kmcmplib/tests/fixtures/itrans_roman.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a019db3923b33f3ed246b61d0ae0ff7da93aeab0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/itrans_roman.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/jawa.kmx b/developer/src/kmcmplib/tests/fixtures/jawa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..709021f21c647106129009b114108bcbd928e303 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/jawa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/jorai.kmx b/developer/src/kmcmplib/tests/fixtures/jorai.kmx new file mode 100644 index 0000000000000000000000000000000000000000..519a4d2fab27ddd26222c317f3f5465a97291ad6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/jorai.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/karakalpak_cyrillic.kmx b/developer/src/kmcmplib/tests/fixtures/karakalpak_cyrillic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a6dc30f7d1bcccf133d83f48ffde542713763eec Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/karakalpak_cyrillic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/karakalpak_latin.kmx b/developer/src/kmcmplib/tests/fixtures/karakalpak_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..919e2ca18521f230ec17f12939094c9b6216052f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/karakalpak_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/kayan.kmx b/developer/src/kmcmplib/tests/fixtures/kayan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7aec141c66c6b5474696dad690cc7fd9a5325fa3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/kayan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/kbdsn1.kmx b/developer/src/kmcmplib/tests/fixtures/kbdsn1.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b580f1905d6c8c1ee3585a538eca9d0796335c23 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/kbdsn1.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/kharoshthi_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/kharoshthi_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a47fe866cdc0bbd1c674d771613b9ffa05c37d6e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/kharoshthi_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/khmer_advanced.kmx b/developer/src/kmcmplib/tests/fixtures/khmer_advanced.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cc95b2cca78b5d12eedb33ad5647f3aad7005eed Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/khmer_advanced.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/khmer_angkor.kmx b/developer/src/kmcmplib/tests/fixtures/khmer_angkor.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d8495d187c4ea369dfa0b608d8a630e196360f16 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/khmer_angkor.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/khojki_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/khojki_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3ace43836be93fce942070daffce2bd9f6017b67 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/khojki_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/kmhmu_2008.kmx b/developer/src/kmcmplib/tests/fixtures/kmhmu_2008.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e0b8576fa6ec6d9f360c3c96cbd8da5229a670cd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/kmhmu_2008.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/koalibrere.kmx b/developer/src/kmcmplib/tests/fixtures/koalibrere.kmx new file mode 100644 index 0000000000000000000000000000000000000000..abd7ba92100cdd3f02d3b6919b834a6b9bef3176 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/koalibrere.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/korean_rr.kmx b/developer/src/kmcmplib/tests/fixtures/korean_rr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..74057b8d43911cd0ae24229922ba290bcfd8ff9c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/korean_rr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/koreguaje.kmx b/developer/src/kmcmplib/tests/fixtures/koreguaje.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f99ac0c0a7b49efe549ff78694c15c1ed4d05b3d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/koreguaje.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/krung.kmx b/developer/src/kmcmplib/tests/fixtures/krung.kmx new file mode 100644 index 0000000000000000000000000000000000000000..596ed3f502c9365c712e83b8a30e5a7dae7aad0d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/krung.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/lahu.kmx b/developer/src/kmcmplib/tests/fixtures/lahu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8d7ecec5ec27346d913aaf6067a1efbf644decfc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/lahu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/lamkaang.kmx b/developer/src/kmcmplib/tests/fixtures/lamkaang.kmx new file mode 100644 index 0000000000000000000000000000000000000000..eeb73b13ae5a47337c7559305f3756762b40c3a7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/lamkaang.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/landuma.kmx b/developer/src/kmcmplib/tests/fixtures/landuma.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2a106877d39f3d78b7609d4ed729e945f5129f8b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/landuma.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/lao_2008_basic.kmx b/developer/src/kmcmplib/tests/fixtures/lao_2008_basic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f6a3cf52400b2a553875f4263771d9be9d724eba Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/lao_2008_basic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/lao_2008_rapid.kmx b/developer/src/kmcmplib/tests/fixtures/lao_2008_rapid.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7c19d841b50a447cea5207384f95f090fa3b2e03 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/lao_2008_rapid.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/lao_pali.kmx b/developer/src/kmcmplib/tests/fixtures/lao_pali.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f2579f0f2193969f2b03cd24a9d940cf36f15a38 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/lao_pali.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/lao_pali_us.kmx b/developer/src/kmcmplib/tests/fixtures/lao_pali_us.kmx new file mode 100644 index 0000000000000000000000000000000000000000..90023f2e74297898083cef88fa2f4da6d5c32b81 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/lao_pali_us.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/lao_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/lao_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9e7abb7f8263e8263e050e242df560292d04390d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/lao_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/lazuri.kmx b/developer/src/kmcmplib/tests/fixtures/lazuri.kmx new file mode 100644 index 0000000000000000000000000000000000000000..19c9dec7358fbfb2b220083ff2f9332a380e15c1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/lazuri.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/libtralo.kmx b/developer/src/kmcmplib/tests/fixtures/libtralo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..df52a88479248b8a1304baaefa32438da74e60be Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/libtralo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/makasar_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/makasar_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b630f2a8995bf6c73173eb975bea356831555cca Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/makasar_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/malar_braille.kmx b/developer/src/kmcmplib/tests/fixtures/malar_braille.kmx new file mode 100644 index 0000000000000000000000000000000000000000..069ed73292d4953c57955c6b1bd5d1a06ac61949 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/malar_braille.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/malar_malayalam.kmx b/developer/src/kmcmplib/tests/fixtures/malar_malayalam.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b34931675b40ce95aff0e5edb7ad25f9e96384b2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/malar_malayalam.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/malar_malayalam_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/malar_malayalam_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..06984b9a682c11d4ef192705e431ef1f29e63ec0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/malar_malayalam_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/malar_tirhuta.kmx b/developer/src/kmcmplib/tests/fixtures/malar_tirhuta.kmx new file mode 100644 index 0000000000000000000000000000000000000000..de13a1a8c3ce27e10ff0f66e85973f15ad2b3173 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/malar_tirhuta.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/maltese.kmx b/developer/src/kmcmplib/tests/fixtures/maltese.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8d083c4015315bf6a363b0a851119307a78096d4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/maltese.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/mandaic_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/mandaic_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0fd9217afb99d5601c03e222c650cb624786a12d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/mandaic_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/masaram_gondi.kmx b/developer/src/kmcmplib/tests/fixtures/masaram_gondi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ecf782860c0957caa0f60da23facd581c9bfc959 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/masaram_gondi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/me_en.kmx b/developer/src/kmcmplib/tests/fixtures/me_en.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d9770fb8bb07953099881be8adb2ce582ef4e73f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/me_en.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/meitei_legacy.kmx b/developer/src/kmcmplib/tests/fixtures/meitei_legacy.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fd43336cc69f8f891cc895b891ea76efd04ba223 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/meitei_legacy.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/miluk_hanis_siuslaw.kmx b/developer/src/kmcmplib/tests/fixtures/miluk_hanis_siuslaw.kmx new file mode 100644 index 0000000000000000000000000000000000000000..42057fdfb8ff0ef4d1e9c172c4078f29a8c2b555 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/miluk_hanis_siuslaw.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/modi_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/modi_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..caf54dfe1ca0bcb2cb92235cfe15a379fe3152f5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/modi_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/mon_anonta.kmx b/developer/src/kmcmplib/tests/fixtures/mon_anonta.kmx new file mode 100644 index 0000000000000000000000000000000000000000..95edf95455a0aec0915daf6343ccaa530e7d7a48 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/mon_anonta.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/mon_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/mon_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1f8e5504d0bfb007698ae0a0df65a0e1f94e5f1a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/mon_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/mongolian_cyrillic_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/mongolian_cyrillic_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e20fee204f1f5dcf11b9cb82ba8431abdedd477c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/mongolian_cyrillic_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/mozhi_malayalam.kmx b/developer/src/kmcmplib/tests/fixtures/mozhi_malayalam.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1c0137b88ca13c9bf05997b2075c1c77ba9fe8f7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/mozhi_malayalam.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/mro_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/mro_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0c24868d1e00e08d85c61aff1a55baf284616008 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/mro_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/multani_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/multani_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..db5c54f6aa989d07a587ea53a78060b3ea0a4aff Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/multani_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/multi_pak_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/multi_pak_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0f3ebfe1c996f42da41c7a0d3af9dca54c9e7234 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/multi_pak_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/munji.kmx b/developer/src/kmcmplib/tests/fixtures/munji.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bfc51c4c8681c0822b2b94250bbcb089fe41b664 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/munji.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/myancode_san.kmx b/developer/src/kmcmplib/tests/fixtures/myancode_san.kmx new file mode 100644 index 0000000000000000000000000000000000000000..95987ef8fabe2ce1ef3a4a0c4ca8c919ef7ac927 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/myancode_san.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nabataean_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/nabataean_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f8e708fff9f7101b1698a20ee90f8f6cca16ecbe Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nabataean_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/naijatype.kmx b/developer/src/kmcmplib/tests/fixtures/naijatype.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d2345dfda7744bbecc4bad7e26d882cac87e24d4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/naijatype.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nailangs.kmx b/developer/src/kmcmplib/tests/fixtures/nailangs.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8dd07c6a088b2ba9d39ea782d652e13110def88f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nailangs.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nasa_yuwe.kmx b/developer/src/kmcmplib/tests/fixtures/nasa_yuwe.kmx new file mode 100644 index 0000000000000000000000000000000000000000..de011fdf954e454dfb6ccedc71b41031e06a20d7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nasa_yuwe.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nepali_traditional.kmx b/developer/src/kmcmplib/tests/fixtures/nepali_traditional.kmx new file mode 100644 index 0000000000000000000000000000000000000000..206a4ac6d0ccf700a5ba430958c5a4fb81d69886 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nepali_traditional.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/newa_romanized.kmx b/developer/src/kmcmplib/tests/fixtures/newa_romanized.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1b2282ae0c74050428f565f69f09e3e6a61f48fc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/newa_romanized.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/newa_traditional.kmx b/developer/src/kmcmplib/tests/fixtures/newa_traditional.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9d1bdce86df35776f040b019c3178dd6876745ed Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/newa_traditional.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nias.kmx b/developer/src/kmcmplib/tests/fixtures/nias.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d7079a039c34a89a9990cad605d6ae348bce943b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nias.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nisenan.kmx b/developer/src/kmcmplib/tests/fixtures/nisenan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a102ebd4b1c2c163d0c5358a5004c62ae42d08b9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nisenan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nko.kmx b/developer/src/kmcmplib/tests/fixtures/nko.kmx new file mode 100644 index 0000000000000000000000000000000000000000..69705f32b7467a77a723debace1709547f591d54 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nko.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nkonya.kmx b/developer/src/kmcmplib/tests/fixtures/nkonya.kmx new file mode 100644 index 0000000000000000000000000000000000000000..62812dab2755de7321afcf0520dfb83a80a66b8b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nkonya.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nlci_bengali_winscript.kmx b/developer/src/kmcmplib/tests/fixtures/nlci_bengali_winscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a99f0a6d1bf637acf6c702df81ed248de1d47226 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nlci_bengali_winscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nlci_devanagari_winscript.kmx b/developer/src/kmcmplib/tests/fixtures/nlci_devanagari_winscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..894ae528cf41c25bc6c0c220103f5f222d4fbf18 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nlci_devanagari_winscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nlci_gujarati_winscript.kmx b/developer/src/kmcmplib/tests/fixtures/nlci_gujarati_winscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..171939f8f03724a59ff01a55acd117d5529c7245 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nlci_gujarati_winscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nlci_gurmukhi_winscript.kmx b/developer/src/kmcmplib/tests/fixtures/nlci_gurmukhi_winscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..cf966d1f791fa916c0b14c1f515eb9de2ad7c0cd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nlci_gurmukhi_winscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nlci_ipa.kmx b/developer/src/kmcmplib/tests/fixtures/nlci_ipa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f7b1bb493e187ef9cc881ceb599c589271891546 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nlci_ipa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nlci_kannada_winscript.kmx b/developer/src/kmcmplib/tests/fixtures/nlci_kannada_winscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3a96d7f934a88587c04b8d3d2b2669f58f1ea011 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nlci_kannada_winscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nlci_malayalam_winscript.kmx b/developer/src/kmcmplib/tests/fixtures/nlci_malayalam_winscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0035303ca43f40f4b0eb8962806cb8a85962cb52 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nlci_malayalam_winscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nlci_oriya_winscript.kmx b/developer/src/kmcmplib/tests/fixtures/nlci_oriya_winscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e3496b0640e231eba8e5083a7324db05f1cfc25a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nlci_oriya_winscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nlci_tamil_winscript.kmx b/developer/src/kmcmplib/tests/fixtures/nlci_tamil_winscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a9d22bfdedd4ee03ba45f46c788442620f7ce4ef Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nlci_tamil_winscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nlci_telugu_winscript.kmx b/developer/src/kmcmplib/tests/fixtures/nlci_telugu_winscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..176ce86e7859a924433be3eab0be33374796277f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nlci_telugu_winscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nrc_makah.kmx b/developer/src/kmcmplib/tests/fixtures/nrc_makah.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4c5dcebbd9c3c1a03f91a7d3096e764b8c9ca068 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nrc_makah.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/ntl_onekey.kmx b/developer/src/kmcmplib/tests/fixtures/ntl_onekey.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e39ae5d918a14b7ba987914169d836c6ce22e583 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/ntl_onekey.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/numanggang.kmx b/developer/src/kmcmplib/tests/fixtures/numanggang.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6064a1e7d944437e01bad463d4cd43fd63a99603 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/numanggang.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/nw_iranian_latin.kmx b/developer/src/kmcmplib/tests/fixtures/nw_iranian_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2d2b49f6839c14b0bfdd87bacd466127a47fc82e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/nw_iranian_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/o_tissi.kmx b/developer/src/kmcmplib/tests/fixtures/o_tissi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..58515ef2390e23035659b871adad1882083a481f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/o_tissi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/obolo_chwerty.kmx b/developer/src/kmcmplib/tests/fixtures/obolo_chwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..873f70b33be411657ac5c5f1632c89ffdf647f3b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/obolo_chwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/obolo_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/obolo_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7ef2dcdadbbc9162dc995a26d8db37afa18e593c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/obolo_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/old_hungarian.kmx b/developer/src/kmcmplib/tests/fixtures/old_hungarian.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ccb6ca06a48600872e28196197b76e07466f4aac Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/old_hungarian.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/old_turkic_udw21_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/old_turkic_udw21_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3be7e17688a650e0ecfcbf5de9b4d91ce114dea2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/old_turkic_udw21_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/orma.kmx b/developer/src/kmcmplib/tests/fixtures/orma.kmx new file mode 100644 index 0000000000000000000000000000000000000000..63fb4e8cc043dc9951cf743c92d2b5816a723230 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/orma.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/osage_nation.kmx b/developer/src/kmcmplib/tests/fixtures/osage_nation.kmx new file mode 100644 index 0000000000000000000000000000000000000000..69333f2e45922f0225750d6d4b12fcef9311d8b2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/osage_nation.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/osage_nation_new.kmx b/developer/src/kmcmplib/tests/fixtures/osage_nation_new.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ead429bb10378b05c455543aeaf82d3ee4cad888 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/osage_nation_new.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/otoe_missouria.kmx b/developer/src/kmcmplib/tests/fixtures/otoe_missouria.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3722c24dbf0f8b699ee2beffc5e5a9ef7af44e3e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/otoe_missouria.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/persian_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/persian_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..89620cddcddbdc1c6626574c298cba247e9f82c2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/persian_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/pid_piaroa.kmx b/developer/src/kmcmplib/tests/fixtures/pid_piaroa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4e8529646c4059e23a58ec2b655b6a01db1a277e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/pid_piaroa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/pingelap.kmx b/developer/src/kmcmplib/tests/fixtures/pingelap.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a54eab2accc03082a23dd50f30d25b19b03c5676 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/pingelap.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/postmodern_english_uk_dualstroke.kmx b/developer/src/kmcmplib/tests/fixtures/postmodern_english_uk_dualstroke.kmx new file mode 100644 index 0000000000000000000000000000000000000000..48859e2af0c9830218fc5d0c2fcf64aee376fdbd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/postmodern_english_uk_dualstroke.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/postmodern_english_uk_natural.kmx b/developer/src/kmcmplib/tests/fixtures/postmodern_english_uk_natural.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e8db651d3174033dc2ef8e57393227f998a9c736 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/postmodern_english_uk_natural.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/postmodern_english_us_dualstroke.kmx b/developer/src/kmcmplib/tests/fixtures/postmodern_english_us_dualstroke.kmx new file mode 100644 index 0000000000000000000000000000000000000000..322b9fec3b6995d690acedb7fb5cc629c6caf29c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/postmodern_english_us_dualstroke.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/postmodern_english_us_natural.kmx b/developer/src/kmcmplib/tests/fixtures/postmodern_english_us_natural.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8b96e384e099b2ef15ece8a19e705e5e2764e29e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/postmodern_english_us_natural.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/pukapuka.kmx b/developer/src/kmcmplib/tests/fixtures/pukapuka.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8c892107a46f3ce8a9876c01c4e96836c25eb8e3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/pukapuka.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/qom.kmx b/developer/src/kmcmplib/tests/fixtures/qom.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ca6f9fb41dcb37627e78d4ea94abb0a6ecac5b23 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/qom.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/quinault.kmx b/developer/src/kmcmplib/tests/fixtures/quinault.kmx new file mode 100644 index 0000000000000000000000000000000000000000..82f88cf24107c5e8573af4f269d3d9443b009da4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/quinault.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/qwerty_farang.kmx b/developer/src/kmcmplib/tests/fixtures/qwerty_farang.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8f27dd42d24beb7ee1900132fc0b91ec63feab14 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/qwerty_farang.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_aer.kmx b/developer/src/kmcmplib/tests/fixtures/rac_aer.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f32daed2596b947a13f4befee425ae21df69b17a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_aer.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_arabic.kmx b/developer/src/kmcmplib/tests/fixtures/rac_arabic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ba7ffbaa404f8e4ed72b8b254d74b1d3b74e6635 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_arabic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_balti.kmx b/developer/src/kmcmplib/tests/fixtures/rac_balti.kmx new file mode 100644 index 0000000000000000000000000000000000000000..942b98e8933ddf32b4be02fa3333404964c25a2c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_balti.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_brahui.kmx b/developer/src/kmcmplib/tests/fixtures/rac_brahui.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6a0fd1cafad6ab24a55f91479d85bd64dd0c3e48 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_brahui.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_brahui_latin.kmx b/developer/src/kmcmplib/tests/fixtures/rac_brahui_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6e63256900d63d84ec5dcbc5e03303ddda4c890d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_brahui_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_burushaski.kmx b/developer/src/kmcmplib/tests/fixtures/rac_burushaski.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3864031e7459aacb5380c5da8ed32174faed9cd4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_burushaski.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_dameli.kmx b/developer/src/kmcmplib/tests/fixtures/rac_dameli.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8eb9c3359d32ef39dff1a202046c27d7e68af230 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_dameli.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_dhatki.kmx b/developer/src/kmcmplib/tests/fixtures/rac_dhatki.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3e4abc594ae9f922a01ef0544465f7a3acd7cf96 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_dhatki.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_dogri.kmx b/developer/src/kmcmplib/tests/fixtures/rac_dogri.kmx new file mode 100644 index 0000000000000000000000000000000000000000..77345ca8a07b8f8424a733ce6e156f2fb9493855 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_dogri.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_gawar_bati.kmx b/developer/src/kmcmplib/tests/fixtures/rac_gawar_bati.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dba08659fbe937d34dd7a145c43c9b4047ad73ea Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_gawar_bati.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_gawri.kmx b/developer/src/kmcmplib/tests/fixtures/rac_gawri.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3ae6573be7cb9668b3876478b014a7c5dcac257c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_gawri.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_hazaragi.kmx b/developer/src/kmcmplib/tests/fixtures/rac_hazaragi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d24481e11719943d04f30c14897cde8bb05507a6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_hazaragi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_hindko.kmx b/developer/src/kmcmplib/tests/fixtures/rac_hindko.kmx new file mode 100644 index 0000000000000000000000000000000000000000..99453a79c50a2de81c6c48744e169efcdfccbd24 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_hindko.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_indus_kohistani.kmx b/developer/src/kmcmplib/tests/fixtures/rac_indus_kohistani.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7966cfda014a4840b835cb101ecc2e912ba1496e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_indus_kohistani.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_kalasha.kmx b/developer/src/kmcmplib/tests/fixtures/rac_kalasha.kmx new file mode 100644 index 0000000000000000000000000000000000000000..de56a3d6a8937f3e8fa7dadd7451bb669837c424 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_kalasha.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_kashmir_shina.kmx b/developer/src/kmcmplib/tests/fixtures/rac_kashmir_shina.kmx new file mode 100644 index 0000000000000000000000000000000000000000..075f85bf48fba5505452d63400c32747e4a9a6f1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_kashmir_shina.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_kashmiri.kmx b/developer/src/kmcmplib/tests/fixtures/rac_kashmiri.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f2c5ee0545011cb7c2aedd06d603622312e8f0bb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_kashmiri.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_khowar.kmx b/developer/src/kmcmplib/tests/fixtures/rac_khowar.kmx new file mode 100644 index 0000000000000000000000000000000000000000..122edb343c7257dc723821f593b4b3d17770bb9f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_khowar.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_marwari.kmx b/developer/src/kmcmplib/tests/fixtures/rac_marwari.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6144b12ccca43999f81e736e3dbb09e526791e99 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_marwari.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_munji.kmx b/developer/src/kmcmplib/tests/fixtures/rac_munji.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3714489c5b487189eed311895b58f5f1593a644d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_munji.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_oadki.kmx b/developer/src/kmcmplib/tests/fixtures/rac_oadki.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7a94331ecbb48aea40899f04f1b310d6847d416d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_oadki.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_ormuri.kmx b/developer/src/kmcmplib/tests/fixtures/rac_ormuri.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fe4dda40f07fc4f51e84c5dc238c2e7f3a2d6406 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_ormuri.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_pahari.kmx b/developer/src/kmcmplib/tests/fixtures/rac_pahari.kmx new file mode 100644 index 0000000000000000000000000000000000000000..64d842679af8197ebd744f1c0d4a9daede057faa Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_pahari.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_palula.kmx b/developer/src/kmcmplib/tests/fixtures/rac_palula.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d6a28b1843121f26034e52c18bb00c2127fa4775 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_palula.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_parkari_koli.kmx b/developer/src/kmcmplib/tests/fixtures/rac_parkari_koli.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3dd6be1d5cc3fe681029f232ef363ffbc3423945 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_parkari_koli.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_pashai.kmx b/developer/src/kmcmplib/tests/fixtures/rac_pashai.kmx new file mode 100644 index 0000000000000000000000000000000000000000..965feaf6bd1c74be79fcda793e9a70daf8da68e4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_pashai.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_pashto.kmx b/developer/src/kmcmplib/tests/fixtures/rac_pashto.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3d5bb2970f4932f1fc776781e2a554fd3b10663d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_pashto.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_saraiki.kmx b/developer/src/kmcmplib/tests/fixtures/rac_saraiki.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1cc25371ed06f48cbd4a4e64f089677ae71e68c3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_saraiki.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_shina.kmx b/developer/src/kmcmplib/tests/fixtures/rac_shina.kmx new file mode 100644 index 0000000000000000000000000000000000000000..818c4bb9e0790dfc7c3c3784360e1573412050b8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_shina.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_sindhi.kmx b/developer/src/kmcmplib/tests/fixtures/rac_sindhi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7cf18e2146d7a7e052ea746a1858a934537d1a67 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_sindhi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_torwali.kmx b/developer/src/kmcmplib/tests/fixtures/rac_torwali.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b9917e064b494f068bea8fb9e634f1fff9012705 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_torwali.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_urdu.kmx b/developer/src/kmcmplib/tests/fixtures/rac_urdu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c46a0af0e0a8262283704740e1cb9e58ead021cd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_urdu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_ushojo.kmx b/developer/src/kmcmplib/tests/fixtures/rac_ushojo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e518f79d002eaa045b00de034ea588722d78b66a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_ushojo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_uyghur.kmx b/developer/src/kmcmplib/tests/fixtures/rac_uyghur.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3bf55f93935f044d02c498e46bf1e93a309e152e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_uyghur.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_wadiyara.kmx b/developer/src/kmcmplib/tests/fixtures/rac_wadiyara.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8b1dcc69bfb24509e5a4ef9343483eecf87c9279 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_wadiyara.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_wakhi.kmx b/developer/src/kmcmplib/tests/fixtures/rac_wakhi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c3acae747f60de7830c118b2869455f5d96ec654 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_wakhi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_western_punjabi.kmx b/developer/src/kmcmplib/tests/fixtures/rac_western_punjabi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..eac2a21ec01380eacd24c68a99a23fdb718be4e7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_western_punjabi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rac_yidgha.kmx b/developer/src/kmcmplib/tests/fixtures/rac_yidgha.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5d777ce16c22245b1adfbac9398a7d5a5bf5e792 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rac_yidgha.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rawang.kmx b/developer/src/kmcmplib/tests/fixtures/rawang.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5ef43d22be467fcae7f86acfb85e2bfca0b4c192 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rawang.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rejang.kmx b/developer/src/kmcmplib/tests/fixtures/rejang.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c04ff065e2c4fecaaf16bbac394a805adcd326c6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rejang.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/remington_gail.kmx b/developer/src/kmcmplib/tests/fixtures/remington_gail.kmx new file mode 100644 index 0000000000000000000000000000000000000000..16412933b6f09c949dc090c773037d03b64059a4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/remington_gail.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rohingya_arab.kmx b/developer/src/kmcmplib/tests/fixtures/rohingya_arab.kmx new file mode 100644 index 0000000000000000000000000000000000000000..07e61629b5e5a77cb9447deaaf46c32aa67a0387 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rohingya_arab.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/rossel.kmx b/developer/src/kmcmplib/tests/fixtures/rossel.kmx new file mode 100644 index 0000000000000000000000000000000000000000..98bca0b9464cd808441242cf418896c3f9d1b0c6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/rossel.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/runeboard.kmx b/developer/src/kmcmplib/tests/fixtures/runeboard.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d41acc4124a158b91a799a7b8986cd04c85cc942 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/runeboard.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/russian_mnemonic_r.kmx b/developer/src/kmcmplib/tests/fixtures/russian_mnemonic_r.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e9a99d02db29ac2a1e6b21511f1d406d14e64576 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/russian_mnemonic_r.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sabdalipi_assamese.kmx b/developer/src/kmcmplib/tests/fixtures/sabdalipi_assamese.kmx new file mode 100644 index 0000000000000000000000000000000000000000..1b7f80b8b13135fa8b4b90783404de82bfa6114c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sabdalipi_assamese.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sahaptin_umatilla.kmx b/developer/src/kmcmplib/tests/fixtures/sahaptin_umatilla.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bfac93d7e6e6bbc5fd45adaf44084fec2f87d5f4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sahaptin_umatilla.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sahaptin_yakima.kmx b/developer/src/kmcmplib/tests/fixtures/sahaptin_yakima.kmx new file mode 100644 index 0000000000000000000000000000000000000000..53d610e7e743131cb2b30f8d84ac62734334e045 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sahaptin_yakima.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sanjha_punjabi.kmx b/developer/src/kmcmplib/tests/fixtures/sanjha_punjabi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..739d01869397bfd75b556a5bb89e77eaef8c76fc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sanjha_punjabi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/santali_latin.kmx b/developer/src/kmcmplib/tests/fixtures/santali_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5a0756301cc95f11feb352d114b22d3191296c33 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/santali_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/saraiki.kmx b/developer/src/kmcmplib/tests/fixtures/saraiki.kmx new file mode 100644 index 0000000000000000000000000000000000000000..260e96f5ca778e5ffd784bf784c06fe3ea402e2c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/saraiki.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/satere.kmx b/developer/src/kmcmplib/tests/fixtures/satere.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e9af31938826265a6f8f3c9e70538ae4748d8ab0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/satere.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/shahmukhi_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/shahmukhi_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0d8cdb54f77be275dbe5e144b0b15ba9590aaa29 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/shahmukhi_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/shan.kmx b/developer/src/kmcmplib/tests/fixtures/shan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d84a72e3ee815867d64e6e10d2f021112be65bfb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/shan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/shaw_2layer.kmx b/developer/src/kmcmplib/tests/fixtures/shaw_2layer.kmx new file mode 100644 index 0000000000000000000000000000000000000000..87cd30ad34a3ef5fc400a62c8794ebde209e7690 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/shaw_2layer.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/siddham_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/siddham_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0f139602947659ba0cec79f6e37752ba845ecae0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/siddham_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_akha_act.kmx b/developer/src/kmcmplib/tests/fixtures/sil_akha_act.kmx new file mode 100644 index 0000000000000000000000000000000000000000..6a81a33d8b49cde3dbcd7601e54d93abe71b42bc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_akha_act.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_arabic_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/sil_arabic_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4caa43ac6410c7803a2dae8cb3b4284ed9e44a27 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_arabic_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_areare.kmx b/developer/src/kmcmplib/tests/fixtures/sil_areare.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8ffe02d000f21ba7ca0e7a7e5229169dddc73987 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_areare.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_bari.kmx b/developer/src/kmcmplib/tests/fixtures/sil_bari.kmx new file mode 100644 index 0000000000000000000000000000000000000000..639e50e028e82135e3a0992f2567ea7395e396b8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_bari.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_bengali_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/sil_bengali_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dae551bdbd1ccd955b3e366a6d92fe5912e51ea2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_bengali_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_bolivia.kmx b/developer/src/kmcmplib/tests/fixtures/sil_bolivia.kmx new file mode 100644 index 0000000000000000000000000000000000000000..75cf86a81df962956a5c746241cce26c90deca02 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_bolivia.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_boonkit.kmx b/developer/src/kmcmplib/tests/fixtures/sil_boonkit.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dfd184f1ab4c9d170cecd1039fab0aa051a265f8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_boonkit.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_brao.kmx b/developer/src/kmcmplib/tests/fixtures/sil_brao.kmx new file mode 100644 index 0000000000000000000000000000000000000000..80d140b65a28b8c2c2120e686a77b787444fbf42 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_brao.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_bru.kmx b/developer/src/kmcmplib/tests/fixtures/sil_bru.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0bb31ea045bec7b946d4bd4b7b8bc04819dccc2d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_bru.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_buang.kmx b/developer/src/kmcmplib/tests/fixtures/sil_buang.kmx new file mode 100644 index 0000000000000000000000000000000000000000..288f2fb7fb7e862229b9d1520d8cc63b0ba99297 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_buang.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_bunong.kmx b/developer/src/kmcmplib/tests/fixtures/sil_bunong.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7eeaf731e1c7bc8cad1018d956c556ed2474e1bb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_bunong.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_busa.kmx b/developer/src/kmcmplib/tests/fixtures/sil_busa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4e907fa2f25088163584b9f2c31901a0c93f681e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_busa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_bwe_karen.kmx b/developer/src/kmcmplib/tests/fixtures/sil_bwe_karen.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8fb25d32a672e15de8c31b2c1758f56e6dd90e99 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_bwe_karen.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_cameroon_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_cameroon_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..da7f23d2d02fccb73ec655da2b38f85359483f4b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_cameroon_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_cameroon_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_cameroon_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0e3bf67607d2cd58b666b905afd2cb432060b55a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_cameroon_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_cherokee_nation.kmx b/developer/src/kmcmplib/tests/fixtures/sil_cherokee_nation.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c568a85e0593e5a72914edd7fddbd97e990fb60b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_cherokee_nation.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_cheyenne.kmx b/developer/src/kmcmplib/tests/fixtures/sil_cheyenne.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0fef098219c522cfac894926df2e8280b82d02d3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_cheyenne.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_cipher_music.kmx b/developer/src/kmcmplib/tests/fixtures/sil_cipher_music.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f1eda8ec037084236280f625a52c9e565cfc6b38 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_cipher_music.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_devanagari_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/sil_devanagari_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f4a4a85f62eabb51c48da4eb39a5c6d76455ce3c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_devanagari_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_devanagari_romanized.kmx b/developer/src/kmcmplib/tests/fixtures/sil_devanagari_romanized.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dbb114e0c97a85c1c921f9b631b1445d519cf784 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_devanagari_romanized.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_devanagari_typewriter.kmx b/developer/src/kmcmplib/tests/fixtures/sil_devanagari_typewriter.kmx new file mode 100644 index 0000000000000000000000000000000000000000..38dbb8008575750b2f51afc7bbaf7eca4a8afee2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_devanagari_typewriter.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_dzongkha.kmx b/developer/src/kmcmplib/tests/fixtures/sil_dzongkha.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d0a824cec8b97802b572a3cdabb58fb36eaaeae0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_dzongkha.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_eastern_congo.kmx b/developer/src/kmcmplib/tests/fixtures/sil_eastern_congo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7d604831fbeef3c34e6aa02dc4d63c33a349109c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_eastern_congo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_el_ethiopian_latin.kmx b/developer/src/kmcmplib/tests/fixtures/sil_el_ethiopian_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..67834cb25c3f1ff716064e804de91f78615a9f0a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_el_ethiopian_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_ethiopic.kmx b/developer/src/kmcmplib/tests/fixtures/sil_ethiopic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3433f5c103b686d4fb258fc56b499f9cc8340fb6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_ethiopic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_ethiopic_power_g.kmx b/developer/src/kmcmplib/tests/fixtures/sil_ethiopic_power_g.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ce697e4e16984959b5c4c37eacfd502daf1c9a5a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_ethiopic_power_g.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_euro_latin.kmx b/developer/src/kmcmplib/tests/fixtures/sil_euro_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..60973192d778367acd633c7a9f2995a57bc64ffe Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_euro_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_extended_urdu_np.kmx b/developer/src/kmcmplib/tests/fixtures/sil_extended_urdu_np.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3dd06bd052011e7511d1b54f8a8e4e60f0f72c45 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_extended_urdu_np.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_greek_polytonic.kmx b/developer/src/kmcmplib/tests/fixtures/sil_greek_polytonic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..904fdeea2b7aeebcd084722787741445a1731ed0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_greek_polytonic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_hawaiian.kmx b/developer/src/kmcmplib/tests/fixtures/sil_hawaiian.kmx new file mode 100644 index 0000000000000000000000000000000000000000..74b83ca88a69defbe7f6d94047a6073f53247fac Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_hawaiian.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_hebr_grek_trans.kmx b/developer/src/kmcmplib/tests/fixtures/sil_hebr_grek_trans.kmx new file mode 100644 index 0000000000000000000000000000000000000000..77128fbd01e4677e05ebfdf11d62a53aa6231e99 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_hebr_grek_trans.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_hebrew.kmx b/developer/src/kmcmplib/tests/fixtures/sil_hebrew.kmx new file mode 100644 index 0000000000000000000000000000000000000000..18163f9a14acaad09e9049233967f3b7a3cc1784 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_hebrew.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_hebrew_legacy.kmx b/developer/src/kmcmplib/tests/fixtures/sil_hebrew_legacy.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0a8646d8ec070edea412ff3a1cd5ed5410d9d8ad Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_hebrew_legacy.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_hmd_plrd.kmx b/developer/src/kmcmplib/tests/fixtures/sil_hmd_plrd.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b39614c21337458bb6df0bdd6d9be4eb20ee5804 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_hmd_plrd.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_indic_roman.kmx b/developer/src/kmcmplib/tests/fixtures/sil_indic_roman.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f41b2cc8b3c88c94721993ad8a486f11b087e4eb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_indic_roman.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_ipa.kmx b/developer/src/kmcmplib/tests/fixtures/sil_ipa.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8d4d9d97e019248a37ad9f39674439a4ef3bbd2c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_ipa.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_jarai.kmx b/developer/src/kmcmplib/tests/fixtures/sil_jarai.kmx new file mode 100644 index 0000000000000000000000000000000000000000..90cc3a418d7af01bf19060d94fc8e3c3c5983970 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_jarai.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_kayah_kali.kmx b/developer/src/kmcmplib/tests/fixtures/sil_kayah_kali.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a4214e1dfc88238c0607aad8adccc4da05b625f1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_kayah_kali.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_kayah_latn.kmx b/developer/src/kmcmplib/tests/fixtures/sil_kayah_latn.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5ab026b835f8a0de082f4b8b0059e993fd054560 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_kayah_latn.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_kayah_mymr.kmx b/developer/src/kmcmplib/tests/fixtures/sil_kayah_mymr.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e918e45b0cf87dbb66f838c70368ab6874fdc5bf Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_kayah_mymr.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_khamti.kmx b/developer/src/kmcmplib/tests/fixtures/sil_khamti.kmx new file mode 100644 index 0000000000000000000000000000000000000000..52ed2dc0e3343ad197758490f6b85362626ade95 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_khamti.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_khmer.kmx b/developer/src/kmcmplib/tests/fixtures/sil_khmer.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c53eb704f1b76c2c07ad391bb17287b212f494e9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_khmer.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_khowar.kmx b/developer/src/kmcmplib/tests/fixtures/sil_khowar.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8cd336d8e4359e029999c0dca4bab35f17c2d81f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_khowar.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_kmhmu.kmx b/developer/src/kmcmplib/tests/fixtures/sil_kmhmu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..630c36cb3db0d08c0792a4fdf714bfd27b0d2093 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_kmhmu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_korda_jamo.kmx b/developer/src/kmcmplib/tests/fixtures/sil_korda_jamo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c03f35d313c301379d34d05e2aed8c4ca8d03b61 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_korda_jamo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_korda_latin.kmx b/developer/src/kmcmplib/tests/fixtures/sil_korda_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e9f48e301300a9258e65296decc80fd1e5e9d90f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_korda_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_korean_morse.kmx b/developer/src/kmcmplib/tests/fixtures/sil_korean_morse.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e2adba2aca2f0d0cf33a488e0e3a683b9898abec Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_korean_morse.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_kvl_kayaw.kmx b/developer/src/kmcmplib/tests/fixtures/sil_kvl_kayaw.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4dedd718537edbf1bca1e0174af80f4cf59e63dc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_kvl_kayaw.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_lepcha.kmx b/developer/src/kmcmplib/tests/fixtures/sil_lepcha.kmx new file mode 100644 index 0000000000000000000000000000000000000000..663bf4580e7fef1b574ad1798343067e20536433 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_lepcha.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_limbu_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/sil_limbu_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..58ecb1a522654d1cad07881fd44b271bd7fd22ae Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_limbu_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_limbu_typewriter.kmx b/developer/src/kmcmplib/tests/fixtures/sil_limbu_typewriter.kmx new file mode 100644 index 0000000000000000000000000000000000000000..651bcbd28e83e827b04489db2b3788cc959c1a9d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_limbu_typewriter.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_lisu_basic.kmx b/developer/src/kmcmplib/tests/fixtures/sil_lisu_basic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d85fadca1cc584913b4f300f8a7beb8c136ec032 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_lisu_basic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_lisu_standard.kmx b/developer/src/kmcmplib/tests/fixtures/sil_lisu_standard.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4eee9a9104c5e8d3855739d7a41685d84eeaf77d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_lisu_standard.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_lpo_plrd.kmx b/developer/src/kmcmplib/tests/fixtures/sil_lpo_plrd.kmx new file mode 100644 index 0000000000000000000000000000000000000000..616799187aded941742991fea1afc1379275eff8 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_lpo_plrd.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_madi.kmx b/developer/src/kmcmplib/tests/fixtures/sil_madi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d92aff331b7fb8d5c10702e41289b5a01dba8d97 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_madi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_makuri.kmx b/developer/src/kmcmplib/tests/fixtures/sil_makuri.kmx new file mode 100644 index 0000000000000000000000000000000000000000..eec4b8b1b73f6ef0aeed01fd9c22b2b5ff317bf2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_makuri.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_mali_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_mali_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..84dd3f53d29dc2c5df805321780b5d44d9df9893 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_mali_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_mali_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_mali_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..29e170f6e6b856e48104699304d34a967ff19abd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_mali_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_mali_qwertz.kmx b/developer/src/kmcmplib/tests/fixtures/sil_mali_qwertz.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b5bd3413865538a189d8abf1b29d6a7d03578db6 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_mali_qwertz.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_moore.kmx b/developer/src/kmcmplib/tests/fixtures/sil_moore.kmx new file mode 100644 index 0000000000000000000000000000000000000000..72e3778d5e0fe59247192510bc40fd6d3b541099 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_moore.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_myanmar_my3.kmx b/developer/src/kmcmplib/tests/fixtures/sil_myanmar_my3.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ad1cb863a99d36774764967e7e033b82b6870fed Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_myanmar_my3.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_myanmar_mywinext.kmx b/developer/src/kmcmplib/tests/fixtures/sil_myanmar_mywinext.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d19b8ecdb53be4ca8f3f2d85385581a08eb9160f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_myanmar_mywinext.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_nigeria_dot.kmx b/developer/src/kmcmplib/tests/fixtures/sil_nigeria_dot.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d15171d8a1ee75b810d7423b9969e5797aa1320b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_nigeria_dot.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_nigeria_odd_vowels.kmx b/developer/src/kmcmplib/tests/fixtures/sil_nigeria_odd_vowels.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f6d6b9cb0970910d30d028e0fc5664915706ffcf Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_nigeria_odd_vowels.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_nigeria_underline.kmx b/developer/src/kmcmplib/tests/fixtures/sil_nigeria_underline.kmx new file mode 100644 index 0000000000000000000000000000000000000000..adb38082b23ea4709b27103651d7fd4d251c2b8a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_nigeria_underline.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_nko.kmx b/developer/src/kmcmplib/tests/fixtures/sil_nko.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5616c8bb5888394246ca02efcdc7325549fdb4cc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_nko.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_nubian.kmx b/developer/src/kmcmplib/tests/fixtures/sil_nubian.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bc178a0659b868841363a80ffe3ba73de23ff4c7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_nubian.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_pan_africa_mnemonic.kmx b/developer/src/kmcmplib/tests/fixtures/sil_pan_africa_mnemonic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..dd3551d2bad7fbaa2e8854eaa3991e7adeac1faf Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_pan_africa_mnemonic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_pan_africa_positional.kmx b/developer/src/kmcmplib/tests/fixtures/sil_pan_africa_positional.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ab7eb053d9d0ad9c65ccf1d2e15e4df3531847b9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_pan_africa_positional.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_philippines.kmx b/developer/src/kmcmplib/tests/fixtures/sil_philippines.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fd5db7d4f4721bc2cd656f64895f40504c7d929a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_philippines.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_sahu.kmx b/developer/src/kmcmplib/tests/fixtures/sil_sahu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e5548549a7b9ad70c5cb5f53fa0fd0b5d948a323 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_sahu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_senegal_bsc_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_senegal_bsc_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b7162c461ff023be25aa99f50d76413bb1d9ea4a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_senegal_bsc_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_senegal_cou_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_senegal_cou_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b74e2888f219f35d0571acc3f736ee382f6d49b1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_senegal_cou_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_senegal_dyo_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_senegal_dyo_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..91de009800efe678f5250f1ce4d6604f13f38692 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_senegal_dyo_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_senegal_gsl_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_senegal_gsl_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8db0110549ab5c6b21f9ac830358e6a2cfd529ed Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_senegal_gsl_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_senegal_krx_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_senegal_krx_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..74ec159fb0d228cb9b75b9558c0bd6e769e5d736 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_senegal_krx_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_senegal_ndv_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_senegal_ndv_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0afef1c629ba71650c6b0de5531ef920bdceb51f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_senegal_ndv_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_senegal_sav_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_senegal_sav_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..bfc3da4321e228bc89cb7b1c5844284f3811dd62 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_senegal_sav_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_senegal_snf_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_senegal_snf_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..69f9a2a06742bfb5ac21db819963368a49593af1 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_senegal_snf_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_senegal_srr_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_senegal_srr_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2d1eea7adee598daca7daafcc3e08b8da332f165 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_senegal_srr_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_senegal_wo_azerty.kmx b/developer/src/kmcmplib/tests/fixtures/sil_senegal_wo_azerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c041de1fce019dfa3e1a34fcc298eeb4fbca4d4a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_senegal_wo_azerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_sgaw_karen.kmx b/developer/src/kmcmplib/tests/fixtures/sil_sgaw_karen.kmx new file mode 100644 index 0000000000000000000000000000000000000000..96212bf1b295c9454719ae25228616ec3c3a1c78 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_sgaw_karen.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_shan.kmx b/developer/src/kmcmplib/tests/fixtures/sil_shan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..35a91760f2d4c44bbe95acc0ea48e939a51bd822 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_shan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_tai_dam.kmx b/developer/src/kmcmplib/tests/fixtures/sil_tai_dam.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fe7dd8513ce439d356aa6b1a3f5f73c5cfe3fa98 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_tai_dam.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_tai_dam_lao.kmx b/developer/src/kmcmplib/tests/fixtures/sil_tai_dam_lao.kmx new file mode 100644 index 0000000000000000000000000000000000000000..9e400619ea30b2ef659929f2b1f1bf0b8f38bc78 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_tai_dam_lao.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_tai_dam_latin.kmx b/developer/src/kmcmplib/tests/fixtures/sil_tai_dam_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e05aa9b5c1335fb2e249aa8dbc308fe7f942ae78 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_tai_dam_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_tai_dam_typewriter.kmx b/developer/src/kmcmplib/tests/fixtures/sil_tai_dam_typewriter.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7db476799ff3ad24c81f3308edb693b4079ca9e7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_tai_dam_typewriter.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_tawallammat.kmx b/developer/src/kmcmplib/tests/fixtures/sil_tawallammat.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f863586f92a5978b841387fbf58167a4c5412a4a Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_tawallammat.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_tchad.kmx b/developer/src/kmcmplib/tests/fixtures/sil_tchad.kmx new file mode 100644 index 0000000000000000000000000000000000000000..19802d37264e2025a174e9c101c6c90925316c9d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_tchad.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_tepehuan.kmx b/developer/src/kmcmplib/tests/fixtures/sil_tepehuan.kmx new file mode 100644 index 0000000000000000000000000000000000000000..2a591d64631b22b461893275f80379f07fe1f780 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_tepehuan.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_torwali.kmx b/developer/src/kmcmplib/tests/fixtures/sil_torwali.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c31bd27e433574ce77d26a400c586c3ee2766e1b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_torwali.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_tunisian.kmx b/developer/src/kmcmplib/tests/fixtures/sil_tunisian.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ff3d6abdf02cb3b9ac1ab38bcc35ed21bd18e5fc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_tunisian.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_uganda_tanzania.kmx b/developer/src/kmcmplib/tests/fixtures/sil_uganda_tanzania.kmx new file mode 100644 index 0000000000000000000000000000000000000000..852f028d5175d1d1fb12e7b19e99a70d45e402be Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_uganda_tanzania.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_vai.kmx b/developer/src/kmcmplib/tests/fixtures/sil_vai.kmx new file mode 100644 index 0000000000000000000000000000000000000000..eac0c3ff1e9343f9ce45660d5da547f8239e273d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_vai.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_wayuu.kmx b/developer/src/kmcmplib/tests/fixtures/sil_wayuu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a3a2499d0d369b245e1f9db525a431fc1e2c217d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_wayuu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_ygp_plrd.kmx b/developer/src/kmcmplib/tests/fixtures/sil_ygp_plrd.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ff801a19bb893cca42390a936bfe2f799a40c9ec Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_ygp_plrd.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_yi.kmx b/developer/src/kmcmplib/tests/fixtures/sil_yi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c4bb0ad3ea065c0bc3d6607647b67f8a5c9873a0 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_yi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_yna_plrd.kmx b/developer/src/kmcmplib/tests/fixtures/sil_yna_plrd.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e37835c6ed0d02bb7dcf573d99c5562b070d354b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_yna_plrd.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_yoruba8.kmx b/developer/src/kmcmplib/tests/fixtures/sil_yoruba8.kmx new file mode 100644 index 0000000000000000000000000000000000000000..eee1e94330afd297708c62067c1603ef0ea9fe6c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_yoruba8.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_yoruba_bar.kmx b/developer/src/kmcmplib/tests/fixtures/sil_yoruba_bar.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e3c2b997995379ddc7a8a996104139dea24cab08 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_yoruba_bar.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_yoruba_dot.kmx b/developer/src/kmcmplib/tests/fixtures/sil_yoruba_dot.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b9aadb35b9443407e1c3fed290496129ed568cbd Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_yoruba_dot.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_yupik_cyrillic.kmx b/developer/src/kmcmplib/tests/fixtures/sil_yupik_cyrillic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..e804035650d537fc0e3af7e625ba0608a0aee43f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_yupik_cyrillic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_yupik_cyrillic_ru.kmx b/developer/src/kmcmplib/tests/fixtures/sil_yupik_cyrillic_ru.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d404a12d71c09a73e0aca6ee6a0cbae28a2738e9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_yupik_cyrillic_ru.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sil_ywq_plrd.kmx b/developer/src/kmcmplib/tests/fixtures/sil_ywq_plrd.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a9d75854a331bb82c471a28c4fc773bcc9c8b117 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sil_ywq_plrd.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/slc_saliba.kmx b/developer/src/kmcmplib/tests/fixtures/slc_saliba.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b74127fa0cbdc6aa5b4faf04d444928a05f2f112 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/slc_saliba.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/soqotri_arabic.kmx b/developer/src/kmcmplib/tests/fixtures/soqotri_arabic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..25955c6bdb49528d398b369b39d6d9f74bebf750 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/soqotri_arabic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/srr_ajami_qwerty.kmx b/developer/src/kmcmplib/tests/fixtures/srr_ajami_qwerty.kmx new file mode 100644 index 0000000000000000000000000000000000000000..12b4230ab9650314389c92eb773b5dac06257482 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/srr_ajami_qwerty.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sundanese.kmx b/developer/src/kmcmplib/tests/fixtures/sundanese.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d1ed7f30bb2c79edf881d63a8ba66932fe5a7a26 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sundanese.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sundanese_latin.kmx b/developer/src/kmcmplib/tests/fixtures/sundanese_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0b4a82916acfdeaf07271a68d90c53f1266dd725 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sundanese_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/swanalekha_malayalam.kmx b/developer/src/kmcmplib/tests/fixtures/swanalekha_malayalam.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0becf6aa5cd34d1d24b8722093f30445c9d0379f Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/swanalekha_malayalam.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sxava.kmx b/developer/src/kmcmplib/tests/fixtures/sxava.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7a4d83475697630c6573ed49ab11507fca4ec088 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sxava.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sxava_eo.kmx b/developer/src/kmcmplib/tests/fixtures/sxava_eo.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3023034630e2a8a40bfa0d85116a56385b519819 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sxava_eo.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/sylheti_nagri.kmx b/developer/src/kmcmplib/tests/fixtures/sylheti_nagri.kmx new file mode 100644 index 0000000000000000000000000000000000000000..81b39c7d475ea1acea0b162fac839134631438e9 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/sylheti_nagri.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/syriac_arabic.kmx b/developer/src/kmcmplib/tests/fixtures/syriac_arabic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a35c4a6663a2cab045a3bf6aa3469752ef78a563 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/syriac_arabic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/syriac_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/syriac_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..057cadf299790ce7e8ea871683e8fdff8723a7a5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/syriac_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tagbanwa_inscript.kmx b/developer/src/kmcmplib/tests/fixtures/tagbanwa_inscript.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ad8f6e992f64cc4561042232a0478d55c01a4b12 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tagbanwa_inscript.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/taigi_poj.kmx b/developer/src/kmcmplib/tests/fixtures/taigi_poj.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f0266317fb413dddd8d485bffe9e5519befa8955 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/taigi_poj.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tainua.kmx b/developer/src/kmcmplib/tests/fixtures/tainua.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a7c5302597f8ed0effa0313ad0f15fb3b01f53bf Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tainua.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tangsa_lakhum.kmx b/developer/src/kmcmplib/tests/fixtures/tangsa_lakhum.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f92abaad901dec4ac4fee457acb06898a8e0dade Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tangsa_lakhum.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tawallammat_latin.kmx b/developer/src/kmcmplib/tests/fixtures/tawallammat_latin.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4ffcea47677876fd78de071d4505017419633ce4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tawallammat_latin.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/teggargrent_lat.kmx b/developer/src/kmcmplib/tests/fixtures/teggargrent_lat.kmx new file mode 100644 index 0000000000000000000000000000000000000000..30988061fb57ed33cf2cbe4242ecf3d4b32618fb Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/teggargrent_lat.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tem_kdh.kmx b/developer/src/kmcmplib/tests/fixtures/tem_kdh.kmx new file mode 100644 index 0000000000000000000000000000000000000000..78e7b891b8ef78cd46d1d55ac24d2efdd90f7418 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tem_kdh.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/thamizha_anjal_paangu.kmx b/developer/src/kmcmplib/tests/fixtures/thamizha_anjal_paangu.kmx new file mode 100644 index 0000000000000000000000000000000000000000..5cef67f7a97ea534b8eab41ea69a356e9d0f7b17 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/thamizha_anjal_paangu.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/thamizha_bamini.kmx b/developer/src/kmcmplib/tests/fixtures/thamizha_bamini.kmx new file mode 100644 index 0000000000000000000000000000000000000000..13b6655801102ad5e2854f1a7e4c64ab9747b545 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/thamizha_bamini.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/thamizha_new_typewriter.kmx b/developer/src/kmcmplib/tests/fixtures/thamizha_new_typewriter.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0213650e6a946c64a78bd0593a8c5e8b82524db2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/thamizha_new_typewriter.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/thamizha_tamil99_ext.kmx b/developer/src/kmcmplib/tests/fixtures/thamizha_tamil99_ext.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fc6a07a9c2fc770f5c4798a0f277948d474bfb65 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/thamizha_tamil99_ext.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tibetan_direct_input.kmx b/developer/src/kmcmplib/tests/fixtures/tibetan_direct_input.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d13c37c692582ed4b0dd07c4183fc1bf460f80c3 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tibetan_direct_input.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tibetan_ewts.kmx b/developer/src/kmcmplib/tests/fixtures/tibetan_ewts.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3db3c74b93494474af41b3d83692c676914fd476 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tibetan_ewts.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tirhuta.kmx b/developer/src/kmcmplib/tests/fixtures/tirhuta.kmx new file mode 100644 index 0000000000000000000000000000000000000000..722eacc10b64adff6f00cc309a90ddb5f366db74 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tirhuta.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tlahuica.kmx b/developer/src/kmcmplib/tests/fixtures/tlahuica.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c2a4aa4a8f301504e12633543d8bf86fbcecfc95 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tlahuica.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tsakonian.kmx b/developer/src/kmcmplib/tests/fixtures/tsakonian.kmx new file mode 100644 index 0000000000000000000000000000000000000000..d2530e34be4c0c6379bf18850502bb3c41ef3dc2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tsakonian.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/tuareg_tifinagh.kmx b/developer/src/kmcmplib/tests/fixtures/tuareg_tifinagh.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a007e67e5528ba90b1b410f5c0cc3ed4b7a02bb4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/tuareg_tifinagh.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/turkmen_cyrl.kmx b/developer/src/kmcmplib/tests/fixtures/turkmen_cyrl.kmx new file mode 100644 index 0000000000000000000000000000000000000000..805865a77f96af2bc7b0cfd8a38d5053ec205d47 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/turkmen_cyrl.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/txo_toto.kmx b/developer/src/kmcmplib/tests/fixtures/txo_toto.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f54ba9b1ef43379d7070c4a2682e37243d7f79ce Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/txo_toto.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/udi_keyboard.kmx b/developer/src/kmcmplib/tests/fixtures/udi_keyboard.kmx new file mode 100644 index 0000000000000000000000000000000000000000..0312e80010d26c82f8f129644b791240b94b88b2 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/udi_keyboard.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/ukwuani.kmx b/developer/src/kmcmplib/tests/fixtures/ukwuani.kmx new file mode 100644 index 0000000000000000000000000000000000000000..94f0349856314f787bf869d174893bdfe5ed4b3b Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/ukwuani.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/uma_graphic.kmx b/developer/src/kmcmplib/tests/fixtures/uma_graphic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..a19a27489e3a3e7ed4ab546468c6b77e9f9be5b7 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/uma_graphic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/uma_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/uma_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..74bcef0a5d0782eefcb75247519d14f7bfe02617 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/uma_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/urdu_phonetic.kmx b/developer/src/kmcmplib/tests/fixtures/urdu_phonetic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..34cf644632d4c5ae7a3c586c6e77da961da790ca Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/urdu_phonetic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/urdu_phonetic_crulp.kmx b/developer/src/kmcmplib/tests/fixtures/urdu_phonetic_crulp.kmx new file mode 100644 index 0000000000000000000000000000000000000000..ecdc3419be5f6a7f96e3ba60420346969226a88c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/urdu_phonetic_crulp.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/venetia_et_histria.kmx b/developer/src/kmcmplib/tests/fixtures/venetia_et_histria.kmx new file mode 100644 index 0000000000000000000000000000000000000000..277314fd88e903b77de07733d31cb38a7f51ff70 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/venetia_et_histria.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/vm_tamil_modular.kmx b/developer/src/kmcmplib/tests/fixtures/vm_tamil_modular.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3afbbac8ee54484304e11e98a45b36893ae9bee4 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/vm_tamil_modular.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/vm_tamil_typewriter.kmx b/developer/src/kmcmplib/tests/fixtures/vm_tamil_typewriter.kmx new file mode 100644 index 0000000000000000000000000000000000000000..c93a9b5f2bff06a4397274a95d3c8d7133fa2521 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/vm_tamil_typewriter.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/wakhi_anglicized.kmx b/developer/src/kmcmplib/tests/fixtures/wakhi_anglicized.kmx new file mode 100644 index 0000000000000000000000000000000000000000..8ff5d267c9074e8fa1ded4c9a5cd76b89dfae6bc Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/wakhi_anglicized.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/wakhi_cyrillic.kmx b/developer/src/kmcmplib/tests/fixtures/wakhi_cyrillic.kmx new file mode 100644 index 0000000000000000000000000000000000000000..fd86f63d25e71ad07f86c0c4315d55b912f80fba Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/wakhi_cyrillic.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/wakhi_standard.kmx b/developer/src/kmcmplib/tests/fixtures/wakhi_standard.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4ceb2540adc9e0d4110d38c0fa1c092255a5f58d Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/wakhi_standard.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/wancho.kmx b/developer/src/kmcmplib/tests/fixtures/wancho.kmx new file mode 100644 index 0000000000000000000000000000000000000000..68ab51c6e968cc753c8a76ee18bca6e0f9053b69 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/wancho.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/warang_citi.kmx b/developer/src/kmcmplib/tests/fixtures/warang_citi.kmx new file mode 100644 index 0000000000000000000000000000000000000000..f36f714a86f0348578896cad922c334c14a54ed5 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/warang_citi.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/wolofal.kmx b/developer/src/kmcmplib/tests/fixtures/wolofal.kmx new file mode 100644 index 0000000000000000000000000000000000000000..b3cc61d41341c86758dc1535b06b7c77109a783e Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/wolofal.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/xinaliq.kmx b/developer/src/kmcmplib/tests/fixtures/xinaliq.kmx new file mode 100644 index 0000000000000000000000000000000000000000..4eb748763bf078c80db3d2a5d4474a091ea8ca1c Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/xinaliq.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/yiddish_pasekh.kmx b/developer/src/kmcmplib/tests/fixtures/yiddish_pasekh.kmx new file mode 100644 index 0000000000000000000000000000000000000000..3836c816d5729a351009ea5ba0b52d945f536109 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/yiddish_pasekh.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/yidgha.kmx b/developer/src/kmcmplib/tests/fixtures/yidgha.kmx new file mode 100644 index 0000000000000000000000000000000000000000..7544013c02f4c8afe67e7f1cac04ebb08f875707 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/yidgha.kmx differ diff --git a/developer/src/kmcmplib/tests/fixtures/younger_futhark_short_twig.kmx b/developer/src/kmcmplib/tests/fixtures/younger_futhark_short_twig.kmx new file mode 100644 index 0000000000000000000000000000000000000000..81761ab9045c7dae54c3e03200f7a661b0609d81 Binary files /dev/null and b/developer/src/kmcmplib/tests/fixtures/younger_futhark_short_twig.kmx differ diff --git a/developer/src/kmcmplib/tests/get-test-source.sh b/developer/src/kmcmplib/tests/get-test-source.sh new file mode 100755 index 0000000000000000000000000000000000000000..13bea90e13219d0aaad84687a2794637df95c0d5 --- /dev/null +++ b/developer/src/kmcmplib/tests/get-test-source.sh @@ -0,0 +1,10 @@ +#!/usr/bin/env bash +# +# Finds all keyboards in the keyboards repo (passed in $1) that are valid source +# keyboards (i.e. ///source/.kmn) +# +# Called from meson.build, so this script does not use build-utils.sh. Do not run this +# script directly. +# +set -eu +find "$1" -name '*.kmn' | grep -E '(release|experimental)/([a-z0-9_]+)/([a-z0-9_]+)/source/\3\.kmn$' diff --git a/developer/src/kmcmplib/tests/keyboards_commit_ref.txt b/developer/src/kmcmplib/tests/keyboards_commit_ref.txt new file mode 100644 index 0000000000000000000000000000000000000000..c8db9ade548b72bf9940548e68a41866ff18e50f --- /dev/null +++ b/developer/src/kmcmplib/tests/keyboards_commit_ref.txt @@ -0,0 +1 @@ +965ef1941f20a3bc0cb5d405792b4984cc46cd52 diff --git a/developer/src/kmcmplib/tests/kmcompxtest.cpp b/developer/src/kmcmplib/tests/kmcompxtest.cpp new file mode 100644 index 0000000000000000000000000000000000000000..1ce542917d389df52ad136047d9b7ae09d15d9dd --- /dev/null +++ b/developer/src/kmcmplib/tests/kmcompxtest.cpp @@ -0,0 +1,233 @@ +/* + * Keyman is copyright (C) SIL International. MIT License. + * + * Tiny frame console app to compile a .kmx from a .kmn + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#ifdef _MSC_VER +#else +#include +#endif + +using namespace std; + +vector < int > error_vec; + +#define CERR_FATAL 0x00008000 +#define CERR_ERROR 0x00004000 +#define CERR_WARNING 0x00002000 +#define CERR_HINT 0x00001000 + +int msgproc(int line, uint32_t dwMsgCode, char* szText, void* context) +{ + error_vec.push_back(dwMsgCode); + const char*t = "unknown"; + switch(dwMsgCode & 0xF000) { + case CERR_HINT: t=" hint"; break; + case CERR_WARNING: t="warning"; break; + case CERR_ERROR: t=" error"; break; + case CERR_FATAL: t=" fatal"; break; + } + printf("line %d %s %04.4x: %s\n", line, t, (unsigned int)dwMsgCode, szText); + return 1; +} + +#include "../src/filesystem.h" + +int main(int argc, char *argv[]) +{ + if(argc < 4) { + puts("Usage: kmcompxtest source.kmn output.kmx fixture.kmx"); + return __LINE__; + } + + char* kmn_file = argv[1]; + char* kmx_file = argv[2]; + char* reference_kmx = argv[3]; + + // Replace \ with / + for(char *p = kmn_file; *p; p++) { + if(*p == '\\') *p = '/'; + } + + for(char *p = kmx_file; *p; p++) { + if(*p == '\\') *p = '/'; + } + + for(char *p = reference_kmx; *p; p++) { + if(*p == '\\') *p = '/'; + } + + char first5[6] = "CERR_"; + char* pfirst5 = first5; + + KMCMP_COMPILER_OPTIONS kcopts; + kcopts.dwSize = sizeof(KMCMP_COMPILER_OPTIONS); + kcopts.ShouldAddCompilerVersion = false; // So we can compare against existing compiled keyboards that also don't have compiler version + if(!kmcmp_SetCompilerOptions(&kcopts)) { + return __LINE__; + } + + if(kmcmp_CompileKeyboardFile(kmn_file, kmx_file, true, false, true, msgproc, nullptr)) { + char* testname = strrchr( (char*) kmn_file, '/') + 1; + if(strncmp(testname, pfirst5, 5) == 0){ + return __LINE__; // exit code: CERR_ in Name + no Error found + } + + // On non-win32 platforms, we cannot get kmcmpdll.dll to build keyboards + // legacy-mode, so we'll compare to a hopefully existing file that we've + // been passed + FILE* fp1 = Open_File(kmx_file, "rb"); + if(!fp1) return __LINE__; + + + FILE* fp2 = Open_File(reference_kmx, "rb"); + if(!fp2) return __LINE__; // exit code: fail if no reference kmx file in build-folder + + fseek(fp1, 0, SEEK_END); + auto sz1 = ftell(fp1); + fseek(fp1, 0, SEEK_SET); + fseek(fp2, 0, SEEK_END); + auto sz2 = ftell(fp2); + fseek(fp2, 0, SEEK_SET); + if (sz1 != sz2) return __LINE__; // exit code: size of kmx-file in build differs from size of kmx-file in source folder + + char* buf1 = new char[sz1]; + char* buf2 = new char[sz1]; + fread(buf1, 1, sz1, fp1); + fread(buf2, 1, sz1, fp2); + return memcmp(buf1, buf2, sz1) ? __LINE__ : 0; // exit code: when contents of kmx-file in build differs from contents of kmx-file in source folder + // success: when contents of kmx-file in build and source folder are the same + } + else { /*if Errors found: check number (e.g. CERR_4061_balochi_phonetic.kmn should produce Error 4061)*/ + int error_val = 0; + char* testname = strrchr( (char*) kmn_file, '/') + 1; + + // Does testname contain CERR_ && contains '_' on pos 9 ? -> Get ErrorValue + if ((strncmp(testname, pfirst5, 5) == 0) && (testname[9] == '_')) { + char* ErrNr = strchr(testname, '_') +1 ; + std::istringstream(ErrNr) >> std::hex >> error_val; + + // check if error_val is in Array of Errors; if it is found return 0 (it's not an error) + for (int i = 0; i < error_vec.size() ; i++) { + if (error_vec[i] == error_val) { + return 0; // success: CERR_ in Name + Error (specified in CERR_Name) IS found + } + } + return __LINE__; // exit code: CERR_ in Name + Error (specified in CERR_Name) is NOT found + } + return __LINE__; // exit code: no correct CERR_ in Name + CompileKeyboardFile failed (i.e. test config is invalid) + } +} + + +bool equalIgnoreCase(const string& a, const string& b) +{ + return std::equal( + a.begin(), a.end(), + b.begin(), b.end(), + [](char a, char b) { + return tolower(a) == tolower(b); + } + ); +} + +// Returns TRUE if the keyboard has a &TARGETS store with +// 'any', 'windows', 'macosx', 'linux', or 'desktop' targets, +// or if no &TARGETS store exists (which is equivalent to +// 'windows'). +bool isDesktopKeyboard(FILE* fp) { + COMP_KEYBOARD fk; + + if(fseek(fp, 0, SEEK_SET) != 0) { + printf("isDesktopKeyboard: fseek(0) failed\n"); + exit(1); + } + + if(!fread(&fk, sizeof(fk), 1, fp)) { + printf("isDesktopKeyboard failed: could not read COMP_KEYBOARD\n"); + exit(1); + } + + // Note: this code assumes a valid .kmx. This is okay for a unit test + if(fseek(fp, fk.dpStoreArray, SEEK_SET) != 0) { + printf("isDesktopKeyboard failed: could not locate fk.dpStoreArray=%x\n", fk.dpStoreArray); + exit(1); + } + + PCOMP_STORE pfs = new COMP_STORE[fk.cxStoreArray]; + if(fread(pfs, sizeof(COMP_STORE), fk.cxStoreArray, fp) != fk.cxStoreArray) { + printf("isDesktopKeyboard failed: could not read fk.dpStoreArray=%x [%x]\n", fk.dpStoreArray, fk.cxStoreArray); + exit(1); + } + + PCOMP_STORE s = pfs; + + for(int i = 0; i < fk.cxStoreArray; i++, s++) { + if(s->dwSystemID != TSS_TARGETS) { + continue; + } + + // Read targets store + if(fseek(fp, s->dpString, SEEK_SET) != 0) { + printf("isDesktopKeyboard: could not seek to TSS_TARGETS.dpString %x\n", s->dpString); + exit(1); + } + + KMX_WCHAR buf[256]; + if(fread(buf, sizeof(KMX_WCHAR), 256, fp) == 0) { + printf("isDesktopKeyboard: could not read TSS_TARGETS.dpString %x\n", s->dpString); + exit(1); + } + buf[255] = 0; // sanity + + if(fseek(fp, 0, SEEK_SET) != 0) { + printf("isDesktopKeyboard: fseek(0) failed\n"); + exit(1); + } + + std::string targets1 = string_from_u16string(buf); + std::stringstream targets(targets1); + std::string target; + + printf("isDesktopKeyboard: TSS_TARGETS: %s\n", targets1.c_str()); + + delete[] pfs; + + while(targets >> target) { + //Matches KMXKeymanTargets from UKeymanTargets.pas + if(equalIgnoreCase(target, "any") || + equalIgnoreCase(target, "windows") || + equalIgnoreCase(target, "macosx") || + equalIgnoreCase(target, "linux") || + equalIgnoreCase(target, "desktop") + ) { + printf("isDesktopKeyboard: TSS_TARGETS does contain desktop target %s\n", target.c_str()); + return true; + } + } + + printf("isDesktopKeyboard: TSS_TARGETS does not contain desktop target\n"); + return false; + } + + delete[] pfs; + + if(fseek(fp, 0, SEEK_SET) != 0) { + printf("isDesktopKeyboard: fseek(0) failed\n"); + exit(1); + } + + printf("isDesktopKeyboard: TSS_TARGETS does not exist\n"); + return true; +} diff --git a/developer/src/kmcmplib/tests/meson.build b/developer/src/kmcmplib/tests/meson.build new file mode 100644 index 0000000000000000000000000000000000000000..b81429806e16a3d414c2626c34fba9caa4d2bc12 --- /dev/null +++ b/developer/src/kmcmplib/tests/meson.build @@ -0,0 +1,130 @@ +# +# Keyman is copyright (C) SIL International. MIT License. +# +# Cross platform build script to compile and run tests for kmcompx +# + +fs = import('fs') + +tests_flags = [] + +input_path = meson.current_source_dir() / '../../../../common/test/keyboards/baseline' +output_path = meson.current_build_dir() + +kmcompxtest = executable('kmcompxtest', 'kmcompxtest.cpp', + cpp_args: defns, + include_directories: inc, + name_suffix: name_suffix, + link_args: links + tests_flags, + objects: lib.extract_all_objects(), + dependencies: icuuc_dep, + ) + +# Test keyboards that we have in Core + +tests = [ + 'k_000___null_keyboard', + 'k_001___basic_input_unicodei', + 'k_002___basic_input_unicode', + 'k_003___nul', + 'k_004___basic_input__shift_2_', + 'k_005___nul_with_initial_context', + 'k_006___vkey_input__shift_ctrl_', + 'k_007___vkey_input__ctrl_alt_', + 'k_008___vkey_input__ctrl_alt_2_', + 'k_012___ralt', + 'k_013___deadkeys', + 'k_014___groups_and_virtual_keys', + 'k_015___ralt_2', + 'k_017___space_mnemonic_kbd', + 'k_018___nul_testing', + 'k_019___multiple_deadkeys', + 'k_020___deadkeys_and_backspace', + 'k_021___options', + 'k_022___options_with_preset', + 'k_023___options_with_save', + 'k_024___options_with_save_and_preset', + 'k_025___options_with_reset', + 'k_026___system_stores', + 'k_027___system_stores_2', + 'k_028___smp', + 'k_029___beep', + 'k_030___multiple_groups', + 'k_031___caps_lock', + 'k_032___caps_control', + 'k_033___caps_always_off', + 'k_034___options_double_set_reset', + 'k_035___options_double_set_staged', + 'k_036___options___double_reset_staged', + 'k_037___options___double_reset', + 'k_038___punctkeys', + 'k_039___generic_ctrlalt', + 'k_040___long_context', + 'k_041___long_context_and_deadkeys', + 'k_042___long_context_and_split_deadkeys', + 'k_043___output_and_keystroke', + 'k_044___if_and_context', + 'k_045___deadkey_and_context', + 'k_046___deadkey_and_contextex', + 'k_047___caps_always_off_initially_on', + 'k_048___modifier_keys_keep_context' +] + +foreach kbd : tests + kbd_src = join_paths(input_path, kbd) + '.kmn' + kbd_obj = join_paths(output_path, kbd) + '.kmx' + test(kbd, kmcompxtest, args: [kbd_src, kbd_obj, join_paths(input_path, kbd) + '.kmx']) +endforeach + +# Test fixtures that come from keyboards repo -- but only for a "full" test, +# which typically we run on CI no more than once a day, because it's expensive. + +if get_option('full_test') + + keyboards_root = meson.current_source_dir() / 'keyboards' + + if build_machine.system() == 'windows' + test_source = run_command('run-shell.bat', 'get-test-source.sh', keyboards_root, capture: true, check: true) + else + test_source = run_command('get-test-source.sh', keyboards_root, capture: true, check: true) + endif + + tests = test_source.stdout().strip().split('\n') + + foreach kbd : tests + test_basename = fs.replace_suffix(fs.name(kbd), '') + + # kbd is going to be an absolute path + kbd_obj = output_path / test_basename + '.kmx' + reference_kmx = meson.current_source_dir() / 'fixtures' / test_basename + '.kmx' + + if fs.is_file(reference_kmx) + test(test_basename, kmcompxtest, args: [kbd, kbd_obj, reference_kmx]) + endif + endforeach + +endif + +# Test the API endpoints + +apitest = executable('api-test', 'api-test.cpp', + cpp_args: defns, + include_directories: inc, + name_suffix: name_suffix, + link_args: links + tests_flags, + objects: lib.extract_all_objects(), + dependencies: icuuc_dep, + ) + +test('api-test', apitest) + +usetapitest = executable('uset-api-test', 'uset-api-test.cpp', + cpp_args: defns, + include_directories: inc, + name_suffix: name_suffix, + link_args: links + tests_flags, + objects: lib.extract_all_objects(), + dependencies: icuuc_dep, + ) + +test('uset-api-test', usetapitest) diff --git a/developer/src/kmcmplib/tests/prep.sh b/developer/src/kmcmplib/tests/prep.sh new file mode 100755 index 0000000000000000000000000000000000000000..058d4a1b9b0bfdd50fe13d29bcbdff7af508bd3c --- /dev/null +++ b/developer/src/kmcmplib/tests/prep.sh @@ -0,0 +1,68 @@ +#!/usr/bin/env bash +# +# Generates fixtures for testing against the legacy compiler +# +# Assumes that the +# + +# Exit on command failure and when using unset variables: +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +cd "$THIS_SCRIPT_PATH" + +builder_describe \ +"Generates fixtures for testing against the legacy compiler. + + Developer must be built locally and binaries should be in developer/bin/. + + Assumes that the keyboards repository exists and is clean. Will record the + commit hash to allow corresponding CI builds to use the same commit hash + for validation." \ + clean \ + build \ + "--keyboards-root,-k=KEYBOARDS_ROOT Path to keyboards repository" + +builder_parse "$@" + +if ! builder_has_option --keyboards-root; then + builder_die "--keyboards-root option is required" +fi + +if [[ ! -d "$KEYBOARDS_ROOT/.git" ]] || [[ ! -f "$KEYBOARDS_ROOT/tools/regression.sh" ]]; then + builder_die "Path $KEYBOARDS_ROOT does not appear to be a valid keyboard repository" +fi + +if builder_start_action clean; then + rm -rf "$THIS_SCRIPT_PATH/fixtures" + rm -f "$THIS_SCRIPT_PATH/keyboards_commit_ref.txt" + builder_finish_action success clean +fi + +if builder_start_action build; then + # yes, remove existing fixtures before build so we don't end up with stale fixtures + rm -rf "$THIS_SCRIPT_PATH/fixtures" + + # record the revision of the keyboards repo + pushd "$KEYBOARDS_ROOT" > /dev/null + git rev-parse head > "$THIS_SCRIPT_PATH/keyboards_commit_ref.txt" + popd > /dev/null + + "$KEYBOARDS_ROOT/tools/regression.sh" --use-legacy-compiler --local "$KEYMAN_ROOT/developer/bin/" --output "$THIS_SCRIPT_PATH/fixtures/" + + cd "$THIS_SCRIPT_PATH" + + # We don't need visual keyboards + rm ./fixtures/*.kvk + # Nor do we need kmw outputs + rm ./fixtures/*.js + # Finally, we remove any keyboards over 500kb, as we won't automatically test them for now + # TODO: consider if we want to keep those large keyboards in the future + find ./fixtures/ -size +500k -exec rm {} \+ + builder_finish_action success build +fi \ No newline at end of file diff --git a/developer/src/kmcmplib/tests/run-shell.bat b/developer/src/kmcmplib/tests/run-shell.bat new file mode 100644 index 0000000000000000000000000000000000000000..f0a51d786900e77246a032380d8813cab0fd25cc --- /dev/null +++ b/developer/src/kmcmplib/tests/run-shell.bat @@ -0,0 +1,7 @@ +@echo off +if defined GIT_BASH_FOR_KEYMAN ( + set GIT_BASH=%GIT_BASH_FOR_KEYMAN% +) else ( + set GIT_BASH="%ProgramFiles%\git\bin\bash.exe" --init-file "%ProgramFiles%\Git\etc\profile" -l +) +%GIT_BASH% %1 %2 %3 %4 %5 %6 %7 %8 %9 \ No newline at end of file diff --git a/developer/src/kmcmplib/tests/uset-api-test.cpp b/developer/src/kmcmplib/tests/uset-api-test.cpp new file mode 100644 index 0000000000000000000000000000000000000000..4fe599ca2e83a1af9d50d61368bafa4b337f3c82 --- /dev/null +++ b/developer/src/kmcmplib/tests/uset-api-test.cpp @@ -0,0 +1,98 @@ +/* + * Keyman is copyright (C) SIL International. MIT License. + * + * UnicodeSet API endpoint unit tests for kmcmplib + */ + +#include + +#ifdef _MSC_VER +#include +#else +#include +#endif + +#include +#include +#include +#include +#include "../src/compfile.h" +#include + +void test_kmcmp_ParseUnicodeSetProc(); + +// std::vector error_vec; + +int main(int argc, char *argv[]) { + test_kmcmp_ParseUnicodeSetProc(); + + return 0; +} + + +void test_kmcmp_ParseUnicodeSetProc() { + { + // null test + const auto bufsiz = 128; + uint32_t buf[bufsiz]; + int rc = kmcmp_ParseUnicodeSet(u8"[]", buf, bufsiz); + assert(rc == KMCMP_USET_OK); + } + { + // basic test + const auto bufsiz = 128; + uint32_t buf[bufsiz]; + int rc = kmcmp_ParseUnicodeSet(u8"[x A-C]", buf, bufsiz); + assert(rc == 2); + assert(buf[0] == 0x41); + assert(buf[1] == 0x43); + assert(buf[2] == 0x78); + assert(buf[3] == 0x78); + } + { + // bigger test + const auto bufsiz = 128; + uint32_t buf[bufsiz]; + int rc = kmcmp_ParseUnicodeSet(u8"[[🙀A-C]-[CB]]", buf, bufsiz); + assert(rc == 2); + assert(buf[0] == 0x41); + assert(buf[1] == 0x41); + assert(buf[2] == 0x1F640); + assert(buf[3] == 0x1F640); + } + { + // overflow test + const auto bufsiz = 1; + uint32_t buf[bufsiz]; + int rc = kmcmp_ParseUnicodeSet(u8"[x A-C]", buf, bufsiz); + assert(rc == KMCMP_FATAL_OUT_OF_RANGE); + } + { + // err test + const auto bufsiz = 128; + uint32_t buf[bufsiz]; + int rc = kmcmp_ParseUnicodeSet(u8"[:Adlm:]", buf, bufsiz); + assert(rc == KMCMP_ERROR_UNSUPPORTED_PROPERTY); + } + { + // err test + const auto bufsiz = 128; + uint32_t buf[bufsiz]; + int rc = kmcmp_ParseUnicodeSet(u8"[[\\p{Mn}]&[A-Z]]", buf, bufsiz); + assert(rc == KMCMP_ERROR_UNSUPPORTED_PROPERTY); + } + { + // err test + const auto bufsiz = 128; + uint32_t buf[bufsiz]; + int rc = kmcmp_ParseUnicodeSet(u8"[abc{def}]", buf, bufsiz); + assert(rc == KMCMP_ERROR_HAS_STRINGS); + } + { + // err test + const auto bufsiz = 128; + uint32_t buf[bufsiz]; + int rc = kmcmp_ParseUnicodeSet(u8"[[]", buf, bufsiz); + assert(rc == KMCMP_ERROR_SYNTAX_ERR); + } +} diff --git a/developer/src/kmcmplib/version.rc b/developer/src/kmcmplib/version.rc new file mode 100644 index 0000000000000000000000000000000000000000..b963c10ddb1be06b12eec81667301c4f551c3cc5 --- /dev/null +++ b/developer/src/kmcmplib/version.rc @@ -0,0 +1,32 @@ +#include "../../../common/windows/cpp/include/keymanversion.h" + +1 VERSIONINFO + FILEVERSION KV_FILEVERSION + PRODUCTVERSION KV_PRODUCTVERSION + FILEFLAGSMASK 0x3fL + FILEFLAGS 0x0L + FILEOS 0x4L + FILETYPE 0x2L + FILESUBTYPE 0x0L + BEGIN + BLOCK "StringFileInfo" + BEGIN + BLOCK "0C0904E4" + BEGIN + VALUE "CompanyName", KV_COMPANY_NAME + VALUE "FileDescription", "Keyman compiler library\0" + VALUE "FileVersion", KV_VERSION_STRING + VALUE "InternalName", "KMCOMP\0" + VALUE "LegalCopyright", KV_LEGAL_COPYRIGHT + VALUE "LegalTrademarks", KV_LEGAL_TRADEMARKS + VALUE "OriginalFilename", "KMCOMP.DLL\0" + VALUE "ProductName", "Keyman Developer\0" + VALUE "ProductVersion", KV_VERSION_STRING + VALUE "Comments", "\0" + END + END + BLOCK "VarFileInfo" + BEGIN + VALUE "Translation", 0xc09, 1252 + END + END diff --git a/developer/src/kmcmplib/wasm.build.linux.in b/developer/src/kmcmplib/wasm.build.linux.in new file mode 100644 index 0000000000000000000000000000000000000000..c5e61a9bda94e66bcc6c147361c56c4488ef60c6 --- /dev/null +++ b/developer/src/kmcmplib/wasm.build.linux.in @@ -0,0 +1,4 @@ +[binaries] +c = ['$EMSCRIPTEN_BASE/emcc.py'] +cpp = ['$EMSCRIPTEN_BASE/em++.py'] +ar = ['$EMSCRIPTEN_BASE/emar.py'] diff --git a/developer/src/kmcmplib/wasm.build.mac.in b/developer/src/kmcmplib/wasm.build.mac.in new file mode 100644 index 0000000000000000000000000000000000000000..c5e61a9bda94e66bcc6c147361c56c4488ef60c6 --- /dev/null +++ b/developer/src/kmcmplib/wasm.build.mac.in @@ -0,0 +1,4 @@ +[binaries] +c = ['$EMSCRIPTEN_BASE/emcc.py'] +cpp = ['$EMSCRIPTEN_BASE/em++.py'] +ar = ['$EMSCRIPTEN_BASE/emar.py'] diff --git a/developer/src/kmcmplib/wasm.build.win.in b/developer/src/kmcmplib/wasm.build.win.in new file mode 100644 index 0000000000000000000000000000000000000000..68c21fb00f5f6ba0a3e0316aabbf894500bd0f3d --- /dev/null +++ b/developer/src/kmcmplib/wasm.build.win.in @@ -0,0 +1,4 @@ +[binaries] +c = ['python.exe', '$EMSCRIPTEN_BASE/emcc.py'] +cpp = ['python.exe', '$EMSCRIPTEN_BASE/em++.py'] +ar = ['python.exe', '$EMSCRIPTEN_BASE/emar.py'] diff --git a/developer/src/kmcmplib/wasm.defs.build b/developer/src/kmcmplib/wasm.defs.build new file mode 100644 index 0000000000000000000000000000000000000000..4a598a1e1c121d759e5637df28d17dabcb675734 --- /dev/null +++ b/developer/src/kmcmplib/wasm.defs.build @@ -0,0 +1,18 @@ +[binaries] +c = ['emcc.py'] +cpp = ['em++.py'] +ar = ['emar.py'] +exe_wrapper = 'node' + +[properties] +root = '$EMSCRIPTEN_BASE/system' +shared_lib_suffix = 'js' +static_lib_suffix = 'js' +shared_module_suffix = 'js' +exe_suffix = 'js' + +[host_machine] +system = 'emscripten' +cpu_family = 'x86' +cpu = 'i686' +endian = 'little' diff --git a/developer/src/kmcomp/kccompilekvk.pas b/developer/src/kmcomp/kccompilekvk.pas index 4e9e52c8376f743400d884501888d64ab65a5a14..facb82122aec4e7c2f30bae26f6f1951870fad45 100644 --- a/developer/src/kmcomp/kccompilekvk.pas +++ b/developer/src/kmcomp/kccompilekvk.pas @@ -20,7 +20,7 @@ uses VisualKeyboard; const - CWARN_KVKFileIsInSourceFormat = $000020A2; // from comperr.h + CWARN_KVKFileIsInSourceFormat = $000020A2; // from kmn_compiler_errors.h (** Compiles the visual keyboard from xml to binary, and/or copies to destination folder diff --git a/developer/src/kmcomp/kmcomp.dpr b/developer/src/kmcomp/kmcomp.dpr index 8ac6e124cfab44e2e1204e73ca91f3a55cdd5230..30204a63dbaa6c67d599fb4b73d70c01fd918763 100644 --- a/developer/src/kmcomp/kmcomp.dpr +++ b/developer/src/kmcomp/kmcomp.dpr @@ -10,7 +10,6 @@ uses RegistryKeys in '..\..\..\common\windows\delphi\general\RegistryKeys.pas', kccompilepackage in 'kccompilepackage.pas', CompilePackage in '..\common\delphi\compiler\CompilePackage.pas', - CRC32 in '..\..\..\common\windows\delphi\general\CRC32.pas', kpsfile in '..\common\delphi\packages\kpsfile.pas', PackageInfo in '..\..\..\common\windows\delphi\packages\PackageInfo.pas', PackageFileFormats in '..\..\..\common\windows\delphi\packages\PackageFileFormats.pas', diff --git a/developer/src/kmcomp/kmcomp.dproj b/developer/src/kmcomp/kmcomp.dproj index f6f183330fb289fdc6eb15dbe7b70f23f2131419..36c16e3535677c77b386d3f42dde5d9914a2d5fa 100644 --- a/developer/src/kmcomp/kmcomp.dproj +++ b/developer/src/kmcomp/kmcomp.dproj @@ -156,7 +156,6 @@ - diff --git a/developer/src/kmcomp/main.pas b/developer/src/kmcomp/main.pas index 1266bdba5d6ee1fdc555f7297a15573bd76860be..5a29927a807bccd47dea671dbb6ce8d629a1f727 100644 --- a/developer/src/kmcomp/main.pas +++ b/developer/src/kmcomp/main.pas @@ -47,6 +47,8 @@ uses Winapi.ActiveX, Winapi.Windows, + KeyboardParser, + kmxfileconsts, Keyman.Developer.System.Project.ProjectLog, Keyman.Developer.System.Project.ProjectLogConsole, Keyman.Developer.System.ValidateRepoChanges, @@ -59,10 +61,11 @@ uses CompileKeymanWeb, JsonExtractKeyboardInfo, ValidateKeyboardInfo, - MergeKeyboardInfo; + MergeKeyboardInfo, + UKeymanTargets; function CompileKeyboard(FInFile, FOutFile: string; FDebug, FWarnAsError: Boolean): Boolean; forward; // I4706 -function KCSetCompilerOptions(const FInFile: string; FShouldAddCompilerVersion: Boolean): Boolean; forward; +function KCSetCompilerOptions(const FInFile: string; FShouldAddCompilerVersion, FUseKmcmpLib: Boolean): Boolean; forward; //function CompilerMessage(line: Integer; msgcode: LongWord; text: PAnsiChar): Integer; stdcall; forward; procedure FixupPathSlashes(var path: string); forward; @@ -87,6 +90,7 @@ var FParamDistribution: Boolean; FMergingValidateIds: Boolean; FShouldAddCompilerVersion: Boolean; + FUseKmcmpLib: Boolean; FJsonSchemaPath: string; FParamSourcePath: string; FParamHelpLink: string; @@ -113,6 +117,7 @@ begin FColorMode := cmDefault; FShouldAddCompilerVersion := True; + FUseKmcmpLib := True; FParamInfile := ''; FParamOutfile := ''; @@ -188,6 +193,8 @@ begin FColorMode := cmForceNoColor else if s = '-no-compiler-version' then FShouldAddCompilerVersion := False + else if s = '-use-legacy-compiler' then + FUseKmcmpLib := False else if (s = '-help') or (s = '-h') then begin // Force help @@ -216,6 +223,8 @@ begin writeln(SKeymanDeveloperName + ' Compiler (32-bit)'); {$ENDIF} writeln('Version ' + CKeymanVersionInfo.VersionWithTag + ', ' + GetVersionCopyright); + if not FUseKmcmpLib then + writeln('Note: using legacy compiler'); end; if FError or (FParamInfile = '') then @@ -225,7 +234,7 @@ begin writeln(''); writeln('Usage: '+cmd+' [-s[s]] [-nologo] [-c] [-d] [-w] [-cfc] [-v[s|d]] [-source-path path] [-schema-path path] '); writeln(' '+spc+' [-m] infile [-m infile] [-t target] [outfile.kmx|outfile.js [error.log]]'); // I4699 - writeln(' '+spc+' [-add-help-link path] [-color|-no-color] [-no-compiler-version]'); + writeln(' '+spc+' [-add-help-link path] [-color|-no-color] [-no-compiler-version] [-use-legacy-compiler]'); writeln(' '+spc+' [-extract-keyboard-info field[,field...]]'); writeln(' infile can be a .kmn file (Keyboard Source, .kps file (Package Source), or .kpj (project)'); // I4699 // I4825 writeln(' if -v specified, can also be a .keyboard_info file'); @@ -249,6 +258,7 @@ begin writeln(' uses console mode to determine whether color should be used.'); writeln; writeln(' -no-compiler-version Don''t embed the compiler version stores, useful for regression tests.'); + writeln(' -use-legacy-compiler Use legacy compiler (will be removed in 18.0)'); writeln; writeln(' JSON .keyboard_info compile targets:'); writeln(' -v[s] validate infile against source schema'); @@ -288,7 +298,7 @@ begin TProjectLogConsole.Create(FSilent, FFullySilent, hOutfile, FColorMode); - KCSetCompilerOptions(FParamInfile, FShouldAddCompilerVersion); + KCSetCompilerOptions(FParamInfile, FShouldAddCompilerVersion, FUseKmcmpLib); if FValidateRepoChanges then FError := not TValidateRepoChanges.Execute(FParamInfile, FParamOutfile) @@ -314,7 +324,7 @@ begin ExitCode := 1; end; -function KCSetCompilerOptions(const FInFile: string; FShouldAddCompilerVersion: Boolean): Boolean; +function KCSetCompilerOptions(const FInFile: string; FShouldAddCompilerVersion, FUseKmcmpLib: Boolean): Boolean; var opt: TCompilerOptions; begin @@ -322,6 +332,7 @@ begin opt.dwSize := sizeof(TCompilerOptions); opt.ShouldAddCompilerVersion := FShouldAddCompilerVersion; + opt.UseKmcmpLib := FUseKmcmpLib; Result := SetCompilerOptions(@opt, @CompilerMessageW); @@ -332,28 +343,67 @@ begin end; function CompileKeyboard(FInFile, FOutFile: string; FDebug, FWarnAsError: Boolean): Boolean; // I4706 +var + FIsJS, FIsKMX: Boolean; + kp: TKeyboardParser; + FTargets: TKeymanTargets; begin - if SameText(ExtractFileExt(FOutFile), '.js') then + if ExtractFileExt(FOutFile) = '.*' then begin - with TCompileKeymanWeb.Create do + // Load the input .kmn and determine if it targets .js and .kmx + kp := TKeyboardParser.Create; try - Result := Compile(nil, FInFile, FOutFile, FDebug, @CompilerMessageW); // I3681 // I4865 // I4866 + kp.LoadFromFile(FInFile); + + // Compile targets - copied from kmnProjectFile + FTargets := StringToKeymanTargets(kp.GetSystemStoreValue(ssTargets)); + if ktAny in FTargets then FTargets := AllKeymanTargets; + if FTargets = [] then FTargets := [ktWindows]; + + FIsJS := FTargets * KMWKeymanTargets <> []; + FIsKMX := FTargets * KMXKeymanTargets <> []; finally - Free; + kp.Free; end; end else begin - if FOutFile = '' then FOutFile := ChangeFileExt(FInFile, '.kmx'); - Result := CompileKeyboardFile(PChar(FInFile), PChar(FOutFile), FDebug, FWarnAsError, True, @CompilerMessage) <> 0; // I4865 // I4866 - Result := Result and CompileVisualKeyboardFromKMX(FInFile, FOutFile); + FIsJS := SameText(ExtractFileExt(FOutFile), '.js'); + FIsKMX := not FIsJS; + end; + + Result := True; + + if FIsJS then + begin + if FOutFile = '' then FOutFile := FInFile; + FOutFile := ChangeFileExt(FOutFile, '.js'); + + with TCompileKeymanWeb.Create do + try + Result := Result and Compile(nil, FInFile, FOutFile, FDebug, @CompilerMessageW); // I3681 // I4865 // I4866 + finally + Free; + end; + + if TProjectLogConsole.Instance.HasWarning and FWarnAsError then Result := False; // I4706 + if Result + then TProjectLogConsole.Instance.Log(plsSuccess, FInFile, 'Keyboard '+FInFile+' compiled, output saved as '+FOutFile+'.', 0, 0) + else TProjectLogConsole.Instance.Log(plsFailure, FInFile, 'Keyboard '+FInFile+' could not be compiled.', 0, 0); end; - if TProjectLogConsole.Instance.HasWarning and FWarnAsError then Result := False; // I4706 + if Result and FIsKMX then + begin + if FOutFile = '' then FOutFile := FInFile; + FOutFile := ChangeFileExt(FOutFile, '.kmx'); + Result := Result and (CompileKeyboardFile(PChar(FInFile), PChar(FOutFile), FDebug, FWarnAsError, True, @CompilerMessage) <> 0); // I4865 // I4866 + Result := Result and CompileVisualKeyboardFromKMX(FInFile, FOutFile); - if Result - then TProjectLogConsole.Instance.Log(plsSuccess, FInFile, 'Keyboard '+FInFile+' compiled, output saved as '+FOutFile+'.', 0, 0) - else TProjectLogConsole.Instance.Log(plsFailure, FInFile, 'Keyboard '+FInFile+' could not be compiled.', 0, 0); + if TProjectLogConsole.Instance.HasWarning and FWarnAsError then Result := False; // I4706 + if Result + then TProjectLogConsole.Instance.Log(plsSuccess, FInFile, 'Keyboard '+FInFile+' compiled, output saved as '+FOutFile+'.', 0, 0) + else TProjectLogConsole.Instance.Log(plsFailure, FInFile, 'Keyboard '+FInFile+' could not be compiled.', 0, 0); + end; end; procedure FixupPathSlashes(var path: string); diff --git a/developer/src/kmconvert/kmconvert.dpr b/developer/src/kmconvert/kmconvert.dpr index 233c07d43c669303b2a6c379813fc4658e532772..3452b73d301d6ba7ea62e3a392e6e57e967a4e1d 100644 --- a/developer/src/kmconvert/kmconvert.dpr +++ b/developer/src/kmconvert/kmconvert.dpr @@ -23,7 +23,6 @@ uses VKeys in '..\..\..\common\windows\delphi\general\VKeys.pas', WindowsLanguages in '..\common\delphi\general\WindowsLanguages.pas', GetOsVersion in '..\..\..\common\windows\delphi\general\GetOsVersion.pas', - CRC32 in '..\..\..\common\windows\delphi\general\CRC32.pas', KeyNames in '..\..\..\common\windows\delphi\general\KeyNames.pas', utildir in '..\..\..\common\windows\delphi\general\utildir.pas', TextFileFormat in '..\common\delphi\general\TextFileFormat.pas', diff --git a/developer/src/kmconvert/kmconvert.dproj b/developer/src/kmconvert/kmconvert.dproj index 48626bc67be8a8b72deebb3f8b1162f09622cfbb..73defed445ce6c3a4a0f2ecc53887372fdb21540 100644 --- a/developer/src/kmconvert/kmconvert.dproj +++ b/developer/src/kmconvert/kmconvert.dproj @@ -129,7 +129,6 @@ - diff --git a/developer/src/kmdecomp/crc32.cpp b/developer/src/kmdecomp/crc32.cpp deleted file mode 100644 index 26b25cf569773a3998159b44f9c7f96bc5ac0e05..0000000000000000000000000000000000000000 --- a/developer/src/kmdecomp/crc32.cpp +++ /dev/null @@ -1,69 +0,0 @@ -#include "pch.h" - -/* - * Instead of performing a straightforward calculation of the 32 bit - * CRC using a series of logical operations, this program uses the - * faster table lookup method. This routine is called once when the - * program starts up to build the table which will be used later - * when calculating the CRC values. - */ - -#define CRC32_POLYNOMIAL 0xEDB88320L - -unsigned long CRCTable[256]; - -static void BuildCRCTable(void) -{ - static BOOL TableBuilt = FALSE; - int i; - int j; - unsigned long crc; - - if(!TableBuilt) - { - for(i = 0; i <= 255; i++) - { - crc = i; - - for(j = 8; j > 0; j--) - if(crc & 1) crc = (crc >> 1) ^ CRC32_POLYNOMIAL; else crc >>= 1; - - CRCTable[i] = crc; - } - } -} - - -/* - * This routine calculates the CRC for a block of data using the - * table lookup method. It accepts an original value for the crc, - * and returns the updated value. - */ - -static unsigned long CalculateBufferCRC(unsigned long count, BYTE *p) -{ - unsigned long temp1; - unsigned long temp2; - unsigned long crc = 0xFFFFFFFFL; - - while (count-- != 0) - { - temp1 = ( crc >> 8 ) & 0x00FFFFFFL; - temp2 = CRCTable[((int) crc ^ *p++) & 0xff]; - crc = temp1 ^ temp2; - } - - return crc; -} - - -BOOL VerifyChecksum(LPBYTE buf, LPDWORD CheckSum, DWORD sz) -{ - DWORD tempcs; - - tempcs = *CheckSum; - *CheckSum = 0; - - BuildCRCTable(); - return tempcs == CalculateBufferCRC(sz, buf); -} diff --git a/developer/src/kmdecomp/kmdecomp.cpp b/developer/src/kmdecomp/kmdecomp.cpp index 819a63350e8600ef1862ebc09dacf98ffcfaa96a..c6a085fe2e0e1a7dc2860be50784d6b0c5c34196 100644 --- a/developer/src/kmdecomp/kmdecomp.cpp +++ b/developer/src/kmdecomp/kmdecomp.cpp @@ -27,7 +27,6 @@ BOOL LoadKeyboard(LPSTR fileName, LPKEYBOARD *lpKeyboard, LPBYTE *lpBitmap, DWORD *cbBitmap); -extern BOOL VerifyChecksum(LPBYTE buf, LPDWORD CheckSum, DWORD sz); void Err(char *p); int SaveKeyboardSource(LPKEYBOARD kbd, LPBYTE lpBitmap, DWORD cbBitmap, char *filename, char *bmpfile); int run(int argc, char *argv[]); @@ -152,25 +151,21 @@ BOOL LoadKeyboard(LPSTR fileName, LPKEYBOARD *lpKeyboard, LPBYTE *lpBitmap, DWOR ckbp->dwFileVersion > VERSION_MAX) { /* Old or new version -- identify the desired program version */ - if(VerifyChecksum(buf, &kbp->dwCheckSum, sz)) - { - kbp->dpStoreArray = (LPSTORE) (buf + ckbp->dpStoreArray); - for(sp = kbp->dpStoreArray, i = 0; i < kbp->cxStoreArray; i++, sp++) - if(sp->dwSystemID == TSS_COMPILEDVERSION) - { - char buf2[256]; - wsprintf(buf2, "Wrong File Version: file version is %ls", ((PBYTE)kbp) + (INT_PTR)sp->dpString); - delete buf; - Err(buf2); - return FALSE; - } + kbp->dpStoreArray = (LPSTORE) (buf + ckbp->dpStoreArray); + for(sp = kbp->dpStoreArray, i = 0; i < kbp->cxStoreArray; i++, sp++) { + if(sp->dwSystemID == TSS_COMPILEDVERSION) + { + char buf2[256]; + wsprintf(buf2, "Wrong File Version: file version is %ls", ((PBYTE)kbp) + (INT_PTR)sp->dpString); + delete buf; + Err(buf2); + return FALSE; + } } delete buf; Err("Unknown File Version: try using the latest version of KMDECOMP"); return FALSE; } - if(!VerifyChecksum(buf, &kbp->dwCheckSum, sz)) { delete buf; Err("Bad Checksum in file"); return FALSE; } - kbp->dpStoreArray = (LPSTORE) (buf + ckbp->dpStoreArray); kbp->dpGroupArray = (LPGROUP) (buf + ckbp->dpGroupArray); diff --git a/developer/src/kmdecomp/kmdecomp.vcxproj b/developer/src/kmdecomp/kmdecomp.vcxproj index 19614cbd38787dc833b7ec2f99679796186602bd..223ae72199e5f920408e6ca0dbce9f1469600f03 100644 --- a/developer/src/kmdecomp/kmdecomp.vcxproj +++ b/developer/src/kmdecomp/kmdecomp.vcxproj @@ -141,12 +141,6 @@ NotUsing - - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) - %(PreprocessorDefinitions) - %(AdditionalIncludeDirectories) %(PreprocessorDefinitions) diff --git a/developer/src/kmdecomp/kmdecomp.vcxproj.filters b/developer/src/kmdecomp/kmdecomp.vcxproj.filters index e268df7a479af06c08fd4a3d960a27c50950e316..4b98e2ca719a42e77bf86ca64e721c8dc866ebb4 100644 --- a/developer/src/kmdecomp/kmdecomp.vcxproj.filters +++ b/developer/src/kmdecomp/kmdecomp.vcxproj.filters @@ -15,9 +15,6 @@ - - Source Files - Source Files diff --git a/developer/src/kmlmc/.gitignore b/developer/src/kmlmc/.gitignore deleted file mode 100644 index bbbfd24cf57c2c2b4405006712a2ae04fd92a960..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/.gitignore +++ /dev/null @@ -1,5 +0,0 @@ -node_modules/ -dist/ -dist-tests/ -tsconfig.tsbuildinfo -tests/tsconfig.tsbuildinfo diff --git a/developer/src/kmlmc/.npmignore b/developer/src/kmlmc/.npmignore deleted file mode 100644 index 2ac029d741ac80e2ce0295a900e97051abfcf764..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/.npmignore +++ /dev/null @@ -1,9 +0,0 @@ -# Ignore files required only in development. -dist-tests/* -source/* -tests/* -build.sh -bundle.sh -Makefile -tsconfig.json -tsconfig.tsbuildinfo diff --git a/developer/src/kmlmc/Makefile b/developer/src/kmlmc/Makefile deleted file mode 100644 index a1e5927f98e1f4d79ce7089daabaa250d2f149aa..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/Makefile +++ /dev/null @@ -1,28 +0,0 @@ -# -# Keyman Developer - Lexical Model Compiler Makefile -# - -!include ..\Defines.mak - -build: .virtual - $(GIT_BASH_FOR_KEYMAN) build.sh -test - -clean: .virtual -#TODO: move to build.sh `clean` target - -rd /s/q dist - -rd /s/q dist-tests - -del tsconfig.tsbuildinfo - -signcode: - @rem nothing to do - -wrap-symbols: - @rem nothing to do - -test-manifest: - @rem This target needed as dependency for KMDECOMP - -install: - @rem nothing to do - -!include ..\Target.mak diff --git a/developer/src/kmlmc/README.md b/developer/src/kmlmc/README.md deleted file mode 100644 index 93fb0facfd406b3f58717ca9153cba1bf102d814..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/README.md +++ /dev/null @@ -1,54 +0,0 @@ -Keyman Developer -================ - -This package provides the following Keyman **command line tools**: - - - `kmlmc` — takes **lexical model sources** and compiles them in to - a **.js** file. - - `kmlmp` — uses a `.model.kmp` file to generate a redistributable - **lexical model package**. - - `kmlmi` — merges Keyman lexical model `.model_info` files. - -`kmlmc` is intended to be used standalone, or as part of a build system. -`kmlmp` is used only by command line tools. `kmlmi` is used exclusively -in the [lexical-models repository][lexical models]. - -In order to build [lexical models][], these tools must be built and -compiled. - -[lexical models]: https://github.com/keymanapp/lexical-models - - -Install -------- - -Install `kmlmc`, `kmlmp`, and `kmlmi` globally: - - npm install -g @keymanapp/lexical-model-compiler - -Usage ------ - -To compile a lexical model from its `.model.ts` source, use `kmlmc`: - - kmlmc my-lexical-model.model.ts --outFile my-lexical-model.js - -To see more command line options by using the `--help` option: - - kmlmc --help - kmlmp --help - kmlmi --help - -How to build from source ------------------------- - -Run `build.sh`: - - ./build.sh - - -How to run the tests --------------------- - - ./build.sh -test - diff --git a/developer/src/kmlmc/build.sh b/developer/src/kmlmc/build.sh deleted file mode 100755 index 4b48d7bf9dfb82eed736d03c8fe79939264c0bdb..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/build.sh +++ /dev/null @@ -1,128 +0,0 @@ -#!/usr/bin/env bash -# -# Compiles the developer tools, including the language model compilers. -# - -# Exit on command failure and when using unset variables: -set -eu - -## START STANDARD BUILD SCRIPT INCLUDE -# adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" -## END STANDARD BUILD SCRIPT INCLUDE -EX_USAGE=64 - -# Where to find lexical model types. -LEXICAL_MODELS_TYPES="$KEYMAN_ROOT/common/models/types" - - -# Build the main script. -build () { - npm run build || fail "Could not build top-level JavaScript file." -} - -display_usage ( ) { - echo "Usage: $0 [-test] [-publish-to-npm]" - echo " $0 -help" - echo - echo " -help displays this screen and exits" - echo " -test runs unit tests after building" - echo " -tdd runs unit tests WITHOUT building" - echo " -skip-package-install, -S skip package installation" - echo " -publish-to-npm publishes the current version to the npm package index" - echo " -dry-run do build, etc, but don't actually publish" -} - -################################ Main script ################################ - -run_tests=0 -install_dependencies=1 -should_publish=0 -npm_dist_tag= -should_dry_run=0 - -# Process command-line arguments -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - -help|-h) - display_usage - exit - ;; - -dry-run) - should_dry_run=1 - ;; - -skip-package-install|-S) - install_dependencies=0 - ;; - -test) - run_tests=1 - ;; - -tdd) - run_tests=1 - install_dependencies=0 - ;; - -version) - echo "Warning: -version is now ignored" - ;; - -tier) - echo "Warning: -tier is now ignored" - ;; - -publish-to-npm) - should_publish=1 - ;; - *) - echo "$0: invalid option: $key" - display_usage - exit $EX_USAGE - esac - shift # past the processed argument -done - -# Dry run settings -if (( should_dry_run )); then - DRY_RUN=--dry-run -else - DRY_RUN= -fi - -# Check if Node.JS/npm is installed. -type npm >/dev/null ||\ - fail "Build environment setup error detected! Please ensure Node.js is installed!" - -if (( install_dependencies )) ; then - verify_npm_setup - # We need to build keyman-version and lm-worker with a script for now - "$KEYMAN_ROOT/common/web/keyman-version/build.sh" || fail "Could not build keyman-version" -fi - -build || fail "Compilation failed." -echo "Typescript compilation successful." - -if (( run_tests )); then - npm test || fail "Tests failed" -fi - -if (( should_publish )); then - if [[ $TIER == stable ]]; then - npm_dist_tag=latest - else - npm_dist_tag=$TIER - fi - - set_npm_version - - # Note: In either case, npm publish MUST be given --access public to publish - # a package in the @keymanapp scope on the public npm package index. - # - # See `npm help publish` for more details. - echo "Publishing $DRY_RUN npm package with tag $npm_dist_tag" - npm publish $DRY_RUN --access public --tag $npm_dist_tag || fail "Could not publish $npm_dist_tag release." - - # For now, kmlmc will have responsibility for publishing keyman-version. In - # the future, we should probably have a top-level npm publish script that - # publishes all modules for a given release version - "$KEYMAN_ROOT/common/web/keyman-version/build.sh" publish $DRY_RUN -fi diff --git a/developer/src/kmlmc/bundle.sh b/developer/src/kmlmc/bundle.sh deleted file mode 100755 index 14143608ca3d85a5223c574f271b9f9ed1ae658a..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/bundle.sh +++ /dev/null @@ -1,145 +0,0 @@ -#!/usr/bin/env bash - -set -eu - -## START STANDARD BUILD SCRIPT INCLUDE -# adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" -## END STANDARD BUILD SCRIPT INCLUDE - -. "$KEYMAN_ROOT/resources/build/jq.inc.sh" -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" - -display_usage() { - echo "Usage: $0 --build-path path" - echo " $0 --help" - echo - echo "This script is called from the Keyman Developer installer build" - echo "and is not intended for standalone use." - echo - echo " --help displays this screen and exits" - echo " --build-path path temporary path where archive will be built" -} - -BUILD_PATH= - -# Process command-line arguments -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - -help|-h) - display_usage - exit - ;; - --build-path) - shift - BUILD_PATH="$1" - ;; - *) - echo "$0: invalid option: $key" - display_usage - exit 64 - esac - shift # past the processed argument -done - -if [[ -z $BUILD_PATH ]]; then - echo "Parameter --build-path is required" - display_usage - exit 64 -fi - -KEYMAN_WIX_TEMP_BASE="$BUILD_PATH" -KEYMAN_WIX_TEMP_MODELCOMPILER="$BUILD_PATH/ModelCompiler" -KEYMAN_MODELCOMPILER_TEMP=`mktemp -d` - -# We copy the built model compiler into a temporary folder in order to prepare -# the node modules, as otherwise the workspace will interfere - -cp -R "$KEYMAN_ROOT/developer/src/kmlmc/"* "$KEYMAN_MODELCOMPILER_TEMP/" - -cd "$KEYMAN_MODELCOMPILER_TEMP" - -# We use `npm pack` to extract only the aspects of the model-compiler actually -# needed for distribution. While we could use npm-bundle or similar, that adds -# extra, unwanted cruft; our approach gives us more control of the set of files -# distributed with the Keyman Developer installer. -# -# For users on other operating systems, node.js is a dependency and the compiler -# can be installed with `npm install @keymanapp/lexical-model-compiler`. - -# We copy the files to a temp folder in order to exclude thumbs.db, .vs, etc -# from harvesting -rm -rf "$KEYMAN_WIX_TEMP_MODELCOMPILER" - -# Step 1 - npm-pack the model compiler package, then unpack it in our bundling -# directory. This automatically strips the package to its barebones. -set_npm_version -npm pack -mv keymanapp-lexical-model-compiler*.tgz kmlmc.tgz -mv kmlmc.tgz "$KEYMAN_WIX_TEMP_BASE" - -# We extract the npm-packed version of the model compiler in order to reproduce -# our needed bundle. -cd "$KEYMAN_WIX_TEMP_BASE" -tar xvzf kmlmc.tgz - -# Creates the directory referenced by $(KEYMAN_WIX_TEMP_MODELCOMPILER). -mv package ModelCompiler - -# Cleans up the npm pack artifacts, which are no longer needed. -rm kmlmc.tgz - -# Step 2 - the model compiler has one in-repo dependency that will also need to -# be packed. Managing other in-repo dependencies will be simpler; they install -# into ModelCompiler's extracted bundle. - -mkdir -p "$KEYMAN_MODELCOMPILER_TEMP/node_modules/@keymanapp/" -cp -R "$KEYMAN_ROOT/node_modules/@keymanapp/models-types" "$KEYMAN_MODELCOMPILER_TEMP/node_modules/@keymanapp/" - -cd "$KEYMAN_MODELCOMPILER_TEMP/node_modules/@keymanapp/models-types" -set_npm_version -npm pack -mv keymanapp-models-types*.tgz kmtypes.tgz -mv kmtypes.tgz "$KEYMAN_WIX_TEMP_MODELCOMPILER" - - -cp -R "$KEYMAN_ROOT/node_modules/@keymanapp/keyman-version" "$KEYMAN_MODELCOMPILER_TEMP/node_modules/@keymanapp/" - -cd "$KEYMAN_MODELCOMPILER_TEMP/node_modules/@keymanapp/keyman-version" -set_npm_version -npm pack -mv keymanapp-keyman-version*.tgz kmver.tgz -mv kmver.tgz "$KEYMAN_WIX_TEMP_MODELCOMPILER" - -# Step 3 - install just the bare essentials by using our packed local -# dependency, followed by all external production dependencies. -cd "$KEYMAN_WIX_TEMP_MODELCOMPILER" -# package-lock.json wasn't bundled; this is needed to keep dependency versions -# consistent. - -# as of npm v8.x, even though we are only working with `dependencies`, -# `devDependencies` is still checked, and as these modules are present in -# devDependencies but are only available when in the repo path, we need to -# remove them before attempting to continue. -# Yuck! ref: https://github.com/npm/cli/issues/3975#issuecomment-985305678 -# ref: https://github.com/npm/cli/issues/2921 -# can't use npm uninstall because it depends on @keymanapp/models-types being -# present! - -cat "$KEYMAN_MODELCOMPILER_TEMP/package.json" | "$JQ" \ - '. | del(.devDependencies."@keymanapp/models-templates") | del(.devDependencies."@keymanapp/keyman-version") | del(.devDependencies."@keymanapp/models-wordbreakers")' \ - > "package.json" - -npm install kmtypes.tgz --production --no-optional -npm install kmver.tgz --production --no-optional -npm install --production --no-optional - -# Clean up the npm pack artifacts for the dependencies. -rm kmtypes.tgz -rm kmver.tgz - -# We don't need the unit tests -rm -rf "$KEYMAN_WIX_TEMP_MODELCOMPILER/tests" -rm -rf "$KEYMAN_MODELCOMPILER_TEMP" \ No newline at end of file diff --git a/developer/src/kmlmc/package.json b/developer/src/kmlmc/package.json deleted file mode 100644 index a126590840a3aa61d7bb8ee21ea8f21399aca7dc..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/package.json +++ /dev/null @@ -1,61 +0,0 @@ -{ - "name": "@keymanapp/lexical-model-compiler", - "description": "Keyman Developer lexical model compiler", - "keywords": [ - "keyboard", - "predictive-text", - "keyman", - "lexical-model", - "unicode" - ], - "scripts": { - "build": "tsc -b", - "test": "cd tests && tsc -b && cd .. && mocha", - "prepublishOnly": "npm run build" - }, - "repository": { - "type": "git", - "url": "https://github.com/keymanapp/keyman" - }, - "author": "Marc Durdin (https://github.com/mcdurdin)", - "contributors": [ - "Eddie Antonio Santos ", - "Joshua Horton" - ], - "license": "MIT", - "bugs": { - "url": "https://github.com/keymanapp/keyman/issues" - }, - "homepage": "https://github.com/keymanapp/keyman/tree/master/common/predictive-text#readme", - "bin": { - "kmlmc": "dist/kmlmc.js", - "kmlmp": "dist/kmlmp.js", - "kmlmi": "dist/kmlmi.js" - }, - "engines": { - "node": ">=16.0.0" - }, - "dependencies": { - "@keymanapp/models-types": "*", - "@keymanapp/keyman-version": "*", - "commander": "^3.0.0", - "typescript": "^4.5.4", - "xml2js": "^0.4.19" - }, - "devDependencies": { - "@keymanapp/models-templates": "*", - "@keymanapp/models-wordbreakers": "*", - "@types/chai": "^4.1.7", - "@types/mocha": "^5.2.7", - "@types/node": "^10.14.6", - "@types/xml2js": "^0.4.5", - "chai": "^4.3.4", - "chalk": "^2.4.2", - "jszip": "^3.7.0", - "mocha": "^10.0.0", - "ts-node": "^9.1.1" - }, - "mocha": { - "spec": "dist-tests/**/test-*.js" - } -} diff --git a/developer/src/kmlmc/source/errors.ts b/developer/src/kmlmc/source/errors.ts deleted file mode 100644 index f58c2df91bce7da02af901326317b1d4993bffb7..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/source/errors.ts +++ /dev/null @@ -1,202 +0,0 @@ -/** - * Log levels. - * - * Note: Currently, this acts like a bit set, where the upper 4 bits of an - * unsigned 16 bit value are the log level flags. - * - * Warning: even though these look like bitmasks, these flags may not be - * combined. - */ -export enum LogLevel { - CERR_FATAL = 0x8000, - CERR_ERROR = 0x4000, - CERR_WARNING = 0x2000, - CERR_HINT = 0x1000 -}; - -/** - * Error codes. Use these when logging messages. - * - * Extends https://github.com/keymanapp/keyman/blob/99db3c0d2448f448242e6397f9d72e9a7ccee4b9/windows/src/global/inc/Comperr.h - */ -export enum KeymanCompilerError { - CERR_LEXICAL_MODEL_MIN = 0x0800, - CERR_LEXICAL_MODEL_MAX = 0x08FF, - - - CERR_FATAL_LM = LogLevel.CERR_FATAL | CERR_LEXICAL_MODEL_MIN, - /* Place all fatal LM compiler errors here! */ - - CERR_ERROR_LM = LogLevel.CERR_ERROR | CERR_LEXICAL_MODEL_MIN, - /* Place all recoverable LM compiler errors here! */ - - CERR_WARN_LM = LogLevel.CERR_WARNING | CERR_LEXICAL_MODEL_MIN, - /* Place all LM compiler warnings here! */ - CWARN_MixedNormalizationForms = 0x2801, /* CERR_WARN_LM + 1 */ - CWARN_DuplicateWordInSameFile = 0x2802, /* CERR_WARN_LM + 2 */ - - CERR_HINT_LM = LogLevel.CERR_HINT | CERR_LEXICAL_MODEL_MIN, - /* Place all LM compiler hints here! */ - - /* Errors that are not specific to the lexical model compiler, from comperr.h: */ - CWARN_TooManyErrorsOrWarnings = 0x20A7, -} - -/** - * Human-readable titles for the various log levels. - * - * Taken from https://github.com/keymanapp/keyman/blob/d83cfffe511ce65b781f919e89e3693146844849/windows/src/developer/TIKE/project/Keyman.Developer.System.Project.ProjectLog.pas#L39-L46 - */ -const LOG_LEVEL_TITLE: {[level in LogLevel]: string} = { - [LogLevel.CERR_HINT]: 'Hint', - [LogLevel.CERR_WARNING]: 'Warning', - [LogLevel.CERR_ERROR]: 'Error', - [LogLevel.CERR_FATAL]: 'Fatal Error', -}; - -/** - * How many errors or warnings are too many! - */ -export const MAX_MESSAGES = 100; - -/** - * Direct where log messages go. - */ -let _logHandler: (log: LogMessage) => void = printLogs; - -/** - * How many logs or warnings have been witnessed so far. - */ -let _messagesSeen = 0; - -/** - * Logs compiler messages (warnings, errors, logs). - * - * @param code Error code - * @param message A helpful message! - * @param source [optional] the filename/line number in the source that induced this error - * - * @see https://github.com/keymanapp/keyman/blob/99db3c0d2448f448242e6397f9d72e9a7ccee4b9/windows/src/developer/TIKE/project/Keyman.Developer.System.Project.ProjectLog.pas#L60-L77 - */ -export function log(code: KeymanCompilerError, message: string, source?: FilenameAndLineNo) { - // Ignore the request if there are too many messages - if (_messagesSeen > MAX_MESSAGES) - return; - - let logMessage = source - ? new LogMessageFromSource(code, message, source) - : new OrdinaryLogMessage(code, message); - - _logHandler(logMessage) - _messagesSeen++; - - if (_messagesSeen > MAX_MESSAGES) { - _logHandler(new OrdinaryLogMessage( - KeymanCompilerError.CWARN_TooManyErrorsOrWarnings, - `More than ${MAX_MESSAGES} warnings or errors received; suppressing further messages` - )); - } -} - -/** - * Override where log messages go. - * - * @param fn The desired log message handler. - */ -export function redirectLogMessagesTo(fn: (log: LogMessage) => void) { - _logHandler = fn; -} - -/** - * Reset the log message handler to the default. - */ -export function resetLogMessageHandler() { - _logHandler = printLogs; - _messagesSeen = 0; -} - -/** - * Prints log messages to stdout. The default log action. - */ -export function printLogs(log: LogMessage): void { - console.log(log.format()); -} - -/** - * Duct tapes together a filename and a line number of a log. - */ -interface FilenameAndLineNo { - readonly filename: string; - readonly lineno: number; -} - -/** - * A log message that knows how to format itself. - */ -export interface LogMessage { - readonly code: KeymanCompilerError; - readonly level: LogLevel; - readonly message: string; - - format(): string; -} - -/** - * Concrete implementation of the log message. - */ -class OrdinaryLogMessage implements LogMessage { - readonly code: KeymanCompilerError; - readonly message: string; - - constructor(code: KeymanCompilerError, message: string) { - this.code = code; - this.message = message; - } - - get level(): LogLevel { - return this.code & 0xF000; - } - - determineLogLevelTitle(): string { - return LOG_LEVEL_TITLE[this.level] || ''; - } - - format(): string { - let prefix = this.determineLogLevelTitle(); - if (prefix) - prefix = `${prefix}: `; - - return `${prefix}${h(this.code)} ${this.message}` - } -} - -/** - * A log message with a filename and line number. - */ -class LogMessageFromSource extends OrdinaryLogMessage { - readonly filename: string; - readonly lineno: number; - - constructor(code: KeymanCompilerError, message: string, source: FilenameAndLineNo) { - super(code, message); - this.filename = source.filename; - this.lineno = source.lineno; - } - - format(): string { - let originalMessage = super.format(); - return `${this.filename} (${this.lineno}): ${originalMessage}`; - } -} - -/** - * Format a number as a zero-padded 4 digit hexadecimal. - */ -function h(n: number) { - let formatted = n.toString(16).toUpperCase(); - if (formatted.length < 4) { - formatted = '0'.repeat(4 - formatted.length); - } - - return formatted; -} \ No newline at end of file diff --git a/developer/src/kmlmc/source/kmlmi.ts b/developer/src/kmlmc/source/kmlmi.ts deleted file mode 100644 index fc8534f5db4bda4f846d12b0cbe1fdeb0da8a2d1..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/source/kmlmi.ts +++ /dev/null @@ -1,73 +0,0 @@ -#!/usr/bin/env node -/** - * kmlmi - Keyman Lexical Model model_info Compiler - */ - -import * as program from 'commander'; -import * as fs from 'fs'; -import * as path from 'path'; -import KmpCompiler from './package-compiler/kmp-compiler'; -import { ModelInfoOptions as ModelInfoOptions, writeMergedModelMetadataFile } from './model-info-compiler/model-info-compiler'; -import { SysExits } from './util/sysexits'; -const KEYMAN_VERSION = require("@keymanapp/keyman-version").KEYMAN_VERSION; - -let inputFilename: string; - -/* Arguments */ -program - .description('Merges Keyman lexical model model_info files. Intended for use within the keymanapp/lexical-models repository.') - .version(KEYMAN_VERSION.VERSION_WITH_TAG) - .arguments('') - .action(infile => inputFilename = infile) - .option('-o, --outFile ', 'where to save the resultant file') - .option('-m, --model ', 'model id, defaults to basename of input file sans .model_info extension') - .option('-s, --source ', 'path to source of model, relative to lexical-models repo root') - .option('--kpsFilename ', 'path to .model.kps file, defaults to source/.model.kps') - .option('--kmpFilename ', 'path to .model.kmp file, defaults to build/.model.kmp') - .option('--jsFilename ', 'path to .model.js file, defaults to build/.model.js'); - -program.parse(process.argv); - -// Deal with input arguments: - -if (!inputFilename) { - exitDueToUsageError('Must provide a lexical model .model_info source file.'); -} - -let model_id: string = program.model ? program.model : path.basename(inputFilename).replace(/\.model_info$/, ""); -let outputFilename: string = program.outFile ? program.outFile : path.join(path.dirname(inputFilename), 'build', path.basename(inputFilename)); -let kpsFilename = program.kpsFilename ? program.kpsFilename : path.join(path.dirname(inputFilename), 'source', path.basename(inputFilename).replace(/\.model_info$/, '.model.kps')); -let kmpFilename = program.kmpFilename ? program.kmpFilename : path.join(path.dirname(inputFilename), 'build', path.basename(inputFilename).replace(/\.model_info$/, '.model.kmp')); -let jsFilename = program.jsFilename ? program.jsFilename : path.join(path.dirname(inputFilename), 'build', path.basename(inputFilename).replace(/\.model_info$/, '.model.js')); - -// -// Load .kps source data -// - -let kpsString: string = fs.readFileSync(kpsFilename, 'utf8'); -let kmpCompiler = new KmpCompiler(); -let kmpJsonData = kmpCompiler.transformKpsToKmpObject(kpsString, kpsFilename); - -// -// Write out the merged .model_info file -// - -let modelInfoOptions: ModelInfoOptions = { - model_id: model_id, - kmpJsonData: kmpJsonData, - sourcePath: program.source, - modelFileName: jsFilename, - kmpFileName: kmpFilename -}; - -writeMergedModelMetadataFile( - inputFilename, - outputFilename, - modelInfoOptions); - -function exitDueToUsageError(message: string): never { - console.error(`${program._name}: ${message}`); - console.error(); - program.outputHelp(); - return process.exit(SysExits.EX_USAGE); -} diff --git a/developer/src/kmlmc/source/kmlmp.ts b/developer/src/kmlmc/source/kmlmp.ts deleted file mode 100644 index eb3c59db4e9fec4744d5302573f34846203dc226..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/source/kmlmp.ts +++ /dev/null @@ -1,57 +0,0 @@ -#!/usr/bin/env node -/** - * kmlmp - Keyman Lexical Model Package Compiler - */ - -import * as program from 'commander'; -import * as fs from 'fs'; -import KmpCompiler from './package-compiler/kmp-compiler'; -import { SysExits } from './util/sysexits'; -const KEYMAN_VERSION = require("@keymanapp/keyman-version").KEYMAN_VERSION; - -let inputFilename: string; - -/* Arguments */ -program - .description('Compiles Keyman lexical model packages') - .version(KEYMAN_VERSION.VERSION_WITH_TAG) - .arguments('') - .action(infile => inputFilename = infile) - .option('-o, --outFile ', 'where to save the resultant file'); - -program.parse(process.argv); - -// Deal with input arguments: - -if (!inputFilename) { - exitDueToUsageError('Must provide a lexical model package source file.'); -} - -let outputFilename: string = program.outFile ? program.outFile : inputFilename.replace(/\.kps$/, ".kmp"); - -// -// Load .kps source data -// - -let kpsString: string = fs.readFileSync(inputFilename, 'utf8'); -let kmpCompiler = new KmpCompiler(); -let kmpJsonData = kmpCompiler.transformKpsToKmpObject(kpsString, inputFilename); - -// -// Build the .kmp package file -// - -let promise = kmpCompiler.buildKmpFile(kmpJsonData); -promise.then(data => { - fs.writeFileSync(outputFilename, data, 'binary'); -}).catch(error => { - // Consumer decides how to handle errors - console.error('Failed to write kmp file'); -}); - -function exitDueToUsageError(message: string): never { - console.error(`${program._name}: ${message}`); - console.error(); - program.outputHelp(); - return process.exit(SysExits.EX_USAGE); -} diff --git a/developer/src/kmlmc/source/package-compiler/kmp-compiler.ts b/developer/src/kmlmc/source/package-compiler/kmp-compiler.ts deleted file mode 100644 index f9297435d36c947c8cba02156dfafd7906890e92..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/source/package-compiler/kmp-compiler.ts +++ /dev/null @@ -1,163 +0,0 @@ -/// -/// - -import * as fs from 'fs'; -import * as path from 'path'; -import * as xml2js from 'xml2js'; -import * as JSZip from 'jszip'; - -let zip = JSZip(); - -export default class KmpCompiler { - - private kpsFilename: string; - - public transformKpsToKmpObject(kpsString: string, kpsFilename: string): KmpJsonFile { - - // Load the KPS data from XML as JS structured data. - - let kpsPackage = (() => { - let a: KpsPackage; - let parser = new xml2js.Parser({ - tagNameProcessors: [xml2js.processors.firstCharLowerCase], - explicitArray: false - }); - parser.parseString(kpsString, (e: unknown, r: unknown) => { a = r as KpsPackage }); - return a; - })(); - - let kps: KpsFile = kpsPackage.package; - - this.kpsFilename = kpsFilename; - - // - // To convert to kmp.json, we need to: - // - // 1. Unwrap arrays (and convert to array where single object) - // 2. Fix casing on `iD` - // 3. Rewrap info, keyboard.languages, lexicalModel.languages, startMenu.items elements - // 4. Remove options.followKeyboardVersion, file.fileType - // 5. Convert file.copyLocation to a Number - // 6. Filenames need to be basenames (but this comes after processing) - // - - // Helper functions - - let kpsInfoToKmpInfo = function (info: KpsFileInfo): KmpJsonFileInfo { - let ni: KmpJsonFileInfo = {}; - - let keys: (keyof KpsFileInfo)[] = ['author', 'copyright', 'name', 'version', 'website']; - for (let element of keys) { - if (info[element]) { - ni[element] = {description: info[element]._ || info[element].toString()}; - if(info[element].$ && info[element].$.URL) ni[element].url = info[element].$.URL; - } - } - return ni; - }; - - let arrayWrap = function(a: unknown) { - if (Array.isArray(a)) { - return a; - } - return [a]; - }; - - let kpsLanguagesToKmpLanguages = function(language: KpsFileLanguage[]): KmpJsonFileLanguage[] { - return language.map((element) => { return { name: element._, id: element.$.ID } }); - }; - - // Start to construct the kmp.json file from the .kps file - - let kmp: KmpJsonFile = { - system: kps.system, - options: {} - }; - - // Fill in additional fields - - let keys: (keyof KpsFileOptions & keyof KmpJsonFileOptions)[] = ['executeProgram', 'graphicFile', 'msiFilename', 'msiOptions', 'readmeFile']; - for (let element of keys) { - if (kps.options[element]) { - kmp.options[element] = kps.options[element]; - } - } - - if(kps.info) { - kmp.info = kpsInfoToKmpInfo(kps.info); - } - - if(kps.files && kps.files.file) { - kmp.files = arrayWrap(kps.files.file).map((file: KpsFileContentFile) => { - return { - name: file.name, - description: file.description, - copyLocation: parseInt(file.copyLocation, 10) - // note: we don't emit fileType as that is not permitted in kmp.json - } - }); - } - - if(kps.keyboards && kps.keyboards.keyboard) { - kmp.keyboards = arrayWrap(kps.keyboards.keyboard).map((keyboard: KpsFileKeyboard) => { - return { name:keyboard.name, id:keyboard.iD, version:keyboard.version, languages: kpsLanguagesToKmpLanguages(arrayWrap(keyboard.languages.language) as KpsFileLanguage[]) } - }); - } - - if(kps.lexicalModels && kps.lexicalModels.lexicalModel) { - kmp.lexicalModels = arrayWrap(kps.lexicalModels.lexicalModel).map((model: KpsFileLexicalModel) => { - return { name:model.name, id:model.iD, languages: kpsLanguagesToKmpLanguages(arrayWrap(model.languages.language) as KpsFileLanguage[]) } - }); - } - - if(kps.startMenu) { - kmp.startMenu = {}; - if(kps.startMenu.addUninstallEntry) kmp.startMenu.addUninstallEntry = kps.startMenu.addUninstallEntry === ''; - if(kps.startMenu.folder) kmp.startMenu.folder = kps.startMenu.folder; - if(kps.startMenu.items && kps.startMenu.items.item) kmp.startMenu.items = arrayWrap(kps.startMenu.items.item); - } - - if(kps.strings && kps.strings.string) { - kmp.strings = arrayWrap(kps.strings.string); - } - - //let util = require('util'); - //console.log(util.inspect(kmp, false, null)) - //console.log(kps); - - return kmp; - } - - /** - * Returns a Promise to the serialized data which can then be written to a .kmp file. - * - * @param kmpJsonData - The kmp.json Object - */ - public buildKmpFile(kmpJsonData: KmpJsonFile): Promise { - const kmpJsonFileName = 'kmp.json'; - - if(!kmpJsonData.files) { - kmpJsonData.files = []; - } - - const kpsPath = path.dirname(this.kpsFilename); - - kmpJsonData.files.forEach(function(value) { - // Make file path slashes compatible across platforms - const filename = value.name.replace(/\\/g, "/"); - const fullFilename = path.resolve(kpsPath, filename); - const baseFilename = path.basename(filename); - - const data = fs.readFileSync(fullFilename, 'utf8'); - zip.file(baseFilename, data); - - // Remove path data from files before save - value.name = baseFilename; - }); - - zip.file(kmpJsonFileName, JSON.stringify(kmpJsonData, null, 2)); - - // Generate kmp file - return zip.generateAsync({type: 'binarystring', compression:'DEFLATE'}); - } -} diff --git a/developer/src/kmlmc/tests/test-error-logger.ts b/developer/src/kmlmc/tests/test-error-logger.ts deleted file mode 100644 index ad0a3cbadbca20f579a351f1723f383c2b09a696..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/tests/test-error-logger.ts +++ /dev/null @@ -1,38 +0,0 @@ -import { MAX_MESSAGES, KeymanCompilerError, log } from "../dist/errors" -import { LogHoarder } from "./helpers" -import { assert } from "chai" - -describe('error logger', function () { - beforeEach(function () { - this.logHoarder = (new LogHoarder).install() - }) - - afterEach(function () { - this.logHoarder.uninstall(); - delete this.logHoarder; - }) - - it('should stop logging messages **after** a maximum', function () { - for (let i = 0; i < MAX_MESSAGES; i++) { - log(KeymanCompilerError.CWARN_DuplicateWordInSameFile, "fake error"); - } - - // We've logged *just enough messages. This error should not be found: - assert.isFalse(this.logHoarder.hasSeenCode( - KeymanCompilerError.CWARN_TooManyErrorsOrWarnings - )); - - // Log just one too many: - log(KeymanCompilerError.CWARN_DuplicateWordInSameFile, "fake error"); - - assert.isTrue(this.logHoarder.hasSeenCode( - KeymanCompilerError.CWARN_TooManyErrorsOrWarnings - )); - - // Log a DIFFERENT error -- it should not appear in the log - log(KeymanCompilerError.CWARN_MixedNormalizationForms, "fake error"); - assert.isFalse(this.logHoarder.hasSeenCode( - KeymanCompilerError.CWARN_MixedNormalizationForms - )); - }) -}) \ No newline at end of file diff --git a/developer/src/kmlmc/tests/test-package-compiler.ts b/developer/src/kmlmc/tests/test-package-compiler.ts deleted file mode 100644 index cc6752595a962b28856c5a8fbbe8120d0acf1d26..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/tests/test-package-compiler.ts +++ /dev/null @@ -1,72 +0,0 @@ -import 'mocha'; -import * as fs from 'fs'; -import * as JSZip from 'jszip'; -import {assert} from 'chai'; - -import KmpCompiler from '../dist/package-compiler/kmp-compiler'; -import {makePathToFixture} from './helpers'; - -let zip = JSZip(); - -describe('KmpCompiler', function () { - const MODELS = [ - 'example.qaa.sencoten', - 'withfolders.qaa.sencoten' - ]; - - let kmpCompiler = new KmpCompiler(); - - for (let modelID of MODELS) { - const kpsPath = modelID.includes('withfolders') ? - makePathToFixture(modelID, 'source', `${modelID}.model.kps`) : makePathToFixture(modelID, `${modelID}.model.kps`); - const jsPath = modelID.includes('withfolders') ? - makePathToFixture(modelID, 'source', `${modelID}.model.js`) : makePathToFixture(modelID, `${modelID}.model.js`); - const kmpJsonIntermediatePath = makePathToFixture(modelID, `${modelID}.model.kmp.intermediate.json`); - const kmpJsonZippedPath = makePathToFixture(modelID, `${modelID}.model.kmp.zipped.json`); - const kmpJsonIntermediateFixture = JSON.parse(fs.readFileSync(kmpJsonIntermediatePath, 'utf-8')); - const kmpJsonZippedFixture = JSON.parse(fs.readFileSync(kmpJsonZippedPath, 'utf-8')); - - // - // Test just the transform from kps to kmp.json - // - it(`should transform ${modelID}.model.kps to kmp.json`, function () { - let source = fs.readFileSync(kpsPath, 'utf-8'); - let kmpJson: KmpJsonFile; - - assert.doesNotThrow(() => { - kmpJson = kmpCompiler.transformKpsToKmpObject(source, kpsPath); - }); - - // Test that the kmp.json data is identical - assert.deepEqual(kmpJson, kmpJsonIntermediateFixture); - - // This was used when building initial test data - //fs.writeFileSync(kmpJsonPath, JSON.stringify(kmpJson), 'utf-8'); - }); - - it(`should build a full .kmp for ${modelID}`, async function() { - const source = fs.readFileSync(kpsPath, 'utf-8'); - // Build kmp.json in memory - const kmpJson: KmpJsonFile = kmpCompiler.transformKpsToKmpObject(source, kpsPath); - // Build file.kmp in memory - const promise = kmpCompiler.buildKmpFile(kmpJson); - promise.then(data => { - // Check that file.kmp contains just 2 files - kmp.json and file.model.js, - // and that they match exactly what we expect - return zip.loadAsync(data, {checkCRC32: true}).then(zipFile => { - assert.equal(zipFile.length, 2); - return Promise.all([ - zipFile.file("kmp.json").async('uint8array').then(kmpJsonOutput => { - assert.deepEqual(kmpJsonOutput, kmpJsonZippedFixture); - }), - zipFile.file(`${modelID}.model.js`).async('uint8array').then(modelJsFile => { - assert.deepEqual(modelJsFile, fs.readFileSync(jsPath)); - }) - ]); - }); - }); - - return promise; - }); - } -}); diff --git a/developer/src/kmlmc/tests/tsconfig.json b/developer/src/kmlmc/tests/tsconfig.json deleted file mode 100644 index 521ddc6c3ba5d30f8da190378c197cd427b01e83..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/tests/tsconfig.json +++ /dev/null @@ -1,23 +0,0 @@ -{ - "extends": "../../../../tsconfig-base.json", - - "compilerOptions": { - "module": "commonjs", - "moduleResolution": "node", - "noImplicitAny": true, - "sourceMap": true, - "rootDir": "./", - "outDir": "../dist-tests/" - }, - "include": [ - "**/test-*.ts", - "helpers/index.ts" - ], - "references": [ - { "path": "../../../../common/web/keyman-version" }, - { "path": "../../../../common/models/types" }, - { "path": "../../../../common/models/templates" }, - { "path": "../../../../common/models/wordbreakers" }, - { "path": "../"} - ] -} \ No newline at end of file diff --git a/developer/src/kmlmc/tsconfig.json b/developer/src/kmlmc/tsconfig.json deleted file mode 100644 index 37d642b8c1942a231dfb83c3c8fa03423fde7a7a..0000000000000000000000000000000000000000 --- a/developer/src/kmlmc/tsconfig.json +++ /dev/null @@ -1,29 +0,0 @@ -{ - "extends": "../../../tsconfig-base.json", - - "compilerOptions": { - "module": "commonjs", - "target": "es2017", - "moduleResolution": "node", - "sourceMap": true, - "outDir": "dist/", - "rootDir": "source/", - "declaration": true, - "alwaysStrict": true, - "noImplicitThis": true, - "noImplicitReturns": true, - "noImplicitAny": true, - "strictBindCallApply": true, - "strictFunctionTypes": true, - "noUnusedLocals": true - }, - "include": [ - "source/**/*.ts" - ], - "references": [ - { "path": "../../../common/web/keyman-version" }, - { "path": "../../../common/models/types" }, - { "path": "../../../common/models/templates" }, - { "path": "../../../common/models/wordbreakers" }, - ] -} diff --git a/developer/src/server/build-addins.inc.sh b/developer/src/server/build-addins.inc.sh index 8be52595ac9262728419605f4a9a9a3bda1e42ea..cce1e9ae6f00d772a716abb12bf8634fb051572a 100644 --- a/developer/src/server/build-addins.inc.sh +++ b/developer/src/server/build-addins.inc.sh @@ -57,10 +57,10 @@ build_addins() { # if (( NODEX64 )); then - [[ $(isFileX64 "$TRAYICON_TARGET") == 1 ]] || die "$TRAYICON_TARGET should be 64-bit" - [[ $(isFileX64 "$HIDECONSOLE_TARGET") == 1 ]] || die "$HIDECONSOLE_TARGET should be 64-bit" + [[ $(isFileX64 "$TRAYICON_TARGET") == 1 ]] || builder_die "$TRAYICON_TARGET should be 64-bit" + [[ $(isFileX64 "$HIDECONSOLE_TARGET") == 1 ]] || builder_die "$HIDECONSOLE_TARGET should be 64-bit" else - [[ $(isFileX64 "$TRAYICON_TARGET") == 0 ]] || die "$TRAYICON_TARGET should not be 64-bit" - [[ $(isFileX64 "$HIDECONSOLE_TARGET") == 0 ]] || die "$HIDECONSOLE_TARGET should not be 64-bit" + [[ $(isFileX64 "$TRAYICON_TARGET") == 0 ]] || builder_die "$TRAYICON_TARGET should not be 64-bit" + [[ $(isFileX64 "$HIDECONSOLE_TARGET") == 0 ]] || builder_die "$HIDECONSOLE_TARGET should not be 64-bit" fi } diff --git a/developer/src/server/build.sh b/developer/src/server/build.sh index f2506845823d74c52433afb3a40926410848d883..53585f1df6b567f62a912e47239d8177c2aa8a22 100755 --- a/developer/src/server/build.sh +++ b/developer/src/server/build.sh @@ -8,8 +8,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE EX_USAGE=64 @@ -20,7 +20,7 @@ pushd "$(dirname "$THIS_SCRIPT")" # Build the main script. build () { - npm run build || fail "Could not build top-level JavaScript file." + npm run build || builder_die "Could not build top-level JavaScript file." } display_usage ( ) { @@ -93,7 +93,7 @@ done # Check if Node.JS/npm is installed. type npm >/dev/null ||\ - fail "Build environment setup error detected! Please ensure Node.js is installed!" + builder_die "Build environment setup error detected! Please ensure Node.js is installed!" if (( install_dependencies )) ; then verify_npm_setup @@ -148,7 +148,7 @@ fi # Build the project # ---------------------------------------- -npm run build || fail "Compilation failed." +npm run build || builder_die "Compilation failed." echo "Typescript compilation successful." # ---------------------------------------- @@ -156,7 +156,7 @@ echo "Typescript compilation successful." # ---------------------------------------- if (( run_tests )); then - npm test || fail "Tests failed" + npm test || builder_die "Tests failed" fi # ---------------------------------------- diff --git a/developer/src/server/package.json b/developer/src/server/package.json index 16898edaebac79f443461600c435f8152fd9ac80..dd779db1a4dc507a90c505931fa08a5bec279001 100644 --- a/developer/src/server/package.json +++ b/developer/src/server/package.json @@ -35,9 +35,9 @@ "chai": "^4.3.4", "copyfiles": "^2.4.1", "mocha": "^10.0.0", - "ts-node": "^10.4.0", + "ts-node": "^10.9.1", "tsc-watch": "^4.5.0", - "typescript": "^4.5.4" + "typescript": "^4.9.5" }, "mocha": { "require": "ts-node/register", diff --git a/developer/src/server/postbuild.sh b/developer/src/server/postbuild.sh index d9683ee4bfd24a8e86db3651f393cb904b9fe83a..e4b90e7e50bbd80ca4581ac8ec03047eb60af354 100755 --- a/developer/src/server/postbuild.sh +++ b/developer/src/server/postbuild.sh @@ -8,8 +8,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" diff --git a/developer/src/server/tsconfig.json b/developer/src/server/tsconfig.json index 14932564aaf476be55e6530e915a85158889d0f3..280b535dd9e8fa260851d54c49040d9444df3a0e 100644 --- a/developer/src/server/tsconfig.json +++ b/developer/src/server/tsconfig.json @@ -3,7 +3,7 @@ "compilerOptions": { "module": "commonjs", - "target": "es2017", + "target": "es2022", "moduleResolution": "node", "sourceMap": true, "outDir": "dist/", @@ -15,7 +15,8 @@ "noImplicitAny": true, "strictBindCallApply": true, "strictFunctionTypes": true, - "noUnusedLocals": true + "noUnusedLocals": true, + "lib": ["es2022"] }, "include": [ "src/**/*.ts" diff --git a/developer/src/test/auto/Makefile b/developer/src/test/auto/Makefile index cf14e7cf1834c28e4e6df43e83dac3f1b99e3f12..ebbdf290160a8222ffcdda4a7c821c28bacc7d4b 100644 --- a/developer/src/test/auto/Makefile +++ b/developer/src/test/auto/Makefile @@ -23,9 +23,13 @@ developer-tests: \ kmcomp-x64-structures \ kmconvert \ kmx-file-languages \ - lexical-model-compiler \ model-ts-parser \ - package-info + package-info \ + kmc \ + kmc-ldml \ + kmc-model \ + kmc-model-info \ + kmc-package # ---------------------------------------------------------------------- @@ -66,11 +70,6 @@ kmconvert: .virtual cd $(DEVELOPER_ROOT)\src\test\auto\kmconvert $(MAKE) $(TARGET) -lexical-model-compiler: .virtual -# TODO: move this to a test target in kmlmc - cd $(DEVELOPER_ROOT)\src\kmlmc - $(GIT_BASH_FOR_KEYMAN) build.sh -test - model-ts-parser: .virtual rem TODO # cd $(DEVELOPER_ROOT)\src\test\auto\model-ts-parser @@ -80,6 +79,30 @@ package-info: .virtual cd $(DEVELOPER_ROOT)\src\test\auto\package-info $(MAKE) $(TARGET) +# ---------------------------------------------------------------------- +# Tests outside the test/auto folder +# ---------------------------------------------------------------------- + +kmc: .virtual + cd $(DEVELOPER_ROOT)\src\kmc + $(MAKE) $(TARGET) + +kmc-ldml: .virtual + cd $(DEVELOPER_ROOT)\src\kmc-ldml + $(MAKE) $(TARGET) + +kmc-model: .virtual + cd $(DEVELOPER_ROOT)\src\kmc-model + $(MAKE) $(TARGET) + +kmc-model-info: .virtual + cd $(DEVELOPER_ROOT)\src\kmc-model-info + $(MAKE) $(TARGET) + +kmc-package: .virtual + cd $(DEVELOPER_ROOT)\src\kmc-package + $(MAKE) $(TARGET) + # ---------------------------------------------------------------------- !include ..\..\Target.mak diff --git a/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dpr b/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dpr index bfe61aa975b613b8dd7d7949faa62670ea5a8726..6122f21916e99e73a7e6b78d711c0f98c5100c97 100644 --- a/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dpr +++ b/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dpr @@ -39,7 +39,6 @@ uses VKeys in '..\..\..\..\..\common\windows\delphi\general\VKeys.pas', ErrorControlledRegistry in '..\..\..\..\..\common\windows\delphi\vcl\ErrorControlledRegistry.pas', kmxfile in '..\..\..\..\..\common\windows\delphi\keyboards\kmxfile.pas', - CRC32 in '..\..\..\..\..\common\windows\delphi\general\CRC32.pas', KeyNames in '..\..\..\..\..\common\windows\delphi\general\KeyNames.pas', KeymanDeveloperOptions in '..\..\..\tike\main\KeymanDeveloperOptions.pas', Keyman.System.PackageInfoRefreshKeyboards in '..\..\..\common\delphi\packages\Keyman.System.PackageInfoRefreshKeyboards.pas', diff --git a/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dproj b/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dproj index c1d5645e4046010a4a0814fd2cb76357f4c047d9..3bbafa79bf8c084abc62a7b6349c317600bcb211 100644 --- a/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dproj +++ b/developer/src/test/auto/keyboard-package-versions/KeyboardPackageVersionsTestSuite.dproj @@ -120,7 +120,6 @@ - diff --git a/developer/src/test/auto/kmcomp/test.bat b/developer/src/test/auto/kmcomp/test.bat index 0fbaefa7f26fd8827be74e1491069e8f8e3da745..808c2f9068b3260fa6f2fcd30386d6072c5fccfb 100644 --- a/developer/src/test/auto/kmcomp/test.bat +++ b/developer/src/test/auto/kmcomp/test.bat @@ -143,26 +143,38 @@ echo %BLUE%TEST: %1 %WHITE% if exist error.log del error.log "%compiler%" -no-color -nologo -ss -w tests.kpj -t "%2" > error.log if !ERRORLEVEL! GTR 0 ( + echo %RED%FAILED: expected %2 to be a valid keyboard.%WHITE% 1>&2 + echo --------------------------------------------------------------------------- + echo %BLUE%## error.log%WHITE% type error.log + echo --------------------------------------------------------------------------- del error.log - echo %RED%FAILED: expected %2 to be a valid keyboard.%WHITE% 1>&2 exit /b 1 ) if "!outfile!" == "" ( findstr /L /C:%3 error.log > nul if !ERRORLEVEL! GTR 0 ( + echo %RED%FAILED: expected compile results to contain message %3.%WHITE% 1>&2 + echo --------------------------------------------------------------------------- + echo %BLUE%## error.log%WHITE% type error.log + echo --------------------------------------------------------------------------- del error.log - echo %RED%FAILED: expected compile results to contain message %3.%WHITE% 1>&2 exit /b 1 ) ) else ( fc error.log !outfile! > nul if !ERRORLEVEL! GTR 0 ( + echo %RED%FAILED: expected output in error.log did not match !outfile!.%WHITE% 1>&2 + echo --------------------------------------------------------------------------- + echo %BLUE%## error.log%WHITE% type error.log + echo --------------------------------------------------------------------------- + echo %BLUE%## !outfile!%WHITE% + type !outfile! + echo --------------------------------------------------------------------------- del error.log - echo %RED%FAILED: expected output in error.log did not match !outfile!.%WHITE% 1>&2 exit /b 1 ) ) diff --git a/developer/src/test/auto/kmcomp/test_194_Filename_case.kvk b/developer/src/test/auto/kmcomp/test_194_Filename_case.kvk index 2d494cfc2e61ff74440731f29a77ea42c37b2d6d..a46a1fffae959d0c39646bdc37b3c9a105f5911e 100644 Binary files a/developer/src/test/auto/kmcomp/test_194_Filename_case.kvk and b/developer/src/test/auto/kmcomp/test_194_Filename_case.kvk differ diff --git a/developer/src/test/auto/kmx-file-languages/KMXFileLanguagesTestSuite.dpr b/developer/src/test/auto/kmx-file-languages/KMXFileLanguagesTestSuite.dpr index aef131a3b0ad3cea3fb62476f4e58400ebf26311..9e169bf18b22ffed27992cd2d011d718de9c4ba2 100644 --- a/developer/src/test/auto/kmx-file-languages/KMXFileLanguagesTestSuite.dpr +++ b/developer/src/test/auto/kmx-file-languages/KMXFileLanguagesTestSuite.dpr @@ -13,7 +13,6 @@ uses DUnitX.TestFramework, Keyman.System.KMXFileLanguages in '..\..\..\common\delphi\keyboards\Keyman.System.KMXFileLanguages.pas', kmxfile in '..\..\..\..\..\common\windows\delphi\keyboards\kmxfile.pas', - CRC32 in '..\..\..\..\..\common\windows\delphi\general\CRC32.pas', KeyNames in '..\..\..\..\..\common\windows\delphi\general\KeyNames.pas', utildir in '..\..\..\..\..\common\windows\delphi\general\utildir.pas', utilfiletypes in '..\..\..\..\..\common\windows\delphi\general\utilfiletypes.pas', diff --git a/developer/src/test/auto/kmx-file-languages/KMXFileLanguagesTestSuite.dproj b/developer/src/test/auto/kmx-file-languages/KMXFileLanguagesTestSuite.dproj index 8c2fcb37ee924e547bcdf1abdbb16e8ca8d4b9da..3dfc3123141cfe20a596fee36015dc312a242d88 100644 --- a/developer/src/test/auto/kmx-file-languages/KMXFileLanguagesTestSuite.dproj +++ b/developer/src/test/auto/kmx-file-languages/KMXFileLanguagesTestSuite.dproj @@ -93,7 +93,6 @@ - diff --git a/developer/src/tike/Makefile b/developer/src/tike/Makefile index c58816384c94226ae7a9b1d89a6b4727539690ba..ce20a3673c6b4306646819111c14cd02b401f282 100644 --- a/developer/src/tike/Makefile +++ b/developer/src/tike/Makefile @@ -11,6 +11,9 @@ build: version.res manifest.res icons dirs xml xsd pull-core $(TDS2DBG) $(WIN32_TARGET_PATH)\tike.exe $(COPY) $(WIN32_TARGET_PATH)\tike.exe $(DEVELOPER_PROGRAM) $(COPY) kmlmc.cmd $(DEVELOPER_PROGRAM) + $(COPY) kmlmi.cmd $(DEVELOPER_PROGRAM) + $(COPY) kmlmp.cmd $(DEVELOPER_PROGRAM) + $(COPY) kmc.cmd $(DEVELOPER_PROGRAM) $(COPY) $(KEYMAN_ROOT)\core\build\x86\$(TARGET_PATH)\src\kmnkbp0-0.dll $(DEVELOPER_PROGRAM) if exist $(WIN32_TARGET_PATH)\tike.dbg $(COPY) $(WIN32_TARGET_PATH)\tike.dbg $(DEVELOPER_DEBUGPATH) @@ -31,15 +34,15 @@ pull-core: cd $(KEYMAN_ROOT)\core !ifdef GIT_BASH_FOR_KEYMAN !ifdef DEBUG - $(GIT_BASH_FOR_KEYMAN) build.sh --debug + $(GIT_BASH_FOR_KEYMAN) build.sh --no-tests clean:x86 configure:x86 build:x86 --debug !else - $(GIT_BASH_FOR_KEYMAN) build.sh + $(GIT_BASH_FOR_KEYMAN) build.sh --no-tests clean:x86 configure:x86 build:x86 !endif !else !ifdef DEBUG - start /wait ./build.sh --debug + start /wait ./build.sh --no-tests clean:x86 configure:x86 build:x86 --debug !else - start /wait ./build.sh + start /wait ./build.sh --no-tests clean:x86 configure:x86 build:x86 !endif !endif @@ -65,6 +68,10 @@ clean: def-clean signcode: $(SIGNCODE) /d "Keyman Developer" $(DEVELOPER_PROGRAM)\tike.exe $(SIGNCODE) /d "Keyman Core" $(DEVELOPER_PROGRAM)\kmnkbp0-0.dll +# Sign the Sentry executables and libraries here + $(SIGNCODE) /d "Keyman Developer" $(DEVELOPER_PROGRAM)\sentry.dll + $(SIGNCODE) /d "Keyman Developer" $(DEVELOPER_PROGRAM)\sentry.x64.dll + $(SIGNCODE) /d "Keyman Developer" $(DEVELOPER_PROGRAM)\crashpad_handler.exe wrap-symbols: $(SYMSTORE) $(DEVELOPER_PROGRAM)\tike.exe /t keyman-developer diff --git a/developer/src/tike/child/UfrmDebug.pas b/developer/src/tike/child/UfrmDebug.pas index 3c3534aab89c3082cac1e1864e55e9ab54b32de3..615cfebc809075989d9aa7ce7d1d464990221839 100644 --- a/developer/src/tike/child/UfrmDebug.pas +++ b/developer/src/tike/child/UfrmDebug.pas @@ -476,7 +476,7 @@ begin if not SetKeyEventContext then Exit(False); - if km_kbp_process_event(FDebugCore.State, vkey, modifier, 1) = KM_KBP_STATUS_OK then + if km_kbp_process_event(FDebugCore.State, Message.WParam, modifier, 1, KM_KBP_EVENT_FLAG_DEFAULT) = KM_KBP_STATUS_OK then begin // Process keystroke -- true = swallow keystroke Result := True; diff --git a/developer/src/tike/compile/keyman32_int.pas b/developer/src/tike/compile/keyman32_int.pas deleted file mode 100644 index 37ddbe93475c8994379563db135fcb7371618ba7..0000000000000000000000000000000000000000 --- a/developer/src/tike/compile/keyman32_int.pas +++ /dev/null @@ -1,108 +0,0 @@ -unit keyman32_int; - -interface - -uses Windows, SysUtils, Forms; - -function Keyman_Initialise(Handle: HWND; FSingleApp: Boolean): Boolean; -function Keyman_Exit: Boolean; -function Keyman_ForceKeyboard(const s: string): Boolean; -function Keyman_StopForcingKeyboard: Boolean; - -implementation - -uses TikeUtils; - -type TKeyman_ForceKeyboard = function (s: PChar): Boolean; stdcall; -type TKeyman_StopForcingKeyboard = function: Boolean; stdcall; -type TKeyman_Initialise = function(h: THandle; FSingleApp: LongBool): Boolean; stdcall; -type TKeyman_Exit = function: Boolean; stdcall; - -var - FInitKeyman: Boolean = False; - FKeyman32Path: string = ''; - -function Keyman_Initialise(Handle: HWND; FSingleApp: Boolean): Boolean; -var - hkeyman: THandle; - FLoad: Boolean; - ki: TKeyman_Initialise; -begin - Result := False; - FLoad := False; - hkeyman := GetModuleHandle('keyman32.dll'); - if hkeyman = 0 then - begin - hkeyman := LoadLibrary(PChar(GetKeymanInstallPath+'keyman32.dll')); - if hkeyman = 0 then Exit; - FLoad := True; - end; - ki := TKeyman_Initialise(GetProcAddress(hkeyman, 'Keyman_Initialise')); - if not Assigned(@ki) then Exit; - if not ki(Handle, FSingleApp) then - begin - if FLoad then FreeLibrary(hkeyman); - Exit; - end; - - FInitKeyman := True; - Result := True; -end; - -function Keyman_Exit: Boolean; -var - hkeyman: THandle; - ke: TKeyman_Exit; -begin - if not FInitKeyman then - begin - Result := True; - Exit; - end; - Result := False; - hkeyman := GetModuleHandle('keyman32.dll'); - if hkeyman = 0 then Exit; - ke := TKeyman_Exit(GetProcAddress(hkeyman, 'Keyman_Exit')); - if not Assigned(@ke) then Exit; - if not ke then Exit; - if FInitKeyman then FreeLibrary(hkeyman); - FInitKeyman := False; - Result := True; -end; - -function Keyman_ForceKeyboard(const s: string): Boolean; -var - hkeyman: THandle; - fk: TKeyman_ForceKeyboard; -begin - Result := False; - hkeyman := GetModuleHandle('keyman32.dll'); - if hkeyman = 0 then - begin - if not Keyman_Initialise(Application.MainForm.Handle, True) then Exit; - hkeyman := GetModuleHandle('keyman32.dll'); - if hkeyman = 0 then Exit; - end; - fk := TKeyman_ForceKeyboard(GetProcAddress(hkeyman, 'Keyman_ForceKeyboard')); - if(Assigned(@fk)) then - Result := fk(PChar(s)); -end; - -function Keyman_StopForcingKeyboard: Boolean; -var - hkeyman: THandle; - sfk: TKeyman_StopForcingKeyboard; -begin - Result := False; - hkeyman := GetModuleHandle('keyman32.dll'); - if hkeyman = 0 then Exit; - sfk := TKeyman_StopForcingKeyboard(GetProcAddress(hkeyman, 'Keyman_StopForcingKeyboard')); - if(Assigned(@sfk)) then - Result := sfk; - Keyman_Exit; -end; - -initialization -finalization - Keyman_Exit; -end. diff --git a/developer/src/tike/dialogs/UfrmOptions.dfm b/developer/src/tike/dialogs/UfrmOptions.dfm index 5968496f38e62dbc14b66ee29bca4aa751dadde7..d20db381fd77cb69b121c18ec52477107ede8a16 100644 --- a/developer/src/tike/dialogs/UfrmOptions.dfm +++ b/developer/src/tike/dialogs/UfrmOptions.dfm @@ -30,7 +30,7 @@ inherited frmOptions: TfrmOptions Width = 125 Height = 25 Caption = '&Proxy Settings...' - TabOrder = 4 + TabOrder = 5 OnClick = cmdProxySettingsClick end object gbExternalEditor: TGroupBox @@ -39,7 +39,7 @@ inherited frmOptions: TfrmOptions Width = 401 Height = 45 Caption = '&External Editor Path' - TabOrder = 1 + TabOrder = 2 object editExternalEditorPath: TEdit Left = 8 Top = 16 @@ -62,7 +62,7 @@ inherited frmOptions: TfrmOptions Width = 125 Height = 25 Caption = 'S&MTP Settings...' - TabOrder = 3 + TabOrder = 6 OnClick = cmdSMTPSettingsClick end object chkOpenKeyboardFilesInSourceView: TCheckBox @@ -71,7 +71,7 @@ inherited frmOptions: TfrmOptions Width = 221 Height = 17 Caption = 'Open &keyboard files in source view' - TabOrder = 0 + TabOrder = 1 end object cmdResetToolWindows: TButton Left = 8 @@ -79,7 +79,7 @@ inherited frmOptions: TfrmOptions Width = 125 Height = 25 Caption = '&Reset tool windows' - TabOrder = 2 + TabOrder = 4 OnClick = cmdResetToolWindowsClick end object chkAllowMultipleInstances: TCheckBox @@ -88,7 +88,7 @@ inherited frmOptions: TfrmOptions Width = 289 Height = 17 Caption = '&Allow multiple instances of Keyman Developer' - TabOrder = 5 + TabOrder = 0 end object gbDefaultProjectPath: TGroupBox Left = 8 @@ -96,7 +96,7 @@ inherited frmOptions: TfrmOptions Width = 401 Height = 45 Caption = '&Default Project Folder' - TabOrder = 6 + TabOrder = 3 object editDefaultProjectPath: TEdit Left = 8 Top = 16 @@ -136,14 +136,14 @@ inherited frmOptions: TfrmOptions Width = 401 Height = 73 Caption = 'Privacy' - TabOrder = 9 + TabOrder = 10 object chkReportUsage: TCheckBox Left = 8 Top = 44 Width = 311 Height = 17 Caption = '&Share anonymous usage statistics with keyman.com' - TabOrder = 0 + TabOrder = 1 end object chkReportErrors: TCheckBox Left = 8 @@ -151,9 +151,17 @@ inherited frmOptions: TfrmOptions Width = 311 Height = 17 Caption = 'Automatically report &errors to keyman.com' - TabOrder = 1 + TabOrder = 0 end end + object chkUseLegacyCompiler: TCheckBox + Left = 152 + Top = 244 + Width = 250 + Height = 17 + Caption = 'Use legacy .kmn compiler (removing in 18.0)' + TabOrder = 9 + end end object tabEditor: TTabSheet Caption = 'Editor' diff --git a/developer/src/tike/dialogs/UfrmOptions.pas b/developer/src/tike/dialogs/UfrmOptions.pas index 77aa090ea2f6f27e18cea8bd201322965132158d..3976e6ceb572971856d5b400c09fcc648ac73226 100644 --- a/developer/src/tike/dialogs/UfrmOptions.pas +++ b/developer/src/tike/dialogs/UfrmOptions.pas @@ -105,6 +105,7 @@ type gbServer: TGroupBox; chkListLocalURLs: TCheckBox; cmdConfigureServer: TButton; + chkUseLegacyCompiler: TCheckBox; procedure FormCreate(Sender: TObject); procedure cmdOKClick(Sender: TObject); procedure cmdDefaultFontClick(Sender: TObject); @@ -194,6 +195,8 @@ begin chkAutoSaveBeforeCompiling.Checked := AutoSaveBeforeCompiling; chkOSKAutoSaveBeforeImporting.Checked := OSKAutoSaveBeforeImporting; + chkUseLegacyCompiler.Checked := UseLegacyCompiler; + chkCharMapAutoLookup.Checked := CharMapAutoLookup; chkCharMapDisableDatabaseLookups.Checked := CharMapDisableDatabaseLookups; @@ -295,6 +298,8 @@ begin AutoSaveBeforeCompiling := chkAutoSaveBeforeCompiling.Checked; OSKAutoSaveBeforeImporting := chkOSKAutoSaveBeforeImporting.Checked; + UseLegacyCompiler := chkUseLegacyCompiler.Checked; + ServerUseLocalAddresses := chkListLocalURLs.Checked; CharMapAutoLookup := chkCharMapAutoLookup.Checked; diff --git a/developer/src/tike/kmc.cmd b/developer/src/tike/kmc.cmd new file mode 100644 index 0000000000000000000000000000000000000000..a25878b4168b5e8f620a513d36d97cf64a62eec1 --- /dev/null +++ b/developer/src/tike/kmc.cmd @@ -0,0 +1,20 @@ +@echo off +setlocal +rem This script is based on /developer/src/node/inst/kmc.cmd. It is stored here +rem in order to allow TIKE to call out to the compiler while debugging. +if exist "%~dp0..\inst\node\dist\node.exe" ( + rem If running in developer/src/tike/: + set nodeexe="%~dp0..\inst\node\dist\node.exe" + set nodecli="%~dp0..\kmc\build\src\kmc.js" +) else if exist "%~dp0..\src\inst\node\dist\node.exe" ( + rem If running in developer/bin/: + set nodeexe="%~dp0..\src\inst\node\dist\node.exe" + set nodecli="%~dp0..\src\kmc\build\src\kmc.js" +) else ( + rem Cannot find node or kmc.js relative to execution path + echo Error: node.exe or kmc.js not found. + exit /b 1 +) + +%nodeexe% --enable-source-maps %nodecli% %* +exit /b %errorlevel% diff --git a/developer/src/tike/kmlmc.cmd b/developer/src/tike/kmlmc.cmd index 5572fbeb945181a0be5d19d20d4bc2cde5529365..4f86f2e3bd04da59685f7eefc8b72f030c384a36 100644 --- a/developer/src/tike/kmlmc.cmd +++ b/developer/src/tike/kmlmc.cmd @@ -1,20 +1,20 @@ @echo off setlocal -rem This script is a rough duplicate of /developer/src/node/inst/kmlmc.cmd. It is stored here +rem This script is based on /developer/src/node/inst/kmlmc.cmd. It is stored here rem in order to allow TIKE to call out to the compiler while debugging. if exist "%~dp0..\inst\node\dist\node.exe" ( - rem If running in windows/src/developer/x/: + rem If running in developer/src/tike/: set nodeexe="%~dp0..\inst\node\dist\node.exe" - set nodecli="%~dp0..\kmlmc\dist\kmlmc.js" + set nodecli="%~dp0..\kmc\build\src\kmlmc.js" ) else if exist "%~dp0..\src\inst\node\dist\node.exe" ( - rem If running in windows/bin/developer/: + rem If running in developer/bin/: set nodeexe="%~dp0..\src\inst\node\dist\node.exe" - set nodecli="%~dp0..\src\kmlmc\dist\kmlmc.js" + set nodecli="%~dp0..\src\kmc\build\src\kmlmc.js" ) else ( rem Cannot find node or kmlmc.js relative to execution path echo Error: node.exe or kmlmc.js not found. exit /b 1 ) -%nodeexe% %nodecli% %* +%nodeexe% --enable-source-maps %nodecli% %* exit /b %errorlevel% diff --git a/developer/src/tike/kmlmi.cmd b/developer/src/tike/kmlmi.cmd index 197e04f3933638093e69e49498831738ee53579a..32f6a256a95cb7947aeba9ab1a2cc33be1633e42 100644 --- a/developer/src/tike/kmlmi.cmd +++ b/developer/src/tike/kmlmi.cmd @@ -1,20 +1,20 @@ @echo off setlocal -rem This script is a rough duplicate of /developer/src/node/inst/kmlmi.cmd. It is stored here +rem This script is based on /developer/src/node/inst/kmlmi.cmd. It is stored here rem in order to allow TIKE to call out to the compiler while debugging. -if exist "%~dp0..\..\..\..\developer\src\inst\node\dist\node.exe" ( - rem If running in windows/src/developer/x/: - set nodeexe="%~dp0..\..\..\..\developer\src\inst\node\dist\node.exe" - set nodecli="%~dp0..\..\..\..\developer\src\kmlmc\dist\kmlmi.js" -) else if exist "%~dp0..\..\..\developer\src\inst\node\dist\node.exe" ( - rem If running in windows/bin/developer/: - set nodeexe="%~dp0..\..\..\developer\src\inst\node\dist\node.exe" - set nodecli="%~dp0..\..\..\developer\src\kmlmc\dist\kmlmi.js" +if exist "%~dp0..\inst\node\dist\node.exe" ( + rem If running in developer/src/tike/: + set nodeexe="%~dp0..\inst\node\dist\node.exe" + set nodecli="%~dp0..\kmc\build\src\kmlmi.js" +) else if exist "%~dp0..\src\inst\node\dist\node.exe" ( + rem If running in developer/bin/: + set nodeexe="%~dp0..\src\inst\node\dist\node.exe" + set nodecli="%~dp0..\src\kmc\build\src\kmlmi.js" ) else ( rem Cannot find node or kmlmi.js relative to execution path echo Error: node.exe or kmlmi.js not found. exit /b 1 ) -%nodeexe% %nodecli% %* +%nodeexe% --enable-source-maps %nodecli% %* exit /b %errorlevel% diff --git a/developer/src/tike/kmlmp.cmd b/developer/src/tike/kmlmp.cmd index e9c28eba57ecab7b49cc94cac5e913ce1f0b8721..716a5bf94019e99261ae2924b9e43d0779ac1a20 100644 --- a/developer/src/tike/kmlmp.cmd +++ b/developer/src/tike/kmlmp.cmd @@ -1,20 +1,20 @@ @echo off setlocal -rem This script is a rough duplicate of /developer/src/node/inst/kmlmp.cmd. It is stored here +rem This script is based on /developer/src/node/inst/kmlmp.cmd. It is stored here rem in order to allow TIKE to call out to the compiler while debugging. -if exist "%~dp0..\..\..\..\developer\src\inst\node\dist\node.exe" ( - rem If running in windows/src/developer/x/: - set nodeexe="%~dp0..\..\..\..\developer\src\inst\node\dist\node.exe" - set nodecli="%~dp0..\..\..\..\developer\src\kmlmc\dist\kmlmp.js" -) else if exist "%~dp0..\..\..\developer\src\inst\node\dist\node.exe" ( - rem If running in windows/bin/developer/: - set nodeexe="%~dp0..\..\..\developer\src\inst\node\dist\node.exe" - set nodecli="%~dp0..\..\..\developer\src\kmlmc\dist\kmlmp.js" +if exist "%~dp0..\inst\node\dist\node.exe" ( + rem If running in developer/src/tike/: + set nodeexe="%~dp0..\inst\node\dist\node.exe" + set nodecli="%~dp0..\kmc\build\src\kmlmp.js" +) else if exist "%~dp0..\src\inst\node\dist\node.exe" ( + rem If running in developer/bin/: + set nodeexe="%~dp0..\src\inst\node\dist\node.exe" + set nodecli="%~dp0..\src\kmc\build\src\kmlmp.js" ) else ( rem Cannot find node or kmlmp.js relative to execution path echo Error: node.exe or kmlmp.js not found. exit /b 1 ) -%nodeexe% %nodecli% %* +%nodeexe% --enable-source-maps %nodecli% %* exit /b %errorlevel% diff --git a/developer/src/tike/main/Keyman.System.KeymanCore.pas b/developer/src/tike/main/Keyman.System.KeymanCore.pas index f89d1d79b29662d5614635f2e33ba38f7774ce46..29a2341b182eebccdc8db53c9a2cddacdd58627a 100644 --- a/developer/src/tike/main/Keyman.System.KeymanCore.pas +++ b/developer/src/tike/main/Keyman.System.KeymanCore.pas @@ -312,9 +312,14 @@ km_kbp_process_event( state: pkm_kbp_state; vk: km_kbp_virtual_key; modifier_state: uint16_t; - is_key_down: uint8_t + is_key_down: uint8_t; + event_flags: uint16_t ): km_kbp_status; cdecl; external kmnkbp0 delayed; +const + KM_KBP_EVENT_FLAG_DEFAULT = 0; // default value: hardware + KM_KBP_EVENT_FLAG_TOUCH = 1; // set if the event is touch, otherwise hardware + // keyboardprocessor_vkeys.h diff --git a/developer/src/tike/main/Keyman.System.VisualKeyboardImportKMX.pas b/developer/src/tike/main/Keyman.System.VisualKeyboardImportKMX.pas index b1536bd0a8463c618663374e5f9483cfa1427d7d..e36216e1559f08edf8efa3ac01fcac690a9cbd3a 100644 --- a/developer/src/tike/main/Keyman.System.VisualKeyboardImportKMX.pas +++ b/developer/src/tike/main/Keyman.System.VisualKeyboardImportKMX.pas @@ -110,7 +110,7 @@ var begin context := km_kbp_state_context(FCore.State); km_kbp_context_clear(context); - if km_kbp_process_event(FCore.State, vk.vkey, vk.kmshift, 1) = KM_KBP_STATUS_OK then + if km_kbp_process_event(FCore.State, vk.vkey, vk.kmshift, 1, KM_KBP_EVENT_FLAG_DEFAULT) = KM_KBP_STATUS_OK then begin FEvents.Clear; FEvents.AddStateItems(FCore.State, vk.vkey, vk.kmshift); diff --git a/developer/src/tike/main/KeymanDeveloperOptions.pas b/developer/src/tike/main/KeymanDeveloperOptions.pas index 677f55d5909c800a59b1c7db06b16c3e203fb6ca..d7068788cd9611fbe475718ba6d52c846a0d58f4 100644 --- a/developer/src/tike/main/KeymanDeveloperOptions.pas +++ b/developer/src/tike/main/KeymanDeveloperOptions.pas @@ -70,6 +70,7 @@ type FServerNgrokToken: string; FServerNgrokRegion: string; FServerKeepAlive: Boolean; + FUseLegacyCompiler: Boolean; procedure CloseRegistry; procedure OpenRegistry; function regReadString(const nm, def: string): string; @@ -104,6 +105,8 @@ type property AutoSaveBeforeCompiling: Boolean read FAutoSaveBeforeCompiling write FAutoSaveBeforeCompiling; property OSKAutoSaveBeforeImporting: Boolean read FOSKAutoSaveBeforeImporting write FOSKAutoSaveBeforeImporting; + property UseLegacyCompiler: Boolean read FUseLegacyCompiler write FUseLegacyCompiler; + property ReportErrors: Boolean read FReportErrors write FReportErrors; property ReportUsage: Boolean read FReportUsage write FReportUsage; @@ -215,6 +218,8 @@ begin FAutoSaveBeforeCompiling := regReadBool(SRegValue_IDEOptAutoSaveBeforeCompiling, False); FOSKAutoSaveBeforeImporting := regReadBool(SRegValue_IDEOptOSKAutoSaveBeforeImporting, False); + FUseLegacyCompiler := regReadBool(SRegValue_IDEOptUseLegacyCompiler, False); + FServerDefaultPort := regReadInt(SRegValue_IDEOptServerPort, 8008); FServerKeepAlive := regReadBool(SRegValue_IDEOptServerKeepAlive, False); FServerUseLocalAddresses := regReadBool(SRegValue_IDEOptServerUseLocalAddresses, True); @@ -276,6 +281,7 @@ begin regWriteBool(SRegValue_IDEOptAutoSaveBeforeCompiling, FAutoSaveBeforeCompiling); regWriteBool(SRegValue_IDEOptOSKAutoSaveBeforeImporting, FOSKAutoSaveBeforeImporting); + regWriteBool(SRegValue_IDEOptUseLegacyCompiler, FUseLegacyCompiler); regWriteInt(SRegValue_IDEOptServerPort, FServerDefaultPort); regWriteBool(SRegValue_IDEOptServerKeepAlive, FServerKeepAlive); diff --git a/developer/src/tike/main/KeymanDeveloperUtils.pas b/developer/src/tike/main/KeymanDeveloperUtils.pas index f2df2432c1b7bd0e18762c805b18bbc62808cd45..25db17d1b5a996fce87f6ce380914a88ccfda805 100644 --- a/developer/src/tike/main/KeymanDeveloperUtils.pas +++ b/developer/src/tike/main/KeymanDeveloperUtils.pas @@ -91,7 +91,7 @@ uses Classes, SysUtils, ErrorControlledRegistry, ActiveX, shlobj, RegistryKeys, //Dialogs, utilsystem, Forms, kmxfile, Dialogs, utilexecute, - KeymanVersion, CRC32, VisualKeyboard, Controls; + KeymanVersion, VisualKeyboard, Controls; function GetKMShellPath(var ps: string): Boolean; forward; // I3655 diff --git a/developer/src/tike/project/Keyman.Developer.System.Project.kmnProjectFileAction.pas b/developer/src/tike/project/Keyman.Developer.System.Project.kmnProjectFileAction.pas index 4f0503509c0c83fbf0df1a56495288a003a2fc14..703a1e4a0b6edd891950b647e5240c2e1250f02b 100644 --- a/developer/src/tike/project/Keyman.Developer.System.Project.kmnProjectFileAction.pas +++ b/developer/src/tike/project/Keyman.Developer.System.Project.kmnProjectFileAction.pas @@ -19,6 +19,8 @@ type public function CompileKeyboard: Boolean; function Clean: Boolean; + function DoSetCompilerOptions(addVersion, + useLegacyCompiler: Boolean): Boolean; end; implementation @@ -106,6 +108,22 @@ begin end; end; +function TkmnProjectFileAction.DoSetCompilerOptions(addVersion: Boolean; useLegacyCompiler: Boolean): Boolean; +var + options: COMPILER_OPTIONS; +begin + TProject.CompilerMessageFile := Self; + options.dwSize := sizeof(COMPILER_OPTIONS); + options.ShouldAddCompilerVersion := addVersion; + options.UseKmcmpLib := not useLegacyCompiler; + if not SetCompilerOptions(@options, ProjectCompilerMessage) then + begin + Log(plsFatal, 'Unable to set compiler options', CERR_FATAL, 0); + Exit(False); + end; + Result := True; +end; + function TkmnProjectFileAction.CompileKeyboard: Boolean; var KMXFileName: String; diff --git a/developer/src/tike/project/Keyman.Developer.UI.Project.kmnProjectFileUI.pas b/developer/src/tike/project/Keyman.Developer.UI.Project.kmnProjectFileUI.pas index 9b2dd467c5be2011eaa205c91612b12c9fb9ec99..72c9b43fd47f817361314b093eaef8dbee180750 100644 --- a/developer/src/tike/project/Keyman.Developer.UI.Project.kmnProjectFileUI.pas +++ b/developer/src/tike/project/Keyman.Developer.UI.Project.kmnProjectFileUI.pas @@ -130,7 +130,11 @@ begin if not FSilent then frmMessages.DoShowForm; - Result := ProjectFile.CompileKeyboard; + Result := + // Note: we do not surface the ability to exclude version information from + // the TIKE compiler; this must be done from kmcomp.exe. + ProjectFile.DoSetCompilerOptions(True, FKeymanDeveloperOptions.UseLegacyCompiler) and + ProjectFile.CompileKeyboard; if Result and TServerDebugAPI.Running and diff --git a/developer/src/tike/tike.dpr b/developer/src/tike/tike.dpr index f047bfa9d4f6e248cdd8b3aa4dfdd57d5ff731d3..1a1b1a07fed8e21520ca5bc4275ba623c92c6721 100644 --- a/developer/src/tike/tike.dpr +++ b/developer/src/tike/tike.dpr @@ -18,7 +18,6 @@ uses UfrmKeyTest in 'debug\UfrmKeyTest.pas' {frmKeyTest}, CompilePackage in '..\common\delphi\compiler\CompilePackage.pas', KeymanDeveloperUtils in 'main\KeymanDeveloperUtils.pas', - CRC32 in '..\..\..\common\windows\delphi\general\CRC32.pas', UfrmEditor in 'child\UfrmEditor.pas' {frmEditor}, MenuImgList in '..\common\delphi\components\MenuImgList.pas', UfrmSelectKey in 'dialogs\UfrmSelectKey.pas' {frmSelectKey}, diff --git a/developer/src/tike/tike.dproj b/developer/src/tike/tike.dproj index b1d8ce81f5eb6ae156835aebf0cd75ab654a3ab9..46661e39ce119a22fc141c6f5ae5da5cf760c7be 100644 --- a/developer/src/tike/tike.dproj +++ b/developer/src/tike/tike.dproj @@ -141,7 +141,6 @@ -
frmEditor
diff --git a/developer/src/tools/sentry-upload-difs.sh b/developer/src/tools/sentry-upload-difs.sh index a5ca8b472dfb69fa1b6cda6dbf731ec670c50354..dd806eea64d2ee7941155c6a901d0fee8fc617af 100755 --- a/developer/src/tools/sentry-upload-difs.sh +++ b/developer/src/tools/sentry-upload-difs.sh @@ -18,8 +18,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE cd "$KEYMAN_ROOT/developer/src" diff --git a/docs/build/linux-ubuntu.md b/docs/build/linux-ubuntu.md index d5cb971f8c50db032cc138c266d66d684574f0d4..36583d4576d991e7d5c044732ed5e4659f0af6ae 100644 --- a/docs/build/linux-ubuntu.md +++ b/docs/build/linux-ubuntu.md @@ -6,8 +6,8 @@ On Linux, you can build the following projects: * [Keyman for Linux](#keyman-for-linux) * [Keyman Core](#keyman-core) (Linux only) (aka core) - -* Keyman for Android +* [Keyman for Android](#keyman-for-android) + * Keyman Core (wasm targets) * Common/Web * KeymanWeb @@ -21,7 +21,7 @@ The following projects **cannot** be built on Linux: ## System Requirements -* Minimum Ubuntu version: Ubuntu 18.04 +* Minimum Ubuntu version: Ubuntu 20.04 Other Linux distributions will also work if appropriate dependencies are installed. @@ -98,4 +98,49 @@ cd keymanapp/keyman docker run -it --rm -v $(pwd):/home/build/src/keyman -u root -w /home/build/src/keyman keymanapp/keyman-linux-builder:latest bash -c "cd linux && make reconf && make fullbuild && make install" ``` +## Keyman for Android +**Dependencies**: +* [Base](#base-dependencies) +* [Web](./windows#web-dependencies) + +**Additional requirements**: +* Android SDK +* [Android Studio](https://developer.android.com/studio/install#linux) +* Gradle +* Maven +* OpenJDK 11 (for Keyman 17.0+) + + +Run Android Studio once after installation to install additional components +such as emulator images and SDK updates. + +**Required environment variables**: +* [`JAVA_HOME`](#java_home) + +Building: +* [Building Keyman for Android](../../android/README.md) + +## Prerequisites + +Many dependencies are only required for specific projects. + +### Base Dependencies + +**Environment variables**: + + +## Notes on Environment Variables + +### JAVA_HOME + +This environment variable tells Gradle what version of Java to use for building Keyman for Android. +OpenJDK 11 is used for master. It's recommended to set the environment variables to: +```bash +EXPORT JAVA_HOME="[path to OpenJDK 11]" +``` + +Also edit `/etc/profile.d/jvm.sh` as sudo: +```bash +EXPORT JAVA_HOME="[path to OpenJDK 11]" +``` diff --git a/docs/build/macos.md b/docs/build/macos.md index c45d2d4673a52b02972e0821523dc823da2f7dd3..d8e4f61696ca7b32183d6257051d04221a166688 100644 --- a/docs/build/macos.md +++ b/docs/build/macos.md @@ -59,10 +59,11 @@ These dependencies are also listed below if you'd prefer to install manually. echo 'eval "$(pyenv init --path)"' >> ~/.bash_profile ``` - On M1 only (as greadlink is not on the path otherwise in XCode): + On macOS, you will need to adjust your PATH so that coreutils’ `realpath` takes precedence over the BSD one: ```shell - sudo ln -s /opt/homebrew/bin/greadlink /usr/local/bin/greadlink + # Credit: brew info coreutils + PATH="$HOMEBREW_PREFIX/opt/coreutils/libexec/gnubin:$PATH" ``` * Web: node.js, emscripten, openjdk 8 diff --git a/docs/build/windows.md b/docs/build/windows.md index 096fd764b7646a28308480d6a27e3aa0f81108a6..ef4a77e18fc890a80417f968f2d5cfc6211ed68c 100644 --- a/docs/build/windows.md +++ b/docs/build/windows.md @@ -101,12 +101,13 @@ Building: * Ant * Gradle * Maven +* OpenJDK 11 ```ps1 # Elevated PowerShell choco install android-sdk android-studio ant gradle maven # optionally install sdk images -sdkmanager "system-images;android-30;google_apis;armeabi-v7a" +sdkmanager "system-images;android-33;google_apis;armeabi-v7a" sdkmanager --update sdkmanager --licenses ``` @@ -114,6 +115,12 @@ sdkmanager --licenses * Run Android Studio once after installation to install additional components such as emulator images and SDK updates. +**Required environment variables**: +* [`JAVA_HOME`](#java_home) + +**Optional environment variables**: +* [`JAVA_HOME_11`](#java_home) + Building: * [Building Keyman for Android](../../android/README.md) @@ -134,7 +141,7 @@ PowerShell. * git for Windows * jq * Python 3 -* Meson 0.56+ +* Meson 1.0+ * Ninja * Pandoc @@ -144,7 +151,7 @@ PowerShell. $ProgressPreference = 'SilentlyContinue' choco install git jq python ninja pandoc refreshenv -# choco meson (0.55) is too old, 0.56 required: +# choco meson (0.55) is too old, 1.0 required: python -m pip install meson **Environment variables**: @@ -175,9 +182,9 @@ You can use Windows Settings to add these environment variables permanently: * KeymanWeb **Requirements**: -* emscripten 2.0.23+ -* node.js 14+ -* openjdk 8+ +* emscripten 3.1.32 +* node.js 18 +* [openjdk 11](https://learn.microsoft.com/en-us/java/openjdk/download#openjdk-11)+ ```ps1 # Elevated PowerShell @@ -245,6 +252,10 @@ choco install openjdk ```ps1 choco install visualstudio2019community visualstudio2019-workload-nativedesktop visualstudio2019buildtools ``` + * Verify required build tools are installed + * Run `Visual Studio Installer` + * Check the `Individual components` tab + * Verify `MSVC v142 - VS 2019 c++ x64/x86 build tools (Latest)` is installed. If not, install it. Recommended: configure Visual Studio to use two-space tab stops: 1. Open the options dialog: Tools > Options. @@ -341,6 +352,17 @@ To include UserDefines.mak in the build, use the command line parameter `-DUSERDEFINES`. You can also set an environment variable `USERDEFINES=1` to get the same result. +### JAVA_HOME + +This environment variable tells Gradle what version of Java to use for building Keyman for Android. + +**Multiple versions of Java:** If you need to build Keyman for Android 16.0 or older versions, you can set `JAVA_HOME_11` to the OpenJDK 11 path and `JAVA_HOME` to the OpenJDK 8 path. This will build both versions correctly from command line. But note that you do need to update your `JAVA_HOME` env var to the associated version before opening Android Studio and loading any Android projects. `JAVA_HOME_11` is mostly used by CI. + +```bat +SET JAVA_HOME="path to OpenJDK 8" +SET JAVA_HOME_11="path to OpenJDK 11" +``` + ## Optional Tools * sentry-cli (optional) diff --git a/docs/linux/README.md b/docs/linux/README.md index 9c90ad85b3cfcc094d4b2dbc5cf428b17c802327..8690b46a55e5db337187b12fd0de336e1f7f5c7e 100644 --- a/docs/linux/README.md +++ b/docs/linux/README.md @@ -22,7 +22,8 @@ See [license information](../../linux/LICENSE.md) about licensing. python3-magic python3-numpy python3-pil python3-pip python3-qrcode \ python3-requests python3-requests-cache python3 python3-gi dconf-cli \ dconf-editor cargo python3-dbus gir1.2-webkit2-4.0 ibus libglib2.0-bin \ - liblocale-gettext-perl xvfb xserver-xephyr metacity mutter + liblocale-gettext-perl xvfb xserver-xephyr metacity mutter \ + libicu-dev pkg-config ``` ## Compiling from Command Line @@ -33,20 +34,19 @@ See [license information](../../linux/LICENSE.md) about licensing. - The process to build and install everything is: - - `make reconf` to create the build system and set the version - - `make fullbuild` to configure and build - - `sudo make install` to install to `/usr/local` + - `linux/build.sh configure` to set the version and setup the build system + - `linux/build.sh build` to build + - `sudo linux/build.sh install` to install to `/usr/local` -- Some of the files must be installed to `/usr/share/` so `make install` must be run as `sudo`. +- Some of the files must be installed to `/usr/share/` or `/usr/local/share` + so `linux/build.sh install` must be run as `sudo`. - To do this run `sudo make install` + To do this run `sudo linux/build.sh install` - - This will install to `/usr/local` - - and `/usr/share/ibus/component/keyman.xml` and `/usr/share/keyman/icons` + - This will install to `/usr/local` and + `/usr/local/share/ibus/component/keyman.xml` and `/usr/local/share/keyman/icons` - - If you already have the ibus-keyman package installed then it will move the file `/usr/share/ibus/component/keyman.xml` to `/usr/share/doc/ibus-keyman/` - -- run `sudo make uninstall` to uninstall everything and put it back again +- run `sudo linux/build.sh uninstall` to uninstall everything and put it back again #### Tmp install @@ -64,17 +64,7 @@ So - **keyboardprocessor** must be built before **ibus-keyman** -For each project run `./configure && make && make install`. - -You may prefer to create a different directory to build in and run configure from there e.g. - -```bash -mkdir ../build-ibus-keyman -cd ../build-ibus-keyman -../ibus-keyman/configure -make -make install -``` +For each project run `./build.sh && ./build.sh install`. ## Continuous integration @@ -108,38 +98,48 @@ to run the tests with X11. The tests can be run with the following command: +```bash +cd linux/ibus-keyman +./build.sh test +``` + +or with a script that accepts additional parameters: + ```bash cd linux/ibus-keyman/tests -./run-tests +scripts/run-tests ``` The `run-tests` script accepts different arguments which can be seen with -`./run-tests --help`. +`scripts/run-tests --help`. ## Running Keyman for Linux ### Setting up Ibus -Ibus should be running on a default install of Ubuntu +Ibus should be running on a default install of Ubuntu. -You may want to install extra packages to get other ibus input methods e.g **ibus-unikey** for VN +You may want to install extra packages to get other ibus input methods e.g +**ibus-unikey** for VN. -Run `ibus restart` after installing any of them +Run `ibus restart` after installing any of them. ### Getting a Keyman keyboard -- After installing a Keyman keyboard usually ibus will be restarted automatically so that ibus will - look for the new keyboard. If for whatever reason the keyboard doesn't show up in the system +- After installing a Keyman keyboard usually ibus will be restarted + automatically so that ibus will look for the new keyboard. If for + whatever reason the keyboard doesn't show up in the system keyboard list, you can manually run `ibus restart`. ### Activating a Keyman keyboard -Keyman tries to activate the keyboard automatically. If you want to activate it for a different -language, you can do so by following the steps below. +Keyman tries to activate the keyboard automatically. If you want to activate +it for a different language, you can do so by following the steps below. #### GNOME3 (focal and bionic default, also newer Ubuntu versions) -- Click the connection/sound/shutdown section in the top right. Then the tools icon for Settings. +- Click the connection/sound/shutdown section in the top right. Then the tools + icon for Settings. - In `Language and Region` click `+` to add a keyboard. - Click the 3 dots expander then search for "Other" and click it diff --git a/docs/linux/ibus-keyman.md b/docs/linux/ibus-keyman.md index 5e7e24b35ac6fa22e5fbe6abbad90f2c67f02962..db09d67f5a8ce4a0eda7cdb5a6148f004093df6c 100644 --- a/docs/linux/ibus-keyman.md +++ b/docs/linux/ibus-keyman.md @@ -6,28 +6,18 @@ Source code for Keyman engine for IBus is in [linux/ibus-keyman](../../linux/ibu ## Requirements -You need autoconf, autopoint, gettext, automake and libtool to generate the build system. - -Run `./autogen.sh` to run them. +meson (>= 0.53) ## Building ```bash -./autogen.sh -./configure -make -sudo make install +./build.sh clean configure build +./build.sh test +sudo ./build.sh install ``` For a debug build: ```bash -./configure CPPFLAGS=-DG_MESSAGES_DEBUG CFLAGS="-g -O0" CXXFLAGS="-g -O0" -``` - -To use the header files from the source repo, you need to specify paths to the include files in core: - -```bash -./configure CPPFLAGS="-DG_MESSAGES_DEBUG -I../../core/build/arch/debug/include/ -I../../common/include/ -I../../core/include/" \ - CFLAGS="-g -O0" CXXFLAGS="-g -O0" +./build.sh --debug clean configure build ``` diff --git a/docs/npm-packages.md b/docs/npm-packages.md index 2a3cea707dd44ade02e3a6b612dacc1e309d3367..040a6e11ccf48b052ec0cd51b925666664b53de8 100644 --- a/docs/npm-packages.md +++ b/docs/npm-packages.md @@ -8,10 +8,25 @@ Currently, we're using TeamCity for this. Packages are **never** published from a developer's machine. -## List of current npm packages - -* `@keymanapp/models-types` -- located at `common/models-types` -* `@keymanapp/lexical-model-compiler` -- located at `developer/src/kmlmc` +## List of current published npm packages + +* `@keymanapp/common-types` -- located at `common/web/types` +* `@keymanapp/keyman-version` -- located at `common/web/keyman-version` +* `@keymanapp/kmc` -- located at `developer/src/kmc` +* `@keymanapp/kmc-kmn` -- located at `developer/src/kmc-kmn` +* `@keymanapp/kmc-ldml` -- located at `developer/src/kmc-ldml` +* `@keymanapp/kmc-model` -- located at `developer/src/kmc-model` +* `@keymanapp/kmc-model-info` -- located at `developer/src/kmc-model-info` +* `@keymanapp/kmc-package` -- located at `developer/src/kmc-package` +* `@keymanapp/models-types` -- located at `common/models/types` + +### Deprecated npm packages + +* `@keymanapp/developer-lexical-model-compiler` -- replaced by `@keymanapp/kmc` +* `@keymanapp/lexical-model-compiler` -- replaced by `@keymanapp/kmc` +* `@keymanapp/lexical-model-types` -- replaced by `@keymanapp/models-types` +* `@keymanapp/lmlayer-cli` -- replaced by `@keymanapp/kmc` +* `@keymanapp/models-wordbreakers` -- published accidentally ## For CI developers @@ -23,59 +38,70 @@ server. This is typically done with: ```bash -./build.sh -test +./build.sh configure build test ``` -Once the build succeeds and the tests pass, the version is set in +Once the build succeeds and the tests pass, you can publish! Use the following +script for this (**only on the CI server**!); during this, the version is set in `package.json`: ```bash -./build.sh -version 12.0.${BUILD_NUMBER} -tier ${tier} -``` - -Now you can publish! Use the following script for this (again, **only on the CI server**!) - -```bash -./build.sh -publish-to-npm -tier ${tier} +./build.sh publish ``` -It is then uploaded to the npm package directory. **Ensure that the -compiled sources are included in the tarball**. For example, +It is then uploaded to the npm package directory. **Ensure that the compiled +sources are included in the tarball**. For example: ```bash -$ npm publish -npm notice 📦 @keymanapp/lexical-model-compiler@0.0.0 +$ ./build.sh publish +npm notice +npm notice 📦 @keymanapp/kmc@16.0.61-alpha-local npm notice === Tarball Contents === -npm notice 12.4kB dist/lexical-model-compiler/build-trie.js -npm notice 1.2kB dist/kmlmc.js -npm notice 3.0kB dist/kmlmi.js -npm notice 1.4kB dist/kmlmp.js -npm notice 5.0kB dist/package-compiler/kmp-compiler.js -npm notice 55B dist/package-compiler/kmp-json-file.js -npm notice 552B dist/package-compiler/kps-file.js -npm notice 4.6kB dist/lexical-model-compiler/lexical-model-compiler.js -npm notice 315B dist/lexical-model-compiler/lexical-model.js -npm notice 158B dist/util/min-keyman-version.js -npm notice 4.5kB dist/model-info-compiler/model-info-compiler.js -npm notice 57B dist/lexical-model-compiler/model-info-file.js -npm notice 341B dist/lexical-model-compiler/stub.js -npm notice 115B dist/util/sysexits.js -npm notice 2.1kB dist/util/util.js -npm notice 1.4kB package.json -npm notice 1.0kB README.md +npm notice 841B Makefile +npm notice 2.8kB README.md +npm notice 2.5kB build.sh +npm notice 116B build/src/kmc.d.ts +npm notice 114B build/src/kmc.d.ts.map +npm notice 2.8kB build/src/kmc.js +npm notice 2.6kB build/src/kmc.js.map +npm notice 120B build/src/kmlmc.d.ts +npm notice 118B build/src/kmlmc.d.ts.map +npm notice 1.4kB build/src/kmlmc.js +npm notice 1.4kB build/src/kmlmc.js.map +npm notice 131B build/src/kmlmi.d.ts +npm notice 118B build/src/kmlmi.d.ts.map +npm notice 3.1kB build/src/kmlmi.js +npm notice 2.7kB build/src/kmlmi.js.map +npm notice 128B build/src/kmlmp.d.ts +npm notice 118B build/src/kmlmp.d.ts.map +npm notice 1.6kB build/src/kmlmp.js +npm notice 1.5kB build/src/kmlmp.js.map +npm notice 285B build/src/util/sysexits.d.ts +npm notice 186B build/src/util/sysexits.d.ts.map +npm notice 51B build/src/util/sysexits.js +npm notice 128B build/src/util/sysexits.js.map +npm notice 29.8kB build/tsconfig.tsbuildinfo +npm notice 5.4kB bundle.inc.sh +npm notice 1.7kB package.json +npm notice 2.8kB src/kmc.ts +npm notice 1.4kB src/kmlmc.ts +npm notice 3.2kB src/kmlmi.ts +npm notice 1.6kB src/kmlmp.ts +npm notice 237B src/util/sysexits.ts +npm notice 740B tsconfig.json +npm notice 449B tsconfig.kmc-base.json ``` For every release of **Keyman Developer**, the CI publishes a release of -`@keymanapp/lexical-model-compiler`. The version number is locked with -the particular version of Keyman Developer. +`@keymanapp/kmc`. The version number is locked with the particular version of +Keyman Developer. -### `set_npm_version` +### `builder_publish_to_npm` -This helper function sets the version in the `package.json` for the -given package, according to the VERSION_WITH_TAG variable. +This helper function updates version numbers and does the publish step for the +package.json in the working directory, using the VERSION_WITH_TAG variable. ```bash -. $KEYMAN_ROOT/resources/shellHelperFunctions.sh - -set_npm_version + . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" + builder_publish_to_npm ``` diff --git a/docs/settings/linux/launch.json b/docs/settings/linux/launch.json index b407dacdb739a2b88db6ee59fac4edf510760df4..bfae335300d1980249d74352ff9ce193ede01ca9 100644 --- a/docs/settings/linux/launch.json +++ b/docs/settings/linux/launch.json @@ -20,25 +20,57 @@ "name": "Launch kmx unit tests", "target": "build/arch/debug/tests/unit/kmx/kmx", "cwd": "${workspaceRoot}/core/", - "arguments": "tests/unit/kmx/033\\ -\\ caps\\ always\\ off.km{n,x}", + "arguments": "tests/unit/kmx/k_033___caps_always_off.km{n,x}", "valuesFormatting": "parseText" }, { // Mount the Keyman root directory as a Shared Folder in the VM. // kill ibus-engine-keyman, if running - // start: gdbserver 10.3.0.53:2345 /media/sf_Develop/keyman/keyman/linux/ibus-keyman/src/ibus-engine-keyman + // start: gdbserver 10.3.0.53:2345 /media/sf_Develop/keyman/keyman/linux/build/x86_64/debug/src/ibus-engine-keyman // then attach debugger in vscode // Replace the IP address after `gdbserver` with the IP address of the host machine. // Replace the IP address below with the address of the VM running gdbserver. "type": "gdb", "request": "attach", "name": "Attach to gdbserver (ibus-keyman)", - "executable": "${workspaceFolder}/linux/ibus-keyman/src/ibus-engine-keyman", + "executable": "${workspaceFolder}/linux/build/x86_64/debug/src/ibus-engine-keyman", "target": "10.3.0.52:2345", "remote": true, "cwd": "${workspaceFolder}/linux/ibus-keyman", "valuesFormatting": "parseText" }, + { + // start: gdbserver 10.3.0.58:2345 /media/sf_Develop/keyman/keyman/linux/build/x86_64/debug/tests/ibus-keyman-tests + // then attach debugger in vscode + "type": "gdb", + "request": "attach", + "name": "Attach to gdbserver (ibus-keyman integration tests)", + "executable": "${workspaceFolder}/linux/build/x86_64/debug/tests/ibus-keyman-tests", + "target": "10.3.0.58:2345", + "remote": true, + "cwd": "${workspaceFolder}/linux/ibus-keyman", + "valuesFormatting": "parseText", + "internalConsoleOptions": "openOnSessionStart", + "env": { + "KEYMAN_DEBUG": "1", + "G_ENABLE_DIAGNOSTIC": "1", + "GSETTINGS_BACKEND": "keyfile" + } + }, + { + "type": "gdb", + "request": "launch", + "name": "Launch ibus-keyman unit tests", + "target": "./keymanutil_tests", + "cwd": "${workspaceFolder}/linux/build/x86_64/debug/src/test", + "valuesFormatting": "parseText", + "internalConsoleOptions": "openOnSessionStart", + "env": { + "KEYMAN_DEBUG": "1", + "G_ENABLE_DIAGNOSTIC": "1", + "GSETTINGS_BACKEND": "keyfile" + } + }, { "name": "Python: Current File", "type": "python", @@ -68,17 +100,6 @@ "KEYMAN_NOSENTRY": "1" } }, - { - "name": "Python: ibus-keyman unit tests", - "type": "python", - "request": "launch", - "program": "${workspaceFolder}/linux/ibus-keyman/test/test_ibus_keyman.py", - "args": [ - "001 - basic input UnicodeI" - ], - "cwd": "${workspaceFolder}/linux/ibus-keyman/test/", - "console": "integratedTerminal" - }, { "type": "perl", "name": "help2md", diff --git a/docs/settings/linux/settings.json b/docs/settings/linux/settings.json index be15b13027d8b8a133b7c310d4ab9ad1160cf6d6..891507dd2ecfc3b11a2ad1eae765934819ac0506 100644 --- a/docs/settings/linux/settings.json +++ b/docs/settings/linux/settings.json @@ -107,4 +107,5 @@ "--external-sources --source-path=resources/build/" ], "C_Cpp.errorSquiggles": "EnabledIfIncludesResolve", + "shellcheck.useWorkspaceRootAsCwd": false } diff --git a/docs/settings/linux/tasks.json b/docs/settings/linux/tasks.json index b2a7f161e5f00da153335544e2eb7b7414930676..77df789fe318c41f7099a86255d6476ce05c3658 100644 --- a/docs/settings/linux/tasks.json +++ b/docs/settings/linux/tasks.json @@ -3,59 +3,24 @@ "tasks": [ { "type": "shell", - "label": "core: build", + "label": "core: clean", "command": "${workspaceFolder}/core/build.sh", "args": [ - "--debug" - ], - "options": { - "cwd": "${workspaceFolder}/core" - }, - "problemMatcher": [ - { - "owner": "cpp", - "source": "compiler", - "fileLocation": [ - "relative", - "${workspaceFolder}/core/" - ], - "pattern": [ - { - "regexp": "^../../../(.*):(\\d+):(\\d+):\\s+(warning|error|note):\\s+(.*)(\\s+\\[.*\\])?$", - "file": 1, - "line": 2, - "column": 3, - "severity": 4, - "message": 5 - } - ] - }, - { - "owner": "cpp", - "source": "linker", - "fileLocation": "absolute", - "pattern": [ - { - "regexp": "^(/usr/bin/ld:\\s+)?(.*):(\\d+):\\s+(.*)$", - "file": 2, - "location": 3, - "message": 4 - } - ] - } + "--debug", + "clean" ], "group": "build", - "detail": "build core" + "detail": "clean core" }, { "type": "shell", "label": "core: configure", "command": "${workspaceFolder}/core/build.sh", - "args": [ "--debug", "configure", + "args": [ + "--debug", + "--no-tests", + "configure:arch" ], - "options": { - "cwd": "${workspaceFolder}/core", - }, "presentation": { "clear": true }, @@ -64,14 +29,13 @@ }, { "type": "shell", - "label": "core: configure+build", + "label": "core: build", "command": "${workspaceFolder}/core/build.sh", "args": [ - "--debug", "configure", "build", "tests" + "--debug", + "--no-tests", + "build:arch" ], - "options": { - "cwd": "${workspaceFolder}/core" - }, "problemMatcher": [ { "owner": "cpp", @@ -103,11 +67,8 @@ "message": 4 } ] - }, + } ], - "presentation": { - "clear": true - }, "group": "build", "detail": "build core" }, @@ -117,7 +78,7 @@ "command": "${workspaceFolder}/core/build.sh", "args": [ "--debug", - "tests" + "test:arch" ], "problemMatcher": [ "$gcc" @@ -127,54 +88,49 @@ }, { "type": "shell", - "label": "ibus-keyman: autogen.sh", - "command": "./autogen.sh", + "label": "ibus-keyman: clean", + "command": "./build.sh", + "args": ["clean", "--debug"], "options": { "cwd": "${workspaceFolder}/linux/ibus-keyman" }, "group": "build", - "detail": "autogen ibus-keyman" + "detail": "clean ibus-keyman" }, { "type": "shell", "label": "ibus-keyman: configure", - "command": "./configure", - "args": [ - "CPPFLAGS=\"-DG_MESSAGES_DEBUG -I${workspaceFolder}/core/build/arch/debug/include/ -I${workspaceFolder}/common/include/ -I${workspaceFolder}/core/include/\"", - "CFLAGS=\"-g -O0\"", - "CXXFLAGS=\"-g -O0\"", - "KEYMAN_PROC_LIBS=\"-L${workspaceFolder}/core/build/arch/debug/src -lkmnkbp0\"", - "KEYMAN_PROC_CFLAGS=\"-I${workspaceFolder}/core/build/arch/debug/include -I${workspaceFolder}/core/include -I${workspaceFolder}/common/include\"", - "PKG_CONFIG_PATH=${workspaceFolder}/core/build/arch/debug/meson-private" - ], + "command": "./build.sh", + "args": ["configure", "--debug"], "options": { - "cwd": "${workspaceFolder}/linux/ibus-keyman" + "cwd": "${workspaceFolder}/linux/ibus-keyman", + "env": { + "CPPFLAGS": "-DG_MESSAGES_DEBUG -I${workspaceFolder}/core/build/arch/debug/include/ -I${workspaceFolder}/core/include/ -I/home/eberhard/Develop/keyman/ibus/ibus/src -I${workspaceFolder}/common/include", + "CFLAGS": "-g -O0", + "CXXFLAGS": "-g -O0", + "KEYMAN_PROC_LIBS": "-L${workspaceFolder}/core/build/arch/debug/src -lkmnkbp0", + "KEYMAN_PROC_CFLAGS": "-I${workspaceFolder}/core/build/arch/debug/include -I${workspaceFolder}/core/include -I${workspaceFolder}/common/include", + "PKG_CONFIG_PATH": "${workspaceFolder}/core/build/arch/debug/meson-private" + }, }, - "problemMatcher": [ - { - "base": "$gcc", - "fileLocation": [ - "relative", - "${workspaceFolder}/linux/ibus-keyman/src/" - ], - } - ], + "dependsOn":["ibus-keyman: clean"], "group": "build", "detail": "configure ibus-keyman" }, { "type": "shell", "label": "ibus-keyman: build", - "command": "make", + "command": "./build.sh", + "args": [ "build", "--debug" ], "options": { - "cwd": "${workspaceFolder}/linux/ibus-keyman", + "cwd": "${workspaceFolder}/linux/ibus-keyman/", }, "problemMatcher": [ { "base": "$gcc", "fileLocation": [ "relative", - "${workspaceFolder}/linux/ibus-keyman/src/" + "${workspaceFolder}/linux/build/x86_64/release" ], } ], @@ -183,24 +139,14 @@ }, { "type": "shell", - "label": "ibus-keyman: build tests", - "command": "make", - "options": { - "cwd": "${workspaceFolder}/linux/ibus-keyman/tests", - }, - "group": "build", - "detail": "build ibus-keyman" - }, - { - "type": "shell", - "label": "ibus-keyman: check", - "command": "make", - "args": ["check"], + "label": "ibus-keyman: test", + "command": "./build.sh", + "args": ["test", "--debug"], "options": { "cwd": "${workspaceFolder}/linux/ibus-keyman/", }, "group": "build", - "detail": "build check ibus-keyman" + "detail": "run tests of ibus-keyman" }, { "type": "shell", diff --git a/ios/Cartfile b/ios/Cartfile index 5ad8178ed48a4e7ad28589d41fe9ed382617a5c9..b265ef77af28f9f7d45032ba8f753477057e456f 100644 --- a/ios/Cartfile +++ b/ios/Cartfile @@ -1,5 +1,5 @@ github "marmelroy/Zip" -github "DaveWoodCom/XCGLogger" ~> 6.1.0 +github "keymanapp/dependency-XCGLogger" "master" github "devicekit/DeviceKit" ~> 5.0 github "ashleymills/Reachability.swift" -github "getsentry/sentry-cocoa" ~> 6.2.1 +github "getsentry/sentry-cocoa" ~> 8.7.0 diff --git a/ios/Cartfile.resolved b/ios/Cartfile.resolved index fe74a57322bc07d42adfbf6539596e6ad6035902..ff30a8871ddc681497e00c68287eb34808d94541 100644 --- a/ios/Cartfile.resolved +++ b/ios/Cartfile.resolved @@ -1,5 +1,5 @@ -github "DaveWoodCom/XCGLogger" "6.1.0" github "ashleymills/Reachability.swift" "v5.1.0" github "devicekit/DeviceKit" "5.0.0" -github "getsentry/sentry-cocoa" "6.2.1" +github "getsentry/sentry-cocoa" "8.7.0" +github "keymanapp/dependency-XCGLogger" "57a7b975dbb6fe4fe90cef3d1bc52b8adbd89113" github "marmelroy/Zip" "2.1.2" diff --git a/ios/build-help.sh b/ios/build-help.sh deleted file mode 100755 index a03a31a88b15f51040e0aef3ab0bf0c42a780852..0000000000000000000000000000000000000000 --- a/ios/build-help.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env bash - -# Set sensible script defaults: -# set -e: Terminate script if a command returns an error -set -e -# set -u: Terminate script if an unset variable is used -set -u - -## START STANDARD BUILD SCRIPT INCLUDE -# adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../resources/build/build-utils.sh" -## END STANDARD BUILD SCRIPT INCLUDE - -QUIET=0 - -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" - -THIS_DIR="$(dirname "$THIS_SCRIPT")" - -display_usage() { - echo "build.sh [--no-clean] target [...target]" - echo "Builds help documentation for Keyman for iPhone and iPad" - echo "Targets:" - echo " * htm or html: convert documentation to html using pandoc" - echo - echo " --no-clean: don't clean target folder before building" -} - -DO_HTM=false -DO_CLEAN=true - -# Debug flags -DO_HTM_CONVERSION=true - -# -# Parse args -# - -shopt -s nocasematch - -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - htm | html) - DO_HTM=true - ;; - --no-clean) - DO_CLEAN=false - ;; - *) - display_usage - exit 1 - esac - shift # past argument -done - -if ! $DO_HTM ; then - display_usage - exit 1 -fi - -displayInfo "" \ - "DO_HTM: $DO_HTM" \ - "DO_CLEAN: $DO_CLEAN" \ - "" - -# -# Compile all .md to .html -# - -cd $KEYMAN_ROOT/ios/help - -MDLUA="$KEYMAN_ROOT/resources/build/html-link.lua" -CSS="../../resources/build/offline-help-style-spec.txt" -MD=`find . -name "*.md"` -DESTHTM="$THIS_DIR/keyman/Keyman/Keyman/resources/OfflineHelp.bundle/Contents/Resources" - -if $DO_HTM; then - # - # Clean existing folder - # - - if $DO_CLEAN; then - rm -rf "$DESTHTM" || true # We don't want to die when we clean an empty folder - fi - mkdir -p "$DESTHTM" - - # - # Generate HTML files from Markdown - # - - if $DO_HTM_CONVERSION; then - for INFILE in $MD; do - OUTFILE="$DESTHTM/${INFILE%.md}.html" - echo "Processing $INFILE to $(basename "$OUTFILE")" - mkdir -p "$(dirname "$OUTFILE")" - pandoc -s -H "$CSS" --lua-filter="$MDLUA" -t html -o "$OUTFILE" $INFILE - done - fi - - # - # Copy Images - # - cd $KEYMAN_ROOT/ios/help/ - mkdir -p "$DESTHTM/ios_images" - cp ios_images/* "$DESTHTM/ios_images/" - -fi diff --git a/ios/engine/KMEI/KeymanEngine/Classes/Errors/SentryManager.swift b/ios/engine/KMEI/KeymanEngine/Classes/Errors/SentryManager.swift index 127fcd12b5bd2b4fb8d900586073e0ab94971bcc..94f988507606db6fe75025f89cc91045ecc8ffd0 100644 --- a/ios/engine/KMEI/KeymanEngine/Classes/Errors/SentryManager.swift +++ b/ios/engine/KMEI/KeymanEngine/Classes/Errors/SentryManager.swift @@ -167,7 +167,7 @@ public class SentryManager { public static func breadcrumbAndLog(crumb: Sentry.Breadcrumb, logLevel: XCGLogger.Level? = nil) { // Guarded in case a library consumer decides against initializing Sentry. if _started { - SentrySDK.addBreadcrumb(crumb: crumb) + SentrySDK.addBreadcrumb(crumb) } let level = logLevel ?? mapLoggingLevel(crumb.level) @@ -193,7 +193,7 @@ public class SentryManager { } public static func forceError() { - SentrySDK.addBreadcrumb(crumb: Sentry.Breadcrumb(level: .info, category: "Deliberate testing error")) + SentrySDK.addBreadcrumb(Sentry.Breadcrumb(level: .info, category: "Deliberate testing error")) SentrySDK.crash() } } diff --git a/ios/engine/KMEI/KeymanEngine/Classes/Resource Data/InstallableKeyboard.swift b/ios/engine/KMEI/KeymanEngine/Classes/Resource Data/InstallableKeyboard.swift index 34b2de6ff4b07a7bec9ca0bab78b28eb739c15bf..14a71eb542217329a23147f1683120dfe3abb008 100644 --- a/ios/engine/KMEI/KeymanEngine/Classes/Resource Data/InstallableKeyboard.swift +++ b/ios/engine/KMEI/KeymanEngine/Classes/Resource Data/InstallableKeyboard.swift @@ -106,7 +106,10 @@ public struct InstallableKeyboard: Codable, KMPInitializableLanguageResource { self.lgCode = lgCode let languageMatches = metadata.languages.compactMap { return $0.languageId == lgCode ? $0.name : nil } - guard languageMatches.count == 1 else { + if (languageMatches.isEmpty) { + SentryManager.captureAndLog("Could not find languageId '\(lgCode)' for package '\(packageID)'", sentryLevel: .warning) + } + guard languageMatches.count >= 1 else { return nil } diff --git a/ios/engine/KMEI/KeymanEngine/Classes/kmp.json/KMPKeyboard.swift b/ios/engine/KMEI/KeymanEngine/Classes/kmp.json/KMPKeyboard.swift index 75e54f26aa2d416d018e386541001cf726968233..7a735f5fd33b7eac591694b4b997731d42205575 100644 --- a/ios/engine/KMEI/KeymanEngine/Classes/kmp.json/KMPKeyboard.swift +++ b/ios/engine/KMEI/KeymanEngine/Classes/kmp.json/KMPKeyboard.swift @@ -76,8 +76,9 @@ class KMPKeyboard: Codable, KMPResource { var installableKeyboards : [InstallableKeyboard] = [] for language in self.languages { - let keyboard = InstallableKeyboard(from: self, packageID: packageId!, lgCode: language.languageId)! - installableKeyboards.append( keyboard ) + if let keyboard = InstallableKeyboard(from: self, packageID: packageId!, lgCode: language.languageId) { + installableKeyboards.append( keyboard ) + } } return installableKeyboards diff --git a/ios/engine/KMEI/KeymanEngine/ckl.lproj/Localizable.strings b/ios/engine/KMEI/KeymanEngine/ckl.lproj/Localizable.strings index 3156ac7c36d3ec0d2f65e50aad6f49c2688bd812..5a43cc3933b956cc84a75e2d4e97c707491ee296 100644 --- a/ios/engine/KMEI/KeymanEngine/ckl.lproj/Localizable.strings +++ b/ios/engine/KMEI/KeymanEngine/ckl.lproj/Localizable.strings @@ -125,7 +125,7 @@ "kmp-error-missing-resource" = "Package ǝni adiyaka kibod ko dictionary namtǝ gǝ yuwɛ wɛ."; /* Error installing a Keyman package with a version of Keyman that does not support it */ -"kmp-error-unsupported-keyman-version" = "This package requires a newer version of Keyman."; +"kmp-error-unsupported-keyman-version" = "Pakeji ǝni ada kǝthlǝr aka jiliyir Keyman nam bǝlin."; /* Error opening a Keyman package - cannot parse contents */ "kmp-error-no-metadata" = "Package ǝni ndadi tsati tǝni kal kal wɛ - suyere nam akwa ndadi zǝndi wɛ."; diff --git a/ios/engine/KMEI/KeymanEngine/ff.lproj/Localizable.strings b/ios/engine/KMEI/KeymanEngine/ff.lproj/Localizable.strings index d46bd61d9b5c4bdad8c3ea4d9904a0cc0534c56b..f27d7c36bcb3c47f8cfc1647ea99724732b2244e 100644 --- a/ios/engine/KMEI/KeymanEngine/ff.lproj/Localizable.strings +++ b/ios/engine/KMEI/KeymanEngine/ff.lproj/Localizable.strings @@ -83,7 +83,7 @@ "info-command-help-keyboard" = "Ballal tappirde"; /* Text for the command to open the help page of a lexical model, as shown on resource information views */ -"info-command-help-lexical-model" = "Ballal tappirde"; +"info-command-help-lexical-model" = "Ballal Saggitorde"; /* Text label for displaying a keyboard's version, as shown on resource information views */ "info-label-version-keyboard" = "Yamre tappirde"; diff --git a/ios/help/basic/config/index.md b/ios/help/basic/config/index.md new file mode 100644 index 0000000000000000000000000000000000000000..22468a4021c9b39a7f6ca23021f88d150914be18 --- /dev/null +++ b/ios/help/basic/config/index.md @@ -0,0 +1,60 @@ +--- +title: Using the Settings Screen - Keyman for iPhone and iPad Help +--- + +## Using the Settings Screen + +This Settings screen is used to configure keyboards and dictionaries. +It also has many of the options that are available on the 'Get Started' menu. To access the Settings screen: + +Step 1) +Open the Keyman app. + +Step 2) +Click the ellipsis (...) for additional options. Select 'Settings' + +![](../../ios_images/settings-screen.png) + +Each selection on the Keyman Settings screen is described in further detail below: + + +## Installed Languages +This displays the number of installed languages. Click this line for the 'Installed Languages' +screen where you may view the languages you have installed and, by clicking any one language, find its keyboards and dictionaries along with [more settings](../language-settings). + +![](../../ios_images/find-new.png) + +Click on this to [search for a keyboard or language](../../start/searching-for-keyboards). + +## Show Banner +This adds a banner to the top of the keyboard to allow space for pop-up keys to render above the top row of keys. + +![](../../ios_images/banner.png) + +When this is off, + +![](../../ios_images/no-banner.png) + +pop-up keys in the top row render horizontally. + +## Show "Get Started" on startup +When enabled, the Keyman app will display the 'Get Started' screen on app startup. + +## Allow error reporting +When enabled, the Keyman app will send crash reporting information to https://sentry.keyman.com. No personally identifiable information or keyboard strokes are recorded. + +## Spacebar Caption +Click on this to [change the displayed keyboard name](spacebar-caption) on the spacebar. + +## System Keyboard Settings +By default, installed Keyman keyboards are only available to use within the Keyman app. Click on this setting to +bring up the iOS system configuration so Keyman can be added as a system-wide keyboard. + +## Set Keyman as default keyboard +Select 'Keyboards' to bring up the iOS system configuration for setting Keyman as the default system-wide keyboard. Toggle both 'Keyman' and 'Allow Full Access'. + +![](../../ios_images/system-wide-setting.png) + +## Install From File +Select this to browse the files on your device and install a keyboard from a .kmp file. + diff --git a/ios/help/basic/config/spacebar-caption.md b/ios/help/basic/config/spacebar-caption.md new file mode 100644 index 0000000000000000000000000000000000000000..4344c83063f676c1090a201bd567c0373f763ee1 --- /dev/null +++ b/ios/help/basic/config/spacebar-caption.md @@ -0,0 +1,13 @@ +--- +title: Spacebar Caption - Keyman for iPhone and iPad Help +--- + +## Spacebar Caption + +This menu can be used to change the displayed keyboard name on the spacebar. The options are: +* Language name +* Keyboard name +* Language name + Keyboard name +* Blank + +![](../../ios_images/spacebar-caption.png) diff --git a/ios/help/basic/index.md b/ios/help/basic/index.md index 10df8f8300ccbd7807ee1527fbb352f80565a89e..e2c9e82d6d272aea9a058d8e80e54c5a7ee5ecd3 100644 --- a/ios/help/basic/index.md +++ b/ios/help/basic/index.md @@ -4,6 +4,9 @@ title: Basic Help * [Switching Between Keyboards](switching-between-keyboards) +* [Using the Settings Screen](config/) + +* [Language Settings](language-settings) * [Installing Custom Keyboards/Dictionaries](installing-custom-keyboards-dictionaries) * [Sharing Keyboards and Dictionaries](sharing-keyboards) diff --git a/ios/help/basic/language-settings.md b/ios/help/basic/language-settings.md new file mode 100644 index 0000000000000000000000000000000000000000..af39c37f36b9b238b15541ae511a732568520b64 --- /dev/null +++ b/ios/help/basic/language-settings.md @@ -0,0 +1,58 @@ +--- +title: Language Settings - Keyman for iPhone and iPad Help +--- + +### Access "Installed Languages" +First, open the "Settings" menu. + +![](../ios_images/add-keyboard-i.png) + +The "Installed Languages" menu found here manages your installed keyboards and dictionaries. + +![](../ios_images/add-keyboard-i2.png) + +You should then see the following screen: + +![](../ios_images/add-keyboard-i3.png) + + +### Select a Language to View its Settings +After selecting a language, you will find settings in these categories: Keyboards, Language Settings, and Dictionaries. + +![](../ios_images/language-settings.png) + +### Keyboard Settings +In Keyboard settings, you will find a list of keyboards installed in the language. After clicking a keyboard, you will see + +* the version of the installed keyboard +* the link to the 'Keyboard help' screen with information about its symbols and fonts +* the option to Uninstall the keyboard +* the QR code for loading this keyboard on another device + +### Language Settings +In Language settings, you may see + +* the option to enable predictions +* if predictions are enabled, the option to enable corrections + +These predictions and corrections are given while a user types, based upon the dictionary selected under 'Dictionaries'. + +### Dictionaries +In Dictionaries, you will see a list of dictionaries installed for the language. + +![](../ios_images/find-new.png) + +Click this to select a new dictionary from a list of available dictionaries in the language. + +![](../ios_images/dictionary-select.png) + +Back in the dictionaries list, after clicking a dictionary, you will see its name again, along with a blue information icon: + +![](../ios_images/dictionary-list.png) + +After clicking the 'i' icon, you will see + +* the version of the installed dictionary +* the option to Uninstall the dictionary + + diff --git a/ios/help/index.md b/ios/help/index.md index 883d4e5112ed659b94e6d94983bf305424470eb0..333dafb9f2d104948a2413a94f32590e31f25956 100644 --- a/ios/help/index.md +++ b/ios/help/index.md @@ -25,6 +25,8 @@ title: Keyman for iPhone and iPad 17.0 Help ### [Using Keyman for iPhone and iPad](basic/) * [Switching Between Keyboards](basic/switching-between-keyboards) +* [Using the Settings Screen](basic/config/) +* [Language Settings](basic/language-settings) * [Installing Custom Keyboards/Dictionaries](basic/installing-custom-keyboards-dictionaries) * [Sharing Keyboards and Dictionaries](basic/sharing-keyboards) * [Using the Keyman Browser](basic/using-keyman-browser) diff --git a/ios/help/ios_images/banner.png b/ios/help/ios_images/banner.png new file mode 100644 index 0000000000000000000000000000000000000000..e7d38e8a2ee9de8ce55335e35e982fd05a3faffb Binary files /dev/null and b/ios/help/ios_images/banner.png differ diff --git a/ios/help/ios_images/dictionary-list.png b/ios/help/ios_images/dictionary-list.png new file mode 100644 index 0000000000000000000000000000000000000000..b2af2f53f5ac0f2325dab8a05c7935863c2a8193 Binary files /dev/null and b/ios/help/ios_images/dictionary-list.png differ diff --git a/ios/help/ios_images/dictionary-select.png b/ios/help/ios_images/dictionary-select.png new file mode 100644 index 0000000000000000000000000000000000000000..ae8300530af8579072b8ef5c0bf687ee897b4d2b Binary files /dev/null and b/ios/help/ios_images/dictionary-select.png differ diff --git a/ios/help/ios_images/find-new.png b/ios/help/ios_images/find-new.png new file mode 100644 index 0000000000000000000000000000000000000000..b76df881b690c6542de9dfcf755c9f7f1bda54f9 Binary files /dev/null and b/ios/help/ios_images/find-new.png differ diff --git a/ios/help/ios_images/language-settings.png b/ios/help/ios_images/language-settings.png new file mode 100644 index 0000000000000000000000000000000000000000..1cea1ffcc1174573acb59dd5d09ad7d244d76075 Binary files /dev/null and b/ios/help/ios_images/language-settings.png differ diff --git a/ios/help/ios_images/no-banner.png b/ios/help/ios_images/no-banner.png new file mode 100644 index 0000000000000000000000000000000000000000..68a19f67f6c953452722a515e9ce7e631d4286d7 Binary files /dev/null and b/ios/help/ios_images/no-banner.png differ diff --git a/ios/help/ios_images/settings-screen.png b/ios/help/ios_images/settings-screen.png new file mode 100644 index 0000000000000000000000000000000000000000..1e5c72b7f853965362b61a2636e4ab30ffcc193a Binary files /dev/null and b/ios/help/ios_images/settings-screen.png differ diff --git a/ios/help/ios_images/spacebar-caption.png b/ios/help/ios_images/spacebar-caption.png new file mode 100644 index 0000000000000000000000000000000000000000..2577c59e81d90846a8eceb181e2205665ced0a1c Binary files /dev/null and b/ios/help/ios_images/spacebar-caption.png differ diff --git a/ios/help/ios_images/system-wide-setting.png b/ios/help/ios_images/system-wide-setting.png new file mode 100644 index 0000000000000000000000000000000000000000..126fe13ec12cc05450ac5dba43a60b5aa1d6d691 Binary files /dev/null and b/ios/help/ios_images/system-wide-setting.png differ diff --git a/ios/i18n-export.sh b/ios/i18n-export.sh index 12d5b0e5a3d1658a1021454a1ad068d5795a16c9..5ae87a6f97f3f8b8be19ce6e4b9f420d7fdb04bd 100755 --- a/ios/i18n-export.sh +++ b/ios/i18n-export.sh @@ -2,8 +2,8 @@ ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE # Include our resource functions; they're pretty useful! diff --git a/ios/kmbuild.sh b/ios/kmbuild.sh index 401e2c483ed3f8ef44a9137eb3474a227f977734..f443f04c2589d9cf10be7c9d7ec91428482f6100 100755 --- a/ios/kmbuild.sh +++ b/ios/kmbuild.sh @@ -9,8 +9,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE # This script runs from its own folder @@ -19,6 +19,7 @@ cd "$(dirname "$THIS_SCRIPT")" # Include our resource functions; they're pretty useful! . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" . "$KEYMAN_ROOT/resources/build/build-download-resources.sh" +. "$KEYMAN_ROOT/resources/build/build-help.inc.sh" # Please note that this build script (understandably) assumes that it is running on Mac OS X. verify_on_mac @@ -172,7 +173,7 @@ update_bundle ( ) { "$KEYMAN_ROOT/web/build.sh" $KMWFLAGS if [ $? -ne 0 ]; then - fail "ERROR: KeymanWeb's build.sh failed." + builder_die "ERROR: KeymanWeb's build.sh failed." fi #Copy over the relevant resources! It's easiest to do if we navigate to the resulting folder. @@ -193,14 +194,14 @@ update_bundle ( ) { # Our default resources are part of the bundle, so let's check on them. if [ ! -f "$base_dir/$BUNDLE_PATH/$DEFAULT_KBD_ID.kmp" ]; then DO_KMP_DOWNLOADS=true - warn "OVERRIDE: Performing -download-resources run, as the keyboard package is missing!" + builder_warn "OVERRIDE: Performing -download-resources run, as the keyboard package is missing!" elif [ ! -f "$base_dir/$BUNDLE_PATH/$DEFAULT_LM_ID.model.kmp" ]; then DO_KMP_DOWNLOADS=true - warn "OVERRIDE: Performing -download-resources run, as the lexical model package is missing!" + builder_warn "OVERRIDE: Performing -download-resources run, as the lexical model package is missing!" fi if [ $DO_KMP_DOWNLOADS = true ]; then - echo_heading "Downloading up-to-date packages for default resources" + builder_heading "Downloading up-to-date packages for default resources" downloadKeyboardPackage "$DEFAULT_KBD_ID" "$base_dir/$BUNDLE_PATH/$DEFAULT_KBD_ID.kmp" downloadModelPackage "$DEFAULT_LM_ID" "$base_dir/$BUNDLE_PATH/$DEFAULT_LM_ID.model.kmp" @@ -218,11 +219,11 @@ if [ $DO_CARTHAGE = true ]; then echo echo "Load dependencies with Carthage" - carthage checkout || fail "Carthage dependency loading failed" + carthage checkout || builder_die "Carthage dependency loading failed" # --no-use-binaries: due to https://github.com/Carthage/Carthage/issues/3134, # which affects the sentry-cocoa dependency. - carthage build --use-xcframeworks --no-use-binaries --platform iOS || fail "Carthage dependency loading failed" + carthage build --use-xcframeworks --no-use-binaries --platform iOS || builder_die "Carthage dependency loading failed" fi echo @@ -251,7 +252,7 @@ echo "KMEI build complete." if [ $DO_KEYMANAPP = true ]; then echo "" echo "Building offline help." - ./build-help.sh html + build_help_html ios keyman/Keyman/Keyman/resources/OfflineHelp.bundle/Contents/Resources echo "" echo "Building Keyman app." diff --git a/ios/samples/build_common.sh b/ios/samples/build_common.sh index 22cfdeecfca8372d8840685fbd65b3a74d221d74..e1ed7ee95fb07307caf721d4c718084df9e333bf 100755 --- a/ios/samples/build_common.sh +++ b/ios/samples/build_common.sh @@ -9,8 +9,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE # Please note that this build script (understandably) assumes that it is running on Mac OS X. @@ -129,7 +129,7 @@ if [ $DO_UPDATE = true ]; then fi # Copy resources. - cp -Rf "$KEYMAN_ENGINE_FRAMEWORK_SRC" "$KEYMAN_ENGINE_FRAMEWORK_DST" + /bin/cp -Rf "$KEYMAN_ENGINE_FRAMEWORK_SRC" "$KEYMAN_ENGINE_FRAMEWORK_DST" fi if [ $CODE_SIGN = true ]; then diff --git a/ios/scripts/kme-universal.sh b/ios/scripts/kme-universal.sh index d197dc02906ab9fdcfe36ba44ffea07f73a96178..57d928099649c4fd956f844497289ea63a5dfe30 100755 --- a/ios/scripts/kme-universal.sh +++ b/ios/scripts/kme-universal.sh @@ -5,8 +5,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE SCHEME_NAME="KeymanEngine" diff --git a/ios/tools/prepRelease.sh b/ios/tools/prepRelease.sh index 6488bbc87aa937c8ac31de017d06858414347ccd..39b46722f79c973bee51d128192bfac1cc647c6f 100755 --- a/ios/tools/prepRelease.sh +++ b/ios/tools/prepRelease.sh @@ -11,8 +11,8 @@ set -e ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE # This script runs from its parent's folder @@ -70,17 +70,17 @@ KEYMAN_SAMPLES="samples" echo "engine dest: $KMEI_DST" -echo "Zipping ${UNI_FRAMEWORK} => ${UPLOAD_DIR}/${KMEI_DST}..." +echo "Zipping ${FRAMEWORK} => ${UPLOAD_DIR}/${KMEI_DST}..." cd "${KMEI_FRAMEWORK_BASE}" -zip -qrX ${KMEI_DST} ${FRAMEWORK} -cd $WORK_DIR +zip -qrX "${KMEI_DST}" ${FRAMEWORK} +cd "$WORK_DIR" echo "Copying Keyman Engine samples into ${UPLOAD_DIR}/${KMEI_DST_NAME}..." cp -rf "${KEYMAN_SAMPLES}" "${UPLOAD_DIR}/samples" cd "${UPLOAD_DIR}" zip -qr "${KMEI_DST_NAME}" "samples" rm -rf "samples" -cd $WORK_DIR +cd "$WORK_DIR" # # Keyman app diff --git a/linux/.gitignore b/linux/.gitignore index bb6ad7a741cad87054466411f7da93fe155a3f9f..478f418b608e52d3898a613528475097a4d10e4d 100644 --- a/linux/.gitignore +++ b/linux/.gitignore @@ -1,35 +1,8 @@ # linux -.deps/ -autom4te.cache *.o *.orig -Makefile.in -configure -aclocal.m4 -config.guess -config.sub config.h -config.h.in -config.log -config.rpath -config.status -compile -depcomp -install-sh -libtool ltmain.sh -missing -test-driver -ylwrap -INSTALL -Makefile -ABOUT-NLS -ltoptions.m4 -ltsugar.m4 -ltversion.m4 -lt~obsolete.m4 -libtool.m4 -stamp-h1 __pycache__ *.egg-info build-* @@ -39,47 +12,8 @@ keyman-config/make_deb tmp/ dist/ *~ -# keyboardprocessor build artifacts (Keyman Core desktop) -keyboardprocessor/ # IDE config files **/.idea/ -ibus-keyman/m4/codeset.m4 -ibus-keyman/m4/glibc2.m4 -ibus-keyman/m4/glibc21.m4 -ibus-keyman/m4/intdiv0.m4 -ibus-keyman/m4/intl.m4 -ibus-keyman/m4/intldir.m4 -ibus-keyman/m4/intmax.m4 -ibus-keyman/m4/inttypes-pri.m4 -ibus-keyman/m4/inttypes_h.m4 -ibus-keyman/m4/lcmessage.m4 -ibus-keyman/m4/lock.m4 -ibus-keyman/m4/longdouble.m4 -ibus-keyman/m4/longlong.m4 -ibus-keyman/m4/printf-posix.m4 -ibus-keyman/m4/size_max.m4 -ibus-keyman/m4/stdint_h.m4 -ibus-keyman/m4/uintmax_t.m4 -ibus-keyman/m4/ulonglong.m4 -ibus-keyman/m4/visibility.m4 -ibus-keyman/m4/wchar_t.m4 -ibus-keyman/m4/wint_t.m4 -ibus-keyman/m4/xsize.m4 -ibus-keyman/m4/extern-inline.m4 -ibus-keyman/m4/fcntl-o.m4 -ibus-keyman/m4/gettext.m4 -ibus-keyman/m4/iconv.m4 -ibus-keyman/m4/intlmacosx.m4 -ibus-keyman/m4/lib-ld.m4 -ibus-keyman/m4/lib-link.m4 -ibus-keyman/m4/lib-prefix.m4 -ibus-keyman/m4/nls.m4 -ibus-keyman/m4/po.m4 -ibus-keyman/m4/progtest.m4 -ibus-keyman/m4/threadlib.m4 -ibus-keyman/po/Makefile.in.in -ibus-keyman/po/Makevars.template -ibus-keyman/po/Rules-quot upload/ launchpad launchpad-* diff --git a/linux/.pbuilderrc b/linux/.pbuilderrc index 21b738f1d9981cd2139090d805598e485c4dc79e..1384eec453548017b10ee36eebab6d17b842d352 100644 --- a/linux/.pbuilderrc +++ b/linux/.pbuilderrc @@ -14,7 +14,7 @@ DEBIAN_SUITES=($UNSTABLE_CODENAME $TESTING_CODENAME $STABLE_CODENAME $STABLE_BAC "experimental" "unstable" "testing" "stable") # List of Ubuntu suites. Update these when needed. -UBUNTU_SUITES=("kinetic" "jammy" "focal" "bionic") +UBUNTU_SUITES=("lunar" "kinetic" "jammy" "focal") # Mirrors to use. Update these to your preferred mirror. DEBIAN_MIRROR="deb.debian.org" diff --git a/linux/Jenkinsfile b/linux/Jenkinsfile index 15f5b27777d79d4442b63efac7d1d1650aa606f4..b70cb95d706cfc3c24ccf6e90a242f407d74ccae 100644 --- a/linux/Jenkinsfile +++ b/linux/Jenkinsfile @@ -5,7 +5,7 @@ @Library('lsdev-pipeline-library') _ keymanPackaging { - distributionsToPackage = 'focal jammy kinetic' + distributionsToPackage = 'focal jammy kinetic lunar' arches = 'amd64 i386' packagesToBuild = ['keyman'] } diff --git a/linux/Makefile b/linux/Makefile index af2a83a69c270abec2db69b5ba2233c061bc52ab..a4ce57bbe04942caf96201ebad34400fa7758494 100644 --- a/linux/Makefile +++ b/linux/Makefile @@ -32,7 +32,7 @@ sources: ./scripts/dist.sh tmpsources: - PKG_CONFIG_PATH="../keyboardprocessor/arch/release/meson-private" ./scripts/dist.sh + PKG_CONFIG_PATH="../../core/build/arch/release/meson-private" ./scripts/dist.sh origdist: ./scripts/dist.sh origdist @@ -54,10 +54,8 @@ nightlydist: reconf sources check: cd keyman-config && ./run-tests.sh - cd ibus-keyman && make check + cd ibus-keyman && ./build.sh test -tmpcheck: - cd keyman-config && ./run-tests.sh - cd build-ibus-keyman && make check +tmpcheck: check tests: check diff --git a/linux/VERSION b/linux/VERSION deleted file mode 120000 index cd581fe79358e8edc7639dd8dd1ea7eea055e641..0000000000000000000000000000000000000000 --- a/linux/VERSION +++ /dev/null @@ -1 +0,0 @@ -../VERSION.md \ No newline at end of file diff --git a/linux/build.sh b/linux/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..8bdbb368c7ea260e50671ab0196d3527e1505a63 --- /dev/null +++ b/linux/build.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env bash + +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +################################ Main script ################################ + +cd "$THIS_SCRIPT_PATH" + +builder_describe \ + "Build Keyman for Linux." \ + ":engine=ibus-keyman ibus-keyman" \ + ":config=keyman-config keyman-config" \ + "clean" \ + "configure" \ + "build" \ + "test" \ + "install install artifacts" \ + "uninstall uninstall artifacts" + +builder_parse "$@" + +builder_run_child_actions clean configure build test install uninstall diff --git a/linux/build/agent/dependencies.config b/linux/build/agent/dependencies.config deleted file mode 100644 index a9058fe8eda3a4a3ebef2cfd1db09e46b063c7b3..0000000000000000000000000000000000000000 --- a/linux/build/agent/dependencies.config +++ /dev/null @@ -1,23 +0,0 @@ -# This git config file lists the build dependencies for building Keyman on Linux. -# -# Possible sections are [common] which apply to all versions of Ubuntu/Debian, distribution -# specific sections, e.g. [Ubuntu] (generated by running lsb_release -i -s), and version -# specific sections, e.g. [precise]. Version specific names are generated by running -# lsb_release -c -s. -# Each section can have up to three variables: -# any - applies to all architectures -# i386 and amd64 - applies only to 32- or 64-bit architecture (output of dpkg --print-architecture) -# -# [common] -# any=build-essential automake uuid-dev -# i386=xvfb -# -# [precise] -# any=xulrunner-1.9.2 -# -# # For quantal use the same packages as for precise -# [quantal] -# any=@precise.any - -[common] -any=git autotools-dev build-essential dh-autoreconf libibus-1.0-dev flex bison meson python3 python3-pip cargo xserver-xephyr xvfb metacity libx11-dev gawk libgtk-3-dev libjson-glib-dev diff --git a/linux/build/agent/install-deps b/linux/build/agent/install-deps deleted file mode 100755 index fac1d5ffc20b73a98fb15bafb93d2440de64a6a4..0000000000000000000000000000000000000000 --- a/linux/build/agent/install-deps +++ /dev/null @@ -1,36 +0,0 @@ -#!/bin/bash -e -# Install required dependencies for building Keyman on Linux -# (copied from wesay/build/agent/install-deps) - -# get packages from config file listed in the variable $1 -getPackages() -{ - packages=$(git config -f $(dirname "$0")/dependencies.config --get "$1" 2>/dev/null) - for package in $packages; do - if [ "${package:0:1}" = "@" ]; then - getPackages "${package:1}" - else - echo -n "$package " - fi - done -} - -# Install packages $@ -install() -{ - if [ $# -gt 0 ]; then - sudo apt install -y "$@" - fi -} - -distribution=$(lsb_release -i -s) -version=$(lsb_release -c -s) -arch=$(dpkg --print-architecture) - -sudo apt update -install $(getPackages common.any) -install $(getPackages common.$arch) -install $(getPackages $distribution.any) -install $(getPackages $distribution.$arch) -install $(getPackages $version.any) -install $(getPackages $version.$arch) diff --git a/linux/debian/changelog b/linux/debian/changelog index 4866bc247a7823882ee63c366324ad4a2cc6a48b..9f69cc9a12fb8cff409c44c39751958f1cf4d7c9 100644 --- a/linux/debian/changelog +++ b/linux/debian/changelog @@ -1,3 +1,36 @@ +keyman (16.0.139-4) unstable; urgency=medium + + * debian/tests: Revert previous change and ignore s390x from autopkgtests + + -- Eberhard Beilharz Fri, 24 Mar 2023 16:05:07 +0100 + +keyman (16.0.139-3) unstable; urgency=medium + + * debian/tests: Run autopkgtests on s390x but immediately return + + -- Eberhard Beilharz Wed, 22 Mar 2023 19:25:02 +0100 + +keyman (16.0.139-2) unstable; urgency=medium + + * Don't build on s390x because Keyman doesn't work on big-endian architectures + (upstream bug https://github.com/keymanapp/keyman/issues/5111) + + -- Eberhard Beilharz Mon, 20 Mar 2023 19:54:44 +0100 + +keyman (16.0.139-1) unstable; urgency=medium + + * New upstream release. + * Re-release to Debian + + -- Eberhard Beilharz Thu, 16 Mar 2023 08:59:04 +0100 + +keyman (16.0.138-4) unstable; urgency=medium + + * Team upload + * debian/tests/control: Don't run autopkgtest on s390x + + -- Gunnar Hjalmarsson Sat, 11 Feb 2023 18:39:13 +0100 + keyman (16.0.138-3) unstable; urgency=medium * debian/tests/test-build: Fix autopkgtests diff --git a/linux/debian/control b/linux/debian/control index 33f50a90dcd7f7f45dab0a1978f74ed907fb4378..40b2065d7f7fb9292ce55170977ec5e758471b59 100644 --- a/linux/debian/control +++ b/linux/debian/control @@ -22,13 +22,14 @@ Build-Depends: python3-pil, python3-pip, python3-qrcode, - python3-sentry-sdk (>= 1.1) | python3-raven, + python3-sentry-sdk (>= 1.1), python3-requests, python3-requests-cache, python3-setuptools, meson (>= 0.53), ninja-build, libgtk-3-dev, + libicu-dev, libibus-1.0-dev (>= 1.2), libjson-glib-dev (>= 1.4.0), pkg-config, @@ -85,7 +86,7 @@ Depends: keyman-engine, python3-bs4, python3-gi, - python3-sentry-sdk (>= 1.1) | python3-raven, + python3-sentry-sdk (>= 1.1), dbus-x11, ${misc:Depends}, ${python3:Depends}, @@ -105,7 +106,7 @@ Description: Keyman for Linux configuration information about Keyman keyboard packages. Package: libkmnkbp-dev -Architecture: any +Architecture: amd64 arm64 armel armhf i386 mipsel mips64el ppc64el riscv64 Section: libdevel Depends: libkmnkbp0-0 (= ${binary:Version}), @@ -129,7 +130,7 @@ Description: Development files for Keyman keyboard processing library This package contains development headers and libraries. Package: libkmnkbp0-0 -Architecture: any +Architecture: amd64 arm64 armel armhf i386 mipsel mips64el ppc64el riscv64 Section: libs Pre-Depends: ${misc:Pre-Depends}, @@ -155,10 +156,9 @@ Description: Keyman keyboard processing library and applies rules from compiled Keyman keyboard files. Package: ibus-keyman -Architecture: any +Architecture: amd64 arm64 armel armhf i386 mipsel mips64el ppc64el riscv64 Depends: ibus (>= 1.3.7), - sudo, libkmnkbp0-0 (= ${binary:Version}), ${misc:Depends}, ${shlibs:Depends}, diff --git a/linux/debian/copyright b/linux/debian/copyright index 292f45bd75710993b82e8c3da4702bd6d2cbd1bc..1b0defab65d52332997df1b7ebe4abd29355c0f1 100644 --- a/linux/debian/copyright +++ b/linux/debian/copyright @@ -24,62 +24,6 @@ Files: linux/ibus-keyman/src/keyman-service.c Copyright: 2018-2023 SIL International License: GPL-3+ -Files: linux/ibus-keyman/config.rpath - linux/ibus-keyman/m4/* -Copyright: 1996-2003, 2009-2015, Free Software Foundation, Inc. -License: FSFULLR - -Files: linux/ibus-keyman/Makefile.am - linux/ibus-keyman/Makefile.in - linux/ibus-keyman/compile - linux/ibus-keyman/configure.ac - linux/ibus-keyman/depcomp - linux/ibus-keyman/m4/Makefile.am - linux/ibus-keyman/m4/Makefile.in - linux/ibus-keyman/missing - linux/ibus-keyman/src/Makefile.am - linux/ibus-keyman/src/Makefile.in - linux/ibus-keyman/src/engine.c - linux/ibus-keyman/src/engine.h - linux/ibus-keyman/src/main.c - linux/ibus-keyman/src/test/Makefile.am - linux/ibus-keyman/src/test/Makefile.in - linux/ibus-keyman/tap-driver.sh - linux/ibus-keyman/test-driver - linux/ibus-keyman/tests/Makefile.am - linux/ibus-keyman/tests/Makefile.in -Copyright: 1994-2017, Free Software Foundation, Inc. - 2009-2023, SIL International -License: GPL-2+ - -Files: linux/ibus-keyman/m4/gettext.m4 - linux/ibus-keyman/m4/intl.m4 - linux/ibus-keyman/m4/intldir.m4 - linux/ibus-keyman/m4/intlmacosx.m4 - linux/ibus-keyman/m4/lcmessage.m4 - linux/ibus-keyman/m4/nls.m4 - linux/ibus-keyman/m4/po.m4 - linux/ibus-keyman/m4/progtest.m4 -Copyright: 1995-2014, Free Software Foundation, Inc. -License: FSFULLR or GPL-3 or LGPL-3 - -Files: linux/ibus-keyman/install-sh -Copyright: 1994, X Consortium - 2018, SIL International -License: MIT - -Files: linux/ibus-keyman/INSTALL - linux/ibus-keyman/po/Makefile.in.in -Copyright: 1994-1996, 1999-2002, 2004-2016, Free Software Foundation, Inc. - 1995-1997, 2000-2007, 2009-2010, Ulrich Drepper -License: FSFAP - -Files: linux/ibus-keyman/icons/Makefile.am - linux/ibus-keyman/icons/Makefile.in -Copyright: 1994-2017, Free Software Foundation, Inc. - 2018, SIL International -License: LGPL-2+ - Files: linux/ibus-keyman/tests/ibusimcontext.c linux/ibus-keyman/tests/ibusimcontext.h Copyright: 2008-2010, Peng Huang @@ -139,24 +83,6 @@ License: GPL-2+ License version 2 can be found in the file `/usr/share/common-licenses/GPL-2'. -License: GPL-3 - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation, version 3. - . - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. - . - You should have received a copy of the GNU General Public License - along with this package; if not, write to the Free Software - Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA - . - On Debian systems, the full text of the GNU General Public - License version 3 can be found in the file - `/usr/share/common-licenses/GPL-3'. - License: GPL-3+ This package is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -176,35 +102,6 @@ License: GPL-3+ License version 3 can be found in the file `/usr/share/common-licenses/GPL-3'. -License: FSFULLR - This file is free software; the Free Software Foundation gives unlimited - permission to copy and/or distribute it, with or without modifications, as long - as this notice is preserved. - -License: FSFAP - Copying and distribution of this file, with or without modification, are - permitted in any medium without royalty provided the copyright notice and this - notice are preserved. This file is offered as-is, without any warranty. - -License: LGPL-2+ - This library is free software; you can redistribute it and/or modify it under - the terms of the GNU Library General Public License as published by the Free - Software Foundation; either version 2 of the License, or (at your option) - any later version. - . - This library is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS - FOR A PARTICULAR PURPOSE. See the GNU Library General Public License for more - details. - . - You should have received a copy of the GNU Library General Public License - along with this library; if not, write to the Free Software Foundation, Inc., - 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. - . - On Debian systems, the full text of the GNU Library General Public - License version 2 can be found in the file - `/usr/share/common-licenses/LGPL-2'. - License: LGPL-2.1+ This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free @@ -223,7 +120,3 @@ License: LGPL-2.1+ On Debian systems, the full text of the GNU Lesser General Public License version 2.1 can be found in the file `/usr/share/common-licenses/LGPL-2.1'. - -License: LGPL-3 - On Debian systems, the full text of the GNU Lesser General Public - License version 3 can be found in `/usr/share/common-licenses/LGPL-3'. diff --git a/linux/debian/ibus-keyman.postinst b/linux/debian/ibus-keyman.postinst index 57c22b8d6de4dda3b2ba3b815b53418f0bddc671..6cff5c525c0b8ae1c5c0d4c064cf9aa8210c9cd2 100644 --- a/linux/debian/ibus-keyman.postinst +++ b/linux/debian/ibus-keyman.postinst @@ -1,16 +1,19 @@ -#!/bin/sh +#!/bin/bash +# Exit on errors - Debian policy 10.4 set -e case "$1" in configure) + # (Re-)Start IBus + # if don't have sudo and ps then don't attempt to restart ibus if which sudo > /dev/null && which ps > /dev/null; then # check for gnome-shell as it works differently - ! gspid=`ps -C gnome-shell -o pid=|head -n 1` - if [ "x$gspid" != "x" ]; then + ! gspid=$(ps -C gnome-shell -o pid=|head -n 1) + if [ "$gspid" != "" ]; then # gnome-shell has multiple ibus-daemon processes and needs exit instead of restart is_gnome_shell=1 else @@ -18,17 +21,17 @@ case "$1" in fi # Restart IBus if it is running - ! ibuspid=`ps -C ibus-daemon -o pid=|head -n 1` + ! ibuspid=$(ps -C ibus-daemon -o pid=|head -n 1) - if [ "x$ibuspid" != "x" ]; then - if [ "x$is_gnome_shell" = "x1" ]; then - ibususers=`ps -C ibus-daemon -o user=|grep -v gdm|uniq` + if [ "$ibuspid" != "" ]; then + if [ "$is_gnome_shell" = "1" ]; then + ibususers=$(ps -C ibus-daemon -o user=|grep -v gdm|uniq) for ibususer in $ibususers; do sudo -H -u "$ibususer" ibus exit || true sleep 1s done else - ibususers=`ps -C ibus-daemon -o user=|uniq` + ibususers=$(ps -C ibus-daemon -o user=|uniq) for ibususer in $ibususers; do sudo -H -u "$ibususer" ibus restart || true sleep 1s @@ -37,20 +40,20 @@ case "$1" in fi # Verify that it's running now - if [ ! -z $SUDO_USER ] && id $SUDO_USER > /dev/null 2>/dev/null; then - ! ibusdaemon=$(ps --user $SUDO_USER -o s= -o cmd | grep --regexp="^[^ZT] ibus-daemon .*--xim.*") - if [ "x$ibusdaemon" = "x" ]; then + if [ -n "$SUDO_USER" ] && id "$SUDO_USER" > /dev/null 2>/dev/null; then + ! ibusdaemon=$(ps --user "$SUDO_USER" -o s= -o cmd | grep --regexp="^[^ZT] \(/usr/bin/\)\?ibus-daemon .*--xim.*") + if [ "$ibusdaemon" = "" ]; then # otherwise try to start it for the user installing the package - if [ "x$is_gnome_shell" = "x1" ]; then - for session in $(loginctl show-user ${SUDO_USER} -p Sessions --value); do - case $(loginctl show-session ${session} -p Type --value) in - wayland) sudo -H -u "${SUDO_USER}" -i WAYLAND_DISPLAY=wayland-0 -- ibus-daemon -d -r --xim --panel disable;; - x11) sudo -H -u "${SUDO_USER}" -- ibus-daemon -d -r --xim --panel disable;; + if [ "$is_gnome_shell" = "1" ]; then + for session in $(loginctl show-user "${SUDO_USER}" -p Sessions --value); do + case $(loginctl show-session "${session}" -p Type --value) in + wayland) sudo -H -u "${SUDO_USER}" -i WAYLAND_DISPLAY=wayland-0 -- /usr/bin/ibus-daemon -d -r --xim --panel disable;; + x11) sudo -H -u "${SUDO_USER}" -- /usr/bin/ibus-daemon -d -r --xim --panel disable;; *) ;; esac done else - sudo -H -u "${SUDO_USER}" -- ibus-daemon -d -r --xim + sudo -H -u "${SUDO_USER}" -- /usr/bin/ibus-daemon -d -r --xim fi fi fi diff --git a/linux/debian/ibus-keyman.postrm b/linux/debian/ibus-keyman.postrm index 088e35e856a08edc67c07c7536ad29195491bba0..c27030a468bf55301a398b9216e1fc16b3def111 100644 --- a/linux/debian/ibus-keyman.postrm +++ b/linux/debian/ibus-keyman.postrm @@ -9,19 +9,18 @@ case "$1" in if which sudo > /dev/null && which ps > /dev/null; then # Restart IBus if it is running - ! ibuspid=`ps -C ibus-daemon -o pid=|head -n 1` - - if [ "x$ibuspid" != "x" ]; then + ibuspid=$(ps -C ibus-daemon -o pid=|head -n 1) + if [ "$ibuspid" != "" ]; then # check for gnome-shell as it works differently - ! gspid=`ps -C gnome-shell -o pid=|head -n 1` - if [ "x$gspid" != "x" ]; then + gspid=$(ps -C gnome-shell -o pid=|head -n 1) + if [ "$gspid" != "" ]; then # gnome-shell has multiple ibus-daemon processes and needs exit instead of restart - ibususers=`ps -C ibus-daemon -o user=|grep -v gdm|uniq` + ibususers=$(ps -C ibus-daemon -o user=|grep -v gdm|uniq) for ibususer in $ibususers; do sudo -H -u "$ibususer" ibus exit || true done else - ibususers=`ps -C ibus-daemon -o user=|uniq` + ibususers=$(ps -C ibus-daemon -o user=|uniq) for ibususer in $ibususers; do sudo -H -u "$ibususer" ibus restart || true done diff --git a/linux/debian/libkmnkbp-dev.install b/linux/debian/libkmnkbp-dev.install index 053b9de35533f68250b49bc352e2ee2fa479bb2d..1603d9594999e50e928be9bf0b294fceb9713200 100644 --- a/linux/debian/libkmnkbp-dev.install +++ b/linux/debian/libkmnkbp-dev.install @@ -1,3 +1,4 @@ usr/include/keyman/* +usr/lib/*/lib*.a usr/lib/*/lib*.so usr/lib/*/pkgconfig diff --git a/linux/debian/rules b/linux/debian/rules index 0ea917118ffb46eb1e8bb28f69f3d678b5758ce8..774371d252ab67ea06bb123d740c8920fec9218e 100755 --- a/linux/debian/rules +++ b/linux/debian/rules @@ -9,6 +9,8 @@ export PYBUILD_INSTALL_ARGS=--install-scripts=/usr/share/keyman-config/ export KEYMAN_PKG_BUILD=1 +export XDG_DATA_HOME=$(shell mktemp -d) + # xenial needs this to be explicit export LC_ALL=C.UTF-8 @@ -20,26 +22,25 @@ include /usr/share/dpkg/pkg-info.mk dh $@ --with-python3 override_dh_auto_configure: - # keymankeyboardprocessor + # keymankeyboardprocessor - we need to configure and build core before + # we can configure ibus-keyman! cd core && \ - ./build.sh configure -- --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc \ + ./build.sh --no-tests configure:arch build:arch -- --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc \ --localstatedir=/var --libdir=lib/$(DEB_TARGET_MULTIARCH) \ --libexecdir=lib/$(DEB_TARGET_MULTIARCH) # ibus-keyman cd linux/ibus-keyman && \ - cp -f ../../VERSION.md VERSION && \ - export KEYMAN_PROC_CFLAGS="-I$(CURDIR)/core/build/arch/release/include -I$(CURDIR)/common/include -I$(CURDIR)/core/include" && \ - export KEYMAN_PROC_LIBS="-L$(CURDIR)/core/build/arch/release/src -lkmnkbp0" && \ - export PKG_CONFIG_PATH=$(CURDIR)/core/build/arch/release/meson-private && \ - ./autogen.sh && \ - ./configure --prefix=/usr + ./build.sh configure -- --wrap-mode=nodownload --prefix=/usr --sysconfdir=/etc \ + --localstatedir=/var # keyman-config override_dh_auto_build: # keymankeyboardprocessor - cd core && ./build.sh build + cd core && \ + ./build.sh --no-tests build:arch # ibus-keyman - cd linux/ibus-keyman && make + cd linux/ibus-keyman && \ + ./build.sh build # keyman-config cd linux/keyman-config && \ make man && \ @@ -50,19 +51,22 @@ override_dh_auto_build: override_dh_auto_test: ifeq (,$(filter nocheck,$(DEB_BUILD_OPTIONS))) # keymankeyboardprocessor - cd core && ./build.sh tests + cd core && \ + ./build.sh --no-tests test:arch # ibus-keyman - cd linux/ibus-keyman && make check VERBOSE=1 + cd linux/ibus-keyman && \ + ./build.sh test # keyman-config dh_auto_test --sourcedir=linux/keyman-config --buildsystem=pybuild $@ endif override_dh_auto_install: - # keymankeyboardprocessor install -d $(CURDIR)/debian/tmp - cd core && DESTDIR=$(CURDIR)/debian/tmp ./build.sh install + cd core && \ + DESTDIR=$(CURDIR)/debian/tmp ./build.sh --no-tests install:arch # ibus-keyman - cd linux/ibus-keyman && make install DESTDIR=$(CURDIR)/debian/tmp + cd linux/ibus-keyman && \ + DESTDIR=$(CURDIR)/debian/tmp ./build.sh install # keyman-config install -d $(CURDIR)/debian/keyman/usr/share/ cp -r linux/keyman-config/locale/ $(CURDIR)/debian/keyman/usr/share/ diff --git a/linux/debian/tests/control b/linux/debian/tests/control index af7e864b970e99bc6360ef6222ba1d7fb7061fd6..c1164c9c8e01baa657310224325daa9c19a33d23 100644 --- a/linux/debian/tests/control +++ b/linux/debian/tests/control @@ -2,3 +2,4 @@ Tests: test-build Depends: @, build-essential, pkg-config, +Architecture: amd64 arm64 armel armhf i386 mips64el mipsel ppc64el riscv64 diff --git a/linux/help/common/index.md b/linux/help/common/index.md index 7bbc820dd0de6641616c99fde5f6bf16c9ae40b2..a25eb07da08f2a0d154b8e4d6dad4182ec0fa04b 100644 --- a/linux/help/common/index.md +++ b/linux/help/common/index.md @@ -57,22 +57,28 @@ sudo dpkg --purge ibus-kmfl libkmfl ## Q. What Linux distros will Keyman work with? -**A.** Keyman runs on Debian, Ubuntu, Wasta Linux and can be compiled to run from source in most distributions. +**A.** Keyman runs on Debian, Ubuntu, Wasta Linux and can be compiled to run +from source in most distributions. **Note:** Keyman for Linux no longer supports Ubuntu 16.04 LTS (Xenial Xerus). +Keyman 16 was the last version that supports Ubuntu 18.04 LTS (Bionic Beaver). ## Q. Will my existing Windows Keyman keyboard work with Keyman for Linux? -**A.** Most keyboards will work without change. A small subset of keyboards require features which -are not yet available in Keyman for Linux. These features will be progressively implemented. +**A.** Most keyboards will work without change. A small subset of keyboards +require features which are not yet available in Keyman for Linux. These +features will be progressively implemented. ## Q. How can I disable automatically reporting errors? -**A.** If Keyman crashes, it will automatically send a report to the development team. This report -is anonymous and contains only technical details relating to the crash. It does not include keystroke -data or personally identifying data. If you don't want these automatic error reports to be sent you -can set the environment variable `KEYMAN_NOSENTRY`: +**A.** If Keyman crashes, it will automatically send a report to the development +team. This report is anonymous and contains only technical details relating to +the crash. It does not include keystroke data or personally identifying data. If +you don't want these automatic error reports to be sent you can set the +environment variable `KEYMAN_NOSENTRY` and start `km-config` from +the command line: ```bash export KEYMAN_NOSENTRY=1 +km-config ``` diff --git a/linux/ibus-keyman/.gitignore b/linux/ibus-keyman/.gitignore deleted file mode 100644 index 0927e6a92a3bb77da224e7a5a3591d5d4b95b6dd..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/.gitignore +++ /dev/null @@ -1,11 +0,0 @@ -po/POTFILES -src/keyman.xml -src/keyman.xml.in -src/keyman-version.h -src/ibus-engine-keyman -src/print_kmp -src/print_kmpdetails -src/test/keymanutil-tests -*.log -*.trs -.dirstamp diff --git a/linux/ibus-keyman/AUTHORS b/linux/ibus-keyman/AUTHORS deleted file mode 100644 index 1c7ea76f1e18cca0b3862e17fd3648902e09693f..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/AUTHORS +++ /dev/null @@ -1,3 +0,0 @@ -# File required by autotools -Daniel Glassey -Eberhard Beilharz diff --git a/linux/ibus-keyman/ChangeLog b/linux/ibus-keyman/ChangeLog deleted file mode 100644 index 6558490a292c34fa8cd8e7b03d814198fa999d37..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/ChangeLog +++ /dev/null @@ -1 +0,0 @@ -# File required by autotools diff --git a/linux/ibus-keyman/Makefile.am b/linux/ibus-keyman/Makefile.am deleted file mode 100644 index d74946bed268451780bb8c4a53b9f67d77cee994..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/Makefile.am +++ /dev/null @@ -1,44 +0,0 @@ -# vim:set noet ts=4: -# -# ibus-keyman - The Keyman engine for IBus -# -# Copyright (c) 2009-2018 SIL International -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -SUBDIRS = \ - src \ - tests \ - icons \ - m4 \ - po \ - $(NULL) - -ACLOCAL_AMFLAGS = -I m4 - -EXTRA_DIST = \ - autogen.sh \ - VERSION \ - tap-driver.sh \ - tap-test \ - $(NULL) - -noinst_DIST = \ - $(NULL) - - -DISTCLEANFILES = \ - po/stamp-it \ - $(NULL) diff --git a/linux/ibus-keyman/NEWS b/linux/ibus-keyman/NEWS deleted file mode 100644 index 6558490a292c34fa8cd8e7b03d814198fa999d37..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/NEWS +++ /dev/null @@ -1 +0,0 @@ -# File required by autotools diff --git a/linux/ibus-keyman/README b/linux/ibus-keyman/README deleted file mode 100644 index 09f716427227bd5ca13633b1d02fae0f10eb324e..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/README +++ /dev/null @@ -1,3 +0,0 @@ -Keyman engine for IBus - -This readme is required by autoconf. Otherwise see README.md. \ No newline at end of file diff --git a/linux/ibus-keyman/README.repo b/linux/ibus-keyman/README.repo deleted file mode 100644 index 6b2703bf277af55520f92a25070a00fc96f23a79..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/README.repo +++ /dev/null @@ -1,3 +0,0 @@ -You need autoconf, autopoint, gettext, automake and libtool to generate the build system - -Run ./autogen.sh to run them diff --git a/linux/ibus-keyman/VERSION b/linux/ibus-keyman/VERSION deleted file mode 120000 index 6ff19de4b804f2eca2b2d72657dd908c216b6537..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/VERSION +++ /dev/null @@ -1 +0,0 @@ -../VERSION \ No newline at end of file diff --git a/linux/ibus-keyman/autogen.sh b/linux/ibus-keyman/autogen.sh deleted file mode 100755 index 905970e6dff16432d4539294f9b8db430731028f..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/autogen.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -autoreconf -if diff --git a/linux/ibus-keyman/build.sh b/linux/ibus-keyman/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..8a16bbb1deafe1f08024fd91c3174f5429d35068 --- /dev/null +++ b/linux/ibus-keyman/build.sh @@ -0,0 +1,76 @@ +#!/usr/bin/env bash + +set -eu + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +################################ Main script ################################ + +builder_describe \ + "Build ibus-keyman." \ + ":engine" \ + "clean" \ + "configure" \ + "build" \ + "test" \ + "install install artifacts" \ + "uninstall uninstall artifacts" \ + "@/core:arch" + +builder_parse "$@" + +if builder_is_debug_build; then + MESON_TARGET=debug + export CPPFLAGS=-DG_MESSAGES_DEBUG + export CFLAGS="-O0" + export CXXFLAGS="-O0" +else + MESON_TARGET=release +fi +MESON_PATH="../build/$(uname -m)/$MESON_TARGET" + +cd "$THIS_SCRIPT_PATH" + +builder_describe_outputs \ + configure "${MESON_PATH}/build.ninja" \ + build "${MESON_PATH}/src/ibus-engine-keyman" + +if builder_start_action clean; then + rm -rf "$THIS_SCRIPT_PATH/../build/" + builder_finish_action success clean +fi + +if builder_start_action configure; then + cd "$THIS_SCRIPT_PATH" + # shellcheck disable=SC2086 + meson setup "$MESON_PATH" --werror --buildtype $MESON_TARGET "${builder_extra_params[@]}" + builder_finish_action success configure +fi + +if builder_start_action build; then + cd "$THIS_SCRIPT_PATH/$MESON_PATH" + ninja + builder_finish_action success build +fi + +if builder_start_action test; then + cd "$THIS_SCRIPT_PATH/$MESON_PATH" + meson test --print-errorlogs $builder_verbose + builder_finish_action success test +fi + +if builder_start_action install; then + cd "$THIS_SCRIPT_PATH/$MESON_PATH" + ninja install + builder_finish_action success install +fi + +if builder_start_action uninstall; then + cd "$THIS_SCRIPT_PATH/$MESON_PATH" + ninja uninstall + builder_finish_action success uninstall +fi diff --git a/linux/ibus-keyman/configure.ac b/linux/ibus-keyman/configure.ac deleted file mode 100644 index 66cbe800e067be90ac6a9271292182c27a287763..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/configure.ac +++ /dev/null @@ -1,112 +0,0 @@ -# vim:set et ts=4: -# -# ibus-keyman - The Keyman engine for IBus -# -# Copyright (c) 2009-2022 SIL International -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -# if not 1, append datestamp to the version number. -m4_define([ibus_released], [0]) -m4_define([ibus_major_version], [1]) -m4_define([ibus_minor_version], [2]) -m4_define([ibus_micro_version], [0]) -m4_define(ibus_maybe_datestamp, - m4_esyscmd([if test x]ibus_released[ != x1; then date +.%Y%m%d | tr -d '\n\r'; fi])) - -m4_define([ibus_version], - ibus_major_version.ibus_minor_version.ibus_micro_version[]ibus_maybe_datestamp) - -AC_INIT([ibus-keyman],[m4_esyscmd_s(cat VERSION)],[https://github.com/keymanapp/keyman/issues/new]) - -AM_INIT_AUTOMAKE -AC_USE_SYSTEM_EXTENSIONS - -AC_CONFIG_HEADERS([config.h]) -AC_CONFIG_MACRO_DIR([m4]) - -# define PACKAGE_VERSION_* variables -AM_SANITY_CHECK -AM_MAINTAINER_MODE -AC_DISABLE_STATIC([]) -AC_PROG_CC -AM_PROG_CC_C_O -AC_PROG_CXX -AC_SEARCH_LIBS([strerror],[cposix]) - -LT_INIT - -# check ibus -PKG_CHECK_MODULES(IBUS, [ - ibus-1.0 >= 1.2.0 -]) - -# check Gtk -PKG_CHECK_MODULES(GTK, [ - gtk+-3.0 >= 2.4 -]) - -# Check X11 -PKG_CHECK_MODULES(X11, [ - x11 >= 1.6 -]) - -# check Json glib -PKG_CHECK_MODULES(JSON_GLIB, [ - json-glib-1.0 >= 1.0 -]) - -# check Keyman keyboard processor -PKG_CHECK_MODULES(KEYMAN_PROC, [ - keyman_kmn_processor >= 0.0.0 -]) - - -# check env -AC_PATH_PROG(ENV, env) -AC_SUBST(ENV) - -# define GETTEXT_* variables -GETTEXT_PACKAGE=ibus-keyman -AC_SUBST(GETTEXT_PACKAGE) -AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,"$GETTEXT_PACKAGE", [Define to the read-only architecture-independent data directory.]) - -AM_GNU_GETTEXT([external]) -AM_GNU_GETTEXT_VERSION(0.19.7) - -# check if it's a patched ibus -SAV_CFLAGS="$CFLAGS" -CFLAGS="$IBUS_CFLAGS $CFLAGS" -AC_CHECK_DECLS([IBUS_PREFILTER_MASK, IBUS_CAP_PREFILTER], - [AC_DEFINE(IBUS_HAS_PREFILTER, 1, [Does ibus support the prefilter flag])], - [], - [[#include ]] -) -CFLAGS="$SAV_CFLAGS" - - -# OUTPUT files -AC_CONFIG_FILES([ po/Makefile.in -Makefile -src/Makefile -src/keyman.xml.in -src/keyman-version.h -src/test/Makefile -tests/Makefile -icons/Makefile -m4/Makefile -]) - -AC_OUTPUT diff --git a/linux/ibus-keyman/glib-tap.mk b/linux/ibus-keyman/glib-tap.mk deleted file mode 100644 index 686d94f1e5106947cc18dde61f013114455411e3..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/glib-tap.mk +++ /dev/null @@ -1,137 +0,0 @@ -# from https://gitlab.gnome.org/GNOME/glib/-/blob/glib-2-58/glib-tap.mk -# GLIB - Library of useful C routines - -AM_TESTS_ENVIRONMENT= \ - G_TEST_SRCDIR="$(abs_srcdir)" \ - G_TEST_BUILDDIR="$(abs_builddir)" \ - G_DEBUG=gc-friendly \ - MALLOC_CHECK_=2 \ - MALLOC_PERTURB_=$$(($${RANDOM:-256} % 256)) -LOG_DRIVER = env AM_TAP_AWK='$(AWK)' $(SHELL) $(top_srcdir)/tap-driver.sh -LOG_COMPILER = $(top_srcdir)/tap-test - -NULL = - -# initialize variables for unconditional += appending -BUILT_SOURCES = -BUILT_EXTRA_DIST = -CLEANFILES = *.log *.trs -DISTCLEANFILES = -MAINTAINERCLEANFILES = -EXTRA_DIST = -TESTS = - -# installed_test_LTLIBRARIES = -# installed_test_PROGRAMS = -# installed_test_SCRIPTS = -# nobase_installed_test_DATA = - -noinst_LTLIBRARIES = -noinst_PROGRAMS = -noinst_SCRIPTS = -noinst_DATA = - -check_LTLIBRARIES = -check_PROGRAMS = -check_SCRIPTS = -check_DATA = - -# We support a fairly large range of possible variables. It is expected that all types of files in a test suite -# will belong in exactly one of the following variables. -# -# First, we support the usual automake suffixes, but in lowercase, with the customary meaning: -# -# test_programs, test_scripts, test_data, test_ltlibraries -# -# The above are used to list files that are involved in both uninstalled and installed testing. The -# test_programs and test_scripts are taken to be actual testcases and will be run as part of the test suite. -# Note that _data is always used with the nobase_ automake variable name to ensure that installed test data is -# installed in the same way as it appears in the package layout. -# -# In order to mark a particular file as being only for one type of testing, use 'installed' or 'uninstalled', -# like so: -# -# installed_test_programs, uninstalled_test_programs -# installed_test_scripts, uninstalled_test_scripts -# installed_test_data, uninstalled_test_data -# installed_test_ltlibraries, uninstalled_test_ltlibraries -# -# Additionally, we support 'extra' infixes for programs and scripts. This is used for support programs/scripts -# that should not themselves be run as testcases (but exist to be used from other testcases): -# -# test_extra_programs, installed_test_extra_programs, uninstalled_test_extra_programs -# test_extra_scripts, installed_test_extra_scripts, uninstalled_test_extra_scripts -# -# Additionally, for _scripts and _data, we support the customary dist_ prefix so that the named script or data -# file automatically end up in the tarball. -# -# dist_test_scripts, dist_test_data, dist_test_extra_scripts -# dist_installed_test_scripts, dist_installed_test_data, dist_installed_test_extra_scripts -# dist_uninstalled_test_scripts, dist_uninstalled_test_data, dist_uninstalled_test_extra_scripts -# -# Note that no file is automatically disted unless it appears in one of the dist_ variables. This follows the -# standard automake convention of not disting programs scripts or data by default. -# -# test_programs, test_scripts, uninstalled_test_programs and uninstalled_test_scripts (as well as their disted -# variants) will be run as part of the in-tree 'make check'. These are all assumed to be runnable under -# gtester. That's a bit strange for scripts, but it's possible. - -TESTS += $(test_programs) $(test_scripts) $(uninstalled_test_programs) $(uninstalled_test_scripts) \ - $(dist_test_scripts) $(dist_uninstalled_test_scripts) - -# Note: build even the installed-only targets during 'make check' to ensure that they still work. -# We need to do a bit of trickery here and manage disting via EXTRA_DIST instead of using dist_ prefixes to -# prevent automake from mistreating gmake functions like $(wildcard ...) and $(addprefix ...) as if they were -# filenames, including removing duplicate instances of the opening part before the space, eg. '$(addprefix'. -all_test_programs = $(test_programs) $(uninstalled_test_programs) $(installed_test_programs) \ - $(test_extra_programs) $(uninstalled_test_extra_programs) $(installed_test_extra_programs) -all_test_scripts = $(test_scripts) $(uninstalled_test_scripts) $(installed_test_scripts) \ - $(test_extra_scripts) $(uninstalled_test_extra_scripts) $(installed_test_extra_scripts) -all_dist_test_scripts = $(dist_test_scripts) $(dist_uninstalled_test_scripts) $(dist_installed_test_scripts) \ - $(dist_test_extra_scripts) $(dist_uninstalled_test_extra_scripts) $(dist_installed_test_extra_scripts) -all_test_scripts += $(all_dist_test_scripts) -EXTRA_DIST += $(all_dist_test_scripts) -all_test_data = $(test_data) $(uninstalled_test_data) $(installed_test_data) -all_dist_test_data = $(dist_test_data) $(dist_uninstalled_test_data) $(dist_installed_test_data) -all_test_data += $(all_dist_test_data) -EXTRA_DIST += $(all_dist_test_data) -all_test_ltlibs = $(test_ltlibraries) $(uninstalled_test_ltlibraries) $(installed_test_ltlibraries) - -# if ENABLE_ALWAYS_BUILD_TESTS -# noinst_LTLIBRARIES += $(all_test_ltlibs) -# noinst_PROGRAMS += $(all_test_programs) -# noinst_SCRIPTS += $(all_test_scripts) -# noinst_DATA += $(all_test_data) -# else -check_LTLIBRARIES += $(all_test_ltlibs) -check_PROGRAMS += $(all_test_programs) -check_SCRIPTS += $(all_test_scripts) -check_DATA += $(all_test_data) -# endif - -# if ENABLE_INSTALLED_TESTS -# installed_test_PROGRAMS += $(test_programs) $(installed_test_programs) \ -# $(test_extra_programs) $(installed_test_extra_programs) -# installed_test_SCRIPTS += $(test_scripts) $(installed_test_scripts) \ -# $(test_extra_scripts) $(installed_test_extra_scripts) -# installed_test_SCRIPTS += $(dist_test_scripts) $(dist_test_extra_scripts) \ -# $(dist_installed_test_scripts) $(dist_installed_test_extra_scripts) -# nobase_installed_test_DATA += $(test_data) $(installed_test_data) -# nobase_installed_test_DATA += $(dist_test_data) $(dist_installed_test_data) -# installed_test_LTLIBRARIES += $(test_ltlibraries) $(installed_test_ltlibraries) -# installed_testcases = $(test_programs) $(installed_test_programs) \ -# $(test_scripts) $(installed_test_scripts) \ -# $(dist_test_scripts) $(dist_installed_test_scripts) - -# installed_test_meta_DATA = $(installed_testcases:=.test) - -# %.test: %$(EXEEXT) Makefile -# $(AM_V_GEN) ($(MKDIR_P) $(@D); \ -# echo '[Test]' > $@.tmp; \ -# echo 'Type=session' >> $@.tmp; \ -# echo 'Exec=$(installed_testdir)/$(notdir $<) --tap' >> $@.tmp; \ -# echo 'Output=TAP' >> $@.tmp; \ -# mv $@.tmp $@) - -# CLEANFILES += $(installed_test_meta_DATA) -# endif diff --git a/linux/ibus-keyman/icons/Makefile.am b/linux/ibus-keyman/icons/Makefile.am deleted file mode 100644 index f1fb7d4fdc96a7dfe281ceb4c6e2e18957529fb1..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/icons/Makefile.am +++ /dev/null @@ -1,30 +0,0 @@ -# vim:set noet ts=4: -# -# ibus-keyman - The Keyman engine for IBus -# -# Copyright (c) 2018 SIL International -# -# This library is free software; you can redistribute it and/or -# modify it under the terms of the GNU Lesser General Public -# License as published by the Free Software Foundation; either -# version 2 of the License, or (at your option) any later version. -# -# This library is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU Lesser General Public License for more details. -# -# You should have received a copy of the GNU Lesser General Public -# License along with this program; if not, write to the -# Free Software Foundation, Inc., 59 Temple Place, Suite 330, -# Boston, MA 02111-1307 USA - -icons_DATA = \ - default.png \ - $(NULL) - -iconsdir = $(datadir)/keyman/icons - -EXTRA_DIST = \ - default.png \ - $(NULL) diff --git a/linux/ibus-keyman/icons/meson.build b/linux/ibus-keyman/icons/meson.build index dce1d236141642f7a7813f0bb5fc46cb1f96619f..c2bdccbd857dd82e6cb0a12f994a7b67d376f91c 100644 --- a/linux/ibus-keyman/icons/meson.build +++ b/linux/ibus-keyman/icons/meson.build @@ -2,5 +2,5 @@ icons = files('default.png') install_data( icons, - install_dir: '{datadir}/keyman/icons' + install_dir: get_option('datadir') / 'keyman/icons' ) diff --git a/linux/ibus-keyman/m4/Makefile.am b/linux/ibus-keyman/m4/Makefile.am deleted file mode 100644 index e28146452cfe6bbcaa235b6273a2836f599d403e..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/m4/Makefile.am +++ /dev/null @@ -1,23 +0,0 @@ -# vim:set noet ts=4: -# -# ibus-keyman - The Keyman engine for IBus -# -# Copyright (c) 2018 SIL International -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -EXTRA_DIST = \ - as-version.m4 \ - $(NULL) diff --git a/linux/ibus-keyman/m4/as-version.m4 b/linux/ibus-keyman/m4/as-version.m4 deleted file mode 100644 index a5b439903e5c4c5b60d89eb8c2ff20848247084a..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/m4/as-version.m4 +++ /dev/null @@ -1,71 +0,0 @@ -dnl as-version.m4 0.2.0 - -dnl autostars m4 macro for versioning - -dnl Thomas Vander Stichele - -dnl $Id: as-version.m4,v 1.4 2004/06/01 09:40:05 thomasvs Exp $ - -dnl AS_VERSION - -dnl example -dnl AS_VERSION - -dnl this macro -dnl - AC_SUBST's PACKAGE_VERSION_MAJOR, _MINOR, _MICRO -dnl - AC_SUBST's PACKAGE_VERSION_RELEASE, -dnl which can be used for rpm release fields -dnl - doesn't call AM_INIT_AUTOMAKE anymore because it prevents -dnl maintainer mode from running correctly -dnl -dnl don't forget to put #undef PACKAGE_VERSION_RELEASE in acconfig.h -dnl if you use acconfig.h - -AC_DEFUN([AS_VERSION], -[ - PACKAGE_VERSION_MAJOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f1) - PACKAGE_VERSION_MINOR=$(echo AC_PACKAGE_VERSION | cut -d'.' -f2) - PACKAGE_VERSION_MICRO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f3) - - AC_SUBST(PACKAGE_VERSION_MAJOR) - AC_SUBST(PACKAGE_VERSION_MINOR) - AC_SUBST(PACKAGE_VERSION_MICRO) -]) - -dnl AS_NANO(ACTION-IF-NO-NANO, [ACTION-IF-NANO]) - -dnl requires AC_INIT to be called before -dnl For projects using a fourth or nano number in your versioning to indicate -dnl development or prerelease snapshots, this macro allows the build to be -dnl set up differently accordingly. - -dnl this macro: -dnl - parses AC_PACKAGE_VERSION, set by AC_INIT, and extracts the nano number -dnl - sets the variable PACKAGE_VERSION_NANO -dnl - sets the variable PACKAGE_VERSION_RELEASE, which can be used -dnl for rpm release fields -dnl - executes ACTION-IF-NO-NANO or ACTION-IF-NANO - -dnl example: -dnl AS_NANO(RELEASE="yes", RELEASE="no") - -AC_DEFUN([AS_NANO], -[ - AC_MSG_CHECKING(nano version) - - NANO=$(echo AC_PACKAGE_VERSION | cut -d'.' -f4) - - if test x"$NANO" = x || test "x$NANO" = "x0" ; then - AC_MSG_RESULT([0 (release)]) - NANO=0 - PACKAGE_VERSION_RELEASE=1 - ifelse([$1], , :, [$1]) - else - AC_MSG_RESULT($NANO) - PACKAGE_VERSION_RELEASE=0.`date +%Y%m%d.%H%M%S` - ifelse([$2], , :, [$2]) - fi - PACKAGE_VERSION_NANO=$NANO - AC_SUBST(PACKAGE_VERSION_NANO) - AC_SUBST(PACKAGE_VERSION_RELEASE) -]) diff --git a/linux/ibus-keyman/meson.build b/linux/ibus-keyman/meson.build index 689cf5a5ec87dddb489621ba22b2373adc1bca60..e8548432d4234201853fe8bcfcce2079ddfe35fd 100644 --- a/linux/ibus-keyman/meson.build +++ b/linux/ibus-keyman/meson.build @@ -36,7 +36,9 @@ configure_file(output : 'config.h', core_include_dirs = [ include_directories('../../core/src'), include_directories('../../core/src/kmx'), + include_directories('../../core/include'), include_directories('../../common/include'), + include_directories('../../core/build/arch' / get_option('buildtype') / 'include'), ] subdir('icons') diff --git a/linux/ibus-keyman/po/LINGUAS b/linux/ibus-keyman/po/LINGUAS deleted file mode 100644 index 8b137891791fe96927ad78e64b0aad7bded08bdc..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/LINGUAS +++ /dev/null @@ -1 +0,0 @@ - diff --git a/linux/ibus-keyman/po/Makevars b/linux/ibus-keyman/po/Makevars deleted file mode 100644 index 6f619148218d5dc394d7ffaae1c2979e69724848..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/Makevars +++ /dev/null @@ -1,78 +0,0 @@ -# Makefile variables for PO directory in any package using GNU gettext. - -# Usually the message domain is the same as the package name. -DOMAIN = $(PACKAGE) - -# These two variables depend on the location of this directory. -subdir = po -top_builddir = .. - -# These options get passed to xgettext. -XGETTEXT_OPTIONS = --keyword=_ --keyword=N_ - -# This is the copyright holder that gets inserted into the header of the -# $(DOMAIN).pot file. Set this to the copyright holder of the surrounding -# package. (Note that the msgstr strings, extracted from the package's -# sources, belong to the copyright holder of the package.) Translators are -# expected to transfer the copyright for their translations to this person -# or entity, or to disclaim their copyright. The empty string stands for -# the public domain; in this case the translators are expected to disclaim -# their copyright. -COPYRIGHT_HOLDER = SIL International - -# This tells whether or not to prepend "GNU " prefix to the package -# name that gets inserted into the header of the $(DOMAIN).pot file. -# Possible values are "yes", "no", or empty. If it is empty, try to -# detect it automatically by scanning the files in $(top_srcdir) for -# "GNU packagename" string. -PACKAGE_GNU = no - -# This is the email address or URL to which the translators shall report -# bugs in the untranslated strings: -# - Strings which are not entire sentences, see the maintainer guidelines -# in the GNU gettext documentation, section 'Preparing Strings'. -# - Strings which use unclear terms or require additional context to be -# understood. -# - Strings which make invalid assumptions about notation of date, time or -# money. -# - Pluralisation problems. -# - Incorrect English spelling. -# - Incorrect formatting. -# It can be your email address, or a mailing list address where translators -# can write to without being subscribed, or the URL of a web page through -# which the translators can contact you. -MSGID_BUGS_ADDRESS = $(PACKAGE_BUGREPORT) - -# This is the list of locale categories, beyond LC_MESSAGES, for which the -# message catalogs shall be used. It is usually empty. -EXTRA_LOCALE_CATEGORIES = - -# This tells whether the $(DOMAIN).pot file contains messages with an 'msgctxt' -# context. Possible values are "yes" and "no". Set this to yes if the -# package uses functions taking also a message context, like pgettext(), or -# if in $(XGETTEXT_OPTIONS) you define keywords with a context argument. -USE_MSGCTXT = no - -# These options get passed to msgmerge. -# Useful options are in particular: -# --previous to keep previous msgids of translated messages, -# --quiet to reduce the verbosity. -MSGMERGE_OPTIONS = - -# These options get passed to msginit. -# If you want to disable line wrapping when writing PO files, add -# --no-wrap to MSGMERGE_OPTIONS, XGETTEXT_OPTIONS, and -# MSGINIT_OPTIONS. -MSGINIT_OPTIONS = - -# This tells whether or not to regenerate a PO file when $(DOMAIN).pot -# has changed. Possible values are "yes" and "no". Set this to no if -# the POT file is checked in the repository and the version control -# program ignores timestamps. -PO_DEPENDS_ON_POT = yes - -# This tells whether or not to forcibly update $(DOMAIN).pot and -# regenerate PO files on "make dist". Possible values are "yes" and -# "no". Set this to no if the POT file and PO files are maintained -# externally. -DIST_DEPENDS_ON_UPDATE_PO = yes diff --git a/linux/ibus-keyman/po/POTFILES.in b/linux/ibus-keyman/po/POTFILES.in deleted file mode 100644 index 2f7116e3ad179caa9d3ff50304cc371df8f01d42..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/POTFILES.in +++ /dev/null @@ -1,5 +0,0 @@ -src/engine.c -src/keyman-service.c -src/keymanutil.c -src/kmpdetails.c -src/main.c diff --git a/linux/ibus-keyman/po/Rules-quot b/linux/ibus-keyman/po/Rules-quot deleted file mode 100644 index baf652858ad314c6e1c288536c6c6066685420fc..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/Rules-quot +++ /dev/null @@ -1,58 +0,0 @@ -# This file, Rules-quot, can be copied and used freely without restrictions. -# Special Makefile rules for English message catalogs with quotation marks. - -DISTFILES.common.extra1 = quot.sed boldquot.sed en@quot.header en@boldquot.header insert-header.sin Rules-quot - -.SUFFIXES: .insert-header .po-update-en - -en@quot.po-create: - $(MAKE) en@quot.po-update -en@boldquot.po-create: - $(MAKE) en@boldquot.po-update - -en@quot.po-update: en@quot.po-update-en -en@boldquot.po-update: en@boldquot.po-update-en - -.insert-header.po-update-en: - @lang=`echo $@ | sed -e 's/\.po-update-en$$//'`; \ - if test "$(PACKAGE)" = "gettext-tools" && test "$(CROSS_COMPILING)" != "yes"; then PATH=`pwd`/../src:$$PATH; GETTEXTLIBDIR=`cd $(top_srcdir)/src && pwd`; export GETTEXTLIBDIR; fi; \ - tmpdir=`pwd`; \ - echo "$$lang:"; \ - ll=`echo $$lang | sed -e 's/@.*//'`; \ - LC_ALL=C; export LC_ALL; \ - cd $(srcdir); \ - if $(MSGINIT) $(MSGINIT_OPTIONS) -i $(DOMAIN).pot --no-translator -l $$lang -o - 2>/dev/null \ - | $(SED) -f $$tmpdir/$$lang.insert-header | $(MSGCONV) -t UTF-8 | \ - { case `$(MSGFILTER) --version | sed 1q | sed -e 's,^[^0-9]*,,'` in \ - '' | 0.[0-9] | 0.[0-9].* | 0.1[0-8] | 0.1[0-8].*) \ - $(MSGFILTER) $(SED) -f `echo $$lang | sed -e 's/.*@//'`.sed \ - ;; \ - *) \ - $(MSGFILTER) `echo $$lang | sed -e 's/.*@//'` \ - ;; \ - esac } 2>/dev/null > $$tmpdir/$$lang.new.po \ - ; then \ - if cmp $$lang.po $$tmpdir/$$lang.new.po >/dev/null 2>&1; then \ - rm -f $$tmpdir/$$lang.new.po; \ - else \ - if mv -f $$tmpdir/$$lang.new.po $$lang.po; then \ - :; \ - else \ - echo "creation of $$lang.po failed: cannot move $$tmpdir/$$lang.new.po to $$lang.po" 1>&2; \ - exit 1; \ - fi; \ - fi; \ - else \ - echo "creation of $$lang.po failed!" 1>&2; \ - rm -f $$tmpdir/$$lang.new.po; \ - fi - -en@quot.insert-header: insert-header.sin - sed -e '/^#/d' -e 's/HEADER/en@quot.header/g' $(srcdir)/insert-header.sin > en@quot.insert-header - -en@boldquot.insert-header: insert-header.sin - sed -e '/^#/d' -e 's/HEADER/en@boldquot.header/g' $(srcdir)/insert-header.sin > en@boldquot.insert-header - -mostlyclean: mostlyclean-quot -mostlyclean-quot: - rm -f *.insert-header diff --git a/linux/ibus-keyman/po/boldquot.sed b/linux/ibus-keyman/po/boldquot.sed deleted file mode 100644 index 4b937aa517bcff9f5adfc2a01d6d780445999297..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/boldquot.sed +++ /dev/null @@ -1,10 +0,0 @@ -s/"\([^"]*\)"/“\1”/g -s/`\([^`']*\)'/‘\1’/g -s/ '\([^`']*\)' / ‘\1’ /g -s/ '\([^`']*\)'$/ ‘\1’/g -s/^'\([^`']*\)' /‘\1’ /g -s/“”/""/g -s/“/“/g -s/”/”/g -s/‘/‘/g -s/’/’/g diff --git a/linux/ibus-keyman/po/en@boldquot.header b/linux/ibus-keyman/po/en@boldquot.header deleted file mode 100644 index fedb6a06d129acb554ccb20ba04e7ea5649aa2ac..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/en@boldquot.header +++ /dev/null @@ -1,25 +0,0 @@ -# All this catalog "translates" are quotation characters. -# The msgids must be ASCII and therefore cannot contain real quotation -# characters, only substitutes like grave accent (0x60), apostrophe (0x27) -# and double quote (0x22). These substitutes look strange; see -# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html -# -# This catalog translates grave accent (0x60) and apostrophe (0x27) to -# left single quotation mark (U+2018) and right single quotation mark (U+2019). -# It also translates pairs of apostrophe (0x27) to -# left single quotation mark (U+2018) and right single quotation mark (U+2019) -# and pairs of quotation mark (0x22) to -# left double quotation mark (U+201C) and right double quotation mark (U+201D). -# -# When output to an UTF-8 terminal, the quotation characters appear perfectly. -# When output to an ISO-8859-1 terminal, the single quotation marks are -# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to -# grave/acute accent (by libiconv), and the double quotation marks are -# transliterated to 0x22. -# When output to an ASCII terminal, the single quotation marks are -# transliterated to apostrophes, and the double quotation marks are -# transliterated to 0x22. -# -# This catalog furthermore displays the text between the quotation marks in -# bold face, assuming the VT100/XTerm escape sequences. -# diff --git a/linux/ibus-keyman/po/en@quot.header b/linux/ibus-keyman/po/en@quot.header deleted file mode 100644 index a9647fc35c3bc0b49aaafe20deeb5c30a80996bb..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/en@quot.header +++ /dev/null @@ -1,22 +0,0 @@ -# All this catalog "translates" are quotation characters. -# The msgids must be ASCII and therefore cannot contain real quotation -# characters, only substitutes like grave accent (0x60), apostrophe (0x27) -# and double quote (0x22). These substitutes look strange; see -# http://www.cl.cam.ac.uk/~mgk25/ucs/quotes.html -# -# This catalog translates grave accent (0x60) and apostrophe (0x27) to -# left single quotation mark (U+2018) and right single quotation mark (U+2019). -# It also translates pairs of apostrophe (0x27) to -# left single quotation mark (U+2018) and right single quotation mark (U+2019) -# and pairs of quotation mark (0x22) to -# left double quotation mark (U+201C) and right double quotation mark (U+201D). -# -# When output to an UTF-8 terminal, the quotation characters appear perfectly. -# When output to an ISO-8859-1 terminal, the single quotation marks are -# transliterated to apostrophes (by iconv in glibc 2.2 or newer) or to -# grave/acute accent (by libiconv), and the double quotation marks are -# transliterated to 0x22. -# When output to an ASCII terminal, the single quotation marks are -# transliterated to apostrophes, and the double quotation marks are -# transliterated to 0x22. -# diff --git a/linux/ibus-keyman/po/ibus-keyman.pot b/linux/ibus-keyman/po/ibus-keyman.pot deleted file mode 100644 index 6d76289df609bd86179d535c7ecb474cc0c4a711..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/ibus-keyman.pot +++ /dev/null @@ -1,22 +0,0 @@ -# Translations for ibus-keyman. -# Copyright (C) 2018 SIL International -# This file is distributed under the same license as the ibus-keyman package. -# FIRST AUTHOR , YEAR. -# -#, fuzzy -msgid "" -msgstr "" -"Project-Id-Version: ibus-keyman 10.99.33\n" -"Report-Msgid-Bugs-To: https://github.com/keymanapp/keyman/issues/new\n" -"POT-Creation-Date: 2018-11-26 11:25+0700\n" -"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" -"Last-Translator: FULL NAME \n" -"Language-Team: LANGUAGE \n" -"Language: \n" -"MIME-Version: 1.0\n" -"Content-Type: text/plain; charset=CHARSET\n" -"Content-Transfer-Encoding: 8bit\n" - -#: src/keymanutil.c:244 -msgid "Keyman" -msgstr "" diff --git a/linux/ibus-keyman/po/insert-header.sin b/linux/ibus-keyman/po/insert-header.sin deleted file mode 100644 index b26de01f6c88c7b15bb4815a8fcd5120d479300d..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/insert-header.sin +++ /dev/null @@ -1,23 +0,0 @@ -# Sed script that inserts the file called HEADER before the header entry. -# -# At each occurrence of a line starting with "msgid ", we execute the following -# commands. At the first occurrence, insert the file. At the following -# occurrences, do nothing. The distinction between the first and the following -# occurrences is achieved by looking at the hold space. -/^msgid /{ -x -# Test if the hold space is empty. -s/m/m/ -ta -# Yes it was empty. First occurrence. Read the file. -r HEADER -# Output the file's contents by reading the next line. But don't lose the -# current line while doing this. -g -N -bb -:a -# The hold space was nonempty. Following occurrences. Do nothing. -x -:b -} diff --git a/linux/ibus-keyman/po/quot.sed b/linux/ibus-keyman/po/quot.sed deleted file mode 100644 index 0122c46318dc8bc115167fa2c259f8456668f861..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/quot.sed +++ /dev/null @@ -1,6 +0,0 @@ -s/"\([^"]*\)"/“\1”/g -s/`\([^`']*\)'/‘\1’/g -s/ '\([^`']*\)' / ‘\1’ /g -s/ '\([^`']*\)'$/ ‘\1’/g -s/^'\([^`']*\)' /‘\1’ /g -s/“”/""/g diff --git a/linux/ibus-keyman/po/remove-potcdate.sin b/linux/ibus-keyman/po/remove-potcdate.sin deleted file mode 100644 index 2436c49e786dea6c9b4a8f87803288496ed38164..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/remove-potcdate.sin +++ /dev/null @@ -1,19 +0,0 @@ -# Sed script that remove the POT-Creation-Date line in the header entry -# from a POT file. -# -# The distinction between the first and the following occurrences of the -# pattern is achieved by looking at the hold space. -/^"POT-Creation-Date: .*"$/{ -x -# Test if the hold space is empty. -s/P/P/ -ta -# Yes it was empty. First occurrence. Remove the line. -g -d -bb -:a -# The hold space was nonempty. Following occurrences. Do nothing. -x -:b -} diff --git a/linux/ibus-keyman/po/stamp-po b/linux/ibus-keyman/po/stamp-po deleted file mode 100644 index 9788f70238c91894045d22366fa941580826c3c1..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/po/stamp-po +++ /dev/null @@ -1 +0,0 @@ -timestamp diff --git a/linux/ibus-keyman/src/Makefile.am b/linux/ibus-keyman/src/Makefile.am deleted file mode 100644 index ce9f72640ae4248ea4b25cf75fc21fd63421d2f4..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/src/Makefile.am +++ /dev/null @@ -1,123 +0,0 @@ -# vim:set noet ts=4: -# -# ibus-keyman - The Keyman engine for IBus -# -# Copyright (c) 2018 SIL International -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -SUBDIRS = \ - test \ - $(NULL) - -AM_CFLAGS = \ - @IBUS_CFLAGS@ \ - @GTK_CFLAGS@ \ - @JSON_GLIB_CFLAGS@ \ - @X11_CFLAGS@ \ - @KEYMAN_PROC_CFLAGS@ \ - -DPKGDATADIR=\"$(pkgdatadir)\" \ - $(NULL) - -AM_LDFLAGS = \ - @IBUS_LIBS@ \ - @GTK_LIBS@ \ - @X11_LIBS@ \ - @JSON_GLIB_LIBS@ \ - @KEYMAN_PROC_LIBS@ \ - $(NULL) - -check_PROGRAMS = \ - print_kmpdetails \ - print_kmp \ - $(NULL) - -TESTS = \ - test/print_kmpdetails.test \ - test/print_kmp.test \ - $(NULL) - -print_kmp_SOURCES = \ - test/print_kmp.c - -print_kmpdetails_SOURCES = \ - kmpdetails.c \ - test/print_kmpdetails.c \ - $(NULL) -print_kmpdetails_CFLAGS = \ - $(AM_CFLAGS) \ - @JSON_GLIB_CFLAGS@ \ - -DDEBUG \ - $(NULL) - -libexec_PROGRAMS = ibus-engine-keyman - -ibus_engine_keyman_SOURCES = \ - keymanutil.c \ - keymanutil.h \ - kmpdetails.c \ - kmpdetails.h \ - main.c \ - engine.c \ - engine.h \ - keycodes.h \ - keyman-service.c \ - keyman-service.h \ - keyman-version.h \ - $(NULL) - -ibus_engine_keyman_CFLAGS = \ - @IBUS_CFLAGS@ \ - @GTK_CFLAGS@ \ - @X11_CFLAGS@ \ - @JSON_GLIB_CFLAGS@ \ - @KEYMAN_PROC_CFLAGS@ \ - -DPKGDATADIR=\"$(pkgdatadir)\" \ - $(NULL) - -ibus_engine_keyman_LDFLAGS = \ - @GTK_LIBS@ \ - @IBUS_LIBS@ \ - @X11_LIBS@ \ - @JSON_GLIB_LIBS@ \ - @KEYMAN_PROC_LIBS@ \ - $(NULL) - -component_DATA = \ - keyman.xml \ - $(NULL) -componentdir = @datadir@/ibus/component - -EXTRA_DIST = \ - keyman.xml.in \ - test/print_kmpdetails.test \ - test/print_kmp.test \ - test/kmp.json \ - $(NULL) - -CLEANFILES = \ - keyman.xml \ - $(NULL) - -keyman.xml: keyman.xml.in - ( \ - libexecdir=${libexecdir}; \ - pkgdatadir=${pkgdatadir}; \ - s=`cat $<`; \ - eval "echo \"$${s}\""; \ - ) > $@ - -test: ibus-engine-keyman - $(builddir)/ibus-engine-keyman diff --git a/linux/ibus-keyman/src/engine.c b/linux/ibus-keyman/src/engine.c index 368fe94182df003ac8415e506f27c739d4cdef49..b7699f55623e46ac7f84f95697768d0ca141e401 100644 --- a/linux/ibus-keyman/src/engine.c +++ b/linux/ibus-keyman/src/engine.c @@ -99,6 +99,7 @@ struct _IBusKeymanEngine { commit_queue_item commit_queue[MAX_QUEUE_SIZE]; commit_queue_item *commit_item; + guint consecutive_backspaces; }; struct _IBusKeymanEngineClass { @@ -467,6 +468,7 @@ ibus_keyman_engine_constructor( keyman->lctrl_pressed = FALSE; keyman->ralt_pressed = FALSE; keyman->rctrl_pressed = FALSE; + keyman->consecutive_backspaces = 0; initialize_queue(keyman, 0, MAX_QUEUE_SIZE); keyman->commit_item = &keyman->commit_queue[0]; gchar **split_name = g_strsplit(engine_name, ":", 2); @@ -572,6 +574,16 @@ ibus_keyman_engine_destroy (IBusKeymanEngine *keyman) IBUS_OBJECT_CLASS (parent_class)->destroy ((IBusObject *)keyman); } +void ibus_keyman_set_text(IBusEngine *engine, const gchar *text) +{ + IBusKeymanEngine *keyman = (IBusKeymanEngine *)engine; + if (!keyman) { + g_error("%s: parameter `engine` is not an `IBusKeymanEngine` (%p)", __FUNCTION__, engine); + return; + } + commit_string(keyman, text); +} + static void commit_string(IBusKeymanEngine *keyman, const gchar *string) { IBusText *text; @@ -656,8 +668,8 @@ process_backspace_action( "DAR: %s - client_capabilities=%x, %x", __FUNCTION__, engine->client_capabilities, IBUS_CAP_SURROUNDING_TEXT); if (client_supports_surrounding_text(engine)) { - g_message("%s: deleting surrounding text 1 char", __FUNCTION__); - ibus_engine_delete_surrounding_text(engine, -1, 1); + keyman->consecutive_backspaces++; + g_message("%s: increment consecutive backspaces to %d", __FUNCTION__, keyman->consecutive_backspaces); } else { g_message("%s: forwarding backspace with reset context", __FUNCTION__); km_kbp_context_item *context_items; @@ -671,6 +683,21 @@ process_backspace_action( return TRUE; } +static gboolean +finish_backspace_action( + IBusEngine *engine +) { + IBusKeymanEngine *keyman = (IBusKeymanEngine *)engine; + if (keyman->consecutive_backspaces <= 0) + return TRUE; + + g_assert(client_supports_surrounding_text(engine)); + g_message("%s: deleting surrounding text %d char", __FUNCTION__, keyman->consecutive_backspaces); + ibus_engine_delete_surrounding_text(engine, -keyman->consecutive_backspaces, keyman->consecutive_backspaces); + keyman->consecutive_backspaces = 0; + return TRUE; +} + static gboolean process_persist_action( IBusKeymanEngine *keyman, @@ -816,6 +843,9 @@ process_actions( IBusKeymanEngine *keyman = (IBusKeymanEngine *)engine; for (int i = 0; i < num_action_items; i++) { gboolean continue_with_next_action = TRUE; + if (action_items[i].type != KM_KBP_IT_BACK && keyman->consecutive_backspaces > 0) { + finish_backspace_action(engine); + } switch (action_items[i].type) { case KM_KBP_IT_CHAR: g_message("CHAR action %d/%d", i + 1, (int)num_action_items); @@ -956,7 +986,7 @@ ibus_keyman_engine_process_key_event( km_kbp_context *context = km_kbp_state_context(keyman->state); g_free(get_current_context_text(context)); g_message("DAR: %s - km_mod_state=0x%x", __FUNCTION__, km_mod_state); - km_kbp_process_event(keyman->state, keycode_to_vk[keycode], km_mod_state, isKeyDown); + km_kbp_process_event(keyman->state, keycode_to_vk[keycode], km_mod_state, isKeyDown, KM_KBP_EVENT_FLAG_DEFAULT); context = km_kbp_state_context(keyman->state); g_message("%s: after process key event", __FUNCTION__); g_free(get_current_context_text(context)); @@ -1056,7 +1086,7 @@ ibus_keyman_engine_enable (IBusEngine *engine) { // own dbus name com.Keyman // expose properties LDMLFile and Name - KeymanService *service = km_service_get_default(); + KeymanService *service = km_service_get_default(engine); km_service_set_ldmlfile (service, keyman->ldmlfile); km_service_set_name (service, keyman->kb_name); } @@ -1073,7 +1103,7 @@ ibus_keyman_engine_disable (IBusEngine *engine) g_message("WDG: %s %s", __FUNCTION__, engine_name); ibus_keyman_engine_focus_out (engine); // stop owning dbus name com.Keyman - KeymanService *service = km_service_get_default(); + KeymanService *service = km_service_get_default(engine); km_service_set_ldmlfile (service, ""); km_service_set_name (service, "None"); // g_clear_object(&service); diff --git a/linux/ibus-keyman/src/engine.h b/linux/ibus-keyman/src/engine.h index 88d1b2a6ffc88d2a83ac2c7d0cbe6fefda240f05..5aaa6303a7f6e9a3d81207c915ffa4a59919faf3 100644 --- a/linux/ibus-keyman/src/engine.h +++ b/linux/ibus-keyman/src/engine.h @@ -31,4 +31,6 @@ GType ibus_keyman_engine_get_type (void); +extern void ibus_keyman_set_text(IBusEngine* engine, const gchar* text); + #endif diff --git a/linux/ibus-keyman/src/keyman-service.c b/linux/ibus-keyman/src/keyman-service.c index b5a30e9599d2ef28a284852ec382377ab3894869..b5c4afc75f9124301959a473f82e2f96ed72d6f6 100644 --- a/linux/ibus-keyman/src/keyman-service.c +++ b/linux/ibus-keyman/src/keyman-service.c @@ -28,22 +28,23 @@ #include +#include "engine.h" #include "keyman-service.h" struct _KeymanServicePrivate { guint owner_id; GDBusNodeInfo *ispec; + IBusEngine *engine; gchar * name; gchar * ldmlfile; }; -enum -{ - PROP_0, - PROP_NAME, - PROP_LDMLFILE +enum { + PROP_0, + PROP_NAME, + PROP_LDMLFILE }; static const gchar introspection_xml[] = @@ -51,6 +52,9 @@ static const gchar introspection_xml[] = " " " " " " + " " + " " + " " " " ""; @@ -194,6 +198,32 @@ km_service_class_init (KeymanServiceClass *klass) G_PARAM_STATIC_STRINGS)); } +static void +handle_method_call( + GDBusConnection *connection, + const gchar *sender, + const gchar *object_path, + const gchar *interface_name, + const gchar *method_name, + GVariant *parameters, + GDBusMethodInvocation *invocation, + gpointer user_data) +{ + KeymanService *service = KM_SERVICE(user_data); + + gsize sz; + if (g_strcmp0(method_name, "SendText") == 0) { + GVariant *param = g_variant_get_child_value(parameters, 0); + gchar *text = g_variant_dup_string(param, &sz); + + km_service_send_text(service, text); + g_dbus_method_invocation_return_value(invocation, NULL); + + g_free(text); + g_variant_unref(param); + } +} + static GVariant * handle_get_property (GDBusConnection *connection, const gchar *sender, @@ -240,9 +270,9 @@ handle_set_property (GDBusConnection *connection, static const GDBusInterfaceVTable interface_vtable = { - (GDBusInterfaceMethodCallFunc) NULL, - (GDBusInterfaceGetPropertyFunc) handle_get_property, - (GDBusInterfaceSetPropertyFunc) handle_set_property + (GDBusInterfaceMethodCallFunc)handle_method_call, + (GDBusInterfaceGetPropertyFunc)handle_get_property, + (GDBusInterfaceSetPropertyFunc)handle_set_property }; static void @@ -290,9 +320,7 @@ km_service_bus_acquired (GDBusConnection *connection, gpointer data) { KeymanService *service = data; - - if (service->priv->ispec) - { + if (service->priv->ispec) { GError *error = NULL; g_dbus_connection_register_object (connection, @@ -312,7 +340,7 @@ km_service_bus_acquired (GDBusConnection *connection, } KeymanService * -km_service_get_default (void) +km_service_get_default(IBusEngine *engine) { static KeymanService *service = NULL; @@ -324,9 +352,13 @@ km_service_get_default (void) // } if (!service) { - service = g_object_new (KM_TYPE_SERVICE, NULL); + service = g_object_new(KM_TYPE_SERVICE, NULL); g_object_add_weak_pointer (G_OBJECT (service), (gpointer *) &service); } + + KeymanServicePrivate *priv = KM_SERVICE(service)->priv; + priv->engine = engine; + return service; } @@ -373,3 +405,14 @@ km_service_set_ldmlfile (KeymanService *service, // return service->priv->ldmlfile; // } + +void +km_service_send_text(KeymanService *service, const gchar *text) { + g_return_if_fail(KM_IS_SERVICE(service)); + + // engine will be NULL unless a keyman keyboard is active + if (!service->priv->engine) + return; + + ibus_keyman_set_text(service->priv->engine, text); +} diff --git a/linux/ibus-keyman/src/keyman-service.h b/linux/ibus-keyman/src/keyman-service.h index 34c4c6d32412179e99470bd01d758ab2de3eb26c..0f7221478a3f78eb8657597af3e9d1c1e59df902 100644 --- a/linux/ibus-keyman/src/keyman-service.h +++ b/linux/ibus-keyman/src/keyman-service.h @@ -30,6 +30,7 @@ #define __KM_SERVICE_H__ #include +#include G_BEGIN_DECLS @@ -53,16 +54,18 @@ struct _KeymanService GType km_service_get_type (void) G_GNUC_CONST; -KeymanService * km_service_get_default (void); +KeymanService * km_service_get_default (IBusEngine *keyman); -// const gchar * km_service_get_ldmlfile (KeymanService *service); -void km_service_set_ldmlfile (KeymanService *service, - const gchar *xml); +// const gchar * km_service_get_ldmlfile(KeymanService *service); +void km_service_set_ldmlfile(KeymanService *service, + const gchar *xml); -// const gchar * km_service_get_name (KeymanService *service); -void km_service_set_name (KeymanService *service, - const gchar *name); +// const gchar * km_service_get_name (KeymanService *service); +void km_service_set_name (KeymanService *service, + const gchar *name); +void km_service_send_text (KeymanService *service, + const gchar *text); G_END_DECLS diff --git a/linux/ibus-keyman/src/keyman.xml.in b/linux/ibus-keyman/src/keyman.xml.in index d41cc8021c2d6a9956cde3cae894b61f920bf78b..5b958e78b54d33a862c710b9bf964ed3e374a8fb 100644 --- a/linux/ibus-keyman/src/keyman.xml.in +++ b/linux/ibus-keyman/src/keyman.xml.in @@ -2,7 +2,7 @@ org.freedesktop.IBus.Keyman Keyman Component - @libexecdir@/ibus-engine-keyman --ibus + @LIBEXECDIR@/ibus-engine-keyman --ibus @VERSION@ Keyman Team <support@keyman.com> GPL @@ -13,5 +13,5 @@ /usr/local/share/keyman/ ~/.local/share/keyman/ - + diff --git a/linux/ibus-keyman/src/keyman.xml.in.in b/linux/ibus-keyman/src/keyman.xml.in.in deleted file mode 100644 index 256b032a0970eaf929bd30d02afb68a17056592c..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/src/keyman.xml.in.in +++ /dev/null @@ -1,18 +0,0 @@ - - - - org.freedesktop.IBus.Keyman - Keyman Component - ${libexecdir}/ibus-engine-keyman --ibus - @VERSION@ - Keyman Team <support@keyman.com> - GPL - https://keyman.com - ibus-keyman - - /usr/share/keyman/ - /usr/local/share/keyman/ - ~/.local/share/keyman/ - - - diff --git a/linux/ibus-keyman/src/kmpdetails.c b/linux/ibus-keyman/src/kmpdetails.c index a6b7fbb18906326405f92f843fd3a84ddffeca77..eba95f4ef9752d4ce3b2c3fcd00480b068631e17 100644 --- a/linux/ibus-keyman/src/kmpdetails.c +++ b/linux/ibus-keyman/src/kmpdetails.c @@ -272,9 +272,6 @@ kmp_json_status get_keyboard_details(const char *kmp_dir, const char *id, keyboa } g_object_unref(parser); return JSON_OK; - - - } kmp_json_status get_kmp_details(const char *kmp_dir, kmp_details *details) @@ -295,7 +292,6 @@ kmp_json_status get_kmp_details(const char *kmp_dir, kmp_details *details) return JSON_FILE_NOT_EXISTS; } - json_parser_load_from_file (parser, kmp_json, &error); diff --git a/linux/ibus-keyman/src/main.c b/linux/ibus-keyman/src/main.c index 2cabd3f1393a81366cf67da0b26faaba209f0839..f791cb45640db610194765626ed3fb36c4a307c0 100644 --- a/linux/ibus-keyman/src/main.c +++ b/linux/ibus-keyman/src/main.c @@ -51,7 +51,7 @@ ibus_disconnected_cb (IBusBus *bus, gpointer user_data) { g_debug ("bus disconnected"); - KeymanService *service = km_service_get_default(); + KeymanService *service = km_service_get_default(NULL); g_clear_object(&service); ibus_quit (); @@ -92,7 +92,7 @@ start_component (void) } g_object_unref (component); - km_service_get_default(); // initialise dbus service + km_service_get_default(NULL); // initialise dbus service ibus_main (); } diff --git a/linux/ibus-keyman/src/meson.build b/linux/ibus-keyman/src/meson.build index 708c4751ead93610d784e22540c671a01268656d..29f265290d51ab76130db7f37d03c4c435cfb1c0 100644 --- a/linux/ibus-keyman/src/meson.build +++ b/linux/ibus-keyman/src/meson.build @@ -25,12 +25,14 @@ deps = [ibus, gtk, x11, json_glib, kmnkbp_lib] prefix = get_option('prefix') cfg = configuration_data() cfg.set('VERSION', meson.project_version()) -cfg.set('libexecdir', prefix / get_option('libexecdir')) +cfg.set('LIBEXECDIR', get_option('prefix') / get_option('libexecdir')) configure_file( configuration: cfg, input: 'keyman.xml.in', - output: 'keyman.xml' + output: 'keyman.xml', + install: true, + install_dir: get_option('datadir') / 'ibus/component', ) configure_file( @@ -44,6 +46,8 @@ exe = executable( sources: [engine_files, util_files], dependencies: deps, include_directories: include_dirs, + install: true, + install_dir: get_option('libexecdir'), ) subdir('test') diff --git a/linux/ibus-keyman/src/test/Makefile.am b/linux/ibus-keyman/src/test/Makefile.am deleted file mode 100644 index 239b40b7fa6d0eec1dc2239ec80d1ccba1bbc66f..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/src/test/Makefile.am +++ /dev/null @@ -1,84 +0,0 @@ -# vim:set noet ts=4: -# -# ibus-keyman - The Keyman engine for IBus -# -# Copyright (c) 2021 SIL International -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -include $(top_srcdir)/glib-tap.mk - -AUTOMAKE_OPTIONS = subdir-objects - -AM_CFLAGS = \ - @IBUS_CFLAGS@ \ - @GTK_CFLAGS@ \ - @JSON_GLIB_CFLAGS@ \ - @X11_CFLAGS@ \ - @KEYMAN_PROC_CFLAGS@ \ - -DPKGDATADIR=\"$(pkgdatadir)\" \ - $(NULL) - -AM_LDFLAGS = \ - @IBUS_LIBS@ \ - @GTK_LIBS@ \ - @X11_LIBS@ \ - @JSON_GLIB_LIBS@ \ - @KEYMAN_PROC_LIBS@ \ - $(NULL) - -uninstalled_test_scripts = run-tests.sh - -libexec_PROGRAMS = \ - keymanutil-tests \ - $(NULL) - -keymanutil_tests_SOURCES = \ - keymanutil_tests.c \ - ../keymanutil.c \ - ../keymanutil.h \ - ../kmpdetails.c \ - ../kmpdetails.h \ - $(NULL) - -keymanutil_tests_CFLAGS = \ - @IBUS_CFLAGS@ \ - @GTK_CFLAGS@ \ - @X11_CFLAGS@ \ - @JSON_GLIB_CFLAGS@ \ - @KEYMAN_PROC_CFLAGS@ \ - -DPKGDATADIR=\"$(pkgdatadir)\" \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src \ - $(NULL) - -keymanutil_tests_CPPFLAGS = \ - @IBUS_CFLAGS@ \ - @GTK_CFLAGS@ \ - @X11_CFLAGS@ \ - @JSON_GLIB_CFLAGS@ \ - @KEYMAN_PROC_CFLAGS@ \ - -DPKGDATADIR=\"$(pkgdatadir)\" \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src \ - $(NULL) - -keymanutil_tests_LDFLAGS = \ - @GTK_LIBS@ \ - @IBUS_LIBS@ \ - @X11_LIBS@ \ - @JSON_GLIB_LIBS@ \ - @KEYMAN_PROC_LIBS@ \ - $(NULL) diff --git a/linux/ibus-keyman/tap-driver.sh b/linux/ibus-keyman/tap-driver.sh deleted file mode 100755 index 65866ae69650283d586d73e09800755680fd9b87..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/tap-driver.sh +++ /dev/null @@ -1,644 +0,0 @@ -#! /bin/sh -# Copyright (C) 2011-2013 Free Software Foundation, Inc. -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program. If not, see . - -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - -# This file is maintained in Automake, please report -# bugs to or send patches to -# . - -# from https://gitlab.gnome.org/GNOME/glib/-/blob/glib-2-58/tap-driver.sh - -scriptversion=2011-12-27.17; # UTC - -# Make unconditional expansion of undefined variables an error. This -# helps a lot in preventing typo-related bugs. -set -u - -me=tap-driver.sh - -fatal () -{ - echo "$me: fatal: $*" >&2 - exit 1 -} - -usage_error () -{ - echo "$me: $*" >&2 - print_usage >&2 - exit 2 -} - -print_usage () -{ - cat < - # - trap : 1 3 2 13 15 - if test $merge -gt 0; then - exec 2>&1 - else - exec 2>&3 - fi - "$@" - echo $? - ) | LC_ALL=C ${AM_TAP_AWK-awk} \ - -v me="$me" \ - -v test_script_name="$test_name" \ - -v log_file="$log_file" \ - -v trs_file="$trs_file" \ - -v expect_failure="$expect_failure" \ - -v merge="$merge" \ - -v ignore_exit="$ignore_exit" \ - -v comments="$comments" \ - -v diag_string="$diag_string" \ -' -# FIXME: the usages of "cat >&3" below could be optimized when using -# FIXME: GNU awk, and/or on systems that supports /dev/fd/. - -# Implementation note: in what follows, `result_obj` will be an -# associative array that (partly) simulates a TAP result object -# from the `TAP::Parser` perl module. - -## ----------- ## -## FUNCTIONS ## -## ----------- ## - -function fatal(msg) -{ - print me ": " msg | "cat >&2" - exit 1 -} - -function abort(where) -{ - fatal("internal error " where) -} - -# Convert a boolean to a "yes"/"no" string. -function yn(bool) -{ - return bool ? "yes" : "no"; -} - -function add_test_result(result) -{ - if (!test_results_index) - test_results_index = 0 - test_results_list[test_results_index] = result - test_results_index += 1 - test_results_seen[result] = 1; -} - -# Whether the test script should be re-run by "make recheck". -function must_recheck() -{ - for (k in test_results_seen) - if (k != "XFAIL" && k != "PASS" && k != "SKIP") - return 1 - return 0 -} - -# Whether the content of the log file associated to this test should -# be copied into the "global" test-suite.log. -function copy_in_global_log() -{ - for (k in test_results_seen) - if (k != "PASS") - return 1 - return 0 -} - -# FIXME: this can certainly be improved ... -function get_global_test_result() -{ - if ("ERROR" in test_results_seen) - return "ERROR" - if ("FAIL" in test_results_seen || "XPASS" in test_results_seen) - return "FAIL" - all_skipped = 1 - for (k in test_results_seen) - if (k != "SKIP") - all_skipped = 0 - if (all_skipped) - return "SKIP" - return "PASS"; -} - -function stringify_result_obj(result_obj) -{ - if (result_obj["is_unplanned"] || result_obj["number"] != testno) - return "ERROR" - - if (plan_seen == LATE_PLAN) - return "ERROR" - - if (result_obj["directive"] == "TODO") - return result_obj["is_ok"] ? "XPASS" : "XFAIL" - - if (result_obj["directive"] == "SKIP") - return result_obj["is_ok"] ? "SKIP" : COOKED_FAIL; - - if (length(result_obj["directive"])) - abort("in function stringify_result_obj()") - - return result_obj["is_ok"] ? COOKED_PASS : COOKED_FAIL -} - -function decorate_result(result) -{ - color_name = color_for_result[result] - if (color_name) - return color_map[color_name] "" result "" color_map["std"] - # If we are not using colorized output, or if we do not know how - # to colorize the given result, we should return it unchanged. - return result -} - -function report(result, details) -{ - if (result ~ /^(X?(PASS|FAIL)|SKIP|ERROR)/) - { - msg = ": " test_script_name - add_test_result(result) - } - else if (result == "#") - { - msg = " " test_script_name ":" - } - else - { - abort("in function report()") - } - if (length(details)) - msg = msg " " details - # Output on console might be colorized. - print decorate_result(result) msg - # Log the result in the log file too, to help debugging (this is - # especially true when said result is a TAP error or "Bail out!"). - print result msg | "cat >&3"; -} - -function testsuite_error(error_message) -{ - report("ERROR", "- " error_message) -} - -function handle_tap_result() -{ - details = result_obj["number"]; - if (length(result_obj["description"])) - details = details " " result_obj["description"] - - if (plan_seen == LATE_PLAN) - { - details = details " # AFTER LATE PLAN"; - } - else if (result_obj["is_unplanned"]) - { - details = details " # UNPLANNED"; - } - else if (result_obj["number"] != testno) - { - details = sprintf("%s # OUT-OF-ORDER (expecting %d)", - details, testno); - } - else if (result_obj["directive"]) - { - details = details " # " result_obj["directive"]; - if (length(result_obj["explanation"])) - details = details " " result_obj["explanation"] - } - - report(stringify_result_obj(result_obj), details) -} - -# `skip_reason` should be empty whenever planned > 0. -function handle_tap_plan(planned, skip_reason) -{ - planned += 0 # Avoid getting confused if, say, `planned` is "00" - if (length(skip_reason) && planned > 0) - abort("in function handle_tap_plan()") - if (plan_seen) - { - # Error, only one plan per stream is acceptable. - testsuite_error("multiple test plans") - return; - } - planned_tests = planned - # The TAP plan can come before or after *all* the TAP results; we speak - # respectively of an "early" or a "late" plan. If we see the plan line - # after at least one TAP result has been seen, assume we have a late - # plan; in this case, any further test result seen after the plan will - # be flagged as an error. - plan_seen = (testno >= 1 ? LATE_PLAN : EARLY_PLAN) - # If testno > 0, we have an error ("too many tests run") that will be - # automatically dealt with later, so do not worry about it here. If - # $plan_seen is true, we have an error due to a repeated plan, and that - # has already been dealt with above. Otherwise, we have a valid "plan - # with SKIP" specification, and should report it as a particular kind - # of SKIP result. - if (planned == 0 && testno == 0) - { - if (length(skip_reason)) - skip_reason = "- " skip_reason; - report("SKIP", skip_reason); - } -} - -function extract_tap_comment(line) -{ - if (index(line, diag_string) == 1) - { - # Strip leading `diag_string` from `line`. - line = substr(line, length(diag_string) + 1) - # And strip any leading and trailing whitespace left. - sub("^[ \t]*", "", line) - sub("[ \t]*$", "", line) - # Return what is left (if any). - return line; - } - return ""; -} - -# When this function is called, we know that line is a TAP result line, -# so that it matches the (perl) RE "^(not )?ok\b". -function setup_result_obj(line) -{ - # Get the result, and remove it from the line. - result_obj["is_ok"] = (substr(line, 1, 2) == "ok" ? 1 : 0) - sub("^(not )?ok[ \t]*", "", line) - - # If the result has an explicit number, get it and strip it; otherwise, - # automatically assing the next progresive number to it. - if (line ~ /^[0-9]+$/ || line ~ /^[0-9]+[^a-zA-Z0-9_]/) - { - match(line, "^[0-9]+") - # The final `+ 0` is to normalize numbers with leading zeros. - result_obj["number"] = substr(line, 1, RLENGTH) + 0 - line = substr(line, RLENGTH + 1) - } - else - { - result_obj["number"] = testno - } - - if (plan_seen == LATE_PLAN) - # No further test results are acceptable after a "late" TAP plan - # has been seen. - result_obj["is_unplanned"] = 1 - else if (plan_seen && testno > planned_tests) - result_obj["is_unplanned"] = 1 - else - result_obj["is_unplanned"] = 0 - - # Strip trailing and leading whitespace. - sub("^[ \t]*", "", line) - sub("[ \t]*$", "", line) - - # This will have to be corrected if we have a "TODO"/"SKIP" directive. - result_obj["description"] = line - result_obj["directive"] = "" - result_obj["explanation"] = "" - - if (index(line, "#") == 0) - return # No possible directive, nothing more to do. - - # Directives are case-insensitive. - rx = "[ \t]*#[ \t]*([tT][oO][dD][oO]|[sS][kK][iI][pP])[ \t]*" - - # See whether we have the directive, and if yes, where. - pos = match(line, rx "$") - if (!pos) - pos = match(line, rx "[^a-zA-Z0-9_]") - - # If there was no TAP directive, we have nothing more to do. - if (!pos) - return - - # Let`s now see if the TAP directive has been escaped. For example: - # escaped: ok \# SKIP - # not escaped: ok \\# SKIP - # escaped: ok \\\\\# SKIP - # not escaped: ok \ # SKIP - if (substr(line, pos, 1) == "#") - { - bslash_count = 0 - for (i = pos; i > 1 && substr(line, i - 1, 1) == "\\"; i--) - bslash_count += 1 - if (bslash_count % 2) - return # Directive was escaped. - } - - # Strip the directive and its explanation (if any) from the test - # description. - result_obj["description"] = substr(line, 1, pos - 1) - # Now remove the test description from the line, that has been dealt - # with already. - line = substr(line, pos) - # Strip the directive, and save its value (normalized to upper case). - sub("^[ \t]*#[ \t]*", "", line) - result_obj["directive"] = toupper(substr(line, 1, 4)) - line = substr(line, 5) - # Now get the explanation for the directive (if any), with leading - # and trailing whitespace removed. - sub("^[ \t]*", "", line) - sub("[ \t]*$", "", line) - result_obj["explanation"] = line -} - -function get_test_exit_message(status) -{ - if (status == 0) - return "" - if (status !~ /^[1-9][0-9]*$/) - abort("getting exit status") - if (status < 127) - exit_details = "" - else if (status == 127) - exit_details = " (command not found?)" - else if (status >= 128 && status <= 255) - exit_details = sprintf(" (terminated by signal %d?)", status - 128) - else if (status > 256 && status <= 384) - # We used to report an "abnormal termination" here, but some Korn - # shells, when a child process die due to signal number n, can leave - # in $? an exit status of 256+n instead of the more standard 128+n. - # Apparently, both behaviours are allowed by POSIX (2008), so be - # prepared to handle them both. See also Austing Group report ID - # 0000051 - exit_details = sprintf(" (terminated by signal %d?)", status - 256) - else - # Never seen in practice. - exit_details = " (abnormal termination)" - return sprintf("exited with status %d%s", status, exit_details) -} - -function write_test_results() -{ - print ":global-test-result: " get_global_test_result() > trs_file - print ":recheck: " yn(must_recheck()) > trs_file - print ":copy-in-global-log: " yn(copy_in_global_log()) > trs_file - for (i = 0; i < test_results_index; i += 1) - print ":test-result: " test_results_list[i] > trs_file - close(trs_file); -} - -BEGIN { - -## ------- ## -## SETUP ## -## ------- ## - -'"$init_colors"' - -# Properly initialized once the TAP plan is seen. -planned_tests = 0 - -COOKED_PASS = expect_failure ? "XPASS": "PASS"; -COOKED_FAIL = expect_failure ? "XFAIL": "FAIL"; - -# Enumeration-like constants to remember which kind of plan (if any) -# has been seen. It is important that NO_PLAN evaluates "false" as -# a boolean. -NO_PLAN = 0 -EARLY_PLAN = 1 -LATE_PLAN = 2 - -testno = 0 # Number of test results seen so far. -bailed_out = 0 # Whether a "Bail out!" directive has been seen. - -# Whether the TAP plan has been seen or not, and if yes, which kind -# it is ("early" is seen before any test result, "late" otherwise). -plan_seen = NO_PLAN - -## --------- ## -## PARSING ## -## --------- ## - -is_first_read = 1 - -while (1) - { - # Involutions required so that we are able to read the exit status - # from the last input line. - st = getline - if (st < 0) # I/O error. - fatal("I/O error while reading from input stream") - else if (st == 0) # End-of-input - { - if (is_first_read) - abort("in input loop: only one input line") - break - } - if (is_first_read) - { - is_first_read = 0 - nextline = $0 - continue - } - else - { - curline = nextline - nextline = $0 - $0 = curline - } - # Copy any input line verbatim into the log file. - print | "cat >&3" - # Parsing of TAP input should stop after a "Bail out!" directive. - if (bailed_out) - continue - - # TAP test result. - if ($0 ~ /^(not )?ok$/ || $0 ~ /^(not )?ok[^a-zA-Z0-9_]/) - { - testno += 1 - setup_result_obj($0) - handle_tap_result() - } - # TAP plan (normal or "SKIP" without explanation). - else if ($0 ~ /^1\.\.[0-9]+[ \t]*$/) - { - # The next two lines will put the number of planned tests in $0. - sub("^1\\.\\.", "") - sub("[^0-9]*$", "") - handle_tap_plan($0, "") - continue - } - # TAP "SKIP" plan, with an explanation. - else if ($0 ~ /^1\.\.0+[ \t]*#/) - { - # The next lines will put the skip explanation in $0, stripping - # any leading and trailing whitespace. This is a little more - # tricky in truth, since we want to also strip a potential leading - # "SKIP" string from the message. - sub("^[^#]*#[ \t]*(SKIP[: \t][ \t]*)?", "") - sub("[ \t]*$", ""); - handle_tap_plan(0, $0) - } - # "Bail out!" magic. - # Older versions of prove and TAP::Harness (e.g., 3.17) did not - # recognize a "Bail out!" directive when preceded by leading - # whitespace, but more modern versions (e.g., 3.23) do. So we - # emulate the latter, "more modern" behaviour. - else if ($0 ~ /^[ \t]*Bail out!/) - { - bailed_out = 1 - # Get the bailout message (if any), with leading and trailing - # whitespace stripped. The message remains stored in `$0`. - sub("^[ \t]*Bail out![ \t]*", ""); - sub("[ \t]*$", ""); - # Format the error message for the - bailout_message = "Bail out!" - if (length($0)) - bailout_message = bailout_message " " $0 - testsuite_error(bailout_message) - } - # Maybe we have too look for dianogtic comments too. - else if (comments != 0) - { - comment = extract_tap_comment($0); - if (length(comment)) - report("#", comment); - } - } - -## -------- ## -## FINISH ## -## -------- ## - -# A "Bail out!" directive should cause us to ignore any following TAP -# error, as well as a non-zero exit status from the TAP producer. -if (!bailed_out) - { - if (!plan_seen) - { - testsuite_error("missing test plan") - } - else if (planned_tests != testno) - { - bad_amount = testno > planned_tests ? "many" : "few" - testsuite_error(sprintf("too %s tests run (expected %d, got %d)", - bad_amount, planned_tests, testno)) - } - if (!ignore_exit) - { - # Fetch exit status from the last line. - exit_message = get_test_exit_message(nextline) - if (exit_message) - testsuite_error(exit_message) - } - } - -write_test_results() - -exit 0 - -} # End of "BEGIN" block. -' - -# TODO: document that we consume the file descriptor 3 :-( -} 3>"$log_file" - -test $? -eq 0 || fatal "I/O or internal error" diff --git a/linux/ibus-keyman/tap-test b/linux/ibus-keyman/tap-test deleted file mode 100755 index 74f8ac94e72245c4be7b5ec713994a12a7036a5a..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/tap-test +++ /dev/null @@ -1,7 +0,0 @@ -#! /bin/sh - -# from https://gitlab.gnome.org/GNOME/glib/-/blob/glib-2-58/tap-test - -# run a GTest in tap mode. The test binary is passed as $1 - -$1 -k --tap diff --git a/linux/ibus-keyman/tests/.gitignore b/linux/ibus-keyman/tests/.gitignore deleted file mode 100644 index 6d154ea0194aa3b2f1a9157a330f11a9dbee9c35..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/tests/.gitignore +++ /dev/null @@ -1,2 +0,0 @@ -.libs/ -ibus-keyman-tests diff --git a/linux/ibus-keyman/tests/Makefile.am b/linux/ibus-keyman/tests/Makefile.am deleted file mode 100644 index eeeb89317b1fdb98b1093d4720f74097d62ae460..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/tests/Makefile.am +++ /dev/null @@ -1,129 +0,0 @@ -# vim:set noet ts=4: -# -# ibus-keyman unit tests -# -# Copyright (c) 2021 SIL International -# -# This program is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2, or (at your option) -# any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. - -include $(top_srcdir)/glib-tap.mk - -AUTOMAKE_OPTIONS = subdir-objects - -AM_CFLAGS = \ - @IBUS_CFLAGS@ \ - @GTK_CFLAGS@ \ - @JSON_GLIB_CFLAGS@ \ - @X11_CFLAGS@ \ - @KEYMAN_PROC_CFLAGS@ \ - -DPKGDATADIR=\"$(pkgdatadir)\" \ - $(NULL) - -AM_LDFLAGS = \ - @IBUS_LIBS@ \ - @GTK_LIBS@ \ - @X11_LIBS@ \ - @JSON_GLIB_LIBS@ \ - @KEYMAN_PROC_LIBS@ \ - $(NULL) - -libexec_PROGRAMS = ibus-keyman-tests - -uninstalled_test_scripts = run-tests.sh - -# Note: don't use $(top_srcdir) here for the first `..` - automake <= 1.15 (Ubuntu 18.04) -# has a bug where it doesn't resolve the variable and so stores some files in the wrong -# location and can't find them later. https://debbugs.gnu.org/cgi/bugreport.cgi?bug=13928 -# Once we drop support for Ubuntu 18.04 Bionic we change this. - -ibus_keyman_tests_SOURCES = \ - ibusimcontext.c \ - ibusimcontext.h \ - testfixture.cpp \ - testmodule.c \ - testmodule.h \ - ../../../core/src/jsonpp.cpp \ - ../../../core/src/keyboard.cpp \ - ../../../core/src/kmx/kmx_actions.cpp \ - ../../../core/src/kmx/kmx_actions.h \ - ../../../core/src/kmx/kmx_base.h \ - ../../../core/src/kmx/kmx_capslock.cpp \ - ../../../core/src/kmx/kmx_consts.cpp \ - ../../../core/src/kmx/kmx_context.cpp \ - ../../../core/src/kmx/kmx_context.h \ - ../../../core/src/kmx/kmx_conversion.cpp \ - ../../../core/src/kmx/kmx_debug.cpp \ - ../../../core/src/kmx/kmx_debugger.cpp \ - ../../../core/src/kmx/kmx_debugger.h \ - ../../../core/src/kmx/kmx_environment.cpp \ - ../../../core/src/kmx/kmx_environment.h \ - ../../../core/src/kmx/kmx_file.cpp \ - ../../../common/include/kmx_file.h \ - ../../../core/src/kmx/kmx_modifiers.cpp \ - ../../../core/src/kmx/kmx_options.cpp \ - ../../../core/src/kmx/kmx_options.h \ - ../../../core/src/kmx/kmx_processevent.cpp \ - ../../../core/src/kmx/kmx_processevent.h \ - ../../../core/src/kmx/kmx_processor.cpp \ - ../../../core/src/kmx/kmx_processor.hpp \ - ../../../core/src/kmx/kmx_xstring.cpp \ - ../../../core/src/kmx/kmx_xstring.h \ - ../../../core/src/option.cpp \ - ../../../core/src/state.cpp \ - ../../../core/src/utfcodec.cpp \ - ../../../core/tests/unit/kmx/kmx_test_source.cpp \ - ../../../core/tests/unit/kmx/kmx_test_source.hpp \ - ../src/keycodes.h \ - ../src/keymanutil.c \ - ../src/keymanutil.h \ - ../src/kmpdetails.c \ - ../src/kmpdetails.h \ - $(NULL) - -ibus_keyman_tests_CFLAGS = \ - @IBUS_CFLAGS@ \ - @GTK_CFLAGS@ \ - @X11_CFLAGS@ \ - @JSON_GLIB_CFLAGS@ \ - @KEYMAN_PROC_CFLAGS@ \ - -DPKGDATADIR=\"$(pkgdatadir)\" \ - -I$(top_srcdir)/../../core/src \ - -I$(top_srcdir)/../../core/src/kmx \ - -I$(top_srcdir)/../../core/tests/unit/kmx \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src \ - $(NULL) - -ibus_keyman_tests_CPPFLAGS = \ - @IBUS_CFLAGS@ \ - @GTK_CFLAGS@ \ - @X11_CFLAGS@ \ - @JSON_GLIB_CFLAGS@ \ - @KEYMAN_PROC_CFLAGS@ \ - -DPKGDATADIR=\"$(pkgdatadir)\" \ - -I$(top_srcdir)/../../core/src \ - -I$(top_srcdir)/../../core/src/kmx \ - -I$(top_srcdir)/../../core/tests/unit/kmx \ - -I$(top_srcdir)/src \ - -I$(top_builddir)/src \ - $(NULL) - -ibus_keyman_tests_LDFLAGS = \ - @GTK_LIBS@ \ - @IBUS_LIBS@ \ - @X11_LIBS@ \ - @JSON_GLIB_LIBS@ \ - @KEYMAN_PROC_LIBS@ \ - $(NULL) diff --git a/linux/ibus-keyman/tests/README.md b/linux/ibus-keyman/tests/README.md index f7537a79fda820adb7b340a52c063e5362d2efe1..046333be9d4a8218b62632f380579eb51acfd43e 100644 --- a/linux/ibus-keyman/tests/README.md +++ b/linux/ibus-keyman/tests/README.md @@ -1,6 +1,6 @@ # ibus-keyman integration tests -The ibus-keyman integration tests run the tests defined in `core/tests/unit/kmx`. +The ibus-keyman integration tests run the tests defined in `common/test/keyboards/baseline`. The tests run in a separate Xephyr session. Any dconf settings that have to be set during the tests are stored in `~/.config/glib-2.0/settings/keyfile`. @@ -19,7 +19,7 @@ scripts/run-tests.sh ### Run specific tests To run a single test you pass the testname (as found in -`core/build/arch/*/tests/unit/kmx`). Multiple tests should be separated by space. +`common/test/keyboards/baseline`). Multiple tests should be separated by space. ```bash scripts/run-tests.sh -- k_000___null_keyboard k_005___nul_with_initial_context diff --git a/linux/ibus-keyman/tests/meson.build b/linux/ibus-keyman/tests/meson.build index 1e5db1957318cb8450d27bbd863fe995115c056e..c67f9920a937ae28ea03cf05ed69e50ed169935a 100644 --- a/linux/ibus-keyman/tests/meson.build +++ b/linux/ibus-keyman/tests/meson.build @@ -6,13 +6,9 @@ test_files = [ 'testmodule.h', ] -kmx_dir = [ - core_dir / 'build/arch' / get_option('buildtype') / 'tests/unit/kmx' -] - kmnkbp_tests_lib = cc.find_library( 'libkmnkbp-tests', - dirs: kmx_dir + dirs: [ core_dir / 'build/arch' / get_option('buildtype') / 'tests/kmx_test_source' ] ) deps = [ibus, gtk, x11, json_glib, kmnkbp_lib, kmnkbp_tests_lib] @@ -24,7 +20,7 @@ test_env = [ test_include_dirs = [ core_include_dirs, - include_directories('../../../core/tests/unit/kmx'), + include_directories('../../../core/tests/kmx_test_source'), include_directories('../src'), include_directories('..'), ] @@ -84,7 +80,7 @@ test( kmxtest_files = run_command( find_tests, - kmx_dir, + [ common_dir / 'test/keyboards/baseline' ], check: true, ).stdout().split('\n') diff --git a/linux/ibus-keyman/tests/run-tests.sh b/linux/ibus-keyman/tests/run-tests.sh deleted file mode 100755 index b6ebc90ff140751ba864fe0440ed0ab9570ad302..0000000000000000000000000000000000000000 --- a/linux/ibus-keyman/tests/run-tests.sh +++ /dev/null @@ -1,215 +0,0 @@ -#!/usr/bin/env bash - -TOP_SRCDIR=${top_srcdir:-$(realpath $(dirname $0)/..)} -BASEDIR=$(realpath $(dirname $0)) -TESTDIR=${XDG_DATA_HOME:-$HOME/.local/share}/keyman/test_kmx -PID_FILE=/tmp/ibus-keyman-test-pids - -if [ -v KEYMAN_PKG_BUILD ]; then - # During package builds we skip these tests that require to start ibus because - # ibus requires to find /var/lib/dbus/machine-id or /etc/machine-id, otherwise it fails with: - # "Bail out! IBUS-FATAL-WARNING: Unable to load /var/lib/dbus/machine-id: Failed to open file - # “/var/lib/dbus/machine-id”: No such file or directory" - echo "1..1" - echo "ok 1 - Integration tests # SKIP on package build" - exit 0 -fi - -if ! which Xvfb > /dev/null || ! which Xephyr > /dev/null || ! which metacity > /dev/null || ! which mutter > /dev/null; then - echo "Please install Xvfb, Xephyr, metacity and mutter before running these tests!" - exit 1 -fi - -function cleanup() { - if [ -f $PID_FILE ]; then - echo - echo "Shutting down processes..." - bash $PID_FILE > /dev/null 2>&1 - rm $PID_FILE - echo "Finished shutdown of processes." - fi -} - -function help() { - echo "Usage:" - echo " $0 [-k] [--tap] [--surrounding-text] [--no-surrounding-text] [--no-wayland] [--no-x11] [[--] TEST...]" - echo - echo "Arguments:" - echo " --help, -h, -? Display this help" - echo " --verbose, -v Run tests verbosely" - echo " --debug debug test logging output" - echo " -k passed to GLib testing framework" - echo " --tap output in TAP format. Passed to GLib testing framework" - echo " --surrounding-text run tests with surrounding texts enabled" - echo " --no-surrounding-text run tests without support for surrounding text" - echo " --no-wayland don't run tests with Wayland" - echo " --no-x11 don't run tests with X11" - echo - echo "If no TESTs are specified then all tests are run." - echo "If neither --surrounding-text nor --no-surrounding-text are specified then the tests run with both settings." - exit 0 -} - -function can_run_wayland() { - local MUTTER_VERSION - MUTTER_VERSION=$(mutter --version | head -1 | cut -f2 -d' ' | cut -f1 -d'.') - if (( $MUTTER_VERSION < 40 )); then - return 1 - else - return 0 - fi -} - -function run_tests() { - DISPLAY_SERVER=$1 - shift - - echo > $PID_FILE - TEMP_DATA_DIR=$(mktemp --directory) - echo "rm -rf ${TEMP_DATA_DIR}" >> $PID_FILE - - COMMON_ARCH_DIR= - [ -d ${TOP_SRCDIR}/../../core/build/arch ] && COMMON_ARCH_DIR=${TOP_SRCDIR}/../../core/build/arch - [ -d ${TOP_SRCDIR}/../keyboardprocessor/arch ] && COMMON_ARCH_DIR=${TOP_SRCDIR}/../keyboardprocessor/arch - - if [ -d ${COMMON_ARCH_DIR}/release ]; then - COMMON_ARCH_DIR=${COMMON_ARCH_DIR}/release - elif [ -d ${COMMON_ARCH_DIR}/debug ]; then - COMMON_ARCH_DIR=${COMMON_ARCH_DIR}/debug - else - echo "Can't find neither ${COMMON_ARCH_DIR}/release nor ${COMMON_ARCH_DIR}/debug" - exit 2 - fi - - if [ ! -d $TESTDIR ] || ! [[ $(ls -x ${TESTDIR}/*.kmx 2>/dev/null | wc -l) > 0 ]]; then - if [[ $(ls -x ${COMMON_ARCH_DIR}/tests/unit/kmx/*.kmx 2>/dev/null | wc -l) > 0 ]]; then - mkdir -p $(realpath --canonicalize-missing $TESTDIR/..) - ln -sf $(realpath ${COMMON_ARCH_DIR}/tests/unit/kmx) $TESTDIR - else - echo "Can't find kmx files in ${COMMON_ARCH_DIR}/tests/unit/kmx" - exit 3 - fi - fi - - echo "NOTE: When the tests fail check /tmp/ibus-engine-keyman.log and /tmp/ibus-daemon.log!" - echo "" - - if [ "$DISPLAY_SERVER" == "wayland" ]; then - if ! can_run_wayland; then - # support for --headless got added in mutter 40.x - echo "ERROR: mutter doesn't support running headless. Can't run Wayland tests." - exit 7 - fi - echo "Running on Wayland..." - TMPFILE=$(mktemp) - # mutter-Message: 18:56:15.422: Using Wayland display name 'wayland-1' - mutter --wayland --headless --no-x11 --virtual-monitor 1024x768 &> $TMPFILE & - echo "kill -9 $!" >> $PID_FILE - sleep 1s - export WAYLAND_DISPLAY=$(cat $TMPFILE | grep "Using Wayland display" | cut -d"'" -f2) - rm $TMPFILE - else - echo "Starting Xvfb..." - Xvfb -screen 0 1024x768x24 :33 &> /dev/null & - echo "kill -9 $!" >> $PID_FILE - sleep 1 - echo "Starting Xephyr..." - DISPLAY=:33 Xephyr :32 -screen 1024x768 &> /dev/null & - echo "kill -9 $!" >> $PID_FILE - sleep 1 - echo "Starting metacity" - metacity --display=:32 &> /dev/null & - echo "kill -9 $!" >> $PID_FILE - - export DISPLAY=:32 - fi - - # Install schema to temporary directory. This removes the build dependency on the keyman package. - SCHEMA_DIR=$TEMP_DATA_DIR/glib-2.0/schemas - export XDG_DATA_DIRS=$TEMP_DATA_DIR:$XDG_DATA_DIRS - - mkdir -p $SCHEMA_DIR - cp ${TOP_SRCDIR}/../keyman-config/com.keyman.gschema.xml $SCHEMA_DIR/ - glib-compile-schemas $SCHEMA_DIR - - if [ $# -gt 0 ]; then - TESTFILES=($@) - else - pushd $TESTDIR > /dev/null - TESTFILES=(*.kmx) - popd > /dev/null - fi - - export LD_LIBRARY_PATH=${COMMON_ARCH_DIR}/src:$LD_LIBRARY_PATH - - # Ubuntu 18.04 Bionic doesn't have ibus-memconf, and glib is not compiled with the keyfile - # backend enabled, so we just use the default backend. Otherwise we use the keyfile - # store which interferes less when running on a dev machine. - if [ -f /usr/libexec/ibus-memconf ]; then - export GSETTINGS_BACKEND=keyfile - IBUS_CONFIG=--config=/usr/libexec/ibus-memconf - fi - - ibus-daemon ${ARG_VERBOSE-} --panel=disable ${IBUS_CONFIG-} &> /tmp/ibus-daemon.log & - echo "kill -9 $!" >> $PID_FILE - sleep 1s - - ../src/ibus-engine-keyman ${ARG_VERBOSE-} &> /tmp/ibus-engine-keyman.log & - echo "kill -9 $!" >> $PID_FILE - sleep 1s - - echo "Starting tests..." - # Note: -k and --tap are consumed by the GLib testing framework - ./ibus-keyman-tests ${ARG_K-} ${ARG_TAP-} ${ARG_VERBOSE-} ${ARG_DEBUG-} \ - ${ARG_SURROUNDING_TEXT-} ${ARG_NO_SURROUNDING_TEXT-} \ - --directory $TESTDIR --${DISPLAY_SERVER} "${TESTFILES[@]}" - echo "Finished tests." - - cleanup -} - -USE_WAYLAND=1 -USE_X11=1 - -while (( $# )); do - case $1 in - --help|-h|-\?) help ;; - -k) ARG_K=$1 ;; - --tap) ARG_TAP=$1 ;; - --surrounding-text) ARG_SURROUNDING_TEXT=$1 ;; - --no-surrounding-text) ARG_NO_SURROUNDING_TEXT=$1 ;; - --no-wayland) USE_WAYLAND=0;; - --no-x11) USE_X11=0;; - --verbose|-v) ARG_VERBOSE=--verbose;; - --debug) ARG_DEBUG=--debug-log;; - --) shift && break ;; - *) echo "Error: Unexpected argument \"$1\". Exiting." ; exit 4 ;; - esac - shift || (echo "Error: The last argument is missing a value. Exiting."; false) || exit 5 -done - -if ! can_run_wayland; then - # support for --headless got added in mutter 40.x - echo "WARNING: mutter doesn't support running headless. Skipping Wayland tests." - USE_WAYLAND=0 - if [ "$USE_X11" == "0" ]; then - echo "ERROR: no tests to run. Can't run Wayland tests, and --no-x11 is specified." - exit 8 - fi -fi - -if [ "$USE_WAYLAND" == "0" -a "$USE_X11" == "0" ]; then - echo "ERROR: I'll have to run somewhere. Specifying both --no-wayland and --no-x11 is not allowed." - exit 6 -fi - -echo > $PID_FILE -trap cleanup EXIT SIGINT - -if [ "$USE_WAYLAND" == "1" ]; then - run_tests wayland "$@" -fi - -if [ "$USE_X11" == "1" ]; then - run_tests x11 "$@" -fi diff --git a/linux/ibus-keyman/tests/scripts/run-single-test.sh b/linux/ibus-keyman/tests/scripts/run-single-test.sh index c265c27ccdf3c9c78533dc58b37585b16fca611c..8e4e84f2cac5cd7aa91f51cb0307035a25934798 100755 --- a/linux/ibus-keyman/tests/scripts/run-single-test.sh +++ b/linux/ibus-keyman/tests/scripts/run-single-test.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -eu TESTDIR=${XDG_DATA_HOME:-$HOME/.local/share}/keyman/test_kmx . "$(dirname "$0")"/test-helper.sh diff --git a/linux/ibus-keyman/tests/scripts/run-tests.sh b/linux/ibus-keyman/tests/scripts/run-tests.sh index b80dd1a5f4e0ca3dbfb1136a2dc4289e5fb492bc..4c0934511f35324e88f67c9acf739642129b4517 100755 --- a/linux/ibus-keyman/tests/scripts/run-tests.sh +++ b/linux/ibus-keyman/tests/scripts/run-tests.sh @@ -1,7 +1,10 @@ #!/usr/bin/env bash +set -eu -TOP_SRCDIR=${top_srcdir:-$(realpath "$(dirname "$0")/..")} -TESTDIR=${XDG_DATA_HOME:-$HOME/.local/share}/keyman/test_kmx +TOP_SRCDIR=${top_srcdir:-$(realpath "$(dirname "$0")/../..")} +TESTBASEDIR=${XDG_DATA_HOME:-$HOME/.local/share}/keyman +TESTDIR=${TESTBASEDIR}/test_kmx +PID_FILE=/tmp/ibus-keyman-test-pids . "$(dirname "$0")"/test-helper.sh @@ -56,11 +59,10 @@ function run_tests() { echo > "$PID_FILE" TEMP_DATA_DIR=$(mktemp --directory) - echo "rm -rf ${TEMP_DATA_DIR}" >> "$PID_FILE" + echo "rm -rf ${TEMP_DATA_DIR} || true" >> "$PID_FILE" COMMON_ARCH_DIR= [ -d "${TOP_SRCDIR}"/../../core/build/arch ] && COMMON_ARCH_DIR=${TOP_SRCDIR}/../../core/build/arch - [ -d "${TOP_SRCDIR}"/../keyboardprocessor/arch ] && COMMON_ARCH_DIR=${TOP_SRCDIR}/../keyboardprocessor/arch if [ -d "${COMMON_ARCH_DIR}"/release ]; then COMMON_ARCH_DIR=${COMMON_ARCH_DIR}/release @@ -71,15 +73,9 @@ function run_tests() { exit 2 fi - if [ ! -d "$TESTDIR" ] || ! [[ $(find "${TESTDIR}/" -name \*.kmx 2>/dev/null | wc -l) -gt 0 ]]; then - if [[ $(find "${COMMON_ARCH_DIR}/tests/unit/kmx/" -name \*.kmx 2>/dev/null | wc -l) -gt 0 ]]; then - mkdir -p "$(realpath --canonicalize-missing "$TESTDIR"/..)" - ln -sf "$(realpath "${COMMON_ARCH_DIR}"/tests/unit/kmx)" "$TESTDIR" - else - echo "Can't find kmx files in ${COMMON_ARCH_DIR}/tests/unit/kmx" - exit 3 - fi - fi + link_test_keyboards "${TOP_SRCDIR}/../../common/test/keyboards/baseline" "$TESTDIR" "$TESTBASEDIR" + + generate_kmpjson "$TESTDIR" echo "# NOTE: When the tests fail check /tmp/ibus-engine-keyman.log and /tmp/ibus-daemon.log!" echo "" @@ -94,23 +90,23 @@ function run_tests() { TMPFILE=$(mktemp) # mutter-Message: 18:56:15.422: Using Wayland display name 'wayland-1' mutter --wayland --headless --no-x11 --virtual-monitor 1024x768 &> "$TMPFILE" & - echo "kill -9 $!" >> "$PID_FILE" + echo "kill -9 $! || true" >> "$PID_FILE" sleep 1s export WAYLAND_DISPLAY - WAYLAND_DISPLAY=$(cat "$TMPFILE" | grep "Using Wayland display" | cut -d"'" -f2) + WAYLAND_DISPLAY=$(grep "Using Wayland display" "$TMPFILE" | cut -d"'" -f2) rm "$TMPFILE" else echo "# Starting Xvfb..." Xvfb -screen 0 1024x768x24 :33 &> /dev/null & - echo "kill -9 $!" >> "$PID_FILE" + echo "kill -9 $! || true" >> "$PID_FILE" sleep 1 echo "# Starting Xephyr..." DISPLAY=:33 Xephyr :32 -screen 1024x768 &> /dev/null & - echo "kill -9 $!" >> "$PID_FILE" + echo "kill -9 $! || true" >> "$PID_FILE" sleep 1 echo "# Starting metacity" metacity --display=:32 &> /dev/null & - echo "kill -9 $!" >> "$PID_FILE" + echo "kill -9 $! || true" >> "$PID_FILE" export DISPLAY=:32 fi @@ -124,6 +120,7 @@ function run_tests() { glib-compile-schemas "$SCHEMA_DIR" if [ $# -gt 0 ]; then + #shellcheck disable=SC2206 TESTFILES=($@) else pushd "$TESTDIR" > /dev/null || exit @@ -131,7 +128,7 @@ function run_tests() { popd > /dev/null || exit fi - export LD_LIBRARY_PATH=${COMMON_ARCH_DIR}/src:$LD_LIBRARY_PATH + export LD_LIBRARY_PATH=${COMMON_ARCH_DIR}/src:${LD_LIBRARY_PATH-} # Ubuntu 18.04 Bionic doesn't have ibus-memconf, and glib is not compiled with the keyfile # backend enabled, so we just use the default backend. Otherwise we use the keyfile @@ -141,19 +138,34 @@ function run_tests() { IBUS_CONFIG=--config=/usr/libexec/ibus-memconf fi - ibus-daemon "${ARG_VERBOSE-}" --panel=disable ${IBUS_CONFIG-} &> /tmp/ibus-daemon.log & - echo "kill -9 $!" >> "$PID_FILE" + #shellcheck disable=SC2086 + ibus-daemon "${ARG_VERBOSE-}" --panel=disable --address=unix:abstract="${TEMP_DATA_DIR}"/test-ibus ${IBUS_CONFIG-} &> /tmp/ibus-daemon.log & + echo "kill -9 $! || true" >> "$PID_FILE" sleep 1s - ../src/ibus-engine-keyman "${ARG_VERBOSE-}" &> /tmp/ibus-engine-keyman.log & - echo "kill -9 $!" >> "$PID_FILE" + IBUS_ADDRESS=$(ibus address) + export IBUS_ADDRESS + + if [ -d "../../build/$(arch)/debug" ]; then + CONFIG=debug + elif [ -d "../../build/$(arch)/release" ]; then + CONFIG=release + else + echo "Can't find neither ../../build/$(arch)/debug nor ../../build/$(arch)/release" + exit 9 + fi + + "../../build/$(arch)/${CONFIG}/src/ibus-engine-keyman" "${ARG_VERBOSE-}" &> /tmp/ibus-engine-keyman.log & + echo "kill -9 $! || true" >> "$PID_FILE" sleep 1s echo "# Starting tests..." # Note: -k and --tap are consumed by the GLib testing framework - "${G_TEST_BUILDDIR:-.}"/ibus-keyman-tests "${ARG_K-}" "${ARG_TAP-}" \ - "${ARG_VERBOSE-}" "${ARG_DEBUG-}" "${ARG_SURROUNDING_TEXT-}" "${ARG_NO_SURROUNDING_TEXT-}" \ - --directory "$TESTDIR" --"${DISPLAY_SERVER}" "${TESTFILES[@]}" + #shellcheck disable=SC2068 # we want to split array elements! + #shellcheck disable=SC2086 + "${G_TEST_BUILDDIR:-../../build/$(arch)/${CONFIG}/tests}/ibus-keyman-tests" ${ARG_K-} ${ARG_TAP-} \ + ${ARG_VERBOSE-} ${ARG_DEBUG-} ${ARG_SURROUNDING_TEXT-} ${ARG_NO_SURROUNDING_TEXT-} \ + --directory "$TESTDIR" --"${DISPLAY_SERVER}" ${TESTFILES[@]} echo "# Finished tests." cleanup @@ -194,13 +206,18 @@ if [ "$USE_WAYLAND" == "0" ] && [ "$USE_X11" == "0" ]; then exit 6 fi +G_TEST_BUILDDIR="${G_TEST_BUILDDIR:-../../build/$(arch)/debug/tests}" +if [ ! -f "${G_TEST_BUILDDIR}/ibus-keyman-tests" ]; then + G_TEST_BUILDDIR="${G_TEST_BUILDDIR:-../../build/$(arch)/release/tests}" +fi + echo > "$PID_FILE" trap cleanup EXIT SIGINT if [ "$USE_WAYLAND" == "1" ]; then - run_tests wayland "$@" + ( run_tests wayland "$@" ) fi if [ "$USE_X11" == "1" ]; then - run_tests x11 "$@" + ( run_tests x11 "$@" ) fi diff --git a/linux/ibus-keyman/tests/scripts/setup-tests.sh b/linux/ibus-keyman/tests/scripts/setup-tests.sh index e48d36eba9dea02cef9ad4720dd27d773afc05cb..62f6a978175f9ad020acf6f4d5235a6facf9083f 100755 --- a/linux/ibus-keyman/tests/scripts/setup-tests.sh +++ b/linux/ibus-keyman/tests/scripts/setup-tests.sh @@ -1,13 +1,16 @@ #!/usr/bin/env bash +set -eu DISPLAY_SERVER=$1 ENV_FILE=$2 PID_FILE=$3 TOP_SRCDIR=${G_TEST_SRCDIR:-$(realpath "$(dirname "$0")/..")}/.. TOP_BINDIR=${G_TEST_BUILDDIR:-$(realpath "$(dirname "$0/..")")}/.. -TESTDIR=${XDG_DATA_HOME:-$HOME/.local/share}/keyman/test_kmx +TESTBASEDIR=${XDG_DATA_HOME:-$HOME/.local/share}/keyman +TESTDIR=${TESTBASEDIR}/test_kmx -. "$(dirname "$0")/"/test-helper.sh +# shellcheck source=linux/ibus-keyman/tests/scripts/test-helper.sh +. "$(dirname "$0")"/test-helper.sh echo > "$ENV_FILE" @@ -18,11 +21,10 @@ fi echo > "$PID_FILE" TEMP_DATA_DIR=$(mktemp --directory) -echo "rm -rf ${TEMP_DATA_DIR}" >> "$PID_FILE" +echo "rm -rf ${TEMP_DATA_DIR} || true" >> "$PID_FILE" COMMON_ARCH_DIR= [ -d "${TOP_SRCDIR}"/../../core/build/arch ] && COMMON_ARCH_DIR=${TOP_SRCDIR}/../../core/build/arch -[ -d "${TOP_SRCDIR}"/../keyboardprocessor/arch ] && COMMON_ARCH_DIR=${TOP_SRCDIR}/../keyboardprocessor/arch if [ -d "${COMMON_ARCH_DIR}"/release ]; then COMMON_ARCH_DIR=${COMMON_ARCH_DIR}/release @@ -33,15 +35,9 @@ else exit 2 fi -if [ ! -d "$TESTDIR" ] || ! [[ $(find "${TESTDIR}/" -name \*.kmx 2>/dev/null | wc -l) -gt 0 ]]; then - if [[ $(find "${COMMON_ARCH_DIR}/tests/unit/kmx/" -name \*.kmx 2>/dev/null | wc -l) -gt 0 ]]; then - mkdir -p "$(realpath --canonicalize-missing "$TESTDIR"/..)" - ln -sf "$(realpath "${COMMON_ARCH_DIR}"/tests/unit/kmx)" "$TESTDIR" - else - echo "Can't find kmx files in ${COMMON_ARCH_DIR}/tests/unit/kmx" - exit 3 - fi -fi +link_test_keyboards "${TOP_SRCDIR}/../../common/test/keyboards/baseline" "$TESTDIR" "$TESTBASEDIR" + +generate_kmpjson "$TESTDIR" if [ "$DISPLAY_SERVER" == "wayland" ]; then if ! can_run_wayland; then @@ -53,7 +49,7 @@ if [ "$DISPLAY_SERVER" == "wayland" ]; then TMPFILE=$(mktemp) # mutter-Message: 18:56:15.422: Using Wayland display name 'wayland-1' mutter --wayland --headless --no-x11 --virtual-monitor 1024x768 &> "$TMPFILE" & - echo "kill -9 $!" >> "$PID_FILE" + echo "kill -9 $! || true" >> "$PID_FILE" sleep 1s export WAYLAND_DISPLAY WAYLAND_DISPLAY=$(grep "Using Wayland display" "$TMPFILE" | cut -d"'" -f2) @@ -62,50 +58,52 @@ if [ "$DISPLAY_SERVER" == "wayland" ]; then else echo "Starting Xvfb..." Xvfb -screen 0 1024x768x24 :33 &> /dev/null & - echo "kill -9 $!" >> "$PID_FILE" + echo "kill -9 $! || true" >> "$PID_FILE" sleep 1 echo "Starting Xephyr..." DISPLAY=:33 Xephyr :32 -screen 1024x768 &> /dev/null & - echo "kill -9 $!" >> "$PID_FILE" + echo "kill -9 $! || true" >> "$PID_FILE" sleep 1 echo "Starting metacity" metacity --display=:32 &> /dev/null & - echo "kill -9 $!" >> "$PID_FILE" + echo "kill -9 $! || true" >> "$PID_FILE" export DISPLAY=:32 echo "export DISPLAY=\"$DISPLAY\"" >> "$ENV_FILE" fi - # Install schema to temporary directory. This removes the build dependency on the keyman package. - SCHEMA_DIR=$TEMP_DATA_DIR/glib-2.0/schemas - export XDG_DATA_DIRS=$TEMP_DATA_DIR:$XDG_DATA_DIRS - echo "export XDG_DATA_DIRS=\"$XDG_DATA_DIRS\"" >> "$ENV_FILE" - - mkdir -p "$SCHEMA_DIR" - cp "${TOP_SRCDIR}"/../keyman-config/com.keyman.gschema.xml "$SCHEMA_DIR"/ - glib-compile-schemas "$SCHEMA_DIR" - - export LD_LIBRARY_PATH=${COMMON_ARCH_DIR}/src:$LD_LIBRARY_PATH - echo "export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"" >> "$ENV_FILE" - - # Ubuntu 18.04 Bionic doesn't have ibus-memconf, and glib is not compiled with the keyfile - # backend enabled, so we just use the default backend. Otherwise we use the keyfile - # store which interferes less when running on a dev machine. - if [ -f /usr/libexec/ibus-memconf ]; then - export GSETTINGS_BACKEND=keyfile - echo "export GSETTINGS_BACKEND=\"$GSETTINGS_BACKEND\"" >> "$ENV_FILE" - IBUS_CONFIG=--config=/usr/libexec/ibus-memconf - fi +# Install schema to temporary directory. This removes the build dependency on the keyman package. +SCHEMA_DIR=$TEMP_DATA_DIR/glib-2.0/schemas +export XDG_DATA_DIRS=$TEMP_DATA_DIR:${XDG_DATA_DIRS-} +echo "export XDG_DATA_DIRS=\"$XDG_DATA_DIRS\"" >> "$ENV_FILE" + +mkdir -p "$SCHEMA_DIR" +cp "${TOP_SRCDIR}"/../keyman-config/com.keyman.gschema.xml "$SCHEMA_DIR"/ +glib-compile-schemas "$SCHEMA_DIR" + +export LD_LIBRARY_PATH=${COMMON_ARCH_DIR}/src:${LD_LIBRARY_PATH-} +echo "export LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"" >> "$ENV_FILE" + +# Ubuntu 18.04 Bionic doesn't have ibus-memconf, and glib is not compiled with the keyfile +# backend enabled, so we just use the default backend. Otherwise we use the keyfile +# store which interferes less when running on a dev machine. +if [ -f /usr/libexec/ibus-memconf ]; then + export GSETTINGS_BACKEND=keyfile + echo "export GSETTINGS_BACKEND=\"$GSETTINGS_BACKEND\"" >> "$ENV_FILE" + IBUS_CONFIG=--config=/usr/libexec/ibus-memconf +fi - ibus-daemon "${ARG_VERBOSE-}" --daemonize --panel=disable ${IBUS_CONFIG-} &> /tmp/ibus-daemon.log - echo "kill -9 $!" >> "$PID_FILE" - sleep 1s +#shellcheck disable=SC2086 +ibus-daemon ${ARG_VERBOSE-} --daemonize --panel=disable --address=unix:abstract="${TEMP_DATA_DIR}/test-ibus" ${IBUS_CONFIG-} &> /tmp/ibus-daemon.log +echo "kill -9 $! || true" >> "$PID_FILE" +sleep 1s - IBUS_ADDRESS=$(ibus address) - export IBUS_ADDRESS +IBUS_ADDRESS=$(ibus address) +export IBUS_ADDRESS - echo "export IBUS_ADDRESS=\"$IBUS_ADDRESS\"" >> "$ENV_FILE" +echo "export IBUS_ADDRESS=\"$IBUS_ADDRESS\"" >> "$ENV_FILE" - "${TOP_BINDIR}"/src/ibus-engine-keyman "${ARG_VERBOSE-}" &> /tmp/ibus-engine-keyman.log & - echo "kill -9 $!" >> "$PID_FILE" - sleep 1s +#shellcheck disable=SC2086 +"${TOP_BINDIR}/src/ibus-engine-keyman" ${ARG_VERBOSE-} &> /tmp/ibus-engine-keyman.log & +echo "kill -9 $! || true" >> "$PID_FILE" +sleep 1s diff --git a/linux/ibus-keyman/tests/scripts/teardown-tests.sh b/linux/ibus-keyman/tests/scripts/teardown-tests.sh index 489769d7218efed5bce5bd5874ce412cf5f47b05..45cfce605df00c9a2a885546373648809e2c637d 100755 --- a/linux/ibus-keyman/tests/scripts/teardown-tests.sh +++ b/linux/ibus-keyman/tests/scripts/teardown-tests.sh @@ -1,4 +1,5 @@ #!/usr/bin/env bash +set -eu PID_FILE=$1 echo "Shutting down processes..." diff --git a/linux/ibus-keyman/tests/scripts/test-helper.sh b/linux/ibus-keyman/tests/scripts/test-helper.sh index 92c8a7e5287928c2bcc853bdb047e2ef6fbfc2f8..efee4c26f1c7019b2f7a3ec6bb901dcc3405f360 100755 --- a/linux/ibus-keyman/tests/scripts/test-helper.sh +++ b/linux/ibus-keyman/tests/scripts/test-helper.sh @@ -9,3 +9,86 @@ function can_run_wayland() { return 0 fi } + +function generate_kmpjson() { + local TESTDIR + TESTDIR="$1" + pushd "$TESTDIR" > /dev/null || exit + KMPFILE="${TESTDIR}/kmp.json" + cat <<-EOF > "$KMPFILE" + { + "system": { + "keymanDeveloperVersion": "10.0.1099.0", + "fileVersion": "7.0" + }, + "info": { + "name": { + "description": "Test Keyboards" + }, + "version": { + "description": "0.0" + } + }, + "files": [ + { + "name": "kmp.json", + "description": "Package information (JSON)" + } +EOF + for f in k_*.kmx; do + keyboard=$(basename "$f") + keyboard="${keyboard%.*}" + echo " ," >> "$KMPFILE" + cat <<-EOF >> "$KMPFILE" + { + "name": "$keyboard", + "description": "$keyboard" + } +EOF + done + cat <<-EOF >> "$KMPFILE" + ], + "keyboards": [ +EOF + FIRST=true + for f in k_*.kmx; do + keyboard=$(basename "$f") + keyboard="${keyboard%.*}" + if $FIRST; then + FIRST=false + else + echo " ," >> "$KMPFILE" + fi + cat <<-EOF >> "$KMPFILE" + { + "name": "$keyboard", + "id": "$keyboard", + "version": "0.0", + "languages": [ + { + "name": "Undetermined", + "id": "und" + } + ] + } +EOF + done + echo " ]" >> "$KMPFILE" + echo "}" >> "$KMPFILE" + popd > /dev/null || exit +} + +function link_test_keyboards() { + KMX_TEST_DIR=$1 + TESTDIR=$2 + TESTBASEDIR=$3 + + if [[ $(find "${KMX_TEST_DIR}/" -name k_\*.kmx 2>/dev/null | wc -l) -gt 0 ]]; then + mkdir -p "$(realpath --canonicalize-missing "$TESTBASEDIR")" + rm -f "$TESTDIR" + ln -sf "$(realpath "${KMX_TEST_DIR}")" "$TESTDIR" + else + echo "Can't find test kmx files in ${KMX_TEST_DIR}" + exit 3 + fi +} diff --git a/linux/ibus-keyman/tests/testfixture.cpp b/linux/ibus-keyman/tests/testfixture.cpp index 5f811572d056da460804d10fef0dce38c1db11d4..3e189258bdb11e19c6ba9b69aea1982473572163 100644 --- a/linux/ibus-keyman/tests/testfixture.cpp +++ b/linux/ibus-keyman/tests/testfixture.cpp @@ -528,9 +528,17 @@ main(int argc, char *argv[]) { skipReason = "mnemonic keyboards are not yet supported on Linux (#3345)"; } + // Wayland related tests - #4273 + if (use_wayland && ( + strcmp(filename->str, "k_031___caps_lock") == 0 || + strcmp(filename->str, "k_032___caps_control") == 0)) { + skipReason = "capslock related keyboards are not yet working with Wayland (#4273)"; + } + if (runSurroundingTextTests) { add_test(directory, filename->str, TRUE, skipReason, use_wayland); } + if (runNoSurroundingTextTests) { add_test(directory, filename->str, FALSE, skipReason, use_wayland); } diff --git a/linux/keyman-config/.editorconfig b/linux/keyman-config/.editorconfig index 4b530139d7b44db0fbccb2a55ff018d9c137f63b..f65775da76c6b240b5e899aba70b3e44efb76245 100644 --- a/linux/keyman-config/.editorconfig +++ b/linux/keyman-config/.editorconfig @@ -7,4 +7,7 @@ indent_size = 4 indent_style = tab [Makefile] -indent_style = tab \ No newline at end of file +indent_style = tab + +[*.sh] +indent_size = 2 diff --git a/linux/keyman-config/Makefile b/linux/keyman-config/Makefile index e5397650696610fc61a431f1054a69bf8a2493ce..41eaab30efb727be2c2e527059e32a1f2d7aa9e4 100644 --- a/linux/keyman-config/Makefile +++ b/linux/keyman-config/Makefile @@ -6,7 +6,14 @@ default: clean version man langtags langtags: cd buildtools && python3 ./build-langtags.py -install: # run as sudo +install: + if [ -n "${SUDO_USER}" ]; then \ + make install-sudo; \ + else \ + make install-temp; \ + fi + +install-sudo: # run as sudo pip3 install qrcode sentry-sdk # eventually change this to: pip3 install . python3 setup.py install @@ -59,7 +66,7 @@ man: ./build-help.sh --man --no-reconf version_reconf: - cd .. && ./scripts/reconf.sh keyman-config + cd .. && ./scripts/reconf.sh version: version_reconf $(eval VERSION := $(shell python3 -c "from keyman_config import __releaseversion__; print(__releaseversion__)")) diff --git a/linux/keyman-config/build-help.sh b/linux/keyman-config/build-help.sh index e525fdbb768f3974611a2b6655ccaa325bbeed56..97f06ca3d0012649012eaa781a061f46000331ed 100755 --- a/linux/keyman-config/build-help.sh +++ b/linux/keyman-config/build-help.sh @@ -5,7 +5,7 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" ## END STANDARD BUILD SCRIPT INCLUDE THIS_DIR=$(dirname "$THIS_SCRIPT") @@ -57,7 +57,7 @@ fi if [ -n "$reconfigure" ]; then pushd $THIS_DIR/.. > /dev/null - ./scripts/reconf.sh keyman-config + ./scripts/reconf.sh popd > /dev/null fi diff --git a/linux/keyman-config/build.sh b/linux/keyman-config/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..38cf22e917b40ab8a37c60b15a5748681bc5c66e --- /dev/null +++ b/linux/keyman-config/build.sh @@ -0,0 +1,32 @@ +#!/usr/bin/env bash + +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +################################ Main script ################################ + +builder_describe \ + "Build keyman-config." \ + "clean" \ + "configure" \ + "build" \ + "test" \ + "install install artifacts" \ + "uninstall uninstall artifacts" \ + +builder_parse "$@" + +cd "$THIS_SCRIPT_PATH" + +builder_describe_outputs \ + build "/linux/keyman-config/keyman_config/standards/lang_tags_map.py" + +builder_run_action clean make clean +builder_run_action configure # nothing to do +builder_run_action build make +builder_run_action test ./run-tests.sh +builder_run_action install make install +builder_run_action uninstall make uninstall diff --git a/linux/keyman-config/keyman_config/install_kmp.py b/linux/keyman-config/keyman_config/install_kmp.py index 0caa9ac0fc180fad37151b18800d2ad6d47f5551..fcf8eabc5df0c988bc90ee92647acc7c1ee232ac 100755 --- a/linux/keyman-config/keyman_config/install_kmp.py +++ b/linux/keyman-config/keyman_config/install_kmp.py @@ -281,8 +281,11 @@ class InstallKmp(): def extract_kmp(kmpfile, directory): - with zipfile.ZipFile(kmpfile, "r") as zip_ref: - zip_ref.extractall(directory) + try: + with zipfile.ZipFile(kmpfile, "r") as zip_ref: + zip_ref.extractall(directory) + except zipfile.BadZipFile as e: + raise InstallError(InstallStatus.Abort, e) def process_keyboard_data(keyboardID, packageDir) -> None: diff --git a/linux/keyman-config/keyman_config/install_window.py b/linux/keyman-config/keyman_config/install_window.py index 9ae0d41cc01ab7a2ea1052de1c074b7ebaff8950..b0684d79f984936fafb64f4665c2748d01e1aeb3 100755 --- a/linux/keyman-config/keyman_config/install_window.py +++ b/linux/keyman-config/keyman_config/install_window.py @@ -49,6 +49,7 @@ class InstallKmpWindow(Gtk.Dialog): def __init__(self, kmpfile, viewkmp=None, language=None): logging.debug("InstallKmpWindow: kmpfile: %s", kmpfile) + self.is_error = False self.kmpfile = kmpfile self.viewwindow = viewkmp self.accelerators = None @@ -67,7 +68,13 @@ class InstallKmpWindow(Gtk.Dialog): mainhbox = Gtk.Box() with tempfile.TemporaryDirectory() as tmpdirname: - extract_kmp(kmpfile, tmpdirname) + try: + extract_kmp(kmpfile, tmpdirname) + except InstallError as e: + self._handle_install_error(e, kmpfile) + self.is_error = True + return + info, system, options, keyboards, files = get_metadata(tmpdirname) if not keyboards: # Likely not a keyboard .kmp file @@ -357,27 +364,30 @@ class InstallKmpWindow(Gtk.Dialog): dialog.run() dialog.destroy() except InstallError as e: - if e.status == InstallStatus.Abort: - message = _("Keyboard {name} could not be installed.").format(name=self.kbname) \ - + "\n\n" + _("Error Message:") + "\n %s" % (e.message) - logging.error(message) - message_type = Gtk.MessageType.ERROR - else: - message = _("Keyboard {name} could not be installed.").format(name=self.kbname) \ - + "\n\n" + _("Warning Message:") + "\n %s" % (e.message) - logging.warning(message) - message_type = Gtk.MessageType.WARNING - dialog = Gtk.MessageDialog( - self, 0, message_type, - Gtk.ButtonsType.OK, message) - dialog.run() - dialog.destroy() + self._handle_install_error(e, self.kbname) self.close() def on_cancel_clicked(self, button): logging.info("Cancel install keyboard") self.response(Gtk.ResponseType.CANCEL) + def _handle_install_error(self, e, kbname): + if e.status == InstallStatus.Abort: + message = _("Keyboard {name} could not be installed.").format(name=kbname) \ + + "\n\n" + _("Error Message:") + "\n %s" % (e.message) + logging.error(message) + message_type = Gtk.MessageType.ERROR + else: + message = _("Keyboard {name} could not be installed.").format(name=kbname) \ + + "\n\n" + _("Warning Message:") + "\n %s" % (e.message) + logging.warning(message) + message_type = Gtk.MessageType.WARNING + dialog = Gtk.MessageDialog( + self, 0, message_type, + Gtk.ButtonsType.OK, message) + dialog.run() + dialog.destroy() + def main(argv): if len(sys.argv) != 2: diff --git a/linux/keyman-config/keyman_config/view_installed.py b/linux/keyman-config/keyman_config/view_installed.py index 671ca2d27924e096d2bb6717c91b1c50f81ec127..01b1a59b89b3e413619c87abd56c479667abeab2 100755 --- a/linux/keyman-config/keyman_config/view_installed.py +++ b/linux/keyman-config/keyman_config/view_installed.py @@ -41,7 +41,7 @@ class ViewInstalledWindowBase(Gtk.Window): def on_close_clicked(self, button): logging.debug("Close application clicked") - Gtk.main_quit() + self.close() def on_refresh_clicked(self, button): logging.debug("Refresh application clicked") @@ -82,6 +82,8 @@ class ViewInstalledWindowBase(Gtk.Window): def install_file(self, kmpfile, language=None): installDlg = InstallKmpWindow(kmpfile, viewkmp=self, language=language) + if installDlg.is_error: + return Gtk.ResponseType.CANCEL result = installDlg.run() installDlg.destroy() return result diff --git a/linux/keyman-config/locale/ckl_NG.po b/linux/keyman-config/locale/ckl_NG.po index b4cacac33853c322c59c8864fca87014a80bd47c..8dab46ae8539ba752df2b53f150a05cc788a51a0 100644 --- a/linux/keyman-config/locale/ckl_NG.po +++ b/linux/keyman-config/locale/ckl_NG.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: keyman\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-19 19:17+0200\n" -"PO-Revision-Date: 2022-10-25 04:29\n" +"PO-Revision-Date: 2023-03-16 04:24\n" "Last-Translator: \n" "Language-Team: Kibaku\n" "Language: ckl_NG\n" diff --git a/linux/keyman-config/locale/ff_ZA.po b/linux/keyman-config/locale/ff_ZA.po index c20f361d9c285615f16fb287c5467336fb923212..04de8a26cbfc01c4cd8fb94beb9d15e3b83e9f1d 100644 --- a/linux/keyman-config/locale/ff_ZA.po +++ b/linux/keyman-config/locale/ff_ZA.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: keyman\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2020-08-19 19:17+0200\n" -"PO-Revision-Date: 2022-10-25 04:29\n" +"PO-Revision-Date: 2023-02-17 01:51\n" "Last-Translator: \n" "Language-Team: Fula\n" "Language: ff_ZA\n" diff --git a/linux/scripts/build.sh b/linux/scripts/build.sh index e8770b888f723f00ec7a1fa0897110ad9a55355d..81d49f9537baf2b96c071c50f54a92ec0475d059 100755 --- a/linux/scripts/build.sh +++ b/linux/scripts/build.sh @@ -1,6 +1,6 @@ #!/bin/bash -# Build Keyman for Linux: keyboardprocessor ibus-keyman +# Build Keyman for Linux: core ibus-keyman # It must be run from the keyman/linux directory @@ -13,80 +13,38 @@ INSTALLDIR=${INSTALLDIR:-"/usr/local"} CONFIGUREONLY=${CONFIGUREONLY:="no"} BUILDONLY=${BUILDONLY:="no"} -projects="ibus-keyman" - if [[ "${CONFIGUREONLY}" != "no" && "${BUILDONLY}" != "no" ]]; then echo "Only use one of CONFIGUREONLY and BUILDONLY" exit 1 fi if [[ "${BUILDONLY}" == "no" ]]; then - ../core/build.sh -t keyboardprocessor configure + cd "$BASEDIR" + ../core/build.sh --no-tests configure:arch - cd keyboardprocessor/arch/release - echo "reconfiguring keyboardprocessor meson with prefix ${INSTALLDIR}" + # While we can't pass extra parameters to the configure action + # we need these extra commands + cd ../core/build/arch/release + echo "reconfiguring Keyman Core meson with prefix ${INSTALLDIR}" meson configure -Dprefix="${INSTALLDIR}" && ninja reconfigure + + # We need to build core first before we can configure ibus-keyman! cd "$BASEDIR" + ../core/build.sh build:arch + + cd "$BASEDIR/ibus-keyman" + ./build.sh clean configure -- --prefix="${INSTALLDIR}" fi if [[ "${CONFIGUREONLY}" == "no" ]]; then - echo "building keyboardprocessor" + echo "building Keyman Core" + cd "$BASEDIR" # May 2021: For now, running tests here as well. We could move this elsewhere # in the future if we want to split out the tests, but they run in a couple of seconds # at present. - ../core/build.sh -t keyboardprocessor build tests -fi + ../core/build.sh build:arch test:arch -function buildproject() { - local proj=$1 - local subdir=$2 - - echo "buildproject: proj=$proj, subdir=$subdir; pwd=$(pwd)" - if [ ! -f "${subdir}${proj}/configure" ]; then - echo "$proj is not set up with autoreconf. First run 'make reconf' or 'make devreconf'" - exit 1 - fi - if [[ "${BUILDONLY}" == "no" ]]; then - rm -rf "build-$proj" - fi - mkdir -p "build-$proj" - cd "build-$proj" - if [[ "${BUILDONLY}" == "no" ]]; then - echo "Configuring $proj" - if [[ "${INSTALLDIR}" == "/tmp/keyman" ]]; then # don't install ibus-keyman into ibus - "../${subdir}$proj/configure" KEYMAN_PROC_CFLAGS="-I\$(top_builddir)/../keyboardprocessor/arch/release/include -I\$(top_builddir)/../../common/include -I\$(top_builddir)/../../core/include" \ - CPPFLAGS="-I\$(top_builddir)/../build-keymancomp -I\$(top_builddir)/../build-libkeyman" \ - KEYMAN_PROC_LIBS="-L$(pwd)/../build-libkeyman/src -L$(pwd)/../keyboardprocessor/arch/release/src -lkmnkbp0" \ - LDFLAGS="-L$(pwd)/../build-keymancomp/src -L$(pwd)/../build-libkeyman/src" --prefix="${INSTALLDIR}" --libexecdir="${INSTALLDIR}/lib/ibus" - else # install ibus-keyman into ibus - "../${subdir}$proj/configure" KEYMAN_PROC_CFLAGS="-I\$(top_builddir)/../keyboardprocessor/arch/release/include -I\$(top_builddir)/../../common/include -I\$(top_builddir)/../../core/include" \ - CPPFLAGS="-I\$(top_builddir)/../build-keymancomp -I\$(top_builddir)/../build-libkeyman" \ - LDFLAGS="-L$(pwd)/../build-keymancomp/src -L$(pwd)/../build-libkeyman/src" \ - KEYMAN_PROC_LIBS="-L$(pwd)/../build-libkeyman/src -L$(pwd)/../keyboardprocessor/arch/release/src -lkmnkbp0" \ - --prefix="${INSTALLDIR}" --libexecdir="${INSTALLDIR}/lib/ibus" --datadir=/usr/share - fi - fi - if [[ "${CONFIGUREONLY}" == "no" ]]; then - if [ ! -f config.h ]; then - echo "$proj has not been configured before building. First run 'make configure'" - exit 1 - fi - echo "Building $proj" - make - fi - cd "$BASEDIR" -} - -for proj in $projects; do - buildproject $proj -done - -if [[ "${CONFIGUREONLY}" == "no" ]]; then - cd keyman-config - if [ ! -f keyman_config/version.py ]; then - echo "The version of keyman-config has not been configured before building. First run 'make reconf'" - fi - make clean - make - cd "$BASEDIR" + echo "building ibus-keyman" + cd "$BASEDIR/ibus-keyman" + ./build.sh build fi diff --git a/linux/scripts/cow.sh b/linux/scripts/cow.sh index 069811049d8ce643c895c4f3baf2d376b5be75c5..e175a666ef606b03a13818df5230259b9847de57 100755 --- a/linux/scripts/cow.sh +++ b/linux/scripts/cow.sh @@ -3,11 +3,9 @@ # If needed set cowbuilder up for building Keyman Debian packages # Then cowbuilder update -distributions='focal jammy kinetic' - -dpkgcheck=$(dpkg-query -l cowbuilder) -if [ $? != 0 ]; then +distributions='focal jammy kinetic lunar' +if ! dpkg-query -l cowbuilder; then echo "installing pbuilder and cowbuilder" sudo apt install pbuilder cowbuilder else @@ -26,27 +24,27 @@ else fi for dist in $distributions; do - sudo mkdir -p /var/cache/pbuilder/result/${dist} - if [ ! -e /var/cache/pbuilder/result/${dist}/Packages ]; then - sudo touch /var/cache/pbuilder/result/${dist}/Packages + sudo mkdir -p /var/cache/pbuilder/result/"${dist}" + if [ ! -e /var/cache/pbuilder/result/"${dist}"/Packages ]; then + sudo touch /var/cache/pbuilder/result/"${dist}"/Packages fi - sudo mkdir -p /var/cache/pbuilder/hook.d/${dist} - if [ ! -e /var/cache/pbuilder/hook.d/${dist}/D70results ]; then - echo "#!/bin/bash" | sudo tee /var/cache/pbuilder/hook.d/${dist}/D70results - echo "cd /var/cache/pbuilder/result/${dist}" | sudo tee -a /var/cache/pbuilder/hook.d/${dist}/D70results - echo "/usr/bin/dpkg-scanpackages . /dev/null > /var/cache/pbuilder/result/${dist}/Packages" | sudo tee -a /var/cache/pbuilder/hook.d/${dist}/D70results - echo "/usr/bin/apt-get update" | sudo tee -a /var/cache/pbuilder/hook.d/${dist}/D70results - sudo chmod +x /var/cache/pbuilder/hook.d/${dist}/D70results - sudo ln -s /var/cache/pbuilder/hook.d/${dist}/D70results /var/cache/pbuilder/hook.d/${dist}/I70buildresults + sudo mkdir -p /var/cache/pbuilder/hook.d/"${dist}" + if [ ! -e /var/cache/pbuilder/hook.d/"${dist}"/D70results ]; then + echo "#!/bin/bash" | sudo tee /var/cache/pbuilder/hook.d/"${dist}"/D70results + echo "cd /var/cache/pbuilder/result/${dist}" | sudo tee -a /var/cache/pbuilder/hook.d/"${dist}"/D70results + echo "/usr/bin/dpkg-scanpackages . /dev/null > /var/cache/pbuilder/result/${dist}/Packages" | sudo tee -a /var/cache/pbuilder/hook.d/"${dist}"/D70results + echo "/usr/bin/apt-get update" | sudo tee -a /var/cache/pbuilder/hook.d/"${dist}"/D70results + sudo chmod +x /var/cache/pbuilder/hook.d/"${dist}"/D70results + sudo ln -s /var/cache/pbuilder/hook.d/"${dist}"/D70results /var/cache/pbuilder/hook.d/"${dist}"/I70buildresults fi - if [ ! -e /var/cache/pbuilder/hook.d/${dist}/D80no-man-db-rebuild ]; then - sudo ln -s /usr/share/doc/pbuilder/examples/D80no-man-db-rebuild /var/cache/pbuilder/hook.d/${dist}/D80no-man-db-rebuild + if [ ! -e /var/cache/pbuilder/hook.d/"${dist}"/D80no-man-db-rebuild ]; then + sudo ln -s /usr/share/doc/pbuilder/examples/D80no-man-db-rebuild /var/cache/pbuilder/hook.d/"${dist}"/D80no-man-db-rebuild fi - if [ ! -d /var/cache/pbuilder/base-${dist}.cow ]; then + if [ ! -d /var/cache/pbuilder/base-"${dist}".cow ]; then echo "making ${dist} cowbuilder" - sudo DIST=${dist} cowbuilder --create --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --hookdir /var/cache/pbuilder/hook.d/${dist} + sudo DIST="${dist}" cowbuilder --create --distribution "${dist}" --basepath /var/cache/pbuilder/base-"${dist}".cow --hookdir /var/cache/pbuilder/hook.d/"${dist}" else echo "already have ${dist} cowbuilder" fi - sudo DIST=${dist} cowbuilder --update --distribution ${dist} --basepath /var/cache/pbuilder/base-${dist}.cow --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} + sudo DIST="${dist}" cowbuilder --update --distribution "${dist}" --basepath /var/cache/pbuilder/base-"${dist}".cow --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/"${dist}" --hookdir /var/cache/pbuilder/hook.d/"${dist}" done diff --git a/linux/scripts/deb-packaging.sh b/linux/scripts/deb-packaging.sh index 35416cc370942dfe81e9f9b94159e8907ee67f0d..62fd389199d38616b2dd85da1dd51a5106dd7afc 100755 --- a/linux/scripts/deb-packaging.sh +++ b/linux/scripts/deb-packaging.sh @@ -5,8 +5,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE builder_describe \ @@ -38,15 +38,15 @@ if builder_start_action source; then echo "${START_STEP}Make source package for keyman${COLOR_RESET}" echo "${START_STEP}reconfigure${COLOR_RESET}" - ./scripts/reconf.sh keyman + ./scripts/reconf.sh echo "${END_STEP}" echo "${START_STEP}Make origdist${COLOR_RESET}" - ./scripts/dist.sh origdist keyman + ./scripts/dist.sh origdist echo "${END_STEP}" echo "${START_STEP}Make deb source${COLOR_RESET}" - ./scripts/deb.sh sourcepackage keyman + ./scripts/deb.sh sourcepackage echo "${END_STEP}" mv builddebs/* "${OUTPUT_PATH:-..}" @@ -58,13 +58,13 @@ fi if builder_start_action verify; then tar xf "${SRC_PKG}" if [ ! -f debian/libkmnkbp0-0.symbols ]; then - echo ":warning: Missing libkmnkbp0-0.symbols file" + echo ":warning: Missing libkmnkbp0-0.symbols file" >&2 else tmpDir=$(mktemp -d) dpkg -x "${BIN_PKG}" "$tmpDir" cd debian dpkg-gensymbols -v"${PKG_VERSION}" -plibkmnkbp0-0 -e"${tmpDir}"/usr/lib/x86_64-linux-gnu/libkmnkbp0.so* -Olibkmnkbp0-0.symbols -c4 - echo ":heavy_check_mark: libkmnkbp0-0 API didn't change" + echo ":heavy_check_mark: libkmnkbp0-0 API didn't change" >&2 fi builder_finish_action success verify exit 0 diff --git a/linux/scripts/deb.sh b/linux/scripts/deb.sh index f35d9e6a857f0c0e5f84ee6bd64017bddcd02699..3c87af0de8c3d40eaf23e0af59e871d2bdc5b99b 100755 --- a/linux/scripts/deb.sh +++ b/linux/scripts/deb.sh @@ -5,75 +5,40 @@ # It must be run from the keyman/linux directory -# parameters: ./deb.sh [sourcepackage] [proj] [dist] +# parameters: ./deb.sh [sourcepackage] [dist] # sourcepackage = only create Debian source package -# proj = only build for this project # dist = only build for this distribution set -e -all_distributions="focal" +all_distributions="focal jammy" distributions="" -all_projects="keyman" -projects="" echo "all_distributions: ${all_distributions}" -echo "all_projects: ${all_projects}" if [ "$1" == "sourcepackage" ]; then - if [ "$2" != "" ]; then - for proj in ${all_projects}; do - if [ "${proj}" == "$2" ]; then - projects="$2" - fi - done - if [ "${projects}" == "" ]; then - echo "project $2 does not exist" - exit 1 - fi - fi + only_sourcepackage=true + shift else - if [ "$1" != "" ]; then - for proj in ${all_projects}; do - if [ "${proj}" == "$1" ]; then - projects="$1" - fi - done - if [ "${projects}" == "" ]; then - for dist in ${all_distributions}; do - if [ "${dist}" == "$1" ]; then - distributions="$1" - projects="${all_projects}" - fi - done - if [ "${distributions}" == "" ]; then - echo "project or distribution $1 does not exist" - exit 1 - fi - else - if [ "$2" != "" ]; then - for dist in ${all_distributions}; do - if [ "${dist}" == "$2" ]; then - distributions="$2" - fi - done - if [ "${distributions}" == "" ]; then - echo "project or distribution $1 does not exist" - exit 1 - fi - fi + only_sourcepackage=false +fi + +if [ "$1" != "" ]; then + for dist in ${all_distributions}; do + if [ "${dist}" == "$1" ]; then + distributions="$1" fi + done + if [ "${distributions}" == "" ]; then + echo "distribution $1 does not exist" + exit 1 fi fi -if [ "${projects}" == "" ]; then - projects="${all_projects}" -fi if [ "${distributions}" == "" ]; then distributions="${all_distributions}" fi echo "distributions: ${distributions}" -echo "projects: ${projects}" BASEDIR=$(pwd) #echo "basedir is $BASEDIR" @@ -82,42 +47,37 @@ mkdir -p builddebs # make the source packages cd builddebs -for proj in ${projects}; do - vers=$(ls ../dist/${proj}_*.orig.tar.gz) - #echo "vers1:${vers}" - vers=${vers##*_} - #echo "vers2:${vers}" - vers=${vers%*.orig.tar.gz} - #echo "vers3:${vers}" - cp -a "../dist/${proj}_${vers}.orig.tar.gz" . - tar xfz "${proj}_${vers}.orig.tar.gz" - if [ "keyman" == "$proj" ]; then - cp -a ../../debian "${proj}-${vers}" - fi - cd "${proj}-${vers}" - dch -v "${vers}-1" "local build" - echo "${proj}-${vers}" - debuild -d -S -sa -Zxz -us -uc - cd "$BASEDIR/builddebs" - rm -rf "${proj}-${vers}" -done +vers=$(ls ../dist/keyman_*.orig.tar.gz) +#echo "vers1:${vers}" +vers=${vers##*_} +#echo "vers2:${vers}" +vers=${vers%*.orig.tar.gz} +#echo "vers3:${vers}" +cp -a "../dist/keyman_${vers}.orig.tar.gz" . +tar xfz "keyman_${vers}.orig.tar.gz" +cp -a ../../debian "keyman-${vers}" +cd "keyman-${vers}" +dch -v "${vers}-1" "local build" +echo "keyman-${vers}" +dch --release --distribution unstable "" +debuild -d -S -sa -Zxz -us -uc +cd "$BASEDIR/builddebs" +rm -rf "keyman-${vers}" cd "$BASEDIR" -if [ "$1" == "sourcepackage" ]; then +if $only_sourcepackage; then exit 0 fi # build the packages with cowbuilder from the source package -for proj in ${projects}; do - cd builddebs - echo "$proj version ${vers}" - rm -rf "${proj}-${vers}" - dpkg-source -x "${proj}_${vers}-1.dsc" - cd "${proj}-${vers}" - for dist in ${distributions}; do - dch -v "${vers}-1+${dist}" "local build for ${dist}" - echo "dist: $dist" - DIST=${dist} pdebuild --pbuilder cowbuilder --buildresult /var/cache/pbuilder/result/${dist} -- --basepath /var/cache/pbuilder/base-${dist}.cow --distribution ${dist} --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/${dist} --hookdir /var/cache/pbuilder/hook.d/${dist} - done - cd "${BASEDIR}" +cd builddebs +echo "keyman version ${vers}" +rm -rf "keyman-${vers}" +dpkg-source -x "keyman_${vers}-1.dsc" +cd "keyman-${vers}" +for dist in ${distributions}; do + dch -v "${vers}-1+${dist}" "local build for ${dist}" + echo "dist: $dist" + DIST=${dist} pdebuild --pbuilder cowbuilder --buildresult /var/cache/pbuilder/result/"${dist}" -- --basepath /var/cache/pbuilder/base-"${dist}".cow --distribution "${dist}" --override-config --othermirror="deb [trusted=yes] file:/var/cache/pbuilder/result/${dist} ./" --bindmounts /var/cache/pbuilder/result/"${dist}" --hookdir /var/cache/pbuilder/hook.d/"${dist}" done +cd "${BASEDIR}" diff --git a/linux/scripts/debian.sh b/linux/scripts/debian.sh index 7e39536c2f0a7b29dceb3c09f9b3ad9eecef7044..135de85432befcb32f341890317c476923c6c9d9 100755 --- a/linux/scripts/debian.sh +++ b/linux/scripts/debian.sh @@ -15,8 +15,8 @@ set -e ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . $(dirname "$THIS_SCRIPT")/package-build.inc.sh @@ -31,11 +31,11 @@ mkdir -p debianpackage for proj in ${projects}; do downloadSource debianpackage - cd ${proj}-${version} + cd "${proj}-${version}" if [ -n "$DIST" ]; then EXTRA_ARGS="--distribution $DIST --force-distribution" fi - dch --newversion ${version}-${DEBREVISION-1} ${EXTRA_ARGS} "Re-release to Debian" + dch --newversion "${version}-${DEBREVISION-1}" "${EXTRA_ARGS}" "Re-release to Debian" debuild -d -S -sa -Zxz - cd ${BASEDIR} + cd "${BASEDIR}" done diff --git a/linux/scripts/dist.sh b/linux/scripts/dist.sh index 056bf44aaad2511e4a40586b08450a4ce7def4e4..f412531cd29a0227f2d9f5443379369e552eef9d 100755 --- a/linux/scripts/dist.sh +++ b/linux/scripts/dist.sh @@ -11,64 +11,57 @@ set -e ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE BASEDIR=$(pwd) -extra_projects="keyman" -if [ "$1" == "origdist" ]; then +if [[ ! -z ${1+x} ]] && [ "$1" == "origdist" ]; then create_origdist=1 shift fi -if [ "$1" != "" ]; then - echo "$1" - if [ "$1" == "keyman" ]; then - extra_projects="$1" - else - echo "project $1 does not exist" - exit 1 - fi -fi - rm -rf dist mkdir -p dist -# configure and make dist for autotool projects -for proj in ${extra_projects}; do - # dist for keyman - cp -a debian ../ - cd .. - echo "3.0 (native)" > debian/source/format - dch keyman --newversion "${VERSION}" --force-bad-version --nomultimaint - dpkg-source --tar-ignore=*~ --tar-ignore=.git --tar-ignore=.gitattributes \ - --tar-ignore=.gitignore --tar-ignore=experiments --tar-ignore=debian \ - --tar-ignore=.github --tar-ignore=.vscode --tar-ignore=android \ - --tar-ignore=common/models --tar-ignore=common/predictive-text \ - --tar-ignore=common/resources --tar-ignore=common/schemas \ - --tar-ignore=common/test --tar-ignore=common/web --tar-ignore=common/windows \ - --tar-ignore=developer --tar-ignore=docs --tar-ignore=ios \ - --tar-ignore=linux/keyman-config/buildtools/build-langtags.py --tar-ignore=__pycache__ \ - --tar-ignore=linux/help --tar-ignore=linux/Jenkinsfile \ - --tar-ignore=linux/keyboardprocessor \ - --tar-ignore=mac --tar-ignore=node_modules --tar-ignore=oem \ - --tar-ignore=linux/build* --tar-ignore=core/build \ - --tar-ignore=resources/devbox --tar-ignore=resources/git-hooks \ - --tar-ignore=resources/scopes \ - --tar-ignore=resources/build/*.lua --tar-ignore=resources/build/jq* \ - --tar-ignore=resources/build/vswhere* --tar-ignore=results \ - --tar-ignore=web --tar-ignore=windows --tar-ignore=keyman_1* \ - --tar-ignore=dist --tar-ignore=.pbuilderrc --tar-ignore=VERSION \ - --tar-ignore=scripts -Zgzip -b . - mv ../keyman_"${VERSION}".tar.gz linux/dist/keyman-"${VERSION}".tar.gz - echo "3.0 (quilt)" > debian/source/format - cd "$BASEDIR" -done +# dist for keyman +cp -a debian ../ +cd .. +echo "3.0 (native)" > debian/source/format +dch keyman --newversion "${VERSION}" --force-bad-version --nomultimaint +dpkg-source --tar-ignore=*~ --tar-ignore=.git --tar-ignore=.gitattributes \ + --tar-ignore=.gitignore --tar-ignore=experiments --tar-ignore=debian \ + --tar-ignore=.github --tar-ignore=.vscode --tar-ignore=android \ + \ + --tar-ignore=common/models \ + --tar-ignore=common/predictive-text \ + --tar-ignore=common/resources \ + --tar-ignore=common/schemas \ + --tar-ignore=common/test/keyboards/build.* \ + --tar-ignore=common/test/predictive-text \ + --tar-ignore=common/test/resources \ + --tar-ignore=common/web \ + --tar-ignore=common/windows \ + \ + --tar-ignore=core/build \ + --tar-ignore=developer --tar-ignore=docs --tar-ignore=ios \ + --tar-ignore=linux/keyman-config/buildtools/build-langtags.py --tar-ignore=__pycache__ \ + --tar-ignore=linux/help --tar-ignore=linux/Jenkinsfile \ + --tar-ignore=mac --tar-ignore=node_modules --tar-ignore=oem \ + --tar-ignore=linux/build --tar-ignore=core/build \ + --tar-ignore=resources/devbox --tar-ignore=resources/git-hooks \ + --tar-ignore=resources/scopes \ + --tar-ignore=resources/build/*.lua --tar-ignore=resources/build/jq* \ + --tar-ignore=results \ + --tar-ignore=web --tar-ignore=windows --tar-ignore=keyman_1* \ + --tar-ignore=dist --tar-ignore=.pbuilderrc --tar-ignore=VERSION -Zgzip -b . +mv ../keyman_"${VERSION}".tar.gz linux/dist/keyman-"${VERSION}".tar.gz +echo "3.0 (quilt)" > debian/source/format +cd "$BASEDIR" # create orig.tar.gz -if [ -n "$create_origdist" ]; then +if [ ! -z "${create_origdist+x}" ]; then cd dist pkgvers="keyman-$VERSION" tar xfz keyman-"${VERSION}".tar.gz diff --git a/linux/scripts/install.sh b/linux/scripts/install.sh index 081f44e93f6e33dc2c1e3c295e7e39a52e8b1c70..40f2eb8f5b09bcd7f6571fa272d660391349ebaa 100755 --- a/linux/scripts/install.sh +++ b/linux/scripts/install.sh @@ -31,25 +31,17 @@ if [ -f "/usr/share/ibus/component/keyman.xml" ] && [ "${SUDOINSTALL}" == "yes" fi fi -cd keyboardprocessor/arch/release +cd ../core/build/arch/release ninja install cd "$BASEDIR" -cd build-ibus-keyman +cd ibus-keyman if [[ "${SUDOINSTALL}" == "uninstall" ]]; then - if [ ! -f Makefile ]; then - echo "ibus-keyman must be configured before it is uninstalled. First run 'make configure'" - exit 1 - fi echo "doing make uninstall of ibus-keyman" - make uninstall + ./build.sh uninstall else - if [ ! -f Makefile ]; then - echo "ibus-keyman must be configured and built before it is installed. First run 'make' or 'make tmpinstall'" - exit 1 - fi echo "doing make install of ibus-keyman" - make install + ./build.sh install fi cd "$BASEDIR" diff --git a/linux/scripts/jenkins.sh b/linux/scripts/jenkins.sh index edac87d30f9c5a8bb1979ebb7f4d9ec863568809..5c796259559f1316bf0078e1139d439d23ff1094 100755 --- a/linux/scripts/jenkins.sh +++ b/linux/scripts/jenkins.sh @@ -7,12 +7,14 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" +. "$THIS_SCRIPT_PATH/package-build.inc.sh" + keyman_projects="keyman" tier="stable" @@ -36,56 +38,28 @@ sourcename=${sourcename%"-beta"} export DEBFULLNAME="${fullsourcename} Package Signing Key" export DEBEMAIL='jenkins@sil.org' -checkAndInstallRequirements() -{ - local TOINSTALL="" - - for p in devscripts equivs - do - if ! dpkg -s $p >/dev/null 2>&1; then - TOINSTALL="$TOINSTALL $p" - fi - done - - export DEBIAN_FRONTEND=noninteractive - - if [ -n "$TOINSTALL" ]; then - sudo apt-get update - sudo apt-get -qy install "$TOINSTALL" - fi - - sudo mk-build-deps debian/control - sudo apt-get -qy --allow-downgrades install ./keyman-build-deps_*.deb - sudo rm -f keyman-buid-deps_* -} - checkAndInstallRequirements # clean up prev deb builds -echo_heading "cleaning previous builds of $1" +builder_heading "cleaning previous builds of $1" rm -rf builddebs rm -rf "$sourcedir/${1}"_*.{dsc,build,buildinfo,changes,tar.?z,log} rm -rf "$sourcedir/../${1}"_*.{dsc,build,buildinfo,changes,tar.?z,log} -echo_heading "Make source package for $fullsourcename" -echo_heading "reconfigure" -TIER="$tier" ./scripts/reconf.sh $sourcename +builder_heading "Make source package for $fullsourcename" +builder_heading "reconfigure" +TIER="$tier" ./scripts/reconf.sh -echo_heading "Make origdist" -./scripts/dist.sh origdist $sourcename -echo_heading "Make deb source" -./scripts/deb.sh sourcepackage "$proj" +builder_heading "Make origdist" +./scripts/dist.sh origdist +builder_heading "Make deb source" +./scripts/deb.sh sourcepackage #sign source package for file in builddebs/*.dsc; do - echo_heading "Signing source package $file" + builder_heading "Signing source package $file" debsign -k"$2" "$file" done -if [ "$proj" == "keyman" ]; then - mv builddebs/* .. -else - mkdir -p "$sourcedir" - mv builddebs/* "$sourcedir" -fi +mv builddebs/* .. diff --git a/linux/scripts/launchpad.sh b/linux/scripts/launchpad.sh index 8667023e496d93e352d13c403de302db4b8a6b22..30495d2b0e1567278819415fcd9edf5a4a9de098 100755 --- a/linux/scripts/launchpad.sh +++ b/linux/scripts/launchpad.sh @@ -10,24 +10,20 @@ # DIST="" only upload for this distribution # PACKAGEVERSION="" string to append to the package version. Default to "1~sil1" -set -e +set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +# shellcheck source=resources/build/build-utils.sh +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE -. $(dirname "$THIS_SCRIPT")/package-build.inc.sh +# shellcheck source=linux/scripts/package-build.inc.sh +. "$(dirname "$THIS_SCRIPT")/package-build.inc.sh" checkPrerequisites -if [ "${UPLOAD}" == "yes" ]; then - SIM="" -else - SIM="-s" -fi - if [ "${TIER}" == "stable" ]; then ppa="ppa:keymanapp/keyman" elif [ "${TIER}" == "beta" ]; then @@ -37,39 +33,29 @@ else fi echo "ppa: ${ppa}" -if [ "${DIST}" != "" ]; then - distributions="${DIST}" -else - distributions="focal jammy kinetic" -fi - -if [ "${PACKAGEVERSION}" != "" ]; then - packageversion="${PACKAGEVERSION}" -else - packageversion="1~sil1" -fi - +distributions="${DIST:-focal jammy kinetic lunar}" +packageversion="${PACKAGEVERSION:-1~sil1}" BASEDIR=$(pwd) rm -rf launchpad mkdir -p launchpad -for proj in ${projects}; do +for proj in ${projects:-}; do downloadSource launchpad - cd ${proj}-${version} - echo $(pwd) - cp debian/changelog ../${proj}-changelog + cd "${proj}-${version:-}" + pwd + cp debian/changelog "../${proj}-changelog" for dist in ${distributions}; do - cp ../${proj}-changelog debian/changelog - dch -v ${version}-${packageversion}~${dist} "source package for PPA" - dch -D ${dist} -r "" + cp "../${proj}-changelog" debian/changelog + dch -v "${version}-${packageversion}~${dist}" "source package for PPA" + dch -D "${dist}" -r "" debuild -d -S -sa -Zxz done cd .. for dist in ${distributions}; do - dput ${SIM} ${ppa} ${proj}_${version}-${packageversion}~${dist}_source.changes + dput ${SIM} ${ppa} "${proj}_${version}-${packageversion}~${dist}_source.changes" done - cd ${BASEDIR} + cd "${BASEDIR}" done diff --git a/linux/scripts/package-build.inc.sh b/linux/scripts/package-build.inc.sh index ee85f29a223617b8732796e503ab258509bac37a..39ea70f7d1719859c9bba2a3de0240b013628b52 100644 --- a/linux/scripts/package-build.inc.sh +++ b/linux/scripts/package-build.inc.sh @@ -1,14 +1,14 @@ #!/bin/bash function checkPrerequisites() { - if [ "${UPLOAD}" == "yes" ]; then + if [ "${UPLOAD:=}" == "yes" ]; then SIM="" else SIM="-s" fi # Check the tier - if [[ -z "${TIER}" ]]; then + if [[ -z "${TIER:=}" ]]; then echo "TIER.md or \${TIER} must be set to (alpha, beta, stable) to use this script" exit 1 fi @@ -18,18 +18,15 @@ function checkPrerequisites() { exit 1 fi - if [ "${PROJECT}" != "" ]; then - projects="${PROJECT}" - else - projects="keyman" - fi + # shellcheck disable=SC2034 + projects="${PROJECT:=keyman}" } function downloadSource() { local packageDir packageDir=$1 - if [ "${proj}" == "keyman" ]; then + if [ "${proj:=}" == "keyman" ]; then cd "${BASEDIR}" || exit fi @@ -51,6 +48,30 @@ function downloadSource() { mv "${proj}"*.asc "${BASEDIR}/${packageDir}" rm "${proj}"*.debian.tar.xz cd "${BASEDIR}/${packageDir}" || exit - wget -N https://downloads.keyman.com/linux/${TIER}/${dirversion}/SHA256SUMS + wget -N "https://downloads.keyman.com/linux/${TIER}/${dirversion}/SHA256SUMS" sha256sum -c --ignore-missing SHA256SUMS |grep "${proj}" } + +function checkAndInstallRequirements() +{ + local TOINSTALL="" + + for p in devscripts equivs + do + if ! dpkg -s $p >/dev/null 2>&1; then + TOINSTALL="$TOINSTALL $p" + fi + done + + export DEBIAN_FRONTEND=noninteractive + + if [ -n "$TOINSTALL" ]; then + sudo apt-get update + # shellcheck disable=SC2086 + sudo apt-get -qy install $TOINSTALL + fi + + sudo mk-build-deps debian/control + sudo apt-get -qy --allow-downgrades install ./keyman-build-deps_*.deb + sudo rm -f keyman-buid-deps_* +} diff --git a/linux/scripts/reconf.sh b/linux/scripts/reconf.sh index 858b0e24846bcac24eba0dda4f156ff282e41262..cd74571a4a1dc696934de83f04d395d4850cda05 100755 --- a/linux/scripts/reconf.sh +++ b/linux/scripts/reconf.sh @@ -1,78 +1,38 @@ #!/bin/bash -# autoreconf autotool projects - -# parameters: ./reconf.sh [proj] -# proj = only reconf this project - set -e ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE BASEDIR="$KEYMAN_ROOT/linux" echo "basedir is $BASEDIR" -autotool_projects="ibus-keyman" -extra_projects="keyboardprocessor keyman-config" - -if [ "$1" != "" ]; then - if [ "$1" == "keyman" ]; then - echo "reconfiguring only keyman" - extra_projects="keyman" - autotool_projects="" - elif [ "$1" == "keyboardprocessor" ]; then - echo "reconfiguring only keyboardprocessor" - extra_projects="keyboardprocessor" - autotool_projects="" - elif [ "$1" == "keyman-config" ]; then - echo "reconfiguring only keyman-config" - extra_projects="keyman-config" - autotool_projects="" - elif [ -d "$1" ]; then - echo "reconfiguring only $1" - extra_projects="" - autotool_projects="$1" - else - echo "project $1 does not exist" - exit 1 - fi -fi echo "Found tier ${TIER}, version ${VERSION}" -# autoreconf the projects -for proj in ${autotool_projects}; do - cd "$proj" - echo "Reconfiguring $proj to version ${VERSION}" - autoreconf -if - rm -rf autom4te.cache - cd "$BASEDIR" -done - -for proj in ${extra_projects}; do - if [ "${proj}" == "keyboardprocessor" ] || [ "${proj}" == "keyman" ]; then - rm -rf keyboardprocessor - cp ../VERSION.md ../core/ - ../core/build.sh -t keyboardprocessor configure - fi - if [ "${proj}" == "keyman-config" ] || [ "${proj}" == "keyman" ]; then - cd keyman-config - make clean - cd keyman_config - sed \ - -e "s/_VERSION_/${VERSION}/g" \ - -e "s/_VERSIONWITHTAG_/${VERSION_WITH_TAG}/g" \ - -e "s/_VERSIONGITTAG_/${VERSION_GIT_TAG}/g" \ - -e "s/_MAJORVERSION_/${VERSION_MAJOR}/g" \ - -e "s/_RELEASEVERSION_/${VERSION_RELEASE}/g" \ - -e "s/_TIER_/${TIER}/g" \ - -e "s/_ENVIRONMENT_/${VERSION_ENVIRONMENT}/g" \ - -e "s/_UPLOADSENTRY_/${UPLOAD_SENTRY}/g" \ - version.py.in > version.py - cd ../buildtools && python3 ./build-langtags.py - fi - cd "$BASEDIR" -done +# We need to configure+build core before we can configure ibus-keyman +cd ../core +./build.sh --no-tests clean:arch configure:arch build:arch + +cd "$BASEDIR/ibus-keyman" +./build.sh clean configure + +cd "$BASEDIR/keyman-config" +make clean + +cd keyman_config +sed \ + -e "s/_VERSION_/${VERSION}/g" \ + -e "s/_VERSIONWITHTAG_/${VERSION_WITH_TAG}/g" \ + -e "s/_VERSIONGITTAG_/${VERSION_GIT_TAG}/g" \ + -e "s/_MAJORVERSION_/${VERSION_MAJOR}/g" \ + -e "s/_RELEASEVERSION_/${VERSION_RELEASE}/g" \ + -e "s/_TIER_/${TIER}/g" \ + -e "s/_ENVIRONMENT_/${VERSION_ENVIRONMENT}/g" \ + -e "s/_UPLOADSENTRY_/${UPLOAD_SENTRY}/g" \ + version.py.in > version.py +cd ../buildtools && python3 ./build-langtags.py +cd "$BASEDIR" diff --git a/linux/scripts/upload-to-debian.sh b/linux/scripts/upload-to-debian.sh index 23622f86a628b2b64f7dd31bac0eee5ef9cf79a8..af443cac08acafec60c925ec633037a1f5ff7b33 100755 --- a/linux/scripts/upload-to-debian.sh +++ b/linux/scripts/upload-to-debian.sh @@ -30,8 +30,8 @@ END ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" @@ -47,7 +47,7 @@ while (( $# )); do if [ ! $# -eq 0 ]; then DEBKEYID=$1 else - fail "Error: The -k argument is missing a value. Exiting." + builder_die "Error: The -k argument is missing a value. Exiting." fi;; -n) NOOP=: ;; --help) usage ; exit 0 ;; @@ -57,11 +57,11 @@ while (( $# )); do if [ ! $# -eq 0 ]; then REVISION=$1 else - fail "Error: The --debian-revision argument is missing a value. Exiting." + builder_die "Error: The --debian-revision argument is missing a value. Exiting." fi;; - *) fail "Error: Unexpected argument \"$1\". Exiting." ;; + *) builder_die "Error: Unexpected argument \"$1\". Exiting." ;; esac - shift || fail "Error: The last argument is missing a value. Exiting." + shift || builder_die "Error: The last argument is missing a value. Exiting." done if [ -z "$DEBKEYID" ]; then @@ -70,10 +70,10 @@ if [ -z "$DEBKEYID" ]; then fi if ! git diff --quiet; then - fail "You have changed files in your git working directory. Exiting." + builder_die "You have changed files in your git working directory. Exiting." fi -echo_heading "Fetching latest changes" +builder_heading "Fetching latest changes" git fetch -p origin stable_branch=$(git branch -r | grep origin/stable- | sort | tail -1) stable_branch=${stable_branch##* } @@ -88,16 +88,16 @@ else fi cd "$KEYMAN_ROOT/linux" -echo_heading "Building source package" +builder_heading "Building source package" DIST=unstable DEBREVISION=$REVISION scripts/debian.sh cd debianpackage/ -echo_heading "Signing source package" +builder_heading "Signing source package" debsign -k"$DEBKEYID" --re-sign ./*.changes -echo_heading "Uploading packages to mentors.debian.net" +builder_heading "Uploading packages to mentors.debian.net" $NOOP dput mentors ./*.changes cd .. -echo_heading "Updating changelog" +builder_heading "Updating changelog" # base changelog branch on remote stable branch git checkout -B chore/linux/changelog "$stable_branch" cp debianpackage/keyman-*/debian/changelog debian/ @@ -105,6 +105,7 @@ git add debian/changelog git commit -m "chore(linux): Update debian changelog" if [ -n "$PUSH" ]; then $NOOP git push --force-with-lease origin chore/linux/changelog + $NOOP gh pr create --draft --base "$stable_branch" --title "chore(linux): Update debian changelog" --body "@keymanapp-test-bot skip" fi if $ISBETA; then @@ -117,9 +118,10 @@ git checkout -B chore/linux/cherry-pick/changelog ${CLBRANCH} git cherry-pick -x chore/linux/changelog if [ -n "$PUSH" ]; then $NOOP git push --force-with-lease origin chore/linux/cherry-pick/changelog + $NOOP gh pr create --draft --base ${CLBRANCH} --title "chore(linux): Update debian changelog 🍒" --body "@keymanapp-test-bot skip" fi -echo_heading "Finishing" +builder_heading "Finishing" if $ISBETA; then git checkout beta else diff --git a/mac/Keyman4MacIM/Keyman4MacIM/KMAboutWindow/ckl.lproj/KMAboutWindowController.strings b/mac/Keyman4MacIM/Keyman4MacIM/KMAboutWindow/ckl.lproj/KMAboutWindowController.strings new file mode 100644 index 0000000000000000000000000000000000000000..1f4ab4ec7ace0f6a506f943ca9fd36a0a95ad61e --- /dev/null +++ b/mac/Keyman4MacIM/Keyman4MacIM/KMAboutWindow/ckl.lproj/KMAboutWindowController.strings @@ -0,0 +1,8 @@ +/* button text to close the About window */ +"Kab-Up-fYH.title" = "Harti"; + +/* text of link to the license agreement */ +"hYC-Bx-aoP.title" = "Lasis nǝr ʻYa suyere"; + +/* button text to open Configuration window */ +"vkh-b5-vO7.title" = "Whalir ʻya suyere wato Konfigareshon..."; diff --git a/mac/Keyman4MacIM/Keyman4MacIM/KMConfiguration/ckl.lproj/preferences.strings b/mac/Keyman4MacIM/Keyman4MacIM/KMConfiguration/ckl.lproj/preferences.strings new file mode 100644 index 0000000000000000000000000000000000000000..396fccf748e72cd0b7d10a0ef7205f68e4ee1cfc --- /dev/null +++ b/mac/Keyman4MacIM/Keyman4MacIM/KMConfiguration/ckl.lproj/preferences.strings @@ -0,0 +1,38 @@ +/* Checkbox text to always show on-screen keyboard */ +"4UX-80-0Vo.title" = "Ka dzǝ tsanti ata skrin nǝr kibod kǝlara saka"; + +/* Checkbox text to enable verbose Console logging */ +"7J6-zy-R20.title" = "Kǝthlǝr aka verbos Konsol akwa sakar lukwa layir sambar"; + +/* Support button text */ +"93O-x6-RLF.label" = "Sǝr dlarɛ"; + +/* Download Keyboard button text */ +"CTw-kf-WNS.title" = "Sǝgǝl aka Kibod..."; + +/* Keyman Configuration window title */ +"F0z-JX-Cv5.title" = "Su namtǝ ndǝ ɗǝmɦɛ ŋǝr Keyman"; + +/* button text to go back to previous page */ +"JOK-JV-n8w.title" = "Mwari tubwa hi"; + +/* Keyboards button text */ +"MPN-9N-wWc.label" = "Kibodyere"; + +/* text to explain verbose Console logging option */ +"MrI-GM-7d6.title" = "Ma saka namtǝ verbos logging ada kǝthlǝr, Keyman ata kǝthlǝr akwa whalɛ namtǝ sǝr dlarǝrniyere ata ʻya ka zǝndiba damicinyere nam adai. Ndata mǝzi kǝthlǝr aka Program nǝr Klnsol ka ndǝ wuti labaryere nǝr Keyman nam akwa Klnsole, ka ndǝ tsanti shanga labaryere nam akwa kuta Keyman. Ndata mǝzi hyanba shanga labaryere ǝni alukwa dlarǝr Keyman ma ndɛ ada bara."; + +/* button text to move forward to the next page */ +"eXr-8V-h1g.title" = "Alǝkǝma"; + +/* button text to return to the home help page */ +"fXS-aC-CMH.title" = "Livi ko alivi"; + +/* Options button text */ +"frd-No-seV.label" = "Sǝr tsarba ka ʻyayere"; + +/* Installed Keyboard column heading */ +"jex-Nd-Qzg.headerCell.title" = "Hau ko vu kibod"; + +/* Verbose logging tooltip text */ +"uWx-3J-U0D.ibShadowedToolTip" = "Hyanti su ǝni ma gaka damicinidzi laka aka kibod laka ko aka kǝlara Keyman laka."; diff --git a/mac/Keyman4MacIM/Keyman4MacIM/KMInfoWindow/ckl.lproj/KMInfoWindowController.strings b/mac/Keyman4MacIM/Keyman4MacIM/KMInfoWindow/ckl.lproj/KMInfoWindowController.strings new file mode 100644 index 0000000000000000000000000000000000000000..f3c199445527c11a9bd236e73e0baae80dd18041 --- /dev/null +++ b/mac/Keyman4MacIM/Keyman4MacIM/KMInfoWindow/ckl.lproj/KMInfoWindowController.strings @@ -0,0 +1,8 @@ +/* Package Information window title */ +"F0z-JX-Cv5.title" = "Tsabtǝdzǝr Sǝr Zǝndiyere"; + +/* button text to show Details */ +"Fvy-XJ-s38.label" = "Suyere nam akuyaka nji zǝndi su ata kǝryere"; + +/* button text to show Read Me */ +"waA-IW-Qyn.label" = "Kǝratu Tǝra"; diff --git a/mac/Keyman4MacIM/Keyman4MacIM/KMKeyboardHelpWindow/ckl.lproj/KMKeyboardHelpWindowController.strings b/mac/Keyman4MacIM/Keyman4MacIM/KMKeyboardHelpWindow/ckl.lproj/KMKeyboardHelpWindowController.strings new file mode 100644 index 0000000000000000000000000000000000000000..1cd0e83722ebdc6ccff4f900af5390a1d050cd3e --- /dev/null +++ b/mac/Keyman4MacIM/Keyman4MacIM/KMKeyboardHelpWindow/ckl.lproj/KMKeyboardHelpWindowController.strings @@ -0,0 +1,8 @@ +/* Keyboard Help window title */ +"F0z-JX-Cv5.title" = "Dlarɛ nǝr Kibod"; + +/* OK button text */ +"Zla-QF-m0K.title" = "Kal kal"; + +/* Print button text */ +"fYY-Uj-y4S.title" = "Print..."; diff --git a/mac/Keyman4MacIM/Keyman4MacIM/am.lproj/Localizable.strings b/mac/Keyman4MacIM/Keyman4MacIM/am.lproj/Localizable.strings index 06182ea47cbb20a18a09f6261771c207bc11f1fa..35de92b8d831632491abd14ea201191a9a9adfc9 100644 --- a/mac/Keyman4MacIM/Keyman4MacIM/am.lproj/Localizable.strings +++ b/mac/Keyman4MacIM/Keyman4MacIM/am.lproj/Localizable.strings @@ -68,4 +68,4 @@ "copyright-label" = "የባለቤትነት መብት፦"; /* message displayed to alert user to need grant accessibility permission */ -"privacy-alert-text" = "To function properly, Keyman requires accessibility features:\n\nGrant access in System Preferences, Security & Privacy.\nRestart your system."; +"privacy-alert-text" = "ኪይማን በአግባቡ ለመስራት የተደራሽነት ባህሪያትን ይፈልጋል፦ \n\nበስርዓት ምርጫዎች፣ ደህንነት እና ግላዊነት ውስጥ መዳረሻ ፍቀድ። \nስርዓት እንደገና አስጀምር።"; diff --git a/mac/Keyman4MacIM/Keyman4MacIM/ckl.lproj/Localizable.strings b/mac/Keyman4MacIM/Keyman4MacIM/ckl.lproj/Localizable.strings new file mode 100644 index 0000000000000000000000000000000000000000..20f433682127822207057df2a6f1cf7b89496f16 --- /dev/null +++ b/mac/Keyman4MacIM/Keyman4MacIM/ckl.lproj/Localizable.strings @@ -0,0 +1,71 @@ +/* Message displayed to confirm delete of the Keyman keyboard selected by the user from the keyboard list */ +"message-confirm-delete-keyboard" = "Gada bara kǝlba kǝlba ka ɗalba kibod '%@' ya?"; + +/* Delete keyboard confirmation info indicating that the delete action cannot be undone */ +"info-cannot-undo-delete-keyboard" = "Gadiyata mǝzi ka pali su namtǝ gǝ kurta ʻyati wɛ."; + +/* Button text to cancel delete of the specified installed Keyman keyboard */ +"button-cancel-delete-keyboard" = "Kansǝl"; + +/* Button text to confirm delete of the specified installed Keyman keyboard */ +"button-delete-keyboard" = "Kǝlba ka ɗalba"; + +/* Message displayed to confirm installation of a keyboard from the specifed .kmp file double-clicked by the user */ +"message-confirm-install-keyboard" = "Vu Keyman kibod?"; + +/* Message displayed to confirm installation of a keyboard from the specifed .kmp file double-clicked by the user */ +"info-install-keyboard-filename" = "Gada bara ka Keyman vu alagɛ kibod nam akwa kuta fail ya '%@'?"; + +/* Button text to cancel installation of the double-clicked Keyman file */ +"button-cancel-install-keyboard" = "Kansǝl"; + +/* Button text to confirm installation of the double-clicked Keyman file */ +"button-install-keyboard" = "Vu ko hau"; + +/* Message displayed to inform user that .kmp file could not be read/unzipped */ +"message-keyboard-file-unreadable" = "Ta mǝzi ka karatɛ fail nǝr Keyman wɛ '%@'."; + +/* Message displayed in Configuration window when keyboard cannot be loaded */ +"message-error-loading-keyboard" = "(aibe akwa vu kibod)"; + +/* Message displayed in Configuration window when keyboard metadata cannot be loaded */ +"message-error-unknown-metadata" = "ndǝta zǝndi suyari wɛ"; + +/* Button text to acknowledge that .kmp file could not be read */ +"button-keyboard-file-unreadable" = "Kal kal"; + +/* label text to identify Keyman version */ +"version-label-text" = "Jiliyari %@"; + +/* Status text for keyboard downloading */ +"message-keyboard-downloading" = "Ata kǝra sǝgǝl akǝr..."; + +/* Status text for keyboard download complete */ +"message-keyboard-download-complete" = "Hau ko sǝgǝl aka suyari kǝ kuri."; + +/* Button text to cancel downloading keyboard */ +"button-cancel-downloading" = "Kansǝl"; + +/* Button text keyboard download complete */ +"button-download-complete" = "Kurai ʻyatidzi"; + +/* keyboards label in the Package Information window */ +"keyboards-label" = "Kibodyere:"; + +/* fonts label in the Package Information window */ +"fonts-label" = "Fontyere:"; + +/* package version label in the Package Information window */ +"package-version-label" = "Jiliyir tsabtǝdzǝr failyere nam ada mǝrti su apa kibod namtǝ ndɛ ada na njǝr kuthlǝr aka kamputa:"; + +/* author label in the Package Information window */ +"author-label" = "Ndǝ nam tara ʻyati sari:"; + +/* website label in the Package Information window */ +"website-label" = "Websait:"; + +/* copyright label in the Package Information window */ +"copyright-label" = "Kopirait:"; + +/* message displayed to alert user to need grant accessibility permission */ +"privacy-alert-text" = "To function properly, Keyman requires accessibility features:\n\nGrant access in System Preferences, Security & Privacy.\nRestart your system."; diff --git a/mac/Keyman4MacIM/Keyman4MacIM/ckl.lproj/MainMenu.strings b/mac/Keyman4MacIM/Keyman4MacIM/ckl.lproj/MainMenu.strings new file mode 100644 index 0000000000000000000000000000000000000000..451ab27f73515512e38b8e7641bbca127113ace1 --- /dev/null +++ b/mac/Keyman4MacIM/Keyman4MacIM/ckl.lproj/MainMenu.strings @@ -0,0 +1,14 @@ +/* Configuration window menu text */ +"P1b-lE-yFw.title" = "Whalǝr ʻya suyere ani konfigareshon..."; + +/* Keyboards menu text */ +"bQa-j9-nHe.title" = "Kibodyere"; + +/* Keyboards menu text */ +"goP-aK-3WB.title" = "Kibodyere"; + +/* About menu text */ +"kb2-ww-RS3.title" = "Ata kǝra"; + +/* On-Screen Keyboard menu text */ +"s96-JI-YDh.title" = "On Skrin Kibod"; diff --git a/mac/Keyman4MacIM/Keyman4MacIM/ff.lproj/Localizable.strings b/mac/Keyman4MacIM/Keyman4MacIM/ff.lproj/Localizable.strings index 3e5b3f4c654bee5eed52c6a45b16086a6f97ec45..bb07294b4c5d22788702d327be275b482dedcb3b 100644 --- a/mac/Keyman4MacIM/Keyman4MacIM/ff.lproj/Localizable.strings +++ b/mac/Keyman4MacIM/Keyman4MacIM/ff.lproj/Localizable.strings @@ -68,4 +68,4 @@ "copyright-label" = "Copyright:"; /* message displayed to alert user to need grant accessibility permission */ -"privacy-alert-text" = "To function properly, Keyman requires accessibility features:\n\nGrant access in System Preferences, Security & Privacy.\nRestart your system."; +"privacy-alert-text" = "Ngam waawde huutoreede, Keyman ena laaɓndii fannuuji heɓindaare:\n\nYamir ɗum to Cuɓoraaɗe Yuɓɓo toh, Kisnal & Suturo.\nHurmitin yuɓɓomaa."; diff --git a/mac/Keyman4MacIM/Keyman4MacIM/zh-Hans.lproj/Localizable.strings b/mac/Keyman4MacIM/Keyman4MacIM/zh-Hans.lproj/Localizable.strings index 32a42e3726f9686e0368ee8c16f68e4b5f1c307b..fb910cdf4c9892ce826cf98cfaf0e8038ecd10f0 100644 --- a/mac/Keyman4MacIM/Keyman4MacIM/zh-Hans.lproj/Localizable.strings +++ b/mac/Keyman4MacIM/Keyman4MacIM/zh-Hans.lproj/Localizable.strings @@ -68,4 +68,4 @@ "copyright-label" = "版权:"; /* message displayed to alert user to need grant accessibility permission */ -"privacy-alert-text" = "To function properly, Keyman requires accessibility features:\n\nGrant access in System Preferences, Security & Privacy.\nRestart your system."; +"privacy-alert-text" = "Keyman 需要以下辅助功能以正常工作:\n\n在系统首选项、安全和隐私中授予访问权限。\n重新启动系统。"; diff --git a/mac/Keyman4MacIM/localdeploy.sh b/mac/Keyman4MacIM/localdeploy.sh index 6b56f7fc3e57ad80077b8de7168798d8d6969f3d..b09bf36bf6949c95a8c3614e720604f6a73d4719 100755 --- a/mac/Keyman4MacIM/localdeploy.sh +++ b/mac/Keyman4MacIM/localdeploy.sh @@ -42,7 +42,7 @@ if [[ -d "$KM4MIM_INSTALL_PATH" ]]; then rm -Rf "$KM4MIM_INSTALL_PATH" fi echo "Copying $KM4MIM_APP_PATH to $IMLIBRARY_PATH..." -cp -R "$KM4MIM_APP_PATH" "$IMLIBRARY_PATH" +/bin/cp -R "$KM4MIM_APP_PATH" "$IMLIBRARY_PATH" if [[ -d "$KM4MIM_INSTALL_PATH" ]]; then exit 0 diff --git a/mac/Keyman4MacIM/make-km-dmg.sh b/mac/Keyman4MacIM/make-km-dmg.sh index c92a59ae99529aae4f206ed7e37e7caa020c17dd..b79f40e8b4842ad861c493383e892a5fc8270cb6 100755 --- a/mac/Keyman4MacIM/make-km-dmg.sh +++ b/mac/Keyman4MacIM/make-km-dmg.sh @@ -2,8 +2,8 @@ ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE # Please note that this build script (understandably) assumes that it is running on Mac OS X. @@ -64,7 +64,7 @@ while [[ $# -gt 0 ]] ; do case $key in -sourceApp) if [[ "$2" == "" || "$2" =~ ^\- ]]; then - fail "Missing source directory on command line." + builder_die "Missing source directory on command line." else SOURCE_KM_APP=="$2" shift # past argument @@ -72,9 +72,9 @@ while [[ $# -gt 0 ]] ; do ;; -template) if [[ "$2" == "" || "$2" =~ ^\- ]]; then - fail "Missing template image on command line." + builder_die "Missing template image on command line." elif ! [[ "$2" =~ \.dmg$ ]]; then - fail "Template image must be a .dmg!" + builder_die "Template image must be a .dmg!" else TEMPLATE_IMAGE="$2" shift # past argument @@ -82,7 +82,7 @@ while [[ $# -gt 0 ]] ; do ;; -destDir) if [[ "$2" == "" || "$2" =~ ^\- ]]; then - fail "Missing destination directory on command line." + builder_die "Missing destination directory on command line." else DEST_DIR="$2" ADD_VERSION_TO_DEST_DIR=false @@ -103,7 +103,7 @@ while [[ $# -gt 0 ]] ; do display_usage ;; -*) - fail "Unknown option $1. Run with --help for help." + builder_die "Unknown option $1. Run with --help for help." ;; esac shift # past argument @@ -111,21 +111,21 @@ done # Step 0 - check parameter and initial file state if [ "$VERSION" = "" ]; then - fail "Required -version parameter not specified!" + builder_die "Required -version parameter not specified!" fi if [[ ! -d "$SOURCE_KM_APP" ]]; then - fail "$SOURCE_KM_APP does not exist!" + builder_die "$SOURCE_KM_APP does not exist!" fi if [[ ! -f "$TEMPLATE_IMAGE" ]]; then - fail "$TEMPLATE_IMAGE does not exist!" + builder_die "$TEMPLATE_IMAGE does not exist!" fi if [[ ! -e "$OUTPUT_DIR" ]]; then mkdir "$OUTPUT_DIR" elif [[ ! -d "$OUTPUT_DIR" ]]; then - fail "Output dir exists but is not a directory: $2" + builder_die "Output dir exists but is not a directory: $2" fi if $ADD_VERSION_TO_DEST_DIR ; then @@ -134,7 +134,7 @@ fi if [[ ! -e "$DEST_DIR" ]]; then mkdir -p "$DEST_DIR" elif [[ ! -d "$DEST_DIR" ]]; then - fail "Destination dir exists but is not a directory: $2" + builder_die "Destination dir exists but is not a directory: $2" fi # TODO: Check that no Keyman volume is already mounted. @@ -143,23 +143,23 @@ fi WORKING_COPY_OF_IMAGE="$OUTPUT_DIR/Keyman-temp-$VERSION.dmg" displayInfo "Copying \"$TEMPLATE_IMAGE\" to \"$WORKING_COPY_OF_IMAGE\"..." if [[ -e "$WORKING_COPY_OF_IMAGE" && "$VERBOSITY" != "-quiet" ]] ; then - warn "Overwriting: $WORKING_COPY_OF_IMAGE" + builder_warn "Overwriting: $WORKING_COPY_OF_IMAGE" fi cp -f "$TEMPLATE_IMAGE" "$WORKING_COPY_OF_IMAGE" # Step 2 - Mount (copy of) template image - writeable displayInfo "Attaching \"$WORKING_COPY_OF_IMAGE\"" "Mounting as \"$STAGING_DIR\"..." if [[ -e "$STAGING_DIR" ]]; then - fail "Mount folder $STAGING_DIR is already present. Unmount it first." + builder_die "Mount folder $STAGING_DIR is already present. Unmount it first." fi hdiutil attach "$WORKING_COPY_OF_IMAGE" -readwrite -mountpoint "$STAGING_DIR" $VERBOSITY if ! [[ $? == 0 && -d "$STAGING_DIR" ]] ; then - fail "Image could not be mounted at: \"$STAGING_DIR\"" + builder_die "Image could not be mounted at: \"$STAGING_DIR\"" fi DEST_KM_APP="$STAGING_DIR/$KM_APP_NAME" if ! [[ -d "$DEST_KM_APP" ]] ; then hdiutil detach $STAGING_DIR $VERBOSITY - fail "Expected mounted image to contain Keyman app, but \"$DEST_KM_APP\" does not exist." + builder_die "Expected mounted image to contain Keyman app, but \"$DEST_KM_APP\" does not exist." fi echo "---- Listing info in /Volumes/Keyman/ ----" @@ -174,7 +174,7 @@ displayInfo "Copying files from \"$SOURCE_KM_APP\"..." find "$DEST_KM_APP" -mindepth 1 -maxdepth 1 echo "---------" find "$DEST_KM_APP" -mindepth 1 -maxdepth 1 -print0 | xargs -0 rm -rf -cp -fR "$SOURCE_KM_APP/" "$DEST_KM_APP" +/bin/cp -fR "$SOURCE_KM_APP/" "$DEST_KM_APP" echo "---- Listing info in /Volumes/Keyman/ ----" echo "DEST_KM_APP=$DEST_KM_APP" @@ -202,7 +202,7 @@ while (( DETACH_SUCCESS < 10 )); do done if (( DETACH_SUCCESS < 999 )); then - fail "Unable to unmount \"$STAGING_DIR\". Aborting build." + builder_die "Unable to unmount \"$STAGING_DIR\". Aborting build." fi # Step 5 - Convert image to a compressed readonly DMG image @@ -210,13 +210,13 @@ DMG_FILE_PATH="$DEST_DIR/keyman-$VERSION.dmg" displayInfo "Converting/compressing image to create \"$DMG_FILE_PATH\"" if [[ -e "$DMG_FILE_PATH" ]] ; then if [[ "$VERBOSITY" != "-quiet" ]] ; then - warn "Overwriting: $DMG_FILE_PATH" + builder_warn "Overwriting: $DMG_FILE_PATH" fi rm -rf "$DMG_FILE_PATH" fi hdiutil convert "$WORKING_COPY_OF_IMAGE" -format UDZO -o "$DMG_FILE_PATH" $VERBOSITY if ! [[ $? == 0 && -f "$DMG_FILE_PATH" ]]; then - fail "make-km-dmg failed to create \"$DMG_FILE_PATH\"." + builder_die "make-km-dmg failed to create \"$DMG_FILE_PATH\"." fi # Step 6 - Clean up diff --git a/mac/Keyman4MacIM/write-download_info.sh b/mac/Keyman4MacIM/write-download_info.sh index 8378d5ed6b59356b7b8ebbf1ea0c73b706ae3fb6..d185185ffbf46095626b347c228d771f73e05a5f 100755 --- a/mac/Keyman4MacIM/write-download_info.sh +++ b/mac/Keyman4MacIM/write-download_info.sh @@ -2,8 +2,8 @@ ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE # Please note that this build script (understandably) assumes that it is running on Mac OS X. @@ -49,7 +49,7 @@ while [[ $# -gt 0 ]] ; do case $key in -destDir) if [[ "$2" == "" || "$2" =~ ^\- ]]; then - fail "Missing destination directory on command line." + builder_die "Missing destination directory on command line." else DEST_DIR="$2" ADD_VERSION_TO_DEST_DIR=false @@ -60,7 +60,7 @@ while [[ $# -gt 0 ]] ; do display_usage ;; -*) - fail "Unknown option $1. Run with --help for help." + builder_die "Unknown option $1. Run with --help for help." ;; esac shift # past argument @@ -72,20 +72,20 @@ fi if [[ ! -e $DEST_DIR ]]; then mkdir -p $DEST_DIR elif [[ ! -d $DEST_DIR ]]; then - fail "Destination dir exists but is not a directory: $2" + builder_die "Destination dir exists but is not a directory: $2" fi DMG_FILENAME="keyman-$VERSION.dmg" DMG_FILEPATH="$DEST_DIR/$DMG_FILENAME" DOWNLOAD_INFO_FILEPATH="${DMG_FILEPATH}.download_info" if [[ ! -f "$DMG_FILEPATH" ]]; then - fail "Cannot compute file size or MD5 for non-existent DMG file: $DMG_FILEPATH" + builder_die "Cannot compute file size or MD5 for non-existent DMG file: $DMG_FILEPATH" fi -DMG_FILE_SIZE=$(stat -f"%z" "$DMG_FILEPATH") +DMG_FILE_SIZE=$(/usr/bin/stat -f"%z" "$DMG_FILEPATH") DMG_MD5=$(md5 -q "$DMG_FILEPATH") if [[ -f "$DOWNLOAD_INFO_FILEPATH" ]]; then - warn "Overwriting $DOWNLOAD_INFO_FILEPATH" + builder_warn "Overwriting $DOWNLOAD_INFO_FILEPATH" fi echo { > "$DOWNLOAD_INFO_FILEPATH" diff --git a/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMBinaryFileFormat.h b/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMBinaryFileFormat.h index 17483dabd259e81c4e86a17a45bbdd2baa940daa..97907c67c1f4a3cde77bbc9775bb48cf94f5a765 100644 --- a/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMBinaryFileFormat.h +++ b/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMBinaryFileFormat.h @@ -16,7 +16,7 @@ typedef uint32_t DWORD; struct COMP_KEYBOARD { DWORD dwIdentifier; // 0000 Keyman compiled keyboard id DWORD dwFileVersion; // 0004 Version of the file - Keyman 4.0 is 0x0400 - DWORD dwCheckSum; // 0008 As stored in keyboard + DWORD dwCheckSum; // 0008 As stored in keyboard. DEPRECATED as of 16.0 DWORD KeyboardID; // 000C as stored in HKEY_LOCAL_MACHINE//system//currentcontrolset//control//keyboard layouts DWORD IsRegistered; // 0010 DWORD version; // 0014 keyboard version @@ -44,8 +44,9 @@ struct COMP_KEYBOARD { #define VERSION_100 0x00000A00 #define VERSION_140 0x00000E00 #define VERSION_150 0x00000F00 +#define VERSION_160 0x00001000 #define VERSION_MIN VERSION_50 -#define VERSION_MAX VERSION_150 +#define VERSION_MAX VERSION_160 struct COMP_GROUP { DWORD dpName; // string (only debug) diff --git a/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMXFile.h b/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMXFile.h index 01ba39458279504f21d5bb1507cdd6438d7aede1..8eec8bb4e321a7e0127aa2dc893117aedd93ab2d 100644 --- a/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMXFile.h +++ b/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMXFile.h @@ -23,7 +23,6 @@ extern NSString *const kKMVisualKeyboardKey; @property (assign, nonatomic, readonly) DWORD identifier; @property (assign, nonatomic, readonly) DWORD fileVersion; -@property (assign, nonatomic, readonly) DWORD checkSum; @property (assign, nonatomic, readonly) DWORD keyboardID; @property (assign, nonatomic, readonly) BOOL isRegistered; @property (assign, nonatomic, readonly) BOOL isMnemonic; diff --git a/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMXFile.m b/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMXFile.m index ddc36a848d499d74fead4e746f668e89d56f47e3..a2c705519a7b7e56b0e7dd389786ac7579f03bb6 100644 --- a/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMXFile.m +++ b/mac/KeymanEngine4Mac/KeymanEngine4Mac/KME/KMXFile.m @@ -27,12 +27,8 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; _filePath = nil; return nil; } - - if (![[self class] verifyCheckSum:path]) { - NSLog(@"errBadChecksum"); - return nil; - } - + + NSFileHandle *file = [NSFileHandle fileHandleForReadingAtPath:path]; if (file == nil) { //NSLog(@"Failed to open kmx file"); @@ -42,21 +38,20 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; else { _filePath = [NSString stringWithString:path]; } - + struct COMP_KEYBOARD cmp_kb; [file seekToFileOffset:0]; size_t size = sizeof(cmp_kb); NSData *dataBuffer = [file readDataOfLength:size]; [dataBuffer getBytes:&cmp_kb length:size]; - + if (cmp_kb.dwFileVersion < VERSION_MIN || cmp_kb.dwFileVersion > VERSION_MAX) { [file closeFile]; return nil; } - + _identifier = cmp_kb.dwIdentifier; _fileVersion = cmp_kb.dwFileVersion; - _checkSum = cmp_kb.dwCheckSum; _keyboardID = cmp_kb.KeyboardID; _isRegistered = (cmp_kb.IsRegistered == 0?NO:YES); _version = cmp_kb.version; @@ -66,7 +61,7 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; _startGroup = [[NSArray alloc] initWithArray:mStartGroup]; _flags = cmp_kb.dwFlags; _hotKey = cmp_kb.dwHotKey; - + struct COMP_STORE cmp_str[cmp_kb.cxStoreArray]; [file seekToFileOffset:cmp_kb.dpStoreArray]; size = sizeof(cmp_str); @@ -77,7 +72,7 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; KMCompStore *kmStore = [[KMCompStore alloc] init]; kmStore.dwSystemID = cmp_str[i].dwSystemID; kmStore.name = [KMXFile UTF16StringWithPointer:cmp_str[i].dpName inFile:file]; - + if (kmStore.dwSystemID == TSS_VERSION) kmStore.string = [[KMXFile UTF16StringWithPointer:cmp_str[i].dpString inFile:file] stringByReplacingOccurrencesOfString:@"\n" withString:@""]; else { @@ -85,24 +80,24 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; if (kmStore.dwSystemID == TSS_MNEMONIC && [kmStore.string isEqualToString:@"1"]) _isMnemonic = YES; } - + if (kmStore.dwSystemID == TSS_VERSION) kmStore.string = [[KMXFile UTF16StringWithPointer:cmp_str[i].dpString inFile:file] stringByReplacingOccurrencesOfString:@"\n" withString:@""]; else kmStore.string = [KMXFile UTF16StringWithPointer:cmp_str[i].dpString inFile:file]; - + [mStore addObject:kmStore]; } - + _store = [[NSArray alloc] initWithArray:mStore]; _storeSaved = [[NSArray alloc] initWithArray:mStore copyItems:YES]; - + struct COMP_GROUP cmp_grp[cmp_kb.cxGroupArray]; [file seekToFileOffset:cmp_kb.dpGroupArray]; size = sizeof(cmp_grp); dataBuffer = [file readDataOfLength:size]; [dataBuffer getBytes:cmp_grp length:size]; - + NSMutableArray *mGroup = [[NSMutableArray alloc] initWithCapacity:cmp_kb.cxGroupArray]; for (int i = 0; i < cmp_kb.cxGroupArray; i++) { KMCompGroup *kmGrp = [[KMCompGroup alloc] init]; @@ -110,13 +105,13 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; kmGrp.match = [KMXFile UTF16StringWithPointer:cmp_grp[i].dpMatch inFile:file]; kmGrp.noMatch = [KMXFile UTF16StringWithPointer:cmp_grp[i].dpNoMatch inFile:file]; kmGrp.fUsingKeys = cmp_grp[i].fUsingKeys; - + struct COMP_KEY cmp_keys[cmp_grp[i].cxKeyArray]; [file seekToFileOffset:cmp_grp[i].dpKeyArray]; size = sizeof(cmp_keys); dataBuffer = [file readDataOfLength:size]; [dataBuffer getBytes:cmp_keys length:size]; - + for (int j = 0; j < cmp_grp[i].cxKeyArray; j++) { KMCompKey *kmKey = [[KMCompKey alloc] init]; kmKey.key = cmp_keys[j].Key; @@ -126,19 +121,19 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; kmKey.context = [KMXFile UTF16StringWithPointer:cmp_keys[j].dpContext inFile:file]; [kmGrp.keys addObject:kmKey]; } - + [mGroup addObject:kmGrp]; } _group = [[NSArray alloc] initWithArray:mGroup]; - + [file seekToFileOffset:cmp_kb.dpBitmapOffset]; NSData *bitmapData = [file readDataOfLength:cmp_kb.dwBitmapSize]; NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:bitmapData]; _bitmap = [[NSImage alloc] initWithCGImage:imageRep.CGImage size:NSMakeSize(CGImageGetWidth(imageRep.CGImage), CGImageGetHeight(imageRep.CGImage))]; - + [file closeFile]; } - + return self; } @@ -149,50 +144,46 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; return str; } -- (BOOL)isValid { +- (BOOL)isValid { for (KMCompGroup *gp in self.group) { if ((gp.match && ![gp.match isValidCode]) || (gp.noMatch && ![gp.noMatch isValidCode])) return NO; - + for (KMCompKey *kmKey in gp.keys) { if (![kmKey.context isValidCode] || ![kmKey.output isValidCode]) return NO; } } - + return YES; } + (NSDictionary *)keyboardInfoFromKmxFile:(NSString *)path { NSFileHandle *file = [NSFileHandle fileHandleForReadingAtPath:path]; - + if (file == nil) { //NSLog(@"Failed to open file"); return nil; } - - if (![[self class] verifyCheckSum:path]) { - NSLog(@"errBadChecksum"); - return nil; - } - + + struct COMP_KEYBOARD cmp_kb; [file seekToFileOffset:0]; size_t size = sizeof(cmp_kb); NSData *dataBuffer = [file readDataOfLength:size]; [dataBuffer getBytes:&cmp_kb length:size]; - + if (cmp_kb.dwFileVersion < VERSION_MIN || cmp_kb.dwFileVersion > VERSION_MAX) { [file closeFile]; return nil; } - + struct COMP_STORE cmp_str[cmp_kb.cxStoreArray]; [file seekToFileOffset:cmp_kb.dpStoreArray]; size = sizeof(cmp_str); dataBuffer = [file readDataOfLength:size]; [dataBuffer getBytes:cmp_str length:size]; - + NSString *nameStr = nil; NSString *verStr = nil; NSString *copyrightStr = nil; @@ -212,9 +203,9 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; NSData *bitmapData = [file readDataOfLength:cmp_kb.dwBitmapSize]; NSBitmapImageRep *imageRep = [NSBitmapImageRep imageRepWithData:bitmapData]; NSImage *icon = [[NSImage alloc] initWithCGImage:imageRep.CGImage size:NSMakeSize(CGImageGetWidth(imageRep.CGImage), CGImageGetHeight(imageRep.CGImage))]; - + [file closeFile]; - + if (!nameStr || !nameStr.length) { nameStr = [path.lastPathComponent stringByReplacingOccurrencesOfString:@".kmx" withString:@""]; } @@ -222,7 +213,7 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; verStr = @""; if (!copyrightStr) copyrightStr = @""; - + NSDictionary *info; if (icon) { info = [[NSDictionary alloc] initWithObjectsAndKeys:nameStr, kKMKeyboardNameKey, @@ -237,14 +228,14 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; copyrightStr, kKMKeyboardCopyrightKey, visualKeyboard, kKMVisualKeyboardKey, nil]; } - + return info; } + (NSString *)UTF16StringWithPointer:(DWORD)dp inFile:(NSFileHandle *)file { if (dp == 0) return nil; - + [file seekToFileOffset:dp]; UTF16Char ch = '\0'; size_t size = sizeof(ch); @@ -257,74 +248,9 @@ NSString *const kKMVisualKeyboardKey = @"KMVisualKeyboardKey"; dataBuffer = [file readDataOfLength:size]; [dataBuffer getBytes:&ch length:size]; } - - return mStr; -} - -#pragma mark - CRC32 - -+ (BOOL)verifyCheckSum:(NSString *)path { - NSFileHandle *file = [NSFileHandle fileHandleForReadingAtPath:path]; - if (file == nil) { - //NSLog(@"Failed to open file"); - return NO; - } - - [file seekToFileOffset:0]; - NSMutableData *dataBuffer = [[file readDataToEndOfFile] mutableCopy]; - [dataBuffer replaceBytesInRange:NSMakeRange(8, 4) withBytes:0 length:4]; // set dwCheckSum = 0 before calculating CRC32 - unsigned long crc = [self getCRC32:dataBuffer]; - - struct COMP_KEYBOARD cmp_kb; - [file seekToFileOffset:0]; - size_t size = sizeof(cmp_kb); - dataBuffer = [[file readDataOfLength:size] mutableCopy]; - [dataBuffer getBytes:&cmp_kb length:size]; - [file closeFile]; - - return (crc == cmp_kb.dwCheckSum); -} -#define CRC32_POLYNOMIAL 0xEDB88320L -unsigned long CRCTable[256]; - -+ (void)buildCRCTable { - static BOOL tableBuilt = FALSE; - int i; - int j; - unsigned long crc; - - if (!tableBuilt) { - for (i = 0; i <= 255; i++) { - crc = i; - - for (j = 8; j > 0; j--) - if(crc & 1) crc = (crc >> 1) ^ CRC32_POLYNOMIAL; else crc >>= 1; - - CRCTable[i] = crc; - } - } -} - -+ (unsigned long)calculateBufferCRC:(unsigned long)count pointer:(Byte *)p { - unsigned long temp1; - unsigned long temp2; - unsigned long crc = 0xFFFFFFFFL; - - [self buildCRCTable]; - - while (count-- != 0) { - temp1 = ( crc >> 8 ) & 0x00FFFFFFL; - temp2 = CRCTable[((int) crc ^ *p++) & 0xff]; - crc = temp1 ^ temp2; - } - - return crc; + return mStr; } -+ (unsigned long)getCRC32:(NSData *)data { - Byte *bytes = (Byte *)[data bytes]; - return [self calculateBufferCRC:[data length] pointer:bytes]; -} @end diff --git a/mac/bashHelperFunctions.sh b/mac/bashHelperFunctions.sh index 2b38848543c6af45e785e0e668f6df16417715f0..d8a482931cfe5e659dcb1f841edce661483a8ab2 100755 --- a/mac/bashHelperFunctions.sh +++ b/mac/bashHelperFunctions.sh @@ -10,17 +10,6 @@ if ! [[ "$TERM" == "" || "$TERM" == "dumb" ]]; then NORMAL=$(tput sgr0) fi -fail() { - FAILURE_MSG="$1" - if [[ "$FAILURE_MSG" == "" ]]; then - FAILURE_MSG="Unknown failure" - fi - echo "${ERROR_RED}$FAILURE_MSG${NORMAL}" - exit 1 -} - -warn() { echo "${WARNING_YELLOW}$*${NORMAL}"; } - displayInfo() { if [ "$QUIET" != true ]; then while [[ $# -gt 0 ]] ; do @@ -32,13 +21,13 @@ displayInfo() { assertFileExists() { if ! [ -f $1 ]; then - fail "Build failed: missing $1" + builder_die "Build failed: missing $1" fi } assertValidVersionNbr() { if [[ "$1" == "" || ! "$1" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then - fail "Specified version not valid: '$1'. Version should be in the form Major.Minor.BuildCounter" + builder_die "Specified version not valid: '$1'. Version should be in the form Major.Minor.BuildCounter" fi } \ No newline at end of file diff --git a/mac/build-help.sh b/mac/build-help.sh deleted file mode 100755 index cce855b7415ddf1fe1e329bd8742395738943eb2..0000000000000000000000000000000000000000 --- a/mac/build-help.sh +++ /dev/null @@ -1,109 +0,0 @@ -#!/usr/bin/env bash - -# Set sensible script defaults: -# set -e: Terminate script if a command returns an error -set -e -# set -u: Terminate script if an unset variable is used -set -u - -## START STANDARD BUILD SCRIPT INCLUDE -# adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../resources/build/build-utils.sh" -## END STANDARD BUILD SCRIPT INCLUDE - -QUIET=0 - -. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" - -THIS_DIR="$(dirname "$THIS_SCRIPT")" - -display_usage() { - echo "build.sh [--no-clean] target [...target]" - echo "Builds help documentation for Keyman for macOS" - echo "Targets:" - echo " * htm or html: convert documentation to html using pandoc" - echo - echo " --no-clean: don't clean target folder before building" -} - -DO_HTM=false -DO_CLEAN=true - -# Debug flags -DO_HTM_CONVERSION=true - -# -# Parse args -# - -shopt -s nocasematch - -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - htm | html) - DO_HTM=true - ;; - --no-clean) - DO_CLEAN=false - ;; - *) - display_usage - exit 1 - esac - shift # past argument -done - -if ! $DO_HTM ; then - display_usage - exit 1 -fi - -displayInfo "" \ - "DO_HTM: $DO_HTM" \ - "DO_CLEAN: $DO_CLEAN" \ - "" - -# -# Compile all .md to .html -# - -cd $KEYMAN_ROOT/mac/help - -MDLUA="$KEYMAN_ROOT/resources/build/html-link.lua" -CSS="../../resources/build/offline-help-style-spec.txt" -MD=`find . -name "*.md"` -DESTHTM="$THIS_DIR/Keyman4MacIM/Keyman4MacIM/Help" - -if $DO_HTM; then - # - # Clean existing folder - # - - if $DO_CLEAN; then - rm -rf "$DESTHTM" || true # We don't want to die when we clean an empty folder - fi - mkdir -p "$DESTHTM" - - # - # Generate HTML files from Markdown - # - - if $DO_HTM_CONVERSION; then - for INFILE in $MD; do - OUTFILE="$DESTHTM/${INFILE%.md}.html" - echo "Processing $INFILE to $(basename "$OUTFILE")" - mkdir -p "$(dirname "$OUTFILE")" - pandoc -s -H "$CSS" --lua-filter="$MDLUA" -t html -o "$OUTFILE" $INFILE - done - fi - - # - # Copy Images - # - cd $KEYMAN_ROOT/mac/help/ - mkdir -p "$DESTHTM/mac_images" - cp mac_images/* "$DESTHTM/mac_images/" - -fi diff --git a/mac/build.sh b/mac/build.sh index 14aa037eab7fd572bd2892b69bbefa4f39ea98d7..5b6a3f525b8e4e9296e4be223f9fa0df6fe521f6 100755 --- a/mac/build.sh +++ b/mac/build.sh @@ -3,14 +3,15 @@ set -e ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE KEYMAN_MAC_BASE_PATH="$KEYMAN_ROOT/mac" # Include our resource functions; they're pretty useful! . "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" +. "$KEYMAN_ROOT/resources/build/build-help.inc.sh" # This script runs from its own folder cd "$(dirname "$THIS_SCRIPT")" @@ -69,7 +70,7 @@ display_usage() { assertOptionsPrecedeTargets() { if [[ "$1" =~ ^\- ]]; then if $PROCESSING_TARGETS ; then - fail "Options must be specified before build targets" + builder_die "Options must be specified before build targets" fi elif ! $PROCESSING_TARGETS ; then PROCESSING_TARGETS=true @@ -81,7 +82,7 @@ assertOptionsPrecedeTargets() { } do_clean ( ) { - echo_heading "Cleaning source (Carthage)" + builder_heading "Cleaning source (Carthage)" # rm -rf $KME4M_BUILD_PATH # rm -rf $APP_BUILD_PATH rm -rf $KEYMAN_MAC_BASE_PATH/Carthage @@ -108,9 +109,6 @@ KMIM_WORKSPACE_PATH="$KM4MIM_BASE_PATH/$IM_NAME.xcworkspace" # APP_BUNDLE_PATH=$APP_RESOURCES/Keyman.bundle # APP_BUILD_PATH=keyman/Keyman/build/ - -KME4M_OUTPUT_FOLDER=$KME4M_BUILD_PATH/libKeyman - ### PROCESS COMMAND-LINE ARGUMENTS ### # Default is debug build of Engine and (code-signed) Input Method @@ -134,6 +132,7 @@ QUIET=false NOTARIZE=false SKIP_BUILD=false UPLOAD_SENTRY=false +QUIET_FLAG= # Import local environment variables for build if [[ -f $(dirname "$THIS_SCRIPT")/localenv.sh ]]; then @@ -161,7 +160,7 @@ while [[ $# -gt 0 ]] ; do NOTARIZE=true CONFIG="Release" elif ! [[ "$2" =~ ^(n(one)?)$ ]]; then - fail "Invalid deploy option. Must be 'none', 'local', 'quicklocal' or 'preprelease'." + builder_die "Invalid deploy option. Must be 'none', 'local', 'quicklocal' or 'preprelease'." fi shift # past argument ;; @@ -171,7 +170,7 @@ while [[ $# -gt 0 ]] ; do ;; -config) if [[ "$2" == "" || "$2" =~ ^\- ]]; then - warn "Missing config name on command line. Using 'Debug' as default..." + builder_warn "Missing config name on command line. Using 'Debug' as default..." else if $PREPRELEASE && [[ "$2" != "Release" ]]; then echo "Deployment option 'preprelease' supersedes $2 configuration." @@ -225,9 +224,9 @@ while [[ $# -gt 0 ]] ; do ;; *) if $PROCESSING_TARGETS ; then - fail "Unexpected target: $1. Run with --help for help." + builder_die "Unexpected target: $1. Run with --help for help." else - fail "Unexpected option: $1. Run with --help for help." + builder_die "Unexpected option: $1. Run with --help for help." fi ;; esac @@ -261,6 +260,7 @@ displayInfo "" \ "BUILD_ACTIONS: $BUILD_ACTIONS" \ "TEST_ACTION: $TEST_ACTION" \ "UPLOAD_SENTRY: $UPLOAD_SENTRY" \ + "QUIET_FLAG: $QUIET_FLAG" \ "" ### Validate notarization environment variables ### @@ -268,19 +268,19 @@ displayInfo "" \ if $LOCALDEPLOY && ! $NOTARIZE ; then if [ "$(spctl --status)" == "assessments enabled" ]; then echo - warn "WARNING: Notarization is disabled but SecAssessment security policy is still active. Keyman will not run correctly." - warn " Disable SecAssessment with 'sudo spctl --master-disable' (or do notarized builds)" - fail "Re-run with '-deploy local' or disable SecAssessment." + builder_warn "WARNING: Notarization is disabled but SecAssessment security policy is still active. Keyman will not run correctly." + builder_warn " Disable SecAssessment with 'sudo spctl --master-disable' (or do notarized builds)" + builder_die "Re-run with '-deploy local' or disable SecAssessment." fi fi if $PREPRELEASE || $NOTARIZE ; then - if [ ! $DO_CODESIGN ] || [ -z "${CERTIFICATE_ID}" ]; then - fail "Code signing must be configured for deployment. See build.sh -help for details." + if [ ! $DO_CODESIGN ] || [ -z "${CERTIFICATE_ID+x}" ]; then + builder_die "Code signing must be configured for deployment. See build.sh -help for details." fi - if [ -z "${APPSTORECONNECT_PROVIDER}" ] || [ -z "${APPSTORECONNECT_USERNAME}" ] || [ -z "${APPSTORECONNECT_PASSWORD}" ]; then - fail "Appstoreconnect Apple ID credentials must be configured in environment. See build.sh -help for details." + if [ -z "${APPSTORECONNECT_PROVIDER+x}" ] || [ -z "${APPSTORECONNECT_USERNAME+x}" ] || [ -z "${APPSTORECONNECT_PASSWORD+x}" ]; then + builder_die "Appstoreconnect Apple ID credentials must be configured in environment. See build.sh -help for details." fi fi @@ -309,7 +309,7 @@ execBuildCommand() { printXCodeBuildScriptLogs if [ $ret_code != 0 ]; then - fail "Build of $component failed! Error: [$ret_code] when executing command: '$cmnd'" + builder_die "Build of $component failed! Error: [$ret_code] when executing command: '$cmnd'" fi } @@ -318,7 +318,7 @@ updatePlist() { KM_PLIST="$1" APPNAME="$2" if [ ! -f "$KM_PLIST" ]; then - fail "File not found: $KM_PLIST" + builder_die "File not found: $KM_PLIST" fi local YEAR=`date "+%Y"` echo "Setting version and related fields to $VERSION_WITH_TAG in $KM_PLIST" @@ -345,7 +345,7 @@ execCodeSign() { eval codesign "$@" ret_code=$? if [ $ret_code != 0 ]; then - fail "Unable to sign component (exit code $ret_code)" + builder_die "Unable to sign component (exit code $ret_code)" fi fi set -e @@ -354,7 +354,7 @@ execCodeSign() { ### Build Keyman Engine (kmx processor) ### if $DO_KEYMANENGINE ; then - echo_heading "Building Keyman Engine" + builder_heading "Building Keyman Engine" execBuildCommand $ENGINE_NAME "xcodebuild -project \"$KME4M_PROJECT_PATH\" $BUILD_OPTIONS $BUILD_ACTIONS $TEST_ACTION -scheme $ENGINE_NAME" execBuildCommand "$ENGINE_NAME dSYM file" "dsymutil \"$KME4M_BASE_PATH/build/$CONFIG/$ENGINE_NAME.framework/Versions/A/$ENGINE_NAME\" -o \"$KME4M_BASE_PATH/build/$CONFIG/$ENGINE_NAME.framework.dSYM\"" updatePlist "$KME4M_BASE_PATH/build/$CONFIG/$ENGINE_NAME.framework/Resources/Info.plist" "Keyman Engine" @@ -365,10 +365,10 @@ fi if $DO_KEYMANIM ; then if $DO_HELP ; then echo "Building help" - $(dirname "$THIS_SCRIPT")/build-help.sh html + build_help_html mac Keyman4MacIM/Keyman4MacIM/Help fi - echo_heading "Building Keyman.app" + builder_heading "Building Keyman.app" cd "$KM4MIM_BASE_PATH" if $DO_PODS ; then pod update @@ -390,7 +390,7 @@ if $DO_KEYMANIM ; then ENTITLEMENTS_FILE=Keyman.entitlements fi - if [ -z "$DEVELOPMENT_TEAM" ]; then + if [ -z "${DEVELOPMENT_TEAM+x}" ]; then DEVELOPMENT_TEAM=3YE4W86L3G fi @@ -413,9 +413,9 @@ if $DO_KEYMANIM ; then if which sentry-cli >/dev/null; then cd "$KM4MIM_BASE_PATH" - sentry-cli upload-dif "build/${CONFIGURATION}" + sentry-cli upload-dif "build/$CONFIG" else - fail "Error: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases" + builder_die "Error: sentry-cli not installed, download from https://github.com/getsentry/sentry-cli/releases" fi fi @@ -425,7 +425,7 @@ fi ### Build test app ### if $DO_KEYMANTESTAPP ; then - echo_heading "Building test app" + builder_heading "Building test app" execBuildCommand $TESTAPP_NAME "xcodebuild -project \"$KMTESTAPP_PROJECT_PATH\" $BUILD_OPTIONS $BUILD_ACTIONS" updatePlist "$KMTESTAPP_BASE_PATH/build/$CONFIG/$TESTAPP_NAME.app/Contents/Info.plist" "Keyman Test App" fi @@ -433,9 +433,9 @@ fi ### Notarize the app for preprelease ### if $PREPRELEASE || $NOTARIZE; then - echo_heading "Notarizing app" - if [ "${CODESIGNING_SUPPRESSION}" != "" ] && [ -z "${CERTIFICATE_ID}" ]; then - fail "Notarization and signed executable is required for deployment, even locally. Specify CERTIFICATE_ID environment variable for custom certificate." + builder_heading "Notarizing app" + if [ "${CODESIGNING_SUPPRESSION}" != "" ] && [ -z "${CERTIFICATE_ID+x}" ]; then + builder_die "Notarization and signed executable is required for deployment, even locally. Specify CERTIFICATE_ID environment variable for custom certificate." else TARGET_PATH="$KM4MIM_BASE_PATH/build/$CONFIG" TARGET_APP_PATH="$TARGET_PATH/$PRODUCT_NAME.app" @@ -445,21 +445,21 @@ if $PREPRELEASE || $NOTARIZE; then # Note: get-task-allow entitlement must be *off* in our release build (to do this, don't include base entitlements in project build settings) # We may need to re-run the code signing if a custom certificate has been passed in - if [ ! -z "${CERTIFICATE_ID}" ]; then - echo_heading "Signing with custom certificate (CERTIFICATE_ID environment variable)." + if [ ! -z "${CERTIFICATE_ID+x}" ]; then + builder_heading "Signing with custom certificate (CERTIFICATE_ID environment variable)." codesign --force --options runtime --entitlements Keyman4MacIM/Keyman.entitlements --deep --sign "${CERTIFICATE_ID}" "$TARGET_APP_PATH" fi - echo_heading "Zipping Keyman.app for notarization to $TARGET_ZIP_PATH" + builder_heading "Zipping Keyman.app for notarization to $TARGET_ZIP_PATH" /usr/bin/ditto -c -k --keepParent "$TARGET_APP_PATH" "$TARGET_ZIP_PATH" - echo_heading "Uploading Keyman.zip to Apple for notarization" + builder_heading "Uploading Keyman.zip to Apple for notarization" xcrun altool --notarize-app --primary-bundle-id "com.Keyman.im.zip" --asc-provider "$APPSTORECONNECT_PROVIDER" --username "$APPSTORECONNECT_USERNAME" --password @env:APPSTORECONNECT_PASSWORD --file "$TARGET_ZIP_PATH" --output-format xml > $ALTOOL_LOG_PATH || ( ALTOOL_CODE=$? cat "$ALTOOL_LOG_PATH" - fail "altool failed with code $ALTOOL_CODE" + builder_die "altool failed with code $ALTOOL_CODE" ) cat "$ALTOOL_LOG_PATH" @@ -480,7 +480,7 @@ if $PREPRELEASE || $NOTARIZE; then continue; fi cat "$ALTOOL_LOG_PATH" - fail "altool failed with code $ALTOOL_CODE" + builder_die "altool failed with code $ALTOOL_CODE" ) ALTOOL_STATUS=$(/usr/libexec/PlistBuddy -c "Print notarization-info:Status" "$ALTOOL_LOG_PATH") if [ "$ALTOOL_STATUS" == "success" ]; then @@ -490,34 +490,34 @@ if $PREPRELEASE || $NOTARIZE; then cat "$ALTOOL_LOG_PATH" ALTOOL_LOG_URL=$(/usr/libexec/PlistBuddy -c "Print notarization-info:LogFileURL" "$ALTOOL_LOG_PATH") curl "$ALTOOL_LOG_URL" - fail "Notarization failed with $ALTOOL_STATUS; check log at $ALTOOL_LOG_PATH" + builder_die "Notarization failed with $ALTOOL_STATUS; check log at $ALTOOL_LOG_PATH" fi done - echo_heading "Notarization completed successfully. Review logs below for any warnings." + builder_heading "Notarization completed successfully. Review logs below for any warnings." cat "$ALTOOL_LOG_PATH" ALTOOL_LOG_URL=$(/usr/libexec/PlistBuddy -c "Print notarization-info:LogFileURL" "$ALTOOL_LOG_PATH") curl "$ALTOOL_LOG_URL" echo - echo_heading "Attempting to staple notarization to Keyman.app" - xcrun stapler staple "$TARGET_APP_PATH" || fail "stapler failed" + builder_heading "Attempting to staple notarization to Keyman.app" + xcrun stapler staple "$TARGET_APP_PATH" || builder_die "stapler failed" fi fi ### Deploy as requested ### if $LOCALDEPLOY ; then - echo_heading "Attempting local deployment with command:" + builder_heading "Attempting local deployment with command:" KM4MIM_APP_BASE_PATH="$KM4MIM_BASE_PATH/build/$CONFIG" displayInfo "$KM4MIM_BASE_PATH/localdeploy.sh \"$KM4MIM_APP_BASE_PATH\"" eval "$KM4MIM_BASE_PATH/localdeploy.sh" "$KM4MIM_APP_BASE_PATH" if [ $? == 0 ]; then displayInfo "Local deployment succeeded!" "" else - fail "Local deployment failed!" + builder_die "Local deployment failed!" fi elif $PREPRELEASE ; then - echo_heading "Preparing files for release deployment..." + builder_heading "Preparing files for release deployment..." # Create the disk image pushd setup eval "./build.sh" @@ -527,7 +527,7 @@ elif $PREPRELEASE ; then if [ $? == 0 ]; then displayInfo "Creating disk image succeeded!" "" else - fail "Creating disk image failed!" + builder_die "Creating disk image failed!" fi # Create download info @@ -535,9 +535,9 @@ elif $PREPRELEASE ; then if [ $? == 0 ]; then displayInfo "Writing download_info file succeeded!" "" else - fail "Writing download_info file failed!" + builder_die "Writing download_info file failed!" fi fi -echo_heading "Build Succeeded!" +builder_heading "Build Succeeded!" exit 0 diff --git a/mac/is_same_version.sh b/mac/is_same_version.sh index 985aecda35e169079fc8a8a2445ce5bd8df6fcfc..024902317f415b5b7ab624685914844dd1d892fc 100755 --- a/mac/is_same_version.sh +++ b/mac/is_same_version.sh @@ -6,8 +6,8 @@ ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE #TODO: diff --git a/mac/setup/build.sh b/mac/setup/build.sh index c51b4bf4e6be078f2cc88de4f337f740e0ce7f10..40860222daf7d884a4b6f2ced65160d6059e6c7f 100755 --- a/mac/setup/build.sh +++ b/mac/setup/build.sh @@ -5,8 +5,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE # Include our resource functions; they're pretty useful! @@ -62,10 +62,10 @@ mkdir -p "$TARGETPATH" rm -rf "$TARGETAPP" || true # Copy new install image to output folder -cp -R "$SOURCEAPP" "$TARGETPATH/" +/bin/cp -R "$SOURCEAPP" "$TARGETPATH/" # Copy Keyman.app into install image -cp -R "$KEYMANAPP" "$TARGETAPP/Contents/MacOS/Keyman.app" +/bin/cp -R "$KEYMANAPP" "$TARGETAPP/Contents/MacOS/Keyman.app" # Copy textinputsource into install image cp textinputsource/textinputsource "$TARGETAPP/Contents/MacOS/textinputsource" @@ -83,13 +83,13 @@ TARGET_ZIP_PATH="$TARGETPATH/Install Keyman.zip" TARGET_APP_PATH="$TARGETAPP" ALTOOL_LOG_PATH="$TARGETPATH/altool.log" -echo_heading "Zipping Install Keyman.app for notarization to $TARGET_ZIP_PATH" +builder_heading "Zipping Install Keyman.app for notarization to $TARGET_ZIP_PATH" /usr/bin/ditto -c -k --keepParent "$TARGET_APP_PATH" "$TARGET_ZIP_PATH" -echo_heading "Uploading Install Keyman.zip to Apple for notarization" +builder_heading "Uploading Install Keyman.zip to Apple for notarization" -xcrun altool --notarize-app --primary-bundle-id "com.Keyman.install.zip" --asc-provider "$APPSTORECONNECT_PROVIDER" --username "$APPSTORECONNECT_USERNAME" --password @env:APPSTORECONNECT_PASSWORD --file "$TARGET_ZIP_PATH" --output-format xml > $ALTOOL_LOG_PATH || fail "altool failed" +xcrun altool --notarize-app --primary-bundle-id "com.Keyman.install.zip" --asc-provider "$APPSTORECONNECT_PROVIDER" --username "$APPSTORECONNECT_USERNAME" --password @env:APPSTORECONNECT_PASSWORD --file "$TARGET_ZIP_PATH" --output-format xml > $ALTOOL_LOG_PATH || builder_die "altool failed" cat "$ALTOOL_LOG_PATH" ALTOOL_UUID=$(/usr/libexec/PlistBuddy -c "Print notarization-upload:RequestUUID" "$ALTOOL_LOG_PATH") @@ -100,7 +100,7 @@ do # We'll sleep 30 seconds before checking status, to give the altool server time to process the archive echo "Waiting 30 seconds for status" sleep 30 - xcrun altool --notarization-info "$ALTOOL_UUID" --username "$APPSTORECONNECT_USERNAME" --password @env:APPSTORECONNECT_PASSWORD --output-format xml > "$ALTOOL_LOG_PATH" || fail "altool failed" + xcrun altool --notarization-info "$ALTOOL_UUID" --username "$APPSTORECONNECT_USERNAME" --password @env:APPSTORECONNECT_PASSWORD --output-format xml > "$ALTOOL_LOG_PATH" || builder_die "altool failed" ALTOOL_STATUS=$(/usr/libexec/PlistBuddy -c "Print notarization-info:Status" "$ALTOOL_LOG_PATH") if [ "$ALTOOL_STATUS" == "success" ]; then ALTOOL_FINISHED=1 @@ -109,17 +109,17 @@ do cat "$ALTOOL_LOG_PATH" ALTOOL_LOG_URL=$(/usr/libexec/PlistBuddy -c "Print notarization-info:LogFileURL" "$ALTOOL_LOG_PATH") curl "$ALTOOL_LOG_URL" - fail "Notarization failed with $ALTOOL_STATUS; check log at $ALTOOL_LOG_PATH" + builder_die "Notarization failed with $ALTOOL_STATUS; check log at $ALTOOL_LOG_PATH" fi done -echo_heading "Notarization completed successfully. Review logs below for any warnings." +builder_heading "Notarization completed successfully. Review logs below for any warnings." cat "$ALTOOL_LOG_PATH" ALTOOL_LOG_URL=$(/usr/libexec/PlistBuddy -c "Print notarization-info:LogFileURL" "$ALTOOL_LOG_PATH") curl "$ALTOOL_LOG_URL" echo -echo_heading "Attempting to staple notarization to Install Keyman.app" -xcrun stapler staple "$TARGET_APP_PATH" || fail "stapler failed" +builder_heading "Attempting to staple notarization to Install Keyman.app" +xcrun stapler staple "$TARGET_APP_PATH" || builder_die "stapler failed" # Done. # Now, we can add "Install Keyman.app" to the .dmg for distribution! diff --git a/oem/firstvoices/android/app/build.gradle b/oem/firstvoices/android/app/build.gradle index aba0c1bb431f06937166a664e9a7fa43db99af6f..d03c5634ae7ee94771f6f161fb110b30c7f31b53 100644 --- a/oem/firstvoices/android/app/build.gradle +++ b/oem/firstvoices/android/app/build.gradle @@ -9,11 +9,7 @@ apply from: "$rootPath/version.gradle" android { compileSdkVersion 33 - - compileOptions { - sourceCompatibility = JavaVersion.VERSION_1_8 - targetCompatibility = JavaVersion.VERSION_1_8 - } + namespace="com.firstvoices.keyboards" defaultConfig { applicationId "com.firstvoices.keyboards" @@ -58,12 +54,24 @@ android { productFlavors { } + applicationVariants.all { variant -> + // Adjust output name to "firstvoices-${VERSION_MD}.apk" + variant.outputs.all { + outputFileName = "firstvoices-" + VERSION_MD + ".apk" + } + } lintOptions { disable 'MissingTranslation' lintConfig file("lint.xml") } } +java { + toolchain { + languageVersion.set(JavaLanguageVersion.of(11)) + } +} + // how to configure the sentry android gradle plugin sentry { // Disables or enables the automatic configuration of Native symbols diff --git a/oem/firstvoices/android/app/src/main/AndroidManifest.xml b/oem/firstvoices/android/app/src/main/AndroidManifest.xml index 40d4eb215ddd91a828ca1db6f52ddf3dd3128602..2249f303501b92295d6a54fe78f527baee307469 100644 --- a/oem/firstvoices/android/app/src/main/AndroidManifest.xml +++ b/oem/firstvoices/android/app/src/main/AndroidManifest.xml @@ -1,7 +1,6 @@ + xmlns:tools="http://schemas.android.com/tools"> diff --git a/oem/firstvoices/android/build.sh b/oem/firstvoices/android/build.sh index bcf0865c97fecd96f5a1bcad0037f0717046e251..75bcfc672a07ce01e6550c6191a1dddc6b119add 100755 --- a/oem/firstvoices/android/build.sh +++ b/oem/firstvoices/android/build.sh @@ -1,97 +1,104 @@ #!/usr/bin/env bash +# Build FirstVoices for Android app -# Set sensible script defaults: -# set -e: Terminate script if a command returns an error -set -e -# set -u: Terminate script if an unset variable is used -set -u -# set -x: Debugging use, print each statement # set -x +set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" + . "$KEYMAN_ROOT/resources/build/build-download-resources.sh" -display_usage ( ) { - echo "build.sh [-no-daemon] [-debug] [-no-update] [-lib-build|-no-lib-build] [-download-keyboards] [-h|-?]" - echo "Build $TARGET" - echo " -no-daemon Don't start the Gradle daemon. Use for CI" - echo " -debug Compile only Debug variant" - echo " -no-update Don't copy or build the Keyman Engine library in (assumes already present)" - echo " -lib-build Force rebuild of the Keyman Engine library" - echo " -no-lib-build Only rebuild the Keyman Engine library if it doesn't exist in /android" - echo " -download-resources Download fv_all.kmp from downloads.keyman.com" - echo " (dictionaries will be downloaded within the app)" - echo "" - exit 1 -} +# This script runs from its own folder +cd "$THIS_SCRIPT_PATH" + +# ################################ Main script ################################ + +# Definition of global compile constants + +CONFIG="release" +BUILD_FLAGS="build -x lint -x test" # Gradle build w/o test +TEST_FLAGS="-x assembleRelease lintRelease testRelease" # Gradle test w/o build +DAEMON_FLAG= + +builder_describe "Builds FirstVoices for Android app." \ + "@/android/KMEA" \ + "clean" \ + "configure" \ + "build" \ + "test Runs lint and tests." \ + "--ci Don't start the Gradle daemon. For CI" \ + "--upload-sentry Upload to sentry" + +# parse before describe_outputs to check debug flags +builder_parse "$@" -export TARGET=FirstVoices -KEYBOARD_PACKAGE_ID="fv_all" -KEYBOARDS_TARGET="$KEYMAN_ROOT/oem/firstvoices/android/app/src/main/assets/${KEYBOARD_PACKAGE_ID}.kmp" -KEYBOARDS_CSV="$KEYMAN_ROOT/oem/firstvoices/keyboards.csv" -KEYBOARDS_CSV_TARGET="$KEYMAN_ROOT/oem/firstvoices/android/app/src/main/assets/keyboards.csv" - -# This build script assumes that the https://github.com/keymanapp/keyboards repo is in -# the same parent folder as this repo, with the default name 'keyboards' - -PARAM_DEBUG= -PARAM_NO_DAEMON= -PARAM_NO_UPDATE= -PARAM_LIB_BUILD= -PARAM_NO_LIB_BUILD= -DO_KEYBOARDS_DOWNLOAD=false - -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - -download-resources) - DO_KEYBOARDS_DOWNLOAD=true - ;; - -h|-\?) - display_usage - ;; - -debug) - PARAM_DEBUG=-debug - ;; - -no-daemon) - PARAM_NO_DAEMON=-no-daemon - ;; - -no-update) - PARAM_NO_UDPATE=-no-update - ;; - -lib-build) - PARAM_LIB_BUILD=-lib-build - ;; - -no-lib-build|-lib-nobuild) - PARAM_NO_LIB_BUILD=-no-lib-build - ;; - esac - shift -done - -# Verify default keyboard package exists -if [[ ! -f "$KEYBOARDS_TARGET" || ! -f "$KEYBOARDS_CSV_TARGET" ]]; then - echo "$KEYBOARDS_TARGET and $KEYBOARDS_CSV_TARGET required. Will download the latest version" - DO_KEYBOARDS_DOWNLOAD=true +if builder_is_debug_build; then + builder_heading "### Debug config ####" + CONFIG="debug" + BUILD_FLAGS="assembleDebug -x lint -x test" + TEST_FLAGS="-x assembleDebug lintDebug testDebug" +fi + +ARTIFACT="firstvoices-$VERSION.apk" + +builder_describe_outputs \ + configure /oem/firstvoices/android/app/libs/keyman-engine.aar \ + build /oem/firstvoices/android/app/build/outputs/apk/$CONFIG/${ARTIFACT} + +#### Build + +# Parse args + +if builder_has_option --ci; then + DAEMON_FLAG=--no-daemon fi -if [ ! -z "$PARAM_LIB_BUILD" ] && [ ! -z "$PARAM_NO_LIB_BUILD" ]; then - echo "ERROR: Cannot set both -lib-build and -no-lib-build" - exit 1 +#### Build action definitions #### + +function makeLocalSentryRelease() { + echo "Placeholder for uploading symbols to Sentry" +} + +#### Build action definitions #### + +# Check about cleaning artifact paths +if builder_start_action clean; then + rm -rf "$KEYMAN_ROOT/oem/firstvoices/android/app/build/outputs" + builder_finish_action success clean fi -# Download default keyboard package -if [ "$DO_KEYBOARDS_DOWNLOAD" = true ]; then - echo "Copying keyboards.csv" - cp "$KEYBOARDS_CSV" "$KEYBOARDS_CSV_TARGET" +if builder_start_action configure; then + KEYBOARDS_CSV="$KEYMAN_ROOT/oem/firstvoices/keyboards.csv" + KEYBOARDS_CSV_TARGET="$KEYMAN_ROOT/oem/firstvoices/android/app/src/main/assets/keyboards.csv" + KEYBOARD_PACKAGE_ID="fv_all" + KEYBOARDS_TARGET="$KEYMAN_ROOT/oem/firstvoices/android/app/src/main/assets/${KEYBOARD_PACKAGE_ID}.kmp" + + cp "$KEYBOARDS_CSV" "$KEYBOARDS_CSV_TARGET" downloadKeyboardPackage "$KEYBOARD_PACKAGE_ID" "$KEYBOARDS_TARGET" + + builder_finish_action success configure fi -# TODO: in the future build_common.sh should probably be shared with all oem products? -./build_common.sh $PARAM_DEBUG $PARAM_NO_DAEMON $PARAM_NO_UPDATE $PARAM_LIB_BUILD $PARAM_NO_LIB_BUILD +if builder_start_action build; then + # Copy Keyman Engine for Android + cp "$KEYMAN_ROOT/android/KMEA/app/build/outputs/aar/keyman-engine-${CONFIG}.aar" "$KEYMAN_ROOT/oem/firstvoices/android/app/libs/keyman-engine.aar" + + echo "BUILD_FLAGS: $BUILD_FLAGS" + ./gradlew $DAEMON_FLAG clean $BUILD_FLAGS + + builder_finish_action success build +fi + +if builder_start_action test; then + echo "TEST_FLAGS: $TEST_FLAGS" + ./gradlew $DAEMON_FLAG $TEST_FLAGS + + builder_finish_action success test +fi diff --git a/oem/firstvoices/android/build_common.sh b/oem/firstvoices/android/build_common.sh deleted file mode 100755 index 8b843f9d0285a4e5042a2f299ec584d253a5b929..0000000000000000000000000000000000000000 --- a/oem/firstvoices/android/build_common.sh +++ /dev/null @@ -1,129 +0,0 @@ -#!/usr/bin/env bash - -# Set sensible script defaults: -# set -e: Terminate script if a command returns an error -set -e -# set -u: Terminate script if an unset variable is used -set -u -# set -x: Debugging use, print each statement -# set -x - -if [ -z "$TARGET" ]; then - exit 1 -fi - -display_usage ( ) { - echo "build_common.sh [-no-daemon] [-debug] [-no-update] [-lib-build|-no-lib-build]" - echo "Build $TARGET" - echo " -no-daemon Don't start the Gradle daemon. Use for CI" - echo " -debug Compile only Debug variant" - echo " -no-update Don't copy or build the Keyman Engine library in (assumes already present)" - echo " -lib-build Force rebuild of the Keyman Engine library" - echo " -no-lib-build Only rebuild the Keyman Engine library if it doesn't exist in /android" - exit 1 -} - -verify_KMEA ( ) { - KMEA_BUILD_EXISTS=true - [ -f "$KEYMAN_ENGINE_DST" ] || KMEA_BUILD_EXISTS=false -} - -echo Build $TARGET - -# -# Prevents 'clear' on exit of mingw64 bash shell -# -SHLVL=0 - -DO_UPDATE=true -FORCE_KMEA_BUILD=false -ALLOW_KMEA_BUILD=true -NO_DAEMON=false -ONLY_DEBUG=false - -# Parse args -while [[ $# -gt 0 ]] ; do - key="$1" - case $key in - -no-daemon) - NO_DAEMON=true - ;; - -debug) - ONLY_DEBUG=true - ;; - # Settings relating to engine build - -no-update) - DO_UPDATE=false - ALLOW_KMEA_BUILD=false - ;; - -lib-build) - FORCE_KMEA_BUILD=true - ;; - -lib-nobuild|-no-lib-build) - ALLOW_KMEA_BUILD=false - ;; - -h|-\?) - display_usage - ;; - esac - shift # past argument -done - -echo -echo "NO_DAEMON: $NO_DAEMON" -echo "ONLY_DEBUG: $ONLY_DEBUG" -echo "DO_UPDATE: $DO_UPDATE" -echo "ALLOW_KMEA_BUILD: $ALLOW_KMEA_BUILD" -echo "FORCE_KMEA_BUILD: $FORCE_KMEA_BUILD" -echo - -# The KMEA build script moves the final .aar from KMEA to KMAPro... -KMEA_BUILD_DIR=../../../android/KMEA/ -KEYMAN_ENGINE_SRC=../../../android/KMAPro/kMAPro/libs/keyman-engine.aar -KEYMAN_ENGINE_DST=app/libs/keyman-engine.aar - -# -# Build Keyman Engine -# - -if [ $DO_UPDATE = true ]; then - # Does a prior build of KMEA exist? - verify_KMEA - - if [ $ALLOW_KMEA_BUILD = true ] && [ $FORCE_KMEA_BUILD = false ] && [ $KMEA_BUILD_EXISTS = false ]; then - echo "Previous Keyman Engine build information is unavailable; rebuilding." - FORCE_KMEA_BUILD=true - fi - - if [ $FORCE_KMEA_BUILD = true ]; then - echo "Building Keyman Engine..." - pushd $KMEA_BUILD_DIR - ./build.sh "$@" - popd - fi - - verify_KMEA - - if ! [ $KMEA_BUILD_EXISTS ]; then - echo "Build failed: Could not build required Keyman Engine resources." - exit 1 - fi - - # Copy Keyman Engine aar to - cp "$KEYMAN_ENGINE_SRC" "$KEYMAN_ENGINE_DST" -fi - - -if [ "$NO_DAEMON" = true ]; then - DAEMON_FLAG=--no-daemon -else - DAEMON_FLAG= -fi - -if [ "$ONLY_DEBUG" = true ]; then - BUILD_FLAG=assembleDebug -else - BUILD_FLAG=build -fi - -./gradlew $DAEMON_FLAG clean $BUILD_FLAG diff --git a/oem/firstvoices/android/gradle/wrapper/gradle-wrapper.properties b/oem/firstvoices/android/gradle/wrapper/gradle-wrapper.properties index 41dfb87909a877d96c3af4adccce4c7a301b55a2..ae04661ee733431762e7ccf8ab9b7409ed44960c 100644 --- a/oem/firstvoices/android/gradle/wrapper/gradle-wrapper.properties +++ b/oem/firstvoices/android/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-7.5.1-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/oem/firstvoices/common/build_csv_languages.sh b/oem/firstvoices/common/build_csv_languages.sh index ed6562bc6e525ffc6cc8ae3c9ac92663fa1f308c..19e6ba06ed4512f9c83a50b71a07658302424997 100755 --- a/oem/firstvoices/common/build_csv_languages.sh +++ b/oem/firstvoices/common/build_csv_languages.sh @@ -10,8 +10,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/build/build-download-resources.sh" diff --git a/oem/firstvoices/common/build_keyboards.sh b/oem/firstvoices/common/build_keyboards.sh index c492d692722910e496f4f4edd3a2198bf9da94a4..4cac20ca565a58243376d84da5fd158ed467c96c 100755 --- a/oem/firstvoices/common/build_keyboards.sh +++ b/oem/firstvoices/common/build_keyboards.sh @@ -19,8 +19,8 @@ set -u ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/build/jq.inc.sh" @@ -29,11 +29,6 @@ THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BA # the same parent folder as this repo, with the default name 'keyboards' KEYBOARDS_ROOT="$KEYMAN_ROOT/../keyboards" -function die { - echo "FATAL: $1" - exit 99 -} - function display_usage { echo "Usage: build_keyboards.sh [-download-keyboards] [-copy-keyboards] [-clean-keyboards] [-debug] [-h|-?]" echo "Builds all keyboards used by the app and copies them into the" @@ -77,7 +72,7 @@ done # Check that $KEYBOARDS_TARGET is valid if [[ -z "$KEYBOARDS_TARGET" ]]; then - die "KEYBOARDS_TARGET cannot be empty" + builder_die "KEYBOARDS_TARGET cannot be empty" fi # Clean existing Keyboards folder @@ -113,7 +108,7 @@ if [ $DO_BUILD = true ] || [ $DO_COPY = true ]; then while IFS=, read -r shortname id name region old_keyboard; do if [ $DO_BUILD = true ]; then echo "Building $id ($name)" # $shortname/$id -> $name" - WINEDEBUG=fixme-nls,fixme-thread "./build.sh" release/$shortname/$id || die "Unable to build keyboard $shortname/$id" + WINEDEBUG=fixme-nls,fixme-thread "./build.sh" release/$shortname/$id || builder_die "Unable to build keyboard $shortname/$id" fi if [ $DO_COPY = true ]; then echo "Copying $id ($name) to $KEYBOARDS_TARGET" @@ -121,7 +116,6 @@ if [ $DO_BUILD = true ] || [ $DO_COPY = true ]; then unzip -o release/$shortname/$id/build/$id.kmp $id.js kmp.json -d "$SCRIPT_ROOT/$KEYBOARDS_TARGET/$id/" cp release/$shortname/$id/build/$id.keyboard_info "$SCRIPT_ROOT/$KEYBOARDS_TARGET/$id.keyboard_info" fi -# die "done" done } < "$SCRIPT_ROOT/../keyboards.csv" diff --git a/oem/firstvoices/ios/Cartfile b/oem/firstvoices/ios/Cartfile index ec3127efc7f8555f418ada6a1254f76698566929..10efbc3d5a00674b34fa904f3376c63c23b95f93 100644 --- a/oem/firstvoices/ios/Cartfile +++ b/oem/firstvoices/ios/Cartfile @@ -1,4 +1,4 @@ -github "DaveWoodCom/XCGLogger" ~> 6.1.0 +github "keymanapp/dependency-XCGLogger" "master" github "devicekit/DeviceKit" ~> 5.0 github "ashleymills/Reachability.swift" -github "getsentry/sentry-cocoa" ~> 6.2.1 +github "getsentry/sentry-cocoa" ~> 8.7.0 diff --git a/oem/firstvoices/ios/Cartfile.resolved b/oem/firstvoices/ios/Cartfile.resolved index 16cb6213b6c2f2a085fd61f59c813a6f2292ec3d..5ac3a55318988538f2f6e3ebf339ac837e43effd 100644 --- a/oem/firstvoices/ios/Cartfile.resolved +++ b/oem/firstvoices/ios/Cartfile.resolved @@ -1,4 +1,4 @@ -github "DaveWoodCom/XCGLogger" "6.1.0" github "ashleymills/Reachability.swift" "v5.1.0" github "devicekit/DeviceKit" "5.0.0" -github "getsentry/sentry-cocoa" "6.2.1" +github "getsentry/sentry-cocoa" "8.7.0" +github "keymanapp/dependency-XCGLogger" "57a7b975dbb6fe4fe90cef3d1bc52b8adbd89113" diff --git a/oem/firstvoices/ios/build_common.sh b/oem/firstvoices/ios/build_common.sh index a464d2b5a43d07e3d7066f22692cb897ce410bcc..04c5ee24cec91cb2bb7592447b349fbb3d06ed30 100755 --- a/oem/firstvoices/ios/build_common.sh +++ b/oem/firstvoices/ios/build_common.sh @@ -2,8 +2,8 @@ ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/../../../resources/build/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../../resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE # Include our resource functions; they're pretty useful! @@ -154,7 +154,7 @@ if [ $DO_UPDATE = true ]; then fi # Copy resources. - cp -Rf "$KEYMAN_ENGINE_FRAMEWORK_SRC" "$KEYMAN_ENGINE_FRAMEWORK_DST" + /bin/cp -Rf "$KEYMAN_ENGINE_FRAMEWORK_SRC" "$KEYMAN_ENGINE_FRAMEWORK_DST" fi # First things first - update our dependencies. @@ -163,11 +163,11 @@ if [ $DO_CARTHAGE = true ]; then echo echo "Load dependencies with Carthage" - carthage checkout || fail "Carthage dependency loading failed" + carthage checkout || builder_die "Carthage dependency loading failed" # --no-use-binaries: due to https://github.com/Carthage/Carthage/issues/3134, # which affects the sentry-cocoa dependency. - carthage build --use-xcframeworks --no-use-binaries --platform iOS || fail "Carthage dependency loading failed" + carthage build --use-xcframeworks --no-use-binaries --platform iOS || builder_die "Carthage dependency loading failed" fi # diff --git a/package-lock.json b/package-lock.json index 21273416fce1feb772ad8a946c66804a1ff872b3..20d7ce98c40cb837e61ec0faba6fead166bd9e02 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "root", - "lockfileVersion": 2, + "lockfileVersion": 3, "requires": true, "packages": { "": { @@ -8,100 +8,41 @@ "workspaces": [ "resources/gosh", "resources/build/version", - "developer/src/kmlmc", + "core/include/ldml", + "developer/src/common/web/test-helpers", + "developer/src/kmc-kmn", + "developer/src/kmc-ldml", + "developer/src/kmc-model", + "developer/src/kmc-model-info", + "developer/src/kmc-package", + "developer/src/kmc", "developer/src/server", "common/models/*", "common/tools/*", "common/web/*", "common/predictive-text", + "common/tools/hextobin", "web" ], - "devDependencies": { - "chai": "^4.3.4", - "mocha": "^10.0.0", - "mocha-teamcity-reporter": "^4.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" - } - }, - "common/core/web/input-processor": { - "name": "@keymanapp/input-processor", - "extraneous": true, - "license": "MIT", - "dependencies": { - "@keymanapp/keyboard-processor": "*", - "@keymanapp/keyman-version": "*", - "@keymanapp/lexical-model-layer": "*", - "@keymanapp/models-types": "*", - "@keymanapp/web-utils": "*", - "eventemitter3": "^4.0.0" - }, - "devDependencies": { - "@keymanapp/lexical-model-compiler": "*", - "@keymanapp/resources-gosh": "*", - "@types/node": "^11.9.4", - "chai": "^4.3.4", - "mocha": "^8.4.0", - "mocha-teamcity-reporter": "^4.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" - } - }, - "common/core/web/keyboard-processor": { - "name": "@keymanapp/keyboard-processor", - "extraneous": true, - "license": "MIT", "dependencies": { - "@keymanapp/keyman-version": "*", - "@keymanapp/models-types": "*", - "@keymanapp/web-utils": "*", - "@types/node": "^11.9.4" + "@keymanapp/common-types": "file:common/web/types", + "@keymanapp/developer-test-helpers": "file:developer/src/common/web/test-helpers", + "@keymanapp/hextobin": "file:common/tools/hextobin", + "@keymanapp/keyman-version": "file:common/web/keyman-version", + "@keymanapp/ldml-keyboard-constants": "file:core/include/ldml" }, "devDependencies": { - "@keymanapp/resources-gosh": "*", + "@typescript-eslint/eslint-plugin": "^5.59.1", "chai": "^4.3.4", - "mocha": "^8.4.0", + "eslint": "^8.39.0", + "eslint-config-standard-with-typescript": "^34.0.1", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-n": "^15.7.0", + "eslint-plugin-promise": "^6.1.1", + "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" - } - }, - "common/core/web/tools/recorder": { - "name": "@keymanapp/recorder-core", - "extraneous": true, - "license": "MIT", - "dependencies": { - "@keymanapp/keyboard-processor": "*", - "@keymanapp/keyman-version": "*", - "@keymanapp/models-types": "*", - "@keymanapp/web-utils": "*", - "@types/node": "^11.9.4" - }, - "devDependencies": { - "typescript": "^4.5.4" - } - }, - "common/core/web/tools/sentry-manager": { - "name": "@keymanapp/web-sentry-manager", - "extraneous": true, - "license": "MIT", - "dependencies": { - "@keymanapp/keyman-version": "*", - "@sentry/browser": "^5.27.4" - }, - "devDependencies": { - "typescript": "^4.5.4" - } - }, - "common/core/web/utils": { - "name": "@keymanapp/web-utils", - "extraneous": true, - "license": "MIT", - "devDependencies": { - "@keymanapp/keyman-version": "*", - "@keymanapp/resources-gosh": "*", - "@types/node": "^14.0.5", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" } }, "common/models/templates": { @@ -118,20 +59,19 @@ "@types/node": "^14.0.4", "chai": "^4.3.4", "mocha": "^10.0.0", - "typescript": "^4.5.4" + "typescript": "^4.9.5" } }, "common/models/templates/node_modules/@types/node": { "version": "14.18.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.12.tgz", - "integrity": "sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==", - "dev": true + "dev": true, + "license": "MIT" }, "common/models/types": { "name": "@keymanapp/models-types", "license": "MIT", "devDependencies": { - "typescript": "^4.5.4" + "typescript": "^4.9.5" } }, "common/models/wordbreakers": { @@ -146,14 +86,13 @@ "@types/mocha": "^7.0.2", "chai": "^4.3.4", "mocha": "^10.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" } }, "common/models/wordbreakers/node_modules/@types/node": { "version": "14.18.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.12.tgz", - "integrity": "sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==" + "license": "MIT" }, "common/predictive-text": { "name": "@keymanapp/lexical-model-layer", @@ -188,15 +127,39 @@ "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", "sinon": "^7.1.1", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" } }, "common/predictive-text/node_modules/@types/node": { "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "dev": true + "dev": true, + "license": "MIT" + }, + "common/tools/hextobin": { + "name": "@keymanapp/hextobin", + "license": "MIT", + "dependencies": { + "commander": "^5.1.0" + }, + "bin": { + "hextobin": "build/hextobin.js" + }, + "devDependencies": { + "@types/node": "^18.7.18" + } + }, + "common/tools/hextobin/node_modules/@types/node": { + "version": "18.11.15", + "dev": true, + "license": "MIT" + }, + "common/tools/hextobin/node_modules/commander": { + "version": "5.1.0", + "license": "MIT", + "engines": { + "node": ">= 6" + } }, "common/tools/sourcemap-path-remapper": { "name": "@keymanapp/sourcemap-path-remapper", @@ -211,24 +174,18 @@ "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", "sinon": "^7.1.1", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" } }, "common/tools/sourcemap-path-remapper/node_modules/@types/node": { "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "dev": true + "dev": true, + "license": "MIT" }, - "common/web/es6-shim": { - "name": "@keymanapp/es6-shim", - "extraneous": true, - "license": "MIT", - "dependencies": { - "es6-shim": "^0.35.5" - }, - "devDependencies": {} + "common/tools/sourcemap-path-remapper/node_modules/convert-source-map": { + "version": "2.0.0", + "license": "MIT" }, "common/web/input-processor": { "name": "@keymanapp/input-processor", @@ -242,14 +199,14 @@ "eventemitter3": "^4.0.0" }, "devDependencies": { - "@keymanapp/lexical-model-compiler": "*", + "@keymanapp/kmc": "*", "@keymanapp/resources-gosh": "*", "@types/node": "^11.9.4", "chai": "^4.3.4", "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" } }, "common/web/keyboard-processor": { @@ -266,39 +223,28 @@ "chai": "^4.3.4", "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" } }, "common/web/keyman-version": { "name": "@keymanapp/keyman-version", "license": "MIT", "devDependencies": { - "typescript": "^4.5.4" - } - }, - "common/web/keyman-version-node": { - "name": "@keymanapp/keyman-version-node", - "extraneous": true, - "license": "MIT", - "devDependencies": { - "typescript": "^4.5.4" + "@types/node": "^18.7.13", + "typescript": "^4.9.5" } }, - "common/web/keyman-version/node": { - "name": "@keymanapp/keyman-version-node", - "extraneous": true, - "license": "MIT", - "devDependencies": { - "@keymanapp/resources-gosh": "*", - "typescript": "^4.5.4" - } + "common/web/keyman-version/node_modules/@types/node": { + "version": "18.11.15", + "dev": true, + "license": "MIT" }, "common/web/lm-message-types": { "name": "@keymanapp/lm-message-types", "license": "MIT", "devDependencies": { - "typescript": "^4.5.4" + "typescript": "^4.9.5" } }, "common/web/lm-worker": { @@ -335,15 +281,14 @@ "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", "sinon": "^7.1.1", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5" } }, "common/web/lm-worker/node_modules/@types/node": { "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "dev": true + "dev": true, + "license": "MIT" }, "common/web/recorder": { "name": "@keymanapp/recorder-core", @@ -356,7 +301,7 @@ "@types/node": "^11.9.4" }, "devDependencies": { - "typescript": "^4.5.4" + "typescript": "^4.9.5" } }, "common/web/sentry-manager": { @@ -367,141 +312,64 @@ "@sentry/browser": "^5.27.4" }, "devDependencies": { - "typescript": "^4.5.4" - } - }, - "common/web/utils": { - "name": "@keymanapp/web-utils", - "license": "MIT", - "devDependencies": { - "@keymanapp/keyman-version": "*", - "@keymanapp/resources-gosh": "*", - "@types/node": "^14.0.5", - "typescript": "^4.5.4" + "typescript": "^4.9.5" } }, - "common/web/utils/node_modules/@types/node": { - "version": "14.18.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.18.tgz", - "integrity": "sha512-B9EoJFjhqcQ9OmQrNorItO+OwEOORNn3S31WuiHvZY/dm9ajkB7AKD/8toessEtHHNL+58jofbq7hMMY9v4yig==", - "dev": true - }, - "developer/js": { - "name": "@keymanapp/lexical-model-compiler", - "extraneous": true, + "common/web/types": { + "name": "@keymanapp/common-types", "license": "MIT", "dependencies": { - "@keymanapp/models-types": "*", - "commander": "^3.0.0", - "typescript": "^4.5.4", - "xml2js": "^0.4.19" - }, - "bin": { - "kmlmc": "dist/kmlmc.js", - "kmlmi": "dist/kmlmi.js", - "kmlmp": "dist/kmlmp.js" + "@keymanapp/keyman-version": "*", + "ajv": "^8.11.0", + "restructure": "git+https://github.com/keymanapp/dependency-restructure.git#49d129cf0916d082a7278bb09296fb89cecfcc50", + "semver": "^7.3.7", + "xml2js": "git+https://github.com/keymanapp/dependency-node-xml2js#535fe732dc408d697e0f847c944cc45f0baf0829" }, "devDependencies": { - "@keymanapp/keyman-version": "*", - "@keymanapp/models-templates": "*", - "@keymanapp/models-wordbreakers": "*", "@types/chai": "^4.1.7", + "@types/git-diff": "^2.0.3", "@types/mocha": "^5.2.7", "@types/node": "^10.14.6", + "@types/semver": "^7.3.12", "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", "chai": "^4.3.4", "chalk": "^2.4.2", - "jszip": "^3.7.0", + "git-diff": "^2.0.6", + "hexy": "^0.3.4", "mocha": "^8.4.0", - "ts-node": "^9.1.1" - }, - "engines": { - "node": ">=16.0.0" + "ts-node": "^9.1.1", + "typescript": "^4.9.5" } }, - "developer/server": { - "name": "@keymanapp/developer-server", - "extraneous": true, - "license": "MIT", - "dependencies": { - "@sentry/node": "^6.16.1", - "chalk": "^4.1.2", - "express": "^4.17.2", - "multer": "^1.4.4", - "ngrok": "^4.2.2", - "open": "^8.4.0", - "ws": "^8.3.0" - }, - "devDependencies": { - "@keymanapp/keyman-version": "*", - "@keymanapp/resources-gosh": "*", - "@types/chai": "^4.3.0", - "@types/express": "^4.17.13", - "@types/mocha": "^9.1.0", - "@types/multer": "^1.4.7", - "@types/node": "^17.0.0", - "@types/ws": "^8.2.2", - "chai": "^4.3.4", - "copyfiles": "^2.4.1", - "mocha": "^9.1.4", - "ts-node": "^10.4.0", - "tsc-watch": "^4.5.0", - "typescript": "^4.5.4" - }, - "optionalDependencies": { - "hetrodo-node-hide-console-window-napi": "git+ssh://git@github.com/keymanapp/hetrodo-node-hide-console-window-napi.git#858b23036a9963b40ad6ff3c5bacd421e5839b92", - "node-windows-trayicon": "git+ssh://git@github.com/keymanapp/node-windows-trayicon.git#1e46786082213f3edcddd5953e33f5abdc7ea05f" - } + "common/web/types/node_modules/@types/mocha": { + "version": "5.2.7", + "dev": true, + "license": "MIT" + }, + "common/web/types/node_modules/@types/node": { + "version": "10.17.60", + "dev": true, + "license": "MIT" }, - "developer/src/kmlmc": { - "name": "@keymanapp/lexical-model-compiler", + "common/web/types/node_modules/ajv": { + "version": "8.11.2", "license": "MIT", "dependencies": { - "@keymanapp/keyman-version": "*", - "@keymanapp/models-types": "*", - "commander": "^3.0.0", - "typescript": "^4.5.4", - "xml2js": "^0.4.19" - }, - "bin": { - "kmlmc": "dist/kmlmc.js", - "kmlmi": "dist/kmlmi.js", - "kmlmp": "dist/kmlmp.js" - }, - "devDependencies": { - "@keymanapp/models-templates": "*", - "@keymanapp/models-wordbreakers": "*", - "@types/chai": "^4.1.7", - "@types/mocha": "^5.2.7", - "@types/node": "^10.14.6", - "@types/xml2js": "^0.4.5", - "chai": "^4.3.4", - "chalk": "^2.4.2", - "jszip": "^3.7.0", - "mocha": "^10.0.0", - "ts-node": "^9.1.1" + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" }, - "engines": { - "node": ">=16.0.0" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "developer/src/kmlmc/node_modules/@types/mocha": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", - "dev": true - }, - "developer/src/kmlmc/node_modules/@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "dev": true - }, - "developer/src/kmlmc/node_modules/ansi-styles": { + "common/web/types/node_modules/ansi-styles": { "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, + "license": "MIT", "dependencies": { "color-convert": "^1.9.0" }, @@ -509,11 +377,10 @@ "node": ">=4" } }, - "developer/src/kmlmc/node_modules/chalk": { + "common/web/types/node_modules/chalk": { "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "license": "MIT", "dependencies": { "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", @@ -523,167 +390,164 @@ "node": ">=4" } }, - "developer/src/kmlmc/node_modules/color-convert": { + "common/web/types/node_modules/color-convert": { "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, + "license": "MIT", "dependencies": { "color-name": "1.1.3" } }, - "developer/src/kmlmc/node_modules/color-name": { + "common/web/types/node_modules/color-name": { "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true + "dev": true, + "license": "MIT" }, - "developer/src/kmlmc/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "common/web/types/node_modules/js-yaml": { + "version": "4.0.0", "dev": true, - "engines": { - "node": ">=4" + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "developer/src/kmlmc/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "common/web/types/node_modules/json-schema-traverse": { + "version": "1.0.0", + "license": "MIT" + }, + "common/web/types/node_modules/minimatch": { + "version": "3.0.4", "dev": true, + "license": "ISC", "dependencies": { - "has-flag": "^3.0.0" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">=4" + "node": "*" } }, - "developer/src/server": { - "name": "@keymanapp/developer-server", + "common/web/types/node_modules/mocha": { + "version": "8.4.0", + "dev": true, "license": "MIT", "dependencies": { - "@sentry/node": "^6.16.1", - "chalk": "^4.1.2", - "express": "^4.17.2", - "multer": "^1.4.5-lts.1", - "ngrok": "^4.2.2", - "open": "^8.4.0", - "ws": "^8.3.0" - }, - "devDependencies": { - "@keymanapp/keyman-version": "*", - "@keymanapp/resources-gosh": "*", - "@types/chai": "^4.3.0", - "@types/express": "^4.17.13", - "@types/mocha": "^9.1.0", - "@types/multer": "^1.4.7", - "@types/node": "^17.0.0", - "@types/ws": "^8.2.2", - "chai": "^4.3.4", - "copyfiles": "^2.4.1", - "mocha": "^10.0.0", - "ts-node": "^10.4.0", - "tsc-watch": "^4.5.0", - "typescript": "^4.5.4" + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.1", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.0.0", + "log-symbols": "4.0.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.20", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.1.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" }, - "optionalDependencies": { - "hetrodo-node-hide-console-window-napi": "git+ssh://git@github.com/keymanapp/hetrodo-node-hide-console-window-napi.git#858b23036a9963b40ad6ff3c5bacd421e5839b92", - "node-windows-trayicon": "git+ssh://git@github.com/keymanapp/node-windows-trayicon.git#1e46786082213f3edcddd5953e33f5abdc7ea05f" + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 10.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, - "developer/src/server/node_modules/@types/mocha": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", - "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", - "dev": true - }, - "developer/src/server/node_modules/@types/node": { - "version": "17.0.45", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", - "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", - "dev": true + "common/web/types/node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "developer/src/server/node_modules/busboy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", + "common/web/types/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "dev": true, + "license": "MIT", "dependencies": { - "streamsearch": "^1.1.0" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=10.16.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "developer/src/server/node_modules/multer": { - "version": "1.4.5-lts.1", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", - "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", + "common/web/types/node_modules/ms": { + "version": "2.1.3", + "dev": true, + "license": "MIT" + }, + "common/web/types/node_modules/supports-color": { + "version": "5.5.0", + "dev": true, + "license": "MIT", "dependencies": { - "append-field": "^1.0.0", - "busboy": "^1.0.0", - "concat-stream": "^1.5.2", - "mkdirp": "^0.5.4", - "object-assign": "^4.1.1", - "type-is": "^1.6.4", - "xtend": "^4.0.0" + "has-flag": "^3.0.0" }, "engines": { - "node": ">= 6.0.0" + "node": ">=4" } }, - "developer/src/server/node_modules/streamsearch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==", + "common/web/types/node_modules/supports-color/node_modules/has-flag": { + "version": "3.0.0", + "dev": true, + "license": "MIT", "engines": { - "node": ">=10.0.0" + "node": ">=4" } }, - "developer/src/server/node_modules/ts-node": { - "version": "10.8.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.1.tgz", - "integrity": "sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g==", + "common/web/types/node_modules/ts-node": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", "dev": true, "dependencies": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", "arg": "^4.1.0", "create-require": "^1.1.0", "diff": "^4.0.1", "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", + "source-map-support": "^0.5.17", "yn": "3.1.1" }, "bin": { "ts-node": "dist/bin.js", - "ts-node-cwd": "dist/bin-cwd.js", - "ts-node-esm": "dist/bin-esm.js", "ts-node-script": "dist/bin-script.js", "ts-node-transpile-only": "dist/bin-transpile.js", "ts-script": "dist/bin-script-deprecated.js" }, + "engines": { + "node": ">=10.0.0" + }, "peerDependencies": { - "@swc/core": ">=1.2.50", - "@swc/wasm": ">=1.2.50", - "@types/node": "*", "typescript": ">=2.7" - }, - "peerDependenciesMeta": { - "@swc/core": { - "optional": true - }, - "@swc/wasm": { - "optional": true - } } }, - "developer/src/server/node_modules/ts-node/node_modules/diff": { + "common/web/types/node_modules/ts-node/node_modules/diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", @@ -692,4649 +556,4629 @@ "node": ">=0.3.1" } }, - "node_modules/@actions/core": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz", - "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==", - "dependencies": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" + "common/web/utils": { + "name": "@keymanapp/web-utils", + "license": "MIT", + "devDependencies": { + "@keymanapp/keyman-version": "*", + "@keymanapp/resources-gosh": "*", + "@types/node": "^14.0.5", + "typescript": "^4.9.5" } }, - "node_modules/@actions/github": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@actions/github/-/github-2.2.0.tgz", - "integrity": "sha512-9UAZqn8ywdR70n3GwVle4N8ALosQs4z50N7XMXrSTUVOmVpaBC5kE3TRTT7qQdi3OaQV24mjGuJZsHUmhD+ZXw==", - "dependencies": { - "@actions/http-client": "^1.0.3", - "@octokit/graphql": "^4.3.1", - "@octokit/rest": "^16.43.1" - } + "common/web/utils/node_modules/@types/node": { + "version": "14.18.18", + "dev": true, + "license": "MIT" }, - "node_modules/@actions/github/node_modules/@actions/http-client": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", - "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", - "dependencies": { - "tunnel": "0.0.6" - } + "core/include/ldml": { + "name": "@keymanapp/ldml-keyboard-constants", + "license": "MIT" }, - "node_modules/@actions/http-client": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", - "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", + "developer/src/common/web/test-helpers": { + "name": "@keymanapp/developer-test-helpers", + "license": "MIT", "dependencies": { - "tunnel": "^0.0.6" + "@keymanapp/common-types": "*" + }, + "devDependencies": { + "@types/node": "^10.14.6", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" } }, - "node_modules/@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", + "developer/src/common/web/test-helpers/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", + "dev": true + }, + "developer/src/common/web/test-helpers/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, "engines": { - "node": ">=0.1.90" + "node": ">=0.3.1" } }, - "node_modules/@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "developer/src/common/web/test-helpers/node_modules/ts-node": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", "dev": true, "dependencies": { - "@jridgewell/trace-mapping": "0.3.9" + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" }, "engines": { - "node": ">=12" + "node": ">=10.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" } }, - "node_modules/@jridgewell/resolve-uri": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", - "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", - "dev": true, - "engines": { - "node": ">=6.0.0" + "developer/src/kmc": { + "name": "@keymanapp/kmc", + "license": "MIT", + "dependencies": { + "@keymanapp/common-types": "*", + "@keymanapp/keyman-version": "*", + "@keymanapp/kmc-kmn": "*", + "@keymanapp/kmc-ldml": "*", + "@keymanapp/kmc-model": "*", + "@keymanapp/kmc-model-info": "*", + "@keymanapp/kmc-package": "*", + "@keymanapp/models-types": "*", + "commander": "^10.0.0" + }, + "bin": { + "kmc": "build/src/kmc.js", + "kmlmc": "build/src/kmlmc.js", + "kmlmi": "build/src/kmlmi.js", + "kmlmp": "build/src/kmlmp.js" + }, + "devDependencies": { + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "esbuild": "^0.15.8", + "mocha": "^8.4.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" } }, - "node_modules/@jridgewell/sourcemap-codec": { - "version": "1.4.13", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", - "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", - "dev": true + "developer/src/kmc-keyboard": { + "name": "@keymanapp/kmc-keyboard", + "extraneous": true, + "license": "MIT", + "dependencies": { + "@keymanapp/keyman-version": "*", + "@keymanapp/ldml-keyboard-constants": "*", + "ajv": "^8.11.0", + "restructure": "git+https://github.com/keymanapp/dependency-restructure.git#49d129cf0916d082a7278bb09296fb89cecfcc50", + "semver": "^7.3.7", + "xml2js": "git+https://github.com/keymanapp/dependency-node-xml2js#535fe732dc408d697e0f847c944cc45f0baf0829" + }, + "devDependencies": { + "@keymanapp/developer-test-helpers": "*", + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/semver": "^7.3.12", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "mocha": "^8.4.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" + } }, - "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", - "dev": true, + "developer/src/kmc-kmn": { + "name": "@keymanapp/kmc-kmn", + "license": "MIT", "dependencies": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "@keymanapp/keyman-version": "*" + }, + "devDependencies": { + "@keymanapp/developer-test-helpers": "*", + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/semver": "^7.3.12", + "@types/sinon": "^10.0.13", + "@types/sinon-chai": "^3.2.9", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "mocha": "^8.4.0", + "sinon": "^15.0.2", + "sinon-chai": "^3.7.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" } }, - "node_modules/@keymanapp/auto-history-action": { - "resolved": "resources/build/version", - "link": true + "developer/src/kmc-kmn/node_modules/@sinonjs/commons": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-3.0.0.tgz", + "integrity": "sha512-jXBtWAF4vmdNmZgD5FoKsVLv3rPgDnLgPbU84LIJ3otV44vJlDRokVng5v8NFJdCf/da9legHcKaRuZs4L7faA==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } }, - "node_modules/@keymanapp/developer-server": { - "resolved": "developer/src/server", - "link": true + "developer/src/kmc-kmn/node_modules/@sinonjs/samsam": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-7.0.1.tgz", + "integrity": "sha512-zsAk2Jkiq89mhZovB2LLOdTCxJF4hqqTToGP0ASWlhp4I1hqOjcfmZGafXntCN7MDC6yySH0mFHrYtHceOeLmw==", + "dev": true, + "dependencies": { + "@sinonjs/commons": "^2.0.0", + "lodash.get": "^4.4.2", + "type-detect": "^4.0.8" + } }, - "node_modules/@keymanapp/input-processor": { - "resolved": "common/web/input-processor", - "link": true - }, - "node_modules/@keymanapp/keyboard-processor": { - "resolved": "common/web/keyboard-processor", - "link": true - }, - "node_modules/@keymanapp/keyman-version": { - "resolved": "common/web/keyman-version", - "link": true - }, - "node_modules/@keymanapp/lexical-model-compiler": { - "resolved": "developer/src/kmlmc", - "link": true - }, - "node_modules/@keymanapp/lexical-model-layer": { - "resolved": "common/predictive-text", - "link": true - }, - "node_modules/@keymanapp/lm-message-types": { - "resolved": "common/web/lm-message-types", - "link": true - }, - "node_modules/@keymanapp/lm-worker": { - "resolved": "common/web/lm-worker", - "link": true - }, - "node_modules/@keymanapp/models-templates": { - "resolved": "common/models/templates", - "link": true + "developer/src/kmc-kmn/node_modules/@sinonjs/samsam/node_modules/@sinonjs/commons": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", + "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } }, - "node_modules/@keymanapp/models-types": { - "resolved": "common/models/types", - "link": true + "developer/src/kmc-kmn/node_modules/@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "dev": true }, - "node_modules/@keymanapp/models-wordbreakers": { - "resolved": "common/models/wordbreakers", - "link": true + "developer/src/kmc-kmn/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", + "dev": true }, - "node_modules/@keymanapp/recorder-core": { - "resolved": "common/web/recorder", - "link": true + "developer/src/kmc-kmn/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } }, - "node_modules/@keymanapp/resources-gosh": { - "resolved": "resources/gosh", - "link": true + "developer/src/kmc-kmn/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } }, - "node_modules/@keymanapp/sourcemap-path-remapper": { - "resolved": "common/tools/sourcemap-path-remapper", - "link": true + "developer/src/kmc-kmn/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "dependencies": { + "color-name": "1.1.3" + } }, - "node_modules/@keymanapp/web-sentry-manager": { - "resolved": "common/web/sentry-manager", - "link": true + "developer/src/kmc-kmn/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true }, - "node_modules/@keymanapp/web-utils": { - "resolved": "common/web/utils", - "link": true + "developer/src/kmc-kmn/node_modules/isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha512-D2S+3GLxWH+uhrNEcoh/fnmYeP8E8/zHl644d/jdA0g2uyXvy3sb0qxotE+ne0LtccHknQzWwZEzhak7oJ0COQ==", + "dev": true }, - "node_modules/@octokit/auth-token": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", - "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", + "developer/src/kmc-kmn/node_modules/js-yaml": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", + "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", + "dev": true, "dependencies": { - "@octokit/types": "^6.0.3" + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@octokit/core": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz", - "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", - "peer": true, + "developer/src/kmc-kmn/node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, "dependencies": { - "@octokit/auth-token": "^2.4.4", - "@octokit/graphql": "^4.5.8", - "@octokit/request": "^5.6.3", - "@octokit/request-error": "^2.0.5", - "@octokit/types": "^6.0.3", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "node_modules/@octokit/endpoint": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", - "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", + "developer/src/kmc-kmn/node_modules/mocha": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", + "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", + "dev": true, "dependencies": { - "@octokit/types": "^6.0.3", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.1", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.0.0", + "log-symbols": "4.0.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.20", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.1.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 10.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, - "node_modules/@octokit/graphql": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", - "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", + "developer/src/kmc-kmn/node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "developer/src/kmc-kmn/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, "dependencies": { - "@octokit/request": "^5.6.0", - "@octokit/types": "^6.0.3", - "universal-user-agent": "^6.0.0" + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/@octokit/openapi-types": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz", - "integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==" + "developer/src/kmc-kmn/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true }, - "node_modules/@octokit/plugin-paginate-rest": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz", - "integrity": "sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==", + "developer/src/kmc-kmn/node_modules/nise": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/nise/-/nise-5.1.4.tgz", + "integrity": "sha512-8+Ib8rRJ4L0o3kfmyVCL7gzrohyDe0cMFTBa2d364yIrEGMEoetznKJx899YxjybU6bL9SQkYPSBBs1gyYs8Xg==", + "dev": true, "dependencies": { - "@octokit/types": "^2.0.1" + "@sinonjs/commons": "^2.0.0", + "@sinonjs/fake-timers": "^10.0.2", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "path-to-regexp": "^1.7.0" } }, - "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", + "developer/src/kmc-kmn/node_modules/nise/node_modules/@sinonjs/commons": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", + "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "dev": true, "dependencies": { - "@types/node": ">= 8" + "type-detect": "4.0.8" } }, - "node_modules/@octokit/plugin-request-log": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", - "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", - "peerDependencies": { - "@octokit/core": ">=3" + "developer/src/kmc-kmn/node_modules/path-to-regexp": { + "version": "1.8.0", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", + "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", + "dev": true, + "dependencies": { + "isarray": "0.0.1" } }, - "node_modules/@octokit/plugin-rest-endpoint-methods": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz", - "integrity": "sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==", + "developer/src/kmc-kmn/node_modules/sinon": { + "version": "15.0.2", + "resolved": "https://registry.npmjs.org/sinon/-/sinon-15.0.2.tgz", + "integrity": "sha512-PCVP63XZkg0/LOqQH5rEU4LILuvTFMb5tNxTHfs6VUMNnZz2XrnGSTZbAGITjzwQWbl/Bl/8hi4G3zZWjyBwHg==", + "dev": true, "dependencies": { - "@octokit/types": "^2.0.1", - "deprecation": "^2.3.1" + "@sinonjs/commons": "^3.0.0", + "@sinonjs/fake-timers": "^10.0.2", + "@sinonjs/samsam": "^7.0.1", + "diff": "^5.1.0", + "nise": "^5.1.4", + "supports-color": "^7.2.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/sinon" } }, - "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", - "dependencies": { - "@types/node": ">= 8" + "developer/src/kmc-kmn/node_modules/sinon/node_modules/diff": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-5.1.0.tgz", + "integrity": "sha512-D+mk+qE8VC/PAUrlAU34N+VfXev0ghe5ywmpqrawphmVZc1bEfn56uo9qpyGp1p4xpzOHkSW4ztBd6L7Xx4ACw==", + "dev": true, + "engines": { + "node": ">=0.3.1" } }, - "node_modules/@octokit/request": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz", - "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", + "developer/src/kmc-kmn/node_modules/sinon/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, "dependencies": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.1.0", - "@octokit/types": "^6.16.1", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "node_modules/@octokit/request-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", - "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", + "developer/src/kmc-kmn/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, "dependencies": { - "@octokit/types": "^6.0.3", - "deprecation": "^2.0.0", - "once": "^1.4.0" + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@octokit/rest": { - "version": "16.43.2", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.2.tgz", - "integrity": "sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ==", - "dependencies": { - "@octokit/auth-token": "^2.4.0", - "@octokit/plugin-paginate-rest": "^1.1.1", - "@octokit/plugin-request-log": "^1.0.0", - "@octokit/plugin-rest-endpoint-methods": "2.4.0", - "@octokit/request": "^5.2.0", - "@octokit/request-error": "^1.0.2", - "atob-lite": "^2.0.0", - "before-after-hook": "^2.0.0", - "btoa-lite": "^1.0.0", - "deprecation": "^2.0.0", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", - "lodash.uniq": "^4.5.0", - "octokit-pagination-methods": "^1.1.0", - "once": "^1.4.0", - "universal-user-agent": "^4.0.0" + "developer/src/kmc-kmn/node_modules/supports-color/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "dev": true, + "engines": { + "node": ">=4" } }, - "node_modules/@octokit/rest/node_modules/@octokit/request-error": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz", - "integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==", + "developer/src/kmc-kmn/node_modules/ts-node": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", + "dev": true, "dependencies": { - "@octokit/types": "^2.0.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" } }, - "node_modules/@octokit/rest/node_modules/@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", - "dependencies": { - "@types/node": ">= 8" + "developer/src/kmc-kmn/node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" } }, - "node_modules/@octokit/rest/node_modules/universal-user-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz", - "integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==", + "developer/src/kmc-ldml": { + "license": "MIT", "dependencies": { - "os-name": "^3.1.0" + "@keymanapp/keyman-version": "*", + "@keymanapp/ldml-keyboard-constants": "*", + "ajv": "^8.11.0", + "restructure": "git+https://github.com/keymanapp/dependency-restructure.git#49d129cf0916d082a7278bb09296fb89cecfcc50", + "semver": "^7.3.7", + "xml2js": "git+https://github.com/keymanapp/dependency-node-xml2js#535fe732dc408d697e0f847c944cc45f0baf0829" + }, + "devDependencies": { + "@keymanapp/developer-test-helpers": "*", + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/semver": "^7.3.12", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "mocha": "^8.4.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" } }, - "node_modules/@octokit/types": { - "version": "6.34.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", - "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", - "dependencies": { - "@octokit/openapi-types": "^11.2.0" - } + "developer/src/kmc-ldml/node_modules/@types/mocha": { + "version": "5.2.7", + "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", + "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", + "dev": true }, - "node_modules/@sentry/browser": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.30.0.tgz", - "integrity": "sha512-rOb58ZNVJWh1VuMuBG1mL9r54nZqKeaIlwSlvzJfc89vyfd7n6tQ1UXMN383QBz/MS5H5z44Hy5eE+7pCrYAfw==", + "developer/src/kmc-ldml/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", + "dev": true + }, + "developer/src/kmc-ldml/node_modules/ajv": { + "version": "8.12.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.12.0.tgz", + "integrity": "sha512-sRu1kpcO9yLtYxBKvqfTeh9KzZEwO3STyX1HT+4CaDzC6HpTGYhIhPIzj9XuKU7KYDwnaeh5hcOwjy1QuJzBPA==", "dependencies": { - "@sentry/core": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" }, - "engines": { - "node": ">=6" + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/@sentry/cli": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.2.0.tgz", - "integrity": "sha512-ywFtB8VHyWN248LuM67fsRtdMLif/SOHYY3zyef5WybvnAmRLDmGTWK//hSUCebsHBpehRIkmt4iMiyUXwgd5w==", + "developer/src/kmc-ldml/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, - "hasInstallScript": true, "dependencies": { - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.7", - "npmlog": "^6.0.1", - "progress": "^2.0.3", - "proxy-from-env": "^1.1.0", - "which": "^2.0.2" - }, - "bin": { - "sentry-cli": "bin/sentry-cli" + "color-convert": "^1.9.0" }, "engines": { - "node": ">= 12" + "node": ">=4" } }, - "node_modules/@sentry/cli/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "developer/src/kmc-ldml/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/@sentry/cli/node_modules/are-we-there-yet": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", - "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", + "developer/src/kmc-ldml/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16" + "color-name": "1.1.3" } }, - "node_modules/@sentry/cli/node_modules/gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "developer/src/kmc-ldml/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "dev": true + }, + "developer/src/kmc-ldml/node_modules/js-yaml": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.0.0.tgz", + "integrity": "sha512-pqon0s+4ScYUvX30wxQi3PogGFAlUyH0awepWvwkj4jD4v+ova3RiYw8bmA6x2rDrEaj8i/oWKoRxpVNW+Re8Q==", "dev": true, "dependencies": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" + "argparse": "^2.0.1" }, - "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@sentry/cli/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==", + "developer/src/kmc-ldml/node_modules/json-schema-traverse": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz", + "integrity": "sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==" + }, + "developer/src/kmc-ldml/node_modules/minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, + "dependencies": { + "brace-expansion": "^1.1.7" + }, "engines": { - "node": ">=8" + "node": "*" } }, - "node_modules/@sentry/cli/node_modules/npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "developer/src/kmc-ldml/node_modules/mocha": { + "version": "8.4.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-8.4.0.tgz", + "integrity": "sha512-hJaO0mwDXmZS4ghXsvPVriOhsxQ7ofcpQdm8dE+jISUOKopitvnXFQmpRR7jd2K6VBG6E26gU3IAbXXGIbu4sQ==", "dev": true, "dependencies": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.1", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.0.0", + "log-symbols": "4.0.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.20", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.1.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" }, "engines": { - "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + "node": ">= 10.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, - "node_modules/@sentry/cli/node_modules/readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "developer/src/kmc-ldml/node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, "engines": { - "node": ">= 6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@sentry/cli/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "developer/src/kmc-ldml/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/@sentry/cli/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "developer/src/kmc-ldml/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true + }, + "developer/src/kmc-ldml/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.1" + "has-flag": "^3.0.0" }, "engines": { - "node": ">=8" + "node": ">=4" } }, - "node_modules/@sentry/cli/node_modules/wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "developer/src/kmc-ldml/node_modules/supports-color/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", "dev": true, - "dependencies": { - "string-width": "^1.0.2 || 2 || 3 || 4" + "engines": { + "node": ">=4" } }, - "node_modules/@sentry/core": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", - "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", + "developer/src/kmc-ldml/node_modules/ts-node": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", + "dev": true, "dependencies": { - "@sentry/hub": "5.30.0", - "@sentry/minimal": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" }, "engines": { - "node": ">=6" + "node": ">=10.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" } }, - "node_modules/@sentry/hub": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", - "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", - "dependencies": { - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" - }, + "developer/src/kmc-ldml/node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=0.3.1" } }, - "node_modules/@sentry/minimal": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", - "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", + "developer/src/kmc-model": { + "name": "@keymanapp/kmc-model", + "license": "MIT", "dependencies": { - "@sentry/hub": "5.30.0", - "@sentry/types": "5.30.0", - "tslib": "^1.9.3" + "@keymanapp/common-types": "*", + "@keymanapp/keyman-version": "*", + "@keymanapp/models-types": "*", + "typescript": "^4.9.5", + "xml2js": "^0.4.19" }, - "engines": { - "node": ">=6" + "devDependencies": { + "@keymanapp/developer-test-helpers": "*", + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "esbuild": "^0.15.7", + "mocha": "^10.0.0", + "ts-node": "^10.9.1" } }, - "node_modules/@sentry/node": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-6.19.6.tgz", - "integrity": "sha512-kHQMfsy40ZxxdS9zMPmXCOOLWOJbQj6/aVSHt/L1QthYcgkAi7NJQNXnQIPWQDe8eP3DfNIWM7dc446coqjXrQ==", + "developer/src/kmc-model-info": { + "name": "@keymanapp/kmc-model-info", + "license": "MIT", "dependencies": { - "@sentry/core": "6.19.6", - "@sentry/hub": "6.19.6", - "@sentry/types": "6.19.6", - "@sentry/utils": "6.19.6", - "cookie": "^0.4.1", - "https-proxy-agent": "^5.0.0", - "lru_map": "^0.3.3", - "tslib": "^1.9.3" + "@keymanapp/common-types": "*", + "@keymanapp/models-types": "*" }, - "engines": { - "node": ">=6" + "devDependencies": { + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "@types/xml2js": "^0.4.5", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "mocha": "^8.4.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" } }, - "node_modules/@sentry/node/node_modules/@sentry/core": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.19.6.tgz", - "integrity": "sha512-biEotGRr44/vBCOegkTfC9rwqaqRKIpFljKGyYU6/NtzMRooktqOhjmjmItNCMRknArdeaQwA8lk2jcZDXX3Og==", + "developer/src/kmc-model-info/node_modules/@types/mocha": { + "version": "5.2.7", + "dev": true, + "license": "MIT" + }, + "developer/src/kmc-model-info/node_modules/@types/node": { + "version": "10.17.60", + "dev": true, + "license": "MIT" + }, + "developer/src/kmc-model-info/node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", "dependencies": { - "@sentry/hub": "6.19.6", - "@sentry/minimal": "6.19.6", - "@sentry/types": "6.19.6", - "@sentry/utils": "6.19.6", - "tslib": "^1.9.3" + "color-convert": "^1.9.0" }, "engines": { - "node": ">=6" + "node": ">=4" } }, - "node_modules/@sentry/node/node_modules/@sentry/hub": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.19.6.tgz", - "integrity": "sha512-PuEOBZxvx3bjxcXmWWZfWXG+orojQiWzv9LQXjIgroVMKM/GG4QtZbnWl1hOckUj7WtKNl4hEGO2g/6PyCV/vA==", + "developer/src/kmc-model-info/node_modules/chalk": { + "version": "2.4.2", + "dev": true, + "license": "MIT", "dependencies": { - "@sentry/types": "6.19.6", - "@sentry/utils": "6.19.6", - "tslib": "^1.9.3" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { - "node": ">=6" + "node": ">=4" } }, - "node_modules/@sentry/node/node_modules/@sentry/minimal": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.19.6.tgz", - "integrity": "sha512-T1NKcv+HTlmd8EbzUgnGPl4ySQGHWMCyZ8a8kXVMZOPDzphN3fVIzkYzWmSftCWp0rpabXPt9aRF2mfBKU+mAQ==", + "developer/src/kmc-model-info/node_modules/color-convert": { + "version": "1.9.3", + "dev": true, + "license": "MIT", "dependencies": { - "@sentry/hub": "6.19.6", - "@sentry/types": "6.19.6", - "tslib": "^1.9.3" - }, - "engines": { - "node": ">=6" + "color-name": "1.1.3" } }, - "node_modules/@sentry/node/node_modules/@sentry/types": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.19.6.tgz", - "integrity": "sha512-QH34LMJidEUPZK78l+Frt3AaVFJhEmIi05Zf8WHd9/iTt+OqvCHBgq49DDr1FWFqyYWm/QgW/3bIoikFpfsXyQ==", - "engines": { - "node": ">=6" - } + "developer/src/kmc-model-info/node_modules/color-name": { + "version": "1.1.3", + "dev": true, + "license": "MIT" }, - "node_modules/@sentry/node/node_modules/@sentry/utils": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.19.6.tgz", - "integrity": "sha512-fAMWcsguL0632eWrROp/vhPgI7sBj/JROWVPzpabwVkm9z3m1rQm6iLFn4qfkZL8Ozy6NVZPXOQ7EXmeU24byg==", + "developer/src/kmc-model-info/node_modules/js-yaml": { + "version": "4.0.0", + "dev": true, + "license": "MIT", "dependencies": { - "@sentry/types": "6.19.6", - "tslib": "^1.9.3" + "argparse": "^2.0.1" }, - "engines": { - "node": ">=6" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@sentry/types": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", - "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==", + "developer/src/kmc-model-info/node_modules/minimatch": { + "version": "3.0.4", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, "engines": { - "node": ">=6" + "node": "*" } }, - "node_modules/@sentry/utils": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", - "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", + "developer/src/kmc-model-info/node_modules/mocha": { + "version": "8.4.0", + "dev": true, + "license": "MIT", "dependencies": { - "@sentry/types": "5.30.0", - "tslib": "^1.9.3" + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.1", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.0.0", + "log-symbols": "4.0.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.20", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.1.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" }, "engines": { - "node": ">=6" + "node": ">= 10.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, - "node_modules/@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", + "developer/src/kmc-model-info/node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, "funding": { - "url": "https://github.com/sindresorhus/is?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "developer/src/kmc-model-info/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", "dev": true, + "license": "MIT", "dependencies": { - "type-detect": "4.0.8" + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/@sinonjs/formatio": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", - "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", + "developer/src/kmc-model-info/node_modules/ms": { + "version": "2.1.3", "dev": true, - "dependencies": { - "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" - } + "license": "MIT" }, - "node_modules/@sinonjs/samsam": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", - "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", + "developer/src/kmc-model-info/node_modules/supports-color": { + "version": "5.5.0", "dev": true, + "license": "MIT", "dependencies": { - "@sinonjs/commons": "^1.3.0", - "array-from": "^2.1.1", - "lodash": "^4.17.15" + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, - "node_modules/@socket.io/base64-arraybuffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", - "integrity": "sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==", + "developer/src/kmc-model-info/node_modules/supports-color/node_modules/has-flag": { + "version": "3.0.0", "dev": true, + "license": "MIT", "engines": { - "node": ">= 0.6.0" + "node": ">=4" } }, - "node_modules/@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", + "developer/src/kmc-model-info/node_modules/ts-node": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", + "dev": true, "dependencies": { - "defer-to-connect": "^2.0.0" + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" }, "engines": { - "node": ">=10" + "node": ">=10.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" } }, - "node_modules/@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", - "dev": true + "developer/src/kmc-model-info/node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true, + "engines": { + "node": ">=0.3.1" + } }, - "node_modules/@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", - "dev": true - }, - "node_modules/@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", - "dev": true + "developer/src/kmc-model/node_modules/@types/mocha": { + "version": "5.2.7", + "dev": true, + "license": "MIT" }, - "node_modules/@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", - "dev": true + "developer/src/kmc-model/node_modules/@types/node": { + "version": "10.17.60", + "dev": true, + "license": "MIT" }, - "node_modules/@types/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "developer/src/kmc-model/node_modules/ansi-styles": { + "version": "3.2.1", "dev": true, + "license": "MIT", "dependencies": { - "@types/connect": "*", - "@types/node": "*" + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@types/cacheable-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", - "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", + "developer/src/kmc-model/node_modules/chalk": { + "version": "2.4.2", + "dev": true, + "license": "MIT", "dependencies": { - "@types/http-cache-semantics": "*", - "@types/keyv": "*", - "@types/node": "*", - "@types/responselike": "*" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@types/chai": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", - "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", - "dev": true - }, - "node_modules/@types/component-emitter": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", - "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==", - "dev": true - }, - "node_modules/@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "developer/src/kmc-model/node_modules/color-convert": { + "version": "1.9.3", "dev": true, + "license": "MIT", "dependencies": { - "@types/node": "*" + "color-name": "1.1.3" } }, - "node_modules/@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", - "dev": true - }, - "node_modules/@types/cors": { - "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", - "dev": true + "developer/src/kmc-model/node_modules/color-name": { + "version": "1.1.3", + "dev": true, + "license": "MIT" }, - "node_modules/@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "developer/src/kmc-model/node_modules/has-flag": { + "version": "3.0.0", "dev": true, - "dependencies": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" + "license": "MIT", + "engines": { + "node": ">=4" } }, - "node_modules/@types/express-serve-static-core": { - "version": "4.17.28", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", - "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "developer/src/kmc-model/node_modules/supports-color": { + "version": "5.5.0", "dev": true, + "license": "MIT", "dependencies": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@types/http-cache-semantics": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", - "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" - }, - "node_modules/@types/json-buffer": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ==" - }, - "node_modules/@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", + "developer/src/kmc-package": { + "name": "@keymanapp/kmc-package", + "license": "MIT", "dependencies": { - "@types/node": "*" + "@keymanapp/common-types": "*", + "jszip": "^3.7.0" + }, + "devDependencies": { + "@keymanapp/developer-test-helpers": "*", + "@types/chai": "^4.1.7", + "@types/mocha": "^5.2.7", + "@types/node": "^10.14.6", + "c8": "^7.12.0", + "chai": "^4.3.4", + "chalk": "^2.4.2", + "mocha": "^8.4.0", + "ts-node": "^9.1.1", + "typescript": "^4.9.5" } }, - "node_modules/@types/mime": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", - "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", - "dev": true - }, - "node_modules/@types/mocha": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", - "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", - "dev": true - }, - "node_modules/@types/multer": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.4.7.tgz", - "integrity": "sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==", + "developer/src/kmc-package/node_modules/@types/mocha": { + "version": "5.2.7", "dev": true, - "dependencies": { - "@types/express": "*" - } - }, - "node_modules/@types/node": { - "version": "11.15.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.15.54.tgz", - "integrity": "sha512-1RWYiq+5UfozGsU6MwJyFX6BtktcT10XRjvcAQmskCtMcW3tPske88lM/nHv7BQG1w9KBXI1zPGuu5PnNCX14g==" - }, - "node_modules/@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", - "dev": true + "license": "MIT" }, - "node_modules/@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", - "dev": true + "developer/src/kmc-package/node_modules/@types/node": { + "version": "10.17.60", + "dev": true, + "license": "MIT" }, - "node_modules/@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", + "developer/src/kmc-package/node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", "dependencies": { - "@types/node": "*" + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@types/semver": { - "version": "7.3.9", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz", - "integrity": "sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ==", - "dev": true - }, - "node_modules/@types/serve-static": { - "version": "1.13.10", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", - "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", + "developer/src/kmc-package/node_modules/chalk": { + "version": "2.4.2", "dev": true, + "license": "MIT", "dependencies": { - "@types/mime": "^1", - "@types/node": "*" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "developer/src/kmc-package/node_modules/color-convert": { + "version": "1.9.3", "dev": true, + "license": "MIT", "dependencies": { - "@types/node": "*" + "color-name": "1.1.3" } }, - "node_modules/@types/xml2js": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.9.tgz", - "integrity": "sha512-CHiCKIihl1pychwR2RNX5mAYmJDACgFVCMT5OArMaO3erzwXVcBqPcusr+Vl8yeeXukxZqtF8mZioqX+mpjjdw==", + "developer/src/kmc-package/node_modules/color-name": { + "version": "1.1.3", "dev": true, - "dependencies": { - "@types/node": "*" - } + "license": "MIT" }, - "node_modules/@types/yauzl": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.2.tgz", - "integrity": "sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==", - "optional": true, + "developer/src/kmc-package/node_modules/js-yaml": { + "version": "4.0.0", + "dev": true, + "license": "MIT", "dependencies": { - "@types/node": "*" + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true - }, - "node_modules/abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "optional": true - }, - "node_modules/accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "developer/src/kmc-package/node_modules/minimatch": { + "version": "3.0.4", + "dev": true, + "license": "ISC", "dependencies": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">= 0.6" + "node": "*" } }, - "node_modules/acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "developer/src/kmc-package/node_modules/mocha": { + "version": "8.4.0", "dev": true, + "license": "MIT", + "dependencies": { + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.1", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.0.0", + "log-symbols": "4.0.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.20", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.1.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, "bin": { - "acorn": "bin/acorn" + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" }, "engines": { - "node": ">=0.4.0" + "node": ">= 10.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, - "node_modules/acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "developer/src/kmc-package/node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.4.0" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "developer/src/kmc-package/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "dev": true, + "license": "MIT", "dependencies": { - "debug": "4" + "has-flag": "^4.0.0" }, "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "optional": true, - "dependencies": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "node": ">=10" }, "funding": { - "type": "github", - "url": "https://github.com/sponsors/epoberezkin" + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "developer/src/kmc-package/node_modules/ms": { + "version": "2.1.3", "dev": true, - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "optional": true, - "engines": { - "node": ">=0.10.0" - } + "license": "MIT" }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "developer/src/kmc-package/node_modules/supports-color": { + "version": "5.5.0", + "dev": true, + "license": "MIT", "dependencies": { - "color-convert": "^2.0.1" + "has-flag": "^3.0.0" }, "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "node": ">=4" } }, - "node_modules/anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "developer/src/kmc-package/node_modules/supports-color/node_modules/has-flag": { + "version": "3.0.0", "dev": true, - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, + "license": "MIT", "engines": { - "node": ">= 8" - } - }, - "node_modules/append-field": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", - "integrity": "sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY=" - }, - "node_modules/aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "devOptional": true - }, - "node_modules/are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "optional": true, - "dependencies": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" + "node": ">=4" } }, - "node_modules/arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "node_modules/array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "node_modules/array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, - "node_modules/asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "optional": true, + "developer/src/kmc-package/node_modules/ts-node": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", + "dev": true, "dependencies": { - "safer-buffer": "~2.1.0" - } - }, - "node_modules/assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "optional": true, + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, "engines": { - "node": ">=0.8" + "node": ">=10.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" } }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", + "developer/src/kmc-package/node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, "engines": { - "node": "*" + "node": ">=0.3.1" } }, - "node_modules/asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "optional": true + "developer/src/kmc/node_modules/@types/mocha": { + "version": "5.2.7", + "dev": true, + "license": "MIT" }, - "node_modules/atob-lite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", - "integrity": "sha512-LEeSAWeh2Gfa2FtlQE1shxQ8zi5F9GHarrGKz08TMdODD5T4eH6BMsvtnhbWZ+XQn+Gb6om/917ucvRu7l7ukw==" + "developer/src/kmc/node_modules/@types/node": { + "version": "10.17.60", + "dev": true, + "license": "MIT" }, - "node_modules/aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "optional": true, + "developer/src/kmc/node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, "engines": { - "node": "*" + "node": ">=4" } }, - "node_modules/aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", - "optional": true - }, - "node_modules/balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "devOptional": true - }, - "node_modules/base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", + "developer/src/kmc/node_modules/chalk": { + "version": "2.4.2", "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, "engines": { - "node": "^4.5.0 || >= 5.9" + "node": ">=4" } }, - "node_modules/bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "optional": true, + "developer/src/kmc/node_modules/color-convert": { + "version": "1.9.3", + "dev": true, + "license": "MIT", "dependencies": { - "tweetnacl": "^0.14.3" + "color-name": "1.1.3" } }, - "node_modules/before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" - }, - "node_modules/binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", + "developer/src/kmc/node_modules/color-name": { + "version": "1.1.3", "dev": true, + "license": "MIT" + }, + "developer/src/kmc/node_modules/commander": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.0.tgz", + "integrity": "sha512-zS5PnTI22FIRM6ylNW8G4Ap0IEOyk62fhLSD0+uHRT9McRCLGpkVNvao4bjimpK/GShynyQkFFxHhwMcETmduA==", "engines": { - "node": ">=8" + "node": ">=14" } }, - "node_modules/bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", - "optional": true, + "developer/src/kmc/node_modules/js-yaml": { + "version": "4.0.0", + "dev": true, + "license": "MIT", "dependencies": { - "file-uri-to-path": "1.0.0" + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "node_modules/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", + "developer/src/kmc/node_modules/minimatch": { + "version": "3.0.4", + "dev": true, + "license": "ISC", "dependencies": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" + "brace-expansion": "^1.1.7" }, "engines": { - "node": ">= 0.8" + "node": "*" } }, - "node_modules/body-parser/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "developer/src/kmc/node_modules/mocha": { + "version": "8.4.0", + "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.0.0" + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.1", + "debug": "4.3.1", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.1.6", + "growl": "1.10.5", + "he": "1.2.0", + "js-yaml": "4.0.0", + "log-symbols": "4.0.0", + "minimatch": "3.0.4", + "ms": "2.1.3", + "nanoid": "3.1.20", + "serialize-javascript": "5.0.1", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "which": "2.0.2", + "wide-align": "1.1.3", + "workerpool": "6.1.0", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha" + }, + "engines": { + "node": ">= 10.12.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, - "node_modules/body-parser/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "devOptional": true, - "dependencies": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "developer/src/kmc/node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "developer/src/kmc/node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", "dev": true, + "license": "MIT", "dependencies": { - "fill-range": "^7.0.1" + "has-flag": "^4.0.0" }, "engines": { - "node": ">=8" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "node_modules/browserstack": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/browserstack/-/browserstack-1.5.3.tgz", - "integrity": "sha512-AO+mECXsW4QcqC9bxwM29O7qWa7bJT94uBFzeb5brylIQwawuEziwq20dPYbins95GlWzOawgyDNdjYAo32EKg==", + "developer/src/kmc/node_modules/ms": { + "version": "2.1.3", "dev": true, - "dependencies": { - "https-proxy-agent": "^2.2.1" - } + "license": "MIT" }, - "node_modules/browserstack-local": { - "version": "1.4.9", - "resolved": "https://registry.npmjs.org/browserstack-local/-/browserstack-local-1.4.9.tgz", - "integrity": "sha512-V+q8HQwRQFr9nd32xR66ZZ3VDWa3Kct4IMMudhKgcuD7cWrvvFARZOibx71II+Rf7P5nMQpWWxl9z/3p927nbg==", + "developer/src/kmc/node_modules/supports-color": { + "version": "5.5.0", "dev": true, + "license": "MIT", "dependencies": { - "https-proxy-agent": "^4.0.0", - "is-running": "^2.1.0", - "ps-tree": "=1.2.0", - "temp-fs": "^0.9.9" + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "node_modules/browserstack-local/node_modules/agent-base": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", - "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", + "developer/src/kmc/node_modules/supports-color/node_modules/has-flag": { + "version": "3.0.0", "dev": true, + "license": "MIT", "engines": { - "node": ">= 6.0.0" + "node": ">=4" } }, - "node_modules/browserstack-local/node_modules/https-proxy-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", - "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", + "developer/src/kmc/node_modules/ts-node": { + "version": "9.1.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", + "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", "dev": true, "dependencies": { - "agent-base": "5", - "debug": "4" + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "source-map-support": "^0.5.17", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" }, "engines": { - "node": ">= 6.0.0" + "node": ">=10.0.0" + }, + "peerDependencies": { + "typescript": ">=2.7" } }, - "node_modules/browserstack/node_modules/agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", + "developer/src/kmc/node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", "dev": true, - "dependencies": { - "es6-promisify": "^5.0.0" - }, "engines": { - "node": ">= 4.0.0" + "node": ">=0.3.1" } }, - "node_modules/browserstack/node_modules/debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, + "developer/src/server": { + "name": "@keymanapp/developer-server", + "license": "MIT", "dependencies": { - "ms": "^2.1.1" + "@sentry/node": "^6.16.1", + "chalk": "^4.1.2", + "express": "^4.17.2", + "multer": "^1.4.5-lts.1", + "ngrok": "^4.2.2", + "open": "^8.4.0", + "ws": "^8.3.0" + }, + "devDependencies": { + "@keymanapp/keyman-version": "*", + "@keymanapp/resources-gosh": "*", + "@types/chai": "^4.3.0", + "@types/express": "^4.17.13", + "@types/mocha": "^9.1.0", + "@types/multer": "^1.4.7", + "@types/node": "^17.0.0", + "@types/ws": "^8.2.2", + "chai": "^4.3.4", + "copyfiles": "^2.4.1", + "mocha": "^10.0.0", + "ts-node": "^10.9.1", + "tsc-watch": "^4.5.0", + "typescript": "^4.9.5" + }, + "optionalDependencies": { + "hetrodo-node-hide-console-window-napi": "keymanapp/hetrodo-node-hide-console-window-napi#keyman-15.0", + "node-windows-trayicon": "keymanapp/node-windows-trayicon#keyman-16.0" } }, - "node_modules/browserstack/node_modules/https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", + "developer/src/server/node_modules/@types/mocha": { + "version": "9.1.1", + "dev": true, + "license": "MIT" + }, + "developer/src/server/node_modules/@types/node": { + "version": "17.0.45", "dev": true, + "license": "MIT" + }, + "developer/src/server/node_modules/busboy": { + "version": "1.6.0", "dependencies": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" + "streamsearch": "^1.1.0" }, "engines": { - "node": ">= 4.5.0" + "node": ">=10.16.0" } }, - "node_modules/btoa-lite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", - "integrity": "sha512-gvW7InbIyF8AicrqWoptdW08pUxuhq8BEgowNajy9RhiE86fmGAGl+bLKo6oB8QP0CkqHLowfN0oJdKC/J6LbA==" + "developer/src/server/node_modules/multer": { + "version": "1.4.5-lts.1", + "license": "MIT", + "dependencies": { + "append-field": "^1.0.0", + "busboy": "^1.0.0", + "concat-stream": "^1.5.2", + "mkdirp": "^0.5.4", + "object-assign": "^4.1.1", + "type-is": "^1.6.4", + "xtend": "^4.0.0" + }, + "engines": { + "node": ">= 6.0.0" + } }, - "node_modules/buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=", + "developer/src/server/node_modules/streamsearch": { + "version": "1.1.0", "engines": { - "node": "*" + "node": ">=10.0.0" } }, - "node_modules/buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" + "node_modules/@actions/core": { + "version": "1.9.1", + "license": "MIT", + "dependencies": { + "@actions/http-client": "^2.0.1", + "uuid": "^8.3.2" + } }, - "node_modules/bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", - "engines": { - "node": ">= 0.8" + "node_modules/@actions/github": { + "version": "2.2.0", + "license": "MIT", + "dependencies": { + "@actions/http-client": "^1.0.3", + "@octokit/graphql": "^4.3.1", + "@octokit/rest": "^16.43.1" } }, - "node_modules/cacheable-lookup": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==", - "engines": { - "node": ">=10.6.0" + "node_modules/@actions/github/node_modules/@actions/http-client": { + "version": "1.0.11", + "license": "MIT", + "dependencies": { + "tunnel": "0.0.6" } }, - "node_modules/cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", + "node_modules/@actions/http-client": { + "version": "2.0.1", + "license": "MIT", "dependencies": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=8" + "tunnel": "^0.0.6" } }, - "node_modules/camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "node_modules/@bcoe/v8-coverage": { + "version": "0.2.3", + "dev": true, + "license": "MIT" + }, + "node_modules/@colors/colors": { + "version": "1.5.0", + "dev": true, + "license": "MIT", "engines": { - "node": ">=6" + "node": ">=0.1.90" } }, - "node_modules/caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "optional": true - }, - "node_modules/chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "node_modules/@cspotcode/source-map-support": { + "version": "0.8.1", "dev": true, + "license": "MIT", "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "@jridgewell/trace-mapping": "0.3.9" }, "engines": { - "node": ">=4" + "node": ">=12" } }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "node_modules/@eslint-community/eslint-utils": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz", + "integrity": "sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA==", + "dev": true, "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": ">=10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || >=8.0.0" } }, - "node_modules/check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", + "node_modules/@eslint-community/regexpp": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/@eslint-community/regexpp/-/regexpp-4.5.0.tgz", + "integrity": "sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ==", "dev": true, "engines": { - "node": "*" + "node": "^12.0.0 || ^14.0.0 || >=16.0.0" } }, - "node_modules/chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "node_modules/@eslint/eslintrc": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-2.0.2.tgz", + "integrity": "sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ==", "dev": true, "dependencies": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "ajv": "^6.12.4", + "debug": "^4.3.2", + "espree": "^9.5.1", + "globals": "^13.19.0", + "ignore": "^5.2.0", + "import-fresh": "^3.2.1", + "js-yaml": "^4.1.0", + "minimatch": "^3.1.2", + "strip-json-comments": "^3.1.1" }, "engines": { - "node": ">= 8.10.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" }, - "optionalDependencies": { - "fsevents": "~2.3.1" - } - }, - "node_modules/chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "optional": true, - "engines": { - "node": ">=10" + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "node_modules/@eslint/eslintrc/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/cliui/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, + "ms": "2.1.2" + }, "engines": { - "node": ">=8" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "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==", + "node_modules/@eslint/js": { + "version": "8.39.0", + "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.39.0.tgz", + "integrity": "sha512-kf9RB0Fg7NZfap83B3QOqOGg9QmD9yBudqQXzzOtn3i4y7ZUXe5ONeW34Gwi+TxhH4mvj72R1Zc300KUMa9Bng==", "dev": true, "engines": { - "node": ">=8" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/cliui/node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "optional": true + }, + "node_modules/@humanwhocodes/config-array": { + "version": "0.11.8", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.8.tgz", + "integrity": "sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "@humanwhocodes/object-schema": "^1.2.1", + "debug": "^4.1.1", + "minimatch": "^3.0.5" }, "engines": { - "node": ">=8" + "node": ">=10.10.0" } }, - "node_modules/cliui/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "node_modules/@humanwhocodes/module-importer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz", + "integrity": "sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA==", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, "engines": { - "node": ">=8" - } - }, - "node_modules/clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", - "dependencies": { - "mimic-response": "^1.0.0" + "node": ">=12.22" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" } }, - "node_modules/code-point-at": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "optional": true, + "node_modules/@humanwhocodes/object-schema": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", + "integrity": "sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA==", + "dev": true + }, + "node_modules/@istanbuljs/schema": { + "version": "0.1.3", + "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, + "node_modules/@jridgewell/resolve-uri": { + "version": "3.1.0", + "dev": true, + "license": "MIT", "engines": { - "node": ">=7.0.0" + "node": ">=6.0.0" } }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "node_modules/@jridgewell/sourcemap-codec": { + "version": "1.4.14", "dev": true, - "bin": { - "color-support": "bin.js" - } + "license": "MIT" }, - "node_modules/combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "optional": true, + "node_modules/@jridgewell/trace-mapping": { + "version": "0.3.9", + "dev": true, + "license": "MIT", "dependencies": { - "delayed-stream": "~1.0.0" - }, - "engines": { - "node": ">= 0.8" + "@jridgewell/resolve-uri": "^3.0.3", + "@jridgewell/sourcemap-codec": "^1.4.10" } }, - "node_modules/commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" + "node_modules/@keymanapp/auto-history-action": { + "resolved": "resources/build/version", + "link": true }, - "node_modules/component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true + "node_modules/@keymanapp/common-types": { + "resolved": "common/web/types", + "link": true }, - "node_modules/compress-brotli": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/compress-brotli/-/compress-brotli-1.3.6.tgz", - "integrity": "sha512-au99/GqZtUtiCBliqLFbWlhnCxn+XSYjwZ77q6mKN4La4qOXDoLVPZ50iXr0WmAyMxl8yqoq3Yq4OeQNPPkyeQ==", - "dependencies": { - "@types/json-buffer": "~3.0.0", - "json-buffer": "~3.0.1" - }, - "engines": { - "node": ">= 12" - } + "node_modules/@keymanapp/developer-server": { + "resolved": "developer/src/server", + "link": true }, - "node_modules/concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "devOptional": true + "node_modules/@keymanapp/developer-test-helpers": { + "resolved": "developer/src/common/web/test-helpers", + "link": true }, - "node_modules/concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "engines": [ - "node >= 0.8" - ], - "dependencies": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" - } + "node_modules/@keymanapp/hextobin": { + "resolved": "common/tools/hextobin", + "link": true }, - "node_modules/connect": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", - "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", - "dev": true, - "dependencies": { - "debug": "2.6.9", - "finalhandler": "1.1.2", - "parseurl": "~1.3.3", - "utils-merge": "1.0.1" - }, - "engines": { - "node": ">= 0.10.0" - } + "node_modules/@keymanapp/input-processor": { + "resolved": "common/web/input-processor", + "link": true }, - "node_modules/connect/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "dependencies": { - "ms": "2.0.0" - } + "node_modules/@keymanapp/keyboard-processor": { + "resolved": "common/web/keyboard-processor", + "link": true }, - "node_modules/connect/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "node_modules/@keymanapp/keyman-version": { + "resolved": "common/web/keyman-version", + "link": true }, - "node_modules/console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "devOptional": true + "node_modules/@keymanapp/kmc": { + "resolved": "developer/src/kmc", + "link": true }, - "node_modules/content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "dependencies": { - "safe-buffer": "5.2.1" - }, - "engines": { - "node": ">= 0.6" - } + "node_modules/@keymanapp/kmc-kmn": { + "resolved": "developer/src/kmc-kmn", + "link": true }, - "node_modules/content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", - "engines": { - "node": ">= 0.6" - } + "node_modules/@keymanapp/kmc-ldml": { + "resolved": "developer/src/kmc-ldml", + "link": true }, - "node_modules/convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + "node_modules/@keymanapp/kmc-model": { + "resolved": "developer/src/kmc-model", + "link": true }, - "node_modules/cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==", - "engines": { - "node": ">= 0.6" - } + "node_modules/@keymanapp/kmc-model-info": { + "resolved": "developer/src/kmc-model-info", + "link": true }, - "node_modules/cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + "node_modules/@keymanapp/kmc-package": { + "resolved": "developer/src/kmc-package", + "link": true }, - "node_modules/copyfiles": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", - "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", + "node_modules/@keymanapp/ldml-keyboard-constants": { + "resolved": "core/include/ldml", + "link": true + }, + "node_modules/@keymanapp/lexical-model-layer": { + "resolved": "common/predictive-text", + "link": true + }, + "node_modules/@keymanapp/lm-message-types": { + "resolved": "common/web/lm-message-types", + "link": true + }, + "node_modules/@keymanapp/lm-worker": { + "resolved": "common/web/lm-worker", + "link": true + }, + "node_modules/@keymanapp/models-templates": { + "resolved": "common/models/templates", + "link": true + }, + "node_modules/@keymanapp/models-types": { + "resolved": "common/models/types", + "link": true + }, + "node_modules/@keymanapp/models-wordbreakers": { + "resolved": "common/models/wordbreakers", + "link": true + }, + "node_modules/@keymanapp/recorder-core": { + "resolved": "common/web/recorder", + "link": true + }, + "node_modules/@keymanapp/resources-gosh": { + "resolved": "resources/gosh", + "link": true + }, + "node_modules/@keymanapp/sourcemap-path-remapper": { + "resolved": "common/tools/sourcemap-path-remapper", + "link": true + }, + "node_modules/@keymanapp/web-sentry-manager": { + "resolved": "common/web/sentry-manager", + "link": true + }, + "node_modules/@keymanapp/web-utils": { + "resolved": "common/web/utils", + "link": true + }, + "node_modules/@nodelib/fs.scandir": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", + "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", "dev": true, "dependencies": { - "glob": "^7.0.5", - "minimatch": "^3.0.3", - "mkdirp": "^1.0.4", - "noms": "0.0.0", - "through2": "^2.0.1", - "untildify": "^4.0.0", - "yargs": "^16.1.0" + "@nodelib/fs.stat": "2.0.5", + "run-parallel": "^1.1.9" }, - "bin": { - "copyfiles": "copyfiles", - "copyup": "copyfiles" + "engines": { + "node": ">= 8" } }, - "node_modules/copyfiles/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "node_modules/@nodelib/fs.stat": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", + "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", "dev": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, "engines": { - "node": ">=10" + "node": ">= 8" } }, - "node_modules/core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" - }, - "node_modules/cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", + "node_modules/@nodelib/fs.walk": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", + "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", "dev": true, "dependencies": { - "object-assign": "^4", - "vary": "^1" + "@nodelib/fs.scandir": "2.1.5", + "fastq": "^1.6.0" }, "engines": { - "node": ">= 0.10" + "node": ">= 8" } }, - "node_modules/create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dev": true, + "node_modules/@npmcli/fs": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-2.1.2.tgz", + "integrity": "sha512-yOJKRvohFOaLqipNtwYB9WugyZKhC/DZC4VYPmpaCzDBrA8YpK3qHZ8/HGscMnE4GqbkLNuVcCnxkeQEdGt6LQ==", + "optional": true, "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "@gar/promisify": "^1.1.3", + "semver": "^7.3.5" }, "engines": { - "node": ">= 8" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/custom-event": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", - "dev": true - }, - "node_modules/dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", + "node_modules/@npmcli/move-file": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-2.0.1.tgz", + "integrity": "sha512-mJd2Z5TjYWq/ttPLLGqArdtnC74J6bOzg4rMDnN+p1xTacZ2yPRCk2y0oSWQtygLR9YVQXgOcONrwtnk3JupxQ==", + "deprecated": "This functionality has been moved to @npmcli/fs", "optional": true, "dependencies": { - "assert-plus": "^1.0.0" + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" }, "engines": { - "node": ">=0.10" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/date-format": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.6.tgz", - "integrity": "sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==", - "dev": true, + "node_modules/@npmcli/move-file/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "optional": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, "engines": { - "node": ">=4.0" + "node": ">=10" } }, - "node_modules/debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "node_modules/@octokit/auth-token": { + "version": "2.5.0", + "license": "MIT", "dependencies": { - "ms": "2.1.2" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "@octokit/types": "^6.0.3" } }, - "node_modules/decamelize": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", - "engines": { - "node": ">=0.10.0" + "node_modules/@octokit/core": { + "version": "3.6.0", + "license": "MIT", + "peer": true, + "dependencies": { + "@octokit/auth-token": "^2.4.4", + "@octokit/graphql": "^4.5.8", + "@octokit/request": "^5.6.3", + "@octokit/request-error": "^2.0.5", + "@octokit/types": "^6.0.3", + "before-after-hook": "^2.2.0", + "universal-user-agent": "^6.0.0" } }, - "node_modules/decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "node_modules/@octokit/endpoint": { + "version": "6.0.12", + "license": "MIT", "dependencies": { - "mimic-response": "^3.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "@octokit/types": "^6.0.3", + "is-plain-object": "^5.0.0", + "universal-user-agent": "^6.0.0" } }, - "node_modules/decompress-response/node_modules/mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node_modules/@octokit/graphql": { + "version": "4.8.0", + "license": "MIT", + "dependencies": { + "@octokit/request": "^5.6.0", + "@octokit/types": "^6.0.3", + "universal-user-agent": "^6.0.0" } }, - "node_modules/deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", - "dev": true, + "node_modules/@octokit/openapi-types": { + "version": "11.2.0", + "license": "MIT" + }, + "node_modules/@octokit/plugin-paginate-rest": { + "version": "1.1.2", + "license": "MIT", "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=0.12" + "@octokit/types": "^2.0.1" } }, - "node_modules/defer-to-connect": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==", - "engines": { - "node": ">=10" + "node_modules/@octokit/plugin-paginate-rest/node_modules/@octokit/types": { + "version": "2.16.2", + "license": "MIT", + "dependencies": { + "@types/node": ">= 8" } }, - "node_modules/define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==", - "engines": { - "node": ">=8" + "node_modules/@octokit/plugin-request-log": { + "version": "1.0.4", + "license": "MIT", + "peerDependencies": { + "@octokit/core": ">=3" } }, - "node_modules/delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "optional": true, - "engines": { - "node": ">=0.4.0" + "node_modules/@octokit/plugin-rest-endpoint-methods": { + "version": "2.4.0", + "license": "MIT", + "dependencies": { + "@octokit/types": "^2.0.1", + "deprecation": "^2.3.1" } }, - "node_modules/delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "devOptional": true - }, - "node_modules/depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=", - "engines": { - "node": ">= 0.6" + "node_modules/@octokit/plugin-rest-endpoint-methods/node_modules/@octokit/types": { + "version": "2.16.2", + "license": "MIT", + "dependencies": { + "@types/node": ">= 8" } }, - "node_modules/deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - }, - "node_modules/destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "node_modules/di": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", - "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", - "dev": true - }, - "node_modules/diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true, - "engines": { - "node": ">=0.3.1" + "node_modules/@octokit/request": { + "version": "5.6.3", + "license": "MIT", + "dependencies": { + "@octokit/endpoint": "^6.0.1", + "@octokit/request-error": "^2.1.0", + "@octokit/types": "^6.16.1", + "is-plain-object": "^5.0.0", + "node-fetch": "^2.6.7", + "universal-user-agent": "^6.0.0" } }, - "node_modules/doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, + "node_modules/@octokit/request-error": { + "version": "2.1.0", + "license": "MIT", "dependencies": { - "esutils": "^2.0.2" - }, - "engines": { - "node": ">=6.0.0" + "@octokit/types": "^6.0.3", + "deprecation": "^2.0.0", + "once": "^1.4.0" } }, - "node_modules/dom-serialize": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", - "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", - "dev": true, + "node_modules/@octokit/rest": { + "version": "16.43.2", + "license": "MIT", "dependencies": { - "custom-event": "~1.0.0", - "ent": "~2.2.0", - "extend": "^3.0.0", - "void-elements": "^2.0.0" + "@octokit/auth-token": "^2.4.0", + "@octokit/plugin-paginate-rest": "^1.1.1", + "@octokit/plugin-request-log": "^1.0.0", + "@octokit/plugin-rest-endpoint-methods": "2.4.0", + "@octokit/request": "^5.2.0", + "@octokit/request-error": "^1.0.2", + "atob-lite": "^2.0.0", + "before-after-hook": "^2.0.0", + "btoa-lite": "^1.0.0", + "deprecation": "^2.0.0", + "lodash.get": "^4.4.2", + "lodash.set": "^4.3.2", + "lodash.uniq": "^4.5.0", + "octokit-pagination-methods": "^1.1.0", + "once": "^1.4.0", + "universal-user-agent": "^4.0.0" } }, - "node_modules/duplexer": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", - "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", - "dev": true - }, - "node_modules/ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", - "optional": true, + "node_modules/@octokit/rest/node_modules/@octokit/request-error": { + "version": "1.2.1", + "license": "MIT", "dependencies": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" + "@octokit/types": "^2.0.0", + "deprecation": "^2.0.0", + "once": "^1.4.0" } }, - "node_modules/edge-launcher": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/edge-launcher/-/edge-launcher-1.2.2.tgz", - "integrity": "sha1-60Cq+9Bnpup27/+rBke81VCbN7I=", - "dev": true - }, - "node_modules/ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=", - "engines": { - "node": ">= 0.8" + "node_modules/@octokit/rest/node_modules/@octokit/types": { + "version": "2.16.2", + "license": "MIT", + "dependencies": { + "@types/node": ">= 8" } }, - "node_modules/end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "node_modules/@octokit/rest/node_modules/universal-user-agent": { + "version": "4.0.1", + "license": "ISC", "dependencies": { - "once": "^1.4.0" + "os-name": "^3.1.0" } }, - "node_modules/engine.io": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.3.tgz", - "integrity": "sha512-rqs60YwkvWTLLnfazqgZqLa/aKo+9cueVfEi/dZ8PyGyaf8TLOxj++4QMIgeG3Gn0AhrWiFXvghsoY9L9h25GA==", - "dev": true, + "node_modules/@octokit/types": { + "version": "6.34.0", + "license": "MIT", "dependencies": { - "@types/cookie": "^0.4.1", - "@types/cors": "^2.8.12", - "@types/node": ">=10.0.0", - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "~0.4.1", - "cors": "~2.8.5", - "debug": "~4.3.1", - "engine.io-parser": "~5.0.3", - "ws": "~8.2.3" - }, - "engines": { - "node": ">=10.0.0" + "@octokit/openapi-types": "^11.2.0" } }, - "node_modules/engine.io-parser": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz", - "integrity": "sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg==", - "dev": true, + "node_modules/@sentry/browser": { + "version": "5.30.0", + "license": "BSD-3-Clause", "dependencies": { - "@socket.io/base64-arraybuffer": "~1.0.2" + "@sentry/core": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" }, "engines": { - "node": ">=10.0.0" + "node": ">=6" } }, - "node_modules/engine.io/node_modules/ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", + "node_modules/@sentry/cli": { + "version": "2.2.0", "dev": true, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "https-proxy-agent": "^5.0.0", + "node-fetch": "^2.6.7", + "npmlog": "^6.0.1", + "progress": "^2.0.3", + "proxy-from-env": "^1.1.0", + "which": "^2.0.2" }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/ent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", - "dev": true - }, - "node_modules/entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "dev": true, - "funding": { - "url": "https://github.com/fb55/entities?sponsor=1" + "bin": { + "sentry-cli": "bin/sentry-cli" + }, + "engines": { + "node": ">= 12" } }, - "node_modules/env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "optional": true, + "node_modules/@sentry/core": { + "version": "5.30.0", + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/minimal": "5.30.0", + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, "engines": { "node": ">=6" } }, - "node_modules/es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "dev": true - }, - "node_modules/es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", - "dev": true, + "node_modules/@sentry/hub": { + "version": "5.30.0", + "license": "BSD-3-Clause", "dependencies": { - "es6-promise": "^4.0.3" - } - }, - "node_modules/es6-shim": { - "version": "0.35.6", - "resolved": "https://registry.npmjs.org/es6-shim/-/es6-shim-0.35.6.tgz", - "integrity": "sha512-EmTr31wppcaIAgblChZiuN/l9Y7DPyw8Xtbg7fIVngn6zMW+IEBJDJngeKC3x6wr0V/vcA2wqeFnaw1bFJbDdA==" - }, - "node_modules/escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true, + "@sentry/types": "5.30.0", + "@sentry/utils": "5.30.0", + "tslib": "^1.9.3" + }, "engines": { "node": ">=6" } }, - "node_modules/escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "node_modules/escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true, + "node_modules/@sentry/minimal": { + "version": "5.30.0", + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/hub": "5.30.0", + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" + }, "engines": { - "node": ">=0.8.0" + "node": ">=6" } }, - "node_modules/esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, + "node_modules/@sentry/node": { + "version": "6.19.6", + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/core": "6.19.6", + "@sentry/hub": "6.19.6", + "@sentry/types": "6.19.6", + "@sentry/utils": "6.19.6", + "cookie": "^0.4.1", + "https-proxy-agent": "^5.0.0", + "lru_map": "^0.3.3", + "tslib": "^1.9.3" + }, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=", + "node_modules/@sentry/node/node_modules/@sentry/core": { + "version": "6.19.6", + "license": "BSD-3-Clause", + "dependencies": { + "@sentry/hub": "6.19.6", + "@sentry/minimal": "6.19.6", + "@sentry/types": "6.19.6", + "@sentry/utils": "6.19.6", + "tslib": "^1.9.3" + }, "engines": { - "node": ">= 0.6" + "node": ">=6" } }, - "node_modules/event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", - "dev": true, + "node_modules/@sentry/node/node_modules/@sentry/hub": { + "version": "6.19.6", + "license": "BSD-3-Clause", "dependencies": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" + "@sentry/types": "6.19.6", + "@sentry/utils": "6.19.6", + "tslib": "^1.9.3" + }, + "engines": { + "node": ">=6" } }, - "node_modules/eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" - }, - "node_modules/execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", + "node_modules/@sentry/node/node_modules/@sentry/minimal": { + "version": "6.19.6", + "license": "BSD-3-Clause", "dependencies": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "@sentry/hub": "6.19.6", + "@sentry/types": "6.19.6", + "tslib": "^1.9.3" }, "engines": { "node": ">=6" } }, - "node_modules/execa/node_modules/cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "dependencies": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - }, + "node_modules/@sentry/node/node_modules/@sentry/types": { + "version": "6.19.6", + "license": "BSD-3-Clause", "engines": { - "node": ">=4.8" + "node": ">=6" } }, - "node_modules/execa/node_modules/get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "node_modules/@sentry/node/node_modules/@sentry/utils": { + "version": "6.19.6", + "license": "BSD-3-Clause", "dependencies": { - "pump": "^3.0.0" + "@sentry/types": "6.19.6", + "tslib": "^1.9.3" }, "engines": { "node": ">=6" } }, - "node_modules/execa/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", + "node_modules/@sentry/types": { + "version": "5.30.0", + "license": "BSD-3-Clause", "engines": { - "node": ">=4" - } - }, - "node_modules/execa/node_modules/semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", - "bin": { - "semver": "bin/semver" + "node": ">=6" } }, - "node_modules/execa/node_modules/shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", + "node_modules/@sentry/utils": { + "version": "5.30.0", + "license": "BSD-3-Clause", "dependencies": { - "shebang-regex": "^1.0.0" + "@sentry/types": "5.30.0", + "tslib": "^1.9.3" }, "engines": { - "node": ">=0.10.0" + "node": ">=6" } }, - "node_modules/execa/node_modules/shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==", + "node_modules/@sindresorhus/is": { + "version": "4.6.0", + "license": "MIT", "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/execa/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dependencies": { - "isexe": "^2.0.0" + "node": ">=10" }, - "bin": { - "which": "bin/which" + "funding": { + "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/express": { - "version": "4.17.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", - "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==", + "node_modules/@sinonjs/commons": { + "version": "1.8.3", + "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.19.2", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.4.2", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.9.7", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.17.2", - "serve-static": "1.14.2", - "setprototypeof": "1.2.0", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" - }, - "engines": { - "node": ">= 0.10.0" + "type-detect": "4.0.8" } }, - "node_modules/express/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "node_modules/@sinonjs/fake-timers": { + "version": "10.0.2", + "resolved": "https://registry.npmjs.org/@sinonjs/fake-timers/-/fake-timers-10.0.2.tgz", + "integrity": "sha512-SwUDyjWnah1AaNl7kxsa7cfLhlTYoiyhDAIgyh+El30YvXs/o7OLXpYH88Zdhyx9JExKrmHDJ+10bwIcY80Jmw==", + "dev": true, "dependencies": { - "ms": "2.0.0" + "@sinonjs/commons": "^2.0.0" } }, - "node_modules/express/node_modules/ms": { + "node_modules/@sinonjs/fake-timers/node_modules/@sinonjs/commons": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" + "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-2.0.0.tgz", + "integrity": "sha512-uLa0j859mMrg2slwQYdO/AkrOfmH+X6LTVmNTS9CqexuE2IvVORIkSpJLqePAbEnKJ77aMmCwr1NUZ57120Xcg==", + "dev": true, + "dependencies": { + "type-detect": "4.0.8" + } }, - "node_modules/extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "devOptional": true - }, - "node_modules/extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "node_modules/@sinonjs/formatio": { + "version": "3.2.2", + "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" - }, - "bin": { - "extract-zip": "cli.js" - }, - "engines": { - "node": ">= 10.17.0" - }, - "optionalDependencies": { - "@types/yauzl": "^2.9.1" + "@sinonjs/commons": "^1", + "@sinonjs/samsam": "^3.1.0" } }, - "node_modules/extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "engines": [ - "node >=0.6.0" - ], - "optional": true - }, - "node_modules/fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "optional": true - }, - "node_modules/fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "optional": true - }, - "node_modules/fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", + "node_modules/@sinonjs/samsam": { + "version": "3.3.3", + "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "pend": "~1.2.0" + "@sinonjs/commons": "^1.3.0", + "array-from": "^2.1.1", + "lodash": "^4.17.15" } }, - "node_modules/file": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/file/-/file-0.2.2.tgz", - "integrity": "sha1-w9/Y+M81Na5FXCtCPC5SY112tNM=", - "dev": true - }, - "node_modules/file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "optional": true + "node_modules/@sinonjs/text-encoding": { + "version": "0.7.1", + "dev": true, + "license": "(Unlicense OR Apache-2.0)" }, - "node_modules/fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/@socket.io/base64-arraybuffer": { + "version": "1.0.2", "dev": true, - "dependencies": { - "to-regex-range": "^5.0.1" - }, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 0.6.0" } }, - "node_modules/finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", + "node_modules/@szmarczak/http-timer": { + "version": "4.0.6", + "license": "MIT", "dependencies": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" + "defer-to-connect": "^2.0.0" }, "engines": { - "node": ">= 0.8" - } - }, - "node_modules/finalhandler/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" + "node": ">=10" } }, - "node_modules/finalhandler/node_modules/ms": { + "node_modules/@tootallnate/once": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dev": true, - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-2.0.0.tgz", + "integrity": "sha512-XCuKFP5PS55gnMVu3dty8KPatLqUoy/ZYzDzAGCQ8JNFCkLXzmI7vNHCR+XpbZaMWQK/vQubr7PkYq8g470J/A==", + "optional": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 10" } }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", + "node_modules/@tsconfig/node10": { + "version": "1.0.8", "dev": true, - "bin": { - "flat": "cli.js" - } + "license": "MIT" }, - "node_modules/flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true + "node_modules/@tsconfig/node12": { + "version": "1.0.9", + "dev": true, + "license": "MIT" }, - "node_modules/follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", + "node_modules/@tsconfig/node14": { + "version": "1.0.1", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/RubenVerborgh" - } - ], - "engines": { - "node": ">=4.0" - }, - "peerDependenciesMeta": { - "debug": { - "optional": true - } - } + "license": "MIT" }, - "node_modules/forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "optional": true, - "engines": { - "node": "*" - } + "node_modules/@tsconfig/node16": { + "version": "1.0.2", + "dev": true, + "license": "MIT" }, - "node_modules/form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "optional": true, + "node_modules/@types/body-parser": { + "version": "1.19.2", + "dev": true, + "license": "MIT", "dependencies": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" - }, - "engines": { - "node": ">= 0.12" + "@types/connect": "*", + "@types/node": "*" } }, - "node_modules/forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", - "engines": { - "node": ">= 0.6" + "node_modules/@types/cacheable-request": { + "version": "6.0.2", + "license": "MIT", + "dependencies": { + "@types/http-cache-semantics": "*", + "@types/keyv": "*", + "@types/node": "*", + "@types/responselike": "*" } }, - "node_modules/fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=", - "engines": { - "node": ">= 0.6" - } + "node_modules/@types/chai": { + "version": "4.3.0", + "dev": true, + "license": "MIT" }, - "node_modules/from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "dev": true + "node_modules/@types/component-emitter": { + "version": "1.2.11", + "dev": true, + "license": "MIT" }, - "node_modules/fs-access": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", - "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", + "node_modules/@types/connect": { + "version": "3.4.35", "dev": true, + "license": "MIT", "dependencies": { - "null-check": "^1.0.0" - }, - "engines": { - "node": ">=0.10.0" + "@types/node": "*" } }, - "node_modules/fs-extra": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", - "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "node_modules/@types/cookie": { + "version": "0.4.1", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/cors": { + "version": "2.8.12", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/express": { + "version": "4.17.13", "dev": true, + "license": "MIT", "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=12" + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" } }, - "node_modules/fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "optional": true, + "node_modules/@types/express-serve-static-core": { + "version": "4.17.28", + "dev": true, + "license": "MIT", "dependencies": { - "minipass": "^3.0.0" - }, - "engines": { - "node": ">= 8" + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" } }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "devOptional": true - }, - "node_modules/fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "node_modules/@types/git-diff": { + "version": "2.0.3", "dev": true, - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } + "license": "MIT" }, - "node_modules/gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "optional": true, - "dependencies": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" - } + "node_modules/@types/http-cache-semantics": { + "version": "4.0.1", + "license": "MIT" }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } + "node_modules/@types/istanbul-lib-coverage": { + "version": "2.0.4", + "dev": true, + "license": "MIT" }, - "node_modules/get-func-name": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true, - "engines": { - "node": "*" - } + "node_modules/@types/json-buffer": { + "version": "3.0.0", + "license": "MIT" }, - "node_modules/get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "dependencies": { - "pump": "^3.0.0" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } + "node_modules/@types/json-schema": { + "version": "7.0.11", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.11.tgz", + "integrity": "sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ==", + "dev": true }, - "node_modules/getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", - "optional": true, - "dependencies": { - "assert-plus": "^1.0.0" - } + "node_modules/@types/json5": { + "version": "0.0.29", + "resolved": "https://registry.npmjs.org/@types/json5/-/json5-0.0.29.tgz", + "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", + "dev": true }, - "node_modules/glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", - "devOptional": true, + "node_modules/@types/keyv": { + "version": "3.1.4", + "license": "MIT", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "@types/node": "*" } }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/@types/mime": { + "version": "1.3.2", "dev": true, + "license": "MIT" + }, + "node_modules/@types/mocha": { + "version": "7.0.2", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/multer": { + "version": "1.4.7", + "dev": true, + "license": "MIT", "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" + "@types/express": "*" } }, - "node_modules/google-closure-compiler-java": { - "version": "20200224.0.0", - "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20200224.0.0.tgz", - "integrity": "sha512-palFcDoScauZjWIsGDzMK6h+IctcRb55I3wJX8Ko/DTSz72xwadRdKm0lGt8OoYL7SKEO+IjgD7s8XrAGpLnlQ==", - "dev": true + "node_modules/@types/node": { + "version": "11.15.54", + "license": "MIT" }, - "node_modules/got": { - "version": "11.8.5", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.5.tgz", - "integrity": "sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ==", + "node_modules/@types/qs": { + "version": "6.9.7", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/range-parser": { + "version": "1.2.4", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/responselike": { + "version": "1.0.0", + "license": "MIT", "dependencies": { - "@sindresorhus/is": "^4.0.0", - "@szmarczak/http-timer": "^4.0.5", - "@types/cacheable-request": "^6.0.1", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "http2-wrapper": "^1.0.0-beta.5.2", - "lowercase-keys": "^2.0.0", - "p-cancelable": "^2.0.0", - "responselike": "^2.0.0" - }, - "engines": { - "node": ">=10.19.0" - }, - "funding": { - "url": "https://github.com/sindresorhus/got?sponsor=1" + "@types/node": "*" } }, - "node_modules/graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "devOptional": true + "node_modules/@types/semver": { + "version": "7.3.13", + "dev": true, + "license": "MIT" }, - "node_modules/har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "optional": true, - "engines": { - "node": ">=4" + "node_modules/@types/serve-static": { + "version": "1.13.10", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/mime": "^1", + "@types/node": "*" } }, - "node_modules/har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "deprecated": "this library is no longer supported", - "optional": true, + "node_modules/@types/sinon": { + "version": "10.0.13", + "resolved": "https://registry.npmjs.org/@types/sinon/-/sinon-10.0.13.tgz", + "integrity": "sha512-UVjDqJblVNQYvVNUsj0PuYYw0ELRmgt1Nt5Vk0pT5f16ROGfcKJY8o1HVuMOJOpD727RrGB9EGvoaTQE5tgxZQ==", + "dev": true, "dependencies": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" - }, - "engines": { - "node": ">=6" + "@types/sinonjs__fake-timers": "*" } }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" + "node_modules/@types/sinon-chai": { + "version": "3.2.9", + "resolved": "https://registry.npmjs.org/@types/sinon-chai/-/sinon-chai-3.2.9.tgz", + "integrity": "sha512-/19t63pFYU0ikrdbXKBWj9PCdnKyTd0Qkz0X91Ta081cYsq90OxYdcWwK/dwEoDa6dtXgj2HJfmzgq+QZTHdmQ==", + "dev": true, + "dependencies": { + "@types/chai": "*", + "@types/sinon": "*" } }, - "node_modules/has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "devOptional": true + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.2", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.2.tgz", + "integrity": "sha512-9GcLXF0/v3t80caGs5p2rRfkB+a8VBGLJZVih6CNFkx8IZ994wiKKLSRs9nuFwk1HevWs/1mnUmkApGrSGsShA==", + "dev": true }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", + "node_modules/@types/ws": { + "version": "8.5.3", "dev": true, - "bin": { - "he": "bin/he" + "license": "MIT", + "dependencies": { + "@types/node": "*" } }, - "node_modules/hetrodo-node-hide-console-window-napi": { - "name": "node-hide-console-window", - "version": "2.0.1", - "resolved": "git+ssh://git@github.com/keymanapp/hetrodo-node-hide-console-window-napi.git#858b23036a9963b40ad6ff3c5bacd421e5839b92", - "hasInstallScript": true, + "node_modules/@types/xml2js": { + "version": "0.4.9", + "dev": true, "license": "MIT", - "optional": true, - "os": [ - "win32" - ] - }, - "node_modules/hpagent": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/hpagent/-/hpagent-0.1.2.tgz", - "integrity": "sha512-ePqFXHtSQWAFXYmj+JtOTHr84iNrII4/QRlAAPPE+zqnKy4xJo7Ie1Y4kC7AdB+LxLxSTTzBMASsEcy0q8YyvQ==", - "optional": true + "dependencies": { + "@types/node": "*" + } }, - "node_modules/http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + "node_modules/@types/yauzl": { + "version": "2.9.2", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/node": "*" + } }, - "node_modules/http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", + "node_modules/@typescript-eslint/eslint-plugin": { + "version": "5.59.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.1.tgz", + "integrity": "sha512-AVi0uazY5quFB9hlp2Xv+ogpfpk77xzsgsIEWyVS7uK/c7MZ5tw7ZPbapa0SbfkqE0fsAMkz5UwtgMLVk2BQAg==", + "dev": true, "dependencies": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" + "@eslint-community/regexpp": "^4.4.0", + "@typescript-eslint/scope-manager": "5.59.1", + "@typescript-eslint/type-utils": "5.59.1", + "@typescript-eslint/utils": "5.59.1", + "debug": "^4.3.4", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "natural-compare-lite": "^1.4.0", + "semver": "^7.3.7", + "tsutils": "^3.21.0" }, "engines": { - "node": ">= 0.6" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "@typescript-eslint/parser": "^5.0.0", + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", + "node_modules/@typescript-eslint/eslint-plugin/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", "dev": true, "dependencies": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" + "ms": "2.1.2" }, "engines": { - "node": ">=8.0.0" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/http-signature": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "optional": true, + "node_modules/@typescript-eslint/parser": { + "version": "5.59.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.59.1.tgz", + "integrity": "sha512-nzjFAN8WEu6yPRDizIFyzAfgK7nybPodMNFGNH0M9tei2gYnYszRDqVA0xlnRjkl7Hkx2vYrEdb6fP2a21cG1g==", + "dev": true, "dependencies": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" + "@typescript-eslint/scope-manager": "5.59.1", + "@typescript-eslint/types": "5.59.1", + "@typescript-eslint/typescript-estree": "5.59.1", + "debug": "^4.3.4" }, "engines": { - "node": ">=0.8", - "npm": ">=1.3.7" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/http2-wrapper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", + "node_modules/@typescript-eslint/parser/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.0.0" + "ms": "2.1.2" }, "engines": { - "node": ">=10.19.0" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "node_modules/@typescript-eslint/scope-manager": { + "version": "5.59.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.59.1.tgz", + "integrity": "sha512-mau0waO5frJctPuAzcxiNWqJR5Z8V0190FTSqRw1Q4Euop6+zTwHAf8YIXNwDOT29tyUDrQ65jSg9aTU/H0omA==", + "dev": true, "dependencies": { - "agent-base": "6", - "debug": "4" + "@typescript-eslint/types": "5.59.1", + "@typescript-eslint/visitor-keys": "5.59.1" }, "engines": { - "node": ">= 6" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "node_modules/@typescript-eslint/type-utils": { + "version": "5.59.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/type-utils/-/type-utils-5.59.1.tgz", + "integrity": "sha512-ZMWQ+Oh82jWqWzvM3xU+9y5U7MEMVv6GLioM3R5NJk6uvP47kZ7YvlgSHJ7ERD6bOY7Q4uxWm25c76HKEwIjZw==", + "dev": true, "dependencies": { - "safer-buffer": ">= 2.1.2 < 3" + "@typescript-eslint/typescript-estree": "5.59.1", + "@typescript-eslint/utils": "5.59.1", + "debug": "^4.3.4", + "tsutils": "^3.21.0" }, "engines": { - "node": ">=0.10.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "*" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=", - "dev": true - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "devOptional": true, + "node_modules/@typescript-eslint/type-utils/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, "dependencies": { - "once": "^1.3.0", - "wrappy": "1" + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "node_modules/@typescript-eslint/types": { + "version": "5.59.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.59.1.tgz", + "integrity": "sha512-dg0ICB+RZwHlysIy/Dh1SP+gnXNzwd/KS0JprD3Lmgmdq+dJAJnUPe1gNG34p0U19HvRlGX733d/KqscrGC1Pg==", + "dev": true, "engines": { - "node": ">= 0.10" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "node_modules/@typescript-eslint/typescript-estree": { + "version": "5.59.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.1.tgz", + "integrity": "sha512-lYLBBOCsFltFy7XVqzX0Ju+Lh3WPIAWxYpmH/Q7ZoqzbscLiCW00LeYCdsUnnfnj29/s1WovXKh2gwCoinHNGA==", "dev": true, "dependencies": { - "binary-extensions": "^2.0.0" + "@typescript-eslint/types": "5.59.1", + "@typescript-eslint/visitor-keys": "5.59.1", + "debug": "^4.3.4", + "globby": "^11.1.0", + "is-glob": "^4.0.3", + "semver": "^7.3.7", + "tsutils": "^3.21.0" }, "engines": { - "node": ">=8" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } } }, - "node_modules/is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==", - "bin": { - "is-docker": "cli.js" + "node_modules/@typescript-eslint/typescript-estree/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" }, "engines": { - "node": ">=8" + "node": ">=6.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "node_modules/@typescript-eslint/utils": { + "version": "5.59.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/utils/-/utils-5.59.1.tgz", + "integrity": "sha512-MkTe7FE+K1/GxZkP5gRj3rCztg45bEhsd8HYjczBuYm+qFHP5vtZmjx3B0yUCDotceQ4sHgTyz60Ycl225njmA==", "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@types/json-schema": "^7.0.9", + "@types/semver": "^7.3.12", + "@typescript-eslint/scope-manager": "5.59.1", + "@typescript-eslint/types": "5.59.1", + "@typescript-eslint/typescript-estree": "5.59.1", + "eslint-scope": "^5.1.1", + "semver": "^7.3.7" + }, "engines": { - "node": ">=0.10.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" + }, + "peerDependencies": { + "eslint": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "optional": true, + "node_modules/@typescript-eslint/visitor-keys": { + "version": "5.59.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.1.tgz", + "integrity": "sha512-6waEYwBTCWryx0VJmP7JaM4FpipLsFl9CvYf2foAE8Qh/Y0s+bxWysciwOs0LTBED4JCaNxTZ5rGadB14M6dwA==", + "dev": true, "dependencies": { - "number-is-nan": "^1.0.0" + "@typescript-eslint/types": "5.59.1", + "eslint-visitor-keys": "^3.3.0" }, "engines": { - "node": ">=0.10.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/typescript-eslint" } }, - "node_modules/is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "node_modules/@ungap/promise-all-settled": { + "version": "1.1.2", "dev": true, + "license": "ISC" + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "optional": true + }, + "node_modules/accepts": { + "version": "1.3.8", + "license": "MIT", "dependencies": { - "is-extglob": "^2.1.1" + "mime-types": "~2.1.34", + "negotiator": "0.6.3" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.6" } }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "node_modules/acorn": { + "version": "8.8.2", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.8.2.tgz", + "integrity": "sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw==", "dev": true, + "bin": { + "acorn": "bin/acorn" + }, "engines": { - "node": ">=0.12.0" + "node": ">=0.4.0" } }, - "node_modules/is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==", - "engines": { - "node": ">=0.10.0" + "node_modules/acorn-jsx": { + "version": "5.3.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.2.tgz", + "integrity": "sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==", + "dev": true, + "peerDependencies": { + "acorn": "^6.0.0 || ^7.0.0 || ^8.0.0" } }, - "node_modules/is-running": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-running/-/is-running-2.1.0.tgz", - "integrity": "sha1-MKc/9cw4VOT8JUkICen1q/jeCeA=", - "dev": true - }, - "node_modules/is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==", + "node_modules/acorn-walk": { + "version": "8.2.0", + "dev": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=0.4.0" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "optional": true - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true, + "node_modules/agent-base": { + "version": "6.0.2", + "license": "MIT", + "dependencies": { + "debug": "4" + }, "engines": { - "node": ">=10" + "node": ">= 6.0.0" + } + }, + "node_modules/agentkeepalive": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.2.1.tgz", + "integrity": "sha512-Zn4cw2NEqd+9fiSVWMscnjyQ1a8Yfoc5oBajLeo5w+YBHgDUcEBY2hS4YpTz6iN5f/2zQiktcuM6tS8x1p9dpA==", + "optional": true, + "dependencies": { + "debug": "^4.1.0", + "depd": "^1.1.2", + "humanize-ms": "^1.2.1" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": ">= 8.0.0" } }, - "node_modules/is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "optional": true, "dependencies": { - "is-docker": "^2.0.0" + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" }, "engines": { "node": ">=8" } }, - "node_modules/isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "node_modules/isbinaryfile": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", - "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", "dev": true, - "engines": { - "node": ">= 8.0.0" + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" }, "funding": { - "url": "https://github.com/sponsors/gjtorikian/" + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" } }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "node_modules/isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "optional": true + "node_modules/ansi-colors": { + "version": "4.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "node_modules/js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "node_modules/ansi-regex": { + "version": "2.1.1", "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "license": "MIT", "dependencies": { - "argparse": "^2.0.1" + "color-convert": "^2.0.1" }, - "bin": { - "js-yaml": "bin/js-yaml.js" + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, - "node_modules/jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true - }, - "node_modules/json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" - }, - "node_modules/json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "optional": true + "node_modules/anymatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } }, - "node_modules/json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "optional": true + "node_modules/append-field": { + "version": "1.0.0", + "license": "MIT" }, - "node_modules/json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "optional": true + "node_modules/aproba": { + "version": "2.0.0", + "devOptional": true, + "license": "ISC" }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, + "node_modules/are-we-there-yet": { + "version": "3.0.1", + "devOptional": true, + "license": "ISC", "dependencies": { - "universalify": "^2.0.0" + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", - "optional": true, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "3.6.0", + "devOptional": true, + "license": "MIT", "dependencies": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" }, "engines": { - "node": ">=0.6.0" + "node": ">= 6" } }, - "node_modules/jszip": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.9.1.tgz", - "integrity": "sha512-H9A60xPqJ1CuC4Ka6qxzXZeU8aNmgOeP5IFqwJbQQwtu2EUYxota3LdsiZWplF7Wgd9tkAd0mdu36nceSaPuYw==", + "node_modules/arg": { + "version": "4.1.3", "dev": true, - "dependencies": { - "lie": "~3.3.0", - "pako": "~1.0.2", - "readable-stream": "~2.3.6", - "set-immediate-shim": "~1.0.1" - } - }, - "node_modules/just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", - "dev": true + "license": "MIT" }, - "node_modules/karma": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.1.tgz", - "integrity": "sha512-Cj57NKOskK7wtFWSlMvZf459iX+kpYIPXmkNUzP2WAFcA7nhr/ALn5R7sw3w+1udFDcpMx/tuB8d5amgm3ijaA==", + "node_modules/argparse": { + "version": "2.0.1", "dev": true, - "dependencies": { - "@colors/colors": "1.5.0", - "body-parser": "^1.19.0", - "braces": "^3.0.2", - "chokidar": "^3.5.1", - "connect": "^3.7.0", - "di": "^0.0.1", - "dom-serialize": "^2.2.1", - "glob": "^7.1.7", - "graceful-fs": "^4.2.6", - "http-proxy": "^1.18.1", - "isbinaryfile": "^4.0.8", - "lodash": "^4.17.21", - "log4js": "^6.4.1", - "mime": "^2.5.2", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.5", - "qjobs": "^1.2.0", - "range-parser": "^1.2.1", - "rimraf": "^3.0.2", - "socket.io": "^4.4.1", - "source-map": "^0.6.1", - "tmp": "^0.2.1", - "ua-parser-js": "^0.7.30", - "yargs": "^16.1.1" - }, - "bin": { - "karma": "bin/karma" - }, - "engines": { - "node": ">= 10" - } + "license": "Python-2.0" }, - "node_modules/karma-browserstack-launcher": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/karma-browserstack-launcher/-/karma-browserstack-launcher-1.6.0.tgz", - "integrity": "sha512-Y/UWPdHZkHIVH2To4GWHCTzmrsB6H7PBWy6pw+TWz5sr4HW2mcE+Uj6qWgoVNxvQU1Pfn5LQQzI6EQ65p8QbiQ==", + "node_modules/array-buffer-byte-length": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-buffer-byte-length/-/array-buffer-byte-length-1.0.0.tgz", + "integrity": "sha512-LPuwb2P+NrQw3XhxGc36+XSvuBPopovXYTR9Ew++Du9Yb/bx5AzBfrIsBoj0EZUifjQU+sHL21sseZ3jerWO/A==", "dev": true, "dependencies": { - "browserstack": "~1.5.1", - "browserstack-local": "^1.3.7", - "q": "~1.5.0" + "call-bind": "^1.0.2", + "is-array-buffer": "^3.0.1" }, - "peerDependencies": { - "karma": ">=0.9" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/karma-chai": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/karma-chai/-/karma-chai-0.1.0.tgz", - "integrity": "sha1-vuWtQEAFF4Ea40u5RfdikJEIt5o=", + "node_modules/array-flatten": { + "version": "1.1.1", + "license": "MIT" + }, + "node_modules/array-from": { + "version": "2.1.1", "dev": true, - "peerDependencies": { - "chai": "*", - "karma": ">=0.10.9" - } + "license": "MIT" }, - "node_modules/karma-chrome-launcher": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", - "integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==", + "node_modules/array-includes": { + "version": "3.1.6", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.6.tgz", + "integrity": "sha512-sgTbLvL6cNnw24FnbaDyjmvddQ2ML8arZsgaJhoABMoplz/4QRhtrYS+alr1BUM1Bwp6dhx8vVCBSLG+StwOFw==", "dev": true, "dependencies": { - "fs-access": "^1.0.0", - "which": "^1.2.1" + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "get-intrinsic": "^1.1.3", + "is-string": "^1.0.7" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/karma-chrome-launcher/node_modules/which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "node_modules/array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", "dev": true, - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "which": "bin/which" + "engines": { + "node": ">=8" } }, - "node_modules/karma-edge-launcher": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/karma-edge-launcher/-/karma-edge-launcher-0.4.2.tgz", - "integrity": "sha512-YAJZb1fmRcxNhMIWYsjLuxwODBjh2cSHgTW/jkVmdpGguJjLbs9ZgIK/tEJsMQcBLUkO+yO4LBbqYxqgGW2HIw==", + "node_modules/array.prototype.flat": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flat/-/array.prototype.flat-1.3.1.tgz", + "integrity": "sha512-roTU0KWIOmJ4DRLmwKd19Otg0/mT3qPNt0Qb3GWW8iObuZXxrjB/pzn0R3hqpRSWg4HCwqx+0vwOnWnvlOyeIA==", "dev": true, "dependencies": { - "edge-launcher": "1.2.2" + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" }, "engines": { - "node": ">=4" + "node": ">= 0.4" }, - "peerDependencies": { - "karma": ">=0.9" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/karma-firefox-launcher": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-1.3.0.tgz", - "integrity": "sha512-Fi7xPhwrRgr+94BnHX0F5dCl1miIW4RHnzjIGxF8GaIEp7rNqX7LSi7ok63VXs3PS/5MQaQMhGxw+bvD+pibBQ==", + "node_modules/array.prototype.flatmap": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.3.1.tgz", + "integrity": "sha512-8UGn9O1FDVvMNB0UlLv4voxRMze7+FpHyF5mSMRjWHUMlpoDViniy05870VlxhfgTnLbpuwTzvD76MTtWxB/mQ==", "dev": true, "dependencies": { - "is-wsl": "^2.1.0" + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4", + "es-shim-unscopables": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/karma-fixture": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/karma-fixture/-/karma-fixture-0.2.6.tgz", - "integrity": "sha1-lxzqjCFtc/BwQ5ZMtz8Q4IMAGO8=", - "dev": true - }, - "node_modules/karma-html2js-preprocessor": { + "node_modules/assertion-error": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/karma-html2js-preprocessor/-/karma-html2js-preprocessor-1.1.0.tgz", - "integrity": "sha1-/Ant8Eu+K7bu6boZaPgmtziAIL0=", "dev": true, - "peerDependencies": { - "karma": ">=0.9" + "license": "MIT", + "engines": { + "node": "*" } }, - "node_modules/karma-ie-launcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/karma-ie-launcher/-/karma-ie-launcher-1.0.0.tgz", - "integrity": "sha1-SXmGhCxJAZA0bNifVJTKmDDG1Zw=", + "node_modules/atob-lite": { + "version": "2.0.0", + "license": "MIT" + }, + "node_modules/available-typed-arrays": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.5.tgz", + "integrity": "sha512-DMD0KiN46eipeziST1LPP/STfDU0sufISXmjSgvVsoU2tqxctQeASejWcfNtxYKqETM1UxQ8sp2OrSBWpHY6sw==", "dev": true, - "dependencies": { - "lodash": "^4.6.1" + "engines": { + "node": ">= 0.4" }, - "peerDependencies": { - "karma": ">=0.9" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/karma-json-fixtures-preprocessor": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/karma-json-fixtures-preprocessor/-/karma-json-fixtures-preprocessor-0.0.6.tgz", - "integrity": "sha1-T3ii6800OH+OVaur/2NGVRZMTHY=", - "dev": true + "node_modules/balanced-match": { + "version": "1.0.0", + "devOptional": true, + "license": "MIT" }, - "node_modules/karma-mocha": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", - "integrity": "sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ==", + "node_modules/base64id": { + "version": "2.0.0", "dev": true, - "dependencies": { - "minimist": "^1.2.3" + "license": "MIT", + "engines": { + "node": "^4.5.0 || >= 5.9" } }, - "node_modules/karma-mocha-reporter": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz", - "integrity": "sha1-FRIAlejtgZGG5HoLAS8810GJVWA=", - "dev": true, - "dependencies": { - "chalk": "^2.1.0", - "log-symbols": "^2.1.0", - "strip-ansi": "^4.0.0" - }, - "peerDependencies": { - "karma": ">=0.13" - } + "node_modules/before-after-hook": { + "version": "2.2.2", + "license": "Apache-2.0" }, - "node_modules/karma-mocha-reporter/node_modules/ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", + "node_modules/binary-extensions": { + "version": "2.2.0", "dev": true, + "license": "MIT", "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/karma-mocha-reporter/node_modules/ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "optional": true, "dependencies": { - "color-convert": "^1.9.0" - }, - "engines": { - "node": ">=4" + "file-uri-to-path": "1.0.0" } }, - "node_modules/karma-mocha-reporter/node_modules/chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, + "node_modules/body-parser": { + "version": "1.19.2", + "license": "MIT", "dependencies": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" + "bytes": "3.1.2", + "content-type": "~1.0.4", + "debug": "2.6.9", + "depd": "~1.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "on-finished": "~2.3.0", + "qs": "6.9.7", + "raw-body": "2.4.3", + "type-is": "~1.6.18" }, "engines": { - "node": ">=4" + "node": ">= 0.8" } }, - "node_modules/karma-mocha-reporter/node_modules/color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, + "node_modules/body-parser/node_modules/debug": { + "version": "2.6.9", + "license": "MIT", "dependencies": { - "color-name": "1.1.3" + "ms": "2.0.0" } }, - "node_modules/karma-mocha-reporter/node_modules/color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true + "node_modules/body-parser/node_modules/ms": { + "version": "2.0.0", + "license": "MIT" }, - "node_modules/karma-mocha-reporter/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true, - "engines": { - "node": ">=4" + "node_modules/brace-expansion": { + "version": "1.1.11", + "devOptional": true, + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" } }, - "node_modules/karma-mocha-reporter/node_modules/log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "node_modules/braces": { + "version": "3.0.2", "dev": true, + "license": "MIT", "dependencies": { - "chalk": "^2.0.1" + "fill-range": "^7.0.1" }, "engines": { - "node": ">=4" + "node": ">=8" } }, - "node_modules/karma-mocha-reporter/node_modules/strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "node_modules/browser-stdout": { + "version": "1.3.1", "dev": true, - "dependencies": { - "ansi-regex": "^3.0.0" - }, - "engines": { - "node": ">=4" - } + "license": "ISC" }, - "node_modules/karma-mocha-reporter/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/browserstack": { + "version": "1.5.3", "dev": true, + "license": "MIT", "dependencies": { - "has-flag": "^3.0.0" - }, - "engines": { - "node": ">=4" + "https-proxy-agent": "^2.2.1" } }, - "node_modules/karma-safari-launcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/karma-safari-launcher/-/karma-safari-launcher-1.0.0.tgz", - "integrity": "sha1-lpgqLMR9BmquccVTursoMZEVos4=", + "node_modules/browserstack-local": { + "version": "1.4.9", "dev": true, - "peerDependencies": { - "karma": ">=0.9" + "license": "MIT", + "dependencies": { + "https-proxy-agent": "^4.0.0", + "is-running": "^2.1.0", + "ps-tree": "=1.2.0", + "temp-fs": "^0.9.9" } }, - "node_modules/karma-teamcity-reporter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/karma-teamcity-reporter/-/karma-teamcity-reporter-1.1.0.tgz", - "integrity": "sha512-Ca1uhHGtNqUuzsnW3I+QykNuS/jF9vdxnIrkbLCVJRunCc6yWJq+ai1UobQT13j0e3JVUOf0mKo3QHZ6A6mG9Q==", + "node_modules/browserstack-local/node_modules/agent-base": { + "version": "5.1.1", "dev": true, - "peerDependencies": { - "karma": ">=0.9" + "license": "MIT", + "engines": { + "node": ">= 6.0.0" } }, - "node_modules/karma/node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "node_modules/browserstack-local/node_modules/https-proxy-agent": { + "version": "4.0.0", "dev": true, + "license": "MIT", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "agent-base": "5", + "debug": "4" }, "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/keyman": { - "resolved": "web", - "link": true - }, - "node_modules/keyv": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.2.2.tgz", - "integrity": "sha512-uYS0vKTlBIjNCAUqrjlxmruxOEiZxZIHXyp32sdcGmP+ukFrmWUnE//RcPXJH3Vxrni1H2gsQbjHE0bH7MtMQQ==", - "dependencies": { - "compress-brotli": "^1.3.6", - "json-buffer": "3.0.1" + "node": ">= 6.0.0" } }, - "node_modules/lie": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", - "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "node_modules/browserstack/node_modules/agent-base": { + "version": "4.3.0", "dev": true, + "license": "MIT", "dependencies": { - "immediate": "~3.0.5" + "es6-promisify": "^5.0.0" + }, + "engines": { + "node": ">= 4.0.0" } }, - "node_modules/linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "node_modules/browserstack/node_modules/debug": { + "version": "3.2.7", "dev": true, + "license": "MIT", "dependencies": { - "uc.micro": "^1.0.1" + "ms": "^2.1.1" } }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "node_modules/browserstack/node_modules/https-proxy-agent": { + "version": "2.2.4", "dev": true, + "license": "MIT", "dependencies": { - "p-locate": "^5.0.0" + "agent-base": "^4.3.0", + "debug": "^3.1.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">= 4.5.0" } }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" - }, - "node_modules/lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" + "node_modules/btoa-lite": { + "version": "1.0.0", + "license": "MIT" }, - "node_modules/lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==" + "node_modules/buffer-crc32": { + "version": "0.2.13", + "license": "MIT", + "engines": { + "node": "*" + } }, - "node_modules/lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==" + "node_modules/buffer-from": { + "version": "1.1.1", + "license": "MIT" }, - "node_modules/log4js": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.4.tgz", - "integrity": "sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw==", + "node_modules/builtins": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", "dev": true, "dependencies": { - "date-format": "^4.0.6", - "debug": "^4.3.4", - "flatted": "^3.2.5", - "rfdc": "^1.3.0", - "streamroller": "^3.0.6" - }, + "semver": "^7.0.0" + } + }, + "node_modules/bytes": { + "version": "3.1.2", + "license": "MIT", "engines": { - "node": ">=8.0" + "node": ">= 0.8" } }, - "node_modules/log4js/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/c8": { + "version": "7.12.0", "dev": true, + "license": "ISC", "dependencies": { - "ms": "2.1.2" + "@bcoe/v8-coverage": "^0.2.3", + "@istanbuljs/schema": "^0.1.3", + "find-up": "^5.0.0", + "foreground-child": "^2.0.0", + "istanbul-lib-coverage": "^3.2.0", + "istanbul-lib-report": "^3.0.0", + "istanbul-reports": "^3.1.4", + "rimraf": "^3.0.2", + "test-exclude": "^6.0.0", + "v8-to-istanbul": "^9.0.0", + "yargs": "^16.2.0", + "yargs-parser": "^20.2.9" }, - "engines": { - "node": ">=6.0" + "bin": { + "c8": "bin/c8.js" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/lolex": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", - "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", - "dev": true - }, - "node_modules/lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", "engines": { - "node": ">=8" + "node": ">=10.12.0" } }, - "node_modules/lru_map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=" - }, - "node_modules/lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "devOptional": true, + "node_modules/c8/node_modules/yargs-parser": { + "version": "20.2.9", + "dev": true, + "license": "ISC", "engines": { - "node": ">=12" + "node": ">=10" } }, - "node_modules/macos-release": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.5.0.tgz", - "integrity": "sha512-EIgv+QZ9r+814gjJj0Bt5vSLJLzswGmSUbUpbi9AIr/fsN2IWFBl2NucV9PAiek+U1STK468tEkxmVYUtuAN3g==", - "engines": { - "node": ">=6" + "node_modules/cacache": { + "version": "16.1.3", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-16.1.3.tgz", + "integrity": "sha512-/+Emcj9DAXxX4cwlLmRI9c166RuL3w30zp4R7Joiv2cQTtTtA+jeuCAjH3ZlGnYS3tKENSrKhAzVVP9GVyzeYQ==", + "optional": true, + "dependencies": { + "@npmcli/fs": "^2.1.0", + "@npmcli/move-file": "^2.0.0", + "chownr": "^2.0.0", + "fs-minipass": "^2.1.0", + "glob": "^8.0.1", + "infer-owner": "^1.0.4", + "lru-cache": "^7.7.1", + "minipass": "^3.1.6", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "mkdirp": "^1.0.4", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^9.0.0", + "tar": "^6.1.11", + "unique-filename": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "node_modules/map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", - "dev": true + "node_modules/cacache/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "optional": true, + "dependencies": { + "balanced-match": "^1.0.0" + } }, - "node_modules/markdown-it": { - "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", - "dev": true, + "node_modules/cacache/node_modules/glob": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", + "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "optional": true, "dependencies": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^5.0.1", + "once": "^1.3.0" }, - "bin": { - "markdown-it": "bin/markdown-it.js" + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", - "dev": true - }, - "node_modules/media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=", + "node_modules/cacache/node_modules/lru-cache": { + "version": "7.16.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.16.1.tgz", + "integrity": "sha512-9kkuMZHnLH/8qXARvYSjNvq8S1GYFFzynQTAfKeaJ0sIrR3PUPuu37Z+EiIANiZBvpfTf2B5y8ecDLSMWlLv+w==", + "optional": true, "engines": { - "node": ">= 0.6" + "node": ">=12" } }, - "node_modules/merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "node_modules/methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=", + "node_modules/cacache/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "optional": true, + "dependencies": { + "brace-expansion": "^2.0.1" + }, "engines": { - "node": ">= 0.6" + "node": ">=10" } }, - "node_modules/mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "dev": true, + "node_modules/cacache/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "optional": true, "bin": { - "mime": "cli.js" + "mkdirp": "bin/cmd.js" }, "engines": { - "node": ">=4.0.0" + "node": ">=10" } }, - "node_modules/mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "node_modules/cacheable-lookup": { + "version": "5.0.4", + "license": "MIT", "engines": { - "node": ">= 0.6" + "node": ">=10.6.0" } }, - "node_modules/mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "node_modules/cacheable-request": { + "version": "7.0.2", + "license": "MIT", "dependencies": { - "mime-db": "1.52.0" + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^4.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^6.0.1", + "responselike": "^2.0.0" }, "engines": { - "node": ">= 0.6" + "node": ">=8" } }, - "node_modules/mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", - "engines": { - "node": ">=4" - } - }, - "node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "devOptional": true, + "node_modules/call-bind": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", + "integrity": "sha512-7O+FbCihrB5WGbFYesctwmTKae6rOiIzmz1icreWJ+0aA7LJfuqhEso2T9ncpcFtzMQtzXf2QGGueWJGTYsqrA==", + "dev": true, "dependencies": { - "brace-expansion": "^1.1.7" + "function-bind": "^1.1.1", + "get-intrinsic": "^1.0.2" }, - "engines": { - "node": "*" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" - }, - "node_modules/minipass": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", - "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", - "optional": true, - "dependencies": { - "yallist": "^4.0.0" - }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true, "engines": { - "node": ">=8" + "node": ">=6" } }, - "node_modules/minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", - "optional": true, - "dependencies": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" - }, + "node_modules/camelcase": { + "version": "5.3.1", + "license": "MIT", "engines": { - "node": ">= 8" + "node": ">=6" } }, - "node_modules/mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", + "node_modules/chai": { + "version": "4.3.4", + "dev": true, + "license": "MIT", "dependencies": { - "minimist": "^1.2.6" + "assertion-error": "^1.1.0", + "check-error": "^1.0.2", + "deep-eql": "^3.0.1", + "get-func-name": "^2.0.0", + "pathval": "^1.1.1", + "type-detect": "^4.0.5" }, - "bin": { - "mkdirp": "bin/cmd.js" + "engines": { + "node": ">=4" } }, - "node_modules/mocha": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz", - "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", - "dev": true, + "node_modules/chalk": { + "version": "4.1.2", + "license": "MIT", "dependencies": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "nanoid": "3.3.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" }, "engines": { - "node": ">= 14.0.0" + "node": ">=10" }, "funding": { - "type": "opencollective", - "url": "https://opencollective.com/mochajs" + "url": "https://github.com/chalk/chalk?sponsor=1" } }, - "node_modules/mocha-teamcity-reporter": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mocha-teamcity-reporter/-/mocha-teamcity-reporter-4.0.0.tgz", - "integrity": "sha512-m+ADz1U7JNf3od4HrY5t4xAKIDamj1171WJCb8nrSuF+RIqP+AP4gq6UJ+U9nPVn2XO8y1nSs5bQ9Kxzelz6Nw==", + "node_modules/check-error": { + "version": "1.0.2", "dev": true, + "license": "MIT", "engines": { - "node": ">=6" - }, - "peerDependencies": { - "mocha": ">=6" + "node": "*" } }, - "node_modules/mocha/node_modules/chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", + "node_modules/chokidar": { + "version": "3.5.1", "dev": true, - "funding": [ - { - "type": "individual", - "url": "https://paulmillr.com/funding/" - } - ], + "license": "MIT", "dependencies": { - "anymatch": "~3.1.2", + "anymatch": "~3.1.1", "braces": "~3.0.2", - "glob-parent": "~5.1.2", + "glob-parent": "~5.1.0", "is-binary-path": "~2.1.0", "is-glob": "~4.0.1", "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" + "readdirp": "~3.5.0" }, "engines": { "node": ">= 8.10.0" }, "optionalDependencies": { - "fsevents": "~2.3.2" + "fsevents": "~2.3.1" } }, - "node_modules/mocha/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "dependencies": { - "ms": "2.1.2" - }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "optional": true, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=10" } }, - "node_modules/mocha/node_modules/debug/node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - }, - "node_modules/mocha/node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "optional": true, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=6" } }, - "node_modules/mocha/node_modules/glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", + "node_modules/cliui": { + "version": "7.0.4", "dev": true, + "license": "ISC", "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^7.0.0" + } + }, + "node_modules/cliui/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", "engines": { - "node": "*" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "node": ">=8" } }, - "node_modules/mocha/node_modules/glob/node_modules/minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "node_modules/cliui/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", "dev": true, - "dependencies": { - "brace-expansion": "^1.1.7" - }, + "license": "MIT", "engines": { - "node": "*" + "node": ">=8" } }, - "node_modules/mocha/node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "node_modules/cliui/node_modules/string-width": { + "version": "4.2.2", "dev": true, + "license": "MIT", "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=8" } }, - "node_modules/mocha/node_modules/minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", + "node_modules/cliui/node_modules/strip-ansi": { + "version": "6.0.0", "dev": true, + "license": "MIT", "dependencies": { - "brace-expansion": "^2.0.1" + "ansi-regex": "^5.0.0" }, "engines": { - "node": ">=10" + "node": ">=8" } }, - "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, + "node_modules/clone-response": { + "version": "1.0.2", + "license": "MIT", "dependencies": { - "balanced-match": "^1.0.0" + "mimic-response": "^1.0.0" } }, - "node_modules/mocha/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "node_modules/mocha/node_modules/nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", + "node_modules/code-point-at": { + "version": "1.1.0", "dev": true, - "bin": { - "nanoid": "bin/nanoid.cjs" - }, + "license": "MIT", "engines": { - "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" + "node": ">=0.10.0" } }, - "node_modules/mocha/node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, + "node_modules/color-convert": { + "version": "2.0.1", + "license": "MIT", "dependencies": { - "picomatch": "^2.2.1" + "color-name": "~1.1.4" }, "engines": { - "node": ">=8.10.0" + "node": ">=7.0.0" } }, - "node_modules/mocha/node_modules/serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dev": true, - "dependencies": { - "randombytes": "^2.1.0" + "node_modules/color-name": { + "version": "1.1.4", + "license": "MIT" + }, + "node_modules/color-support": { + "version": "1.1.3", + "devOptional": true, + "license": "ISC", + "bin": { + "color-support": "bin.js" } }, - "node_modules/mocha/node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "node_modules/component-emitter": { + "version": "1.3.0", "dev": true, + "license": "MIT" + }, + "node_modules/compress-brotli": { + "version": "1.3.6", + "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "@types/json-buffer": "~3.0.0", + "json-buffer": "~3.0.1" }, "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" + "node": ">= 12" } }, - "node_modules/mocha/node_modules/workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "dev": true + "node_modules/concat-map": { + "version": "0.0.1", + "devOptional": true, + "license": "MIT" }, - "node_modules/modernizr": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/modernizr/-/modernizr-3.12.0.tgz", - "integrity": "sha512-i5f5xfnxMOb3cePoBpwk4bWjVAyIB3hgm7QrDvZx/R7zUUS8PO9zlyQF7vJKn8kCVxEvL0nRWeZ0PPqVbY31sw==", - "dev": true, + "node_modules/concat-stream": { + "version": "1.6.2", + "engines": [ + "node >= 0.8" + ], + "license": "MIT", "dependencies": { - "doctrine": "^3.0.0", - "file": "^0.2.2", - "lodash": "^4.17.21", - "markdown-it": "^12.3.2", - "mkdirp": "0.5.5", - "requirejs": "^2.3.6", - "yargs": "^15.4.1" - }, - "bin": { - "modernizr": "bin/modernizr" - }, - "engines": { - "node": ">=8" + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^2.2.2", + "typedarray": "^0.0.6" } }, - "node_modules/modernizr/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/connect": { + "version": "3.7.0", "dev": true, + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "finalhandler": "1.1.2", + "parseurl": "~1.3.3", + "utils-merge": "1.0.1" + }, "engines": { - "node": ">=8" + "node": ">= 0.10.0" } }, - "node_modules/modernizr/node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", + "node_modules/connect/node_modules/debug": { + "version": "2.6.9", "dev": true, + "license": "MIT", "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" + "ms": "2.0.0" } }, - "node_modules/modernizr/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "node_modules/connect/node_modules/ms": { + "version": "2.0.0", "dev": true, + "license": "MIT" + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "devOptional": true, + "license": "ISC" + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "license": "MIT", "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" + "safe-buffer": "5.2.1" }, "engines": { - "node": ">=8" + "node": ">= 0.6" } }, - "node_modules/modernizr/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, + "node_modules/content-type": { + "version": "1.0.4", + "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 0.6" } }, - "node_modules/modernizr/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/convert-source-map": { + "version": "1.9.0", "dev": true, - "dependencies": { - "p-locate": "^4.1.0" - }, + "license": "MIT" + }, + "node_modules/cookie": { + "version": "0.4.2", + "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 0.6" } }, - "node_modules/modernizr/node_modules/mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", + "node_modules/cookie-signature": { + "version": "1.0.6", + "license": "MIT" + }, + "node_modules/copyfiles": { + "version": "2.4.1", "dev": true, + "license": "MIT", "dependencies": { - "minimist": "^1.2.5" + "glob": "^7.0.5", + "minimatch": "^3.0.3", + "mkdirp": "^1.0.4", + "noms": "0.0.0", + "through2": "^2.0.1", + "untildify": "^4.0.0", + "yargs": "^16.1.0" }, "bin": { - "mkdirp": "bin/cmd.js" + "copyfiles": "copyfiles", + "copyup": "copyfiles" } }, - "node_modules/modernizr/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "node_modules/copyfiles/node_modules/mkdirp": { + "version": "1.0.4", "dev": true, - "dependencies": { - "p-try": "^2.0.0" + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=10" } }, - "node_modules/modernizr/node_modules/p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "node_modules/core-util-is": { + "version": "1.0.3", + "license": "MIT" + }, + "node_modules/cors": { + "version": "2.8.5", "dev": true, + "license": "MIT", "dependencies": { - "p-limit": "^2.2.0" + "object-assign": "^4", + "vary": "^1" }, "engines": { - "node": ">=8" + "node": ">= 0.10" } }, - "node_modules/modernizr/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/create-require": { + "version": "1.1.1", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.3", "dev": true, + "license": "MIT", "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" }, "engines": { - "node": ">=8" + "node": ">= 8" } }, - "node_modules/modernizr/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/custom-event": { + "version": "1.0.1", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.1" - }, + "license": "MIT" + }, + "node_modules/date-format": { + "version": "4.0.6", + "dev": true, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=4.0" } }, - "node_modules/modernizr/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, + "node_modules/debug": { + "version": "4.3.1", + "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "ms": "2.1.2" }, "engines": { - "node": ">=8" + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/modernizr/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "node_modules/modernizr/node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - }, + "node_modules/decamelize": { + "version": "1.2.0", + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/modernizr/node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, + "node_modules/decompress-response": { + "version": "6.0.0", + "license": "MIT", "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "mimic-response": "^3.1.0" }, "engines": { - "node": ">=6" - } - }, - "node_modules/ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" - }, - "node_modules/negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", - "engines": { - "node": ">= 0.6" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ngrok": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ngrok/-/ngrok-4.3.1.tgz", - "integrity": "sha512-s0joO2liKYiGTVARyzL8hfLIXAZT03GDK3oJqsZK6d61Es+HCx77j8E9ysUbtkMEyvBgYmIMr8taQNsvQt4/DQ==", - "hasInstallScript": true, - "dependencies": { - "@types/node": "^8.10.50", - "extract-zip": "^2.0.1", - "got": "^11.5.1", - "lodash.clonedeep": "^4.5.0", - "uuid": "^7.0.0 || ^8.0.0", - "yaml": "^1.10.0" - }, - "bin": { - "ngrok": "bin/ngrok" - }, + "node_modules/decompress-response/node_modules/mimic-response": { + "version": "3.1.0", + "license": "MIT", "engines": { - "node": ">=10.19.0 <14 || >=14.2" + "node": ">=10" }, - "optionalDependencies": { - "hpagent": "^0.1.2" + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ngrok/node_modules/@types/node": { - "version": "8.10.66", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", - "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==" - }, - "node_modules/nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" - }, - "node_modules/nise": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz", - "integrity": "sha512-Ymbac/94xeIrMf59REBPOv0thr+CJVFMhrlAkW/gjCIE58BGQdCj0x7KRCb3yz+Ga2Rz3E9XXSvUyyxqqhjQAQ==", + "node_modules/deep-eql": { + "version": "3.0.1", "dev": true, + "license": "MIT", "dependencies": { - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "lolex": "^5.0.1", - "path-to-regexp": "^1.7.0" + "type-detect": "^4.0.0" + }, + "engines": { + "node": ">=0.12" } }, - "node_modules/nise/node_modules/isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "node_modules/deep-is": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", "dev": true }, - "node_modules/nise/node_modules/lolex": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-5.1.2.tgz", - "integrity": "sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==", - "dev": true, - "dependencies": { - "@sinonjs/commons": "^1.7.0" + "node_modules/defer-to-connect": { + "version": "2.0.1", + "license": "MIT", + "engines": { + "node": ">=10" } }, - "node_modules/nise/node_modules/path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "dependencies": { - "isarray": "0.0.1" + "node_modules/define-lazy-prop": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=8" } }, - "node_modules/node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", - "optional": true - }, - "node_modules/node-cleanup": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/node-cleanup/-/node-cleanup-2.1.2.tgz", - "integrity": "sha1-esGavSl+Caf3KnFUXZUbUX5N3iw=", - "dev": true - }, - "node_modules/node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", + "node_modules/define-properties": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.2.0.tgz", + "integrity": "sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==", + "dev": true, "dependencies": { - "whatwg-url": "^5.0.0" + "has-property-descriptors": "^1.0.0", + "object-keys": "^1.1.1" }, "engines": { - "node": "4.x || >=6.0.0" + "node": ">= 0.4" }, - "peerDependencies": { - "encoding": "^0.1.0" - }, - "peerDependenciesMeta": { - "encoding": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/node-gyp": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", - "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", - "optional": true, - "dependencies": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.3", - "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "request": "^2.88.2", - "rimraf": "^3.0.2", - "semver": "^7.3.2", - "tar": "^6.0.2", - "which": "^2.0.2" - }, - "bin": { - "node-gyp": "bin/node-gyp.js" - }, - "engines": { - "node": ">= 10.12.0" - } + "node_modules/delegates": { + "version": "1.0.0", + "devOptional": true, + "license": "MIT" }, - "node_modules/node-windows-trayicon": { - "name": "windows-trayicon", - "version": "3.0.0", - "resolved": "git+ssh://git@github.com/keymanapp/node-windows-trayicon.git#1e46786082213f3edcddd5953e33f5abdc7ea05f", - "hasInstallScript": true, + "node_modules/depd": { + "version": "1.1.2", "license": "MIT", - "optional": true, - "os": [ - "win32" - ], - "dependencies": { - "bindings": "^1.5.0", - "node-addon-api": "^3.1.0", - "node-gyp": "^7.1.2" + "engines": { + "node": ">= 0.6" } }, - "node_modules/noms": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", - "integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=", - "dev": true, - "dependencies": { - "inherits": "^2.0.1", - "readable-stream": "~1.0.31" - } + "node_modules/deprecation": { + "version": "2.3.1", + "license": "ISC" }, - "node_modules/noms/node_modules/isarray": { + "node_modules/destroy": { + "version": "1.0.4", + "license": "MIT" + }, + "node_modules/di": { "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true + "dev": true, + "license": "MIT" }, - "node_modules/noms/node_modules/readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", + "node_modules/diff": { + "version": "5.0.0", "dev": true, - "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" } }, - "node_modules/noms/node_modules/string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - }, - "node_modules/nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "optional": true, + "node_modules/dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, "dependencies": { - "abbrev": "1" - }, - "bin": { - "nopt": "bin/nopt.js" + "path-type": "^4.0.0" }, "engines": { - "node": ">=6" + "node": ">=8" } }, - "node_modules/normalize-path": { + "node_modules/doctrine": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", + "license": "Apache-2.0", "dependencies": { - "path-key": "^2.0.0" + "esutils": "^2.0.2" }, "engines": { - "node": ">=4" - } - }, - "node_modules/npm-run-path/node_modules/path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==", - "engines": { - "node": ">=4" + "node": ">=6.0.0" } }, - "node_modules/npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "optional": true, + "node_modules/dom-serialize": { + "version": "2.2.1", + "dev": true, + "license": "MIT", "dependencies": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" + "custom-event": "~1.0.0", + "ent": "~2.2.0", + "extend": "^3.0.0", + "void-elements": "^2.0.0" } }, - "node_modules/null-check": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz", - "integrity": "sha1-l33/1xdgErnsMNKjnbXPcqBDnt0=", + "node_modules/duplexer": { + "version": "0.1.2", "dev": true, - "engines": { - "node": ">=0.10.0" - } + "license": "MIT" }, - "node_modules/number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "optional": true, + "node_modules/edge-launcher": { + "version": "1.2.2", + "dev": true, + "license": "MIT" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "license": "MIT" + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">= 0.8" } }, - "node_modules/oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "node_modules/encoding": { + "version": "0.1.13", + "license": "MIT", "optional": true, - "engines": { - "node": "*" + "dependencies": { + "iconv-lite": "^0.6.2" } }, - "node_modules/object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, "engines": { "node": ">=0.10.0" } }, - "node_modules/octokit-pagination-methods": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", - "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==" - }, - "node_modules/on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", + "node_modules/end-of-stream": { + "version": "1.4.4", + "license": "MIT", "dependencies": { - "ee-first": "1.1.1" - }, - "engines": { - "node": ">= 0.8" + "once": "^1.4.0" } }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "node_modules/engine.io": { + "version": "6.1.3", + "dev": true, + "license": "MIT", "dependencies": { - "wrappy": "1" + "@types/cookie": "^0.4.1", + "@types/cors": "^2.8.12", + "@types/node": ">=10.0.0", + "accepts": "~1.3.4", + "base64id": "2.0.0", + "cookie": "~0.4.1", + "cors": "~2.8.5", + "debug": "~4.3.1", + "engine.io-parser": "~5.0.3", + "ws": "~8.2.3" + }, + "engines": { + "node": ">=10.0.0" } }, - "node_modules/open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", + "node_modules/engine.io-parser": { + "version": "5.0.3", + "dev": true, + "license": "MIT", "dependencies": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" + "@socket.io/base64-arraybuffer": "~1.0.2" }, "engines": { - "node": ">=12" + "node": ">=10.0.0" + } + }, + "node_modules/engine.io/node_modules/ws": { + "version": "8.2.3", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/ent": { + "version": "2.2.0", + "dev": true, + "license": "MIT" + }, + "node_modules/entities": { + "version": "2.1.0", + "dev": true, + "license": "BSD-2-Clause", "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/fb55/entities?sponsor=1" } }, - "node_modules/os-name": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", - "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", - "dependencies": { - "macos-release": "^2.2.0", - "windows-release": "^3.1.0" - }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "optional": true, "engines": { "node": ">=6" } }, - "node_modules/p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==", + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "optional": true + }, + "node_modules/es-abstract": { + "version": "1.21.2", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.21.2.tgz", + "integrity": "sha512-y/B5POM2iBnIxCiernH1G7rC9qQoM77lLIMQLuob0zhp8C56Po81+2Nj0WFKnd0pNReDTnkYryc+zhOzpEIROg==", + "dev": true, + "dependencies": { + "array-buffer-byte-length": "^1.0.0", + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "es-set-tostringtag": "^2.0.1", + "es-to-primitive": "^1.2.1", + "function.prototype.name": "^1.1.5", + "get-intrinsic": "^1.2.0", + "get-symbol-description": "^1.0.0", + "globalthis": "^1.0.3", + "gopd": "^1.0.1", + "has": "^1.0.3", + "has-property-descriptors": "^1.0.0", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "internal-slot": "^1.0.5", + "is-array-buffer": "^3.0.2", + "is-callable": "^1.2.7", + "is-negative-zero": "^2.0.2", + "is-regex": "^1.1.4", + "is-shared-array-buffer": "^1.0.2", + "is-string": "^1.0.7", + "is-typed-array": "^1.1.10", + "is-weakref": "^1.0.2", + "object-inspect": "^1.12.3", + "object-keys": "^1.1.1", + "object.assign": "^4.1.4", + "regexp.prototype.flags": "^1.4.3", + "safe-regex-test": "^1.0.0", + "string.prototype.trim": "^1.2.7", + "string.prototype.trimend": "^1.0.6", + "string.prototype.trimstart": "^1.0.6", + "typed-array-length": "^1.0.4", + "unbox-primitive": "^1.0.2", + "which-typed-array": "^1.1.9" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.0.1.tgz", + "integrity": "sha512-g3OMbtlwY3QewlqAiMLI47KywjWZoEytKr8pf6iTC8uJq5bIAH52Z9pnQ8pVL6whrCto53JZDuUIsifGeLorTg==", + "dev": true, + "dependencies": { + "get-intrinsic": "^1.1.3", + "has": "^1.0.3", + "has-tostringtag": "^1.0.0" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/p-finally": { + "node_modules/es-shim-unscopables": { "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==", - "engines": { - "node": ">=4" + "resolved": "https://registry.npmjs.org/es-shim-unscopables/-/es-shim-unscopables-1.0.0.tgz", + "integrity": "sha512-Jm6GPcCdC30eMLbZ2x8z2WuRwAws3zTBBKuusffYVUrNj/GVSUAZ+xKMaUpfNDR5IbyNA5LJbaecoUVbmUcB1w==", + "dev": true, + "dependencies": { + "has": "^1.0.3" } }, - "node_modules/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/es-to-primitive": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.1.tgz", + "integrity": "sha512-QCOllgZJtaUo9miYBcLChTUaHNjJF3PYs1VidD7AwiEj1kYxKeQTctLAezAOH5ZKRH0g2IgPn6KwB4IT8iRpvA==", "dev": true, "dependencies": { - "yocto-queue": "^0.1.0" + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" }, "engines": { - "node": ">=10" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/p-locate": { + "node_modules/es6-promise": { + "version": "4.2.8", + "dev": true, + "license": "MIT" + }, + "node_modules/es6-promisify": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", "dev": true, + "license": "MIT", "dependencies": { - "p-limit": "^3.0.2" + "es6-promise": "^4.0.3" + } + }, + "node_modules/es6-shim": { + "version": "0.35.6", + "license": "MIT" + }, + "node_modules/esbuild": { + "version": "0.15.18", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "bin": { + "esbuild": "bin/esbuild" }, "engines": { - "node": ">=10" + "node": ">=12" }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "optionalDependencies": { + "@esbuild/android-arm": "0.15.18", + "@esbuild/linux-loong64": "0.15.18", + "esbuild-android-64": "0.15.18", + "esbuild-android-arm64": "0.15.18", + "esbuild-darwin-64": "0.15.18", + "esbuild-darwin-arm64": "0.15.18", + "esbuild-freebsd-64": "0.15.18", + "esbuild-freebsd-arm64": "0.15.18", + "esbuild-linux-32": "0.15.18", + "esbuild-linux-64": "0.15.18", + "esbuild-linux-arm": "0.15.18", + "esbuild-linux-arm64": "0.15.18", + "esbuild-linux-mips64le": "0.15.18", + "esbuild-linux-ppc64le": "0.15.18", + "esbuild-linux-riscv64": "0.15.18", + "esbuild-linux-s390x": "0.15.18", + "esbuild-netbsd-64": "0.15.18", + "esbuild-openbsd-64": "0.15.18", + "esbuild-sunos-64": "0.15.18", + "esbuild-windows-32": "0.15.18", + "esbuild-windows-64": "0.15.18", + "esbuild-windows-arm64": "0.15.18" + } + }, + "node_modules/esbuild-darwin-64": { + "version": "0.15.18", + "cpu": [ + "x64" + ], + "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" } }, - "node_modules/p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "node_modules/escalade": { + "version": "3.1.1", + "dev": true, + "license": "MIT", "engines": { "node": ">=6" } }, - "node_modules/pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true + "node_modules/escape-html": { + "version": "1.0.3", + "license": "MIT" }, - "node_modules/parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "dev": true, + "license": "MIT", "engines": { - "node": ">= 0.8" + "node": ">=0.8.0" } }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "node_modules/eslint": { + "version": "8.39.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.39.0.tgz", + "integrity": "sha512-mwiok6cy7KTW7rBpo05k6+p4YVZByLNjAZ/ACB9DRCu4YDRwjXI01tWHp6KAUWelsBetTxKK/2sHB0vdS8Z2Og==", + "dev": true, + "dependencies": { + "@eslint-community/eslint-utils": "^4.2.0", + "@eslint-community/regexpp": "^4.4.0", + "@eslint/eslintrc": "^2.0.2", + "@eslint/js": "8.39.0", + "@humanwhocodes/config-array": "^0.11.8", + "@humanwhocodes/module-importer": "^1.0.1", + "@nodelib/fs.walk": "^1.2.8", + "ajv": "^6.10.0", + "chalk": "^4.0.0", + "cross-spawn": "^7.0.2", + "debug": "^4.3.2", + "doctrine": "^3.0.0", + "escape-string-regexp": "^4.0.0", + "eslint-scope": "^7.2.0", + "eslint-visitor-keys": "^3.4.0", + "espree": "^9.5.1", + "esquery": "^1.4.2", + "esutils": "^2.0.2", + "fast-deep-equal": "^3.1.3", + "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", + "glob-parent": "^6.0.2", + "globals": "^13.19.0", + "grapheme-splitter": "^1.0.4", + "ignore": "^5.2.0", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "is-glob": "^4.0.0", + "is-path-inside": "^3.0.3", + "js-sdsl": "^4.1.4", + "js-yaml": "^4.1.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.4.1", + "lodash.merge": "^4.6.2", + "minimatch": "^3.1.2", + "natural-compare": "^1.4.0", + "optionator": "^0.9.1", + "strip-ansi": "^6.0.1", + "strip-json-comments": "^3.1.0", + "text-table": "^0.2.0" + }, + "bin": { + "eslint": "bin/eslint.js" + }, "engines": { - "node": ">=8" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "devOptional": true, - "engines": { - "node": ">=0.10.0" + "node_modules/eslint-config-standard": { + "version": "17.0.0", + "resolved": "https://registry.npmjs.org/eslint-config-standard/-/eslint-config-standard-17.0.0.tgz", + "integrity": "sha512-/2ks1GKyqSOkH7JFvXJicu0iMpoojkwB+f5Du/1SC0PtBL+s8v30k9njRZ21pm2drKYm2342jFnGWzttxPmZVg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "peerDependencies": { + "eslint": "^8.0.1", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0", + "eslint-plugin-promise": "^6.0.0" } }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "node_modules/eslint-config-standard-with-typescript": { + "version": "34.0.1", + "resolved": "https://registry.npmjs.org/eslint-config-standard-with-typescript/-/eslint-config-standard-with-typescript-34.0.1.tgz", + "integrity": "sha512-J7WvZeLtd0Vr9F+v4dZbqJCLD16cbIy4U+alJMq4MiXdpipdBM3U5NkXaGUjePc4sb1ZE01U9g6VuTBpHHz1fg==", "dev": true, - "engines": { - "node": ">=8" + "dependencies": { + "@typescript-eslint/parser": "^5.43.0", + "eslint-config-standard": "17.0.0" + }, + "peerDependencies": { + "@typescript-eslint/eslint-plugin": "^5.43.0", + "eslint": "^8.0.1", + "eslint-plugin-import": "^2.25.2", + "eslint-plugin-n": "^15.0.0", + "eslint-plugin-promise": "^6.0.0", + "typescript": "*" } }, - "node_modules/path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", + "node_modules/eslint-import-resolver-node": { + "version": "0.3.7", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.7.tgz", + "integrity": "sha512-gozW2blMLJCeFpBwugLTGyvVjNoeo1knonXAcatC6bjPBZitotxdWf7Gimr25N4c0AAOo4eOUfaG82IJPDpqCA==", "dev": true, - "engines": { - "node": "*" + "dependencies": { + "debug": "^3.2.7", + "is-core-module": "^2.11.0", + "resolve": "^1.22.1" } }, - "node_modules/pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "node_modules/eslint-import-resolver-node/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, "dependencies": { - "through": "~2.3" + "ms": "^2.1.1" } }, - "node_modules/pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" - }, - "node_modules/performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "optional": true - }, - "node_modules/picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", + "node_modules/eslint-module-utils": { + "version": "2.8.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.8.0.tgz", + "integrity": "sha512-aWajIYfsqCKRDgUfjEXNN/JlrzauMuSEy5sbd7WXbtW3EH6A6MpwEh42c7qD+MqQo9QMJ6fWLAeIJynx0g6OAw==", "dev": true, + "dependencies": { + "debug": "^3.2.7" + }, "engines": { - "node": ">=8.6" + "node": ">=4" }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, - "node_modules/process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" - }, - "node_modules/progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "node_modules/eslint-module-utils/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", "dev": true, - "engines": { - "node": ">=0.4.0" + "dependencies": { + "ms": "^2.1.1" } }, - "node_modules/proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "node_modules/eslint-plugin-es": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", + "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", + "dev": true, "dependencies": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" + "eslint-utils": "^2.0.0", + "regexpp": "^3.0.0" }, "engines": { - "node": ">= 0.10" - } - }, - "node_modules/proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true + "node": ">=8.10.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=4.19.1" + } }, - "node_modules/ps-tree": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", - "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", + "node_modules/eslint-plugin-es/node_modules/eslint-utils": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "dependencies": { - "event-stream": "=3.3.4" + "eslint-visitor-keys": "^1.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + } + }, + "node_modules/eslint-plugin-es/node_modules/eslint-visitor-keys": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/eslint-plugin-import": { + "version": "2.27.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.27.5.tgz", + "integrity": "sha512-LmEt3GVofgiGuiE+ORpnvP+kAm3h6MLZJ4Q5HCyHADofsb4VzXFsRiWj3c0OFiV+3DWFh0qg3v9gcPlfc3zRow==", + "dev": true, + "dependencies": { + "array-includes": "^3.1.6", + "array.prototype.flat": "^1.3.1", + "array.prototype.flatmap": "^1.3.1", + "debug": "^3.2.7", + "doctrine": "^2.1.0", + "eslint-import-resolver-node": "^0.3.7", + "eslint-module-utils": "^2.7.4", + "has": "^1.0.3", + "is-core-module": "^2.11.0", + "is-glob": "^4.0.3", + "minimatch": "^3.1.2", + "object.values": "^1.1.6", + "resolve": "^1.22.1", + "semver": "^6.3.0", + "tsconfig-paths": "^3.14.1" + }, + "engines": { + "node": ">=4" + }, + "peerDependencies": { + "eslint": "^2 || ^3 || ^4 || ^5 || ^6 || ^7.2.0 || ^8" + } + }, + "node_modules/eslint-plugin-import/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/eslint-plugin-import/node_modules/doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "dependencies": { + "esutils": "^2.0.2" }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/eslint-plugin-import/node_modules/semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true, "bin": { - "ps-tree": "bin/ps-tree.js" + "semver": "bin/semver.js" + } + }, + "node_modules/eslint-plugin-n": { + "version": "15.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.7.0.tgz", + "integrity": "sha512-jDex9s7D/Qial8AGVIHq4W7NswpUD5DPDL2RH8Lzd9EloWUuvUkHfv4FRLMipH5q2UtyurorBkPeNi1wVWNh3Q==", + "dev": true, + "dependencies": { + "builtins": "^5.0.1", + "eslint-plugin-es": "^4.1.0", + "eslint-utils": "^3.0.0", + "ignore": "^5.1.1", + "is-core-module": "^2.11.0", + "minimatch": "^3.1.2", + "resolve": "^1.22.1", + "semver": "^7.3.8" }, "engines": { - "node": ">= 0.10" + "node": ">=12.22.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=7.0.0" } }, - "node_modules/psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "optional": true + "node_modules/eslint-plugin-promise": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.1.1.tgz", + "integrity": "sha512-tjqWDwVZQo7UIPMeDReOpUgHCmCiH+ePnVT+5zVapL0uuHnegBUs2smM13CzOs2Xb5+MHMRFTs9v24yjba4Oig==", + "dev": true, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "peerDependencies": { + "eslint": "^7.0.0 || ^8.0.0" + } }, - "node_modules/pump": { + "node_modules/eslint-scope": { + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.1.tgz", + "integrity": "sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw==", + "dev": true, + "dependencies": { + "esrecurse": "^4.3.0", + "estraverse": "^4.1.1" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/eslint-utils": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-3.0.0.tgz", + "integrity": "sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA==", + "dev": true, "dependencies": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "eslint-visitor-keys": "^2.0.0" + }, + "engines": { + "node": "^10.0.0 || ^12.0.0 || >= 14.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" + }, + "peerDependencies": { + "eslint": ">=5" } }, - "node_modules/punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "optional": true, + "node_modules/eslint-utils/node_modules/eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true, "engines": { - "node": ">=6" + "node": ">=10" } }, - "node_modules/q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", + "node_modules/eslint-visitor-keys": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz", + "integrity": "sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ==", "dev": true, "engines": { - "node": ">=0.6.0", - "teleport": ">=0.2.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/qjobs": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", + "node_modules/eslint/node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", "dev": true, "engines": { - "node": ">=0.9" + "node": ">=8" } }, - "node_modules/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==", + "node_modules/eslint/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "dev": true, + "dependencies": { + "ms": "2.1.2" + }, "engines": { - "node": ">=0.6" + "node": ">=6.0" }, - "funding": { - "url": "https://github.com/sponsors/ljharb" + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "node_modules/quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==", + "node_modules/eslint/node_modules/escape-string-regexp": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", + "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", + "dev": true, "engines": { "node": ">=10" }, @@ -5342,1363 +5186,1540 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "node_modules/eslint/node_modules/eslint-scope": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.2.0.tgz", + "integrity": "sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw==", "dev": true, "dependencies": { - "safe-buffer": "^5.1.0" + "esrecurse": "^4.3.0", + "estraverse": "^5.2.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "node_modules/eslint/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { - "node": ">= 0.6" + "node": ">=4.0" } }, - "node_modules/raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", + "node_modules/eslint/node_modules/glob-parent": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-6.0.2.tgz", + "integrity": "sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A==", + "dev": true, "dependencies": { - "bytes": "3.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "is-glob": "^4.0.3" }, "engines": { - "node": ">= 0.8" + "node": ">=10.13.0" } }, - "node_modules/readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "node_modules/eslint/node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, "dependencies": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "node_modules/readable-stream/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - }, - "node_modules/readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "node_modules/espree": { + "version": "9.5.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.5.1.tgz", + "integrity": "sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg==", "dev": true, "dependencies": { - "picomatch": "^2.2.1" + "acorn": "^8.8.0", + "acorn-jsx": "^5.3.2", + "eslint-visitor-keys": "^3.4.0" }, "engines": { - "node": ">=8.10.0" + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, - "node_modules/request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", - "optional": true, + "node_modules/esquery": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.5.0.tgz", + "integrity": "sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg==", + "dev": true, "dependencies": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" + "estraverse": "^5.1.0" }, "engines": { - "node": ">= 6" + "node": ">=0.10" } }, - "node_modules/request/node_modules/qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "optional": true, + "node_modules/esquery/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { - "node": ">=0.6" + "node": ">=4.0" } }, - "node_modules/request/node_modules/uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", - "optional": true, - "bin": { - "uuid": "bin/uuid" + "node_modules/esrecurse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", + "dev": true, + "dependencies": { + "estraverse": "^5.2.0" + }, + "engines": { + "node": ">=4.0" } }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=", + "node_modules/esrecurse/node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "dev": true, "engines": { - "node": ">=0.10.0" + "node": ">=4.0" } }, - "node_modules/require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" - }, - "node_modules/requirejs": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", - "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", + "node_modules/estraverse": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true, - "bin": { - "r_js": "bin/r.js", - "r.js": "bin/r.js" - }, "engines": { - "node": ">=0.4.0" + "node": ">=4.0" } }, - "node_modules/requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true + "node_modules/esutils": { + "version": "2.0.3", + "dev": true, + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } }, - "node_modules/resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" + "node_modules/etag": { + "version": "1.8.1", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } }, - "node_modules/responselike": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz", - "integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==", + "node_modules/event-stream": { + "version": "3.3.4", + "dev": true, + "license": "MIT", "dependencies": { - "lowercase-keys": "^2.0.0" + "duplexer": "~0.1.1", + "from": "~0", + "map-stream": "~0.1.0", + "pause-stream": "0.0.11", + "split": "0.3", + "stream-combiner": "~0.0.4", + "through": "~2.3.1" } }, - "node_modules/rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true + "node_modules/eventemitter3": { + "version": "4.0.7", + "license": "MIT" }, - "node_modules/rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "devOptional": true, + "node_modules/execa": { + "version": "1.0.0", + "license": "MIT", "dependencies": { - "glob": "^7.1.3" + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" }, - "bin": { - "rimraf": "bin.js" + "engines": { + "node": ">=6" + } + }, + "node_modules/execa/node_modules/cross-spawn": { + "version": "6.0.5", + "license": "MIT", + "dependencies": { + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" }, - "funding": { - "url": "https://github.com/sponsors/isaacs" + "engines": { + "node": ">=4.8" } }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] + "node_modules/execa/node_modules/get-stream": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=6" + } }, - "node_modules/safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "node_modules/execa/node_modules/path-key": { + "version": "2.0.1", + "license": "MIT", + "engines": { + "node": ">=4" + } }, - "node_modules/sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "node_modules/execa/node_modules/semver": { + "version": "5.7.1", + "license": "ISC", + "bin": { + "semver": "bin/semver" + } }, - "node_modules/semver": { - "version": "7.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", - "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", - "devOptional": true, + "node_modules/execa/node_modules/shebang-command": { + "version": "1.2.0", + "license": "MIT", "dependencies": { - "lru-cache": "^7.4.0" - }, - "bin": { - "semver": "bin/semver.js" + "shebang-regex": "^1.0.0" }, "engines": { - "node": "^10.0.0 || ^12.0.0 || ^14.0.0 || >=16.0.0" + "node": ">=0.10.0" } }, - "node_modules/send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", - "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", + "node_modules/execa/node_modules/shebang-regex": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/execa/node_modules/which": { + "version": "1.3.1", + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "which": "bin/which" + } + }, + "node_modules/express": { + "version": "4.17.3", + "license": "MIT", "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.19.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.4.2", + "cookie-signature": "1.0.6", "debug": "2.6.9", "depd": "~1.1.2", - "destroy": "~1.0.4", "encodeurl": "~1.0.2", "escape-html": "~1.0.3", "etag": "~1.8.1", + "finalhandler": "~1.1.2", "fresh": "0.5.2", - "http-errors": "1.8.1", - "mime": "1.6.0", - "ms": "2.1.3", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.9.7", "range-parser": "~1.2.1", - "statuses": "~1.5.0" + "safe-buffer": "5.2.1", + "send": "0.17.2", + "serve-static": "1.14.2", + "setprototypeof": "1.2.0", + "statuses": "~1.5.0", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" }, "engines": { - "node": ">= 0.8.0" + "node": ">= 0.10.0" } }, - "node_modules/send/node_modules/debug": { + "node_modules/express/node_modules/debug": { "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", "dependencies": { "ms": "2.0.0" } }, - "node_modules/send/node_modules/debug/node_modules/ms": { + "node_modules/express/node_modules/ms": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - }, - "node_modules/send/node_modules/mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", - "bin": { - "mime": "cli.js" - }, - "engines": { - "node": ">=4" - } + "license": "MIT" }, - "node_modules/send/node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" + "node_modules/extend": { + "version": "3.0.2", + "dev": true, + "license": "MIT" }, - "node_modules/serve-static": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", - "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", + "node_modules/extract-zip": { + "version": "2.0.1", + "license": "BSD-2-Clause", "dependencies": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.2" + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" }, "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/set-blocking": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "node_modules/set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true, - "engines": { - "node": ">=0.10.0" + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" } }, - "node_modules/setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "license": "MIT" }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "node_modules/fast-glob": { + "version": "3.2.12", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.2.12.tgz", + "integrity": "sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w==", "dev": true, "dependencies": { - "shebang-regex": "^3.0.0" + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.2", + "merge2": "^1.3.0", + "micromatch": "^4.0.4" }, "engines": { - "node": ">=8" + "node": ">=8.6.0" } }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true, - "engines": { - "node": ">=8" - } + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "dev": true }, - "node_modules/signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "node_modules/fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", + "dev": true }, - "node_modules/sinon": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.5.0.tgz", - "integrity": "sha512-AoD0oJWerp0/rY9czP/D6hDTTUYGpObhZjMpd7Cl/A6+j0xBE+ayL/ldfggkBXUs0IkvIiM1ljM8+WkOc5k78Q==", + "node_modules/fastq": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", + "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", "dev": true, "dependencies": { - "@sinonjs/commons": "^1.4.0", - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.3.3", - "diff": "^3.5.0", - "lolex": "^4.2.0", - "nise": "^1.5.2", - "supports-color": "^5.5.0" + "reusify": "^1.0.4" } }, - "node_modules/sinon/node_modules/diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true, - "engines": { - "node": ">=0.3.1" + "node_modules/fd-slicer": { + "version": "1.1.0", + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" } }, - "node_modules/sinon/node_modules/has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "node_modules/file": { + "version": "0.2.2", "dev": true, - "engines": { - "node": ">=4" - } + "license": "MIT" }, - "node_modules/sinon/node_modules/supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "node_modules/file-entry-cache": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", + "integrity": "sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg==", "dev": true, "dependencies": { - "has-flag": "^3.0.0" + "flat-cache": "^3.0.4" }, "engines": { - "node": ">=4" + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/socket.io": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.4.1.tgz", - "integrity": "sha512-s04vrBswdQBUmuWJuuNTmXUVJhP0cVky8bBDhdkf8y0Ptsu7fKU2LuLbts9g+pdmAdyMMn8F/9Mf1/wbtUN0fg==", + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "optional": true + }, + "node_modules/fill-range": { + "version": "7.0.1", "dev": true, + "license": "MIT", "dependencies": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "debug": "~4.3.2", - "engine.io": "~6.1.0", - "socket.io-adapter": "~2.3.3", - "socket.io-parser": "~4.0.4" + "to-regex-range": "^5.0.1" }, "engines": { - "node": ">=10.0.0" + "node": ">=8" } }, - "node_modules/socket.io-adapter": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz", - "integrity": "sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==", - "dev": true - }, - "node_modules/socket.io-parser": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.5.tgz", - "integrity": "sha512-sNjbT9dX63nqUFIOv95tTVm6elyIU4RvB1m8dOeZt+IgWwcWklFDOdmGcfo3zSiRsnR/3pJkjY5lfoGqEe4Eig==", - "dev": true, + "node_modules/finalhandler": { + "version": "1.1.2", + "license": "MIT", "dependencies": { - "@types/component-emitter": "^1.2.10", - "component-emitter": "~1.3.0", - "debug": "~4.3.1" + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "~2.3.0", + "parseurl": "~1.3.3", + "statuses": "~1.5.0", + "unpipe": "~1.0.0" }, "engines": { - "node": ">=10.0.0" + "node": ">= 0.8" } }, - "node_modules/socket.io/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/finalhandler/node_modules/debug": { + "version": "2.6.9", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/finalhandler/node_modules/ms": { + "version": "2.0.0", + "license": "MIT" + }, + "node_modules/find-up": { + "version": "5.0.0", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "locate-path": "^6.0.0", + "path-exists": "^4.0.0" }, "engines": { - "node": ">=6.0" + "node": ">=10" }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "node_modules/flat": { + "version": "5.0.2", "dev": true, - "engines": { - "node": ">=0.10.0" + "license": "BSD-3-Clause", + "bin": { + "flat": "cli.js" } }, - "node_modules/source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "node_modules/flat-cache": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-3.0.4.tgz", + "integrity": "sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==", "dev": true, "dependencies": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "flatted": "^3.1.0", + "rimraf": "^3.0.2" + }, + "engines": { + "node": "^10.12.0 || >=12.0.0" } }, - "node_modules/split": { + "node_modules/flatted": { + "version": "3.2.5", + "dev": true, + "license": "ISC" + }, + "node_modules/follow-redirects": { + "version": "1.14.9", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/for-each": { "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", + "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", + "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", "dev": true, "dependencies": { - "through": "2" - }, - "engines": { - "node": "*" + "is-callable": "^1.1.3" } }, - "node_modules/sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "optional": true, + "node_modules/foreground-child": { + "version": "2.0.0", + "dev": true, + "license": "ISC", "dependencies": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - }, - "bin": { - "sshpk-conv": "bin/sshpk-conv", - "sshpk-sign": "bin/sshpk-sign", - "sshpk-verify": "bin/sshpk-verify" + "cross-spawn": "^7.0.0", + "signal-exit": "^3.0.2" }, "engines": { - "node": ">=0.10.0" + "node": ">=8.0.0" } }, - "node_modules/statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=", + "node_modules/forwarded": { + "version": "0.2.0", + "license": "MIT", "engines": { "node": ">= 0.6" } }, - "node_modules/stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", - "dev": true, - "dependencies": { - "duplexer": "~0.1.1" + "node_modules/fresh": { + "version": "0.5.2", + "license": "MIT", + "engines": { + "node": ">= 0.6" } }, - "node_modules/streamroller": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.6.tgz", - "integrity": "sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==", + "node_modules/from": { + "version": "0.1.7", "dev": true, + "license": "MIT" + }, + "node_modules/fs-access": { + "version": "1.0.1", + "dev": true, + "license": "MIT", "dependencies": { - "date-format": "^4.0.6", - "debug": "^4.3.4", - "fs-extra": "^10.0.1" + "null-check": "^1.0.0" }, "engines": { - "node": ">=8.0" + "node": ">=0.10.0" } }, - "node_modules/streamroller/node_modules/debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "node_modules/fs-extra": { + "version": "10.0.1", "dev": true, + "license": "MIT", "dependencies": { - "ms": "2.1.2" + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" }, "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } + "node": ">=12" } }, - "node_modules/string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "optional": true, "dependencies": { - "safe-buffer": "~5.1.0" + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" } }, - "node_modules/string_decoder/node_modules/safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" + "node_modules/fs.realpath": { + "version": "1.0.0", + "devOptional": true, + "license": "ISC" }, - "node_modules/string-argv": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.1.2.tgz", - "integrity": "sha512-mBqPGEOMNJKXRo7z0keX0wlAhbBAjilUdPW13nN0PecVryZxdHIeM7TqbsSUA7VYuS00HGC6mojP7DlQzfa9ZA==", + "node_modules/fsevents": { + "version": "2.3.2", "dev": true, + "license": "MIT", + "optional": true, + "os": [ + "darwin" + ], "engines": { - "node": ">=0.6.19" + "node": "^8.16.0 || ^10.6.0 || >=11.0.0" } }, - "node_modules/string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "optional": true, + "node_modules/function-bind": { + "version": "1.1.1", + "dev": true, + "license": "MIT" + }, + "node_modules/function.prototype.name": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/function.prototype.name/-/function.prototype.name-1.1.5.tgz", + "integrity": "sha512-uN7m/BzVKQnCUF/iW8jYea67v++2u7m5UgENbHRtdDVclOUP+FMPlCNdmk0h/ysGyo2tavMJEDqJAkJdRa1vMA==", + "dev": true, "dependencies": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "call-bind": "^1.0.2", + "define-properties": "^1.1.3", + "es-abstract": "^1.19.0", + "functions-have-names": "^1.2.2" }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/string.prototype.codepointat": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz", - "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==" - }, - "node_modules/string.prototype.startswith": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/string.prototype.startswith/-/string.prototype.startswith-0.2.0.tgz", - "integrity": "sha1-2miYLjU6TprEpDtFCiBF0cRFrns=" + "node_modules/functions-have-names": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/functions-have-names/-/functions-have-names-1.2.3.tgz", + "integrity": "sha512-xckBUXyTIqT97tq2x2AMb+g163b5JFysYk0x4qxNFwbfQkmNZoiRHb6sPzI9/QV33WeuvVYBUIiD4NzNIyqaRQ==", + "dev": true, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "optional": true, + "node_modules/gauge": { + "version": "4.0.4", + "devOptional": true, + "license": "ISC", "dependencies": { - "ansi-regex": "^2.0.0" + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" }, "engines": { - "node": ">=0.10.0" + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "node_modules/strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==", + "node_modules/gauge/node_modules/ansi-regex": { + "version": "5.0.1", + "devOptional": true, + "license": "MIT", "engines": { - "node": ">=0.10.0" + "node": ">=8" } }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true, + "node_modules/gauge/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "devOptional": true, + "license": "MIT", "engines": { "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "node_modules/gauge/node_modules/string-width": { + "version": "4.2.3", + "devOptional": true, + "license": "MIT", "dependencies": { - "has-flag": "^4.0.0" + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" }, "engines": { "node": ">=8" } }, - "node_modules/tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "optional": true, + "node_modules/gauge/node_modules/strip-ansi": { + "version": "6.0.1", + "devOptional": true, + "license": "MIT", "dependencies": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" + "ansi-regex": "^5.0.1" }, "engines": { - "node": ">= 10" + "node": ">=8" } }, - "node_modules/tar/node_modules/mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "optional": true, - "bin": { - "mkdirp": "bin/cmd.js" - }, + "node_modules/gauge/node_modules/wide-align": { + "version": "1.1.5", + "devOptional": true, + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "license": "ISC", "engines": { - "node": ">=10" + "node": "6.* || 8.* || >= 10.*" } }, - "node_modules/temp-fs": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/temp-fs/-/temp-fs-0.9.9.tgz", - "integrity": "sha1-gHFzBDeHByDpQxUy/igUNk+IA9c=", + "node_modules/get-func-name": { + "version": "2.0.0", "dev": true, - "dependencies": { - "rimraf": "~2.5.2" - }, + "license": "MIT", "engines": { - "node": ">=0.8.0" + "node": "*" } }, - "node_modules/temp-fs/node_modules/rimraf": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=", + "node_modules/get-intrinsic": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.0.tgz", + "integrity": "sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q==", "dev": true, "dependencies": { - "glob": "^7.0.5" + "function-bind": "^1.1.1", + "has": "^1.0.3", + "has-symbols": "^1.0.3" }, - "bin": { - "rimraf": "bin.js" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "node_modules/through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", - "dev": true, + "node_modules/get-stream": { + "version": "5.2.0", + "license": "MIT", "dependencies": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "node_modules/get-symbol-description": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/get-symbol-description/-/get-symbol-description-1.0.0.tgz", + "integrity": "sha512-2EmdH1YvIQiZpltCNgkuiUnyukzxM/R6NDJX31Ke3BG1Nq5b0S2PhX59UKi9vZpPDQVdqn+1IcaAwnzTT5vCjw==", "dev": true, "dependencies": { - "rimraf": "^3.0.0" + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.1" }, "engines": { - "node": ">=8.17.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "node_modules/git-diff": { + "version": "2.0.6", "dev": true, + "license": "ISC", "dependencies": { - "is-number": "^7.0.0" + "chalk": "^2.3.2", + "diff": "^3.5.0", + "loglevel": "^1.6.1", + "shelljs": "^0.8.1", + "shelljs.exec": "^1.1.7" }, "engines": { - "node": ">=8.0" + "node": ">= 4.8.0" } }, - "node_modules/toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "node_modules/git-diff/node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, "engines": { - "node": ">=0.6" + "node": ">=4" } }, - "node_modules/tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "optional": true, + "node_modules/git-diff/node_modules/chalk": { + "version": "2.4.2", + "dev": true, + "license": "MIT", "dependencies": { - "psl": "^1.1.28", - "punycode": "^2.1.1" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" }, "engines": { - "node": ">=0.8" + "node": ">=4" } }, - "node_modules/tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "node_modules/ts-node": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", - "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", + "node_modules/git-diff/node_modules/color-convert": { + "version": "1.9.3", "dev": true, + "license": "MIT", "dependencies": { - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - }, - "bin": { - "ts-node": "dist/bin.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" - }, - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "typescript": ">=2.7" + "color-name": "1.1.3" } }, - "node_modules/ts-node/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "node_modules/git-diff/node_modules/color-name": { + "version": "1.1.3", + "dev": true, + "license": "MIT" + }, + "node_modules/git-diff/node_modules/diff": { + "version": "3.5.0", "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=0.3.1" } }, - "node_modules/tsc-watch": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/tsc-watch/-/tsc-watch-4.6.2.tgz", - "integrity": "sha512-eHWzZGkPmzXVGQKbqQgf3BFpGiZZw1jQ29ZOJeaSe8JfyUvphbd221NfXmmsJUGGPGA/nnaSS01tXipUcyxAxg==", + "node_modules/git-diff/node_modules/has-flag": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/git-diff/node_modules/supports-color": { + "version": "5.5.0", "dev": true, + "license": "MIT", "dependencies": { - "cross-spawn": "^7.0.3", - "node-cleanup": "^2.1.2", - "ps-tree": "^1.2.0", - "string-argv": "^0.1.1", - "strip-ansi": "^6.0.0" + "has-flag": "^3.0.0" }, - "bin": { - "tsc-watch": "index.js" + "engines": { + "node": ">=4" + } + }, + "node_modules/glob": { + "version": "7.1.6", + "devOptional": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "engines": { - "node": ">=8.17.0" + "node": "*" }, - "peerDependencies": { - "typescript": "*" + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "node_modules/tsc-watch/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/glob-parent": { + "version": "5.1.2", "dev": true, + "license": "ISC", + "dependencies": { + "is-glob": "^4.0.1" + }, "engines": { - "node": ">=8" + "node": ">= 6" } }, - "node_modules/tsc-watch/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/globals": { + "version": "13.20.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.20.0.tgz", + "integrity": "sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.1" + "type-fest": "^0.20.2" }, "engines": { "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "node_modules/tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==", + "node_modules/globalthis": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/globalthis/-/globalthis-1.0.3.tgz", + "integrity": "sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==", + "dev": true, + "dependencies": { + "define-properties": "^1.1.3" + }, "engines": { - "node": ">=0.6.11 <=0.7.0 || >=0.7.3" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "optional": true, + "node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, "dependencies": { - "safe-buffer": "^5.0.1" + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" }, "engines": { - "node": "*" + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true + "node_modules/google-closure-compiler-java": { + "version": "20200224.0.0", + "dev": true, + "license": "Apache-2.0" }, - "node_modules/type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", "dev": true, - "engines": { - "node": ">=4" + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "node_modules/got": { + "version": "11.8.5", + "license": "MIT", "dependencies": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" + "@sindresorhus/is": "^4.0.0", + "@szmarczak/http-timer": "^4.0.5", + "@types/cacheable-request": "^6.0.1", + "@types/responselike": "^1.0.0", + "cacheable-lookup": "^5.0.3", + "cacheable-request": "^7.0.2", + "decompress-response": "^6.0.0", + "http2-wrapper": "^1.0.0-beta.5.2", + "lowercase-keys": "^2.0.0", + "p-cancelable": "^2.0.0", + "responselike": "^2.0.0" }, "engines": { - "node": ">= 0.6" + "node": ">=10.19.0" + }, + "funding": { + "url": "https://github.com/sindresorhus/got?sponsor=1" } }, - "node_modules/typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" + "node_modules/graceful-fs": { + "version": "4.2.10", + "devOptional": true, + "license": "ISC" }, - "node_modules/typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==", - "bin": { - "tsc": "bin/tsc", - "tsserver": "bin/tsserver" - }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, + "node_modules/growl": { + "version": "1.10.5", + "dev": true, + "license": "MIT", "engines": { - "node": ">=4.2.0" + "node": ">=4.x" } }, - "node_modules/ua-parser-js": { - "version": "0.7.33", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.33.tgz", - "integrity": "sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==", + "node_modules/has": { + "version": "1.0.3", "dev": true, - "funding": [ - { - "type": "opencollective", - "url": "https://opencollective.com/ua-parser-js" - }, - { - "type": "paypal", - "url": "https://paypal.me/faisalman" - } - ], + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.1" + }, "engines": { - "node": "*" + "node": ">= 0.4.0" } }, - "node_modules/uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true - }, - "node_modules/universal-user-agent": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - }, - "node_modules/universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", + "node_modules/has-bigints": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", + "integrity": "sha512-tSvCKtBr9lkF0Ex0aQiP9N+OpV4zi2r/Nee5VkRDbaqv35RLYMzbwQfFSZZH0kR+Rd6302UJZ2p/bJCEoR3VoQ==", "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, - "node_modules/unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=", - "engines": { - "node": ">= 0.8" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/untildify": { + "node_modules/has-flag": { "version": "4.0.0", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", - "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", - "dev": true, + "license": "MIT", "engines": { "node": ">=8" } }, - "node_modules/uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "optional": true, + "node_modules/has-property-descriptors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz", + "integrity": "sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==", + "dev": true, "dependencies": { - "punycode": "^2.1.0" + "get-intrinsic": "^1.1.1" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "node_modules/utils-merge": { + "node_modules/has-proto": { "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.1.tgz", + "integrity": "sha512-7qE+iP+O+bgF9clE5+UoBFzE65mlBiVj3tKCrlNQ0Ogwm0BjpT/gK4SlLYDMybDh5I3TCTKnPPa0oMG7JDYrhg==", + "dev": true, "engines": { - "node": ">= 0.4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", - "bin": { - "uuid": "dist/bin/uuid" + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "dev": true, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, - "node_modules/vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=", + "node_modules/has-tostringtag": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.0.tgz", + "integrity": "sha512-kFjcSNhnlGV1kyoGk7OXKSawH5JOb/LzUc5w9B02hOTO0dfFRjbHQKvg1d6cf3HbeUmtU9VbbV3qzZ2Teh97WQ==", + "dev": true, + "dependencies": { + "has-symbols": "^1.0.2" + }, "engines": { - "node": ">= 0.8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "engines": [ - "node >=0.6.0" - ], + "node_modules/has-unicode": { + "version": "2.0.1", + "devOptional": true, + "license": "ISC" + }, + "node_modules/he": { + "version": "1.2.0", + "dev": true, + "license": "MIT", + "bin": { + "he": "bin/he" + } + }, + "node_modules/hetrodo-node-hide-console-window-napi": { + "name": "node-hide-console-window", + "version": "2.0.1", + "resolved": "git+ssh://git@github.com/keymanapp/hetrodo-node-hide-console-window-napi.git#858b23036a9963b40ad6ff3c5bacd421e5839b92", + "license": "MIT", "optional": true, - "dependencies": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" + "os": [ + "win32" + ] + }, + "node_modules/hexy": { + "version": "0.3.4", + "dev": true, + "license": "MIT", + "bin": { + "hexy": "bin/hexy_cmd.js" + }, + "engines": { + "node": ">=10.4" } }, - "node_modules/verror/node_modules/core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", + "node_modules/hpagent": { + "version": "0.1.2", + "license": "MIT", "optional": true }, - "node_modules/void-elements": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", + "node_modules/html-escaper": { + "version": "2.0.2", "dev": true, + "license": "MIT" + }, + "node_modules/http-cache-semantics": { + "version": "4.1.0", + "license": "BSD-2-Clause" + }, + "node_modules/http-errors": { + "version": "1.8.1", + "license": "MIT", + "dependencies": { + "depd": "~1.1.2", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": ">= 1.5.0 < 2", + "toidentifier": "1.0.1" + }, "engines": { - "node": ">=0.10.0" + "node": ">= 0.6" } }, - "node_modules/webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "node_modules/http-proxy": { + "version": "1.18.1", + "dev": true, + "license": "MIT", + "dependencies": { + "eventemitter3": "^4.0.0", + "follow-redirects": "^1.0.0", + "requires-port": "^1.0.0" + }, + "engines": { + "node": ">=8.0.0" + } }, - "node_modules/whatwg-url": { + "node_modules/http-proxy-agent": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-5.0.0.tgz", + "integrity": "sha512-n2hY8YdoRE1i7r6M0w9DIw5GgZN0G25P8zLCRQ8rjXtTU3vsNFBI/vWK/UIeE6g5MUUz6avwAPXmL6Fy9D/90w==", + "optional": true, "dependencies": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "@tootallnate/once": "2", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" } }, - "node_modules/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "devOptional": true, + "node_modules/http2-wrapper": { + "version": "1.0.3", + "license": "MIT", "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" + "quick-lru": "^5.1.1", + "resolve-alpn": "^1.0.0" }, "engines": { - "node": ">= 8" + "node": ">=10.19.0" } }, - "node_modules/which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + "node_modules/https-proxy-agent": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } }, - "node_modules/wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", "optional": true, "dependencies": { - "string-width": "^1.0.2 || 2" + "ms": "^2.0.0" } }, - "node_modules/windows-release": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.3.tgz", - "integrity": "sha512-OSOGH1QYiW5yVor9TtmXKQvt2vjQqbYS+DqmsZw+r7xDwLXEeT3JGW0ZppFmHx4diyXmxt238KFR3N9jzevBRg==", + "node_modules/iconv-lite": { + "version": "0.4.24", + "license": "MIT", "dependencies": { - "execa": "^1.0.0" + "safer-buffer": ">= 2.1.2 < 3" }, "engines": { - "node": ">=6" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node": ">=0.10.0" } }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "node_modules/ignore": { + "version": "5.2.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.4.tgz", + "integrity": "sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ==", + "dev": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/immediate": { + "version": "3.0.6", + "license": "MIT" + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", "dev": true, "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" }, "engines": { - "node": ">=10" + "node": ">=6" }, "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/wrap-ansi/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "devOptional": true, "engines": { - "node": ">=8" + "node": ">=0.8.19" } }, - "node_modules/wrap-ansi/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, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "optional": true, "engines": { "node": ">=8" } }, - "node_modules/wrap-ansi/node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "optional": true + }, + "node_modules/inflight": { + "version": "1.0.6", + "devOptional": true, + "license": "ISC", + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "license": "ISC" + }, + "node_modules/internal-slot": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/internal-slot/-/internal-slot-1.0.5.tgz", + "integrity": "sha512-Y+R5hJrzs52QCG2laLn4udYVnxsfny9CpOhNhUvk/SSSVyF6T27FzRbF0sroPidSu3X8oEAkOn2K804mjpt6UQ==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "get-intrinsic": "^1.2.0", + "has": "^1.0.3", + "side-channel": "^1.0.4" }, "engines": { - "node": ">=8" + "node": ">= 0.4" } }, - "node_modules/wrap-ansi/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "node_modules/interpret": { + "version": "1.4.0", "dev": true, - "dependencies": { - "ansi-regex": "^5.0.0" - }, + "license": "MIT", "engines": { - "node": ">=8" + "node": ">= 0.10" } }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" + "node_modules/ip": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ip/-/ip-2.0.0.tgz", + "integrity": "sha512-WKa+XuLG1A1R0UWhl2+1XQSi+fZWMsYKffMZTTYsiZaUD8k2yDAj5atimTUD2TZkyCkNEeYE5NhFZmupOGtjYQ==", + "optional": true }, - "node_modules/ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", + "node_modules/ipaddr.js": { + "version": "1.9.1", + "license": "MIT", "engines": { - "node": ">=10.0.0" + "node": ">= 0.10" + } + }, + "node_modules/is-array-buffer": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/is-array-buffer/-/is-array-buffer-3.0.2.tgz", + "integrity": "sha512-y+FyyR/w8vfIRq4eQcM1EYgSTnmHXPqaF+IgzgraytCFq5Xh8lllDVmAZolPJiZttZLeFSINPYMaEJ7/vWUa1w==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.2.0", + "is-typed-array": "^1.1.10" }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-bigint": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-bigint/-/is-bigint-1.0.4.tgz", + "integrity": "sha512-zB9CruMamjym81i2JZ3UMn54PKGsQzsJeo6xvN3HJJ4CAsQNB6iRutp2To77OfCNuoxspsIhzaPoO1zyCEhFOg==", + "dev": true, + "dependencies": { + "has-bigints": "^1.0.1" }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", + "node_modules/is-binary-path": { + "version": "2.1.0", + "dev": true, + "license": "MIT", "dependencies": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" + "binary-extensions": "^2.0.0" }, "engines": { - "node": ">=4.0.0" + "node": ">=8" } }, - "node_modules/xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==", + "node_modules/is-boolean-object": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/is-boolean-object/-/is-boolean-object-1.1.2.tgz", + "integrity": "sha512-gDYaKHJmnj4aWxyj6YHyXVpdQawtVLHU5cb+eztPGczf6cjuTdwve5ZIEfgXqH4e57An1D1AKf8CZ3kYrQRqYA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, "engines": { - "node": ">=4.0" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "node_modules/is-callable": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", + "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", + "dev": true, "engines": { - "node": ">=0.4" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "node_modules/is-core-module": { + "version": "2.11.0", "dev": true, - "engines": { - "node": ">=10" + "license": "MIT", + "dependencies": { + "has": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "optional": true + "node_modules/is-date-object": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.5.tgz", + "integrity": "sha512-9YQaSxsAiSwcvS33MBk3wTCVnWK+HhF8VZR2jRxehM16QcVOdHqPn4VPHmRK4lSr38n9JriurInLcP90xsYNfQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "node_modules/yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==", + "node_modules/is-docker": { + "version": "2.2.1", + "license": "MIT", + "bin": { + "is-docker": "cli.js" + }, "engines": { - "node": ">= 6" + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "node_modules/is-extglob": { + "version": "2.1.1", "dev": true, - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", + "node_modules/is-fullwidth-code-point": { + "version": "1.0.0", "dev": true, + "license": "MIT", + "dependencies": { + "number-is-nan": "^1.0.0" + }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", + "node_modules/is-glob": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", + "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", "dev": true, "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" + "is-extglob": "^2.1.1" }, "engines": { - "node": ">=10" + "node": ">=0.10.0" } }, - "node_modules/yargs-unparser/node_modules/camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "optional": true + }, + "node_modules/is-negative-zero": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/is-negative-zero/-/is-negative-zero-2.0.2.tgz", + "integrity": "sha512-dqJvarLawXsFbNDeJW7zAz8ItJ9cd28YufuuFzh0G8pNHjJMnY08Dv7sYX2uF5UpQOwieAeOExEYAWWfu7ZZUA==", "dev": true, "engines": { - "node": ">=10" + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/yargs-unparser/node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", + "node_modules/is-number": { + "version": "7.0.0", "dev": true, + "license": "MIT", "engines": { - "node": ">=10" + "node": ">=0.12.0" + } + }, + "node_modules/is-number-object": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-number-object/-/is-number-object-1.0.7.tgz", + "integrity": "sha512-k1U0IRzLMo7ZlYIfzRu23Oh6MiIFasgpb9X76eqfFZAqwH44UI4KTBvBYIZ1dSL9ZzChTB9ShHfLkR4pdW5krQ==", + "dev": true, + "dependencies": { + "has-tostringtag": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" }, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/yargs-unparser/node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", "dev": true, "engines": { "node": ">=8" } }, - "node_modules/yargs/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true, + "node_modules/is-plain-object": { + "version": "5.0.0", + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "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==", + "node_modules/is-regex": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.1.4.tgz", + "integrity": "sha512-kvRdxDsxZjhzUX07ZnLydzS1TU/TJlTUHHY4YLL87e37oUA49DfkLqgy+VjFocowy29cKvcSiu+kIv728jTTVg==", "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "has-tostringtag": "^1.0.0" + }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/yargs/node_modules/string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", + "node_modules/is-running": { + "version": "2.1.0", + "dev": true, + "license": "BSD" + }, + "node_modules/is-shared-array-buffer": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-shared-array-buffer/-/is-shared-array-buffer-1.0.2.tgz", + "integrity": "sha512-sqN2UDu1/0y6uvXyStCOzyhAjCSlHceFoMKJW8W9EU9cvic/QdsZ0kEU93HEy3IUEFZIiH/3w+AH/UQbPHNdhA==", "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" + "call-bind": "^1.0.2" }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/is-stream": { + "version": "1.1.0", + "license": "MIT", "engines": { - "node": ">=8" + "node": ">=0.10.0" } }, - "node_modules/yargs/node_modules/strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "node_modules/is-string": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.7.tgz", + "integrity": "sha512-tE2UXzivje6ofPW7l23cjDOMa09gb7xlAqG6jG5ej6uPV32TlWP3NKPigtaGeHNu9fohccRYvIiZMfOOnOYUtg==", "dev": true, "dependencies": { - "ansi-regex": "^5.0.0" + "has-tostringtag": "^1.0.0" }, "engines": { - "node": ">=8" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", + "node_modules/is-symbol": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.4.tgz", + "integrity": "sha512-C/CPBqKWnvdcxqIARxyOh4v1UUEOCHpgDa0WYgpKDFMszcrPcffg5uhwSgPCLD2WWxmq6isisz87tzT01tuGhg==", + "dev": true, "dependencies": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" + "has-symbols": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", + "node_modules/is-typed-array": { + "version": "1.1.10", + "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.10.tgz", + "integrity": "sha512-PJqgEHiWZvMpaFZ3uTc8kHPM4+4ADTlDniuQL7cU/UDA0Ql7F70yGfHph3cLNe+c9toaigv+DFzTJKhc2CtO6A==", "dev": true, + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0" + }, "engines": { - "node": ">=6" + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "node_modules/yocto-queue": { + "node_modules/is-unicode-supported": { "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", "dev": true, + "license": "MIT", "engines": { "node": ">=10" }, @@ -6706,5586 +6727,3862 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "resources/build/version": { - "name": "@keymanapp/auto-history-action", - "license": "MIT", + "node_modules/is-weakref": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-weakref/-/is-weakref-1.0.2.tgz", + "integrity": "sha512-qctsuLZmIQ0+vSSMfoVvyFe2+GSEvnmZ2ezTup1SBse9+twCCeial6EEi3Nc2KFcf6+qz2FBPnjXsk8xhKSaPQ==", + "dev": true, "dependencies": { - "@actions/core": "^1.9.1", - "@actions/github": "^2.1.0", - "typescript": "^4.5.4", - "yargs": "^15.1.0" - }, - "devDependencies": { - "@types/node": "^13.7.0", - "@types/semver": "^7.1.0", - "semver": "^7.1.2", - "ts-node": "^8.6.2" + "call-bind": "^1.0.2" }, - "engines": { - "node": "16" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "resources/build/version/node_modules/@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==", - "dev": true - }, - "resources/build/version/node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "node_modules/is-wsl": { + "version": "2.2.0", + "license": "MIT", + "dependencies": { + "is-docker": "^2.0.0" + }, "engines": { "node": ">=8" } }, - "resources/build/version/node_modules/cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } + "node_modules/isarray": { + "version": "1.0.0", + "license": "MIT" }, - "resources/build/version/node_modules/diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "node_modules/isbinaryfile": { + "version": "4.0.10", "dev": true, + "license": "MIT", "engines": { - "node": ">=0.3.1" + "node": ">= 8.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/gjtorikian/" } }, - "resources/build/version/node_modules/find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dependencies": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - }, + "node_modules/isexe": { + "version": "2.0.0", + "license": "ISC" + }, + "node_modules/istanbul-lib-coverage": { + "version": "3.2.0", + "dev": true, + "license": "BSD-3-Clause", "engines": { "node": ">=8" } }, - "resources/build/version/node_modules/is-fullwidth-code-point": { + "node_modules/istanbul-lib-report": { "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": "BSD-3-Clause", + "dependencies": { + "istanbul-lib-coverage": "^3.0.0", + "make-dir": "^3.0.0", + "supports-color": "^7.1.0" + }, "engines": { "node": ">=8" } }, - "resources/build/version/node_modules/locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "node_modules/istanbul-reports": { + "version": "3.1.5", + "dev": true, + "license": "BSD-3-Clause", "dependencies": { - "p-locate": "^4.1.0" + "html-escaper": "^2.0.0", + "istanbul-lib-report": "^3.0.0" }, "engines": { "node": ">=8" } }, - "resources/build/version/node_modules/p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dependencies": { - "p-try": "^2.0.0" - }, - "engines": { - "node": ">=6" - }, + "node_modules/js-sdsl": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.4.0.tgz", + "integrity": "sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg==", + "dev": true, "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" } }, - "resources/build/version/node_modules/p-locate": { + "node_modules/js-yaml": { "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "license": "MIT", "dependencies": { - "p-limit": "^2.2.0" + "argparse": "^2.0.1" }, - "engines": { - "node": ">=8" + "bin": { + "js-yaml": "bin/js-yaml.js" } }, - "resources/build/version/node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "node_modules/json-buffer": { + "version": "3.0.1", + "license": "MIT" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "node_modules/json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw==", + "dev": true + }, + "node_modules/json5": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json5/-/json5-1.0.2.tgz", + "integrity": "sha512-g1MWMLBiz8FKi1e4w0UyVL3w+iJceWAFBAaBnnGKOpNa5f8TLktkbre1+s6oICydWAm+HRUGTmI+//xv2hvXYA==", + "dev": true, "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" + "minimist": "^1.2.0" }, - "engines": { - "node": ">=8" + "bin": { + "json5": "lib/cli.js" } }, - "resources/build/version/node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "node_modules/jsonfile": { + "version": "6.1.0", + "dev": true, + "license": "MIT", "dependencies": { - "ansi-regex": "^5.0.1" + "universalify": "^2.0.0" }, - "engines": { - "node": ">=8" + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jszip": { + "version": "3.9.1", + "license": "(MIT OR GPL-3.0-or-later)", + "dependencies": { + "lie": "~3.3.0", + "pako": "~1.0.2", + "readable-stream": "~2.3.6", + "set-immediate-shim": "~1.0.1" } }, - "resources/build/version/node_modules/ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", + "node_modules/just-extend": { + "version": "4.2.1", + "dev": true, + "license": "MIT" + }, + "node_modules/karma": { + "version": "6.4.1", "dev": true, + "license": "MIT", "dependencies": { - "arg": "^4.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" + "@colors/colors": "1.5.0", + "body-parser": "^1.19.0", + "braces": "^3.0.2", + "chokidar": "^3.5.1", + "connect": "^3.7.0", + "di": "^0.0.1", + "dom-serialize": "^2.2.1", + "glob": "^7.1.7", + "graceful-fs": "^4.2.6", + "http-proxy": "^1.18.1", + "isbinaryfile": "^4.0.8", + "lodash": "^4.17.21", + "log4js": "^6.4.1", + "mime": "^2.5.2", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.5", + "qjobs": "^1.2.0", + "range-parser": "^1.2.1", + "rimraf": "^3.0.2", + "socket.io": "^4.4.1", + "source-map": "^0.6.1", + "tmp": "^0.2.1", + "ua-parser-js": "^0.7.30", + "yargs": "^16.1.1" }, "bin": { - "ts-node": "dist/bin.js", - "ts-node-script": "dist/bin-script.js", - "ts-node-transpile-only": "dist/bin-transpile.js", - "ts-script": "dist/bin-script-deprecated.js" + "karma": "bin/karma" }, "engines": { - "node": ">=6.0.0" - }, - "peerDependencies": { - "typescript": ">=2.7" + "node": ">= 10" } }, - "resources/build/version/node_modules/wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "node_modules/karma-browserstack-launcher": { + "version": "1.6.0", + "dev": true, + "license": "MIT", "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" + "browserstack": "~1.5.1", + "browserstack-local": "^1.3.7", + "q": "~1.5.0" }, - "engines": { - "node": ">=8" + "peerDependencies": { + "karma": ">=0.9" } }, - "resources/build/version/node_modules/y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" + "node_modules/karma-chai": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "peerDependencies": { + "chai": "*", + "karma": ">=0.10.9" + } }, - "resources/build/version/node_modules/yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", + "node_modules/karma-chrome-launcher": { + "version": "2.2.0", + "dev": true, + "license": "MIT", "dependencies": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" + "fs-access": "^1.0.0", + "which": "^1.2.1" + } + }, + "node_modules/karma-chrome-launcher/node_modules/which": { + "version": "1.3.1", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" }, - "engines": { - "node": ">=8" + "bin": { + "which": "bin/which" } }, - "resources/build/version/node_modules/yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", + "node_modules/karma-edge-launcher": { + "version": "0.4.2", + "dev": true, + "license": "MIT", "dependencies": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" + "edge-launcher": "1.2.2" }, "engines": { - "node": ">=6" + "node": ">=4" + }, + "peerDependencies": { + "karma": ">=0.9" } }, - "resources/gosh": { - "name": "@keymanapp/resources-gosh", + "node_modules/karma-firefox-launcher": { + "version": "1.3.0", + "dev": true, "license": "MIT", - "bin": { - "gosh": "gosh.js" + "dependencies": { + "is-wsl": "^2.1.0" } }, - "web": { - "name": "keyman", + "node_modules/karma-fixture": { + "version": "0.2.6", + "dev": true, + "license": "MIT" + }, + "node_modules/karma-html2js-preprocessor": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "peerDependencies": { + "karma": ">=0.9" + } + }, + "node_modules/karma-ie-launcher": { + "version": "1.0.0", + "dev": true, "license": "MIT", "dependencies": { - "@keymanapp/input-processor": "*", - "@keymanapp/keyboard-processor": "*", - "@keymanapp/keyman-version": "*", - "@keymanapp/lexical-model-layer": "*", - "@keymanapp/models-types": "*", - "@keymanapp/recorder-core": "*", - "@keymanapp/web-utils": "*", - "@types/node": "^11.9.4", - "eventemitter3": "^4.0.0" + "lodash": "^4.6.1" }, - "devDependencies": { - "@keymanapp/resources-gosh": "*", - "@keymanapp/web-sentry-manager": "*", - "@sentry/cli": "2.2.0", - "chai": "^4.3.4", - "google-closure-compiler-java": "^20200224.0.0", - "karma": "^6.4.1", - "karma-browserstack-launcher": "^1.6.0", - "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^2.2.0", - "karma-edge-launcher": "^0.4.2", - "karma-firefox-launcher": "^1.1.0", - "karma-fixture": "^0.2.6", - "karma-html2js-preprocessor": "^1.1.0", - "karma-ie-launcher": "^1.0.0", - "karma-json-fixtures-preprocessor": "0.0.6", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-safari-launcher": "^1.0.0", - "karma-teamcity-reporter": "^1.1.0", - "mocha": "^10.0.0", - "modernizr": "^3.11.7", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "peerDependencies": { + "karma": ">=0.9" } - } - }, - "dependencies": { - "@actions/core": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/@actions/core/-/core-1.9.1.tgz", - "integrity": "sha512-5ad+U2YGrmmiw6du20AQW5XuWo7UKN2052FjSV7MX+Wfjf8sCqcsZe62NfgHys4QI4/Y+vQvLKYL8jWtA1ZBTA==", - "requires": { - "@actions/http-client": "^2.0.1", - "uuid": "^8.3.2" + }, + "node_modules/karma-json-fixtures-preprocessor": { + "version": "0.0.6", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/karma-mocha": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.3" } }, - "@actions/github": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@actions/github/-/github-2.2.0.tgz", - "integrity": "sha512-9UAZqn8ywdR70n3GwVle4N8ALosQs4z50N7XMXrSTUVOmVpaBC5kE3TRTT7qQdi3OaQV24mjGuJZsHUmhD+ZXw==", - "requires": { - "@actions/http-client": "^1.0.3", - "@octokit/graphql": "^4.3.1", - "@octokit/rest": "^16.43.1" + "node_modules/karma-mocha-reporter": { + "version": "2.2.5", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^2.1.0", + "log-symbols": "^2.1.0", + "strip-ansi": "^4.0.0" }, + "peerDependencies": { + "karma": ">=0.13" + } + }, + "node_modules/karma-mocha-reporter/node_modules/ansi-regex": { + "version": "3.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/karma-mocha-reporter/node_modules/ansi-styles": { + "version": "3.2.1", + "dev": true, + "license": "MIT", "dependencies": { - "@actions/http-client": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-1.0.11.tgz", - "integrity": "sha512-VRYHGQV1rqnROJqdMvGUbY/Kn8vriQe/F9HR2AlYHzmKuM/p3kjNuXhmdBfcVgsvRWTz5C5XW5xvndZrVBuAYg==", - "requires": { - "tunnel": "0.0.6" - } - } + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" } }, - "@actions/http-client": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@actions/http-client/-/http-client-2.0.1.tgz", - "integrity": "sha512-PIXiMVtz6VvyaRsGY268qvj57hXQEpsYogYOu2nrQhlf+XCGmZstmuZBbAybUl1nQGnvS1k1eEsQ69ZoD7xlSw==", - "requires": { - "tunnel": "^0.0.6" + "node_modules/karma-mocha-reporter/node_modules/chalk": { + "version": "2.4.2", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" } }, - "@colors/colors": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/@colors/colors/-/colors-1.5.0.tgz", - "integrity": "sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ==", - "dev": true + "node_modules/karma-mocha-reporter/node_modules/color-convert": { + "version": "1.9.3", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } }, - "@cspotcode/source-map-support": { - "version": "0.8.1", - "resolved": "https://registry.npmjs.org/@cspotcode/source-map-support/-/source-map-support-0.8.1.tgz", - "integrity": "sha512-IchNf6dN4tHoMFIn/7OE8LWZ19Y6q/67Bmf6vnGREv8RSbBVb9LPJxEcnwrcwX6ixSvaiGoomAUvu4YSxXrVgw==", + "node_modules/karma-mocha-reporter/node_modules/color-name": { + "version": "1.1.3", "dev": true, - "requires": { - "@jridgewell/trace-mapping": "0.3.9" + "license": "MIT" + }, + "node_modules/karma-mocha-reporter/node_modules/has-flag": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" } }, - "@jridgewell/resolve-uri": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/@jridgewell/resolve-uri/-/resolve-uri-3.0.7.tgz", - "integrity": "sha512-8cXDaBBHOr2pQ7j77Y6Vp5VDT2sIqWyWQ56TjEq4ih/a4iST3dItRe8Q9fp0rrIl9DoKhWQtUQz/YpOxLkXbNA==", - "dev": true + "node_modules/karma-mocha-reporter/node_modules/log-symbols": { + "version": "2.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^2.0.1" + }, + "engines": { + "node": ">=4" + } }, - "@jridgewell/sourcemap-codec": { - "version": "1.4.13", - "resolved": "https://registry.npmjs.org/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.13.tgz", - "integrity": "sha512-GryiOJmNcWbovBxTfZSF71V/mXbgcV3MewDe3kIMCLyIh5e7SKAeUZs+rMnJ8jkMolZ/4/VsdBmMrw3l+VdZ3w==", - "dev": true + "node_modules/karma-mocha-reporter/node_modules/strip-ansi": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^3.0.0" + }, + "engines": { + "node": ">=4" + } }, - "@jridgewell/trace-mapping": { - "version": "0.3.9", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.9.tgz", - "integrity": "sha512-3Belt6tdc8bPgAtbcmdtNJlirVoTmEb5e2gC94PnkwEW9jI6CAHUeoG85tjWP5WquqfavoMtMwiG4P926ZKKuQ==", + "node_modules/karma-mocha-reporter/node_modules/supports-color": { + "version": "5.5.0", "dev": true, - "requires": { - "@jridgewell/resolve-uri": "^3.0.3", - "@jridgewell/sourcemap-codec": "^1.4.10" + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "@keymanapp/auto-history-action": { - "version": "file:resources/build/version", - "requires": { - "@actions/core": "^1.9.1", - "@actions/github": "^2.1.0", - "@types/node": "^13.7.0", - "@types/semver": "^7.1.0", - "semver": "^7.1.2", - "ts-node": "^8.6.2", - "typescript": "^4.5.4", - "yargs": "^15.1.0" + "node_modules/karma-safari-launcher": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "peerDependencies": { + "karma": ">=0.9" + } + }, + "node_modules/karma-teamcity-reporter": { + "version": "1.1.0", + "dev": true, + "license": "MIT", + "peerDependencies": { + "karma": ">=0.9" + } + }, + "node_modules/karma/node_modules/glob": { + "version": "7.2.0", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/keyman": { + "resolved": "web", + "link": true + }, + "node_modules/keyv": { + "version": "4.2.2", + "license": "MIT", "dependencies": { - "@types/node": { - "version": "13.13.52", - "resolved": "https://registry.npmjs.org/@types/node/-/node-13.13.52.tgz", - "integrity": "sha512-s3nugnZumCC//n4moGGe6tkNMyYEdaDBitVjwPxXmR5lnMG5dHePinH2EdxkG3Rh1ghFHHixAG4NJhpJW1rthQ==", - "dev": true - }, - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==" - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "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==" - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "requires": { - "p-locate": "^4.1.0" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "requires": { - "p-limit": "^2.2.0" - } - }, - "string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "ts-node": { - "version": "8.10.2", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-8.10.2.tgz", - "integrity": "sha512-ISJJGgkIpDdBhWVu3jufsWpK3Rzo7bdiIXJjQc0ynKxVOVcg2oIrf2H2cejminGrptVc6q6/uynAHNCuWGbpVA==", - "dev": true, - "requires": { - "arg": "^4.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==" - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } + "compress-brotli": "^1.3.6", + "json-buffer": "3.0.1" } }, - "@keymanapp/developer-server": { - "version": "file:developer/src/server", - "requires": { - "@keymanapp/keyman-version": "*", - "@keymanapp/resources-gosh": "*", - "@sentry/node": "^6.16.1", - "@types/chai": "^4.3.0", - "@types/express": "^4.17.13", - "@types/mocha": "^9.1.0", - "@types/multer": "^1.4.7", - "@types/node": "^17.0.0", - "@types/ws": "^8.2.2", - "chai": "^4.3.4", - "chalk": "^4.1.2", - "copyfiles": "^2.4.1", - "express": "^4.17.2", - "hetrodo-node-hide-console-window-napi": "git+ssh://git@github.com/keymanapp/hetrodo-node-hide-console-window-napi.git#858b23036a9963b40ad6ff3c5bacd421e5839b92", - "mocha": "^10.0.0", - "multer": "^1.4.5-lts.1", - "ngrok": "^4.2.2", - "node-windows-trayicon": "git+ssh://git@github.com/keymanapp/node-windows-trayicon.git#1e46786082213f3edcddd5953e33f5abdc7ea05f", - "open": "^8.4.0", - "ts-node": "^10.4.0", - "tsc-watch": "^4.5.0", - "typescript": "^4.5.4", - "ws": "^8.3.0" + "node_modules/levn": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1", + "type-check": "~0.4.0" }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/lie": { + "version": "3.3.0", + "license": "MIT", "dependencies": { - "@types/mocha": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-9.1.1.tgz", - "integrity": "sha512-Z61JK7DKDtdKTWwLeElSEBcWGRLY8g95ic5FoQqI9CMx0ns/Ghep3B4DfcEimiKMvtamNVULVNKEsiwV3aQmXw==", - "dev": true - }, - "@types/node": { - "version": "17.0.45", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.45.tgz", - "integrity": "sha512-w+tIMs3rq2afQdsPJlODhoUEKzFP1ayaoyl1CcnwtIlsVe7K7bA1NGm4s3PraqTLlXnbIN84zuBlxBWo1u9BLw==", - "dev": true - }, - "busboy": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz", - "integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==", - "requires": { - "streamsearch": "^1.1.0" - } - }, - "multer": { - "version": "1.4.5-lts.1", - "resolved": "https://registry.npmjs.org/multer/-/multer-1.4.5-lts.1.tgz", - "integrity": "sha512-ywPWvcDMeH+z9gQq5qYHCCy+ethsk4goepZ45GLD63fOu0YcNecQxi64nDs3qluZB+murG3/D4dJ7+dGctcCQQ==", - "requires": { - "append-field": "^1.0.0", - "busboy": "^1.0.0", - "concat-stream": "^1.5.2", - "mkdirp": "^0.5.4", - "object-assign": "^4.1.1", - "type-is": "^1.6.4", - "xtend": "^4.0.0" - } - }, - "streamsearch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz", - "integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==" - }, - "ts-node": { - "version": "10.8.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.8.1.tgz", - "integrity": "sha512-Wwsnao4DQoJsN034wePSg5nZiw4YKXf56mPIAeD6wVmiv+RytNSWqc2f3fKvcUoV+Yn2+yocD71VOfQHbmVX4g==", - "dev": true, - "requires": { - "@cspotcode/source-map-support": "^0.8.0", - "@tsconfig/node10": "^1.0.7", - "@tsconfig/node12": "^1.0.7", - "@tsconfig/node14": "^1.0.0", - "@tsconfig/node16": "^1.0.2", - "acorn": "^8.4.1", - "acorn-walk": "^8.1.1", - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "v8-compile-cache-lib": "^3.0.1", - "yn": "3.1.1" - }, - "dependencies": { - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - } - } - } + "immediate": "~3.0.5" } }, - "@keymanapp/input-processor": { - "version": "file:common/web/input-processor", - "requires": { - "@keymanapp/keyboard-processor": "*", - "@keymanapp/keyman-version": "*", - "@keymanapp/lexical-model-compiler": "*", - "@keymanapp/lexical-model-layer": "*", - "@keymanapp/models-types": "*", - "@keymanapp/resources-gosh": "*", - "@keymanapp/web-utils": "*", - "@types/node": "^11.9.4", - "chai": "^4.3.4", - "eventemitter3": "^4.0.0", - "mocha": "^10.0.0", - "mocha-teamcity-reporter": "^4.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "node_modules/linkify-it": { + "version": "3.0.3", + "dev": true, + "license": "MIT", + "dependencies": { + "uc.micro": "^1.0.1" } }, - "@keymanapp/keyboard-processor": { - "version": "file:common/web/keyboard-processor", - "requires": { - "@keymanapp/keyman-version": "*", - "@keymanapp/models-types": "*", - "@keymanapp/resources-gosh": "*", - "@keymanapp/web-utils": "*", - "@types/node": "^11.9.4", - "chai": "^4.3.4", - "mocha": "^10.0.0", - "mocha-teamcity-reporter": "^4.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "node_modules/locate-path": { + "version": "6.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-locate": "^5.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "@keymanapp/keyman-version": { - "version": "file:common/web/keyman-version", - "requires": { - "typescript": "^4.5.4" + "node_modules/lodash": { + "version": "4.17.21", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.clonedeep": { + "version": "4.5.0", + "license": "MIT" + }, + "node_modules/lodash.get": { + "version": "4.4.2", + "license": "MIT" + }, + "node_modules/lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, + "node_modules/lodash.set": { + "version": "4.3.2", + "license": "MIT" + }, + "node_modules/lodash.uniq": { + "version": "4.5.0", + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, - "@keymanapp/lexical-model-compiler": { - "version": "file:developer/src/kmlmc", - "requires": { - "@keymanapp/keyman-version": "*", - "@keymanapp/models-templates": "*", - "@keymanapp/models-types": "*", - "@keymanapp/models-wordbreakers": "*", - "@types/chai": "^4.1.7", - "@types/mocha": "^5.2.7", - "@types/node": "^10.14.6", - "@types/xml2js": "^0.4.5", - "chai": "^4.3.4", - "chalk": "^2.4.2", - "commander": "^3.0.0", - "jszip": "^3.7.0", - "mocha": "^10.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4", - "xml2js": "^0.4.19" + "node_modules/log4js": { + "version": "6.4.4", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "date-format": "^4.0.6", + "debug": "^4.3.4", + "flatted": "^3.2.5", + "rfdc": "^1.3.0", + "streamroller": "^3.0.6" }, + "engines": { + "node": ">=8.0" + } + }, + "node_modules/log4js/node_modules/debug": { + "version": "4.3.4", + "dev": true, + "license": "MIT", "dependencies": { - "@types/mocha": { - "version": "5.2.7", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-5.2.7.tgz", - "integrity": "sha512-NYrtPht0wGzhwe9+/idPaBB+TqkY9AhTvOLMkThm0IoEfLaiVQZwBwyJ5puCkO3AUCWrmcoePjp2mbFocKy4SQ==", - "dev": true - }, - "@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", - "dev": true - }, + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } + "optional": true } } }, - "@keymanapp/lexical-model-layer": { - "version": "file:common/predictive-text", - "requires": { - "@keymanapp/keyman-version": "*", - "@keymanapp/models-templates": "*", - "@keymanapp/models-types": "*", - "@keymanapp/models-wordbreakers": "*", - "@keymanapp/resources-gosh": "*", - "@keymanapp/web-utils": "*", - "@types/node": "^10.17.21", - "chai": "^4.3.4", - "es6-shim": "^0.35.5", - "karma": "^6.4.1", - "karma-browserstack-launcher": "^1.6.0", - "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^2.2.0", - "karma-edge-launcher": "^0.4.2", - "karma-firefox-launcher": "^1.1.0", - "karma-fixture": "^0.2.6", - "karma-html2js-preprocessor": "^1.1.0", - "karma-ie-launcher": "^1.0.0", - "karma-json-fixtures-preprocessor": "0.0.6", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-safari-launcher": "^1.0.0", - "karma-teamcity-reporter": "^1.1.0", - "mocha": "^10.0.0", - "mocha-teamcity-reporter": "^4.0.0", - "sinon": "^7.1.1", - "string.prototype.codepointat": "^0.2.1", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "node_modules/loglevel": { + "version": "1.8.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" }, - "dependencies": { - "@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "dev": true - } + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" } }, - "@keymanapp/lm-message-types": { - "version": "file:common/web/lm-message-types", - "requires": { - "typescript": "^4.5.4" + "node_modules/lolex": { + "version": "4.2.0", + "dev": true, + "license": "BSD-3-Clause" + }, + "node_modules/lowercase-keys": { + "version": "2.0.0", + "license": "MIT", + "engines": { + "node": ">=8" } }, - "@keymanapp/lm-worker": { - "version": "file:common/web/lm-worker", - "requires": { - "@keymanapp/keyman-version": "*", - "@keymanapp/models-templates": "*", - "@keymanapp/models-types": "*", - "@keymanapp/models-wordbreakers": "*", - "@keymanapp/resources-gosh": "*", - "@keymanapp/web-utils": "*", - "@types/node": "^10.17.21", - "chai": "^4.3.4", - "es6-shim": "^0.35.5", - "karma": "^6.4.1", - "karma-browserstack-launcher": "^1.6.0", - "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^2.2.0", - "karma-edge-launcher": "^0.4.2", - "karma-firefox-launcher": "^1.1.0", - "karma-fixture": "^0.2.6", - "karma-html2js-preprocessor": "^1.1.0", - "karma-ie-launcher": "^1.0.0", - "karma-json-fixtures-preprocessor": "0.0.6", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-safari-launcher": "^1.0.0", - "karma-teamcity-reporter": "^1.1.0", - "mocha": "^10.0.0", - "mocha-teamcity-reporter": "^4.0.0", - "sinon": "^7.1.1", - "string.prototype.codepointat": "^0.2.1", - "string.prototype.startswith": "^0.2.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" - }, + "node_modules/lru_map": { + "version": "0.3.3", + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "license": "ISC", "dependencies": { - "@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "dev": true - } + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, - "@keymanapp/models-templates": { - "version": "file:common/models/templates", - "requires": { - "@keymanapp/models-types": "*", - "@keymanapp/models-wordbreakers": "*", - "@keymanapp/web-utils": "*", - "@types/chai": "^4.2.11", - "@types/mocha": "^7.0.2", - "@types/node": "^14.0.4", - "chai": "^4.3.4", - "mocha": "^10.0.0", - "typescript": "^4.5.4" + "node_modules/macos-release": { + "version": "2.5.0", + "license": "MIT", + "engines": { + "node": ">=6" }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/make-dir": { + "version": "3.1.0", + "dev": true, + "license": "MIT", "dependencies": { - "@types/node": { - "version": "14.18.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.12.tgz", - "integrity": "sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==", - "dev": true - } + "semver": "^6.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "@keymanapp/models-types": { - "version": "file:common/models/types", - "requires": { - "typescript": "^4.5.4" + "node_modules/make-dir/node_modules/semver": { + "version": "6.3.0", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" } }, - "@keymanapp/models-wordbreakers": { - "version": "file:common/models/wordbreakers", - "requires": { - "@keymanapp/models-types": "*", - "@types/chai": "^4.2.11", - "@types/mocha": "^7.0.2", - "@types/node": "^14.0.3", - "chai": "^4.3.4", - "mocha": "^10.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" - }, + "node_modules/make-error": { + "version": "1.3.6", + "dev": true, + "license": "ISC" + }, + "node_modules/make-fetch-happen": { + "version": "10.2.1", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-10.2.1.tgz", + "integrity": "sha512-NgOPbRiaQM10DYXvN3/hhGVI2M5MtITFryzBGxHM5p4wnFxsVCbxkrBrDsk+EZ5OB4jEOT7AjDxtdF+KVEFT7w==", + "optional": true, "dependencies": { - "@types/node": { - "version": "14.18.12", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.12.tgz", - "integrity": "sha512-q4jlIR71hUpWTnGhXWcakgkZeHa3CCjcQcnuzU8M891BAWA2jHiziiWEPEkdS5pFsz7H9HJiy8BrK7tBRNrY7A==" - } + "agentkeepalive": "^4.2.1", + "cacache": "^16.1.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^5.0.0", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^7.7.1", + "minipass": "^3.1.6", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^2.0.3", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.3", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^7.0.0", + "ssri": "^9.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "@keymanapp/recorder-core": { - "version": "file:common/web/recorder", - "requires": { - "@keymanapp/keyboard-processor": "*", - "@keymanapp/keyman-version": "*", - "@keymanapp/models-types": "*", - "@keymanapp/web-utils": "*", - "@types/node": "^11.9.4", - "typescript": "^4.5.4" + "node_modules/make-fetch-happen/node_modules/lru-cache": { + "version": "7.16.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.16.1.tgz", + "integrity": "sha512-9kkuMZHnLH/8qXARvYSjNvq8S1GYFFzynQTAfKeaJ0sIrR3PUPuu37Z+EiIANiZBvpfTf2B5y8ecDLSMWlLv+w==", + "optional": true, + "engines": { + "node": ">=12" } }, - "@keymanapp/resources-gosh": { - "version": "file:resources/gosh" + "node_modules/map-stream": { + "version": "0.1.0", + "dev": true }, - "@keymanapp/sourcemap-path-remapper": { - "version": "file:common/tools/sourcemap-path-remapper", - "requires": { - "@keymanapp/resources-gosh": "*", - "@types/node": "^10.17.21", - "chai": "^4.3.4", - "convert-source-map": "^2.0.0", - "mocha": "^10.0.0", - "mocha-teamcity-reporter": "^4.0.0", - "sinon": "^7.1.1", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "node_modules/markdown-it": { + "version": "12.3.2", + "dev": true, + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "~2.1.0", + "linkify-it": "^3.0.1", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" }, + "bin": { + "markdown-it": "bin/markdown-it.js" + } + }, + "node_modules/mdurl": { + "version": "1.0.1", + "dev": true, + "license": "MIT" + }, + "node_modules/media-typer": { + "version": "0.3.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "license": "MIT" + }, + "node_modules/merge2": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", + "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", + "dev": true, + "engines": { + "node": ">= 8" + } + }, + "node_modules/methods": { + "version": "1.1.2", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/micromatch": { + "version": "4.0.5", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", + "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", + "dev": true, "dependencies": { - "@types/node": { - "version": "10.17.60", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", - "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==", - "dev": true - } + "braces": "^3.0.2", + "picomatch": "^2.3.1" + }, + "engines": { + "node": ">=8.6" } }, - "@keymanapp/web-sentry-manager": { - "version": "file:common/web/sentry-manager", - "requires": { - "@keymanapp/keyman-version": "*", - "@sentry/browser": "^5.27.4", - "typescript": "^4.5.4" + "node_modules/mime": { + "version": "2.6.0", + "dev": true, + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" } }, - "@keymanapp/web-utils": { - "version": "file:common/web/utils", - "requires": { - "@keymanapp/keyman-version": "*", - "@keymanapp/resources-gosh": "*", - "@types/node": "^14.0.5", - "typescript": "^4.5.4" + "node_modules/mime-db": { + "version": "1.52.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "devOptional": true, + "license": "ISC", "dependencies": { - "@types/node": { - "version": "14.18.18", - "resolved": "https://registry.npmjs.org/@types/node/-/node-14.18.18.tgz", - "integrity": "sha512-B9EoJFjhqcQ9OmQrNorItO+OwEOORNn3S31WuiHvZY/dm9ajkB7AKD/8toessEtHHNL+58jofbq7hMMY9v4yig==", - "dev": true - } + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "@octokit/auth-token": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/@octokit/auth-token/-/auth-token-2.5.0.tgz", - "integrity": "sha512-r5FVUJCOLl19AxiuZD2VRZ/ORjp/4IN98Of6YJoJOkY75CIBuYfmiNHGrDwXr+aLGG55igl9QrxX3hbiXlLb+g==", - "requires": { - "@octokit/types": "^6.0.3" + "node_modules/minimist": { + "version": "1.2.6", + "license": "MIT" + }, + "node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "@octokit/core": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/@octokit/core/-/core-3.6.0.tgz", - "integrity": "sha512-7RKRKuA4xTjMhY+eG3jthb3hlZCsOwg3rztWh75Xc+ShDWOfDDATWbeZpAHBNRpm4Tv9WgBMOy1zEJYXG6NJ7Q==", - "peer": true, - "requires": { - "@octokit/auth-token": "^2.4.4", - "@octokit/graphql": "^4.5.8", - "@octokit/request": "^5.6.3", - "@octokit/request-error": "^2.0.5", - "@octokit/types": "^6.0.3", - "before-after-hook": "^2.2.0", - "universal-user-agent": "^6.0.0" + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" } }, - "@octokit/endpoint": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@octokit/endpoint/-/endpoint-6.0.12.tgz", - "integrity": "sha512-lF3puPwkQWGfkMClXb4k/eUT/nZKQfxinRWJrdZaJO85Dqwo/G0yOC434Jr2ojwafWJMYqFGFa5ms4jJUgujdA==", - "requires": { - "@octokit/types": "^6.0.3", - "is-plain-object": "^5.0.0", - "universal-user-agent": "^6.0.0" + "node_modules/minipass-fetch": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-2.1.2.tgz", + "integrity": "sha512-LT49Zi2/WMROHYoqGgdlQIZh8mLPZmOrN2NdJjMXxYe4nkN6FUyuPuOAOedNJDrx0IRGg9+4guZewtp8hE6TxA==", + "optional": true, + "dependencies": { + "minipass": "^3.1.6", + "minipass-sized": "^1.0.3", + "minizlib": "^2.1.2" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + }, + "optionalDependencies": { + "encoding": "^0.1.13" } }, - "@octokit/graphql": { - "version": "4.8.0", - "resolved": "https://registry.npmjs.org/@octokit/graphql/-/graphql-4.8.0.tgz", - "integrity": "sha512-0gv+qLSBLKF0z8TKaSKTsS39scVKF9dbMxJpj3U0vC7wjNWFuIpL/z76Qe2fiuCbDRcJSavkXsVtMS6/dtQQsg==", - "requires": { - "@octokit/request": "^5.6.0", - "@octokit/types": "^6.0.3", - "universal-user-agent": "^6.0.0" + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" } }, - "@octokit/openapi-types": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/@octokit/openapi-types/-/openapi-types-11.2.0.tgz", - "integrity": "sha512-PBsVO+15KSlGmiI8QAzaqvsNlZlrDlyAJYcrXBCvVUxCp7VnXjkwPoFHgjEJXx3WF9BAwkA6nfCUA7i9sODzKA==" - }, - "@octokit/plugin-paginate-rest": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@octokit/plugin-paginate-rest/-/plugin-paginate-rest-1.1.2.tgz", - "integrity": "sha512-jbsSoi5Q1pj63sC16XIUboklNw+8tL9VOnJsWycWYR78TKss5PVpIPb1TUUcMQ+bBh7cY579cVAWmf5qG+dw+Q==", - "requires": { - "@octokit/types": "^2.0.1" - }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "optional": true, "dependencies": { - "@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", - "requires": { - "@types/node": ">= 8" - } - } + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "@octokit/plugin-request-log": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@octokit/plugin-request-log/-/plugin-request-log-1.0.4.tgz", - "integrity": "sha512-mLUsMkgP7K/cnFEw07kWqXGF5LKrOkD+lhCrKvPHXWDywAwuDUeDwWBpc69XK3pNX0uKiVt8g5z96PJ6z9xCFA==", - "requires": {} - }, - "@octokit/plugin-rest-endpoint-methods": { - "version": "2.4.0", - "resolved": "https://registry.npmjs.org/@octokit/plugin-rest-endpoint-methods/-/plugin-rest-endpoint-methods-2.4.0.tgz", - "integrity": "sha512-EZi/AWhtkdfAYi01obpX0DF7U6b1VRr30QNQ5xSFPITMdLSfhcBqjamE3F+sKcxPbD7eZuMHu3Qkk2V+JGxBDQ==", - "requires": { - "@octokit/types": "^2.0.1", - "deprecation": "^2.3.1" - }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "optional": true, "dependencies": { - "@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", - "requires": { - "@types/node": ">= 8" - } - } + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "@octokit/request": { - "version": "5.6.3", - "resolved": "https://registry.npmjs.org/@octokit/request/-/request-5.6.3.tgz", - "integrity": "sha512-bFJl0I1KVc9jYTe9tdGGpAMPy32dLBXXo1dS/YwSCTL/2nd9XeHsY616RE3HPXDVk+a+dBuzyz5YdlXwcDTr2A==", - "requires": { - "@octokit/endpoint": "^6.0.1", - "@octokit/request-error": "^2.1.0", - "@octokit/types": "^6.16.1", - "is-plain-object": "^5.0.0", - "node-fetch": "^2.6.7", - "universal-user-agent": "^6.0.0" + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "optional": true, + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" } }, - "@octokit/request-error": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-2.1.0.tgz", - "integrity": "sha512-1VIvgXxs9WHSjicsRwq8PlR2LR2x6DwsJAaFgzdi0JfJoGSO8mYI/cHJQ+9FbN21aa+DrgNLnwObmyeSC8Rmpg==", - "requires": { - "@octokit/types": "^6.0.3", - "deprecation": "^2.0.0", - "once": "^1.4.0" + "node_modules/mkdirp": { + "version": "0.5.6", + "license": "MIT", + "dependencies": { + "minimist": "^1.2.6" + }, + "bin": { + "mkdirp": "bin/cmd.js" } }, - "@octokit/rest": { - "version": "16.43.2", - "resolved": "https://registry.npmjs.org/@octokit/rest/-/rest-16.43.2.tgz", - "integrity": "sha512-ngDBevLbBTFfrHZeiS7SAMAZ6ssuVmXuya+F/7RaVvlysgGa1JKJkKWY+jV6TCJYcW0OALfJ7nTIGXcBXzycfQ==", - "requires": { - "@octokit/auth-token": "^2.4.0", - "@octokit/plugin-paginate-rest": "^1.1.1", - "@octokit/plugin-request-log": "^1.0.0", - "@octokit/plugin-rest-endpoint-methods": "2.4.0", - "@octokit/request": "^5.2.0", - "@octokit/request-error": "^1.0.2", - "atob-lite": "^2.0.0", - "before-after-hook": "^2.0.0", - "btoa-lite": "^1.0.0", - "deprecation": "^2.0.0", - "lodash.get": "^4.4.2", - "lodash.set": "^4.3.2", - "lodash.uniq": "^4.5.0", - "octokit-pagination-methods": "^1.1.0", - "once": "^1.4.0", - "universal-user-agent": "^4.0.0" - }, + "node_modules/mocha": { + "version": "10.0.0", + "dev": true, + "license": "MIT", "dependencies": { - "@octokit/request-error": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/@octokit/request-error/-/request-error-1.2.1.tgz", - "integrity": "sha512-+6yDyk1EES6WK+l3viRDElw96MvwfJxCt45GvmjDUKWjYIb3PJZQkq3i46TwGwoPD4h8NmTrENmtyA1FwbmhRA==", - "requires": { - "@octokit/types": "^2.0.0", - "deprecation": "^2.0.0", - "once": "^1.4.0" - } - }, - "@octokit/types": { - "version": "2.16.2", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-2.16.2.tgz", - "integrity": "sha512-O75k56TYvJ8WpAakWwYRN8Bgu60KrmX0z1KqFp1kNiFNkgW+JW+9EBKZ+S33PU6SLvbihqd+3drvPxKK68Ee8Q==", - "requires": { - "@types/node": ">= 8" - } - }, - "universal-user-agent": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-4.0.1.tgz", - "integrity": "sha512-LnST3ebHwVL2aNe4mejI9IQh2HfZ1RLo8Io2HugSif8ekzD1TlWpHpColOB/eh8JHMLkGH3Akqf040I+4ylNxg==", - "requires": { - "os-name": "^3.1.0" - } - } + "@ungap/promise-all-settled": "1.1.2", + "ansi-colors": "4.1.1", + "browser-stdout": "1.3.1", + "chokidar": "3.5.3", + "debug": "4.3.4", + "diff": "5.0.0", + "escape-string-regexp": "4.0.0", + "find-up": "5.0.0", + "glob": "7.2.0", + "he": "1.2.0", + "js-yaml": "4.1.0", + "log-symbols": "4.1.0", + "minimatch": "5.0.1", + "ms": "2.1.3", + "nanoid": "3.3.3", + "serialize-javascript": "6.0.0", + "strip-json-comments": "3.1.1", + "supports-color": "8.1.1", + "workerpool": "6.2.1", + "yargs": "16.2.0", + "yargs-parser": "20.2.4", + "yargs-unparser": "2.0.0" + }, + "bin": { + "_mocha": "bin/_mocha", + "mocha": "bin/mocha.js" + }, + "engines": { + "node": ">= 14.0.0" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mochajs" } }, - "@octokit/types": { - "version": "6.34.0", - "resolved": "https://registry.npmjs.org/@octokit/types/-/types-6.34.0.tgz", - "integrity": "sha512-s1zLBjWhdEI2zwaoSgyOFoKSl109CUcVBCc7biPJ3aAf6LGLU6szDvi31JPU7bxfla2lqfhjbbg/5DdFNxOwHw==", - "requires": { - "@octokit/openapi-types": "^11.2.0" + "node_modules/mocha-teamcity-reporter": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "peerDependencies": { + "mocha": ">=6" } }, - "@sentry/browser": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/browser/-/browser-5.30.0.tgz", - "integrity": "sha512-rOb58ZNVJWh1VuMuBG1mL9r54nZqKeaIlwSlvzJfc89vyfd7n6tQ1UXMN383QBz/MS5H5z44Hy5eE+7pCrYAfw==", - "requires": { - "@sentry/core": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" + "node_modules/mocha/node_modules/chokidar": { + "version": "3.5.3", + "dev": true, + "funding": [ + { + "type": "individual", + "url": "https://paulmillr.com/funding/" + } + ], + "license": "MIT", + "dependencies": { + "anymatch": "~3.1.2", + "braces": "~3.0.2", + "glob-parent": "~5.1.2", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.6.0" + }, + "engines": { + "node": ">= 8.10.0" + }, + "optionalDependencies": { + "fsevents": "~2.3.2" } }, - "@sentry/cli": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/@sentry/cli/-/cli-2.2.0.tgz", - "integrity": "sha512-ywFtB8VHyWN248LuM67fsRtdMLif/SOHYY3zyef5WybvnAmRLDmGTWK//hSUCebsHBpehRIkmt4iMiyUXwgd5w==", + "node_modules/mocha/node_modules/debug": { + "version": "4.3.4", "dev": true, - "requires": { - "https-proxy-agent": "^5.0.0", - "node-fetch": "^2.6.7", - "npmlog": "^6.0.1", - "progress": "^2.0.3", - "proxy-from-env": "^1.1.0", - "which": "^2.0.2" - }, + "license": "MIT", "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "are-we-there-yet": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.0.tgz", - "integrity": "sha512-0GWpv50YSOcLXaN6/FAKY3vfRbllXWV2xvfA/oKJF8pzFhWXPV+yjhJXDBbjscDYowv7Yw1A3uigpzn5iEGTyw==", - "dev": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^3.6.0" - } - }, - "gauge": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", - "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", - "dev": true, - "requires": { - "aproba": "^1.0.3 || ^2.0.0", - "color-support": "^1.1.3", - "console-control-strings": "^1.1.0", - "has-unicode": "^2.0.1", - "signal-exit": "^3.0.7", - "string-width": "^4.2.3", - "strip-ansi": "^6.0.1", - "wide-align": "^1.1.5" - } - }, - "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 - }, - "npmlog": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", - "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", - "dev": true, - "requires": { - "are-we-there-yet": "^3.0.0", - "console-control-strings": "^1.1.0", - "gauge": "^4.0.3", - "set-blocking": "^2.0.0" - } - }, - "readable-stream": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", - "dev": true, - "requires": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - } - }, - "string-width": { - "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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "wide-align": { - "version": "1.1.5", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", - "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", - "dev": true, - "requires": { - "string-width": "^1.0.2 || 2 || 3 || 4" - } + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true } } }, - "@sentry/core": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-5.30.0.tgz", - "integrity": "sha512-TmfrII8w1PQZSZgPpUESqjB+jC6MvZJZdLtE/0hZ+SrnKhW3x5WlYLvTXZpcWePYBku7rl2wn1RZu6uT0qCTeg==", - "requires": { - "@sentry/hub": "5.30.0", - "@sentry/minimal": "5.30.0", - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" + "node_modules/mocha/node_modules/debug/node_modules/ms": { + "version": "2.1.2", + "dev": true, + "license": "MIT" + }, + "node_modules/mocha/node_modules/escape-string-regexp": { + "version": "4.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "@sentry/hub": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-5.30.0.tgz", - "integrity": "sha512-2tYrGnzb1gKz2EkMDQcfLrDTvmGcQPuWxLnJKXJvYTQDGLlEvi2tWz1VIHjunmOvJrB5aIQLhm+dcMRwFZDCqQ==", - "requires": { - "@sentry/types": "5.30.0", - "@sentry/utils": "5.30.0", - "tslib": "^1.9.3" + "node_modules/mocha/node_modules/glob": { + "version": "7.2.0", + "dev": true, + "license": "ISC", + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "@sentry/minimal": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-5.30.0.tgz", - "integrity": "sha512-BwWb/owZKtkDX+Sc4zCSTNcvZUq7YcH3uAVlmh/gtR9rmUvbzAA3ewLuB3myi4wWRAMEtny6+J/FN/x+2wn9Xw==", - "requires": { - "@sentry/hub": "5.30.0", - "@sentry/types": "5.30.0", - "tslib": "^1.9.3" + "node_modules/mocha/node_modules/glob/node_modules/minimatch": { + "version": "3.1.2", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" } }, - "@sentry/node": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/node/-/node-6.19.6.tgz", - "integrity": "sha512-kHQMfsy40ZxxdS9zMPmXCOOLWOJbQj6/aVSHt/L1QthYcgkAi7NJQNXnQIPWQDe8eP3DfNIWM7dc446coqjXrQ==", - "requires": { - "@sentry/core": "6.19.6", - "@sentry/hub": "6.19.6", - "@sentry/types": "6.19.6", - "@sentry/utils": "6.19.6", - "cookie": "^0.4.1", - "https-proxy-agent": "^5.0.0", - "lru_map": "^0.3.3", - "tslib": "^1.9.3" - }, + "node_modules/mocha/node_modules/log-symbols": { + "version": "4.1.0", + "dev": true, + "license": "MIT", "dependencies": { - "@sentry/core": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/core/-/core-6.19.6.tgz", - "integrity": "sha512-biEotGRr44/vBCOegkTfC9rwqaqRKIpFljKGyYU6/NtzMRooktqOhjmjmItNCMRknArdeaQwA8lk2jcZDXX3Og==", - "requires": { - "@sentry/hub": "6.19.6", - "@sentry/minimal": "6.19.6", - "@sentry/types": "6.19.6", - "@sentry/utils": "6.19.6", - "tslib": "^1.9.3" - } - }, - "@sentry/hub": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/hub/-/hub-6.19.6.tgz", - "integrity": "sha512-PuEOBZxvx3bjxcXmWWZfWXG+orojQiWzv9LQXjIgroVMKM/GG4QtZbnWl1hOckUj7WtKNl4hEGO2g/6PyCV/vA==", - "requires": { - "@sentry/types": "6.19.6", - "@sentry/utils": "6.19.6", - "tslib": "^1.9.3" - } - }, - "@sentry/minimal": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/minimal/-/minimal-6.19.6.tgz", - "integrity": "sha512-T1NKcv+HTlmd8EbzUgnGPl4ySQGHWMCyZ8a8kXVMZOPDzphN3fVIzkYzWmSftCWp0rpabXPt9aRF2mfBKU+mAQ==", - "requires": { - "@sentry/hub": "6.19.6", - "@sentry/types": "6.19.6", - "tslib": "^1.9.3" - } - }, - "@sentry/types": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-6.19.6.tgz", - "integrity": "sha512-QH34LMJidEUPZK78l+Frt3AaVFJhEmIi05Zf8WHd9/iTt+OqvCHBgq49DDr1FWFqyYWm/QgW/3bIoikFpfsXyQ==" - }, - "@sentry/utils": { - "version": "6.19.6", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-6.19.6.tgz", - "integrity": "sha512-fAMWcsguL0632eWrROp/vhPgI7sBj/JROWVPzpabwVkm9z3m1rQm6iLFn4qfkZL8Ozy6NVZPXOQ7EXmeU24byg==", - "requires": { - "@sentry/types": "6.19.6", - "tslib": "^1.9.3" - } - } + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "@sentry/types": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/types/-/types-5.30.0.tgz", - "integrity": "sha512-R8xOqlSTZ+htqrfteCWU5Nk0CDN5ApUTvrlvBuiH1DyP6czDZ4ktbZB0hAgBlVcK0U+qpD3ag3Tqqpa5Q67rPw==" - }, - "@sentry/utils": { - "version": "5.30.0", - "resolved": "https://registry.npmjs.org/@sentry/utils/-/utils-5.30.0.tgz", - "integrity": "sha512-zaYmoH0NWWtvnJjC9/CBseXMtKHm/tm40sz3YfJRxeQjyzRqNQPgivpd9R/oDJCYj999mzdW382p/qi2ypjLww==", - "requires": { - "@sentry/types": "5.30.0", - "tslib": "^1.9.3" + "node_modules/mocha/node_modules/minimatch": { + "version": "5.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" } }, - "@sindresorhus/is": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-4.6.0.tgz", - "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==" - }, - "@sinonjs/commons": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", - "integrity": "sha512-xkNcLAn/wZaX14RPlwizcKicDk9G3F8m2nU3L7Ukm5zBgTwiT0wsoFAHx9Jq56fJA1z/7uKGtCRu16sOUCLIHQ==", + "node_modules/mocha/node_modules/minimatch/node_modules/brace-expansion": { + "version": "2.0.1", "dev": true, - "requires": { - "type-detect": "4.0.8" + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" } }, - "@sinonjs/formatio": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/@sinonjs/formatio/-/formatio-3.2.2.tgz", - "integrity": "sha512-B8SEsgd8gArBLMD6zpRw3juQ2FVSsmdd7qlevyDqzS9WTCtvF55/gAL+h6gue8ZvPYcdiPdvueM/qm//9XzyTQ==", + "node_modules/mocha/node_modules/ms": { + "version": "2.1.3", "dev": true, - "requires": { - "@sinonjs/commons": "^1", - "@sinonjs/samsam": "^3.1.0" - } + "license": "MIT" }, - "@sinonjs/samsam": { + "node_modules/mocha/node_modules/nanoid": { "version": "3.3.3", - "resolved": "https://registry.npmjs.org/@sinonjs/samsam/-/samsam-3.3.3.tgz", - "integrity": "sha512-bKCMKZvWIjYD0BLGnNrxVuw4dkWCYsLqFOUWw8VgKF/+5Y+mE7LfHWPIYoDXowH+3a9LsWDMo0uAP8YDosPvHQ==", "dev": true, - "requires": { - "@sinonjs/commons": "^1.3.0", - "array-from": "^2.1.1", - "lodash": "^4.17.15" + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "@sinonjs/text-encoding": { - "version": "0.7.1", - "resolved": "https://registry.npmjs.org/@sinonjs/text-encoding/-/text-encoding-0.7.1.tgz", - "integrity": "sha512-+iTbntw2IZPb/anVDbypzfQa+ay64MW0Zo8aJ8gZPWMMK6/OubMVb6lUPMagqjOPnmtauXnFCACVl3O7ogjeqQ==", - "dev": true - }, - "@socket.io/base64-arraybuffer": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@socket.io/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz", - "integrity": "sha512-dOlCBKnDw4iShaIsH/bxujKTM18+2TOAsYz+KSc11Am38H4q5Xw8Bbz97ZYdrVNM+um3p7w86Bvvmcn9q+5+eQ==", - "dev": true - }, - "@szmarczak/http-timer": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", - "integrity": "sha512-4BAffykYOgO+5nzBWYwE3W90sBgLJoUPRWWcL8wlyiM8IB8ipJz3UMJ9KXQd1RKQXpKp8Tutn80HZtWsu2u76w==", - "requires": { - "defer-to-connect": "^2.0.0" + "node_modules/mocha/node_modules/readdirp": { + "version": "3.6.0", + "dev": true, + "license": "MIT", + "dependencies": { + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" } }, - "@tsconfig/node10": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@tsconfig/node10/-/node10-1.0.8.tgz", - "integrity": "sha512-6XFfSQmMgq0CFLY1MslA/CPUfhIL919M1rMsa5lP2P097N2Wd1sSX0tx1u4olM16fLNhtHZpRhedZJphNJqmZg==", - "dev": true - }, - "@tsconfig/node12": { - "version": "1.0.9", - "resolved": "https://registry.npmjs.org/@tsconfig/node12/-/node12-1.0.9.tgz", - "integrity": "sha512-/yBMcem+fbvhSREH+s14YJi18sp7J9jpuhYByADT2rypfajMZZN4WQ6zBGgBKp53NKmqI36wFYDb3yaMPurITw==", - "dev": true - }, - "@tsconfig/node14": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@tsconfig/node14/-/node14-1.0.1.tgz", - "integrity": "sha512-509r2+yARFfHHE7T6Puu2jjkoycftovhXRqW328PDXTVGKihlb1P8Z9mMZH04ebyajfRY7dedfGynlrFHJUQCg==", - "dev": true - }, - "@tsconfig/node16": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@tsconfig/node16/-/node16-1.0.2.tgz", - "integrity": "sha512-eZxlbI8GZscaGS7kkc/trHTT5xgrjH3/1n2JDwusC9iahPKWMRvRjJSAN5mCXviuTGQ/lHnhvv8Q1YTpnfz9gA==", - "dev": true - }, - "@types/body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "node_modules/mocha/node_modules/serialize-javascript": { + "version": "6.0.0", "dev": true, - "requires": { - "@types/connect": "*", - "@types/node": "*" + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" } }, - "@types/cacheable-request": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/@types/cacheable-request/-/cacheable-request-6.0.2.tgz", - "integrity": "sha512-B3xVo+dlKM6nnKTcmm5ZtY/OL8bOAOd2Olee9M1zft65ox50OzjEHW91sDiU9j6cvW8Ejg1/Qkf4xd2kugApUA==", - "requires": { - "@types/http-cache-semantics": "*", - "@types/keyv": "*", - "@types/node": "*", - "@types/responselike": "*" + "node_modules/mocha/node_modules/supports-color": { + "version": "8.1.1", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" } }, - "@types/chai": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", - "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", - "dev": true - }, - "@types/component-emitter": { - "version": "1.2.11", - "resolved": "https://registry.npmjs.org/@types/component-emitter/-/component-emitter-1.2.11.tgz", - "integrity": "sha512-SRXjM+tfsSlA9VuG8hGO2nft2p8zjXCK1VcC6N4NXbBbYbSia9kzCChYQajIjzIqOOOuh5Ock6MmV2oux4jDZQ==", - "dev": true + "node_modules/mocha/node_modules/workerpool": { + "version": "6.2.1", + "dev": true, + "license": "Apache-2.0" }, - "@types/connect": { - "version": "3.4.35", - "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.35.tgz", - "integrity": "sha512-cdeYyv4KWoEgpBISTxWvqYsVy444DOqehiF3fM3ne10AmJ62RSyNkUnxMJXHQWRQQX2eR94m5y1IZyDwBjV9FQ==", + "node_modules/modernizr": { + "version": "3.12.0", "dev": true, - "requires": { - "@types/node": "*" + "license": "MIT", + "dependencies": { + "doctrine": "^3.0.0", + "file": "^0.2.2", + "lodash": "^4.17.21", + "markdown-it": "^12.3.2", + "mkdirp": "0.5.5", + "requirejs": "^2.3.6", + "yargs": "^15.4.1" + }, + "bin": { + "modernizr": "bin/modernizr" + }, + "engines": { + "node": ">=8" } }, - "@types/cookie": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/@types/cookie/-/cookie-0.4.1.tgz", - "integrity": "sha512-XW/Aa8APYr6jSVVA1y/DEIZX0/GMKLEVekNG727R8cs56ahETkRAy/3DR7+fJyh7oUgGwNQaRfXCun0+KbWY7Q==", - "dev": true - }, - "@types/cors": { - "version": "2.8.12", - "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", - "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==", - "dev": true - }, - "@types/express": { - "version": "4.17.13", - "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.13.tgz", - "integrity": "sha512-6bSZTPaTIACxn48l50SR+axgrqm6qXFIxrdAKaG6PaJk3+zuUr35hBlgT7vOmJcum+OEaIBLtHV/qloEAFITeA==", + "node_modules/modernizr/node_modules/ansi-regex": { + "version": "5.0.1", "dev": true, - "requires": { - "@types/body-parser": "*", - "@types/express-serve-static-core": "^4.17.18", - "@types/qs": "*", - "@types/serve-static": "*" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "@types/express-serve-static-core": { - "version": "4.17.28", - "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.28.tgz", - "integrity": "sha512-P1BJAEAW3E2DJUlkgq4tOL3RyMunoWXqbSCygWo5ZIWTjUgN1YnaXWW4VWl/oc8vs/XoYibEGBKP0uZyF4AHig==", + "node_modules/modernizr/node_modules/cliui": { + "version": "6.0.0", "dev": true, - "requires": { - "@types/node": "*", - "@types/qs": "*", - "@types/range-parser": "*" + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" } }, - "@types/http-cache-semantics": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz", - "integrity": "sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ==" + "node_modules/modernizr/node_modules/find-up": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" + } }, - "@types/json-buffer": { + "node_modules/modernizr/node_modules/is-fullwidth-code-point": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/@types/json-buffer/-/json-buffer-3.0.0.tgz", - "integrity": "sha512-3YP80IxxFJB4b5tYC2SUPwkg0XQLiu0nWvhRgEatgjf+29IcWO9X1k8xRv5DGssJ/lCrjYTjQPcobJr2yWIVuQ==" - }, - "@types/keyv": { - "version": "3.1.4", - "resolved": "https://registry.npmjs.org/@types/keyv/-/keyv-3.1.4.tgz", - "integrity": "sha512-BQ5aZNSCpj7D6K2ksrRCTmKRLEpnPvWDiLPfoGyhZ++8YtiK9d/3DBKPJgry359X/P1PfruyYwvnvwFjuEiEIg==", - "requires": { - "@types/node": "*" + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" } }, - "@types/mime": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.2.tgz", - "integrity": "sha512-YATxVxgRqNH6nHEIsvg6k2Boc1JHI9ZbH5iWFFv/MTkchz3b1ieGDa5T0a9RznNdI0KhVbdbWSN+KWWrQZRxTw==", - "dev": true - }, - "@types/mocha": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/@types/mocha/-/mocha-7.0.2.tgz", - "integrity": "sha512-ZvO2tAcjmMi8V/5Z3JsyofMe3hasRcaw88cto5etSVMwVQfeivGAlEYmaQgceUSVYFofVjT+ioHsATjdWcFt1w==", - "dev": true - }, - "@types/multer": { - "version": "1.4.7", - "resolved": "https://registry.npmjs.org/@types/multer/-/multer-1.4.7.tgz", - "integrity": "sha512-/SNsDidUFCvqqcWDwxv2feww/yqhNeTRL5CVoL3jU4Goc4kKEL10T7Eye65ZqPNi4HRx8sAEX59pV1aEH7drNA==", + "node_modules/modernizr/node_modules/locate-path": { + "version": "5.0.0", "dev": true, - "requires": { - "@types/express": "*" + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" } }, - "@types/node": { - "version": "11.15.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-11.15.54.tgz", - "integrity": "sha512-1RWYiq+5UfozGsU6MwJyFX6BtktcT10XRjvcAQmskCtMcW3tPske88lM/nHv7BQG1w9KBXI1zPGuu5PnNCX14g==" - }, - "@types/qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-FGa1F62FT09qcrueBA6qYTrJPVDzah9a+493+o2PCXsesWHIn27G98TsSMs3WPNbZIEj4+VJf6saSFpvD+3Zsw==", - "dev": true + "node_modules/modernizr/node_modules/mkdirp": { + "version": "0.5.5", + "dev": true, + "license": "MIT", + "dependencies": { + "minimist": "^1.2.5" + }, + "bin": { + "mkdirp": "bin/cmd.js" + } }, - "@types/range-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.4.tgz", - "integrity": "sha512-EEhsLsD6UsDM1yFhAvy0Cjr6VwmpMWqFBCb9w07wVugF7w9nfajxLuVmngTIpgS6svCnm6Vaw+MZhoDCKnOfsw==", - "dev": true + "node_modules/modernizr/node_modules/p-limit": { + "version": "2.3.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "@types/responselike": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/@types/responselike/-/responselike-1.0.0.tgz", - "integrity": "sha512-85Y2BjiufFzaMIlvJDvTTB8Fxl2xfLo4HgmHzVBz08w4wDePCTjYw66PdrolO0kzli3yam/YCgRufyo1DdQVTA==", - "requires": { - "@types/node": "*" + "node_modules/modernizr/node_modules/p-locate": { + "version": "4.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" } }, - "@types/semver": { - "version": "7.3.9", - "resolved": "https://registry.npmjs.org/@types/semver/-/semver-7.3.9.tgz", - "integrity": "sha512-L/TMpyURfBkf+o/526Zb6kd/tchUP3iBDEPjqjb+U2MAJhVRxxrmr2fwpe08E7QsV7YLcpq0tUaQ9O9x97ZIxQ==", - "dev": true - }, - "@types/serve-static": { - "version": "1.13.10", - "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.13.10.tgz", - "integrity": "sha512-nCkHGI4w7ZgAdNkrEu0bv+4xNV/XDqW+DydknebMOQwkpDGx8G+HTlj7R7ABI8i8nKxVw0wtKPi1D+lPOkh4YQ==", + "node_modules/modernizr/node_modules/string-width": { + "version": "4.2.3", "dev": true, - "requires": { - "@types/mime": "^1", - "@types/node": "*" + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" } }, - "@types/ws": { - "version": "8.5.3", - "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.3.tgz", - "integrity": "sha512-6YOoWjruKj1uLf3INHH7D3qTXwFfEsg1kf3c0uDdSBJwfa/llkwIjrAGV7j7mVgGNbzTQ3HiHKKDXl6bJPD97w==", + "node_modules/modernizr/node_modules/strip-ansi": { + "version": "6.0.1", "dev": true, - "requires": { - "@types/node": "*" + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "@types/xml2js": { - "version": "0.4.9", - "resolved": "https://registry.npmjs.org/@types/xml2js/-/xml2js-0.4.9.tgz", - "integrity": "sha512-CHiCKIihl1pychwR2RNX5mAYmJDACgFVCMT5OArMaO3erzwXVcBqPcusr+Vl8yeeXukxZqtF8mZioqX+mpjjdw==", + "node_modules/modernizr/node_modules/wrap-ansi": { + "version": "6.2.0", "dev": true, - "requires": { - "@types/node": "*" + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" } }, - "@types/yauzl": { - "version": "2.9.2", - "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.9.2.tgz", - "integrity": "sha512-8uALY5LTvSuHgloDVUvWP3pIauILm+8/0pDMokuDYIoNsOkSwd5AiHBTSEJjKTDcZr5z8UpgOWZkxBF4iJftoA==", - "optional": true, - "requires": { - "@types/node": "*" + "node_modules/modernizr/node_modules/y18n": { + "version": "4.0.3", + "dev": true, + "license": "ISC" + }, + "node_modules/modernizr/node_modules/yargs": { + "version": "15.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", + "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", + "string-width": "^4.2.0", + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" + }, + "engines": { + "node": ">=8" } }, - "@ungap/promise-all-settled": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@ungap/promise-all-settled/-/promise-all-settled-1.1.2.tgz", - "integrity": "sha512-sL/cEvJWAnClXw0wHk85/2L0G6Sj8UB0Ctc1TEMbKSsmpRosqhwj9gWgFRZSrBr2f9tiXISwNhCPmlfqUqyb9Q==", - "dev": true + "node_modules/modernizr/node_modules/yargs-parser": { + "version": "18.1.3", + "dev": true, + "license": "ISC", + "dependencies": { + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" + } }, - "abbrev": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", - "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", - "optional": true + "node_modules/ms": { + "version": "2.1.2", + "license": "MIT" }, - "accepts": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", - "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", - "requires": { - "mime-types": "~2.1.34", - "negotiator": "0.6.3" + "node_modules/nanoid": { + "version": "3.1.20", + "dev": true, + "license": "MIT", + "bin": { + "nanoid": "bin/nanoid.cjs" + }, + "engines": { + "node": "^10 || ^12 || ^13.7 || ^14 || >=15.0.1" } }, - "acorn": { - "version": "8.7.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", - "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", + "node_modules/natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw==", "dev": true }, - "acorn-walk": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/acorn-walk/-/acorn-walk-8.2.0.tgz", - "integrity": "sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==", + "node_modules/natural-compare-lite": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz", + "integrity": "sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g==", "dev": true }, - "agent-base": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", - "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", - "requires": { - "debug": "4" + "node_modules/negotiator": { + "version": "0.6.3", + "license": "MIT", + "engines": { + "node": ">= 0.6" } }, - "ajv": { - "version": "6.12.6", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", - "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", - "optional": true, - "requires": { - "fast-deep-equal": "^3.1.1", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.4.1", - "uri-js": "^4.2.2" + "node_modules/ngrok": { + "version": "4.3.1", + "hasInstallScript": true, + "license": "BSD-2-Clause", + "dependencies": { + "@types/node": "^8.10.50", + "extract-zip": "^2.0.1", + "got": "^11.5.1", + "lodash.clonedeep": "^4.5.0", + "uuid": "^7.0.0 || ^8.0.0", + "yaml": "^1.10.0" + }, + "bin": { + "ngrok": "bin/ngrok" + }, + "engines": { + "node": ">=10.19.0 <14 || >=14.2" + }, + "optionalDependencies": { + "hpagent": "^0.1.2" } }, - "ansi-colors": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", - "dev": true - }, - "ansi-regex": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", - "integrity": "sha1-w7M6te42DYbg5ijwRorn7yfWVN8=", - "optional": true + "node_modules/ngrok/node_modules/@types/node": { + "version": "8.10.66", + "license": "MIT" }, - "ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "requires": { - "color-convert": "^2.0.1" - } + "node_modules/nice-try": { + "version": "1.0.5", + "license": "MIT" }, - "anymatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.2.tgz", - "integrity": "sha512-P43ePfOAIupkguHUycrc4qJ9kz8ZiuOUijaETwX7THt0Y/GNK7v0aa8rY816xWjZ7rJdA5XdMcpVFTKMq+RvWg==", + "node_modules/nise": { + "version": "1.5.3", "dev": true, - "requires": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/formatio": "^3.2.1", + "@sinonjs/text-encoding": "^0.7.1", + "just-extend": "^4.0.2", + "lolex": "^5.0.1", + "path-to-regexp": "^1.7.0" } }, - "append-field": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-field/-/append-field-1.0.0.tgz", - "integrity": "sha1-HjRA6RXwsSA9I3SOeO3XubW0PlY=" + "node_modules/nise/node_modules/isarray": { + "version": "0.0.1", + "dev": true, + "license": "MIT" }, - "aproba": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/aproba/-/aproba-1.2.0.tgz", - "integrity": "sha512-Y9J6ZjXtoYh8RnXVCMOU/ttDmk1aBjunq9vO0ta5x85WDQiQfUF9sIPBITdbiiIVcBo03Hi3jMxigBtsddlXRw==", - "devOptional": true - }, - "are-we-there-yet": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-1.1.7.tgz", - "integrity": "sha512-nxwy40TuMiUGqMyRHgCSWZ9FM4VAoRP4xUYSTv5ImRog+h9yISPbVH7H8fASCIzYn9wlEv4zvFL7uKDMCFQm3g==", - "optional": true, - "requires": { - "delegates": "^1.0.0", - "readable-stream": "^2.0.6" + "node_modules/nise/node_modules/lolex": { + "version": "5.1.2", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^1.7.0" } }, - "arg": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", - "dev": true - }, - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - }, - "array-flatten": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", - "integrity": "sha1-ml9pkFGx5wczKPKgCJaLZOopVdI=" - }, - "array-from": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/array-from/-/array-from-2.1.1.tgz", - "integrity": "sha1-z+nYwmYoudxa7MYqn12PHzUsEZU=", - "dev": true - }, - "asn1": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", - "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", - "optional": true, - "requires": { - "safer-buffer": "~2.1.0" + "node_modules/nise/node_modules/path-to-regexp": { + "version": "1.8.0", + "dev": true, + "license": "MIT", + "dependencies": { + "isarray": "0.0.1" } }, - "assert-plus": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", - "integrity": "sha1-8S4PPF13sLHN2RRpQuTpbB5N1SU=", - "optional": true - }, - "assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "dev": true - }, - "asynckit": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=", - "optional": true - }, - "atob-lite": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/atob-lite/-/atob-lite-2.0.0.tgz", - "integrity": "sha512-LEeSAWeh2Gfa2FtlQE1shxQ8zi5F9GHarrGKz08TMdODD5T4eH6BMsvtnhbWZ+XQn+Gb6om/917ucvRu7l7ukw==" - }, - "aws-sign2": { - "version": "0.7.0", - "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", - "integrity": "sha1-tG6JCTSpWR8tL2+G1+ap8bP+dqg=", - "optional": true - }, - "aws4": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.11.0.tgz", - "integrity": "sha512-xh1Rl34h6Fi1DC2WWKfxUTVqRsNnr6LsKz2+hfwDxQJWmrx8+c7ylaqBMcHfl1U1r2dsifOvKX3LQuLNZ+XSvA==", + "node_modules/node-addon-api": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", + "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", "optional": true }, - "balanced-match": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", - "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", - "devOptional": true - }, - "base64id": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", - "dev": true + "node_modules/node-cleanup": { + "version": "2.1.2", + "dev": true, + "license": "MIT" }, - "bcrypt-pbkdf": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", - "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", - "optional": true, - "requires": { - "tweetnacl": "^0.14.3" + "node_modules/node-fetch": { + "version": "2.6.7", + "license": "MIT", + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } } }, - "before-after-hook": { - "version": "2.2.2", - "resolved": "https://registry.npmjs.org/before-after-hook/-/before-after-hook-2.2.2.tgz", - "integrity": "sha512-3pZEU3NT5BFUo/AD5ERPWOgQOCZITni6iavr5AUw5AUwQjMlI0kzu5btnyD39AF0gUEsDPwJT+oY1ORBJijPjQ==" - }, - "binary-extensions": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", - "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", - "dev": true - }, - "bindings": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", - "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "node_modules/node-gyp": { + "version": "9.3.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-9.3.1.tgz", + "integrity": "sha512-4Q16ZCqq3g8awk6UplT7AuxQ35XN4R/yf/+wSAwcBUAjg7l58RTactWaP8fIDTi0FzI7YcVLujwExakZlfWkXg==", "optional": true, - "requires": { - "file-uri-to-path": "1.0.0" - } - }, - "body-parser": { - "version": "1.19.2", - "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.2.tgz", - "integrity": "sha512-SAAwOxgoCKMGs9uUAUFHygfLAyaniaoun6I8mFY9pRAJL9+Kec34aU+oIjDhTycub1jozEfEwx1W1IuOYxVSFw==", - "requires": { - "bytes": "3.1.2", - "content-type": "~1.0.4", - "debug": "2.6.9", - "depd": "~1.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "on-finished": "~2.3.0", - "qs": "6.9.7", - "raw-body": "2.4.3", - "type-is": "~1.6.18" + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^10.0.3", + "nopt": "^6.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": "^12.13 || ^14.13 || >=16" } }, - "brace-expansion": { - "version": "1.1.11", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "devOptional": true, - "requires": { - "balanced-match": "^1.0.0", - "concat-map": "0.0.1" + "node_modules/node-windows-trayicon": { + "name": "windows-trayicon", + "version": "3.0.0", + "resolved": "git+ssh://git@github.com/keymanapp/node-windows-trayicon.git#b3dda72327141cd99b4e21d3f5d7002bb17c2131", + "hasInstallScript": true, + "license": "MIT", + "optional": true, + "os": [ + "win32" + ], + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^3.1.0", + "node-gyp": "^9.1.0" } }, - "braces": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "node_modules/noms": { + "version": "0.0.0", "dev": true, - "requires": { - "fill-range": "^7.0.1" + "license": "ISC", + "dependencies": { + "inherits": "^2.0.1", + "readable-stream": "~1.0.31" } }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true + "node_modules/noms/node_modules/isarray": { + "version": "0.0.1", + "dev": true, + "license": "MIT" }, - "browserstack": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/browserstack/-/browserstack-1.5.3.tgz", - "integrity": "sha512-AO+mECXsW4QcqC9bxwM29O7qWa7bJT94uBFzeb5brylIQwawuEziwq20dPYbins95GlWzOawgyDNdjYAo32EKg==", + "node_modules/noms/node_modules/readable-stream": { + "version": "1.0.34", "dev": true, - "requires": { - "https-proxy-agent": "^2.2.1" - }, + "license": "MIT", "dependencies": { - "agent-base": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.3.0.tgz", - "integrity": "sha512-salcGninV0nPrwpGNn4VTXBb1SOuXQBiqbrNXoeizJsHrsL6ERFM2Ne3JUSBWRE6aeNJI2ROP/WEEIDUiDe3cg==", - "dev": true, - "requires": { - "es6-promisify": "^5.0.0" - } - }, - "debug": { - "version": "3.2.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", - "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", - "dev": true, - "requires": { - "ms": "^2.1.1" - } - }, - "https-proxy-agent": { - "version": "2.2.4", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.4.tgz", - "integrity": "sha512-OmvfoQ53WLjtA9HeYP9RNrWMJzzAz1JGaSFr1nijg0PVR1JaD/xbJq1mdEIIlxGpXp9eSe/O2LgU9DJmTPd0Eg==", - "dev": true, - "requires": { - "agent-base": "^4.3.0", - "debug": "^3.1.0" - } - } + "core-util-is": "~1.0.0", + "inherits": "~2.0.1", + "isarray": "0.0.1", + "string_decoder": "~0.10.x" } }, - "browserstack-local": { - "version": "1.4.9", - "resolved": "https://registry.npmjs.org/browserstack-local/-/browserstack-local-1.4.9.tgz", - "integrity": "sha512-V+q8HQwRQFr9nd32xR66ZZ3VDWa3Kct4IMMudhKgcuD7cWrvvFARZOibx71II+Rf7P5nMQpWWxl9z/3p927nbg==", + "node_modules/noms/node_modules/string_decoder": { + "version": "0.10.31", "dev": true, - "requires": { - "https-proxy-agent": "^4.0.0", - "is-running": "^2.1.0", - "ps-tree": "=1.2.0", - "temp-fs": "^0.9.9" - }, + "license": "MIT" + }, + "node_modules/nopt": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-6.0.0.tgz", + "integrity": "sha512-ZwLpbTgdhuZUnZzjd7nb1ZV+4DoiC6/sfiVKok72ym/4Tlf+DFdlHYmT2JPmcNNWV6Pi3SDf1kT+A4r9RTuT9g==", + "optional": true, "dependencies": { - "agent-base": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-5.1.1.tgz", - "integrity": "sha512-TMeqbNl2fMW0nMjTEPOwe3J/PRFP4vqeoNuQMG0HlMrtm5QxKqdvAkZ1pRBQ/ulIyDD5Yq0nJ7YbdD8ey0TO3g==", - "dev": true - }, - "https-proxy-agent": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-4.0.0.tgz", - "integrity": "sha512-zoDhWrkR3of1l9QAL8/scJZyLu8j/gBkcwcaQOZh7Gyh/+uJQzGVETdgT30akuwkpL8HTRfssqI3BZuV18teDg==", - "dev": true, - "requires": { - "agent-base": "5", - "debug": "4" - } - } + "abbrev": "^1.0.0" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "btoa-lite": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/btoa-lite/-/btoa-lite-1.0.0.tgz", - "integrity": "sha512-gvW7InbIyF8AicrqWoptdW08pUxuhq8BEgowNajy9RhiE86fmGAGl+bLKo6oB8QP0CkqHLowfN0oJdKC/J6LbA==" - }, - "buffer-crc32": { - "version": "0.2.13", - "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", - "integrity": "sha1-DTM+PwDqxQqhRUq9MO+MKl2ackI=" - }, - "buffer-from": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==" - }, - "bytes": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", - "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==" + "node_modules/normalize-path": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "cacheable-lookup": { - "version": "5.0.4", - "resolved": "https://registry.npmjs.org/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz", - "integrity": "sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA==" + "node_modules/normalize-url": { + "version": "6.1.0", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "cacheable-request": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-7.0.2.tgz", - "integrity": "sha512-pouW8/FmiPQbuGpkXQ9BAPv/Mo5xDGANgSNXzTzJ8DrKGuXOssM4wIQRjfanNRh3Yu5cfYPvcorqbhg2KIJtew==", - "requires": { - "clone-response": "^1.0.2", - "get-stream": "^5.1.0", - "http-cache-semantics": "^4.0.0", - "keyv": "^4.0.0", - "lowercase-keys": "^2.0.0", - "normalize-url": "^6.0.1", - "responselike": "^2.0.0" + "node_modules/npm-run-path": { + "version": "2.0.2", + "license": "MIT", + "dependencies": { + "path-key": "^2.0.0" + }, + "engines": { + "node": ">=4" } }, - "camelcase": { - "version": "5.3.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==" + "node_modules/npm-run-path/node_modules/path-key": { + "version": "2.0.1", + "license": "MIT", + "engines": { + "node": ">=4" + } }, - "caseless": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", - "integrity": "sha1-G2gcIf+EAzyCZUMJBolCDRhxUdw=", - "optional": true + "node_modules/npmlog": { + "version": "6.0.2", + "devOptional": true, + "license": "ISC", + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, - "chai": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.3.4.tgz", - "integrity": "sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA==", + "node_modules/null-check": { + "version": "1.0.0", "dev": true, - "requires": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.2", - "deep-eql": "^3.0.1", - "get-func-name": "^2.0.0", - "pathval": "^1.1.1", - "type-detect": "^4.0.5" + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "requires": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" + "node_modules/number-is-nan": { + "version": "1.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "check-error": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.2.tgz", - "integrity": "sha1-V00xLt2Iu13YkS6Sht1sCu1KrII=", - "dev": true + "node_modules/object-assign": { + "version": "4.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "chokidar": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.1.tgz", - "integrity": "sha512-9+s+Od+W0VJJzawDma/gvBNQqkTiqYTWLuZoyAsivsI4AaWTCzHG06/TMjsf1cYe9Cb97UCEhjz7HvnPk2p/tw==", + "node_modules/object-inspect": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.3.tgz", + "integrity": "sha512-geUvdk7c+eizMNUDkRpW1wJwgfOiOeHbxBR/hLXK1aT6zmVSO0jsQcs7fj6MGw89jC/cjGfLcNOrtMYtGqm81g==", "dev": true, - "requires": { - "anymatch": "~3.1.1", - "braces": "~3.0.2", - "fsevents": "~2.3.1", - "glob-parent": "~5.1.0", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.5.0" + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "chownr": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", - "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", - "optional": true + "node_modules/object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true, + "engines": { + "node": ">= 0.4" + } }, - "cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "node_modules/object.assign": { + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - }, "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "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 - }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", + "object-keys": "^1.1.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "clone-response": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", - "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", - "requires": { - "mimic-response": "^1.0.0" + "node_modules/object.values": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.6.tgz", + "integrity": "sha512-FVVTkD1vENCsAcwNs9k6jea2uHC/X0+JcjG8YA60FN5CMaJmG95wT9jek/xX9nornqGRrBkKtzuAu2wuHpKqvw==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "code-point-at": { + "node_modules/octokit-pagination-methods": { "version": "1.1.0", - "resolved": "https://registry.npmjs.org/code-point-at/-/code-point-at-1.1.0.tgz", - "integrity": "sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=", - "optional": true + "license": "MIT" }, - "color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "requires": { - "color-name": "~1.1.4" + "node_modules/on-finished": { + "version": "2.3.0", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" } }, - "color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "color-support": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", - "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", - "dev": true - }, - "combined-stream": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", - "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "optional": true, - "requires": { - "delayed-stream": "~1.0.0" + "node_modules/once": { + "version": "1.4.0", + "license": "ISC", + "dependencies": { + "wrappy": "1" } }, - "commander": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/commander/-/commander-3.0.2.tgz", - "integrity": "sha512-Gar0ASD4BDyKC4hl4DwHqDrmvjoxWKZigVnAbn5H1owvm4CxCPdb0HQDehwNYMJpla5+M2tPmPARzhtYuwpHow==" + "node_modules/open": { + "version": "8.4.0", + "license": "MIT", + "dependencies": { + "define-lazy-prop": "^2.0.0", + "is-docker": "^2.1.1", + "is-wsl": "^2.2.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "component-emitter": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", - "dev": true + "node_modules/optionator": { + "version": "0.9.1", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", + "dev": true, + "dependencies": { + "deep-is": "^0.1.3", + "fast-levenshtein": "^2.0.6", + "levn": "^0.4.1", + "prelude-ls": "^1.2.1", + "type-check": "^0.4.0", + "word-wrap": "^1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } }, - "compress-brotli": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/compress-brotli/-/compress-brotli-1.3.6.tgz", - "integrity": "sha512-au99/GqZtUtiCBliqLFbWlhnCxn+XSYjwZ77q6mKN4La4qOXDoLVPZ50iXr0WmAyMxl8yqoq3Yq4OeQNPPkyeQ==", - "requires": { - "@types/json-buffer": "~3.0.0", - "json-buffer": "~3.0.1" + "node_modules/os-name": { + "version": "3.1.0", + "license": "MIT", + "dependencies": { + "macos-release": "^2.2.0", + "windows-release": "^3.1.0" + }, + "engines": { + "node": ">=6" } }, - "concat-map": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", - "devOptional": true + "node_modules/p-cancelable": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "concat-stream": { - "version": "1.6.2", - "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-1.6.2.tgz", - "integrity": "sha512-27HBghJxjiZtIk3Ycvn/4kbJk/1uZuJFfuPEns6LaEvpvG1f0hTea8lilrouyo9mVc2GWdcEZ8OLoGmSADlrCw==", - "requires": { - "buffer-from": "^1.0.0", - "inherits": "^2.0.3", - "readable-stream": "^2.2.2", - "typedarray": "^0.0.6" + "node_modules/p-finally": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=4" } }, - "connect": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", - "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", + "node_modules/p-limit": { + "version": "3.1.0", "dev": true, - "requires": { - "debug": "2.6.9", - "finalhandler": "1.1.2", - "parseurl": "~1.3.3", - "utils-merge": "1.0.1" - }, + "license": "MIT", "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dev": true, - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true - } + "yocto-queue": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "console-control-strings": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", - "integrity": "sha1-PXz0Rk22RG6mRL9LOVB/mFEAjo4=", - "devOptional": true - }, - "content-disposition": { - "version": "0.5.4", - "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", - "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", - "requires": { - "safe-buffer": "5.2.1" + "node_modules/p-locate": { + "version": "5.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "p-limit": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "content-type": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==" - }, - "convert-source-map": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-2.0.0.tgz", - "integrity": "sha512-Kvp459HrV2FEJ1CAsi1Ku+MY3kasH19TFykTz2xWmMeq6bk2NU3XXvfJ+Q61m0xktWwt+1HSYf3JZsTms3aRJg==" + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "optional": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "cookie": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.4.2.tgz", - "integrity": "sha512-aSWTXFzaKWkvHO1Ny/s+ePFpvKsPnjc551iI41v3ny/ow6tBG5Vd+FuqGNhh1LxOmVzOlGUriIlOaokOvhaStA==" + "node_modules/p-try": { + "version": "2.2.0", + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "cookie-signature": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", - "integrity": "sha1-4wOogrNCzD7oylE6eZmXNNqzriw=" + "node_modules/pako": { + "version": "1.0.11", + "license": "(MIT AND Zlib)" }, - "copyfiles": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", - "integrity": "sha512-fereAvAvxDrQDOXybk3Qu3dPbOoKoysFMWtkY3mv5BsL8//OSZVL5DCLYqgRfY5cWirgRzlC+WSrxp6Bo3eNZg==", + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, - "requires": { - "glob": "^7.0.5", - "minimatch": "^3.0.3", - "mkdirp": "^1.0.4", - "noms": "0.0.0", - "through2": "^2.0.1", - "untildify": "^4.0.0", - "yargs": "^16.1.0" - }, "dependencies": { - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "dev": true - } + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" } }, - "core-util-is": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.3.tgz", - "integrity": "sha512-ZQBvi1DcpJ4GDqanjucZ2Hj3wEO5pZDS89BWbkcrvdxksJorwUDDZamX9ldFkp9aw2lmBDLgkObEA4DWNJ9FYQ==" + "node_modules/parseurl": { + "version": "1.3.3", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } }, - "cors": { - "version": "2.8.5", - "resolved": "https://registry.npmjs.org/cors/-/cors-2.8.5.tgz", - "integrity": "sha512-KIHbLJqu73RGr/hnbrO9uBeixNGuvSQjul/jdFvS/KFSIH1hWVd1ng7zOHx+YrEfInLG7q4n6GHQ9cDtxv/P6g==", - "dev": true, - "requires": { - "object-assign": "^4", - "vary": "^1" + "node_modules/path-exists": { + "version": "4.0.0", + "license": "MIT", + "engines": { + "node": ">=8" } }, - "create-require": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", - "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", - "dev": true + "node_modules/path-is-absolute": { + "version": "1.0.1", + "devOptional": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "node_modules/path-key": { + "version": "3.1.1", "dev": true, - "requires": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "custom-event": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/custom-event/-/custom-event-1.0.1.tgz", - "integrity": "sha1-XQKkaFCt8bSjF5RqOSj8y1v9BCU=", - "dev": true + "node_modules/path-parse": { + "version": "1.0.7", + "dev": true, + "license": "MIT" }, - "dashdash": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", - "integrity": "sha1-hTz6D3y+L+1d4gMmuN1YEDX24vA=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0" + "node_modules/path-to-regexp": { + "version": "0.1.7", + "license": "MIT" + }, + "node_modules/path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true, + "engines": { + "node": ">=8" } }, - "date-format": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/date-format/-/date-format-4.0.6.tgz", - "integrity": "sha512-B9vvg5rHuQ8cbUXE/RMWMyX2YA5TecT3jKF5fLtGNlzPlU7zblSPmAm2OImDbWL+LDOQ6pUm+4LOFz+ywS41Zw==", - "dev": true + "node_modules/pathval": { + "version": "1.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } }, - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "requires": { - "ms": "2.1.2" + "node_modules/pause-stream": { + "version": "0.0.11", + "dev": true, + "license": [ + "MIT", + "Apache2" + ], + "dependencies": { + "through": "~2.3" } }, - "decamelize": { + "node_modules/pend": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", - "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=" + "license": "MIT" }, - "decompress-response": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", - "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", - "requires": { - "mimic-response": "^3.1.0" + "node_modules/picomatch": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", + "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", + "dev": true, + "engines": { + "node": ">=8.6" }, - "dependencies": { - "mimic-response": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", - "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==" - } + "funding": { + "url": "https://github.com/sponsors/jonschlinkert" } }, - "deep-eql": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", + "node_modules/prelude-ls": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true, - "requires": { - "type-detect": "^4.0.0" + "engines": { + "node": ">= 0.8.0" } }, - "defer-to-connect": { + "node_modules/process-nextick-args": { "version": "2.0.1", - "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-2.0.1.tgz", - "integrity": "sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg==" - }, - "define-lazy-prop": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz", - "integrity": "sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og==" - }, - "delayed-stream": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", - "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=", - "optional": true - }, - "delegates": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", - "integrity": "sha1-hMbhWbgZBP3KWaDvRM2HDTElD5o=", - "devOptional": true - }, - "depd": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/depd/-/depd-1.1.2.tgz", - "integrity": "sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak=" - }, - "deprecation": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/deprecation/-/deprecation-2.3.1.tgz", - "integrity": "sha512-xmHIy4F3scKVwMsQ4WnVaS8bHOx0DmVwRywosKhaILI0ywMDWPtBSku2HNxRvF7jtwDRsoEwYQSfbxj8b7RlJQ==" - }, - "destroy": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.0.4.tgz", - "integrity": "sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA=" - }, - "di": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/di/-/di-0.0.1.tgz", - "integrity": "sha1-gGZJMmzqp8qjMG112YXqJ0i6kTw=", - "dev": true - }, - "diff": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.0.0.tgz", - "integrity": "sha512-/VTCrvm5Z0JGty/BWHljh+BAiw3IK+2j87NGMu8Nwc/f48WoDAC395uomO9ZD117ZOBaHmkX1oyLvkVM/aIT3w==", - "dev": true - }, - "doctrine": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", - "dev": true, - "requires": { - "esutils": "^2.0.2" - } + "license": "MIT" }, - "dom-serialize": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/dom-serialize/-/dom-serialize-2.2.1.tgz", - "integrity": "sha1-ViromZ9Evl6jB29UGdzVnrQ6yVs=", + "node_modules/progress": { + "version": "2.0.3", "dev": true, - "requires": { - "custom-event": "~1.0.0", - "ent": "~2.2.0", - "extend": "^3.0.0", - "void-elements": "^2.0.0" + "license": "MIT", + "engines": { + "node": ">=0.4.0" } }, - "duplexer": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/duplexer/-/duplexer-0.1.2.tgz", - "integrity": "sha512-jtD6YG370ZCIi/9GTaJKQxWTZD045+4R4hTk/x1UyoqadyJ9x9CgSi1RlVDQF8U2sxLLSnFkCaMihqljHIWgMg==", - "dev": true + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "optional": true }, - "ecc-jsbn": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", - "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", "optional": true, - "requires": { - "jsbn": "~0.1.0", - "safer-buffer": "^2.1.0" + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" } }, - "edge-launcher": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/edge-launcher/-/edge-launcher-1.2.2.tgz", - "integrity": "sha1-60Cq+9Bnpup27/+rBke81VCbN7I=", - "dev": true - }, - "ee-first": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", - "integrity": "sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0=" - }, - "emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "encodeurl": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", - "integrity": "sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k=" - }, - "end-of-stream": { - "version": "1.4.4", - "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", - "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", - "requires": { - "once": "^1.4.0" + "node_modules/proxy-addr": { + "version": "2.0.7", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" } }, - "engine.io": { - "version": "6.1.3", - "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-6.1.3.tgz", - "integrity": "sha512-rqs60YwkvWTLLnfazqgZqLa/aKo+9cueVfEi/dZ8PyGyaf8TLOxj++4QMIgeG3Gn0AhrWiFXvghsoY9L9h25GA==", + "node_modules/proxy-from-env": { + "version": "1.1.0", "dev": true, - "requires": { - "@types/cookie": "^0.4.1", - "@types/cors": "^2.8.12", - "@types/node": ">=10.0.0", - "accepts": "~1.3.4", - "base64id": "2.0.0", - "cookie": "~0.4.1", - "cors": "~2.8.5", - "debug": "~4.3.1", - "engine.io-parser": "~5.0.3", - "ws": "~8.2.3" - }, - "dependencies": { - "ws": { - "version": "8.2.3", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.2.3.tgz", - "integrity": "sha512-wBuoj1BDpC6ZQ1B7DWQBYVLphPWkm8i9Y0/3YdHjHKHiohOJ1ws+3OccDWtH+PoC9DZD5WOTrJvNbWvjS6JWaA==", - "dev": true, - "requires": {} - } - } + "license": "MIT" }, - "engine.io-parser": { - "version": "5.0.3", - "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-5.0.3.tgz", - "integrity": "sha512-BtQxwF27XUNnSafQLvDi0dQ8s3i6VgzSoQMJacpIcGNrlUdfHSKbgm3jmjCVvQluGzqwujQMPAoMai3oYSTurg==", + "node_modules/ps-tree": { + "version": "1.2.0", "dev": true, - "requires": { - "@socket.io/base64-arraybuffer": "~1.0.2" + "license": "MIT", + "dependencies": { + "event-stream": "=3.3.4" + }, + "bin": { + "ps-tree": "bin/ps-tree.js" + }, + "engines": { + "node": ">= 0.10" } }, - "ent": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/ent/-/ent-2.2.0.tgz", - "integrity": "sha1-6WQhkyWiHQX0RGai9obtbOX13R0=", - "dev": true - }, - "entities": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/entities/-/entities-2.1.0.tgz", - "integrity": "sha512-hCx1oky9PFrJ611mf0ifBLBRW8lUUVRlFolb5gWRfIELabBlbp9xZvrqZLZAs+NxFnbfQoeGd8wDkygjg7U85w==", - "dev": true - }, - "env-paths": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", - "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", - "optional": true + "node_modules/pump": { + "version": "3.0.0", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } }, - "es6-promise": { - "version": "4.2.8", - "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.8.tgz", - "integrity": "sha512-HJDGx5daxeIvxdBxvG2cb9g4tEvwIk3i8+nhX0yGrYmZUzbkdg8QbDevheDB8gd0//uPj4c1EQua8Q+MViT0/w==", - "dev": true + "node_modules/punycode": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "es6-promisify": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", - "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "node_modules/q": { + "version": "1.5.1", "dev": true, - "requires": { - "es6-promise": "^4.0.3" + "license": "MIT", + "engines": { + "node": ">=0.6.0", + "teleport": ">=0.2.0" } }, - "es6-shim": { - "version": "0.35.6", - "resolved": "https://registry.npmjs.org/es6-shim/-/es6-shim-0.35.6.tgz", - "integrity": "sha512-EmTr31wppcaIAgblChZiuN/l9Y7DPyw8Xtbg7fIVngn6zMW+IEBJDJngeKC3x6wr0V/vcA2wqeFnaw1bFJbDdA==" - }, - "escalade": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.1.tgz", - "integrity": "sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw==", - "dev": true - }, - "escape-html": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", - "integrity": "sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg=" - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - }, - "esutils": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true - }, - "etag": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", - "integrity": "sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc=" - }, - "event-stream": { - "version": "3.3.4", - "resolved": "https://registry.npmjs.org/event-stream/-/event-stream-3.3.4.tgz", - "integrity": "sha1-SrTJoPWlTbkzi0w02Gv86PSzVXE=", + "node_modules/qjobs": { + "version": "1.2.0", "dev": true, - "requires": { - "duplexer": "~0.1.1", - "from": "~0", - "map-stream": "~0.1.0", - "pause-stream": "0.0.11", - "split": "0.3", - "stream-combiner": "~0.0.4", - "through": "~2.3.1" + "license": "MIT", + "engines": { + "node": ">=0.9" } }, - "eventemitter3": { - "version": "4.0.7", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", - "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==" - }, - "execa": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/execa/-/execa-1.0.0.tgz", - "integrity": "sha512-adbxcyWV46qiHyvSp50TKt05tB4tK3HcmF7/nxfAdhnox83seTDbwnaqKO4sXRy7roHAIFqJP/Rw/AuEbX61LA==", - "requires": { - "cross-spawn": "^6.0.0", - "get-stream": "^4.0.0", - "is-stream": "^1.1.0", - "npm-run-path": "^2.0.0", - "p-finally": "^1.0.0", - "signal-exit": "^3.0.0", - "strip-eof": "^1.0.0" + "node_modules/qs": { + "version": "6.9.7", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.6" }, - "dependencies": { - "cross-spawn": { - "version": "6.0.5", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", - "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", - "requires": { - "nice-try": "^1.0.4", - "path-key": "^2.0.1", - "semver": "^5.5.0", - "shebang-command": "^1.2.0", - "which": "^1.2.9" - } - }, - "get-stream": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", - "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", - "requires": { - "pump": "^3.0.0" - } - }, - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==" - }, - "semver": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==" - }, - "shebang-command": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", - "integrity": "sha512-EV3L1+UQWGor21OmnvojK36mhg+TyIKDh3iFBKBohr5xeXIhNBcx8oWdgkTEEQ+BEFFYdLRuqMfd5L84N1V5Vg==", - "requires": { - "shebang-regex": "^1.0.0" - } + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-microtask": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", + "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" }, - "shebang-regex": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", - "integrity": "sha512-wpoSFAxys6b2a2wHZ1XpDSgD7N9iVjg29Ph9uV/uaP9Ex/KXlkTZTeddxDPSYQpgvzKLGJke2UU0AzoGCjNIvQ==" + { + "type": "patreon", + "url": "https://www.patreon.com/feross" }, - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "requires": { - "isexe": "^2.0.0" - } + { + "type": "consulting", + "url": "https://feross.org/support" } - } + ] }, - "express": { - "version": "4.17.3", - "resolved": "https://registry.npmjs.org/express/-/express-4.17.3.tgz", - "integrity": "sha512-yuSQpz5I+Ch7gFrPCk4/c+dIBKlQUxtgwqzph132bsT6qhuzss6I8cLJQz7B3rFblzd6wtcI0ZbGltH/C4LjUg==", - "requires": { - "accepts": "~1.3.8", - "array-flatten": "1.1.1", - "body-parser": "1.19.2", - "content-disposition": "0.5.4", - "content-type": "~1.0.4", - "cookie": "0.4.2", - "cookie-signature": "1.0.6", - "debug": "2.6.9", - "depd": "~1.1.2", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "finalhandler": "~1.1.2", - "fresh": "0.5.2", - "merge-descriptors": "1.0.1", - "methods": "~1.1.2", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "path-to-regexp": "0.1.7", - "proxy-addr": "~2.0.7", - "qs": "6.9.7", - "range-parser": "~1.2.1", - "safe-buffer": "5.2.1", - "send": "0.17.2", - "serve-static": "1.14.2", - "setprototypeof": "1.2.0", - "statuses": "~1.5.0", - "type-is": "~1.6.18", - "utils-merge": "1.0.1", - "vary": "~1.1.2" + "node_modules/quick-lru": { + "version": "5.1.1", + "license": "MIT", + "engines": { + "node": ">=10" }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "extend": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", - "devOptional": true - }, - "extract-zip": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", - "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", - "requires": { - "@types/yauzl": "^2.9.1", - "debug": "^4.1.1", - "get-stream": "^5.1.0", - "yauzl": "^2.10.0" + "node_modules/randombytes": { + "version": "2.1.0", + "dev": true, + "license": "MIT", + "dependencies": { + "safe-buffer": "^5.1.0" } }, - "extsprintf": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", - "integrity": "sha1-lpGEQOMEGnpBT4xS48V06zw+HgU=", - "optional": true - }, - "fast-deep-equal": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", - "optional": true - }, - "fast-json-stable-stringify": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", - "optional": true + "node_modules/range-parser": { + "version": "1.2.1", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } }, - "fd-slicer": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", - "integrity": "sha1-JcfInLH5B3+IkbvmHY85Dq4lbx4=", - "requires": { - "pend": "~1.2.0" + "node_modules/raw-body": { + "version": "2.4.3", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "1.8.1", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" } }, - "file": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/file/-/file-0.2.2.tgz", - "integrity": "sha1-w9/Y+M81Na5FXCtCPC5SY112tNM=", - "dev": true + "node_modules/readable-stream": { + "version": "2.3.7", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } }, - "file-uri-to-path": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", - "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", - "optional": true + "node_modules/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" }, - "fill-range": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "node_modules/readdirp": { + "version": "3.5.0", "dev": true, - "requires": { - "to-regex-range": "^5.0.1" - } - }, - "finalhandler": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", - "requires": { - "debug": "2.6.9", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "on-finished": "~2.3.0", - "parseurl": "~1.3.3", - "statuses": "~1.5.0", - "unpipe": "~1.0.0" - }, + "license": "MIT", "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } + "picomatch": "^2.2.1" + }, + "engines": { + "node": ">=8.10.0" } }, - "find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", + "node_modules/rechoir": { + "version": "0.6.2", "dev": true, - "requires": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" + "dependencies": { + "resolve": "^1.1.6" + }, + "engines": { + "node": ">= 0.10" } }, - "flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "dev": true - }, - "flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", - "dev": true - }, - "follow-redirects": { - "version": "1.14.9", - "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", - "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==", - "dev": true - }, - "forever-agent": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", - "integrity": "sha1-+8cfDEGt6zf5bFd60e1C2P2sypE=", - "optional": true + "node_modules/regexp.prototype.flags": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.5.0.tgz", + "integrity": "sha512-0SutC3pNudRKgquxGoRGIz946MZVHqbNfPjBdxeOhBrdgDKlRoXmYLQN9xRbrR09ZXWeGAdPuif7egofn6v5LA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.2.0", + "functions-have-names": "^1.2.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "form-data": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", - "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", - "optional": true, - "requires": { - "asynckit": "^0.4.0", - "combined-stream": "^1.0.6", - "mime-types": "^2.1.12" + "node_modules/regexpp": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.2.0.tgz", + "integrity": "sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg==", + "dev": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" } }, - "forwarded": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", - "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==" + "node_modules/require-directory": { + "version": "2.1.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "fresh": { - "version": "0.5.2", - "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", - "integrity": "sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac=" + "node_modules/require-from-string": { + "version": "2.0.2", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "from": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/from/-/from-0.1.7.tgz", - "integrity": "sha1-g8YK/Fi5xWmXAH7Rp2izqzA6RP4=", - "dev": true + "node_modules/require-main-filename": { + "version": "2.0.0", + "license": "ISC" }, - "fs-access": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/fs-access/-/fs-access-1.0.1.tgz", - "integrity": "sha1-1qh/JiJxzv6+wwxVNAf7mV2od3o=", + "node_modules/requirejs": { + "version": "2.3.6", "dev": true, - "requires": { - "null-check": "^1.0.0" + "license": "MIT", + "bin": { + "r_js": "bin/r.js", + "r.js": "bin/r.js" + }, + "engines": { + "node": ">=0.4.0" } }, - "fs-extra": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.1.tgz", - "integrity": "sha512-NbdoVMZso2Lsrn/QwLXOy6rm0ufY2zEOKCDzJR/0kBsb0E6qed0P3iYK+Ath3BfvXEeu4JhEtXLgILx5psUfag==", + "node_modules/requires-port": { + "version": "1.0.0", "dev": true, - "requires": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - } + "license": "MIT" }, - "fs-minipass": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", - "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", - "optional": true, - "requires": { - "minipass": "^3.0.0" + "node_modules/resolve": { + "version": "1.22.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-core-module": "^2.9.0", + "path-parse": "^1.0.7", + "supports-preserve-symlinks-flag": "^1.0.0" + }, + "bin": { + "resolve": "bin/resolve" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "devOptional": true + "node_modules/resolve-alpn": { + "version": "1.2.1", + "license": "MIT" }, - "fsevents": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.2.tgz", - "integrity": "sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA==", + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true, - "optional": true - }, - "gauge": { - "version": "2.7.4", - "resolved": "https://registry.npmjs.org/gauge/-/gauge-2.7.4.tgz", - "integrity": "sha1-LANAXHU4w51+s3sxcCLjJfsBi/c=", - "optional": true, - "requires": { - "aproba": "^1.0.3", - "console-control-strings": "^1.0.0", - "has-unicode": "^2.0.0", - "object-assign": "^4.1.0", - "signal-exit": "^3.0.0", - "string-width": "^1.0.1", - "strip-ansi": "^3.0.1", - "wide-align": "^1.1.0" + "engines": { + "node": ">=4" } }, - "get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==" - }, - "get-func-name": { + "node_modules/responselike": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.0.tgz", - "integrity": "sha1-6td0q+5y4gQJQzoGY2YCPdaIekE=", - "dev": true - }, - "get-stream": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", - "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", - "requires": { - "pump": "^3.0.0" + "license": "MIT", + "dependencies": { + "lowercase-keys": "^2.0.0" } }, - "getpass": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", - "integrity": "sha1-Xv+OPmhNVprkyysSgmBOi6YhSfo=", + "node_modules/restructure": { + "version": "3.0.0", + "resolved": "git+ssh://git@github.com/keymanapp/dependency-restructure.git#49d129cf0916d082a7278bb09296fb89cecfcc50", + "integrity": "sha512-2vBFOLc0+dkUb3Pnpl87o+B4SIc3MAm3P8PXT8YFkP51URFGsgTgm3gAnwTX2jXSEd/5eT9n7C733loG6OaVgw==", + "license": "MIT" + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", "optional": true, - "requires": { - "assert-plus": "^1.0.0" + "engines": { + "node": ">= 4" } }, - "glob": { - "version": "7.1.6", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", + "node_modules/reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true, + "engines": { + "iojs": ">=1.0.0", + "node": ">=0.10.0" + } + }, + "node_modules/rfdc": { + "version": "1.3.0", + "dev": true, + "license": "MIT" + }, + "node_modules/rimraf": { + "version": "3.0.2", "devOptional": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "license": "ISC", + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" } }, - "glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", + "node_modules/run-parallel": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", + "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", "dev": true, - "requires": { - "is-glob": "^4.0.1" + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "dependencies": { + "queue-microtask": "^1.2.2" } }, - "google-closure-compiler-java": { - "version": "20200224.0.0", - "resolved": "https://registry.npmjs.org/google-closure-compiler-java/-/google-closure-compiler-java-20200224.0.0.tgz", - "integrity": "sha512-palFcDoScauZjWIsGDzMK6h+IctcRb55I3wJX8Ko/DTSz72xwadRdKm0lGt8OoYL7SKEO+IjgD7s8XrAGpLnlQ==", - "dev": true + "node_modules/safe-buffer": { + "version": "5.2.1", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" }, - "got": { - "version": "11.8.5", - "resolved": "https://registry.npmjs.org/got/-/got-11.8.5.tgz", - "integrity": "sha512-o0Je4NvQObAuZPHLFoRSkdG2lTgtcynqymzg2Vupdx6PorhaT5MCbIyXG6d4D94kk8ZG57QeosgdiqfJWhEhlQ==", - "requires": { - "@sindresorhus/is": "^4.0.0", - "@szmarczak/http-timer": "^4.0.5", - "@types/cacheable-request": "^6.0.1", - "@types/responselike": "^1.0.0", - "cacheable-lookup": "^5.0.3", - "cacheable-request": "^7.0.2", - "decompress-response": "^6.0.0", - "http2-wrapper": "^1.0.0-beta.5.2", - "lowercase-keys": "^2.0.0", - "p-cancelable": "^2.0.0", - "responselike": "^2.0.0" + "node_modules/safe-regex-test": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/safe-regex-test/-/safe-regex-test-1.0.0.tgz", + "integrity": "sha512-JBUUzyOgEwXQY1NuPtvcj/qcBDbDmEvWufhlnXZIm75DEHp+afM1r1ujJpJsV/gSM4t59tpDyPi1sd6ZaPFfsA==", + "dev": true, + "dependencies": { + "call-bind": "^1.0.2", + "get-intrinsic": "^1.1.3", + "is-regex": "^1.1.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "graceful-fs": { - "version": "4.2.10", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", - "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==", - "devOptional": true + "node_modules/safer-buffer": { + "version": "2.1.2", + "license": "MIT" }, - "har-schema": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", - "integrity": "sha1-qUwiJOvKwEeCoNkDVSHyRzW37JI=", - "optional": true + "node_modules/sax": { + "version": "1.2.4", + "license": "ISC" }, - "har-validator": { - "version": "5.1.5", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", - "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", - "optional": true, - "requires": { - "ajv": "^6.12.3", - "har-schema": "^2.0.0" + "node_modules/semver": { + "version": "7.3.8", + "license": "ISC", + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" } }, - "has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" + "node_modules/send": { + "version": "0.17.2", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "~1.1.2", + "destroy": "~1.0.4", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "1.8.1", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "~2.3.0", + "range-parser": "~1.2.1", + "statuses": "~1.5.0" + }, + "engines": { + "node": ">= 0.8.0" + } }, - "has-unicode": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", - "integrity": "sha1-4Ob+aijPUROIVeCG0Wkedx3iqLk=", - "devOptional": true + "node_modules/send/node_modules/debug": { + "version": "2.6.9", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } }, - "he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "dev": true + "node_modules/send/node_modules/debug/node_modules/ms": { + "version": "2.0.0", + "license": "MIT" }, - "hetrodo-node-hide-console-window-napi": { - "version": "git+ssh://git@github.com/keymanapp/hetrodo-node-hide-console-window-napi.git#858b23036a9963b40ad6ff3c5bacd421e5839b92", - "from": "hetrodo-node-hide-console-window-napi@git+ssh://git@github.com/keymanapp/hetrodo-node-hide-console-window-napi.git#858b23036a9963b40ad6ff3c5bacd421e5839b92", - "optional": true + "node_modules/send/node_modules/mime": { + "version": "1.6.0", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } }, - "hpagent": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/hpagent/-/hpagent-0.1.2.tgz", - "integrity": "sha512-ePqFXHtSQWAFXYmj+JtOTHr84iNrII4/QRlAAPPE+zqnKy4xJo7Ie1Y4kC7AdB+LxLxSTTzBMASsEcy0q8YyvQ==", - "optional": true + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "license": "MIT" }, - "http-cache-semantics": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", - "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==" + "node_modules/serialize-javascript": { + "version": "5.0.1", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "randombytes": "^2.1.0" + } }, - "http-errors": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.8.1.tgz", - "integrity": "sha512-Kpk9Sm7NmI+RHhnj6OIWDI1d6fIoFAtFt9RLaTMRlg/8w49juAStsrBgp0Dp4OdxdVbRIeKhtCUvoi/RuAhO4g==", - "requires": { - "depd": "~1.1.2", - "inherits": "2.0.4", - "setprototypeof": "1.2.0", - "statuses": ">= 1.5.0 < 2", - "toidentifier": "1.0.1" + "node_modules/serve-static": { + "version": "1.14.2", + "license": "MIT", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.17.2" + }, + "engines": { + "node": ">= 0.8.0" } }, - "http-proxy": { - "version": "1.18.1", - "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", - "dev": true, - "requires": { - "eventemitter3": "^4.0.0", - "follow-redirects": "^1.0.0", - "requires-port": "^1.0.0" + "node_modules/set-blocking": { + "version": "2.0.0", + "license": "ISC" + }, + "node_modules/set-immediate-shim": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "http-signature": { + "node_modules/setprototypeof": { "version": "1.2.0", - "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", - "integrity": "sha1-muzZJRFHcvPZW2WmCruPfBj7rOE=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "jsprim": "^1.2.2", - "sshpk": "^1.7.0" - } + "license": "ISC" }, - "http2-wrapper": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/http2-wrapper/-/http2-wrapper-1.0.3.tgz", - "integrity": "sha512-V+23sDMr12Wnz7iTcDeJr3O6AIxlnvT/bmaAAAP/Xda35C90p9599p0F1eHR/N1KILWSoWVAiOMFjBBXaXSMxg==", - "requires": { - "quick-lru": "^5.1.1", - "resolve-alpn": "^1.0.0" + "node_modules/shebang-command": { + "version": "2.0.0", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" } }, - "https-proxy-agent": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", - "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", - "requires": { - "agent-base": "6", - "debug": "4" + "node_modules/shebang-regex": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" } }, - "iconv-lite": { - "version": "0.4.24", - "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", - "requires": { - "safer-buffer": ">= 2.1.2 < 3" + "node_modules/shelljs": { + "version": "0.8.5", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "glob": "^7.0.0", + "interpret": "^1.0.0", + "rechoir": "^0.6.2" + }, + "bin": { + "shjs": "bin/shjs" + }, + "engines": { + "node": ">=4" } }, - "immediate": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.0.6.tgz", - "integrity": "sha1-nbHb0Pr43m++D13V5Wu2BigN5ps=", - "dev": true - }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", - "devOptional": true, - "requires": { - "once": "^1.3.0", - "wrappy": "1" + "node_modules/shelljs.exec": { + "version": "1.1.8", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" } }, - "inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "ipaddr.js": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", - "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==" - }, - "is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "node_modules/side-channel": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.4.tgz", + "integrity": "sha512-q5XPytqFEIKHkGdiMIrY10mvLRvnQh42/+GoBlFW3b2LXLE2xxJpZFdm94we0BaoV3RwJyGqg5wS7epxTv0Zvw==", "dev": true, - "requires": { - "binary-extensions": "^2.0.0" + "dependencies": { + "call-bind": "^1.0.0", + "get-intrinsic": "^1.0.2", + "object-inspect": "^1.9.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "is-docker": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.2.1.tgz", - "integrity": "sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ==" - }, - "is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", - "dev": true + "node_modules/signal-exit": { + "version": "3.0.7", + "license": "ISC" }, - "is-fullwidth-code-point": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-1.0.0.tgz", - "integrity": "sha1-754xOG8DGn8NZDr4L95QxFfvAMs=", - "optional": true, - "requires": { - "number-is-nan": "^1.0.0" + "node_modules/sinon": { + "version": "7.5.0", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "@sinonjs/commons": "^1.4.0", + "@sinonjs/formatio": "^3.2.1", + "@sinonjs/samsam": "^3.3.3", + "diff": "^3.5.0", + "lolex": "^4.2.0", + "nise": "^1.5.2", + "supports-color": "^5.5.0" } }, - "is-glob": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "node_modules/sinon-chai": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/sinon-chai/-/sinon-chai-3.7.0.tgz", + "integrity": "sha512-mf5NURdUaSdnatJx3uhoBOrY9dtL19fiOtAdT1Azxg3+lNJFiuN0uzaU3xX1LeAfL17kHQhTAJgpsfhbMJMY2g==", "dev": true, - "requires": { - "is-extglob": "^2.1.1" + "peerDependencies": { + "chai": "^4.0.0", + "sinon": ">=4.0.0" } }, - "is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "dev": true - }, - "is-plain-object": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-5.0.0.tgz", - "integrity": "sha512-VRSzKkbMm5jMDoKLbltAkFQ5Qr7VDiTFGXxYFXXowVj387GeGNOCsOH6Msy00SGZ3Fp84b1Naa1psqgcCIEP5Q==" - }, - "is-running": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-running/-/is-running-2.1.0.tgz", - "integrity": "sha1-MKc/9cw4VOT8JUkICen1q/jeCeA=", - "dev": true - }, - "is-stream": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", - "integrity": "sha512-uQPm8kcs47jx38atAcWTVxyltQYoPT68y9aWYdV6yWXSyW8mzSat0TL6CiWdZeCdF3KrAvpVtnHbTv4RN+rqdQ==" - }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", - "optional": true - }, - "is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "dev": true - }, - "is-wsl": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", - "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", - "requires": { - "is-docker": "^2.0.0" + "node_modules/sinon/node_modules/diff": { + "version": "3.5.0", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" } }, - "isarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", - "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=" - }, - "isbinaryfile": { - "version": "4.0.10", - "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.10.tgz", - "integrity": "sha512-iHrqe5shvBUcFbmZq9zOQHBoeOhZJu6RQGrDpBgenUm/Am+F3JM2MgQj+rK3Z601fzrL5gLZWtAPH2OBaSVcyw==", - "dev": true - }, - "isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=" - }, - "isstream": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", - "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", - "optional": true + "node_modules/sinon/node_modules/has-flag": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4" + } }, - "js-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "node_modules/sinon/node_modules/supports-color": { + "version": "5.5.0", "dev": true, - "requires": { - "argparse": "^2.0.1" + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" } }, - "jsbn": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", - "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "optional": true + "node_modules/slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true, + "engines": { + "node": ">=8" + } }, - "json-buffer": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.1.tgz", - "integrity": "sha512-4bV5BfR2mqfQTJm+V5tPPdf+ZpuhiIvTuAB5g8kcrXOZpTT/QwwVRWBywX1ozr6lEuPdbHxwaJlm9G6mI2sfSQ==" + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "optional": true, + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } }, - "json-schema": { - "version": "0.4.0", - "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", - "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", - "optional": true + "node_modules/socket.io": { + "version": "4.4.1", + "dev": true, + "license": "MIT", + "dependencies": { + "accepts": "~1.3.4", + "base64id": "~2.0.0", + "debug": "~4.3.2", + "engine.io": "~6.1.0", + "socket.io-adapter": "~2.3.3", + "socket.io-parser": "~4.0.4" + }, + "engines": { + "node": ">=10.0.0" + } }, - "json-schema-traverse": { - "version": "0.4.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", - "optional": true + "node_modules/socket.io-adapter": { + "version": "2.3.3", + "dev": true, + "license": "MIT" }, - "json-stringify-safe": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", - "integrity": "sha1-Epai1Y/UXxmg9s4B1lcB4sc1tus=", - "optional": true + "node_modules/socket.io-parser": { + "version": "4.0.5", + "dev": true, + "license": "MIT", + "dependencies": { + "@types/component-emitter": "^1.2.10", + "component-emitter": "~1.3.0", + "debug": "~4.3.1" + }, + "engines": { + "node": ">=10.0.0" + } }, - "jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "node_modules/socket.io/node_modules/debug": { + "version": "4.3.4", "dev": true, - "requires": { - "graceful-fs": "^4.1.6", - "universalify": "^2.0.0" + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } } }, - "jsprim": { - "version": "1.4.2", - "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", - "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "node_modules/socks": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.7.1.tgz", + "integrity": "sha512-7maUZy1N7uo6+WVEX6psASxtNlKaNVMlGQKkG/63nEDdLOWNbiUMoLK7X4uYoLhQstau72mLgfEWcXcwsaHbYQ==", "optional": true, - "requires": { - "assert-plus": "1.0.0", - "extsprintf": "1.3.0", - "json-schema": "0.4.0", - "verror": "1.10.0" + "dependencies": { + "ip": "^2.0.0", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.13.0", + "npm": ">= 3.0.0" } }, - "jszip": { - "version": "3.9.1", - "resolved": "https://registry.npmjs.org/jszip/-/jszip-3.9.1.tgz", - "integrity": "sha512-H9A60xPqJ1CuC4Ka6qxzXZeU8aNmgOeP5IFqwJbQQwtu2EUYxota3LdsiZWplF7Wgd9tkAd0mdu36nceSaPuYw==", - "dev": true, - "requires": { - "lie": "~3.3.0", - "pako": "~1.0.2", - "readable-stream": "~2.3.6", - "set-immediate-shim": "~1.0.1" + "node_modules/socks-proxy-agent": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-7.0.0.tgz", + "integrity": "sha512-Fgl0YPZ902wEsAyiQ+idGd1A7rSFx/ayC1CQVMw5P+EQx2V0SgpGtf6OKFhVjPflPUl9YMmEOnmfjCdMUsygww==", + "optional": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" } }, - "just-extend": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/just-extend/-/just-extend-4.2.1.tgz", - "integrity": "sha512-g3UB796vUFIY90VIv/WX3L2c8CS2MdWUww3CNrYmqza1Fg0DURc2K/O4YrnklBdQarSJ/y8JnJYDGc+1iumQjg==", - "dev": true - }, - "karma": { - "version": "6.4.1", - "resolved": "https://registry.npmjs.org/karma/-/karma-6.4.1.tgz", - "integrity": "sha512-Cj57NKOskK7wtFWSlMvZf459iX+kpYIPXmkNUzP2WAFcA7nhr/ALn5R7sw3w+1udFDcpMx/tuB8d5amgm3ijaA==", - "dev": true, - "requires": { - "@colors/colors": "1.5.0", - "body-parser": "^1.19.0", - "braces": "^3.0.2", - "chokidar": "^3.5.1", - "connect": "^3.7.0", - "di": "^0.0.1", - "dom-serialize": "^2.2.1", - "glob": "^7.1.7", - "graceful-fs": "^4.2.6", - "http-proxy": "^1.18.1", - "isbinaryfile": "^4.0.8", - "lodash": "^4.17.21", - "log4js": "^6.4.1", - "mime": "^2.5.2", - "minimatch": "^3.0.4", - "mkdirp": "^0.5.5", - "qjobs": "^1.2.0", - "range-parser": "^1.2.1", - "rimraf": "^3.0.2", - "socket.io": "^4.4.1", - "source-map": "^0.6.1", - "tmp": "^0.2.1", - "ua-parser-js": "^0.7.30", - "yargs": "^16.1.1" + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.4", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", + "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", + "optional": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" }, - "dependencies": { - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - } + "peerDependenciesMeta": { + "supports-color": { + "optional": true } } }, - "karma-browserstack-launcher": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/karma-browserstack-launcher/-/karma-browserstack-launcher-1.6.0.tgz", - "integrity": "sha512-Y/UWPdHZkHIVH2To4GWHCTzmrsB6H7PBWy6pw+TWz5sr4HW2mcE+Uj6qWgoVNxvQU1Pfn5LQQzI6EQ65p8QbiQ==", + "node_modules/source-map": { + "version": "0.6.1", "dev": true, - "requires": { - "browserstack": "~1.5.1", - "browserstack-local": "^1.3.7", - "q": "~1.5.0" + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.10.0" } }, - "karma-chai": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/karma-chai/-/karma-chai-0.1.0.tgz", - "integrity": "sha1-vuWtQEAFF4Ea40u5RfdikJEIt5o=", - "dev": true, - "requires": {} - }, - "karma-chrome-launcher": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-2.2.0.tgz", - "integrity": "sha512-uf/ZVpAabDBPvdPdveyk1EPgbnloPvFFGgmRhYLTDH7gEB4nZdSBk8yTU47w1g/drLSx5uMOkjKk7IWKfWg/+w==", + "node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", "dev": true, - "requires": { - "fs-access": "^1.0.0", - "which": "^1.2.1" - }, "dependencies": { - "which": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", - "dev": true, - "requires": { - "isexe": "^2.0.0" - } - } + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" } }, - "karma-edge-launcher": { - "version": "0.4.2", - "resolved": "https://registry.npmjs.org/karma-edge-launcher/-/karma-edge-launcher-0.4.2.tgz", - "integrity": "sha512-YAJZb1fmRcxNhMIWYsjLuxwODBjh2cSHgTW/jkVmdpGguJjLbs9ZgIK/tEJsMQcBLUkO+yO4LBbqYxqgGW2HIw==", + "node_modules/split": { + "version": "0.3.3", "dev": true, - "requires": { - "edge-launcher": "1.2.2" + "license": "MIT", + "dependencies": { + "through": "2" + }, + "engines": { + "node": "*" } }, - "karma-firefox-launcher": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/karma-firefox-launcher/-/karma-firefox-launcher-1.3.0.tgz", - "integrity": "sha512-Fi7xPhwrRgr+94BnHX0F5dCl1miIW4RHnzjIGxF8GaIEp7rNqX7LSi7ok63VXs3PS/5MQaQMhGxw+bvD+pibBQ==", - "dev": true, - "requires": { - "is-wsl": "^2.1.0" + "node_modules/ssri": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-9.0.1.tgz", + "integrity": "sha512-o57Wcn66jMQvfHG1FlYbWeZWW/dHZhJXjpIcTfXldXEk5nz5lStPo3mK0OJQfGR3RbZUlbISexbljkJzuEj/8Q==", + "optional": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "karma-fixture": { - "version": "0.2.6", - "resolved": "https://registry.npmjs.org/karma-fixture/-/karma-fixture-0.2.6.tgz", - "integrity": "sha1-lxzqjCFtc/BwQ5ZMtz8Q4IMAGO8=", - "dev": true - }, - "karma-html2js-preprocessor": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/karma-html2js-preprocessor/-/karma-html2js-preprocessor-1.1.0.tgz", - "integrity": "sha1-/Ant8Eu+K7bu6boZaPgmtziAIL0=", - "dev": true, - "requires": {} + "node_modules/statuses": { + "version": "1.5.0", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } }, - "karma-ie-launcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/karma-ie-launcher/-/karma-ie-launcher-1.0.0.tgz", - "integrity": "sha1-SXmGhCxJAZA0bNifVJTKmDDG1Zw=", + "node_modules/stream-combiner": { + "version": "0.0.4", "dev": true, - "requires": { - "lodash": "^4.6.1" + "license": "MIT", + "dependencies": { + "duplexer": "~0.1.1" } }, - "karma-json-fixtures-preprocessor": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/karma-json-fixtures-preprocessor/-/karma-json-fixtures-preprocessor-0.0.6.tgz", - "integrity": "sha1-T3ii6800OH+OVaur/2NGVRZMTHY=", - "dev": true - }, - "karma-mocha": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", - "integrity": "sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ==", + "node_modules/streamroller": { + "version": "3.0.6", "dev": true, - "requires": { - "minimist": "^1.2.3" + "license": "MIT", + "dependencies": { + "date-format": "^4.0.6", + "debug": "^4.3.4", + "fs-extra": "^10.0.1" + }, + "engines": { + "node": ">=8.0" } }, - "karma-mocha-reporter": { - "version": "2.2.5", - "resolved": "https://registry.npmjs.org/karma-mocha-reporter/-/karma-mocha-reporter-2.2.5.tgz", - "integrity": "sha1-FRIAlejtgZGG5HoLAS8810GJVWA=", + "node_modules/streamroller/node_modules/debug": { + "version": "4.3.4", "dev": true, - "requires": { - "chalk": "^2.1.0", - "log-symbols": "^2.1.0", - "strip-ansi": "^4.0.0" - }, + "license": "MIT", "dependencies": { - "ansi-regex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.1.tgz", - "integrity": "sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw==", - "dev": true - }, - "ansi-styles": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", - "dev": true, - "requires": { - "color-convert": "^1.9.0" - } - }, - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "color-convert": { - "version": "1.9.3", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", - "dev": true, - "requires": { - "color-name": "1.1.3" - } - }, - "color-name": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", - "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "log-symbols": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", - "dev": true, - "requires": { - "chalk": "^2.0.1" - } - }, - "strip-ansi": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", - "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", - "dev": true, - "requires": { - "ansi-regex": "^3.0.0" - } - }, + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } + "optional": true } } }, - "karma-safari-launcher": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/karma-safari-launcher/-/karma-safari-launcher-1.0.0.tgz", - "integrity": "sha1-lpgqLMR9BmquccVTursoMZEVos4=", - "dev": true, - "requires": {} + "node_modules/string_decoder": { + "version": "1.1.1", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } }, - "karma-teamcity-reporter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/karma-teamcity-reporter/-/karma-teamcity-reporter-1.1.0.tgz", - "integrity": "sha512-Ca1uhHGtNqUuzsnW3I+QykNuS/jF9vdxnIrkbLCVJRunCc6yWJq+ai1UobQT13j0e3JVUOf0mKo3QHZ6A6mG9Q==", - "dev": true, - "requires": {} + "node_modules/string_decoder/node_modules/safe-buffer": { + "version": "5.1.2", + "license": "MIT" }, - "keyman": { - "version": "file:web", - "requires": { - "@keymanapp/input-processor": "*", - "@keymanapp/keyboard-processor": "*", - "@keymanapp/keyman-version": "*", - "@keymanapp/lexical-model-layer": "*", - "@keymanapp/models-types": "*", - "@keymanapp/recorder-core": "*", - "@keymanapp/resources-gosh": "*", - "@keymanapp/web-sentry-manager": "*", - "@keymanapp/web-utils": "*", - "@sentry/cli": "2.2.0", - "@types/node": "^11.9.4", - "chai": "^4.3.4", - "eventemitter3": "^4.0.0", - "google-closure-compiler-java": "^20200224.0.0", - "karma": "^6.4.1", - "karma-browserstack-launcher": "^1.6.0", - "karma-chai": "^0.1.0", - "karma-chrome-launcher": "^2.2.0", - "karma-edge-launcher": "^0.4.2", - "karma-firefox-launcher": "^1.1.0", - "karma-fixture": "^0.2.6", - "karma-html2js-preprocessor": "^1.1.0", - "karma-ie-launcher": "^1.0.0", - "karma-json-fixtures-preprocessor": "0.0.6", - "karma-mocha": "^2.0.1", - "karma-mocha-reporter": "^2.2.5", - "karma-safari-launcher": "^1.0.0", - "karma-teamcity-reporter": "^1.1.0", - "mocha": "^10.0.0", - "modernizr": "^3.11.7", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "node_modules/string-argv": { + "version": "0.1.2", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.6.19" } }, - "keyv": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/keyv/-/keyv-4.2.2.tgz", - "integrity": "sha512-uYS0vKTlBIjNCAUqrjlxmruxOEiZxZIHXyp32sdcGmP+ukFrmWUnE//RcPXJH3Vxrni1H2gsQbjHE0bH7MtMQQ==", - "requires": { - "compress-brotli": "^1.3.6", - "json-buffer": "3.0.1" + "node_modules/string-width": { + "version": "1.0.2", + "dev": true, + "license": "MIT", + "dependencies": { + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "lie": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/lie/-/lie-3.3.0.tgz", - "integrity": "sha512-UaiMJzeWRlEujzAuw5LokY1L5ecNQYZKfmyZ9L7wDHb/p5etKaxXhohBcrw0EYby+G/NA52vRSN4N39dxHAIwQ==", + "node_modules/string.prototype.codepointat": { + "version": "0.2.1", + "license": "MIT" + }, + "node_modules/string.prototype.startswith": { + "version": "0.2.0" + }, + "node_modules/string.prototype.trim": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/string.prototype.trim/-/string.prototype.trim-1.2.7.tgz", + "integrity": "sha512-p6TmeT1T3411M8Cgg9wBTMRtY2q9+PNy9EV1i2lIXUN/btt763oIfxwN3RR8VU6wHX8j/1CFy0L+YuThm6bgOg==", "dev": true, - "requires": { - "immediate": "~3.0.5" + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "linkify-it": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-3.0.3.tgz", - "integrity": "sha512-ynTsyrFSdE5oZ/O9GEf00kPngmOfVwazR5GKDq6EYfhlpFug3J2zybX56a2PRRpc9P+FuSoGNAwjlbDs9jJBPQ==", + "node_modules/string.prototype.trimend": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimend/-/string.prototype.trimend-1.0.6.tgz", + "integrity": "sha512-JySq+4mrPf9EsDBEDYMOb/lM7XQLulwg5R/m1r0PXEFqrV0qHvl58sdTilSXtKOflCsK2E8jxf+GKC0T07RWwQ==", "dev": true, - "requires": { - "uc.micro": "^1.0.1" + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", + "node_modules/string.prototype.trimstart": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/string.prototype.trimstart/-/string.prototype.trimstart-1.0.6.tgz", + "integrity": "sha512-omqjMDaY92pbn5HOX7f9IccLA+U1tA9GvtU4JrodiXFfYB7jPzzHpRzpglLAjtUV6bB557zwClJezTqnAiYnQA==", "dev": true, - "requires": { - "p-locate": "^5.0.0" + "dependencies": { + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "es-abstract": "^1.20.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", - "dev": true - }, - "lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=" - }, - "lodash.get": { - "version": "4.4.2", - "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", - "integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==" - }, - "lodash.set": { - "version": "4.3.2", - "resolved": "https://registry.npmjs.org/lodash.set/-/lodash.set-4.3.2.tgz", - "integrity": "sha512-4hNPN5jlm/N/HLMCO43v8BXKq9Z7QdAGc/VGrRD61w8gN9g/6jF9A4L1pbUgBLCffi0w9VsXfTOij5x8iTyFvg==" - }, - "lodash.uniq": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.uniq/-/lodash.uniq-4.5.0.tgz", - "integrity": "sha512-xfBaXQd9ryd9dlSDvnvI0lvxfLJlYAZzXomUYzLKtUeOQvOP5piqAWuGtrhWeqaXK9hhoM/iyJc5AV+XfsX3HQ==" - }, - "log4js": { - "version": "6.4.4", - "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.4.4.tgz", - "integrity": "sha512-ncaWPsuw9Vl1CKA406hVnJLGQKy1OHx6buk8J4rE2lVW+NW5Y82G5/DIloO7NkqLOUtNPEANaWC1kZYVjXssPw==", + "node_modules/strip-ansi": { + "version": "3.0.1", "dev": true, - "requires": { - "date-format": "^4.0.6", - "debug": "^4.3.4", - "flatted": "^3.2.5", - "rfdc": "^1.3.0", - "streamroller": "^3.0.6" - }, + "license": "MIT", "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } + "ansi-regex": "^2.0.0" + }, + "engines": { + "node": ">=0.10.0" } }, - "lolex": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-4.2.0.tgz", - "integrity": "sha512-gKO5uExCXvSm6zbF562EvM+rd1kQDnB9AZBbiQVzf1ZmdDpxUSvpnAaVOP83N/31mRK8Ml8/VE8DMvsAZQ+7wg==", - "dev": true - }, - "lowercase-keys": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", - "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==" - }, - "lru_map": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/lru_map/-/lru_map-0.3.3.tgz", - "integrity": "sha1-tcg1G5Rky9dQM1p5ZQoOwOVhGN0=" - }, - "lru-cache": { - "version": "7.8.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.8.1.tgz", - "integrity": "sha512-E1v547OCgJvbvevfjgK9sNKIVXO96NnsTsFPBlg4ZxjhsJSODoH9lk8Bm0OxvHNm6Vm5Yqkl/1fErDxhYL8Skg==", - "devOptional": true - }, - "macos-release": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/macos-release/-/macos-release-2.5.0.tgz", - "integrity": "sha512-EIgv+QZ9r+814gjJj0Bt5vSLJLzswGmSUbUpbi9AIr/fsN2IWFBl2NucV9PAiek+U1STK468tEkxmVYUtuAN3g==" - }, - "make-error": { - "version": "1.3.6", - "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", - "dev": true - }, - "map-stream": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/map-stream/-/map-stream-0.1.0.tgz", - "integrity": "sha1-5WqpTEyAVaFkBKBnS3jyFffI4ZQ=", - "dev": true - }, - "markdown-it": { - "version": "12.3.2", - "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-12.3.2.tgz", - "integrity": "sha512-TchMembfxfNVpHkbtriWltGWc+m3xszaRD0CZup7GFFhzIgQqxIfn3eGj1yZpfuflzPvfkt611B2Q/Bsk1YnGg==", + "node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, - "requires": { - "argparse": "^2.0.1", - "entities": "~2.1.0", - "linkify-it": "^3.0.1", - "mdurl": "^1.0.1", - "uc.micro": "^1.0.5" + "engines": { + "node": ">=4" } }, - "mdurl": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", - "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", - "dev": true - }, - "media-typer": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", - "integrity": "sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g=" - }, - "merge-descriptors": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", - "integrity": "sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E=" - }, - "methods": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", - "integrity": "sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4=" - }, - "mime": { - "version": "2.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-2.6.0.tgz", - "integrity": "sha512-USPkMeET31rOMiarsBNIHZKLGgvKc/LrjofAnBlOttf5ajRvqiRA8QsenbcooctK6d6Ts6aqZXBA+XbkKthiQg==", - "dev": true - }, - "mime-db": { - "version": "1.52.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", - "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==" - }, - "mime-types": { - "version": "2.1.35", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", - "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", - "requires": { - "mime-db": "1.52.0" + "node_modules/strip-eof": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">=0.10.0" } }, - "mimic-response": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", - "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==" + "node_modules/strip-json-comments": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "devOptional": true, - "requires": { - "brace-expansion": "^1.1.7" + "node_modules/supports-color": { + "version": "7.2.0", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "minimist": { - "version": "1.2.6", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.6.tgz", - "integrity": "sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q==" + "node_modules/supports-preserve-symlinks-flag": { + "version": "1.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } }, - "minipass": { - "version": "3.1.6", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.1.6.tgz", - "integrity": "sha512-rty5kpw9/z8SX9dmxblFA6edItUmwJgMeYDZRrwlIVN27i8gysGbznJwUggw2V/FVqFSDdWy040ZPS811DYAqQ==", + "node_modules/tar": { + "version": "6.1.13", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.13.tgz", + "integrity": "sha512-jdIBIN6LTIe2jqzay/2vtYLlBHa3JF42ot3h1dW8Q0PaAG4v8rm0cvpVePtau5C6OKXGGcgO9q2AMNSWxiLqKw==", "optional": true, - "requires": { + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^4.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" } }, - "minizlib": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", - "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "node_modules/tar/node_modules/minipass": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-4.0.3.tgz", + "integrity": "sha512-OW2r4sQ0sI+z5ckEt5c1Tri4xTgZwYDxpE54eqWlQloQRoWtXjqt9udJ5Z4dSv7wK+nfFI7FRXyCpBSft+gpFw==", "optional": true, - "requires": { - "minipass": "^3.0.0", - "yallist": "^4.0.0" + "engines": { + "node": ">=8" } }, - "mkdirp": { - "version": "0.5.6", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.6.tgz", - "integrity": "sha512-FP+p8RB8OWpF3YZBCrP5gtADmtXApB5AMLn+vdyA+PyxCjrCs00mjyUozssO33cwDeT3wNGdLxJ5M//YqtHAJw==", - "requires": { - "minimist": "^1.2.6" + "node_modules/tar/node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "optional": true, + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" } }, - "mocha": { - "version": "10.0.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.0.0.tgz", - "integrity": "sha512-0Wl+elVUD43Y0BqPZBzZt8Tnkw9CMUdNYnUsTfOM1vuhJVZL+kiesFYsqwBkEEuEixaiPe5ZQdqDgX2jddhmoA==", + "node_modules/temp-fs": { + "version": "0.9.9", "dev": true, - "requires": { - "@ungap/promise-all-settled": "1.1.2", - "ansi-colors": "4.1.1", - "browser-stdout": "1.3.1", - "chokidar": "3.5.3", - "debug": "4.3.4", - "diff": "5.0.0", - "escape-string-regexp": "4.0.0", - "find-up": "5.0.0", - "glob": "7.2.0", - "he": "1.2.0", - "js-yaml": "4.1.0", - "log-symbols": "4.1.0", - "minimatch": "5.0.1", - "ms": "2.1.3", - "nanoid": "3.3.3", - "serialize-javascript": "6.0.0", - "strip-json-comments": "3.1.1", - "supports-color": "8.1.1", - "workerpool": "6.2.1", - "yargs": "16.2.0", - "yargs-parser": "20.2.4", - "yargs-unparser": "2.0.0" - }, + "license": "MIT", "dependencies": { - "chokidar": { - "version": "3.5.3", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", - "integrity": "sha512-Dr3sfKRP6oTcjf2JmUmFJfeVMvXBdegxB0iVQ5eb2V10uFJUCAS8OByZdVAyVb8xXNz3GjjTgj9kLWsZTqE6kw==", - "dev": true, - "requires": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "fsevents": "~2.3.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - } - }, - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - }, - "dependencies": { - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", - "dev": true - } - } - }, - "escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true - }, - "glob": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.0.tgz", - "integrity": "sha512-lmLf6gtyrPq8tTjSmrO94wBeQbFR3HbLHbuyD69wuyQkImp2hWqMGB47OX65FBkPffO641IP9jWa1z4ivqG26Q==", - "dev": true, - "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" - }, - "dependencies": { - "minimatch": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", - "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, - "requires": { - "brace-expansion": "^1.1.7" - } - } - } - }, - "log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dev": true, - "requires": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - } - }, - "minimatch": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.0.1.tgz", - "integrity": "sha512-nLDxIFRyhDblz3qMuq+SoRZED4+miJ/G+tdDrjkkkRnjAsBexeGpgjLEQ0blJy7rHhR2b93rhQY4SvyWu9v03g==", - "dev": true, - "requires": { - "brace-expansion": "^2.0.1" - }, - "dependencies": { - "brace-expansion": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", - "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", - "dev": true, - "requires": { - "balanced-match": "^1.0.0" - } - } - } - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", - "dev": true - }, - "nanoid": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/nanoid/-/nanoid-3.3.3.tgz", - "integrity": "sha512-p1sjXuopFs0xg+fPASzQ28agW1oHD7xDsd9Xkf3T15H3c/cifrFHVwrh74PdoklAPi+i7MdRsE47vm2r6JoB+w==", - "dev": true - }, - "readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dev": true, - "requires": { - "picomatch": "^2.2.1" - } - }, - "serialize-javascript": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.0.tgz", - "integrity": "sha512-Qr3TosvguFt8ePWqsvRfrKyQXIiW+nGbYpy8XK24NQHE83caxWt+mIymTT19DGFbNWNLfEwsrkSmN64lVWB9ag==", - "dev": true, - "requires": { - "randombytes": "^2.1.0" - } - }, - "supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dev": true, - "requires": { - "has-flag": "^4.0.0" - } - }, - "workerpool": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.2.1.tgz", - "integrity": "sha512-ILEIE97kDZvF9Wb9f6h5aXK4swSlKGUcOEGiIYb2OOu/IrDU9iwj0fD//SsA6E5ibwJxpEvhullJY4Sl4GcpAw==", - "dev": true - } + "rimraf": "~2.5.2" + }, + "engines": { + "node": ">=0.8.0" } }, - "mocha-teamcity-reporter": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/mocha-teamcity-reporter/-/mocha-teamcity-reporter-4.0.0.tgz", - "integrity": "sha512-m+ADz1U7JNf3od4HrY5t4xAKIDamj1171WJCb8nrSuF+RIqP+AP4gq6UJ+U9nPVn2XO8y1nSs5bQ9Kxzelz6Nw==", + "node_modules/temp-fs/node_modules/rimraf": { + "version": "2.5.4", "dev": true, - "requires": {} + "license": "ISC", + "dependencies": { + "glob": "^7.0.5" + }, + "bin": { + "rimraf": "bin.js" + } }, - "modernizr": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/modernizr/-/modernizr-3.12.0.tgz", - "integrity": "sha512-i5f5xfnxMOb3cePoBpwk4bWjVAyIB3hgm7QrDvZx/R7zUUS8PO9zlyQF7vJKn8kCVxEvL0nRWeZ0PPqVbY31sw==", + "node_modules/test-exclude": { + "version": "6.0.0", "dev": true, - "requires": { - "doctrine": "^3.0.0", - "file": "^0.2.2", - "lodash": "^4.17.21", - "markdown-it": "^12.3.2", - "mkdirp": "0.5.5", - "requirejs": "^2.3.6", - "yargs": "^15.4.1" - }, + "license": "ISC", "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "cliui": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", - "dev": true, - "requires": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^6.2.0" - } - }, - "find-up": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", - "dev": true, - "requires": { - "locate-path": "^5.0.0", - "path-exists": "^4.0.0" - } - }, - "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 - }, - "locate-path": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", - "dev": true, - "requires": { - "p-locate": "^4.1.0" - } - }, - "mkdirp": { - "version": "0.5.5", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, - "p-limit": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", - "dev": true, - "requires": { - "p-try": "^2.0.0" - } - }, - "p-locate": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", - "dev": true, - "requires": { - "p-limit": "^2.2.0" - } - }, - "string-width": { - "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, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - } - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - }, - "wrap-ansi": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", - "dev": true, - "requires": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - } - }, - "y18n": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.3.tgz", - "integrity": "sha512-JKhqTOwSrqNA1NY5lSztJ1GrBiUodLMmIZuLiDaMRJ+itFd+ABVE8XBjOvIWL+rSqNDC74LCSFmlb/U4UZ4hJQ==", - "dev": true - }, - "yargs": { - "version": "15.4.1", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", - "dev": true, - "requires": { - "cliui": "^6.0.0", - "decamelize": "^1.2.0", - "find-up": "^4.1.0", - "get-caller-file": "^2.0.1", - "require-directory": "^2.1.1", - "require-main-filename": "^2.0.0", - "set-blocking": "^2.0.0", - "string-width": "^4.2.0", - "which-module": "^2.0.0", - "y18n": "^4.0.0", - "yargs-parser": "^18.1.2" - } - }, - "yargs-parser": { - "version": "18.1.3", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", - "dev": true, - "requires": { - "camelcase": "^5.0.0", - "decamelize": "^1.2.0" - } - } + "@istanbuljs/schema": "^0.1.2", + "glob": "^7.1.4", + "minimatch": "^3.0.4" + }, + "engines": { + "node": ">=8" } }, - "ms": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + "node_modules/text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", + "dev": true }, - "negotiator": { - "version": "0.6.3", - "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", - "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==" + "node_modules/through": { + "version": "2.3.8", + "dev": true, + "license": "MIT" }, - "ngrok": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/ngrok/-/ngrok-4.3.1.tgz", - "integrity": "sha512-s0joO2liKYiGTVARyzL8hfLIXAZT03GDK3oJqsZK6d61Es+HCx77j8E9ysUbtkMEyvBgYmIMr8taQNsvQt4/DQ==", - "requires": { - "@types/node": "^8.10.50", - "extract-zip": "^2.0.1", - "got": "^11.5.1", - "hpagent": "^0.1.2", - "lodash.clonedeep": "^4.5.0", - "uuid": "^7.0.0 || ^8.0.0", - "yaml": "^1.10.0" - }, + "node_modules/through2": { + "version": "2.0.5", + "dev": true, + "license": "MIT", "dependencies": { - "@types/node": { - "version": "8.10.66", - "resolved": "https://registry.npmjs.org/@types/node/-/node-8.10.66.tgz", - "integrity": "sha512-tktOkFUA4kXx2hhhrB8bIFb5TbwzS4uOhKEmwiD+NoiL0qtP2OQ9mFldbgD4dV1djrlBYP6eBuQZiWjuHUpqFw==" - } + "readable-stream": "~2.3.6", + "xtend": "~4.0.1" } }, - "nice-try": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", - "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==" - }, - "nise": { - "version": "1.5.3", - "resolved": "https://registry.npmjs.org/nise/-/nise-1.5.3.tgz", - "integrity": "sha512-Ymbac/94xeIrMf59REBPOv0thr+CJVFMhrlAkW/gjCIE58BGQdCj0x7KRCb3yz+Ga2Rz3E9XXSvUyyxqqhjQAQ==", + "node_modules/tmp": { + "version": "0.2.1", "dev": true, - "requires": { - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/text-encoding": "^0.7.1", - "just-extend": "^4.0.2", - "lolex": "^5.0.1", - "path-to-regexp": "^1.7.0" - }, + "license": "MIT", "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "lolex": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/lolex/-/lolex-5.1.2.tgz", - "integrity": "sha512-h4hmjAvHTmd+25JSwrtTIuwbKdwg5NzZVRMLn9saij4SZaepCrTCxPr35H/3bjwfMJtN+t3CX8672UIkglz28A==", - "dev": true, - "requires": { - "@sinonjs/commons": "^1.7.0" - } - }, - "path-to-regexp": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-1.8.0.tgz", - "integrity": "sha512-n43JRhlUKUAlibEJhPeir1ncUID16QnEjNpwzNdO3Lm4ywrBpBZ5oLD0I6br9evr1Y9JTqwRtAh7JLoOzAQdVA==", - "dev": true, - "requires": { - "isarray": "0.0.1" - } - } + "rimraf": "^3.0.0" + }, + "engines": { + "node": ">=8.17.0" } }, - "node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==", - "optional": true - }, - "node-cleanup": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/node-cleanup/-/node-cleanup-2.1.2.tgz", - "integrity": "sha1-esGavSl+Caf3KnFUXZUbUX5N3iw=", - "dev": true + "node_modules/to-regex-range": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "dependencies": { + "is-number": "^7.0.0" + }, + "engines": { + "node": ">=8.0" + } }, - "node-fetch": { - "version": "2.6.7", - "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", - "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", - "requires": { - "whatwg-url": "^5.0.0" + "node_modules/toidentifier": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">=0.6" } }, - "node-gyp": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-7.1.2.tgz", - "integrity": "sha512-CbpcIo7C3eMu3dL1c3d0xw449fHIGALIJsRP4DDPHpyiW8vcriNY7ubh9TE4zEKfSxscY7PjeFnshE7h75ynjQ==", - "optional": true, - "requires": { - "env-paths": "^2.2.0", - "glob": "^7.1.4", - "graceful-fs": "^4.2.3", - "nopt": "^5.0.0", - "npmlog": "^4.1.2", - "request": "^2.88.2", - "rimraf": "^3.0.2", - "semver": "^7.3.2", - "tar": "^6.0.2", - "which": "^2.0.2" + "node_modules/tr46": { + "version": "0.0.3", + "license": "MIT" + }, + "node_modules/ts-node": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-10.9.1.tgz", + "integrity": "sha512-NtVysVPkxxrwFGUUxGYhfux8k78pQB3JqYBXlLRZgdGUqTO5wU/UyHop5p70iEbGhB7q5KmiZiU0Y3KlJrScEw==", + "dev": true, + "dependencies": { + "@cspotcode/source-map-support": "^0.8.0", + "@tsconfig/node10": "^1.0.7", + "@tsconfig/node12": "^1.0.7", + "@tsconfig/node14": "^1.0.0", + "@tsconfig/node16": "^1.0.2", + "acorn": "^8.4.1", + "acorn-walk": "^8.1.1", + "arg": "^4.1.0", + "create-require": "^1.1.0", + "diff": "^4.0.1", + "make-error": "^1.1.1", + "v8-compile-cache-lib": "^3.0.1", + "yn": "3.1.1" + }, + "bin": { + "ts-node": "dist/bin.js", + "ts-node-cwd": "dist/bin-cwd.js", + "ts-node-esm": "dist/bin-esm.js", + "ts-node-script": "dist/bin-script.js", + "ts-node-transpile-only": "dist/bin-transpile.js", + "ts-script": "dist/bin-script-deprecated.js" + }, + "peerDependencies": { + "@swc/core": ">=1.2.50", + "@swc/wasm": ">=1.2.50", + "@types/node": "*", + "typescript": ">=2.7" + }, + "peerDependenciesMeta": { + "@swc/core": { + "optional": true + }, + "@swc/wasm": { + "optional": true + } } }, - "node-windows-trayicon": { - "version": "git+ssh://git@github.com/keymanapp/node-windows-trayicon.git#1e46786082213f3edcddd5953e33f5abdc7ea05f", - "from": "node-windows-trayicon@git+ssh://git@github.com/keymanapp/node-windows-trayicon.git#1e46786082213f3edcddd5953e33f5abdc7ea05f", - "optional": true, - "requires": { - "bindings": "^1.5.0", - "node-addon-api": "^3.1.0", - "node-gyp": "^7.1.2" + "node_modules/ts-node/node_modules/diff": { + "version": "4.0.2", + "dev": true, + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.3.1" } }, - "noms": { - "version": "0.0.0", - "resolved": "https://registry.npmjs.org/noms/-/noms-0.0.0.tgz", - "integrity": "sha1-2o69nzr51nYJGbJ9nNyAkqczKFk=", + "node_modules/tsc-watch": { + "version": "4.6.2", "dev": true, - "requires": { - "inherits": "^2.0.1", - "readable-stream": "~1.0.31" - }, + "license": "MIT", "dependencies": { - "isarray": { - "version": "0.0.1", - "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", - "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", - "dev": true - }, - "readable-stream": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-1.0.34.tgz", - "integrity": "sha1-Elgg40vIQtLyqq+v5MKRbuMsFXw=", - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.1", - "isarray": "0.0.1", - "string_decoder": "~0.10.x" - } - }, - "string_decoder": { - "version": "0.10.31", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-0.10.31.tgz", - "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", - "dev": true - } + "cross-spawn": "^7.0.3", + "node-cleanup": "^2.1.2", + "ps-tree": "^1.2.0", + "string-argv": "^0.1.1", + "strip-ansi": "^6.0.0" + }, + "bin": { + "tsc-watch": "index.js" + }, + "engines": { + "node": ">=8.17.0" + }, + "peerDependencies": { + "typescript": "*" } }, - "nopt": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", - "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", - "optional": true, - "requires": { - "abbrev": "1" + "node_modules/tsc-watch/node_modules/ansi-regex": { + "version": "5.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" } }, - "normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "dev": true - }, - "normalize-url": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-6.1.0.tgz", - "integrity": "sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A==" - }, - "npm-run-path": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", - "integrity": "sha512-lJxZYlT4DW/bRUtFh1MQIWqmLwQfAxnqWG4HhEdjMlkrJYnJn0Jrr2u3mgxqaWsdiBc76TYkTG/mhrnYTuzfHw==", - "requires": { - "path-key": "^2.0.0" - }, + "node_modules/tsc-watch/node_modules/strip-ansi": { + "version": "6.0.1", + "dev": true, + "license": "MIT", "dependencies": { - "path-key": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", - "integrity": "sha512-fEHGKCSmUSDPv4uoj8AlD+joPlq3peND+HRYyxFz4KPw4z926S/b8rIuFs2FYJg3BwsxJf6A9/3eIdLaYC+9Dw==" - } + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "npmlog": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-4.1.2.tgz", - "integrity": "sha512-2uUqazuKlTaSI/dC8AzicUck7+IrEaOnN/e0jd3Xtt1KcGpwx30v50mL7oPyr/h9bL3E4aZccVwpwP+5W9Vjkg==", - "optional": true, - "requires": { - "are-we-there-yet": "~1.1.2", - "console-control-strings": "~1.1.0", - "gauge": "~2.7.3", - "set-blocking": "~2.0.0" + "node_modules/tsconfig-paths": { + "version": "3.14.2", + "resolved": "https://registry.npmjs.org/tsconfig-paths/-/tsconfig-paths-3.14.2.tgz", + "integrity": "sha512-o/9iXgCYc5L/JxCHPe3Hvh8Q/2xm5Z+p18PESBU6Ff33695QnCHBEjcytY2q19ua7Mbl/DavtBOLq+oG0RCL+g==", + "dev": true, + "dependencies": { + "@types/json5": "^0.0.29", + "json5": "^1.0.2", + "minimist": "^1.2.6", + "strip-bom": "^3.0.0" } }, - "null-check": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/null-check/-/null-check-1.0.0.tgz", - "integrity": "sha1-l33/1xdgErnsMNKjnbXPcqBDnt0=", - "dev": true - }, - "number-is-nan": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/number-is-nan/-/number-is-nan-1.0.1.tgz", - "integrity": "sha1-CXtgK1NCKlIsGvuHkDGDNpQaAR0=", - "optional": true - }, - "oauth-sign": { - "version": "0.9.0", - "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", - "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", - "optional": true - }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=" - }, - "octokit-pagination-methods": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/octokit-pagination-methods/-/octokit-pagination-methods-1.1.0.tgz", - "integrity": "sha512-fZ4qZdQ2nxJvtcasX7Ghl+WlWS/d9IgnBIwFZXVNNZUmzpno91SX5bc5vuxiuKoCtK78XxGGNuSCrDC7xYB3OQ==" - }, - "on-finished": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.3.0.tgz", - "integrity": "sha1-IPEzZIGwg811M3mSoWlxqi2QaUc=", - "requires": { - "ee-first": "1.1.1" - } + "node_modules/tslib": { + "version": "1.14.1", + "license": "0BSD" }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "requires": { - "wrappy": "1" + "node_modules/tsutils": { + "version": "3.21.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.21.0.tgz", + "integrity": "sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA==", + "dev": true, + "dependencies": { + "tslib": "^1.8.1" + }, + "engines": { + "node": ">= 6" + }, + "peerDependencies": { + "typescript": ">=2.8.0 || >= 3.2.0-dev || >= 3.3.0-dev || >= 3.4.0-dev || >= 3.5.0-dev || >= 3.6.0-dev || >= 3.6.0-beta || >= 3.7.0-dev || >= 3.7.0-beta" } }, - "open": { - "version": "8.4.0", - "resolved": "https://registry.npmjs.org/open/-/open-8.4.0.tgz", - "integrity": "sha512-XgFPPM+B28FtCCgSb9I+s9szOC1vZRSwgWsRUA5ylIxRTgKozqjOCrVOqGsYABPYK5qnfqClxZTFBa8PKt2v6Q==", - "requires": { - "define-lazy-prop": "^2.0.0", - "is-docker": "^2.1.1", - "is-wsl": "^2.2.0" + "node_modules/tunnel": { + "version": "0.0.6", + "license": "MIT", + "engines": { + "node": ">=0.6.11 <=0.7.0 || >=0.7.3" } }, - "os-name": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/os-name/-/os-name-3.1.0.tgz", - "integrity": "sha512-h8L+8aNjNcMpo/mAIBPn5PXCM16iyPGjHNWo6U1YO8sJTMHtEtyczI6QJnLoplswm6goopQkqc7OAnjhWcugVg==", - "requires": { - "macos-release": "^2.2.0", - "windows-release": "^3.1.0" + "node_modules/type-check": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", + "dev": true, + "dependencies": { + "prelude-ls": "^1.2.1" + }, + "engines": { + "node": ">= 0.8.0" } }, - "p-cancelable": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-2.1.1.tgz", - "integrity": "sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg==" - }, - "p-finally": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", - "integrity": "sha512-LICb2p9CB7FS+0eR1oqWnHhp0FljGLZCWBE9aix0Uye9W8LTQPwMTYVGWQWIw9RdQiDg4+epXQODwIYJtSJaow==" - }, - "p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", + "node_modules/type-detect": { + "version": "4.0.8", "dev": true, - "requires": { - "yocto-queue": "^0.1.0" + "license": "MIT", + "engines": { + "node": ">=4" } }, - "p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", + "node_modules/type-fest": { + "version": "0.20.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.20.2.tgz", + "integrity": "sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ==", "dev": true, - "requires": { - "p-limit": "^3.0.2" + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "p-try": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==" - }, - "pako": { - "version": "1.0.11", - "resolved": "https://registry.npmjs.org/pako/-/pako-1.0.11.tgz", - "integrity": "sha512-4hLB8Py4zZce5s4yd9XzopqwVv/yGNhV1Bl8NTmCq1763HeK2+EwVTv+leGeL13Dnh2wfbqowVPXCIO0z4taYw==", - "dev": true - }, - "parseurl": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==" - }, - "path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==" - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "devOptional": true - }, - "path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "dev": true - }, - "path-to-regexp": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", - "integrity": "sha1-32BBeABfUi8V60SQ5yR6G/qmf4w=" - }, - "pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "dev": true + "node_modules/type-is": { + "version": "1.6.18", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } }, - "pause-stream": { - "version": "0.0.11", - "resolved": "https://registry.npmjs.org/pause-stream/-/pause-stream-0.0.11.tgz", - "integrity": "sha1-/lo0sMvOErWqaitAPuLnO2AvFEU=", + "node_modules/typed-array-length": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/typed-array-length/-/typed-array-length-1.0.4.tgz", + "integrity": "sha512-KjZypGq+I/H7HI5HlOoGHkWUUGq+Q0TPhQurLbyrVrvnKTBgzLhIJ7j6J/XTQOi0d1RjyZ0wdas8bKs2p0x3Ng==", "dev": true, - "requires": { - "through": "~2.3" + "dependencies": { + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "is-typed-array": "^1.1.9" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "pend": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", - "integrity": "sha1-elfrVQpng/kRUzH89GY9XI4AelA=" - }, - "performance-now": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", - "integrity": "sha1-Ywn04OX6kT7BxpMHrjZLSzd8nns=", - "optional": true - }, - "picomatch": { - "version": "2.2.3", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.3.tgz", - "integrity": "sha512-KpELjfwcCDUb9PeigTs2mBJzXUPzAuP2oPcA989He8Rte0+YUAjw1JVedDhuTKPkHjSYzMN3npC9luThGYEKdg==", - "dev": true - }, - "process-nextick-args": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==" + "node_modules/typedarray": { + "version": "0.0.6", + "license": "MIT" }, - "progress": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", - "dev": true + "node_modules/typescript": { + "version": "4.9.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.9.5.tgz", + "integrity": "sha512-1FXk9E2Hm+QzZQ7z+McJiHL4NW1F2EzMu9Nq9i3zAaGqibafqYwCVU6WyWAuyQRRzOlxou8xZSyXLEN8oKj24g==", + "bin": { + "tsc": "bin/tsc", + "tsserver": "bin/tsserver" + }, + "engines": { + "node": ">=4.2.0" + } }, - "proxy-addr": { - "version": "2.0.7", - "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", - "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", - "requires": { - "forwarded": "0.2.0", - "ipaddr.js": "1.9.1" + "node_modules/ua-parser-js": { + "version": "0.7.31", + "dev": true, + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/ua-parser-js" + }, + { + "type": "paypal", + "url": "https://paypal.me/faisalman" + } + ], + "license": "MIT", + "engines": { + "node": "*" } }, - "proxy-from-env": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", - "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", - "dev": true + "node_modules/uc.micro": { + "version": "1.0.6", + "dev": true, + "license": "MIT" }, - "ps-tree": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/ps-tree/-/ps-tree-1.2.0.tgz", - "integrity": "sha512-0VnamPPYHl4uaU/nSFeZZpR21QAWRz+sRv4iW9+v/GS/J5U5iZB5BNN6J0RMoOvdx2gWM2+ZFMIm58q24e4UYA==", + "node_modules/unbox-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/unbox-primitive/-/unbox-primitive-1.0.2.tgz", + "integrity": "sha512-61pPlCD9h51VoreyJ0BReideM3MDKMKnh6+V9L08331ipq6Q8OFXZYiqP6n/tbHx4s5I9uRhcye6BrbkizkBDw==", "dev": true, - "requires": { - "event-stream": "=3.3.4" + "dependencies": { + "call-bind": "^1.0.2", + "has-bigints": "^1.0.2", + "has-symbols": "^1.0.3", + "which-boxed-primitive": "^1.0.2" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "psl": { - "version": "1.8.0", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz", - "integrity": "sha512-RIdOzyoavK+hA18OGGWDqUTsCLhtA7IcZ/6NCs4fFJaHBDab+pDDmDIByWFRQJq2Cd7r1OoQxBGKOaztq+hjIQ==", - "optional": true + "node_modules/unique-filename": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-2.0.1.tgz", + "integrity": "sha512-ODWHtkkdx3IAR+veKxFV+VBkUMcN+FaqzUUd7IZzt+0zhDZFPFxhlqwPF3YQvMHx1TD0tdgYl+kuPnJ8E6ql7A==", + "optional": true, + "dependencies": { + "unique-slug": "^3.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } }, - "pump": { + "node_modules/unique-slug": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", - "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", - "requires": { - "end-of-stream": "^1.1.0", - "once": "^1.3.1" + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-3.0.0.tgz", + "integrity": "sha512-8EyMynh679x/0gqE9fT9oilG+qEt+ibFyqjuVTsZn1+CMxH+XLlpvr2UZx4nVcCwTpx81nICr2JQFkM+HPLq4w==", + "optional": true, + "dependencies": { + "imurmurhash": "^0.1.4" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" } }, - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "optional": true - }, - "q": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", - "integrity": "sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=", - "dev": true - }, - "qjobs": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", - "dev": true - }, - "qs": { - "version": "6.9.7", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.7.tgz", - "integrity": "sha512-IhMFgUmuNpyRfxA90umL7ByLlgRXu6tIfKPpF5TmcfRLlLCckfP/g3IQmju6jjpu+Hh8rA+2p6A27ZSPOOHdKw==" - }, - "quick-lru": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-5.1.1.tgz", - "integrity": "sha512-WuyALRjWPDGtt/wzJiadO5AXY+8hZ80hVpe6MyivgraREW751X3SbhRvG3eLKOYN+8VEvqLcf3wdnt44Z4S4SA==" + "node_modules/universal-user-agent": { + "version": "6.0.0", + "license": "ISC" }, - "randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", + "node_modules/universalify": { + "version": "2.0.0", "dev": true, - "requires": { - "safe-buffer": "^5.1.0" - } - }, - "range-parser": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==" - }, - "raw-body": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.3.tgz", - "integrity": "sha512-UlTNLIcu0uzb4D2f4WltY6cVjLi+/jEN4lgEUj3E04tpMDpUlkBo/eSn6zou9hum2VMNpCCUone0O0WeJim07g==", - "requires": { - "bytes": "3.1.2", - "http-errors": "1.8.1", - "iconv-lite": "0.4.24", - "unpipe": "1.0.0" + "license": "MIT", + "engines": { + "node": ">= 10.0.0" } }, - "readable-stream": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } + "node_modules/unpipe": { + "version": "1.0.0", + "license": "MIT", + "engines": { + "node": ">= 0.8" } }, - "readdirp": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.5.0.tgz", - "integrity": "sha512-cMhu7c/8rdhkHXWsY+osBhfSy0JikwpHK/5+imo+LpeasTF8ouErHrlYkwT0++njiyuDvc7OFY5T3ukvZ8qmFQ==", + "node_modules/untildify": { + "version": "4.0.0", "dev": true, - "requires": { - "picomatch": "^2.2.1" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "request": { - "version": "2.88.2", - "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", - "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", - "optional": true, - "requires": { - "aws-sign2": "~0.7.0", - "aws4": "^1.8.0", - "caseless": "~0.12.0", - "combined-stream": "~1.0.6", - "extend": "~3.0.2", - "forever-agent": "~0.6.1", - "form-data": "~2.3.2", - "har-validator": "~5.1.3", - "http-signature": "~1.2.0", - "is-typedarray": "~1.0.0", - "isstream": "~0.1.2", - "json-stringify-safe": "~5.0.1", - "mime-types": "~2.1.19", - "oauth-sign": "~0.9.0", - "performance-now": "^2.1.0", - "qs": "~6.5.2", - "safe-buffer": "^5.1.2", - "tough-cookie": "~2.5.0", - "tunnel-agent": "^0.6.0", - "uuid": "^3.3.2" - }, - "dependencies": { - "qs": { - "version": "6.5.3", - "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", - "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", - "optional": true - }, - "uuid": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", - "optional": true - } + "node_modules/uri-js": { + "version": "4.4.1", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" } }, - "require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha1-jGStX9MNqxyXbiNE/+f3kqam30I=" - }, - "require-main-filename": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==" + "node_modules/util-deprecate": { + "version": "1.0.2", + "license": "MIT" }, - "requirejs": { - "version": "2.3.6", - "resolved": "https://registry.npmjs.org/requirejs/-/requirejs-2.3.6.tgz", - "integrity": "sha512-ipEzlWQe6RK3jkzikgCupiTbTvm4S0/CAU5GlgptkN5SO6F3u0UD0K18wy6ErDqiCyP4J4YYe1HuAShvsxePLg==", - "dev": true + "node_modules/utils-merge": { + "version": "1.0.1", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } }, - "requires-port": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/requires-port/-/requires-port-1.0.0.tgz", - "integrity": "sha1-kl0mAdOaxIXgkc8NpcbmlNw9yv8=", - "dev": true + "node_modules/uuid": { + "version": "8.3.2", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } }, - "resolve-alpn": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/resolve-alpn/-/resolve-alpn-1.2.1.tgz", - "integrity": "sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g==" + "node_modules/v8-compile-cache-lib": { + "version": "3.0.1", + "dev": true, + "license": "MIT" }, - "responselike": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/responselike/-/responselike-2.0.0.tgz", - "integrity": "sha512-xH48u3FTB9VsZw7R+vvgaKeLKzT6jOogbQhEe/jewwnZgzPcnyWui2Av6JpoYZF/91uueC+lqhWqeURw5/qhCw==", - "requires": { - "lowercase-keys": "^2.0.0" + "node_modules/v8-to-istanbul": { + "version": "9.0.1", + "dev": true, + "license": "ISC", + "dependencies": { + "@jridgewell/trace-mapping": "^0.3.12", + "@types/istanbul-lib-coverage": "^2.0.1", + "convert-source-map": "^1.6.0" + }, + "engines": { + "node": ">=10.12.0" } }, - "rfdc": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", - "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", - "dev": true - }, - "rimraf": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", - "devOptional": true, - "requires": { - "glob": "^7.1.3" + "node_modules/v8-to-istanbul/node_modules/@jridgewell/trace-mapping": { + "version": "0.3.17", + "dev": true, + "license": "MIT", + "dependencies": { + "@jridgewell/resolve-uri": "3.1.0", + "@jridgewell/sourcemap-codec": "1.4.14" } }, - "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==" + "node_modules/vary": { + "version": "1.1.2", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } }, - "safer-buffer": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==" + "node_modules/void-elements": { + "version": "2.0.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } }, - "sax": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", - "integrity": "sha512-NqVDv9TpANUjFm0N8uM5GxL36UgKi9/atZw+x7YFnQ8ckwFGKrl4xX4yWtrey3UJm5nP1kUbnYgLopqWNSRhWw==" + "node_modules/webidl-conversions": { + "version": "3.0.1", + "license": "BSD-2-Clause" }, - "semver": { - "version": "7.3.6", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.6.tgz", - "integrity": "sha512-HZWqcgwLsjaX1HBD31msI/rXktuIhS+lWvdE4kN9z+8IVT4Itc7vqU2WvYsyD6/sjYCt4dEKH/m1M3dwI9CC5w==", - "devOptional": true, - "requires": { - "lru-cache": "^7.4.0" + "node_modules/whatwg-url": { + "version": "5.0.0", + "license": "MIT", + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" } }, - "send": { - "version": "0.17.2", - "resolved": "https://registry.npmjs.org/send/-/send-0.17.2.tgz", - "integrity": "sha512-UJYB6wFSJE3G00nEivR5rgWp8c2xXvJ3OPWPhmuteU0IKj8nKbG3DrjiOmLwpnHGYWAVwA69zmTm++YG0Hmwww==", - "requires": { - "debug": "2.6.9", - "depd": "~1.1.2", - "destroy": "~1.0.4", - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "etag": "~1.8.1", - "fresh": "0.5.2", - "http-errors": "1.8.1", - "mime": "1.6.0", - "ms": "2.1.3", - "on-finished": "~2.3.0", - "range-parser": "~1.2.1", - "statuses": "~1.5.0" - }, + "node_modules/which": { + "version": "2.0.2", + "devOptional": true, + "license": "ISC", "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - }, - "dependencies": { - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" - } - } - }, - "mime": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", - "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==" - }, - "ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - } + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" } }, - "serve-static": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.14.2.tgz", - "integrity": "sha512-+TMNA9AFxUEGuC0z2mevogSnn9MXKb4fa7ngeRMJaaGv8vTwnIEkKi+QGvPt33HSnf8pRS+WGM0EbMtCJLKMBQ==", - "requires": { - "encodeurl": "~1.0.2", - "escape-html": "~1.0.3", - "parseurl": "~1.3.3", - "send": "0.17.2" + "node_modules/which-boxed-primitive": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/which-boxed-primitive/-/which-boxed-primitive-1.0.2.tgz", + "integrity": "sha512-bwZdv0AKLpplFY2KZRX6TvyuN7ojjr7lwkg6ml0roIy9YeuSr7JS372qlNW18UQYzgYK9ziGcerWqZOmEn9VNg==", + "dev": true, + "dependencies": { + "is-bigint": "^1.0.1", + "is-boolean-object": "^1.1.0", + "is-number-object": "^1.0.4", + "is-string": "^1.0.5", + "is-symbol": "^1.0.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "set-blocking": { + "node_modules/which-module": { "version": "2.0.0", - "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", - "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=" - }, - "set-immediate-shim": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz", - "integrity": "sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=", - "dev": true - }, - "setprototypeof": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", - "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==" + "license": "ISC" }, - "shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "node_modules/which-typed-array": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.9.tgz", + "integrity": "sha512-w9c4xkx6mPidwp7180ckYWfMmvxpjlZuIudNtDf4N/tTAUB8VJbX25qZoAsrtGuYNnGw3pa0AXgbGKRB8/EceA==", "dev": true, - "requires": { - "shebang-regex": "^3.0.0" + "dependencies": { + "available-typed-arrays": "^1.0.5", + "call-bind": "^1.0.2", + "for-each": "^0.3.3", + "gopd": "^1.0.1", + "has-tostringtag": "^1.0.0", + "is-typed-array": "^1.1.10" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" } }, - "shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "dev": true + "node_modules/wide-align": { + "version": "1.1.3", + "dev": true, + "license": "ISC", + "dependencies": { + "string-width": "^1.0.2 || 2" + } }, - "signal-exit": { - "version": "3.0.7", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", - "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" + "node_modules/windows-release": { + "version": "3.3.3", + "license": "MIT", + "dependencies": { + "execa": "^1.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "sinon": { - "version": "7.5.0", - "resolved": "https://registry.npmjs.org/sinon/-/sinon-7.5.0.tgz", - "integrity": "sha512-AoD0oJWerp0/rY9czP/D6hDTTUYGpObhZjMpd7Cl/A6+j0xBE+ayL/ldfggkBXUs0IkvIiM1ljM8+WkOc5k78Q==", + "node_modules/word-wrap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true, - "requires": { - "@sinonjs/commons": "^1.4.0", - "@sinonjs/formatio": "^3.2.1", - "@sinonjs/samsam": "^3.3.3", - "diff": "^3.5.0", - "lolex": "^4.2.0", - "nise": "^1.5.2", - "supports-color": "^5.5.0" - }, - "dependencies": { - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true - }, - "has-flag": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", - "dev": true - }, - "supports-color": { - "version": "5.5.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", - "dev": true, - "requires": { - "has-flag": "^3.0.0" - } - } + "engines": { + "node": ">=0.10.0" } }, - "socket.io": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-4.4.1.tgz", - "integrity": "sha512-s04vrBswdQBUmuWJuuNTmXUVJhP0cVky8bBDhdkf8y0Ptsu7fKU2LuLbts9g+pdmAdyMMn8F/9Mf1/wbtUN0fg==", + "node_modules/workerpool": { + "version": "6.1.0", "dev": true, - "requires": { - "accepts": "~1.3.4", - "base64id": "~2.0.0", - "debug": "~4.3.2", - "engine.io": "~6.1.0", - "socket.io-adapter": "~2.3.3", - "socket.io-parser": "~4.0.4" - }, + "license": "Apache-2.0" + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "dev": true, + "license": "MIT", "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - } + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "socket.io-adapter": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-2.3.3.tgz", - "integrity": "sha512-Qd/iwn3VskrpNO60BeRyCyr8ZWw9CPZyitW4AQwmRZ8zCiyDiL+znRnWX6tDHXnWn1sJrM1+b6Mn6wEDJJ4aYQ==", - "dev": true - }, - "socket.io-parser": { - "version": "4.0.5", - "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-4.0.5.tgz", - "integrity": "sha512-sNjbT9dX63nqUFIOv95tTVm6elyIU4RvB1m8dOeZt+IgWwcWklFDOdmGcfo3zSiRsnR/3pJkjY5lfoGqEe4Eig==", + "node_modules/wrap-ansi/node_modules/ansi-regex": { + "version": "5.0.1", "dev": true, - "requires": { - "@types/component-emitter": "^1.2.10", - "component-emitter": "~1.3.0", - "debug": "~4.3.1" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "node_modules/wrap-ansi/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "source-map-support": { - "version": "0.5.19", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", + "node_modules/wrap-ansi/node_modules/string-width": { + "version": "4.2.2", "dev": true, - "requires": { - "buffer-from": "^1.0.0", - "source-map": "^0.6.0" + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" } }, - "split": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/split/-/split-0.3.3.tgz", - "integrity": "sha1-zQ7qXmOiEd//frDwkcQTPi0N0o8=", + "node_modules/wrap-ansi/node_modules/strip-ansi": { + "version": "6.0.0", "dev": true, - "requires": { - "through": "2" + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" } }, - "sshpk": { - "version": "1.17.0", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.17.0.tgz", - "integrity": "sha512-/9HIEs1ZXGhSPE8X6Ccm7Nam1z8KcoCqPdI7ecm1N33EzAetWahvQWVqLZtaZQ+IDKX4IyA2o0gBzqIMkAagHQ==", - "optional": true, - "requires": { - "asn1": "~0.2.3", - "assert-plus": "^1.0.0", - "bcrypt-pbkdf": "^1.0.0", - "dashdash": "^1.12.0", - "ecc-jsbn": "~0.1.1", - "getpass": "^0.1.1", - "jsbn": "~0.1.0", - "safer-buffer": "^2.0.2", - "tweetnacl": "~0.14.0" - } - }, - "statuses": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/statuses/-/statuses-1.5.0.tgz", - "integrity": "sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow=" - }, - "stream-combiner": { - "version": "0.0.4", - "resolved": "https://registry.npmjs.org/stream-combiner/-/stream-combiner-0.0.4.tgz", - "integrity": "sha1-TV5DPBhSYd3mI8o/RMWGvPXErRQ=", - "dev": true, - "requires": { - "duplexer": "~0.1.1" - } + "node_modules/wrappy": { + "version": "1.0.2", + "license": "ISC" }, - "streamroller": { - "version": "3.0.6", - "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-3.0.6.tgz", - "integrity": "sha512-Qz32plKq/MZywYyhEatxyYc8vs994Gz0Hu2MSYXXLD233UyPeIeRBZARIIGwFer4Mdb8r3Y2UqKkgyDghM6QCg==", - "dev": true, - "requires": { - "date-format": "^4.0.6", - "debug": "^4.3.4", - "fs-extra": "^10.0.1" + "node_modules/ws": { + "version": "8.5.0", + "license": "MIT", + "engines": { + "node": ">=10.0.0" }, - "dependencies": { - "debug": { - "version": "4.3.4", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.4.tgz", - "integrity": "sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true } } }, - "string_decoder": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", - "requires": { - "safe-buffer": "~5.1.0" - }, + "node_modules/xml2js": { + "version": "0.4.23", + "resolved": "git+ssh://git@github.com/keymanapp/dependency-node-xml2js.git#535fe732dc408d697e0f847c944cc45f0baf0829", + "integrity": "sha512-5CS+yWxp0qg8zO7ng/iXrBZm2FXgpiJ+RJ3E0LzRxDXChESqzazRwzl8sXYe8/7je/NfwG4EXcClaRKUkcIvtQ==", + "license": "MIT", "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==" - } + "sax": ">=0.6.0", + "xmlbuilder": "~11.0.0" + }, + "engines": { + "node": ">=4.0.0" } }, - "string-argv": { - "version": "0.1.2", - "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.1.2.tgz", - "integrity": "sha512-mBqPGEOMNJKXRo7z0keX0wlAhbBAjilUdPW13nN0PecVryZxdHIeM7TqbsSUA7VYuS00HGC6mojP7DlQzfa9ZA==", - "dev": true + "node_modules/xmlbuilder": { + "version": "11.0.1", + "license": "MIT", + "engines": { + "node": ">=4.0" + } }, - "string-width": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", - "integrity": "sha1-EYvfW4zcUaKn5w0hHgfisLmxB9M=", - "optional": true, - "requires": { - "code-point-at": "^1.0.0", - "is-fullwidth-code-point": "^1.0.0", - "strip-ansi": "^3.0.0" + "node_modules/xtend": { + "version": "4.0.2", + "license": "MIT", + "engines": { + "node": ">=0.4" } }, - "string.prototype.codepointat": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/string.prototype.codepointat/-/string.prototype.codepointat-0.2.1.tgz", - "integrity": "sha512-2cBVCj6I4IOvEnjgO/hWqXjqBGsY+zwPmHl12Srk9IXSZ56Jwwmy+66XO5Iut/oQVR7t5ihYdLB0GMa4alEUcg==" + "node_modules/y18n": { + "version": "5.0.8", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } }, - "string.prototype.startswith": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/string.prototype.startswith/-/string.prototype.startswith-0.2.0.tgz", - "integrity": "sha1-2miYLjU6TprEpDtFCiBF0cRFrns=" + "node_modules/yallist": { + "version": "4.0.0", + "license": "ISC" }, - "strip-ansi": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", - "integrity": "sha1-ajhfuIU9lS1f8F0Oiq+UJ43GPc8=", - "optional": true, - "requires": { - "ansi-regex": "^2.0.0" + "node_modules/yaml": { + "version": "1.10.2", + "license": "ISC", + "engines": { + "node": ">= 6" } }, - "strip-eof": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", - "integrity": "sha512-7FCwGGmx8mD5xQd3RPUvnSpUXHM3BWuzjtpD4TXsfcZ9EL4azvVVUscFYwD9nx8Kh+uCBC00XBtAykoMHwTh8Q==" - }, - "strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "dev": true + "node_modules/yargs": { + "version": "16.2.0", + "dev": true, + "license": "MIT", + "dependencies": { + "cliui": "^7.0.2", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.0", + "y18n": "^5.0.5", + "yargs-parser": "^20.2.2" + }, + "engines": { + "node": ">=10" + } }, - "supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "requires": { - "has-flag": "^4.0.0" + "node_modules/yargs-parser": { + "version": "20.2.4", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" } }, - "tar": { - "version": "6.1.11", - "resolved": "https://registry.npmjs.org/tar/-/tar-6.1.11.tgz", - "integrity": "sha512-an/KZQzQUkZCkuoAA64hM92X0Urb6VpRhAFllDzz44U2mcD5scmT3zBc4VgVpkugF580+DQn8eAFSyoQt0tznA==", - "optional": true, - "requires": { - "chownr": "^2.0.0", - "fs-minipass": "^2.0.0", - "minipass": "^3.0.0", - "minizlib": "^2.1.1", - "mkdirp": "^1.0.3", - "yallist": "^4.0.0" - }, + "node_modules/yargs-unparser": { + "version": "2.0.0", + "dev": true, + "license": "MIT", "dependencies": { - "mkdirp": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", - "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", - "optional": true - } + "camelcase": "^6.0.0", + "decamelize": "^4.0.0", + "flat": "^5.0.2", + "is-plain-obj": "^2.1.0" + }, + "engines": { + "node": ">=10" } }, - "temp-fs": { - "version": "0.9.9", - "resolved": "https://registry.npmjs.org/temp-fs/-/temp-fs-0.9.9.tgz", - "integrity": "sha1-gHFzBDeHByDpQxUy/igUNk+IA9c=", + "node_modules/yargs-unparser/node_modules/camelcase": { + "version": "6.2.0", "dev": true, - "requires": { - "rimraf": "~2.5.2" + "license": "MIT", + "engines": { + "node": ">=10" }, - "dependencies": { - "rimraf": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.5.4.tgz", - "integrity": "sha1-loAAk8vxoMhr2VtGJUZ1NcKd+gQ=", - "dev": true, - "requires": { - "glob": "^7.0.5" - } - } + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "through": { - "version": "2.3.8", - "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", - "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", - "dev": true - }, - "through2": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", + "node_modules/yargs-unparser/node_modules/decamelize": { + "version": "4.0.0", "dev": true, - "requires": { - "readable-stream": "~2.3.6", - "xtend": "~4.0.1" + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "tmp": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", + "node_modules/yargs-unparser/node_modules/is-plain-obj": { + "version": "2.1.0", "dev": true, - "requires": { - "rimraf": "^3.0.0" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "to-regex-range": { + "node_modules/yargs/node_modules/ansi-regex": { "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, - "requires": { - "is-number": "^7.0.0" + "license": "MIT", + "engines": { + "node": ">=8" } }, - "toidentifier": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", - "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==" - }, - "tough-cookie": { - "version": "2.5.0", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", - "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", - "optional": true, - "requires": { - "psl": "^1.1.28", - "punycode": "^2.1.1" + "node_modules/yargs/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" } }, - "tr46": { - "version": "0.0.3", - "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", - "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" - }, - "ts-node": { - "version": "9.1.1", - "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.1.1.tgz", - "integrity": "sha512-hPlt7ZACERQGf03M253ytLY3dHbGNGrAq9qIHWUY9XHYl1z7wYngSr3OQ5xmui8o2AaxsONxIzjafLUiWBo1Fg==", + "node_modules/yargs/node_modules/string-width": { + "version": "4.2.2", "dev": true, - "requires": { - "arg": "^4.1.0", - "create-require": "^1.1.0", - "diff": "^4.0.1", - "make-error": "^1.1.1", - "source-map-support": "^0.5.17", - "yn": "3.1.1" - }, + "license": "MIT", "dependencies": { - "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", - "dev": true - } + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" } }, - "tsc-watch": { - "version": "4.6.2", - "resolved": "https://registry.npmjs.org/tsc-watch/-/tsc-watch-4.6.2.tgz", - "integrity": "sha512-eHWzZGkPmzXVGQKbqQgf3BFpGiZZw1jQ29ZOJeaSe8JfyUvphbd221NfXmmsJUGGPGA/nnaSS01tXipUcyxAxg==", + "node_modules/yargs/node_modules/strip-ansi": { + "version": "6.0.0", "dev": true, - "requires": { - "cross-spawn": "^7.0.3", - "node-cleanup": "^2.1.2", - "ps-tree": "^1.2.0", - "string-argv": "^0.1.1", - "strip-ansi": "^6.0.0" - }, + "license": "MIT", "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.1" - } - } + "ansi-regex": "^5.0.0" + }, + "engines": { + "node": ">=8" } }, - "tslib": { - "version": "1.14.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", - "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" - }, - "tunnel": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/tunnel/-/tunnel-0.0.6.tgz", - "integrity": "sha512-1h/Lnq9yajKY2PEbBadPXj3VxsDDu844OnaAo52UVmIzIvwwtBPIuNvkjuzBlTWpfJyUbG3ez0KSBibQkj4ojg==" - }, - "tunnel-agent": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", - "integrity": "sha1-J6XeoGs2sEoKmWZ3SykIaPD8QP0=", - "optional": true, - "requires": { - "safe-buffer": "^5.0.1" + "node_modules/yauzl": { + "version": "2.10.0", + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" } }, - "tweetnacl": { - "version": "0.14.5", - "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", - "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "optional": true + "node_modules/yn": { + "version": "3.1.1", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } }, - "type-detect": { - "version": "4.0.8", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", - "dev": true + "node_modules/yocto-queue": { + "version": "0.1.0", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } }, - "type-is": { - "version": "1.6.18", - "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", - "requires": { - "media-typer": "0.3.0", - "mime-types": "~2.1.24" + "resources/build/version": { + "name": "@keymanapp/auto-history-action", + "license": "MIT", + "dependencies": { + "@actions/core": "^1.9.1", + "@actions/github": "^2.1.0", + "typescript": "^4.9.5", + "yargs": "^15.1.0" + }, + "devDependencies": { + "@types/node": "^13.7.0", + "@types/semver": "^7.1.0", + "semver": "^7.1.2", + "ts-node": "^10.9.1" + }, + "engines": { + "node": ">=16.0" } }, - "typedarray": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", - "integrity": "sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c=" - }, - "typescript": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.6.3.tgz", - "integrity": "sha512-yNIatDa5iaofVozS/uQJEl3JRWLKKGJKh6Yaiv0GLGSuhpFJe7P3SbHZ8/yjAHRQwKRoA6YZqlfjXWmVzoVSMw==" - }, - "ua-parser-js": { - "version": "0.7.33", - "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.33.tgz", - "integrity": "sha512-s8ax/CeZdK9R/56Sui0WM6y9OFREJarMRHqLB2EwkovemBxNQ+Bqu8GAsUnVcXKgphb++ghr/B2BZx4mahujPw==", - "dev": true + "resources/build/version/node_modules/@types/node": { + "version": "13.13.52", + "dev": true, + "license": "MIT" }, - "uc.micro": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", - "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", - "dev": true + "resources/build/version/node_modules/ansi-regex": { + "version": "5.0.1", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "universal-user-agent": { + "resources/build/version/node_modules/cliui": { "version": "6.0.0", - "resolved": "https://registry.npmjs.org/universal-user-agent/-/universal-user-agent-6.0.0.tgz", - "integrity": "sha512-isyNax3wXoKaulPDZWHQqbmIx1k2tb9fb3GGDBRxCscfYV2Ch7WxPArBsFEG8s/safwXTT7H4QGhaIkTp9447w==" - }, - "universalify": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.0.tgz", - "integrity": "sha512-hAZsKq7Yy11Zu1DE0OzWjw7nnLZmJZYTDZZyEFHZdUhV8FkH5MCfoU1XMaxXovpyW5nq5scPqq0ZDP9Zyl04oQ==", - "dev": true - }, - "unpipe": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", - "integrity": "sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw=" - }, - "untildify": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", - "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", - "dev": true - }, - "uri-js": { - "version": "4.4.1", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", - "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", - "optional": true, - "requires": { - "punycode": "^2.1.0" + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.0", + "wrap-ansi": "^6.2.0" } }, - "util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" - }, - "utils-merge": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", - "integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM=" - }, - "uuid": { - "version": "8.3.2", - "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", - "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" - }, - "v8-compile-cache-lib": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/v8-compile-cache-lib/-/v8-compile-cache-lib-3.0.1.tgz", - "integrity": "sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==", - "dev": true - }, - "vary": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", - "integrity": "sha1-IpnwLG3tMNSllhsLn3RSShj2NPw=" - }, - "verror": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", - "integrity": "sha1-OhBcoXBTr1XW4nDB+CiGguGNpAA=", - "optional": true, - "requires": { - "assert-plus": "^1.0.0", - "core-util-is": "1.0.2", - "extsprintf": "^1.2.0" - }, + "resources/build/version/node_modules/find-up": { + "version": "4.1.0", + "license": "MIT", "dependencies": { - "core-util-is": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", - "integrity": "sha1-tf1UIgqivFq1eqtxQMlAdUUDwac=", - "optional": true - } + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + }, + "engines": { + "node": ">=8" } }, - "void-elements": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/void-elements/-/void-elements-2.0.1.tgz", - "integrity": "sha1-wGavtYK7HLQSjWDqkjkulNXp2+w=", - "dev": true - }, - "webidl-conversions": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", - "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" + "resources/build/version/node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "license": "MIT", + "engines": { + "node": ">=8" + } }, - "whatwg-url": { + "resources/build/version/node_modules/locate-path": { "version": "5.0.0", - "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", - "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", - "requires": { - "tr46": "~0.0.3", - "webidl-conversions": "^3.0.0" + "license": "MIT", + "dependencies": { + "p-locate": "^4.1.0" + }, + "engines": { + "node": ">=8" } }, - "which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "devOptional": true, - "requires": { - "isexe": "^2.0.0" + "resources/build/version/node_modules/p-limit": { + "version": "2.3.0", + "license": "MIT", + "dependencies": { + "p-try": "^2.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, - "which-module": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/which-module/-/which-module-2.0.0.tgz", - "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=" + "resources/build/version/node_modules/p-locate": { + "version": "4.1.0", + "license": "MIT", + "dependencies": { + "p-limit": "^2.2.0" + }, + "engines": { + "node": ">=8" + } }, - "wide-align": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.3.tgz", - "integrity": "sha512-QGkOQc8XL6Bt5PwnsExKBPuMKBxnGxWWW3fU55Xt4feHozMUhdUMaBCk290qpm/wG5u/RSKzwdAC4i51YigihA==", - "optional": true, - "requires": { - "string-width": "^1.0.2 || 2" + "resources/build/version/node_modules/string-width": { + "version": "4.2.3", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" } }, - "windows-release": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/windows-release/-/windows-release-3.3.3.tgz", - "integrity": "sha512-OSOGH1QYiW5yVor9TtmXKQvt2vjQqbYS+DqmsZw+r7xDwLXEeT3JGW0ZppFmHx4diyXmxt238KFR3N9jzevBRg==", - "requires": { - "execa": "^1.0.0" + "resources/build/version/node_modules/strip-ansi": { + "version": "6.0.1", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" } }, - "wrap-ansi": { - "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, - "requires": { + "resources/build/version/node_modules/wrap-ansi": { + "version": "6.2.0", + "license": "MIT", + "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", "strip-ansi": "^6.0.0" }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "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 - }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } - } - }, - "wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=" - }, - "ws": { - "version": "8.5.0", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.5.0.tgz", - "integrity": "sha512-BWX0SWVgLPzYwF8lTzEy1egjhS4S4OEAHfsO8o65WOVsrnSRGaSiUaa9e0ggGlkMTtBlmOpEXiie9RUcBO86qg==", - "requires": {} - }, - "xml2js": { - "version": "0.4.23", - "resolved": "https://registry.npmjs.org/xml2js/-/xml2js-0.4.23.tgz", - "integrity": "sha512-ySPiMjM0+pLDftHgXY4By0uswI3SPKLDw/i3UXbnO8M/p28zqexCUoPmQFrYD+/1BzhGJSs2i1ERWKJAtiLrug==", - "requires": { - "sax": ">=0.6.0", - "xmlbuilder": "~11.0.0" + "engines": { + "node": ">=8" } }, - "xmlbuilder": { - "version": "11.0.1", - "resolved": "https://registry.npmjs.org/xmlbuilder/-/xmlbuilder-11.0.1.tgz", - "integrity": "sha512-fDlsI/kFEx7gLvbecc0/ohLG50fugQp8ryHzMTuW9vSa1GJ0XYWKnhsUx7oie3G98+r56aTQIUB4kht42R3JvA==" - }, - "xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==" - }, - "y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "dev": true - }, - "yallist": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", - "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", - "optional": true - }, - "yaml": { - "version": "1.10.2", - "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.2.tgz", - "integrity": "sha512-r3vXyErRCYJ7wg28yvBY5VSoAF8ZvlcW9/BwUzEtUsjvX/DKs24dIkuwjtuprwJJHsbyUbLApepYTR1BN4uHrg==" + "resources/build/version/node_modules/y18n": { + "version": "4.0.3", + "license": "ISC" }, - "yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dev": true, - "requires": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", + "resources/build/version/node_modules/yargs": { + "version": "15.4.1", + "license": "MIT", + "dependencies": { + "cliui": "^6.0.0", + "decamelize": "^1.2.0", + "find-up": "^4.1.0", + "get-caller-file": "^2.0.1", "require-directory": "^2.1.1", + "require-main-filename": "^2.0.0", + "set-blocking": "^2.0.0", "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" + "which-module": "^2.0.0", + "y18n": "^4.0.0", + "yargs-parser": "^18.1.2" }, - "dependencies": { - "ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "dev": true - }, - "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 - }, - "string-width": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", - "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, - "requires": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.0" - } - }, - "strip-ansi": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, - "requires": { - "ansi-regex": "^5.0.0" - } - } + "engines": { + "node": ">=8" } }, - "yargs-parser": { - "version": "20.2.4", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.4.tgz", - "integrity": "sha512-WOkpgNhPTlE73h4VFAFsOnomJVaovO8VqLDzy5saChRBFQFBoMYirowyW+Q9HB4HFF4Z7VZTiG3iSzJJA29yRA==", - "dev": true - }, - "yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dev": true, - "requires": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, + "resources/build/version/node_modules/yargs-parser": { + "version": "18.1.3", + "license": "ISC", "dependencies": { - "camelcase": { - "version": "6.2.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.2.0.tgz", - "integrity": "sha512-c7wVvbw3f37nuobQNtgsgG9POC9qMbNuMQmTCqZv23b6MIz0fcYpBiOlv9gEN/hdLdnZTDQhg6e9Dq5M1vKvfg==", - "dev": true - }, - "decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "dev": true - }, - "is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "dev": true - } + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" + }, + "engines": { + "node": ">=6" } }, - "yauzl": { - "version": "2.10.0", - "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", - "integrity": "sha1-x+sXyT4RLLEIb6bY5R+wZnt5pfk=", - "requires": { - "buffer-crc32": "~0.2.3", - "fd-slicer": "~1.1.0" + "resources/gosh": { + "name": "@keymanapp/resources-gosh", + "license": "MIT", + "bin": { + "gosh": "gosh.js" } }, - "yn": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", - "dev": true - }, - "yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "dev": true + "web": { + "name": "keyman", + "license": "MIT", + "dependencies": { + "@keymanapp/input-processor": "*", + "@keymanapp/keyboard-processor": "*", + "@keymanapp/keyman-version": "*", + "@keymanapp/lexical-model-layer": "*", + "@keymanapp/models-types": "*", + "@keymanapp/recorder-core": "*", + "@keymanapp/web-utils": "*", + "@types/node": "^11.9.4", + "eventemitter3": "^4.0.0" + }, + "devDependencies": { + "@keymanapp/resources-gosh": "*", + "@keymanapp/web-sentry-manager": "*", + "@sentry/cli": "2.2.0", + "chai": "^4.3.4", + "google-closure-compiler-java": "^20200224.0.0", + "karma": "^6.4.1", + "karma-browserstack-launcher": "^1.6.0", + "karma-chai": "^0.1.0", + "karma-chrome-launcher": "^2.2.0", + "karma-edge-launcher": "^0.4.2", + "karma-firefox-launcher": "^1.1.0", + "karma-fixture": "^0.2.6", + "karma-html2js-preprocessor": "^1.1.0", + "karma-ie-launcher": "^1.0.0", + "karma-json-fixtures-preprocessor": "0.0.6", + "karma-mocha": "^2.0.1", + "karma-mocha-reporter": "^2.2.5", + "karma-safari-launcher": "^1.0.0", + "karma-teamcity-reporter": "^1.1.0", + "mocha": "^10.0.0", + "modernizr": "^3.11.7", + "ts-node": "^10.9.1", + "typescript": "^4.9.5" + } } } } diff --git a/package.json b/package.json index 3740150c629690f431a63d5378eb7b282945d540..7a2b53d50d53a777f786760652e187d9e6d5da02 100644 --- a/package.json +++ b/package.json @@ -5,19 +5,40 @@ "chai": "^4.3.4", "mocha": "^10.0.0", "mocha-teamcity-reporter": "^4.0.0", - "ts-node": "^9.1.1", - "typescript": "^4.5.4" + "ts-node": "^10.9.1", + "typescript": "^4.9.5", + "@typescript-eslint/eslint-plugin": "^5.59.1", + "eslint": "^8.39.0", + "eslint-config-standard-with-typescript": "^34.0.1", + "eslint-plugin-import": "^2.27.5", + "eslint-plugin-n": "^15.7.0", + "eslint-plugin-promise": "^6.1.1" }, "scripts": {}, "workspaces": [ "resources/gosh", "resources/build/version", - "developer/src/kmlmc", + "core/include/ldml", + "developer/src/common/web/test-helpers", + "developer/src/kmc-kmn", + "developer/src/kmc-ldml", + "developer/src/kmc-model", + "developer/src/kmc-model-info", + "developer/src/kmc-package", + "developer/src/kmc", "developer/src/server", "common/models/*", "common/tools/*", "common/web/*", "common/predictive-text", + "common/tools/hextobin", "web" - ] + ], + "dependencies": { + "@keymanapp/hextobin": "file:common/tools/hextobin", + "@keymanapp/keyman-version": "file:common/web/keyman-version", + "@keymanapp/common-types": "file:common/web/types", + "@keymanapp/ldml-keyboard-constants": "file:core/include/ldml", + "@keymanapp/developer-test-helpers": "file:developer/src/common/web/test-helpers" + } } diff --git a/resources/build.sh b/resources/build.sh new file mode 100755 index 0000000000000000000000000000000000000000..c65af696c7576bbfcd4575a0b1ebf69dd615d362 --- /dev/null +++ b/resources/build.sh @@ -0,0 +1,21 @@ +#!/usr/bin/env bash +## START STANDARD BUILD SCRIPT INCLUDE +# adjust relative paths as necessary +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../resources/build/build-utils.sh" +## END STANDARD BUILD SCRIPT INCLUDE + +cd "$THIS_SCRIPT_PATH" + +builder_describe "Keyman resources module" clean configure build test +builder_parse "$@" + +#------------------------------------------------------------------------------------------------------------------- + +# clean, configure, and build are no-ops for resources/ folder; currently +# only have a test for builder.inc.sh + +if builder_start_action test; then + ./build/test/test.sh + builder_finish_action success test +fi diff --git a/resources/build/README.md b/resources/build/README.md index daa9c771e5e8c044076f5f7392626abce7096794..ead7975b8b1077f6212b74b2c975a7a71069809c 100644 --- a/resources/build/README.md +++ b/resources/build/README.md @@ -16,13 +16,6 @@ including this file... See [build-utils.md](build-utils.md) -### vswhere - -vswhere.exe is used by Keyman Core to select a Visual Studio version on Windows. - -Official source: . -License: [MIT](vswhere-license.txt) - ### jq-win64 jq-win64.exe is used by various builds for json query. diff --git a/resources/build/build-download-resources.sh b/resources/build/build-download-resources.sh index eb738aab6bf99a34f732486589d9e0cc387ab621..07cfbfc697e72bae68f3fda5667e4da98dc9c3f2 100755 --- a/resources/build/build-download-resources.sh +++ b/resources/build/build-download-resources.sh @@ -21,7 +21,7 @@ SHLVL=0 function downloadKeyboardPackage() { # Check that $KEYBOARDS_TARGET is valid if [ "$#" -ne 2 ]; then - die "downloadKeyboardPackage requires KEYBOARD_PACKAGE_ID and KEYBOARDS_TARGET to be set" + builder_die "downloadKeyboardPackage requires KEYBOARD_PACKAGE_ID and KEYBOARDS_TARGET to be set" fi # Default Keyboard local ID="$1" @@ -33,14 +33,14 @@ function downloadKeyboardPackage() { echo "Downloading ${ID}.kmp from downloads.keyman.com" local URL_DOWNLOAD_FILE=`curl -s "$URL_API_KEYBOARD_VERSION/${ID}" | "$JQ" -r .kmp` curl -f -s "$URL_DOWNLOAD_FILE" -o "$KEYBOARDS_TARGET" || { - die "Downloading $KEYBOARDS_TARGET failed with error $?" + builder_die "Downloading $KEYBOARDS_TARGET failed with error $?" } } function downloadModelPackage() { # Check that $MODELS_TARGET is valid if [ "$#" -ne 2 ]; then - die "downloadModelPackage requires MODEL_PACKAGE_ID and MODELS_TARGET to be set" + builder_die "downloadModelPackage requires MODEL_PACKAGE_ID and MODELS_TARGET to be set" fi # Default Model local ID="$1" @@ -52,6 +52,6 @@ function downloadModelPackage() { echo "Downloading ${ID}.model.kmp from downloads.keyman.com" local URL_DOWNLOAD_FILE=`curl -s "$URL_API_MODEL_VERSION/${ID}" | "$JQ" -r .kmp` curl -f -s "$URL_DOWNLOAD_FILE" -o "$MODELS_TARGET" || { - die "Downloading $MODELS_TARGET failed with error $?" + builder_die "Downloading $MODELS_TARGET failed with error $?" } } diff --git a/resources/build/build-help.inc.sh b/resources/build/build-help.inc.sh new file mode 100644 index 0000000000000000000000000000000000000000..f5770fe885ec2fa594cc727b8cad7dfff2fd7410 --- /dev/null +++ b/resources/build/build-help.inc.sh @@ -0,0 +1,85 @@ +#!/usr/bin/env bash +# +# This script contains utilities for converting markdown help documentation to htm/html. +# The apps can then include the htm/html files in the installation to display +# help within the app. +# Expected platforms: android, ios, mac +# Note: linux app doesn't need to convert from markdown to html +# + +# Clean the htm/html files and recreate the output path +# ### Parameters +# +# * `platform` the platform to build, matching the platform folder name +# * `output_path` path to emit files to, relative to `$KEYMAN_ROOT/$platform` +# +function _build_help_clean() { + echo "Cleaning" + local PLATFORM="$1" + local DESTHTM="$KEYMAN_ROOT/$PLATFORM/$2" + + echo "rm DESTHTM: $DESTHTM" + rm -rf "$DESTHTM" + mkdir -p "$DESTHTM" +} + + +# +# Compile all .md to .html +# ### Parameters +# +# * `platform` the platform to build, matching the platform folder name +# * `output_path` path to emit files to, relative to `$KEYMAN_ROOT/$platform` +# +function _build_help_build() { + local MDLUA="$KEYMAN_ROOT/resources/build/html-link.lua" + local CSS="$KEYMAN_ROOT/resources/build/offline-help-style-spec.txt" + local PLATFORM="$1" + + cd "$KEYMAN_ROOT/$PLATFORM/help" + local MD=`find . -name "*.md"` + local DESTHTM="$KEYMAN_ROOT/$PLATFORM/$2" + + # + # Generate HTML files from Markdown + # + for INFILE in $MD; do + OUTFILE="$DESTHTM/${INFILE%.md}.html" + echo "Processing $INFILE to $(basename "$OUTFILE")" + mkdir -p "$(dirname "$OUTFILE")" + pandoc -s -H "$CSS" --lua-filter="$MDLUA" -t html -o "$OUTFILE" $INFILE + done + + # + # Copy Images + # + cd "$KEYMAN_ROOT/$PLATFORM/help/" + mkdir -p "$DESTHTM/${PLATFORM}_images" + cp $KEYMAN_ROOT/$PLATFORM/help/${PLATFORM}_images/* "$DESTHTM/${PLATFORM}_images/" +} + +# +# Builds .html files from .md source +# +# ### Usage +# +# ```bash +# build_help_html platform output_path +# ``` +# +# ### Parameters +# +# * `platform` the platform to build, matching the platform folder name +# * `output_path` path to emit files to, relative to `$KEYMAN_ROOT/$platform` +# +# ### Description +# +# Expects to find .md source under $KEYMAN_ROOT/$platform/help/, and +# will write the output .html to $KEYMAN_ROOT/$platform/$output_path. +# +function build_help_html() { + pushd $(pwd) + _build_help_clean $1 $2 + _build_help_build $1 $2 + popd +} diff --git a/resources/build/build-utils-ci.inc.sh b/resources/build/build-utils-ci.inc.sh index 9aafa9c98e5af878150d98209a0269d377bff6c8..de36ae9e9b606556869c22f2f7492240825070f7 100644 --- a/resources/build/build-utils-ci.inc.sh +++ b/resources/build/build-utils-ci.inc.sh @@ -68,8 +68,12 @@ function builder_pull_has_label() { # parameter, will do a dry run # # Note that `package.json` will be dirty after this command, as the `version` -# field will be added to it. This change should not be committed to the -# repository. +# field will be added to it, and @keymanapp dependency versions will also be +# modified. This change should not be committed to the repository. +# +# builder_publish_to_pack and builder_publish_to_npm are similar: +# * builder_publish_to_npm publishes to the public registry +# * builder_publish_to_pack creates a local tarball which can be used to test # # Usage: # ```bash @@ -77,6 +81,15 @@ function builder_pull_has_label() { # ``` # function builder_publish_to_npm() { + _builder_publish_npm_package publish +} + +function builder_publish_to_pack() { + _builder_publish_npm_package pack +} + +function _builder_publish_npm_package() { + local action=$1 local dist_tag=$TIER dry_run= if [[ $TIER == stable ]]; then @@ -87,17 +100,46 @@ function builder_publish_to_npm() { dry_run=--dry-run fi - # We use --no-git-tag-version because our CI system controls version numbering and - # already tags releases. We also want to have the version of this match the - # release of Keyman Developer -- these two versions should be in sync. Because this - # is a large repo with multiple projects and build systems, it's better for us that - # individual build systems don't take too much ownership of git tagging. :) + # We use --no-git-tag-version because our CI system controls version numbering + # and already tags releases. We also want to have the version of this match + # the release of Keyman Developer -- these two versions should be in sync. + # Because this is a large repo with multiple projects and build systems, it's + # better for us that individual build systems don't take too much ownership of + # git tagging. :) npm version --allow-same-version --no-git-tag-version --no-commit-hooks "$VERSION_WITH_TAG" - # Note: In either case, npm publish MUST be given --access public to publish - # a package in the @keymanapp scope on the public npm package index. + # Update all @keymanapp/* [*]dependencies in package.json to the current + # version-with-tag, so that the published version has precise dependencies, + # and we don't accidentally end up with either older or newer deps here + _builder_npm_set_dependency_version + + # Note: In either case, npm publish MUST be given --access public to publish a + # package in the @keymanapp scope on the public npm package index. # # See `npm help publish` for more details. - echo "Publishing $dry_run npm package $THIS_SCRIPT_IDENTIFIER with tag $dist_tag" - npm publish $dry_run --access public --tag $dist_tag + if [[ $action == pack ]]; then + # We can use --publish-to-pack to locally test a package + # before publishing to the package registry + echo "Packing $dry_run npm package $THIS_SCRIPT_IDENTIFIER with tag $dist_tag" + npm pack $dry_run --access public --tag $dist_tag + else # $action == publish + echo "Publishing $dry_run npm package $THIS_SCRIPT_IDENTIFIER with tag $dist_tag" + npm publish $dry_run --access public --tag $dist_tag + fi } + +# Updates all @keymanapp/* [*]dependencies in package.json to the current +# version-with-tag, so that the published version has precise dependencies, and +# we don't accidentally end up with either older or newer deps. This overwrites +# the local package.json, so it does need to be restored afterwards +function _builder_npm_set_dependency_version() { + cat package.json | "$JQ" --arg VERSION_WITH_TAG "$VERSION_WITH_TAG" \ + ' + . + + (try { dependencies: (.dependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {}) + + (try { devDependencies: (.devDependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {}) + + (try { bundleDependencies: (.bundleDependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {}) + + (try { optionalDependencies: (.optionalDependencies | to_entries | . + map(select(.key | match("@keymanapp/.*")) .value |= $VERSION_WITH_TAG) | from_entries) } catch {}) + ' > package1.json + mv -f package1.json package.json +} \ No newline at end of file diff --git a/resources/build/build-utils-ci.test.sh b/resources/build/build-utils-ci.test.sh index b80be2d1b1ba23bf13ba53ebf10204699ed7c842..662ea581daa06c4fb3a47b34b3e53b5cbe1b4e49 100755 --- a/resources/build/build-utils-ci.test.sh +++ b/resources/build/build-utils-ci.test.sh @@ -7,8 +7,8 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" -. "$(dirname "$THIS_SCRIPT")/build-utils.sh" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" +. "${THIS_SCRIPT%/*}/../../resources/build/build-utils.sh" # END STANDARD BUILD SCRIPT INCLUDE . "$KEYMAN_ROOT/resources/build/build-utils-ci.inc.sh" @@ -16,42 +16,42 @@ THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BA # Tests -echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER not set${COLOR_RESET}" +builder_echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER not set${COLOR_RESET}" if ! builder_pull_get_details; then - echo "PASS: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER is not set" + builder_echo "PASS: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER is not set" else - fail "FAIL: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER is not set" + builder_die "FAIL: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER is not set" fi -echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=master${COLOR_RESET}" +builder_echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=master${COLOR_RESET}" TEAMCITY_PR_NUMBER=master if ! builder_pull_get_details; then - echo "PASS: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER=master" + builder_echo "PASS: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER=master" else - fail "FAIL: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER=master" + builder_die "FAIL: builder_pull_get_details should get no details if \$TEAMCITY_PR_NUMBER=master" fi -echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=$TEAMCITY_PR_NUMBER${COLOR_RESET}" +builder_echo "${COLOR_BLUE}## Testing: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=$TEAMCITY_PR_NUMBER${COLOR_RESET}" TEAMCITY_PR_NUMBER=7248 if ! builder_pull_get_details; then - fail "FAIL: builder_pull_get_details was unable to read and parse PR details for #$TEAMCITY_PR_NUMBER from GitHub" + builder_die "FAIL: builder_pull_get_details was unable to read and parse PR details for #$TEAMCITY_PR_NUMBER from GitHub" fi # print metadata from PR -echo " pull number: $builder_pull_number" -echo " title: $builder_pull_title" -echo " labels: ${builder_pull_labels[*]}" +builder_echo " pull number: $builder_pull_number" +builder_echo " title: $builder_pull_title" +builder_echo " labels: ${builder_pull_labels[*]}" -echo "PASS: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=$TEAMCITY_PR_NUMBER" +builder_echo "PASS: builder_pull_get_details with \$TEAMCITY_PR_NUMBER=$TEAMCITY_PR_NUMBER" -echo "${COLOR_BLUE}## Testing: builder_pull_has_label epic-ldml${COLOR_RESET}" +builder_echo "${COLOR_BLUE}## Testing: builder_pull_has_label epic-ldml${COLOR_RESET}" if ! builder_pull_has_label epic-ldml; then - fail "FAIL: builder_pull_has_label epic-ldml" + builder_die "FAIL: builder_pull_has_label epic-ldml" fi -echo "PASS: builder_pull_has_label epic-ldml" +builder_echo "PASS: builder_pull_has_label epic-ldml" -echo "All tests passed." +builder_echo "All tests passed." diff --git a/resources/build/build-utils.md b/resources/build/build-utils.md index 8c74220f67aa647cd21be3b17d6c66d4d8c041da..6c27e5e8a4bd9b3e7980d2f6278c0690f0f527dd 100644 --- a/resources/build/build-utils.md +++ b/resources/build/build-utils.md @@ -15,8 +15,7 @@ objectives are: to know) 3. for the scripts to be easily readable, coherent, and straightforward for anyone involved in the project to maintain -4. for dependencies to be simple (a module dependency will always be to a whole - module, not to a specific target within that module) +4. for dependencies to be simple, but flexible * [Jump to API definitions](#builder-api-functions-and-variables) @@ -43,11 +42,13 @@ set -eu ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" . "$(dirname "$THIS_SCRIPT")//resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE -# any other includes, such as jq.inc.sh +# . "$KEYMAN_ROOT/.../foo.inc.sh" # any other includes, such as jq.inc.sh + +# cd "$THIS_SCRIPT_PATH" # optionally, run from script directory ################################ Main script ################################ ``` @@ -76,21 +77,24 @@ We use `set -eu` throughout: ```bash ## START STANDARD BUILD SCRIPT INCLUDE # adjust relative paths as necessary -THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" +THIS_SCRIPT="$(readlink -f "${BASH_SOURCE[0]}")" . "$(dirname "$THIS_SCRIPT")//resources/build/build-utils.sh" ## END STANDARD BUILD SCRIPT INCLUDE ``` -This somewhat unwieldy incantation handles all our build environments, with -`greadlink` necessary on macOS (again installed with homebrew) due to the -included macOS `readlink` struggling with canonicalization of symbolic links. +This somewhat unwieldy incantation handles all our build environments. The intent is to get a good solid consistent path for the script so that we can safely include the build script, no matter what `pwd` is when the script is run. + The only modification permissible in this block is the `` text which will be a series of `../` paths taking us to the repository root from the location of the script itself. +It is essential to make the include relative to the repo root, even for scripts +under the resources/ folder. Doing this gives us significant performance +benefits. + Inclusion of other scripts should be kept outside this standard build script include section, as we may programatically update (a.ka. global search-and-replace) this section in the future as required. @@ -104,6 +108,29 @@ available, so other include scripts should be sourced accordingly, for example: . "$KEYMAN_ROOT/resources/build/jq.inc.sh" ``` +## Setting path + +Many scripts will be easier to code if they run from a consistent path. Because +build scripts should be invokable from any directory, you may wish to add the +following line here: + +```bash +cd "$THIS_SCRIPT_PATH" +``` + +## Standard environment + +`build-utils.sh` will prepend `$KEYMAN_ROOT/node_modules/.bin` to the `PATH` +variable to ensure that we run the correct versions of npm package commands, so +there is no need to hard-code path references or add script wrappers to +package.json (`npm run