Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(developer): bring kmc-package inline with file format spec 🗜 #9210

Merged
merged 4 commits into from
Jul 6, 2023

Conversation

mcdurdin
Copy link
Member

@mcdurdin mcdurdin commented Jul 6, 2023

Fixes #9198.
Fixes #9203.
Fixes #9204.
Fixes #9205.
Fixes #9207.
Fixes #9208.
Fixes #9209.

Seven fixes. Four of these are in a single commit, as they were too tangled to easily do as separate commits. A thousand apologies.

@keymanapp-test-bot skip

Fixes #9208.
Fixes #9209.
Fixes #9203.
Fixes #9198.

The changes here overlap in kmp-compiler.ts. Addresses several issues
with the package compiler:

* refactors the reading of the metadata from keyboards to make use of it
  when refreshing the keyboard metadata in kmp.json (#9208). This is the
  bulk of the changes.
* Fixes case on some fields in the kps file format (#9209)
* Removes code which emitted strings table to kmp.json, as these were
  only ever used for package installer executables (#9203)
* Cleans up code which emitted Start Menu items to make it match spec
  (#9198)
@mcdurdin mcdurdin added this to the A17S16 milestone Jul 6, 2023
@@ -71,7 +71,11 @@ export class KmpCompiler {
if(kps.options) {
for (let [src,dst] of keys) {
if (kps.options[src]) {
kmp.options[dst] = kps.options[src];
if(dst == 'graphicFile' || dst == 'readmeFile') {
kmp.options[dst] = /[/\\]?([^/\\]*)$/.exec(kps.options[src])[1];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So... why are we stripping the path selectively here? I assume there are other dst values that should remain unstripped?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those are the only two options that are paths

@@ -94,7 +94,7 @@ export interface KpsFileKeyboard {
version: string;
oSKFont?: string;
displayFont?: string;
rtl?: boolean;
rTL?: string;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What sort of convention is this? I'd rather keep it purely lower-cased. Also not a fan of oSKFont. (Title-case for an abbrevation is... okay if necessary. I'm generally not a fan of mixed-case within a coding abbreviation unless it causes issues parsing something in camelCase or similar.)

I checked the referenced issue, but there's no detail there for me to compare against.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It sounds like there may be some pre-established spec that mandates this... but there was no link for me to follow and verify that. I'll definitely acquiesce if this is the case.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've discussed this before. It's a "feature" of the xml2js implementation and options selected which I am still considering winding back, see #7353. I reckon we should call it dONKEYCase (or aSSCase but that's a little dangerous).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, so not exactly a "spec", but it's a pre-established thing we have to put up with for now b/c triage. 👍 Good to have the reference, at least.

Base automatically changed from fix/developer/kmc-various-fixes to feature-kmc-kmw July 6, 2023 09:58
@mcdurdin mcdurdin merged commit eeecb72 into feature-kmc-kmw Jul 6, 2023
@mcdurdin mcdurdin deleted the fix/developer/kmc-package-final-fixes branch July 6, 2023 09:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment