Commit graph

216 commits

Author SHA1 Message Date
Marc Durdin
8e6ca01175 chore(developer): fix always-false nullish coalescing
Test-bot: skip
Build-bot: skip
2025-10-30 15:24:15 +01:00
Marc Durdin
df212364a2 maint(resources): add repository record for all published packages
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
2025-10-29 14:35:31 +01:00
Marc Durdin
ba411774f6 maint(resources): move NPM package publishing to GitHub Actions
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
2025-10-27 16:31:55 +01:00
Marc Durdin
7a3e50596d fix(developer): handle missing model id in package with compiler error
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
2025-08-30 05:46:53 +02:00
Marc Durdin
f3fb3ac87b maint(common): move build-utils-ci.inc.sh to ci/ci-publish.inc.sh
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
2025-08-05 12:54:56 +10:00
Marc Durdin
acefdf281a maint(common): move typescript script functions into typescript.inc.sh
Fixes: #14448
Build-bot: build
Test-bot: skip
2025-08-03 07:01:57 +10:00
Marc Durdin
2726050601 maint(common): rename and move node-related script functions into node.inc.sh
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
2025-08-02 13:34:29 +10:00
Marc Durdin
f394245636 maint(common): consolidate builder scripts
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
2025-08-02 08:11:24 +10:00
Marc Durdin
65158a0526 maint(common): rename shellHelperFunctions.sh to utils.inc.sh
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
2025-08-02 06:58:40 +10:00
Joshua Horton
155c1a2b12 maint: update mocha
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
2025-05-13 14:02:02 +07:00
Joshua Horton
871ebee552 change(developer): clean up developer/src/kmc-package linter issues 2025-04-30 09:37:32 +07:00
Marc Durdin
4f829f5c8f chore: Merge remote-tracking branch 'origin/master' into chore/merge-beta-to-master-b18s5 2025-04-21 07:13:35 +07:00
Marc Durdin
70838ff1ac refactor(developer): rename to developer-utils-messages.ts
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).
2025-04-03 09:26:27 +07:00
Marc Durdin
0f05da957f fix(developer): remove redundant Name and RTL fields from .kps LexicalModel
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
2025-04-02 05:39:09 +07:00
Marc Durdin
9dabcc0306 fix(developer): remove redundant keyboard fields from .kps
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: #13576
Fixes: #13593
2025-03-28 14:07:23 +07:00
Marc Durdin
c1b930217b
Merge branch 'master' into feat/developer/13109-check-that-package-does-not-contain-itself 2025-02-10 08:20:05 +07:00
Marc Durdin
a00e446ee7
chore(developer): use correct .kmp file extension in fixture
Co-authored-by: Darcy Wong <darcy_wong@sil.org>
2025-02-07 05:11:47 +01:00
Marc Durdin
4509aca88a feat(developer): verify that packages do not contain themselves in kmc-package
Fixes: #13109
2025-02-07 09:30:07 +07:00
Marc Durdin
706f3996c2 chore(developer): prevent leading zeroes in initial component of version number 2025-02-03 14:07:38 +07:00
Marc Durdin
6dbc20f87b feat(developer): verify package version number format in kmc-package
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
2025-02-03 14:00:58 +07:00
Marc Durdin
11d92be941 chore: address review comments 2025-01-20 10:25:56 +07:00
Marc Durdin
d24f3477bd chore(developer): update binary_kvk_file test to make .kps more valid
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.
2025-01-20 10:06:25 +07:00
Marc Durdin
0b749a5df2 feat(developer): rewrite font data in .kvk from package metadata
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
2025-01-20 09:21:50 +07:00
Marc Durdin
dad1df3194 fix(developer): ensure license parameter is required and add tests
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
2025-01-13 15:10:31 +07:00
Marc Durdin
ee46a6693d chore(developer): Merge branch 'master' into feat/developer/12012-improve-support-for-bcp47 2024-12-06 14:16:00 +07:00
Marc Durdin
cd8825d504
Merge pull request #12736 from keymanapp/refactor/developer/unify_test_action
refactor(developer): unify test action
2024-12-01 00:14:11 +01:00
Eberhard Beilharz
66404f9503
chore(developer): rename test files
This change rename the test files for Developer according to the
discussion at the Keyman conference in November 2024.
2024-11-28 14:32:09 +01:00
Marc Durdin
70a32f00d7 refactor(developer): unify test action 2024-11-28 15:16:25 +07:00
Eberhard Beilharz
21736d8817
refactor(developer): output number of tests when running on TC
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.
2024-11-27 11:41:06 +01:00
Marc Durdin
ce7593bd2f fix(developer): box package compiler info fields
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.
2024-11-13 10:11:44 +07:00
Marc Durdin
5a93bdf6c2 chore(developer): make package subfile description fully optional
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.
2024-11-13 10:03:26 +07:00
Marc Durdin
b80c124ec8
Merge pull request #11014 from keymanapp/feat/developer/kmc-generate
feat(developer): kmc generate
2024-11-08 05:13:51 +01:00
Marc Durdin
e0cc39ee32 refactor(developer): add kps-file-reader and kps-file-writer
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.
2024-10-16 08:45:35 +07:00
Marc Durdin
89e58fbe00
Merge branch 'master' into feat/developer/kmc-generate 2024-10-12 11:48:31 +02:00
Marc Durdin
7dc787b96b fix(developer): use TextDecoder to convert Uint8Array to string
`toString()` only works when the Uint8Array is actually a Node Buffer.
2024-10-11 14:11:45 +07:00
Marc Durdin
0d9688451d
Merge branch 'master' into feat/developer/kmc-generate 2024-10-11 03:26:54 +02:00
Marc Durdin
2b7ceff3e1 chore(developer): add baseline tests for bcp47 codes to kmc-package
Relates-to: #12012
2024-10-07 14:27:15 +07:00
Steven R. Loomis
158c4a7637 feat(developer): update the unified xml parser per review
- declarative syntax for options
- workaround an issue where xml2js is mutating our options objects
- improve tests

