From 21744d0ed64c79842784988562b3e6b469551d71 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Mon, 9 May 2022 13:29:41 +1000 Subject: [PATCH 1/5] chore(web): fixup test paths Fixes some of the test paths required for core tests. --- common/core/web/input-processor/test.sh | 22 +++++++--- .../tests/cases/inputProcessor.js | 8 ++-- .../web/keyboard-processor/src/tsconfig.json | 3 +- common/core/web/tools/recorder/src/build.sh | 4 +- common/core/web/tools/recorder/src/index.ts | 15 ++++--- .../web/tools/recorder/src/nodeProctor.ts | 2 - .../recorder/src/nodeProctor.tsconfig.json | 34 ++++++++++------ .../core/web/tools/recorder/src/tsconfig.json | 34 ++++++++++------ web/source/build_dev_resources.sh | 4 +- web/source/tsconfig.dev_resources.json | 35 ++++++++++------ web/tools/recorder/browserDriver.ts | 4 +- web/tools/recorder/build.sh | 4 +- web/tools/recorder/scribe.ts | 40 +++++++++---------- web/tools/recorder/tsconfig.json | 32 ++++++++++----- web/unit_tests/test.sh | 2 +- 15 files changed, 143 insertions(+), 100 deletions(-) diff --git a/common/core/web/input-processor/test.sh b/common/core/web/input-processor/test.sh index a3c46c65cfe..1eb9c2e118d 100755 --- a/common/core/web/input-processor/test.sh +++ b/common/core/web/input-processor/test.sh @@ -54,22 +54,32 @@ if [ $FETCH_DEPS = true ]; then fi # Ensures that the lexical model compiler has been built locally. -echo_heading "Preparing Lexical Model Compiler for test use" -pushd $WORKING_DIRECTORY/node_modules/@keymanapp/lexical-model-compiler -npm run build -popd +#echo_heading "Preparing Lexical Model Compiler for test use" +#pushd $WORKING_DIRECTORY/node_modules/@keymanapp/lexical-model-compiler +#npm run build +#popd test-headless ( ) { if (( CI_REPORTING )); then FLAGS="$FLAGS --reporter mocha-teamcity-reporter" fi - npm run mocha -- --recursive $FLAGS ./tests/cases/ + # Poor Man's Modules until we support ES6 throughout + PREPEND=./tests/cases/prepend.js + (cat ../../../../resources/web-environment/build/index.js; echo) > $PREPEND + (cat ../utils/build/index.js; echo) >> $PREPEND + (cat ../keyboard-processor/build/index.js; echo) >> $PREPEND + (cat ../input-processor/build/index.js; echo) >> $PREPEND + (cat tests/cases/inputProcessor.js; echo) >> $PREPEND + + npm run mocha -- --recursive $FLAGS ./tests/cases/prepend.js + + rm $PREPEND } if [ $FETCH_DEPS = true ]; then # First, run tests on the keyboard processor. - pushd $WORKING_DIRECTORY/node_modules/@keymanapp/keyboard-processor + pushd "$KEYMAN_ROOT/common/core/web/keyboard-processor" ./test.sh -skip-package-install || fail "Tests failed by dependencies; aborting integration tests." popd fi diff --git a/common/core/web/input-processor/tests/cases/inputProcessor.js b/common/core/web/input-processor/tests/cases/inputProcessor.js index e885817e10d..e7edec394f5 100644 --- a/common/core/web/input-processor/tests/cases/inputProcessor.js +++ b/common/core/web/input-processor/tests/cases/inputProcessor.js @@ -2,13 +2,15 @@ var assert = require('chai').assert; var fs = require("fs"); var vm = require("vm"); -let InputProcessor = require('../../dist'); +//let InputProcessor = require('../../build'); // Required initialization setup. -global.com = InputProcessor.com; // exports all keyboard-processor namespacing. +//global.com = InputProcessor.com; // exports all keyboard-processor namespacing. global.keyman = {}; // So that keyboard-based checks against the global `keyman` succeed. // 10.0+ dependent keyboards, like khmer_angkor, will otherwise fail to load. +let InputProcessor = com.keyman.text.InputProcessor; + let device = { formFactor: 'phone', OS: 'ios', @@ -55,7 +57,7 @@ describe('InputProcessor', function() { var keyboard; // Easy peasy long context: use the input processor's full source! - let coreSourceCode = fs.readFileSync('dist/index.js', 'utf-8'); + let coreSourceCode = fs.readFileSync('build/index.js', 'utf-8'); // At the time this test block was written... 810485 chars. // Let's force it to the same order of magnitude, even if the codebase grows. diff --git a/common/core/web/keyboard-processor/src/tsconfig.json b/common/core/web/keyboard-processor/src/tsconfig.json index 57a98fa4d9e..b58a6b509fc 100644 --- a/common/core/web/keyboard-processor/src/tsconfig.json +++ b/common/core/web/keyboard-processor/src/tsconfig.json @@ -10,7 +10,8 @@ "target": "es5", "types": ["node"], "lib": ["es6"], - "outFile": "../build/index.js" + "outFile": "../build/index.js", + "experimentalDecorators": true, }, "references": [ { "path": "../../../../../common/models/types" }, diff --git a/common/core/web/tools/recorder/src/build.sh b/common/core/web/tools/recorder/src/build.sh index f8b44bf529f..87c4606f333 100755 --- a/common/core/web/tools/recorder/src/build.sh +++ b/common/core/web/tools/recorder/src/build.sh @@ -57,12 +57,12 @@ PATH="../node_modules/.bin:$PATH" compiler="npm run tsc --" compilecmd="$compiler" -$compilecmd -p "$SCRIPT_DIR/tsconfig.json" +$compilecmd --build "$SCRIPT_DIR/tsconfig.json" if [ $? -ne 0 ]; then fail "KeymanWeb recorder-core compilation failed." fi -$compilecmd -p "$SCRIPT_DIR/nodeProctor.tsconfig.json" +$compilecmd --build "$SCRIPT_DIR/nodeProctor.tsconfig.json" if [ $? -ne 0 ]; then fail "Node-based unit-test Proctor compilation failed." fi diff --git a/common/core/web/tools/recorder/src/index.ts b/common/core/web/tools/recorder/src/index.ts index 60cf7ad0b1e..35c228c26c6 100644 --- a/common/core/web/tools/recorder/src/index.ts +++ b/common/core/web/tools/recorder/src/index.ts @@ -1,4 +1,3 @@ -/// /// namespace KMWRecorder { @@ -92,7 +91,7 @@ namespace KMWRecorder { static fromJSONObject(obj: any): RecordedKeystroke { if(obj && obj.type) { if(obj.type == "key") { - return new RecordedPhysicalKeystroke(obj as RecordedPhysicalKeystroke); + return new RecordedPhysicalKeystroke(obj as RecordedPhysicalKeystroke); } else if(obj && obj.type) { return new RecordedSyntheticKeystroke(obj as RecordedSyntheticKeystroke); } @@ -375,7 +374,7 @@ namespace KMWRecorder { this.id = activeStub.KLC; this.name = activeStub.KL; this.region = activeStub.KR; - + // Fonts. if(activeStub.KFont) { this.font = new FontStubForLanguage(activeStub.KFont); @@ -515,7 +514,7 @@ namespace KMWRecorder { this.result = output; } } - + export interface TestSet> { constraint: Constraint; @@ -649,7 +648,7 @@ namespace KMWRecorder { public specVersion: com.keyman.utils.Version = KeyboardTest.CURRENT_VERSION; /** - * The version of KMW in which the Recorder was first written. Worked from 10.0 to 13.0 with + * The version of KMW in which the Recorder was first written. Worked from 10.0 to 13.0 with * only backward-compatible changes and minor tweaks to conform to internal API shifts. */ public static readonly FALLBACK_VERSION = new com.keyman.utils.Version("10.0"); @@ -667,8 +666,8 @@ namespace KMWRecorder { inputTestSets: TestSet[]; /** - * Reconstructs a KeyboardTest object from its JSON representation, restoring its methods. - * @param fromJSON + * Reconstructs a KeyboardTest object from its JSON representation, restoring its methods. + * @param fromJSON */ constructor(fromJSON?: string|KeyboardStub|KeyboardTest) { if(!fromJSON) { @@ -720,7 +719,7 @@ namespace KMWRecorder { var newSet = new RecordedSequenceTestSet(new Constraint(constraint)); this.inputTestSets.push(newSet); - newSet.addTest(seq); + newSet.addTest(seq); } test(proctor: Proctor) { diff --git a/common/core/web/tools/recorder/src/nodeProctor.ts b/common/core/web/tools/recorder/src/nodeProctor.ts index 39dcae47463..0ae4b5adcc5 100644 --- a/common/core/web/tools/recorder/src/nodeProctor.ts +++ b/common/core/web/tools/recorder/src/nodeProctor.ts @@ -1,5 +1,3 @@ -/// -/// namespace KMWRecorder { export class NodeProctor extends Proctor { diff --git a/common/core/web/tools/recorder/src/nodeProctor.tsconfig.json b/common/core/web/tools/recorder/src/nodeProctor.tsconfig.json index d13317335d3..39bc1464d32 100644 --- a/common/core/web/tools/recorder/src/nodeProctor.tsconfig.json +++ b/common/core/web/tools/recorder/src/nodeProctor.tsconfig.json @@ -1,19 +1,27 @@ { + "extends": "../../../../../../tsconfig-base.json", + "compilerOptions": { - "allowJs": true, - "module": "none", - "outDir": "../dist/", - "inlineSources": true, - "inlineSourceMap": true, - "target": "es5", - "types": ["node"], - "lib": ["es6"], - "outFile": "../dist/nodeProctor.js" + "allowJs": true, + "module": "none", + "outDir": "../dist/", + "inlineSources": true, + "inlineSourceMap": true, + "target": "es5", + "types": ["node"], + "lib": ["es6"], + "outFile": "../dist/nodeProctor.js" }, + "files": [ - "../node_modules/@keymanapp/models-types/index.d.ts", - "../node_modules/@keymanapp/web-environment/environment.inc.ts", - "../node_modules/@keymanapp/web-utils/src/index.ts", - "nodeProctor.ts" + "nodeProctor.ts" + ], + + "references": [ + { "path": "../../../../../../resources/web-environment" }, + { "path": "../../../../../../common/core/web/utils" }, + { "path": "../../../../../../common/core/web/keyboard-processor/src" }, + { "path": "../../../../../../common/web/lm-message-types" }, + { "path": "./tsconfig.json" } ] } diff --git a/common/core/web/tools/recorder/src/tsconfig.json b/common/core/web/tools/recorder/src/tsconfig.json index 55a709583bd..714b0175ad3 100644 --- a/common/core/web/tools/recorder/src/tsconfig.json +++ b/common/core/web/tools/recorder/src/tsconfig.json @@ -1,19 +1,27 @@ { + "extends": "../../../../../../tsconfig-base.json", + "compilerOptions": { - "allowJs": true, - "module": "none", - "outDir": "../build/", - "inlineSources": true, - "inlineSourceMap": true, - "target": "es5", - "types": ["node"], - "lib": ["es6"], - "outFile": "../build/index.js" + "allowJs": true, + "module": "none", + "outDir": "../build/", + "inlineSources": true, + "inlineSourceMap": true, + "target": "es5", + "types": ["node"], + "lib": ["es6"], + "outFile": "../build/index.js" }, + "files": [ - "../node_modules/@keymanapp/models-types/index.d.ts", - "../node_modules/@keymanapp/web-environment/environment.inc.ts", - "../node_modules/@keymanapp/web-utils/src/index.ts", - "index.ts" + "index.ts", + "proctor.ts" + ], + + "references": [ + { "path": "../../../../../../resources/web-environment" }, + { "path": "../../../../../../common/core/web/utils" }, + { "path": "../../../../../../common/core/web/keyboard-processor/src" }, + { "path": "../../../../../../common/web/lm-message-types" } ] } diff --git a/web/source/build_dev_resources.sh b/web/source/build_dev_resources.sh index 6dde04fdb8f..1f113c91914 100755 --- a/web/source/build_dev_resources.sh +++ b/web/source/build_dev_resources.sh @@ -1,5 +1,5 @@ #! /bin/bash -# +# # Compiles development-related KeymanWeb resources for use with developing/running tests. # - the Recorder module (for engine tests) # - the DOM module (for touch-alias and element-interface tests) @@ -49,7 +49,7 @@ compilecmd="$compiler" for (( n=0; n<$PRODUCT_COUNT; n++ )) # Apparently, args ends up zero-based, meaning $2 => n=1. do - $compilecmd -p $NODE_SOURCE/tsconfig.${SCRIPT_TAGS[$n]}.json + $compilecmd --build $NODE_SOURCE/tsconfig.${SCRIPT_TAGS[$n]}.json if [ $? -ne 0 ]; then fail "Typescript compilation failed for '${SCRIPT_TAGS[$n]}'." fi diff --git a/web/source/tsconfig.dev_resources.json b/web/source/tsconfig.dev_resources.json index c3510167fae..02a76fc8793 100644 --- a/web/source/tsconfig.dev_resources.json +++ b/web/source/tsconfig.dev_resources.json @@ -1,17 +1,28 @@ { + "extends": "../../tsconfig-base.json", + "compilerOptions": { - "allowJs": true, - "inlineSources": true, - "module": "none", - "outFile": "../release/dev_resources/dev_resources.js", - "sourceMap": true, - "target": "es5" - }, + "allowJs": true, + "inlineSources": true, + "module": "none", + "outFile": "../release/dev_resources/dev_resources.js", + "sourceMap": true, + "target": "es5" + }, + "files": [ - "../node_modules/@keymanapp/keyboard-processor/src/text/outputTarget.ts", - "../node_modules/@keymanapp/web-environment/environment.inc.ts", - "../node_modules/@keymanapp/web-utils/src/index.ts", - "../node_modules/@keymanapp/lexical-model-layer/message.d.ts", - "dom/targets/wrapElement.ts" + "dom/targets/wrapElement.ts", + "dom/targets/input.ts", + "dom/targets/textarea.ts", + "dom/targets/contentEditable.ts", + "dom/targets/designIFrame.ts", + "dom/targets/touchAlias.ts", + ], + + "references": [ + { "path": "../../common/core/web/keyboard-processor/src" }, + { "path": "../../resources/web-environment" }, + { "path": "../../common/core/web/utils" }, + { "path": "../../common/web/lm-message-types" } ] } diff --git a/web/tools/recorder/browserDriver.ts b/web/tools/recorder/browserDriver.ts index 4922a998afe..83e062d7f1e 100644 --- a/web/tools/recorder/browserDriver.ts +++ b/web/tools/recorder/browserDriver.ts @@ -1,5 +1,3 @@ -/// - namespace KMWRecorder { export class BrowserDriver { static readonly physicalEventClass: string = "KeyboardEvent"; @@ -44,7 +42,7 @@ namespace KMWRecorder { event = document.createEvent(BrowserDriver.physicalEventClass); // An override to ensure that IE's method gets called. // Many thanks to https://gist.github.com/termi/4654819, line 142 at the time of writing this. - var success = (event).initKeyboardEvent(BrowserDriver.physicalEventType, false, true, null, eventSpec.key, /*this.code,*/ eventSpec.location, + var success = (event).initKeyboardEvent(BrowserDriver.physicalEventType, false, true, null, eventSpec.key, /*this.code,*/ eventSpec.location, eventSpec.generateModifierString(), 0, 0); } diff --git a/web/tools/recorder/build.sh b/web/tools/recorder/build.sh index 7d90e803843..efefa4018e0 100755 --- a/web/tools/recorder/build.sh +++ b/web/tools/recorder/build.sh @@ -1,5 +1,5 @@ #! /bin/bash -# +# # Compiles development-related KeymanWeb resources for use with developing/running tests. # - the Recorder module (for engine tests) # - the DOM module (for touch-alias and element-interface tests) @@ -35,7 +35,7 @@ popd compiler="npm run tsc --" compilecmd="$compiler" -$compilecmd -p "$SCRIPT_DIR/tsconfig.json" +$compilecmd --build "$SCRIPT_DIR/tsconfig.json" if [ $? -ne 0 ]; then fail "KeymanWeb test sequence recorder compilation failed." fi diff --git a/web/tools/recorder/scribe.ts b/web/tools/recorder/scribe.ts index 073f344721f..70885d51164 100644 --- a/web/tools/recorder/scribe.ts +++ b/web/tools/recorder/scribe.ts @@ -1,22 +1,20 @@ -/// -/// //Since TS won't recognize the types b/c no "import"/"require" statements. // A small-scale manual definition. -declare class EventEmitter { - /** Add a listener for a given event */ - on(event: string, func: (...args: any[]) => boolean, context?: any); - /** Add a one-time listener for a given event */ - once(event: string, func: (...args: any[]) => boolean, context?: any); - removeListener(event: string, func: (...args: any[]) => boolean, context?: any, once?: boolean); - - // Defines their alternately-themed aliases. - addListener: typeof EventEmitter.prototype.on; - off: typeof EventEmitter.prototype.removeListener; - - // Defines the actual event-raising function. - emit(eventName: string, ...args: any[]); -} +// declare class EventEmitter { +// /** Add a listener for a given event */ +// on(event: string, func: (...args: any[]) => boolean, context?: any); +// /** Add a one-time listener for a given event */ +// once(event: string, func: (...args: any[]) => boolean, context?: any); +// removeListener(event: string, func: (...args: any[]) => boolean, context?: any, once?: boolean); + +// // Defines their alternately-themed aliases. +// addListener: typeof EventEmitter.prototype.on; +// off: typeof EventEmitter.prototype.removeListener; + +// // Defines the actual event-raising function. +// emit(eventName: string, ...args: any[]); +// } // Makes sure the code below knows that the namespaces exist. namespace com.keyman { @@ -35,8 +33,8 @@ namespace com.keyman { namespace KMWRecorder { /** - * Contains browser-dependent code used to transcribe browser-based events - * so that thay may be reconstructed for use in KMW testing. + * Contains browser-dependent code used to transcribe browser-based events + * so that thay may be reconstructed for use in KMW testing. */ export class Scribe extends EventEmitter { //#region Static methods for recording input events @@ -155,7 +153,7 @@ namespace KMWRecorder { } else { delete this.currentSequence.msg; } - + this.raiseRecordChanged(); } @@ -196,7 +194,7 @@ namespace KMWRecorder { window.setTimeout(function() { recorderScribe.addInputRecord(recording, in_output.getText()); }, 1); - + return retVal; } @@ -244,7 +242,7 @@ namespace KMWRecorder { recorderScribe.emit('stub-changed', JSON.stringify(kbdRecord)); // var ta_activeStub = document.getElementById('activeStub'); // ta_activeStub.value = JSON.stringify(kbdRecord); - + if(!sameKbd && !recorderScribe.keyboardJustActivated) { recorderScribe.testDefinition = new KMWRecorder.KeyboardTest(kbdRecord); } diff --git a/web/tools/recorder/tsconfig.json b/web/tools/recorder/tsconfig.json index 1b29c715ea6..d9d74c437ae 100644 --- a/web/tools/recorder/tsconfig.json +++ b/web/tools/recorder/tsconfig.json @@ -1,16 +1,26 @@ { + "extends": "../../../tsconfig-base.json", "compilerOptions": { - "allowJs": true, - "inlineSources": true, - "module": "none", - "outFile": "build/recorder_InputEvents.js", - "sourceMap": true, - "target": "es5" - }, + "allowJs": true, + "inlineSources": true, + "module": "none", + "outFile": "build/recorder_InputEvents.js", + "sourceMap": true, + "target": "es5" + }, + "files": [ - "../../node_modules/@keymanapp/web-environment/environment.inc.ts", - "../../node_modules/@keymanapp/web-utils/src/index.ts", - "../../node_modules/@keymanapp/lexical-model-layer/message.d.ts", - "browserProctor.ts" + "browserProctor.ts", + "browserDriver.ts", + "scribe.ts" + ], + + "references": [ + { "path": "../../../resources/web-environment" }, + { "path": "../../../common/core/web/utils" }, + { "path": "../../../common/core/web/keyboard-processor/src" }, + { "path": "../../../common/core/web/input-processor/src" }, + { "path": "../../../common/core/web/tools/recorder/src" }, + { "path": "../../../common/web/lm-message-types" } ] } diff --git a/web/unit_tests/test.sh b/web/unit_tests/test.sh index 1a3389652d1..c4acc052355 100755 --- a/web/unit_tests/test.sh +++ b/web/unit_tests/test.sh @@ -129,7 +129,7 @@ cd ../tools/recorder # Run our headless tests first. # First: Web-core tests. -pushd $WORKING_DIRECTORY/node_modules/@keymanapp/input-processor +pushd "$KEYMAN_ROOT/common/core/web/input-processor" ./test.sh $HEADLESS_FLAGS || fail "Tests failed by dependencies; aborting integration tests." # Once done, now we run the integrated (KeymanWeb) tests. popd From 907d4acba13635ae073210ac7e1e8b5ee8a6ae06 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Mon, 9 May 2022 13:31:32 +1000 Subject: [PATCH 2/5] chore(web): make getters enumerable Ref https://github.com/microsoft/TypeScript/pull/32264#issuecomment-677718191 We need getters for the ActiveLayout classes to be enumerable so that we can copy them across in the polyfill functions. --- .../src/keyboards/activeLayout.ts | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/common/core/web/keyboard-processor/src/keyboards/activeLayout.ts b/common/core/web/keyboard-processor/src/keyboards/activeLayout.ts index ac9647cdd37..c5d83448e4e 100644 --- a/common/core/web/keyboard-processor/src/keyboards/activeLayout.ts +++ b/common/core/web/keyboard-processor/src/keyboards/activeLayout.ts @@ -1,6 +1,18 @@ namespace com.keyman.keyboards { type KeyDistribution = text.KeyDistribution; + // TS 3.9 changed behavior of getters to make them + // non-enumerable by default. This broke our 'polyfill' + // functions which depended on enumeration to copy the + // relevant props over. + // https://github.com/microsoft/TypeScript/pull/32264#issuecomment-677718191 + function Enumerable( + target: unknown, + propertyKey: string, + descriptor: PropertyDescriptor + ) { + descriptor.enumerable = true; + }; export class ActiveKey implements LayoutKey { @@ -52,6 +64,7 @@ namespace com.keyman.keyboards { * * Is used to determine the keycode for input events, rule-matching, and keystroke processing. */ + @Enumerable public get baseKeyID(): string { if(typeof this.id === 'undefined') { return undefined; @@ -78,6 +91,7 @@ namespace com.keyman.keyboards { * * Useful when the active layer of an input-event is already known. */ + @Enumerable public get coreID(): string { if(typeof this.id === 'undefined') { return undefined; @@ -110,6 +124,7 @@ namespace com.keyman.keyboards { * * Useful when only the active keyboard is known about an input event. */ + @Enumerable public get elementID(): string { if(typeof this.id === 'undefined') { return undefined; From f7a0b3d3983d4f76728c15154b916518355a985b Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 10 May 2022 10:22:12 +1000 Subject: [PATCH 3/5] chore(web): fixup keyboard-processor tests Uses poor man's module mode (i.e. appending .js files) to avoid module issues with the changeover from Lerna to NPM and tsc -b for builds. We will revisit this once the builds have stabilised. --- common/core/web/input-processor/test.sh | 4 ++ .../tests/cases/inputProcessor.js | 3 -- common/core/web/keyboard-processor/test.sh | 40 ++++++++++++++--- .../tests/cases/basic-engine.js | 10 ++--- .../tests/cases/basic-init.js | 11 ++--- .../tests/cases/chirality.js | 10 ++--- .../tests/cases/deadkeys.js | 11 ++--- .../tests/cases/engine/context.js | 43 ++++++++++--------- .../tests/cases/engine/notany_context.js | 19 +++----- .../tests/cases/engine/stores.js | 21 ++++++--- .../cases/engine/unmatched_final_group.js | 8 ++-- .../tests/cases/transcriptions.js | 19 ++++---- .../tests/cases/versions.js | 9 ++-- .../recorder/src/nodeProctor.tsconfig.json | 11 ++--- 14 files changed, 127 insertions(+), 92 deletions(-) diff --git a/common/core/web/input-processor/test.sh b/common/core/web/input-processor/test.sh index 1eb9c2e118d..b2d9bf0d525 100755 --- a/common/core/web/input-processor/test.sh +++ b/common/core/web/input-processor/test.sh @@ -72,6 +72,10 @@ test-headless ( ) { (cat ../input-processor/build/index.js; echo) >> $PREPEND (cat tests/cases/inputProcessor.js; echo) >> $PREPEND + # TODO: We will re-enable languageProcessor tests when we have sorted out + # paths and modules for lmc + #(cat tests/cases/languageProcessor.js; echo) >> $PREPEND + npm run mocha -- --recursive $FLAGS ./tests/cases/prepend.js rm $PREPEND diff --git a/common/core/web/input-processor/tests/cases/inputProcessor.js b/common/core/web/input-processor/tests/cases/inputProcessor.js index e7edec394f5..4fd7fde4b89 100644 --- a/common/core/web/input-processor/tests/cases/inputProcessor.js +++ b/common/core/web/input-processor/tests/cases/inputProcessor.js @@ -2,10 +2,7 @@ var assert = require('chai').assert; var fs = require("fs"); var vm = require("vm"); -//let InputProcessor = require('../../build'); - // Required initialization setup. -//global.com = InputProcessor.com; // exports all keyboard-processor namespacing. global.keyman = {}; // So that keyboard-based checks against the global `keyman` succeed. // 10.0+ dependent keyboards, like khmer_angkor, will otherwise fail to load. diff --git a/common/core/web/keyboard-processor/test.sh b/common/core/web/keyboard-processor/test.sh index ae82949fadc..909ffdabfb7 100755 --- a/common/core/web/keyboard-processor/test.sh +++ b/common/core/web/keyboard-processor/test.sh @@ -55,13 +55,43 @@ test-headless ( ) { FLAGS="$FLAGS --reporter mocha-teamcity-reporter" fi - npm run mocha -- --recursive $FLAGS ./tests/cases/ + # Poor Man's Modules until we support ES6 throughout + PREPEND=./tests/cases/prepend.js + rm -f $PREPEND + for n in tests/cases/*.js; do + echo $n + (cat ../../../../resources/web-environment/build/index.js; echo) > $PREPEND + (cat ../utils/build/index.js; echo) >> $PREPEND + (cat ../tools/recorder/build/nodeProctor/index.js; echo) >> $PREPEND + (cat ../keyboard-processor/build/index.js; echo) >> $PREPEND + (cat $n; echo) >> $PREPEND; + npm run mocha -- --recursive $FLAGS $PREPEND || die + rm $PREPEND + done + + # Poor Man's Modules until we support ES6 throughout + PREPEND=./tests/cases/engine/prepend.js + rm -f $PREPEND + for n in tests/cases/engine/*.js; do + echo $n + (cat ../../../../resources/web-environment/build/index.js; echo) > $PREPEND + (cat ../utils/build/index.js; echo) >> $PREPEND + (cat ../tools/recorder/build/nodeProctor/index.js; echo) >> $PREPEND + (cat ../keyboard-processor/build/index.js; echo) >> $PREPEND + (cat $n; echo) >> $PREPEND; + npm run mocha -- --recursive $FLAGS $PREPEND || die + rm $PREPEND + done + + # npm run mocha -- --recursive $FLAGS ./tests/cases/ } -# Build test dependency -pushd "$KEYMAN_ROOT/common/core/web/tools/recorder/src" -./build.sh -skip-package-install || fail "recorder-core compilation failed." -popd +if [ $FETCH_DEPS = true ]; then + # Build test dependency + pushd "$KEYMAN_ROOT/common/core/web/tools/recorder/src" + ./build.sh -skip-package-install || fail "recorder-core compilation failed." + popd +fi # Run headless (browserless) tests. echo_heading "Running Keyboard Processor test suite" diff --git a/common/core/web/keyboard-processor/tests/cases/basic-engine.js b/common/core/web/keyboard-processor/tests/cases/basic-engine.js index b04b1619bbe..809d110d5c1 100644 --- a/common/core/web/keyboard-processor/tests/cases/basic-engine.js +++ b/common/core/web/keyboard-processor/tests/cases/basic-engine.js @@ -2,11 +2,11 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = require('../../dist'); -let KMWRecorder = require('../../../tools/recorder/dist/nodeProctor'); +let KeyboardProcessor = com.keyman.text.KeyboardProcessor; +global.keyman = {}; -// Required initialization setup. -global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. +// Initialize supplementary plane string extensions +String.kmwEnableSupplementaryPlane(false); describe('Engine - Basic Simulation', function() { let testJSONtext = fs.readFileSync('../tests/resources/json/engine_tests/basic_lao_simulation.json'); @@ -41,7 +41,7 @@ describe('Engine - Basic Simulation', function() { // Converts each test set into its own Mocha-level test. for(let set of testSuite.inputTestSets) { let proctor = new KMWRecorder.NodeProctor(keyboard, device, assert.equal); - + if(!proctor.compatibleWithSuite(testSuite)) { it.skip(set.toTestName() + " - Cannot run this test suite on Node."); } else { diff --git a/common/core/web/keyboard-processor/tests/cases/basic-init.js b/common/core/web/keyboard-processor/tests/cases/basic-init.js index c1ed7f6f07e..a7891043628 100644 --- a/common/core/web/keyboard-processor/tests/cases/basic-init.js +++ b/common/core/web/keyboard-processor/tests/cases/basic-init.js @@ -2,15 +2,12 @@ var assert = require('chai').assert; var fs = require("fs"); var vm = require("vm"); -let KeyboardProcessor = require('../../dist'); - -// Required initialization setup. -global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. -global.keyman = {}; // So that keyboard-based checks against the global `keyman` succeed. - // 10.0+ dependent keyboards, like khmer_angkor, will otherwise fail to load. +let KeyboardProcessor = com.keyman.text.KeyboardProcessor; +global.keyman = {}; +global.com = com; // Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); +String.kmwEnableSupplementaryPlane(false); // Test the KeyboardProcessor interface. describe('KeyboardProcessor', function() { diff --git a/common/core/web/keyboard-processor/tests/cases/chirality.js b/common/core/web/keyboard-processor/tests/cases/chirality.js index 251ef39d035..c6406c99281 100644 --- a/common/core/web/keyboard-processor/tests/cases/chirality.js +++ b/common/core/web/keyboard-processor/tests/cases/chirality.js @@ -2,11 +2,11 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = require('../../dist'); -let KMWRecorder = require('../../../tools/recorder/dist/nodeProctor'); +let KeyboardProcessor = com.keyman.text.KeyboardProcessor; +global.keyman = {}; -// Required initialization setup. -global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. +// Initialize supplementary plane string extensions +String.kmwEnableSupplementaryPlane(false); describe('Engine - Chirality', function() { let testJSONtext = fs.readFileSync('../tests/resources/json/engine_tests/chirality.json'); @@ -41,7 +41,7 @@ describe('Engine - Chirality', function() { // Converts each test set into its own Mocha-level test. for(let set of testSuite.inputTestSets) { let proctor = new KMWRecorder.NodeProctor(keyboard, device, assert.equal); - + if(!proctor.compatibleWithSuite(testSuite)) { it.skip(set.toTestName() + " - Cannot run this test suite on Node."); } else if(set.constraint.target == 'hardware') { diff --git a/common/core/web/keyboard-processor/tests/cases/deadkeys.js b/common/core/web/keyboard-processor/tests/cases/deadkeys.js index c77300983d8..939b7040980 100644 --- a/common/core/web/keyboard-processor/tests/cases/deadkeys.js +++ b/common/core/web/keyboard-processor/tests/cases/deadkeys.js @@ -2,11 +2,12 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = require('../../dist'); -let KMWRecorder = require('../../../tools/recorder/dist/nodeProctor'); +let KeyboardProcessor = com.keyman.text.KeyboardProcessor; +global.keyman = {}; +global.com = com; -// Required initialization setup. -global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. +// Initialize supplementary plane string extensions +String.kmwEnableSupplementaryPlane(false); describe('Engine - Deadkeys', function() { let testJSONtext = fs.readFileSync('../tests/resources/json/engine_tests/deadkeys.json'); @@ -41,7 +42,7 @@ describe('Engine - Deadkeys', function() { // Converts each test set into its own Mocha-level test. for(let set of testSuite.inputTestSets) { let proctor = new KMWRecorder.NodeProctor(keyboard, device, assert.equal); - + if(!proctor.compatibleWithSuite(testSuite)) { it.skip(set.toTestName() + " - Cannot run this test suite on Node."); } else { diff --git a/common/core/web/keyboard-processor/tests/cases/engine/context.js b/common/core/web/keyboard-processor/tests/cases/engine/context.js index 646cb9dadd3..65bc4336f21 100644 --- a/common/core/web/keyboard-processor/tests/cases/engine/context.js +++ b/common/core/web/keyboard-processor/tests/cases/engine/context.js @@ -2,22 +2,26 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = require('../../../dist'); -let KMWRecorder = require('../../../../tools/recorder/dist/nodeProctor'); +let KeyboardProcessor = com.keyman.text.KeyboardProcessor; +global.keyman = {}; +global.com = com; -/* +// Initialize supplementary plane string extensions +String.kmwEnableSupplementaryPlane(false); + +/* * ABOUT THIS TEST SUITE * --------------------- - * + * * This suite contains two types of tests, both designed to test all possible variations * of behaviors that `KeyboardInterface.fullContextMatch` may be expected to handle. - * + * * Type 1: White-box tests for validity of the generated context-cache * - uses only the `baseSequence` of each test spec definition; does not * use any `fullMatchDefs` entries. * - uses the specified `contextCache` entry of each test spec in assertions * - CTRL+F `Tests "stage 1" of fullContextMatch` for more details. - * + * * Type 2: Black-box rule-matching tests * - uses both `baseSequence` and `fullMatchDefs` entries of a test spec * - tests that each simulation sequence's output either passes or fails against @@ -26,9 +30,6 @@ let KMWRecorder = require('../../../../tools/recorder/dist/nodeProctor'); * It should be a removable limitation, though. */ -// Required initialization setup. -global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. - let device = { formFactor: 'desktop', OS: 'windows', @@ -68,12 +69,13 @@ function runEngineRuleSet(ruleSet, defaultNoun) { // Now for the real test! let processor = new KeyboardProcessor(); + processor.device = device; processor.activeKeyboard = keyboard; var res = processor.keyboardInterface.fullContextMatch(ruleDef.n, target, ruleDef.rule); var msg = matchTest.msg; if(!msg) { - msg = defaultNoun + " incorrectly reported as " + (matchTest.result ? "unmatched!" : "matched!"); + msg = defaultNoun + " incorrectly reported as " + (matchTest.result ? "unmatched!" : "matched!"); } assert.equal(res, matchTest.result, msg); } @@ -463,7 +465,7 @@ var ANY_CONTEXT_TEST_2 = { * * store(ac) 'ac' * store(bc) 'bc' - * + * * 'c' any(ac) any(bc) context(3) context(2) > 'success' */ var ANY_CONTEXT_TEST_3 = { @@ -520,7 +522,7 @@ var ANY_CONTEXT_TEST_3 = { * * store(ab) 'ab' * store(bc) 'bc' - * + * * 'c' any(ab) index(bc, 2) 'a' > 'success' */ var ANY_INDEX_TEST_1 = { @@ -567,7 +569,7 @@ var ANY_INDEX_TEST_1 = { * * store(ab) 'ab' * store(bc) 'bc' - * + * * 'c' any(ab) index(bc, 2) index(bc, 2) index(ab, 2) > 'success' */ var ANY_INDEX_TEST_2 = { @@ -614,7 +616,7 @@ var ANY_INDEX_TEST_2 = { * * store(ab) 'ab' * store(bc) 'bc' - * + * * 'c' any(ab) any(bc) index(bc, 3) index(ab, 2) > 'success' */ var ANY_INDEX_TEST_3 = { @@ -747,7 +749,7 @@ var DEADKEY_STORE_TEST_2 = { * * store(match) dk(0) dk(1) dk(2) * store(abc) 'abc' - * + * * any(match) index(abc, 1) > 'success' */ var DEADKEY_STORE_TEST_3 = { @@ -880,7 +882,7 @@ var NOTANY_NUL_TEST_1 = { * * store(match) dk(0) dk(1) dk(2) * store(abc) 'abc' - * + * * notany(match) any(abc) > 'success' */ var NOTANY_NUL_TEST_2 = { @@ -917,7 +919,7 @@ var NOTANY_NUL_TEST_2 = { * * store(first) dk(0) 'b' dk(2) * store(second) 'a' dk(1) 'c' - * + * * notany(first) any(second) > 'success' */ var NOTANY_NUL_TEST_3 = { @@ -964,8 +966,8 @@ var NOTANY_NUL_TEST_3 = { }] }; -var DEADKEY_RULE_SET = [ DEADKEY_TEST_1, DEADKEY_TEST_2, DEADKEY_TEST_3, DEADKEY_TEST_4, - DEADKEY_TEST_5, DEADKEY_TEST_6 +var DEADKEY_RULE_SET = [ DEADKEY_TEST_1, DEADKEY_TEST_2, DEADKEY_TEST_3, DEADKEY_TEST_4, + DEADKEY_TEST_5, DEADKEY_TEST_6 ]; var ANY_CONTEXT_RULE_SET = [ ANY_CONTEXT_TEST_1, ANY_CONTEXT_TEST_2, ANY_CONTEXT_TEST_3 ]; var ANY_INDEX_RULE_SET = [ ANY_INDEX_TEST_1, ANY_INDEX_TEST_2, ANY_INDEX_TEST_3 ]; @@ -1007,6 +1009,7 @@ describe('Engine - Context Matching', function() { // Now for the real test! let processor = new KeyboardProcessor(); + processor.device = device; processor.activeKeyboard = keyboard; var res = processor.keyboardInterface._BuildExtendedContext(ruleDef.n, ruleDef.ln, target); @@ -1067,7 +1070,7 @@ describe('Engine - Context Matching', function() { runEngineRuleSet([ANY_INDEX_TEST_3]); }); }); - + describe('handles interactions with deadkeys in stores', function() { it('for any on pure deadkey store: DEADKEY_STORE_TEST_1', function() { runEngineRuleSet([DEADKEY_STORE_TEST_1]); diff --git a/common/core/web/keyboard-processor/tests/cases/engine/notany_context.js b/common/core/web/keyboard-processor/tests/cases/engine/notany_context.js index 1b502fa99b5..7db2d05feed 100644 --- a/common/core/web/keyboard-processor/tests/cases/engine/notany_context.js +++ b/common/core/web/keyboard-processor/tests/cases/engine/notany_context.js @@ -2,16 +2,11 @@ const assert = require('chai').assert; const fs = require('fs'); const vm = require('vm'); -const KeyboardProcessor = require('../../../dist'); -const KMWRecorder = require('../../../../tools/recorder/dist/nodeProctor'); - -// Required initialization setup. -global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. -global.keyman = {}; // So that keyboard-based checks against the global `keyman` succeed. - // 10.0+ dependent keyboards, like khmer_angkor, will otherwise fail to load. +let KeyboardProcessor = com.keyman.text.KeyboardProcessor; +global.keyman = {}; // Initialize supplementary plane string extensions -String.kmwEnableSupplementaryPlane(false); +String.kmwEnableSupplementaryPlane(false); const device = { formFactor: 'desktop', @@ -32,7 +27,7 @@ function runEngineRuleSet(ruleSet) { } /** - * Wrapper to simplify running tests -- supports either virtual key codes as string (e.g. 'A' is VK_A) + * Wrapper to simplify running tests -- supports either virtual key codes as string (e.g. 'A' is VK_A) * or an array of integers. Does not currently support modifiers (not needed here). * @param {String|Array} input Virtual key codes of each character (as string or array) * @param {String} output Expected output @@ -40,11 +35,11 @@ function runEngineRuleSet(ruleSet) { function runStringRuleSet(input, output) { const rule = { - "inputs": + "inputs": typeof input == 'string' - ? input.split("").map(ch => + ? input.split("").map(ch => { return { "type": "key", "keyCode": ch.charCodeAt(0), "states": 10752, "modifiers": 0, "modifierChanged": false, "isVirtualKey": true } }) - : input.map(ch => + : input.map(ch => { return { "type": "key", "keyCode": ch, "states": 10752, "modifiers": 0, "modifierChanged": false, "isVirtualKey": true } }), "output": output }; diff --git a/common/core/web/keyboard-processor/tests/cases/engine/stores.js b/common/core/web/keyboard-processor/tests/cases/engine/stores.js index 66f0a57b208..4b14748c20e 100644 --- a/common/core/web/keyboard-processor/tests/cases/engine/stores.js +++ b/common/core/web/keyboard-processor/tests/cases/engine/stores.js @@ -2,36 +2,43 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = require('../../../dist'); -let KMWRecorder = require('../../../../tools/recorder/dist/nodeProctor'); +let KeyboardProcessor = com.keyman.text.KeyboardProcessor; +global.keyman = {}; -// Required initialization setup. -global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. +// Initialize supplementary plane string extensions +String.kmwEnableSupplementaryPlane(false); + +let device = { + formFactor: 'desktop', + OS: 'windows', + browser: 'native' +} describe('Engine - Stores', function() { var toSupplementaryPairString = function(code){ var H = Math.floor((code - 0x10000) / 0x400) + 0xD800; var L = (code - 0x10000) % 0x400 + 0xDC00; - + return String.fromCharCode(H, L); } it('Store \'Explosion\'', function() { let processor = new KeyboardProcessor(); + processor.device = device; // A 'hollow' Keyboard that only follows default rules. That said, we need a Keyboard // instance to host cache data for our exploded store tests. processor.activeKeyboard = new com.keyman.keyboards.Keyboard(); // Function defined at top of file; creates supplementary pairs for extended Unicode codepoints. var u = toSupplementaryPairString; - + var STORES = [ {smp: false, in: "apple", out: ['a','p','p','l','e']}, //In JS-escaped form: "\\ud804\\udd12\\ud804\\udd0d\\ud804\\udd0f\\ud804\\udd10\\ud804\\udd0a\\ud804\\udd05" //(Supplementary pairs, copied from the easy_chakma keyboard.) {smp: true, in: "𑄒𑄍𑄏𑄐𑄊𑄅", out: ["𑄒","𑄍","𑄏","𑄐","𑄊","𑄅"]}, // Built in-line via function. Looks functionally equivalent to "apple", but with SMP characters. - {smp: true, in: (u(0x1d5ba)+u(0x1d5c9)+u(0x1d5c9)+u(0x1d5c5)+u(0x1d5be)), + {smp: true, in: (u(0x1d5ba)+u(0x1d5c9)+u(0x1d5c9)+u(0x1d5c5)+u(0x1d5be)), out: [u(0x1d5ba), u(0x1d5c9), u(0x1d5c9), u(0x1d5c5), u(0x1d5be)]} ]; diff --git a/common/core/web/keyboard-processor/tests/cases/engine/unmatched_final_group.js b/common/core/web/keyboard-processor/tests/cases/engine/unmatched_final_group.js index 40d02487a15..30d126fcc53 100644 --- a/common/core/web/keyboard-processor/tests/cases/engine/unmatched_final_group.js +++ b/common/core/web/keyboard-processor/tests/cases/engine/unmatched_final_group.js @@ -2,11 +2,11 @@ var assert = require('chai').assert; let fs = require('fs'); let vm = require('vm'); -let KeyboardProcessor = require('../../../dist'); -let KMWRecorder = require('../../../../tools/recorder/dist/nodeProctor'); +let KeyboardProcessor = com.keyman.text.KeyboardProcessor; +global.keyman = {}; -// Required initialization setup. -global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. +// Initialize supplementary plane string extensions +String.kmwEnableSupplementaryPlane(false); describe('Engine - Unmatched Final Groups', function() { let testJSONtext = fs.readFileSync('../tests/resources/json/engine_tests/ghp_enter.json'); diff --git a/common/core/web/keyboard-processor/tests/cases/transcriptions.js b/common/core/web/keyboard-processor/tests/cases/transcriptions.js index 59f644670db..c351ded8d0e 100644 --- a/common/core/web/keyboard-processor/tests/cases/transcriptions.js +++ b/common/core/web/keyboard-processor/tests/cases/transcriptions.js @@ -1,16 +1,15 @@ var assert = require('chai').assert; -let KeyboardProcessor = require('../../dist'); -// Required initialization setup. -global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. +global.keyman = {}; +// Initialize supplementary plane string extensions String.kmwEnableSupplementaryPlane(false); describe("Transcriptions and Transforms", function() { var toSupplementaryPairString = function(code){ var H = Math.floor((code - 0x10000) / 0x400) + 0xD800; var L = (code - 0x10000) % 0x400 + 0xDC00; - + return String.fromCharCode(H, L); } @@ -50,7 +49,7 @@ describe("Transcriptions and Transforms", function() { * Other modules coming later will need it, though. */ var transcription = target.buildTranscriptionFrom(original, null); - + assert.equal(transcription.transform.insert, "s", "Failed to recognize inserted text"); assert.equal(transcription.transform.deleteLeft, 0, "Incorrectly detected left-of-caret deletions"); assert.equal(transcription.transform.deleteRight, 0, "Incorrectly detected right-of-caret deletions"); @@ -322,11 +321,11 @@ but not himself.`; // Sheev Palpatine, in the Star Wars prequels. // could eventually run in 'headless' mode. var target = new Mock("apple"); var original = Mock.from(target); - + target.setDeadkeyCaret(4); target.insertDeadkeyBeforeCaret(0); target.setDeadkeyCaret(1); - target.insertDeadkeyBeforeCaret(1); + target.insertDeadkeyBeforeCaret(1); target.setDeadkeyCaret(2); target.insertDeadkeyBeforeCaret(2); // 'a' dk(1) 'p' dk(2) | 'p' 'l' dk(0) 'e' @@ -337,8 +336,8 @@ but not himself.`; // Sheev Palpatine, in the Star Wars prequels. target.setDeadkeyCaret(3); target.deleteCharsBeforeCaret(2); - target.insertTextBeforeCaret("b"); - target.insertDeadkeyBeforeCaret(3); // In effect: 'a' dk(1) 'b' dk(3) | 'l' dk(0) 'e' + target.insertTextBeforeCaret("b"); + target.insertDeadkeyBeforeCaret(3); // In effect: 'a' dk(1) 'b' dk(3) | 'l' dk(0) 'e' var transcription = target.buildTranscriptionFrom(original, null); @@ -350,7 +349,7 @@ but not himself.`; // Sheev Palpatine, in the Star Wars prequels. var rem = transcription.removedDks; assert.equal(rem.length, 1, "Incorrect count for removed deadkeys"); assert.deepEqual({d: rem[0].d, p: rem[0].p}, {d: 2, p: 2}, "Selected wrong deadkey as removed"); - + var ins = transcription.insertedDks; assert.equal(ins.length, 1, "Incorrect count for inserted deadkeys"); assert.deepEqual({d: ins[0].d, p: ins[0].p}, {d: 3, p:2}, "Selected wrong deadkey as inserted"); diff --git a/common/core/web/keyboard-processor/tests/cases/versions.js b/common/core/web/keyboard-processor/tests/cases/versions.js index 2345602de39..e3c6a42768e 100644 --- a/common/core/web/keyboard-processor/tests/cases/versions.js +++ b/common/core/web/keyboard-processor/tests/cases/versions.js @@ -1,8 +1,9 @@ var assert = require('chai').assert; -let KeyboardProcessor = require('../../dist'); -// Required initialization setup. -global.com = KeyboardProcessor.com; // exports all keyboard-processor namespacing. +global.keyman = {}; + +// Initialize supplementary plane string extensions +String.kmwEnableSupplementaryPlane(false); describe('Version Logic', function() { it('Should provide a default, fallback value when nothing is specified', function() { @@ -42,5 +43,5 @@ describe('Version Logic', function() { // Ensures the first "precede" check's return is flipped when the order's flipped. assert.equal(v9_1_0.compareTo(v9_0_1), 1); }); - + }); \ No newline at end of file diff --git a/common/core/web/tools/recorder/src/nodeProctor.tsconfig.json b/common/core/web/tools/recorder/src/nodeProctor.tsconfig.json index 39bc1464d32..064a8dd69ad 100644 --- a/common/core/web/tools/recorder/src/nodeProctor.tsconfig.json +++ b/common/core/web/tools/recorder/src/nodeProctor.tsconfig.json @@ -4,16 +4,18 @@ "compilerOptions": { "allowJs": true, "module": "none", - "outDir": "../dist/", + "outDir": "../build/nodeProctor/", + "outFile": "../build/nodeProctor/index.js", "inlineSources": true, "inlineSourceMap": true, "target": "es5", "types": ["node"], - "lib": ["es6"], - "outFile": "../dist/nodeProctor.js" + "lib": ["es6"] }, "files": [ + "index.ts", + "proctor.ts", "nodeProctor.ts" ], @@ -21,7 +23,6 @@ { "path": "../../../../../../resources/web-environment" }, { "path": "../../../../../../common/core/web/utils" }, { "path": "../../../../../../common/core/web/keyboard-processor/src" }, - { "path": "../../../../../../common/web/lm-message-types" }, - { "path": "./tsconfig.json" } + { "path": "../../../../../../common/web/lm-message-types" } ] } From d2b86c90d10187c5b9f4d5638bbdfd74b8c8ed63 Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 10 May 2022 10:50:33 +1000 Subject: [PATCH 4/5] chore(web): fix predictive text module concatenation --- web/source/build.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/source/build.sh b/web/source/build.sh index 6a1c17ebe7c..95e9b9445a3 100755 --- a/web/source/build.sh +++ b/web/source/build.sh @@ -473,7 +473,7 @@ if [ $BUILD_COREWEB = true ]; then # TEMP STUB LMLayerWorkerCode pwd - cat $INTERMEDIATE/keymanweb.js ../../common/predictive-text/build/intermediate/index.js > $INTERMEDIATE/km1.js + cat $INTERMEDIATE/keymanweb.js <(echo) ../../common/predictive-text/build/index.js > $INTERMEDIATE/km1.js mv $INTERMEDIATE/km1.js $INTERMEDIATE/keymanweb.js echo Native TypeScript compiled as $INTERMEDIATE/keymanweb.js From 08ec9a5565de133fe4bce3e791c796905b91c98a Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Tue, 10 May 2022 12:58:02 +1000 Subject: [PATCH 5/5] chore(web): +x for build.sh --- common/web/keyman-version/build.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100644 => 100755 common/web/keyman-version/build.sh diff --git a/common/web/keyman-version/build.sh b/common/web/keyman-version/build.sh old mode 100644 new mode 100755