The exports of the `util.ts` can now be imported as
`@keymanapp/common-types/utils`. Those methods are used by developer.
We still export the `Uni_IsSurrogate*` methods in `main.js` because they
are needed by the keyboard-processor, but exporting everything would
increase the size of the resulting `keymanweb.js`. Doing it this way
keeps the size the same.
Currently, automatic Keyman minimum version determination works for all
features in Keyman keyboards _except_ `U_xxxx_yyyy` touch key
identifiers.
This change adds the automatic keyboard versioning functionality to the
keymanweb compiler as well, following the pattern that's in kmcmplib.
This makes the `store(&version)` line completely optional, and it may
be possible to deprecate it in future versions of Keyman Developer.
This updates the calculation of the lastModifiedDate property of the
.keyboard_info and .model_info file. It now looks for the most recent
commit to HISTORY.md, and then falls back to the project folder for
.keyboard_info and .model_info.
getLastGitCommitDate now also returns UTC date (it was giving TZ=0
which is affected by daylight saving), and works for a file rather than
just for a folder, and a corresponding unit test has been added.
The date strings returned will now always include '.000' msec suffix. I
have manually verified that the import into the api.keyman.com database
copes with this, and that this change still conforms to the expected
schema for .keyboard_info and .model_info files.
Last, but important, it turned out that the unit tests for kmc were not
running. This has been resolved in kmc/build.sh.
Fixes: #11793
The CLDR imports are copied into the build/ folder, so it makes more
sense for them to be done during the build phase, particularly as it is
a very quick operation. (Before this, removing the build/ folder did not
trigger a build.sh configure, so subsequent tests and usage will fail
with confusing LDML import errors. An alternative solution would have
been to declare the configure output to be one of these files.)
When importing all of events with:
import * as events from 'events';
tsc for kmc-ldml (but not for common/web/types) would error with:
../../../common/web/types/build/src/deps/xml2js/parser.d.ts:17:25 - error TS2306: File '.../node_modules/@types/node/events.d.ts' is not a module.
17 import * as events from "node/events.js";
I am not clear why. Changing to the following side-stepped this:
import { EventEmitter } from 'events';
Use a new flag `--npm-publish` in conjunction with `publish` action,
so that the default will always be to `npm pack` if the new flag is not
specified. This flag is also guarded in the actual npm publish code to
ensure that it can only run in the appropriate CI alpha/beta/stable
environment, and not in local or test.
This then also removes the separate `pack` action.
Also removes legacy boilerplate from a number of build scripts.
Note: there is a bit of potential confusion about the difference between
/resources/builder.inc.sh (the full implementation for builder scripts),
and /resources/build/builder.inc.sh (the source script that builder
scripts should always use).
This allows us to make assumptions that will always be true for builder
scripts that may not be true for other scripts, such as setting base
folder.
Fixes#11324.
* Always `cd "$THIS_SCRIPT_PATH"`
* Remove unnecessary `cd` from all build.sh
* Remove unnecessary `set -eu` from all build.sh (and `# set -x`)
* Replace old build-utils.sh incantation in a few build.sh scripts
- tran: check for \uXXXX earlier in the chain, because we emit this format further down
- add test cases for syntax chars being used in variables
Fixes: bug(core): assert when matching markers #11045
Fixes: bug(developer): escape on string substitution if syntax char #11037
Moved the ERROR_Message line above the Error_Message line for every
message in the compiler message files, as it makes the grouping clearer
once we start adding message details. For example, see the start of the
KmnCompilerMessages class.
Also wraps potentially-undefined parameters to the messages with a new
function `def`, shorthand for `CompilerMessageDef`, which converts the
parameter to '<param>' if it is undefined, which is helpful for
documentation.
Relates to #10207.
In order to include message detail in messages, it is helpful to split
out the exception messages which have a separate parameter, so that
parameter at the same position can be the message detail.
Introduces the CompilerMessageSpecWithException function which takes an
exceptionVar parameter to achieve this differentiation.
This module is used only by Keyman Developer compiler. It was originally
in common-types because we didn't have a shared module for Developer.
Moving it to @keymanapp/developer-utils in order to improve its
documentation.
Fixes#10396.
Instead of `--message 20ae 5006`, which is ambiguous, because 5006 could
be a filename, you must now specify the parameter option flag each time:
`--message 20ae --message 5006` (or `-m 20ae -m 5006`).