Fixes: #12208
2024-09-30 13:25:38 -05:00
Steven R. Loomis
3832ca1c12 feat(developer,common): use unified xml parser
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
2024-09-27 17:49:32 -05:00
Marc Durdin
10e4bba100
Merge branch 'master' into feat/developer/kmc-generate 2024-09-26 18:55:20 +02:00
Eberhard Beilharz
1fe6a0370f
refactor(web): move common/web/eslintcommon/tools/eslint
Fixes: #12386
2024-09-10 19:16:52 +02:00
Marc Durdin
8274d30788 feat(developer): kmc generate cleanup
Cleanup various todo items for kmc generate. Outstanding TODO item is
icon generation for .kmn.
2024-09-03 06:20:28 +07:00
Marc Durdin
ba96d26858 fix(developer): enforce presence of Version field when FollowKeyboardVersion is not set, in package compiler
Fixes: #12193
2024-08-16 08:24:37 +02:00
Marc Durdin
86fd36a713
Merge pull request #12117 from keymanapp/chore/developer/build-ci-linux-mac
chore(developer): start building Developer on linux,mac
2024-08-09 18:57:38 +10:00
Marc Durdin
7bf0d17282 chore(developer): ignore line endings in unit test for kmc-keyboard-info 2024-08-07 13:11:37 +07:00
Marc Durdin
d55558fb31
Merge pull request #12101 from keymanapp/refactor/common/9665-move-xml2js-and-related-deps-to-developer
refactor(common): move xml2js and related deps to @keymanapp/developer-utils 🐉
2024-08-07 15:16:07 +10:00
Marc Durdin
32b4711659
Merge branch 'master' into refactor/common/9665-move-compiler-interfaces-to-developer 2024-08-07 15:15:45 +10:00
Marc Durdin
88506cea6b
Merge branch 'master' into refactor/common/9665-move-kps-file-type-to-developer 2024-08-07 15:13:10 +10:00
Marc Durdin
edf47d7f43 refactor(common): move xml2js and related deps to @keymanapp/developer-utils
Fixes: #9665
2024-08-06 05:19:30 +07:00
Marc Durdin
e67aed1606 refactor(common): move compiler-interfaces to @keymanapp/developer-utils
This should be the last step in the refactoring.

Fixes: #9665
2024-08-02 13:49:59 +07:00