spiegel-keyman/developer/src/kmc
Marc Durdin a355721e1b
Merge pull request #9996 from keymanapp/chore/developer/9948-handle-project-version-cleanly-in-kmc
chore(developer): handle project version checks cleanly in kmc 🦕
2023-11-15 13:48:44 +11:00
..
src Merge pull request #9996 from keymanapp/chore/developer/9948-handle-project-version-cleanly-in-kmc 2023-11-15 13:48:44 +11:00
test chore(developer): handle project version checks cleanly in kmc 2023-11-14 06:24:28 +07:00
.eslintrc.cjs chore(developer): sourcemap def in wrong file 2023-07-13 09:04:19 +07:00
build-bundler.js feat(developer): eliminate source .model_info and .keyboard_info files 2023-08-29 15:37:31 +10:00
build.sh Merge branch 'epic/package-metadata' into chore/merge-master-into-package-metadata 2023-10-04 19:34:16 +11:00
Makefile chore: rename kmc-keyboard to kmc-ldml 2023-05-09 14:08:45 +07:00
package.json Merge pull request #9940 from keymanapp/fix/developer/9939-sentry-support-in-server 2023-11-06 17:55:56 +11:00
README.md feat(developer): Windows package installer compiler 2023-09-21 17:35:16 +07:00
tsconfig.json feat(developer): introduce kmc-keyboard-info 2023-07-24 10:41:12 +07:00
tsconfig.kmc-base.json chore(common): cleanup final Typescript non-ESM metadata 2023-10-04 12:55:51 +07:00

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.

kmlmc is intended to be used standalone, or as part of a build system. kmlmp is used only by command line tools.

Note: kmc will in the future replace kmlmc and kmlmp.

In order to build lexical models, these tools must be built and compiled.

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

To compile a lexical model from its .model.ts source, use kmc:

kmc build my-lexical-model.model.ts --outFile my-lexical-model.model.js

To see more command line options by using the --help option:

kmc --help

kmc can now build package installers for Windows. Example usage (Bash on Windows, using 'node .' instead of 'kmc' to run the local build):

node . build windows-package-installer \
  $KEYMAN_ROOT/developer/src/kmc-package/test/fixtures/khmer_angkor/source/khmer_angkor.kps \
  --msi /c/Program\ Files\ \(x86\)/Common\ Files/Keyman/Cached\ Installer\ Files/keymandesktop.msi \
  --exe $KEYMAN_ROOT/windows/bin/desktop/setup-redist.exe \
  --license $KEYMAN_ROOT/LICENSE.md \
  --out-file ./khmer.exe

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 configured 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 <temp_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.