-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
feat(developer): Support blank or missing .model_info/.keyboard_info 🎺 #9351
Comments
Would this also flag if the .model_info or .keyboard_info doesn't match the package ID? e.g. the fix needed in keymanapp/keyboards#2319 |
Well, it just wouldn't find the .model_info or .keyboard_info so it would build defaults. It would mean it wouldn't "go wrong" in the deployment like it did for that PR, but the results still may not be what the dev expected because the misspelled .keyboard_info would still be ignored. |
Removes the following fields: * legacyId * documentationFilename * documentationFileSize * links * related[].note None of these fields are needed any longer; see #9351 for steps to remove data. Eliminates difference between keyboard_info source and distribution, renaming to keyboard_info.schema.json, and updating the required members of the json accordingly. Will have corresponding commits in keyman.com, api.keyman.com, help.keyman.com, and keyboards repositories.
Relates to keymanapp/keyman#9351. Removes: * links --> details moved into description field * legacyId --> from old Tavultesoft infrastructure, very much obsolete t this point * documentationFilename, documentationFileSize --> essentially unused, never referenced by websites * related[].note --> only ever used by one keyboard
In auditing the keyboards repo, I determined that we no longer have any keyboards that are only .js. All keyboards have a .kmp. The following command lists keyboards that have no .kmp file, running e.g. from release/:
It also prints an error if there is no build/ folder, e.g. if you failed to build the keyboard. There are still many keyboards that do not have a .kmx:
For these, we will get as much as we can from the .kmp and fallback to .js for the few fields which are not yet available in the package. |
Relates to #9351. Adds support for building a .keyboard_info file without having source .keyboard_info file: * Constructs a default source .keyboard_info in memory * Hints if license is missing * If LICENSE.md is present, verifies it matches the MIT license text * Adds project option to turn on or off metadata generation. This will default to False for version 1.0 projects, and to True for version 2.0 projects. This means that the keyboard repository will need a PR to enable metadata generation for existing projects in the repository, but this is important to avoid breaking builds for existing projects that are not in the repository. * Turns on additional c8 coverage for kmc projects
Remaining TODO items are tracked in #9235, as this is getting too unwieldy and there are overlapping items. |
With license from kps:Options/LicenseFile == LICENSE.md, and all other data from package/keyboard sources and binaries
Generated fields that don't need change.
The following fields are reliably automatically generated, and we should avoid modifying the code for these:
id
: from folder namename
: from .kmp (or from .js?)authorName
: from .kmpauthorEmail
: from .kmplastModifiedDate
: when .keyboard_info is generatedpackageFilename
: from .kmppackageFileSize
: from .kmpjsFilename
: from .jsjsFileSize
: from .jsisRTL
: from .js or .kmpencodings
: 'unicode'packageIncludes
: from .kmpversion
: from .kmp, .jsminKeymanVersion
: from .kmp, .jshelpLink
: from folder data (id/source/help/id.php existence)platformSupport
: from .kmp, .jssourcePath
: generated from the path in keyboards repodeprecated
: always generated by deprecation references inlinks
Have verified that all release/ and experimental/ keyboards have a .kmp file. This means we can deprecate or even remove the .js parsing, I think, as long as all fields are represented in the .kmp.
General tasks
\r\n
to\n
in kmp.json Description field? ➡ feat(developer): convert markdown description to html 🎺 #9476lastModifiedDate
should be date of last commit in folder, which is possible to achieve during release build:TZ=UTC0 git log -1 --no-merges --date=format:%Y-%m-%dT%H:%M:%SZ --format=%ad
➡ feat(developer): use git's last commit date for keyboard_info 🎺 #9480Schema cleanup
The following fields are not available from .kmp, or only partially available. Suggested action:
license
fieldAction: Add to .kps as LicenseFile, then source that.
description
fieldAction: Add to .kps,
<Info><Description/></Info>
and kmp.json. Must be Markdown, not HTML, and no HTML embed is supported.languages
fieldThis was partially generated from .kps. This is the most complex object.
font
,oskFont
fieldsAction: We will need new a metadata field in the package to support these -- because we cannot necessarily read it all automatically:
family
: from .kmpsource[]
: read from .kmp, always make it an arraysize
: remove from .keyboard_info, unusedwebOskFonts
andwebDisplayFonts
tokeyboard
➡ feat(developer): add web font references to package 🎺 #9463size
from .keyboard_info schema, makesource
always array ➡ chore(developer): cleanup keyboard_info schema 🎺 #9471size
, makesource
always an array ➡ chore: prepare keyboard_info 2.0 documentation 🎺 help.keyman.com#798examples[]{.keys,.text,.note}
fieldAction:
<Examples><Example Text="..." Note="..." Keys="Ctrl+Shift+X A B" /></Examples>
,"examples": [{ "text": "...", "note": "...", "keys": "Ctrl+Shift+X A B"}]
examples
instead ofexample
displayName
,languageName
,scriptName
,regionName
fieldsNo change -- always generated automatically from BCP 47
links
fieldAction:: Only 11 uses, plus some empty arrays. Suggest not supporting in .kps.
links
➡ chore: prepare keyboard_info 2.0 documentation 🎺 help.keyman.com#798related
fieldAction: on
deprecates
andnote
subfieldsdeprecates
: add to .kps, a list of ids in<RelatedKeyboards><RelatedKeyboard Id="id" Deprecates="True" /></RelatedKeyboards>
note
: only used in sil_ipa to ref ipa93_km5, so effectively unused; remove it.notes
field ➡ chore: remove old fields from keyboard_info 🎺 keyboards#2337note
➡ chore: prepare keyboard_info 2.0 documentation 🎺 help.keyman.com#798legacyId
fieldAction: only in legacy keyboards, never generated. Remove altogether as obsolete.
documentationFilename
fieldAction:: only used in legacy/ keyboards, remove it
documentationFileSize
fieldAction: only used in legacy/ keyboards, remove it
Should not require changes to end-user apps, although they could benefit from some of the additional metadata in the future, e.g. showing key sequence to type a sample string in the keyboard.
e.g. see keymanapp/keyboards#2308 (comment)
The text was updated successfully, but these errors were encountered: