Address a review comment from #15665 and cleanup additional references
that I missed the first time around, along with the `fs.readFileSync`
`Uint8Array` cast.
Follows: #15665
Test-bot: skip
Simplify usage of `TestCompilerCallbacks` by making it responsible for
the `beforeEach` and `afterEach` incantations itself. There are a couple
of more complex usages of `TestCompilerCallbacks` which have been
excluded from this change on purpose.
Renamed `testCallbacks` to `callbacks` in the one place where it was
different.
Hoist @types/node and @types/mocha because inconsistent versions of
@types/mocha were causing compiler errors with this change.
Also added a cast to `fs.readFileSync` to `Uint8Array` to eliminate
compiler warnings/errors in test files.
Fixes: #15654
Test-bot: skip
Turned on strictNullChecks to verify the file and found a few other
problems in this file. However, there are many null check errors
reported across the kmc-package source which should be addressed in a
future patch. (This is a broader problem for the entire Typescript
source of Keyman.)
Fixes: #15627
Test-bot: skip
Build-bot: skip build:developer
While not documented as such, it appears that the repository record is
required with trusted publishing of npm packages.
Test-bot: skip
Build-bot: skip
Due to recent changes in NPM package publishing security requirements,
we have to move from TeamCity build to a GitHub Action to publish our
NPM packages, so we can take advantage of trusted publishing. This
change also consolidates and centralizes the npm publishing into
resources/build/ci/npm-publish.sh, which removes a lot of boilerplate
from each of the build.sh scripts, and ensures consistency.
Packages will be `npm pack`ed on PR and test builds, and published in
release builds.
Ref: https://docs.npmjs.com/trusted-publishers
Ref: https://github.blog/changelog/2025-09-29-strengthening-npm-security-important-changes-to-authentication-and-token-management/Fixes: #14963
Test-bot: skip
Build-bot: release:developer
If a `<LexicalModel>` element is found with a missing or empty `<ID>`
element, the compiler will now report `ERROR_MissingModelId` instead of
crashing. The corresponding check for missing `<ID>` for `<Keyboard>`
element has been updated to match this, and now reports a clearer error
message of `ERROR_MissingKeyboardId` rather than depending on the
side-effect of looking up the keyboard in the `<File>` elements.
Fixes: #13783
Fixes: KEYMAN-DEVELOPER-2X7
Test-bot: skip
Removes a number of unused functions from the file, renames remaining
functions to match our builder script prefix patterns, removes unused
imports from various build scripts (e.g. Android).
Fixes: #14453
Consolidates the node-related script functions into node.inc.sh, as part
of cleaning up the build scripts and making them easier to maintain into
the future.
Fixes: #14447
Clarifies the confusing builder.inc.sh / build-utils.sh distinction by
giving the scripts more appropriate names. Most build scripts should use
builder-full.inc.sh; some helper scripts can use builder-basic.inc.sh.
Documented in resources/build/README.md.
Renames:
* resources/build/builder.inc.sh to resources/build/builder-full.inc.sh
* resources/build/build-utils.sh to resources/build/builder-basic.inc.sh
Other changes:
* Moves Android-specific functions out of builder-basic.inc.sh and into
android/build.sh.
* Renames functions in builder-basic.inc.sh
More functions may be moved from builder-basic.inc.sh into utils.inc.sh
or other scripts in the future.
Fixes: #14065
Build-bot: build all
Test-bot: skip
Adds documentation for various functions, removes unused functions (a
couple of simple, very lightly used functions were unDRYed; these could
go back the other way across all shell scripts if necessary). TODO items
noted for follow-up refactoring.
Fixes: #14275
Relates-to: #14269
Build-bot: build all
Test-bot: skip
Some of the npm audit warnings left after #13897 require an updated `mocha` version to remedy. As we only really use `mocha` to do unit-testing, it should be safe to update if all of our existing tests pass with the new version.
Test-bot: skip
Renames common-messages.ts to developer-utils-messages.ts. This was
split from /common/web/types, but the messages module retained the old
name, which was confusing (two modules with same name).
Follows on from the similar changes to `Keyboard` fields in #13600. This
deprecates the `RTL` and `Name` fields. `RTL` was never used. `Name` was
written but never presented to end users, so effectively irrelevant.
`Name` also was present in `File.Description` (already deprecated) for
the corresponding model.js _and_ `Info.Name`, so doubly redundant.
Also updates the schema documentation to mark the deprecated fields.
Relates-to: #13600
The fields 'name', 'version', and 'rtl' were defined in the .kps file,
but were not actually used by the compiler, as kmc-package reads the
metadata from the keyboard file rather than relying on this data, which
often is out of date. This led to confusion for keyboard authors, so
this change removes that metadata from the package.
The one visible side-effect (apart from the data disappearing from
future .kps files) is that the package editor no longer shows this
metadata in the Keyboards view (but as it may be out-of-date, this is
probably a good thing).
Fixes: #13576Fixes: #13593
Ensures that version number field is not blank, and is a recognized
format matching the pattern 'number[.number[.number]]'. Each number
component should be an integer, without leading zeroes.
The format chosen is more restrictive than semver, because much of our
existing infrastructure assumes this format anyway. This does lead to
a mismatch in version number format for LDML keyboards, which do support
semver according to the spec, so this may need to be revisited in the
future to allow for full semver formats.
Fixes: #13067
The test .kps for binary_kvk_file tests was not very coherent, which
meant that it failed with the changes and additional consistency
checking included in this PR.
When compiling a package, rewrite the font data in embedded .kvk files
to use the facename from the font referenced in OSKFont or DisplayFont.
This also does some safety checking for cross-references of the .kvk,
and the font data.
Fixes: #12912
Some additional items arose from this:
* Adds a command-line-tests unit test which does some basic sanity tests
on `kmc`.
* Cleans up some of the error reporting infrastructure in `kmc` to
ensure that thrown errors are handled better.
* Removes redundant subshell from `builder_run_action`.
Fixes: #12846
This change adds the mocha-teamcity-reporter which outputs the running
tests in a special format that TeamCity can interpret. This allows TC
to show which tests run as well as the number of tests run.
Also refactor some of the build scripts to use functions.
Note that we had to explicitly add `--check-coverage=false` (which is the
default) to get successful builds when we run on TC.
If a .kps file had an `<Info>` element without a URL attribute, it
would not map correctly in all circumstances. This change ensures that
the kps-file-reader is responsible for normalizing the layout of these
elements on read.
The package subfile description field is never really used in the
end-user apps. As it is meaningless metadata, we'll make it fully
optional, and start to remove all references in the designers and
compilers.
TODO: For packages targeting Keyman 18.0+, we should consider removing
the description field altogether from the subfiles.
Relates to kmc-copy project.
Moves the .kps file reader out of kmc-package and adds corresponding
kps file writer unit in developer-utils. Also moves related test and
error message definition.
Subsystems changed:
- ldml keyboard reader (main and test)
- kpj
- kvks
- kmp compiler
test: made the test-xml-utils less verbose about the pathnames
Fixes: #12208