Commit graph

1842 commits

Author SHA1 Message Date
Marc Durdin
b050d018f2 chore(developer): prevent recursion when analyzing projects 2023-06-12 12:44:09 +07:00
Marc Durdin
769a08f027 chore(developer): remove old comment 2023-06-12 09:49:12 +07:00
Marc Durdin
f04900a9e9 chore(developer): fixup .kpj reference 2023-06-12 09:36:36 +07:00
Marc Durdin
8a4c005d40 chore(common): define constants for file types
Now that we have the file type detection in place, we can replace
existing references to the file extensions, where possible, with the
constant declarations. While we could rely on TypeScript's typing to use
string-based values, this helps us to avoid using file extensions
directly in string transforms, regex, etc, and use the `KeymanFileTypes`
alias instead.

Note that only references in common/web, and kmc-* projects have been
touched. References in other Developer projects have not been touched,
as some of those are not yet ESM, so that needs to be addressed first.
2023-06-12 09:17:09 +07:00
Marc Durdin
d2029c40cd chore(common): Create file-types.ts module
This module is used for identification of Keyman source and binary file
formats by file extension. It is not yet appropriate to use for
constants; this will come in a future commit.
2023-06-12 08:20:02 +07:00
Marc Durdin
8bfd4c0bae chore(developer): refactor LdmlCompilerOptions
LdmlCompilerOptions is now based on the shared CompilerOptions. Also
fixes command line parameter inheritance for sub-commands.
2023-06-10 14:27:40 +07:00
Marc Durdin
459f42b273 chore(developer): refactor CompilerOptions
Part 1 of the `CompilerOptions` reorg. kmc now uses `CompilerOptions`
throughout, and `CompilerBaseOptions` maps to the set of options
available to all activities.
2023-06-10 14:27:39 +07:00
Marc Durdin
db06dfd810 chore(developer): Merge branch 'feature-kmc-kmw' into feat/developer/kmc-analyze 2023-06-09 14:00:14 +07:00
Marc Durdin
16c40d0d99
Merge pull request #8951 from keymanapp/feat/KmxFileReader-error-handling-and-more
chore(common): cleanup error handling for KmxFileReader and CompilerOptions as shared type
2023-06-09 16:57:54 +10:00
Marc Durdin
fc043c960e chore: tweak CompilerLogLevel 2023-06-09 13:02:17 +07:00
Marc Durdin
3b5c38aa80 feat(developer): use new memory-based kmx compiler in analyze
* Also adds info messages for scanning.
2023-06-09 12:38:20 +07:00
Marc Durdin
fde428fb70 chore(developer): add logLevel to kmc
Tidies up silent vs quiet vs verbose by adding logLevel as an option.

* Notes that we need to consolidate all the various CompilerOptions
  interfaces before they get too much further out of hand.
* Cleans up a couple of other minor TODO items.
2023-06-09 10:23:06 +07:00
Marc Durdin
1670b3099f chore(developer): cleanup kmc-analyze build.sh 2023-06-09 10:20:54 +07:00
Marc Durdin
b06981fff8 chore(developer): fixup kmc-analyze call in kmc 2023-06-09 06:51:10 +07:00
Marc Durdin
915311c5fc chore(developer): fixup gosh ref 2023-06-09 06:03:28 +07:00
Marc Durdin
427c326682 chore(developer): cleanup kmc-analyze build and test 2023-06-09 05:20:25 +07:00
Marc Durdin
c02b271394 chore: cleanup unneeded changes 2023-06-08 15:17:09 +07:00
Marc Durdin
57d3a4617a chore: cleanup unneeded changes 2023-06-08 15:13:59 +07:00
Marc Durdin
f6e52270ed chore(developer): Merge branch 'feature-kmc-kmw' into feat/developer/kmc-analyze 2023-06-08 14:59:28 +07:00
Marc Durdin
1b4bce7f65 chore(developer): skip c8 test for kmc-kmw for now 2023-06-08 14:42:57 +07:00
Marc Durdin
d3e01f620b chore(developer): split CKF_KEYMANWEB for typescript compiler 2023-06-08 14:42:56 +07:00
Marc Durdin
02fef8ac18 chore(developer): use older pattern for row id
In order to match existing behaviour with the legacy KeymanWeb compiler,
we should use quoted numbers for row ids. This behaviour can probably be
changed over to the new model in the future, but for now this prevents
unit tests from causing us grief.
2023-06-08 14:42:56 +07:00
Marc Durdin
f111aedbe7 chore(developer): rollback temp kmcomp js build stub 2023-06-08 14:42:55 +07:00
Marc Durdin
6421a1f6f4
chore: Apply suggestions from code review
Co-authored-by: Joshua Horton <joshua_horton@sil.org>
2023-06-08 17:34:37 +10:00
Marc Durdin
0ed0de8ea5 chore(developer): fix path ref 2023-06-08 09:49:14 +07:00
Marc Durdin
9f71f093cb chore(common): export KmxFileReaderError 2023-06-08 08:51:08 +07:00
Marc Durdin
ba12a063ae
Merge branch 'feature/kmc-kmw' into feat/typescript-keymanweb-compiler 2023-06-08 09:20:55 +10:00
Marc Durdin
483e43ca69 chore(developer): seed kmc-kmw 2023-06-08 06:17:18 +07:00
Marc Durdin
e2f5b88078 chore(developer): rename build/ to buildClasses/
Our dev env mostly assumes that build/ is for build artifacts, so this
just sidesteps issues with code search, etc.

