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
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
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.
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.
With the full move to ES Modules, we no longer need to include
`references` in tsconfig.json, as we can rely on package.json and
build.sh dependency management. Note however that `tsc -b` may not work
to build dependencies -- they need to be built using `build.sh`, which
calculates which dependencies need building.
kmc-keyboard-info was missing a dependency link to kmc-package in
build.sh, correcting this at the same time.
Relates-to: #12027
Add verification of email address formats to kmc-package,
kmc-keyboard-info, and kmc-model-info. Add corresponding unit tests for
kmc-package and kmc-keyboard-info (kmc-model-info unit tests will be a
later addition). Uses AJV's email validation regex, as we rely on AJV
for schema compliance tests.
Fixes: #11362
Fixes: KEYMAN-DEVELOPER-1XE
Handles when `<Version/>`, `<Name/>`, or `<ID/>` elements are missing
from `<Keyboard>` elements in the .kps file in kmc-package. Adds a unit
test.
Fixes: #11562
Fixes: KEYMAN-DEVELOPER-1YY
Relates to #10150. Makes the various Messages classes in kmc modules
accessible to other modules. Some file renames involved to reduce
confusion.
No functional changes.
Fixes kmc-analyze metadata.
See #10254 for a related future fix.
Relates to #9473.
Refactors the public API of PackageCompiler and
WindowsPackageInstallerCompiler to meet KeymanCompiler, including
asyncing a bunch of functions, and moving file write responsibilities
into the classes themselves.
The classes were updated together in a single commit because
WindowsPackageInstallerCompiler depends on PackageCompiler, and needed
refactoring for the updated API access there anyway.
Most of the test cases needed only minor patching, but introducing the
`async init()` function has caused them to all be async. The
test-messages module has a slight functional change with the compile
process running completely rather than stopping on first message, which
meant we needed to add extra dummy fixtures to avoid other errors that
arose later in the compile process. The keyman.exe fixture is a text
file, not a Windows executable.
Part of #9266.
Also cleans up filenames for hint_language_tag_is_not_minimal, and fixes
a bug in transformKpsToKmpObject where a null object could be passed on
to another function in case of failure.
Fixes#9266.
For historical reasons there are many non-minimal BCP 47 tags in package
metadata in the repository (over 2500). Furthermore, earlier versions of
kmcomp did not fail the build on package compilation warnings. This
means it is better to reduce WARN_LanguageTagIsNotMinimal to
HINT_LanguageTagIsNotMinimal, so that we can otherwise respect the
'treat warnings as errors' flag on the keyboard projects.
We may be able to upgrade this to a warning again one day in the future.
Fixes#9478.
This adds a property WelcomeFile to .kps and kmp.json, which allows us
to move away from the hardcoded welcome.htm filename in the future, and
makes transform from Markdown (#9477) a simpler operation, and just
generally starts the cleanup of the messiness of hard-coded filenames.
The package compiler will fallback to injecting welcome.htm into this
property if (a) welcome.htm is present, and (b) the property does not
already have a value. This doesn't buy us much because we still need to
support welcome.htm for existing legacy packages, but does mean that
our .kmp package metadata will be more consistent for packages compiled
with 17.0+ compilers.
Fixes#9324.
As .js keyboards in packages are only used by the iOS and Android apps,
it's kinda helpful if the keyboard itself includes a touch layout. While
Keyman will fall back to a desktop vk layout if a touch layout is not
present, this is less than ideal -- but that's why this is setup as a
hint and not a warning.
Fixes#9325.
Also tweaks test for error_package_must_contain_a_model_or_a_keyboard as
the fixture had a .kmn, triggering the new hint, which was unhelpful in
this case.
Replaces kmcomp's package installer build infrastructure. While this is
mostly legacy, package installers are still used in adhoc distribution
scenarios, so we need to continue to support with the new kmc.
The package installer is a Windows self-extracting zip archive. The user
is expected to find setup-redist.exe and keymandesktop.msi themselves,
from the Keyman Developer release files. They are not included with
Keyman Developer, but are available as standalone downloads from
https://downloads.keyman.com/windows/.
`kmc build` has been updated to include two subcommands:
* `kmc build ldml-test-data`
* `kmc build windows-package-installer`
Both of these subcommands are a little long, but the use cases for them
are fairly narrow, so I believe this is okay. `kmc build-test-data` has
been removed, as `kmc build ldml-test-data` replaces it.
While a package supports a .ttf or .otf font for the OSK and Display
fonts for use within the Keyman apps, on websites it also supports .woff
and .woff2. This change makes it possible to specify a set of fonts for
a package which will be provided through api.keyman.com to websites.
This means that .woff and .woff2 fonts may also be included in the
package and may not be used on target devices at this time, it further
opens the pathway to deploying .kmp packages to web in the future.
The deployment stage of keymanapp/keyboards will require a new phase to
copy web fonts from packages to s.keyman.com.
Adds relatedPackages support to:
* .kps schema
* .kps file format for Typescript
* kmp.json file format for Typescript
* kmc-package compiler
* Package Editor
Fixes#8795.
Relates to #9090.
Cleans up and makes consistent compiler messages in kmc, and related
unit tests.
Adds support for colorized messages.
After installing chalk for ansi coloring in kmc, @types/node needed to
be brought in sync with the Typescript version, per the suggestion of
checking against `npm dist-tags @types/node`,found in a discussion at
https://github.com/DefinitelyTyped/DefinitelyTyped/discussions/64262#discussioncomment-4905069
Additional tidying up includes:
* Deprecating a set of functions in compiler-interfaces, bringing them
together under a new CompilerError class.
Separating CompilerErrorSeverity and CompilerErrorMask enums.
* Making CompilerError.formatEvent (formerly compilerEventFormat) print
messages in the same format as NodeCompilerCallbacks (sans coloring).
* Adding a wrapper class for CompilerCallbacks that manages the filename
reporting, used currently exclusively by kmc itself.