From c27ac9e4be8d5f5c07fd106960694f5c3526b30c Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 26 Nov 2024 19:14:16 +0100 Subject: [PATCH 1/5] chore(common): rename test files This change rename the test files in Common according to the discussion at the Keyman conference in November 2024. --- common/web/types/package.json | 2 +- .../kmx/{test-keyman-targets.ts => keyman-targets.tests.ts} | 0 .../web/types/test/kmx/{test-kmx-file.ts => kmx-file.tests.ts} | 0 .../web/types/test/kvk/{test-kvk-file.ts => kvk-file.tests.ts} | 2 +- .../types/test/kvk/{test-kvk-utils.ts => kvk-utils.tests.ts} | 0 .../{test-pattern-parser.ts => pattern-parser.tests.ts} | 0 .../ldml-keyboard/{test-string-list.ts => string-list.tests.ts} | 0 common/web/types/test/tsconfig.json | 1 - .../web/types/test/util/{test-unescape.ts => unescape.tests.ts} | 0 9 files changed, 2 insertions(+), 3 deletions(-) rename common/web/types/test/kmx/{test-keyman-targets.ts => keyman-targets.tests.ts} (100%) rename common/web/types/test/kmx/{test-kmx-file.ts => kmx-file.tests.ts} (100%) rename common/web/types/test/kvk/{test-kvk-file.ts => kvk-file.tests.ts} (90%) rename common/web/types/test/kvk/{test-kvk-utils.ts => kvk-utils.tests.ts} (100%) rename common/web/types/test/ldml-keyboard/{test-pattern-parser.ts => pattern-parser.tests.ts} (100%) rename common/web/types/test/ldml-keyboard/{test-string-list.ts => string-list.tests.ts} (100%) rename common/web/types/test/util/{test-unescape.ts => unescape.tests.ts} (100%) diff --git a/common/web/types/package.json b/common/web/types/package.json index e9f7c41294..f78557cb52 100644 --- a/common/web/types/package.json +++ b/common/web/types/package.json @@ -48,7 +48,7 @@ "typescript": "^5.4.5" }, "mocha": { - "spec": "build/test/**/test-*.js", + "spec": "build/test/**/*.tests.js", "require": [ "source-map-support/register" ] diff --git a/common/web/types/test/kmx/test-keyman-targets.ts b/common/web/types/test/kmx/keyman-targets.tests.ts similarity index 100% rename from common/web/types/test/kmx/test-keyman-targets.ts rename to common/web/types/test/kmx/keyman-targets.tests.ts diff --git a/common/web/types/test/kmx/test-kmx-file.ts b/common/web/types/test/kmx/kmx-file.tests.ts similarity index 100% rename from common/web/types/test/kmx/test-kmx-file.ts rename to common/web/types/test/kmx/kmx-file.tests.ts diff --git a/common/web/types/test/kvk/test-kvk-file.ts b/common/web/types/test/kvk/kvk-file.tests.ts similarity index 90% rename from common/web/types/test/kvk/test-kvk-file.ts rename to common/web/types/test/kvk/kvk-file.tests.ts index 8a1179b67b..8e0387fefe 100644 --- a/common/web/types/test/kvk/test-kvk-file.ts +++ b/common/web/types/test/kvk/kvk-file.tests.ts @@ -2,7 +2,7 @@ import * as fs from 'fs'; import 'mocha'; import { makePathToFixture } from '../helpers/index.js'; import KvkFileReader from "../../src/kvk/kvk-file-reader.js"; -import { verify_balochi_inpage, verify_khmer_angkor } from './test-kvk-utils.js'; +import { verify_balochi_inpage, verify_khmer_angkor } from './kvk-utils.tests.js'; describe('kvk-file-reader', function () { it('kvk-file-reader should read a valid file', function() { diff --git a/common/web/types/test/kvk/test-kvk-utils.ts b/common/web/types/test/kvk/kvk-utils.tests.ts similarity index 100% rename from common/web/types/test/kvk/test-kvk-utils.ts rename to common/web/types/test/kvk/kvk-utils.tests.ts diff --git a/common/web/types/test/ldml-keyboard/test-pattern-parser.ts b/common/web/types/test/ldml-keyboard/pattern-parser.tests.ts similarity index 100% rename from common/web/types/test/ldml-keyboard/test-pattern-parser.ts rename to common/web/types/test/ldml-keyboard/pattern-parser.tests.ts diff --git a/common/web/types/test/ldml-keyboard/test-string-list.ts b/common/web/types/test/ldml-keyboard/string-list.tests.ts similarity index 100% rename from common/web/types/test/ldml-keyboard/test-string-list.ts rename to common/web/types/test/ldml-keyboard/string-list.tests.ts diff --git a/common/web/types/test/tsconfig.json b/common/web/types/test/tsconfig.json index 9678c49945..21b4145e59 100644 --- a/common/web/types/test/tsconfig.json +++ b/common/web/types/test/tsconfig.json @@ -10,7 +10,6 @@ "allowSyntheticDefaultImports": true }, "include": [ - "**/test-*.ts", "**/*.tests.ts", "./helpers/*.ts", ], diff --git a/common/web/types/test/util/test-unescape.ts b/common/web/types/test/util/unescape.tests.ts similarity index 100% rename from common/web/types/test/util/test-unescape.ts rename to common/web/types/test/util/unescape.tests.ts From cbbb643ed02a4070c7138705c08f347cf9911f38 Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Tue, 3 Dec 2024 13:53:13 +0100 Subject: [PATCH 2/5] chore(common): rename `common/web/types/test` to `.../tests` Addresses code review comment. --- common/web/types/.eslintrc.cjs | 4 ++-- common/web/types/build.sh | 2 +- common/web/types/package.json | 6 +++--- .../{test => tests}/fixtures/kmx/khmer_angkor.kmx | Bin .../{test => tests}/fixtures/kvk/balochi_inpage.kvk | Bin .../{test => tests}/fixtures/kvk/khmer_angkor.kvk | Bin common/web/types/{test => tests}/helpers/index.ts | 2 +- .../{test => tests}/kmx/keyman-targets.tests.ts | 0 .../web/types/{test => tests}/kmx/kmx-file.tests.ts | 0 .../web/types/{test => tests}/kvk/kvk-file.tests.ts | 0 .../types/{test => tests}/kvk/kvk-utils.tests.ts | 0 .../ldml-keyboard/pattern-parser.tests.ts | 0 .../ldml-keyboard/string-list.tests.ts | 0 .../{test => tests}/lexical-model-types.tests.ts | 0 common/web/types/{test => tests}/tsconfig.json | 2 +- .../types/{test => tests}/util/unescape.tests.ts | 0 16 files changed, 8 insertions(+), 8 deletions(-) rename common/web/types/{test => tests}/fixtures/kmx/khmer_angkor.kmx (100%) rename common/web/types/{test => tests}/fixtures/kvk/balochi_inpage.kvk (100%) rename common/web/types/{test => tests}/fixtures/kvk/khmer_angkor.kvk (100%) rename common/web/types/{test => tests}/helpers/index.ts (87%) rename common/web/types/{test => tests}/kmx/keyman-targets.tests.ts (100%) rename common/web/types/{test => tests}/kmx/kmx-file.tests.ts (100%) rename common/web/types/{test => tests}/kvk/kvk-file.tests.ts (100%) rename common/web/types/{test => tests}/kvk/kvk-utils.tests.ts (100%) rename common/web/types/{test => tests}/ldml-keyboard/pattern-parser.tests.ts (100%) rename common/web/types/{test => tests}/ldml-keyboard/string-list.tests.ts (100%) rename common/web/types/{test => tests}/lexical-model-types.tests.ts (100%) rename common/web/types/{test => tests}/tsconfig.json (93%) rename common/web/types/{test => tests}/util/unescape.tests.ts (100%) diff --git a/common/web/types/.eslintrc.cjs b/common/web/types/.eslintrc.cjs index b28ba0941b..4fd5954e49 100644 --- a/common/web/types/.eslintrc.cjs +++ b/common/web/types/.eslintrc.cjs @@ -1,13 +1,13 @@ module.exports = { parserOptions: { - project: ["./tsconfig.json", "./test/tsconfig.json"], + project: ["./tsconfig.json", "./tests/tsconfig.json"], }, ignorePatterns: [ ".*/*", "build/*", "coverage/*", "node_modules/*", - "test/fixtures/*", + "tests/fixtures/*", "tools/*", "src/schemas/*" ], diff --git a/common/web/types/build.sh b/common/web/types/build.sh index 75273aaa2c..418840d1a8 100755 --- a/common/web/types/build.sh +++ b/common/web/types/build.sh @@ -88,7 +88,7 @@ function do_test() { fi eslint . - tsc --build test + tsc --build tests readonly C8_THRESHOLD=60 diff --git a/common/web/types/package.json b/common/web/types/package.json index f78557cb52..d6efc63503 100644 --- a/common/web/types/package.json +++ b/common/web/types/package.json @@ -23,7 +23,7 @@ "build": "tsc -b", "build:schema": "ajv compile", "lint": "eslint .", - "test": "npm run lint && cd test && tsc -b && cd .. && c8 --skip-full --reporter=lcov --reporter=text mocha" + "test": "npm run lint && cd tests && tsc -b && cd .. && c8 --skip-full --reporter=lcov --reporter=text mocha" }, "author": "Marc Durdin (https://github.com/mcdurdin)", "license": "MIT", @@ -48,7 +48,7 @@ "typescript": "^5.4.5" }, "mocha": { - "spec": "build/test/**/*.tests.js", + "spec": "build/tests/**/*.tests.js", "require": [ "source-map-support/register" ] @@ -76,7 +76,7 @@ "src/keyman-touch-layout/keyman-touch-layout-file-writer.ts", "src/osk/osk.ts", "src/schemas/*", - "test/" + "tests/" ] }, "sideEffects": false diff --git a/common/web/types/test/fixtures/kmx/khmer_angkor.kmx b/common/web/types/tests/fixtures/kmx/khmer_angkor.kmx similarity index 100% rename from common/web/types/test/fixtures/kmx/khmer_angkor.kmx rename to common/web/types/tests/fixtures/kmx/khmer_angkor.kmx diff --git a/common/web/types/test/fixtures/kvk/balochi_inpage.kvk b/common/web/types/tests/fixtures/kvk/balochi_inpage.kvk similarity index 100% rename from common/web/types/test/fixtures/kvk/balochi_inpage.kvk rename to common/web/types/tests/fixtures/kvk/balochi_inpage.kvk diff --git a/common/web/types/test/fixtures/kvk/khmer_angkor.kvk b/common/web/types/tests/fixtures/kvk/khmer_angkor.kvk similarity index 100% rename from common/web/types/test/fixtures/kvk/khmer_angkor.kvk rename to common/web/types/tests/fixtures/kvk/khmer_angkor.kvk diff --git a/common/web/types/test/helpers/index.ts b/common/web/types/tests/helpers/index.ts similarity index 87% rename from common/web/types/test/helpers/index.ts rename to common/web/types/tests/helpers/index.ts index 3e305eeca8..717b2e7519 100644 --- a/common/web/types/test/helpers/index.ts +++ b/common/web/types/tests/helpers/index.ts @@ -9,5 +9,5 @@ import { fileURLToPath } from "url"; * @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)); + return fileURLToPath(new URL(path.join('..', '..', '..', 'tests', 'fixtures', ...components), import.meta.url)); } diff --git a/common/web/types/test/kmx/keyman-targets.tests.ts b/common/web/types/tests/kmx/keyman-targets.tests.ts similarity index 100% rename from common/web/types/test/kmx/keyman-targets.tests.ts rename to common/web/types/tests/kmx/keyman-targets.tests.ts diff --git a/common/web/types/test/kmx/kmx-file.tests.ts b/common/web/types/tests/kmx/kmx-file.tests.ts similarity index 100% rename from common/web/types/test/kmx/kmx-file.tests.ts rename to common/web/types/tests/kmx/kmx-file.tests.ts diff --git a/common/web/types/test/kvk/kvk-file.tests.ts b/common/web/types/tests/kvk/kvk-file.tests.ts similarity index 100% rename from common/web/types/test/kvk/kvk-file.tests.ts rename to common/web/types/tests/kvk/kvk-file.tests.ts diff --git a/common/web/types/test/kvk/kvk-utils.tests.ts b/common/web/types/tests/kvk/kvk-utils.tests.ts similarity index 100% rename from common/web/types/test/kvk/kvk-utils.tests.ts rename to common/web/types/tests/kvk/kvk-utils.tests.ts diff --git a/common/web/types/test/ldml-keyboard/pattern-parser.tests.ts b/common/web/types/tests/ldml-keyboard/pattern-parser.tests.ts similarity index 100% rename from common/web/types/test/ldml-keyboard/pattern-parser.tests.ts rename to common/web/types/tests/ldml-keyboard/pattern-parser.tests.ts diff --git a/common/web/types/test/ldml-keyboard/string-list.tests.ts b/common/web/types/tests/ldml-keyboard/string-list.tests.ts similarity index 100% rename from common/web/types/test/ldml-keyboard/string-list.tests.ts rename to common/web/types/tests/ldml-keyboard/string-list.tests.ts diff --git a/common/web/types/test/lexical-model-types.tests.ts b/common/web/types/tests/lexical-model-types.tests.ts similarity index 100% rename from common/web/types/test/lexical-model-types.tests.ts rename to common/web/types/tests/lexical-model-types.tests.ts diff --git a/common/web/types/test/tsconfig.json b/common/web/types/tests/tsconfig.json similarity index 93% rename from common/web/types/test/tsconfig.json rename to common/web/types/tests/tsconfig.json index 21b4145e59..45e5311fdc 100644 --- a/common/web/types/test/tsconfig.json +++ b/common/web/types/tests/tsconfig.json @@ -4,7 +4,7 @@ "compilerOptions": { "rootDir": ".", "rootDirs": ["./", "../src/"], - "outDir": "../build/test", + "outDir": "../build/tests", "baseUrl": ".", "strictNullChecks": false, // TODO: get rid of this as some point "allowSyntheticDefaultImports": true diff --git a/common/web/types/test/util/unescape.tests.ts b/common/web/types/tests/util/unescape.tests.ts similarity index 100% rename from common/web/types/test/util/unescape.tests.ts rename to common/web/types/tests/util/unescape.tests.ts From 148938eb1de0fb04681a8ba9635dc56a19be11ac Mon Sep 17 00:00:00 2001 From: Marc Durdin Date: Wed, 4 Dec 2024 12:51:00 +0700 Subject: [PATCH 3/5] fix(developer): honour provided script when checking for matching scripts Fixes: #12765 --- .../src/kmc-keyboard-info/src/keyboard-info-compiler.ts | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/developer/src/kmc-keyboard-info/src/keyboard-info-compiler.ts b/developer/src/kmc-keyboard-info/src/keyboard-info-compiler.ts index d91f9db0ba..74c06d5d12 100644 --- a/developer/src/kmc-keyboard-info/src/keyboard-info-compiler.ts +++ b/developer/src/kmc-keyboard-info/src/keyboard-info-compiler.ts @@ -575,11 +575,12 @@ export class KeyboardInfoCompiler implements KeymanCompiler { '' ); + const resolvedScript = locale.script ?? langtagsByTag[bcp47]?.script ?? langtagsByTag[locale.language]?.script ?? undefined; if(commonScript === null) { - commonScript = tag?.script ?? undefined; + commonScript = resolvedScript; } else { - if(tag?.script !== commonScript) { - this.callbacks.reportMessage(KeyboardInfoCompilerMessages.Hint_ScriptDoesNotMatch({commonScript, bcp47, script: tag?.script})) + if(resolvedScript !== commonScript) { + this.callbacks.reportMessage(KeyboardInfoCompilerMessages.Hint_ScriptDoesNotMatch({commonScript, bcp47, script: resolvedScript})) } } } From ed22cc00a6df5314f1650e05b00b5a6cabdeb0be Mon Sep 17 00:00:00 2001 From: Eberhard Beilharz Date: Wed, 4 Dec 2024 10:44:05 +0100 Subject: [PATCH 4/5] fix(common): rename test file This change renames a new test file and moves it to the new location. This file was overlooked in #12709. --- .../ldml-keyboard/unicodeset-parser-api.tests.ts} | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) rename common/web/types/{test/ldml-keyboard/test-unicodeset-parser-api.ts => tests/ldml-keyboard/unicodeset-parser-api.tests.ts} (98%) diff --git a/common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts b/common/web/types/tests/ldml-keyboard/unicodeset-parser-api.tests.ts similarity index 98% rename from common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts rename to common/web/types/tests/ldml-keyboard/unicodeset-parser-api.tests.ts index cc36e78ae2..763bc6d5bb 100644 --- a/common/web/types/test/ldml-keyboard/test-unicodeset-parser-api.ts +++ b/common/web/types/tests/ldml-keyboard/unicodeset-parser-api.tests.ts @@ -1,8 +1,8 @@ /* * Keyman is copyright (C) SIL Global. MIT License. - * + * * Created by Dr Mark C. Sinclair on 2024-11-29 - * + * * Test code for unicodeset-parser-api.ts */ From 917cae39f0a913f2061c8a45e95bf7516c6272d5 Mon Sep 17 00:00:00 2001 From: Keyman Build Agent Date: Wed, 4 Dec 2024 13:01:45 -0500 Subject: [PATCH 5/5] auto: increment master version to 18.0.153 --- HISTORY.md | 7 +++++++ VERSION.md | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/HISTORY.md b/HISTORY.md index d92ae3e0f4..b831dadee8 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,5 +1,12 @@ # Keyman Version History +## 18.0.152 alpha 2024-12-04 + +* refactor(mac): pass kmx data blob to keyman core instead of file path (#12760) +* fix(developer): honour provided script when checking for matching scripts (#12768) +* chore(common): rename test files (#12709) +* fix(common): rename test file (#12770) + ## 18.0.151 alpha 2024-12-03 * feat(android): Enhance how ENTER key is handled for FV and KMSample2 (#12745) diff --git a/VERSION.md b/VERSION.md index a08197ede1..6269a6496f 100644 --- a/VERSION.md +++ b/VERSION.md @@ -1 +1 @@ -18.0.152 \ No newline at end of file +18.0.153 \ No newline at end of file