The other glaring example of this is resources/build/ which is a _much_
more painful change, given how many scripts reference it. So not
changing that for now.
2023-06-08 05:43:33 +07:00
Marc Durdin
a1fdc7b133 refactor(developer): CompilerOptions as shared type
Also fixes handling of kmx errors in kmc-package.
2023-06-08 05:42:23 +07:00
Marc Durdin
4c3acaf651 chore(common): update restructure to support typescript 2023-06-08 05:40:48 +07:00
Marc Durdin
52a08ef21a
Merge pull request #8934 from keymanapp/chore/core/emscripten-location-tweaks
chore(core): look for emcc.py, not emcc
2023-06-07 12:17:35 +10:00
Marc Durdin
044a14f1d9 chore(core): look for emcc.py, not emcc
Relates to #8913.
2023-06-06 07:07:07 +07:00
Marc Durdin
eaf7a6b628 chore(developer): merge changed interfaces in compiler 2023-06-05 16:34:23 +07:00
Marc Durdin
91f985de03 chore(developer): cleanup build.sh 2023-06-05 16:33:38 +07:00
Marc Durdin
eab503a829 chore(developer): roll back CKF_KEYMANWEB_MODERN, not needed 2023-06-05 16:19:41 +07:00
Marc Durdin
9d85712039 chore(developer): rollback unneeded kmcomp changes 2023-06-05 16:10:57 +07:00
Marc Durdin
3f993bd651 chore: Merge branch 'master' into feat/typescript-keymanweb-compiler 2023-06-05 15:57:42 +07:00
Marc Durdin
18a3ef36bc chore(developer): ensure kmcmplib messages are all UTF-8
Fixes #8887.
2023-06-05 15:46:40 +07:00
Marc Durdin
e96cd3af11
Merge pull request #8915 from keymanapp/chore/developer/8888-long-line-test
chore(developer): verify long lines compile correctly
2023-06-04 21:15:46 +10:00
Marc Durdin
16675ef46b
chore: extend from test options in e2e test 2023-06-02 18:54:42 +10:00
Marc Durdin
0ec5c08b26 chore(common): move const url to class prop
We still have cjs modules that rely on the ldml-keyboard-xml-reader, and
this meant that an exported const was being calculated with an invalid
meta url, which crashed the cjs module require() call.
2023-06-02 12:28:13 +07:00
Marc Durdin
d7f22b186f chore(developer): verify long lines compile correctly
Fixes #8888.

Verifies that wrapped lines (ending in \) are handled correctly in
kmcmplib.
2023-06-02 12:01:58 +07:00
Marc Durdin
4e535832d8 chore: cleanup 2023-06-02 11:45:59 +07:00
Marc Durdin
b313272250 chore(common): remove url module ref from common/web/types
The url module is a node module. We need to move responsibility for
resolving the path of the LDML XML <import> statements out of
common/web/types, and into the ultimate consumer, so it's now surfaced
as an option, along with a helper constant that reports the
import.meta.url-relative base path of the standard imports that are
compiled into common/web/types.

This hopefully means we can use this module in both browser and node
contexts without trouble.
2023-06-02 11:38:17 +07:00
Marc Durdin
9a4345c736
Merge pull request #8908 from keymanapp/chore/developer/8885-error-check-loadFile-callback
chore(developer): loadFile callback error check and optimization
2023-06-02 13:21:04 +10:00
Marc Durdin
355b5f9085
Merge pull request #8907 from keymanapp/refactor/developer/8883-move-filename-consistency-check-to-kmc
refactor(developer): move filename consistency check to kmc
2023-06-02 13:20:57 +10:00
Marc Durdin
f762b31d01
Merge pull request #8899 from keymanapp/refactor/developer/8889-kmcmplib-interface-shuffle
refactor(developer): rearrange kmcmplib interface source
2023-06-02 13:20:50 +10:00
Marc Durdin
7301281247 chore(developer): loadFile callback error check and optimization
Fixes #8885.

Adds some optimization and error checking to the loadFile callback in
kmc-kmn. Also handles case of zero-byte bitmap file so we won't crash on
it.
2023-06-01 15:31:31 +07:00
Marc Durdin
c3458d040c refactor(developer): move filename consistency check to kmc
kmcmplib no longer has any filesystem access, so it cannot verify if a
referenced filename in a source file has the same case as the actual
filename on disk (a risk when moving projects between platforms). So
I opted to move this to the `loadFile` callback in kmc, which is the
only place where filesystem is actually accessed, and added
corresponding unit test.

Small additional fixes here:

1. Move from `Buffer` to `Uint8Array` in all kmc-* modules, so that we
   remove that barrier to running on web.
2. Use `callbacks.loadFile` instead of `callbacks.fs.readFileSync`, so
   that we can be sure to run the filename consistency check.
3. Fixed kps parser silently swallowing xml errors on load.
4. Added silent mode to NodeCompilerCallbacks so we could cleanly test
   the new filename consistency hint.
5. Noted a location where we still have NodeJS deps in kmc-ldml.
2023-06-01 15:11:38 +07:00