keymanapp / keyman

Keyman cross platform input methods system running on Android, iOS, Linux, macOS, Windows and mobile and desktop web
https://keyman.com/
Other
394 stars 110 forks source link

feat(developer): Add hints, warnings, and errors to ts-based package compiler #8150

Closed mcdurdin closed 1 year ago

mcdurdin commented 1 year ago

We need to ensure that all the error checking that is currently done in the pascal-based package compiler is replicated in the typescript version.


Originally posted by @mcdurdin in https://github.com/keymanapp/keyman/issues/8119#issuecomment-1413295606

mcdurdin commented 1 year ago
See #8657 e.g. this should be a friendly error message (17.0.89-alpha): ``` C:\Projects\keymanapp\keyboards\release\k\khmer_angkor\source>kmc build khmer_angkor.kps Building khmer_angkor.kps Error: ENOENT: no such file or directory, open 'C:\Projects\keymanapp\keyboards\release\k\khmer_angkor\build\khmer_angkor.js' at Object.openSync (node:fs:601:3) at Module.readFileSync (node:fs:469:35) at file:///C:/Users/mcdurdin/AppData/Roaming/npm/node_modules/@keymanapp/kmc/node_modules/@keymanapp/kmc-package/build/src/kmp-compiler.js:222:27 at Array.forEach () at KmpCompiler.buildKmpFile (file:///C:/Users/mcdurdin/AppData/Roaming/npm/node_modules/@keymanapp/kmc/node_modules/@keymanapp/kmc-package/build/src/kmp-compiler.js:198:20) at BuildPackage.build (file:///C:/Users/mcdurdin/AppData/Roaming/npm/node_modules/@keymanapp/kmc/build/src/activities/BuildPackage.js:19:38) at build (file:///C:/Users/mcdurdin/AppData/Roaming/npm/node_modules/@keymanapp/kmc/build/src/commands/build.js:38:26) at Command. (file:///C:/Users/mcdurdin/AppData/Roaming/npm/node_modules/@keymanapp/kmc/build/src/commands/build.js:18:20) at Command.listener [as _actionHandler] (C:\Users\mcdurdin\AppData\Roaming\npm\node_modules\@keymanapp\kmc\node_modules\commander\lib\command.js:482:17) at C:\Users\mcdurdin\AppData\Roaming\npm\node_modules\@keymanapp\kmc\node_modules\commander\lib\command.js:1283:65 { errno: -4058, syscall: 'open', code: 'ENOENT', path: 'C:\\Projects\\keymanapp\\keyboards\\release\\k\\khmer_angkor\\build\\khmer_angkor.js' } ```
mcdurdin commented 1 year ago
See #8658 Per the OP, #8151 needs to be implemented in kmc-package.
mcdurdin commented 1 year ago
See #8659 ``` AssertionError: expected [Function] to not throw an error but 'TypeError: Cannot read properties of undefined (reading \'executeProgram\')' was thrown ``` Note: executeProgram should be optional (all of Options key is optional)
mcdurdin commented 1 year ago

See also #7353

mcdurdin commented 1 year ago

Marking this as done. #7353 is mostly around regression-testing the new compiler, which will come later. All other hints and warnings have been implemented.