From fd5bd1a70c7fe3f048a32c491964aed5fa68b0bf Mon Sep 17 00:00:00 2001 From: Eddie Antonio Santos Date: Mon, 4 May 2020 10:53:57 -0600 Subject: [PATCH] chore(common/lmlayer): requisite lerna-fu --- developer/js/build.sh | 13 ++++--------- developer/js/package.json | 3 ++- developer/js/tests/test-join-word-breaker.ts | 14 +++++++------- lerna.json | 3 ++- 4 files changed, 15 insertions(+), 18 deletions(-) diff --git a/developer/js/build.sh b/developer/js/build.sh index c804baef62..0403e65465 100755 --- a/developer/js/build.sh +++ b/developer/js/build.sh @@ -7,13 +7,11 @@ set -eu # Include some helper functions from resources -. ../../resources/shellHelperFunctions.sh +THIS_SCRIPT="$(greadlink -f "${BASH_SOURCE[0]}" 2>/dev/null || readlink -f "${BASH_SOURCE[0]}")" +KEYMAN_ROOT="$(dirname "$THIS_SCRIPT")/../.." +. "$KEYMAN_ROOT/resources/shellHelperFunctions.sh" EX_USAGE=64 -# Where to find lexical model types. -LEXICAL_MODELS_TYPES=../../common/lexical-model-types - - # Build the main script. build () { npm run build || fail "Could not build top-level JavaScript file." @@ -130,10 +128,7 @@ type npm >/dev/null ||\ fail "Build environment setup error detected! Please ensure Node.js is installed!" if (( install_dependencies )) ; then - # Ensure that the local npm package can be require()'d. - (cd $LEXICAL_MODELS_TYPES && npm link .) || fail "Could not link lexical-model-types" - - npm install || fail "Could not download dependencies." + verify_npm_setup true || fail "Could not setup dependencies." fi if [ -n "$publish_version" ]; then diff --git a/developer/js/package.json b/developer/js/package.json index 31b8ee6f30..1ab196e673 100644 --- a/developer/js/package.json +++ b/developer/js/package.json @@ -12,7 +12,6 @@ "scripts": { "build": "tsc", "test": "mocha", - "install": "npm link @keymanapp/lexical-model-types", "prepublishOnly": "npm run build" }, "repository": { @@ -38,6 +37,7 @@ "node": ">=12.0.0" }, "dependencies": { + "@keymanapp/lexical-model-types": "^0.0.0", "commander": "^3.0.0", "typescript": "^3.2.4", "xml2js": "^0.4.19" @@ -47,6 +47,7 @@ "@types/mocha": "^5.2.7", "@types/node": "^10.14.6", "@types/xml2js": "^0.4.5", + "@keymanapp/lexical-model-layer": "^14.0.0", "chai": "^4.2.0", "chalk": "^2.4.2", "jszip": "^2.5.0", diff --git a/developer/js/tests/test-join-word-breaker.ts b/developer/js/tests/test-join-word-breaker.ts index 9a54e1fd66..22707729da 100644 --- a/developer/js/tests/test-join-word-breaker.ts +++ b/developer/js/tests/test-join-word-breaker.ts @@ -13,18 +13,18 @@ describe('The join word breaker decorator', function () { const TEST_CASES: [string, string[], string[], string[]][] = [ /* input, joiners, default breaks, breaks with joins */ // Original test case from https://github.com/keymanapp/keyman/issues/2753 - ['khui-chhùi', ['-'], ["khui", "-", "chhùi"], ["khui-chhùi"]], + ['khui-chhùi', ['-'], ["khui", "-", "chhùi"], ["khui-chhùi"]], - // Plains Cree SRO: + // Plains Cree SRO: ['ê-kotiskâwêyâhk', ['-'], ['ê', '-', 'kotiskâwêyâhk'], ['ê-kotiskâwêyâhk']], // Edge cases: // Joiner alone: ['-', ['-'], ['-'], ['-']], - // Joiner at the end: + // Joiner at the end: ['ni-', ['-'], ['ni', '-'], ['ni-']], - // Joiner at the end: + // Joiner at the end: ['-ân', ['-'], ['-', 'ân'], ['-ân']], // This was my guiding test case: @@ -45,8 +45,8 @@ describe('The join word breaker decorator', function () { ["Email", ":", "no", "-", "body", "@", "example.com"], ["Email", ":", "no-body@example.com"] ], - - // Joining with two or more joiners in a row + + // Joining with two or more joiners in a row [ "nobody@@example.com", ["@"], @@ -96,4 +96,4 @@ describe('The join word breaker decorator', function () { function onlyText(span: Span) { return span.text; } -}); \ No newline at end of file +}); diff --git a/lerna.json b/lerna.json index 677b6d94d3..76b8b39a82 100644 --- a/lerna.json +++ b/lerna.json @@ -4,7 +4,8 @@ "common/core/web/keyboard-processor", "common/predictive-text", "common/lexical-model-types", - "web" + "web", + "developer/js" ], "version": "14.0.0" }