Commit graph

33096 commits

Author SHA1 Message Date
Darcy Wong
86c740e708
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2022-09-28 19:48:07 +07:00
Marc Durdin
7a819598e7 fix(developer): Handle hints and warnings cleanly
Relates to #4324 (but slightly orthogonal.)

We wanted some message classes to be handled in the lexical model editor
more cleanly, including drill-down to line of error. A few changes
required to make this work well:

1. Parse error messages from kmlmc. This is not perfect but works while
   the two projects are kept in sync, which they always are for Keyman
   Developer. Note that at this stage, .ts warnings are not captured in
   this parser, as they are generated by tsc.
2. Drill-down in Wordlist Editor Frame to find line of error
3. Model editor reports ownership of .tsv files so they can be loaded
4. In case of model editor not open (e.g. building from project view),
   the TSV standalone editor was not displaying the frame, so it never
   actually worked.
5. If the text editor had never loaded, then FindError was effectively
   a no-op; adds code to seek to error line after page load finishes.
6. Ensures that if we attempt to seek an error in a sub-file owned by
   an editor (e.g. .tsv owned by .model.ts, .kvks owned by .kmn), that
   the parent editor will be focused first. Does not verify all paths
   here, just the tsv one.
2022-09-28 20:17:44 +10:00
Marc Durdin
73e0a2e461 fix(developer): generate valid js when using unquoted digits in stores
Fixes #7005.

If a developer used single digit values in stores, unquoted (which is
not really the usual approach, but should work just fine for non-zero
values), the KMW compiler would emit invalid single-digit hexadecimal
escapes for them, e.g. `"\x1"` instead of `"\x01"`.

Sample code:

```
store(option) 1

if(option = 1) + 'a' > 'one'
if(option = 2) + 'a' > 'two'
+ '1' > set(option = 1)
+ '2' > set(option = 2)
```

It is not immediately obvious from this code, but the value `1` is
actually a character with value `'\x01'` or `U+0001`!

The more usual approach will not encounter this problem:

```
store(option) '1'

if(option = '1') + 'a' > 'one'
if(option = '2') + 'a' > 'two'
+ '1' > set(option = '1')
+ '2' > set(option = '2')
```

Note that the following is a compile error (due to internal use of
null terminated strings).

```
store(option) 0
```
2022-09-28 17:00:55 +10:00
Marc Durdin
f5b8effaae fix(developer): ensure backslash in paths passed to kmcomp
Fixes #7090.
Fixes #7091.

While kmcomp loads most files just fine when paths with forward slashes
are passed in, it fails to parse target path correctly when building one
file out of a project.

For example, if the user runs:

```
kmcomp.exe -t khmer_angkor.kmn release/k/khmer_angkor/khmer_angkor.kpj
```

Then the following error arises:

```
khmer_angkor.kps: Error: 0001 Validation error: The system cannot find the path specified.
khmer_angkor.kps: Failure: Package C:\Projects\keyman\keyboards\source\khmer_angkor.kps had validation errors.
```

This patch ensures all paths passed in as command-line parameters are
converted to backslashes, matching the expected Windows format. While I
only needed to fix the `FParamTarget` parameter in order to address the
reported issues, for consistency I applied the same fix to all input
paths.
2022-09-28 16:50:58 +10:00
Marc Durdin
50614fb088 fix(developer): handle invalid kps xml when loading project view
Fixes #7368.
2022-09-28 16:32:36 +10:00
Darcy Wong
06e31e5cfc chore(common): Update builder.inc.sh path 2022-09-28 12:57:01 +07:00
Darcy Wong
28ddfdb70a chore(common): Move builder.inc.sh up to resources/ 2022-09-28 12:56:43 +07:00
Darcy Wong
0645524022
Apply suggestions from code review
Co-authored-by: Marc Durdin <marc@durdin.net>
2022-09-28 12:56:16 +07:00
Marc Durdin
0b701275fd chore(developer): remove unused var 2022-09-28 15:25:35 +10:00
Ross
d2075cdbcc feat(windows): fix localisation for enable/disable 2022-09-28 15:00:05 +10:00
Darcy Wong
e021116aea chore(common): Add newline 2022-09-28 09:22:05 +07:00
Darcy Wong
ae892c10f7 chore(common): Resolve review comments 2022-09-28 09:09:24 +07:00
Darcy Wong
fcc4fdca61 chore(common): Add _builder_init 2022-09-28 09:09:09 +07:00
Darcy Wong
17435c310b chore(common): Add builder_die 2022-09-28 08:29:16 +07:00
Darcy Wong
824319d398 chore(common): Revert move of die to builder_die 2022-09-28 08:24:08 +07:00
Ross
85ede116b9 feat(windows): address review comments 2022-09-28 11:14:35 +10:00
Darcy Wong
dd07f1c333 refactor(common): Add _builder_findRepoRoot 2022-09-28 08:10:57 +07:00
Darcy Wong
f95e17483b refactor(common): Revert move of KEYMAN_ROOT to REPO_ROOT 2022-09-28 07:56:08 +07:00
Darcy Wong
d5df060e76 chore(common): Move KEYMAN_ROOT to REPO_ROOT 2022-09-27 15:23:32 +07:00
Darcy Wong
a31c8931f1 chore(common): Move die to builder_die 2022-09-27 15:18:48 +07:00
Darcy Wong
22767bd6be chore(common): Split builder portion of script 2022-09-27 14:43:14 +07:00
Marc Durdin
0f961bd674 feat(developer): visual keyboard compiler in kmc
Adds support for building .kvk files to kmc. At present, .kvk will
always be generated, even if the .xml does not have a hardware layer.
2022-09-27 15:16:07 +10:00
Marc Durdin
b6abe7432a feat(developer): emit .kvk plus e2e test
Adds visual-keyboard-compiler and corresponding e2e test.
2022-09-27 15:03:31 +10:00
rc-swag
7ac4dd64b8
feat(windows): address review comments
Co-authored-by: Marc Durdin <marc@durdin.net>
Co-authored-by: Eberhard Beilharz <ermshiperete@users.noreply.github.com>
2022-09-27 14:47:42 +10:00
Joshua A. Horton
f557f5636a fix(web): design-iframes too 2022-09-27 10:46:55 +07:00
Marc Durdin
eb0dbef9d4 chore: npm install 2022-09-27 13:43:58 +10:00
Marc Durdin
03c3c40f29 chore(developer): remove visual-keyboard-compiler.ts 2022-09-27 13:42:56 +10:00
Joshua A. Horton
59b6b6e804 fix(web): getTextAfterCaret() should never return undefined 2022-09-27 10:34:41 +07:00
Marc Durdin
26e32a0124 refactor(developer): split file type management into package
Splits file format reading, writing, and in-memory structures of .kmx,
.kvk, .kvks, .xml (ldml keyboard) into separate common module. Lots of
little fixups, sorry...

This will make it much easier for us to reuse these readers and writers
in future code.
2022-09-27 12:33:10 +10:00
Joshua A. Horton
0bbc3e7375 chore(web): reverts accidental branch creep 2022-09-27 08:59:56 +07:00
Joshua Horton
fc7dfb9879
Merge pull request #7346 from keymanapp/chore/web/update-toolchain
chore(web): update Node dev-dependencies
2022-09-27 08:53:42 +07:00
Marc Durdin
52dd3e0e85 refactor(developer): move compiler callbacks out of kvks file reader 2022-09-27 05:04:04 +10:00
Marc Durdin
5c65405f65 refactor(developer): move compiler callbacks out of ldml xml reader 2022-09-27 04:52:00 +10:00
Keyman Server
497a8613db
Merge pull request #7356 from keymanapp/auto/version-master-16.0.71
auto: increment master version to 16.0.71
2022-09-27 04:02:24 +10:00
Keyman Build Agent
ee86250eec auto: increment master version to 16.0.71 2022-09-26 14:01:38 -04:00
Marc Durdin
9480d8931e chore(developer): remove commented code 2022-09-26 20:41:59 +10:00
Marc Durdin
74fc795c1c feat(developer): refactor CompilerCallbacks in tests
Now has a shared object for all tests, reset between tests, and if the
test fails, prints any reported compiler messages.

Also updates kvk and kvks tests with refactored names from previous
commit.
2022-09-26 20:07:00 +10:00
Marc Durdin
50db7a2c9b feat(developer): add schemas for .kvk and .kvks
Also minor tweaks around reading .xml files.
2022-09-26 20:05:52 +10:00
Darcy Wong
28fd95fce2
Merge pull request #7350 from keymanapp/chore/history-15-0-stable
chore(common): Add 15.0 stable entries to HISTORY.md 🍒
2022-09-26 12:57:29 +07:00
Darcy Wong
4e1efb2fc1
Merge pull request #7347 from keymanapp/fix/android/en-language-name
fix(android): Add language name when installing default lexical-model
2022-09-26 08:13:49 +07:00
Marc Durdin
c7740a39a2 feat(developer): kvk support
Part of #7238.

Supports reading and writing .kvk files, and reading .kvks files,
to/from an in-memory VisualKeyboard object.

TODO:
 - Full validation of .kvks files
 - Writing .kvks files
 - Some cleanup of API surfaces for consistency
2022-09-26 09:29:38 +10:00
sgschantz
ae3b9c82bc improved comments and updated alert string 2022-09-25 17:21:45 +07:00
sgschantz
c6a6e32e11 add mechanism to check for required permissions and prompt the user before the system does 2022-09-25 16:18:07 +07:00
Marc Durdin
828cbdf584
Merge pull request #7341 from keymanapp/feat/developer/epic-ldml/7277-kmc-makes-keyboard-packages
feat(developer): fixes to kmc-package for keyboard support 🙀
2022-09-24 10:12:38 +10:00
Marc Durdin
0502d6ccbd
Merge pull request #7342 from keymanapp/chore/epic-ldml/merge-master-to-feature-ldml
chore: merge master into feature-ldml 🙀
2022-09-24 10:12:00 +10:00
Steven R. Loomis
aff9a93960
Merge pull request #7300 from keymanapp/chore/core/7276-checksums-epic-ldml
chore(core): ignore checksum in 16.0 🙀
2022-09-23 15:53:42 -05:00
Steven R. Loomis
03012248a2 chore(windows): remove crc32 from tike 2022-09-23 11:48:47 -05:00
Darcy Wong
3239a1e7e3 fix(web): Update spacebar caption when refreshing layout 2022-09-23 12:45:17 +07:00
Darcy Wong
6418852eec chore(common): Add 15.0 stable entries to HISTORY.md 2022-09-23 10:11:21 +07:00
Steven R. Loomis
1ac4e116b4 chore(windows): remove crc32 from mcompile 2022-09-22 18:42:38 -05:00