diff --git a/core/include/ldml/.gitignore b/core/include/ldml/.gitignore new file mode 100644 index 0000000000..3e39f0a460 --- /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/package.json b/core/include/ldml/package.json new file mode 100644 index 0000000000..61b71870d9 --- /dev/null +++ b/core/include/ldml/package.json @@ -0,0 +1,16 @@ +{ + "name": "@keymanapp/ldml-keyboard-constants", + "description": "Keyman LDML keyboard constants", + "keywords": [ + "keyboard", + "keyman", + "ldml", + "unicode" + ], + "license": "MIT", + "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 0000000000..1a7b9fdfbb --- /dev/null +++ b/core/include/ldml/tsconfig.build.json @@ -0,0 +1,18 @@ +{ + "extends": "../../../tsconfig-base.json", + "compilerOptions": { + "composite": true, + "declaration": true, + "module": "CommonJS", + "moduleResolution": "node", + "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 index 01411ba39e..f8a56d0687 100644 --- a/core/include/ldml/tsconfig.json +++ b/core/include/ldml/tsconfig.json @@ -5,13 +5,13 @@ "declaration": true, "module": "CommonJS", "moduleResolution": "node", + "rootDir": ".", "outDir": "build/", }, "exclude": [ "node_modules" ], "files": [ - "keyboardprocessor_ldml.ts", - "ldml-const-builder.ts" + "keyboardprocessor_ldml.ts" ] } diff --git a/core/tools/ldml-const-builder/build.sh b/core/tools/ldml-const-builder/build.sh index c19e34e27c..d231d2967d 100755 --- a/core/tools/ldml-const-builder/build.sh +++ b/core/tools/ldml-const-builder/build.sh @@ -36,13 +36,13 @@ fi if builder_has_action build; then # Generate index.ts - npx tsc -b ../../include/ldml/ + npx tsc -b ../../include/ldml/tsconfig.build.json builder_report success build fi if builder_has_action run; then - node ../../include/ldml/build/core/include/ldml/ldml-const-builder.js > ${KBP_LDML_H_FILE} + node ../../include/ldml/ldml-const-builder/ldml-const-builder.js > ${KBP_LDML_H_FILE} echo "Updated ${KBP_LDML_H_FILE}" builder_report success run diff --git a/developer/src/kmldmlc/src/keyman/kmx/kmx-plus.ts b/developer/src/kmldmlc/src/keyman/kmx/kmx-plus.ts new file mode 100644 index 0000000000..f464a05272 --- /dev/null +++ b/developer/src/kmldmlc/src/keyman/kmx/kmx-plus.ts @@ -0,0 +1,11 @@ +// import * as r from 'restructure'; + +import { constants } from '@keymanapp/ldml-keyboard-constants'; + +// Uses defns from ... + +export default class KMXPlusFile { + constructor() { + console.log(constants); + } +} \ No newline at end of file diff --git a/developer/src/kmldmlc/tsconfig.json b/developer/src/kmldmlc/tsconfig.json index ccdb2efcfe..d6f6004769 100644 --- a/developer/src/kmldmlc/tsconfig.json +++ b/developer/src/kmldmlc/tsconfig.json @@ -22,5 +22,6 @@ ], "references": [ { "path": "../../../common/web/keyman-version" }, + { "path": "../../../core/include/ldml/"} ] } diff --git a/package-lock.json b/package-lock.json index 8fc6dbd502..027c55279f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -8,6 +8,7 @@ "workspaces": [ "resources/gosh", "resources/build/version", + "core/include/ldml", "developer/src/kmlmc", "developer/src/kmldmlc", "developer/src/server", @@ -376,6 +377,10 @@ "integrity": "sha512-B9EoJFjhqcQ9OmQrNorItO+OwEOORNn3S31WuiHvZY/dm9ajkB7AKD/8toessEtHHNL+58jofbq7hMMY9v4yig==", "dev": true }, + "core/include/ldml": { + "name": "@keymanapp/ldml-keyboard-constants", + "license": "MIT" + }, "developer/js": { "name": "@keymanapp/lexical-model-compiler", "extraneous": true, @@ -1057,6 +1062,10 @@ "resolved": "developer/src/kmldmlc", "link": true }, + "node_modules/@keymanapp/ldml-keyboard-constants": { + "resolved": "core/include/ldml", + "link": true + }, "node_modules/@keymanapp/lexical-model-compiler": { "resolved": "developer/src/kmlmc", "link": true @@ -7735,7 +7744,7 @@ "chai": "^4.3.4", "chalk": "^2.4.2", "commander": "^3.0.0", - "crc-32": "*", + "crc-32": "^1.2.2", "mocha": "^8.4.0", "restructure": "^3.0.0", "ts-node": "^9.1.1", @@ -7807,6 +7816,9 @@ } } }, + "@keymanapp/ldml-keyboard-constants": { + "version": "file:core/include/ldml" + }, "@keymanapp/lexical-model-compiler": { "version": "file:developer/src/kmlmc", "requires": { diff --git a/package.json b/package.json index f6d54cb36d..fadefef382 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ "workspaces": [ "resources/gosh", "resources/build/version", + "core/include/ldml", "developer/src/kmlmc", "developer/src/kmldmlc", "developer/src/server",