Skip to content

Commit aa9788a

Browse files
committed
chore(common): remove deprecated fields from keyboard_info
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.
1 parent 06f2c64 commit aa9788a

File tree

9 files changed

+18
-58
lines changed

9 files changed

+18
-58
lines changed

common/schemas/keyboard_info/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,19 @@
11
# keyboard_info
22

3-
* **keyboard_info.source.json**
4-
* **keyboard_info.distribution.json**
3+
* **keyboard_info.schema.json**
54

65
Documentation at https://help.keyman.com/developer/cloud/keyboard_info
76

87
* Primary version:
9-
* https://github.com/keymanapp/api.keyman.com/tree/master/schemas/keyboard_info.source
10-
* https://github.com/keymanapp/api.keyman.com/tree/master/schemas/keyboard_info.distribution
8+
* https://github.com/keymanapp/api.keyman.com/tree/master/schemas/keyboard_info
119
* Synchronized copies at:
1210
* https://github.com/keymanapp/keyman/tree/master/common/schemas/keyboard_info
1311

1412
# .keyboard_info version history
1513

14+
## 2023-08-11 2.0 stable
15+
* Removed legacyId, documentationFilename, documentationFileSize. Source vs distribution keyboard_info distinction is removed.
16+
1617
## 2019-09-06 1.0.6 stable
1718
* No changes (see api.keyman.com#36 and api.keyman.com#59. Reverted in 2020-06-10.).
1819

common/schemas/keyboard_info/keyboard_info.distribution.json

Lines changed: 0 additions & 8 deletions
This file was deleted.

common/schemas/keyboard_info/keyboard_info.source.json renamed to common/schemas/keyboard_info/keyboard_info.schema.json

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,17 @@
1717
{ "$ref": "#/definitions/KeyboardLanguageInfo" }
1818
]},
1919
"lastModifiedDate": { "type": "string", "format": "date-time" },
20-
"links": { "type": "array", "items": { "$ref": "#/definitions/KeyboardLinkInfo" } },
2120
"packageFilename": { "type": "string", "pattern": "\\.km[xp]$" },
2221
"packageFileSize": { "type": "number" },
2322
"jsFilename": { "type": "string", "pattern": "\\.js$" },
2423
"jsFileSize": { "type": "number" },
25-
"documentationFilename": { "type": "string", "pattern": "\\.(rtf|html?|pdf|txt)$" },
26-
"documentationFileSize": { "type": "number" },
2724
"isRTL": { "type": "boolean" },
2825
"encodings": { "type": "array", "items": { "type": "string", "enum": ["ansi", "unicode"] }, "additionalItems": false },
2926
"packageIncludes": { "type": "array", "items": { "type": "string", "enum": ["welcome", "documentation", "fonts", "visualKeyboard"] }, "additionalItems": false },
3027
"version": { "type": "string" },
3128
"minKeymanVersion": { "type": "string", "pattern": "^\\d+\\.\\d$" },
3229
"helpLink": { "type": "string", "pattern": "^https://help\\.keyman\\.com/keyboard/" },
3330
"platformSupport": { "$ref": "#/definitions/KeyboardPlatformInfo" },
34-
"legacyId": { "type": "number" },
3531
"sourcePath": { "type": "string", "pattern": "^(release|legacy|experimental)/.+/.+$" },
3632
"related": { "type": "object", "patternProperties": {
3733
".": { "$ref": "#/definitions/KeyboardRelatedInfo" }
@@ -40,9 +36,7 @@
4036
},
4137
"deprecated": { "type": "boolean" }
4238
},
43-
"required": [
44-
"license", "languages"
45-
]
39+
"required": [ "id", "name", "license", "languages", "lastModifiedDate", "platformSupport" ]
4640
},
4741

4842
"KeyboardLanguageInfo": {
@@ -140,16 +134,6 @@
140134
"additionalProperties": false
141135
},
142136

143-
"KeyboardLinkInfo": {
144-
"type": "object",
145-
"properties": {
146-
"name": { "type": "string" },
147-
"url": { "type": "string" }
148-
},
149-
"required": ["name", "url"],
150-
"additionalProperties": false
151-
},
152-
153137
"KeyboardPlatformInfo": {
154138
"type": "object",
155139
"patternProperties": {
@@ -163,8 +147,7 @@
163147
"type": "object",
164148
"properties": {
165149
"deprecates": { "type": "boolean" },
166-
"deprecatedBy": { "type": "boolean" },
167-
"note": { "type": "string" }
150+
"deprecatedBy": { "type": "boolean" }
168151
},
169152
"required": [],
170153
"additionalProperties": false

developer/src/inst/download.in.mak

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ make-kmcomp-install-zip: copy-schemas
119119
kmconvert.exe \
120120
sentry.dll sentry.x64.dll \
121121
kmdecomp.exe \
122-
keyboard_info.source.json keyboard_info.distribution.json \
122+
keyboard_info.schema.json \
123123
keyman-touch-layout.spec.json keyman-touch-layout.clean.spec.json \
124124
xml\layoutbuilder\*.keyman-touch-layout \
125125
projects\* \
@@ -130,8 +130,7 @@ make-kmcomp-install-zip: copy-schemas
130130
# ldml-keyboard.schema.json ldml-keyboardtest.schema.json \
131131
132132
copy-schemas:
133-
copy $(KEYMAN_ROOT)\common\schemas\keyboard_info\keyboard_info.source.json $(DEVELOPER_ROOT)\bin
134-
copy $(KEYMAN_ROOT)\common\schemas\keyboard_info\keyboard_info.distribution.json $(DEVELOPER_ROOT)\bin
133+
copy $(KEYMAN_ROOT)\common\schemas\keyboard_info\keyboard_info.schema.json $(DEVELOPER_ROOT)\bin
135134
copy $(KEYMAN_ROOT)\common\schemas\keyman-touch-layout\keyman-touch-layout.spec.json $(DEVELOPER_ROOT)\bin
136135
copy $(KEYMAN_ROOT)\common\schemas\keyman-touch-layout\keyman-touch-layout.clean.spec.json $(DEVELOPER_ROOT)\bin
137136
copy $(KEYMAN_ROOT)\common\schemas\displaymap\displaymap.schema.json $(DEVELOPER_ROOT)\bin

developer/src/inst/kmdev.wxs

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -184,11 +184,7 @@
184184
</Component>
185185

186186
<Component>
187-
<File Name="keyboard_info.distribution.json" Source="..\..\..\common\schemas\keyboard_info\" KeyPath="yes" />
188-
</Component>
189-
190-
<Component>
191-
<File Name="keyboard_info.source.json" Source="..\..\..\common\schemas\keyboard_info\" KeyPath="yes" />
187+
<File Name="keyboard_info.schema.json" Source="..\..\..\common\schemas\keyboard_info\" KeyPath="yes" />
192188
</Component>
193189

194190
<!-- Data Files -->

developer/src/kmc-keyboard-info/src/index.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,9 @@ export class KeyboardInfoCompiler {
126126
}[] = this.loadKmxFiles(sources.kpsFileName, sources.kmpJsonData);
127127

128128
//
129-
// Build merged .keyboard_info file
130-
// https://api.keyman.com/schemas/keyboard_info.source.json and
131-
// https://api.keyman.com/schemas/keyboard_info.distribution.json
132-
// https://help.keyman.com/developer/cloud/keyboard_info/1.0
129+
// Build .keyboard_info file
130+
// https://api.keyman.com/schemas/keyboard_info.schema.json
131+
// https://help.keyman.com/developer/cloud/keyboard_info/2.0
133132
//
134133

135134
keyboard_info.isRTL = keyboard_info.isRTL ?? !!jsFile?.match(/this\.KRTL=1/);

developer/src/kmc-keyboard-info/src/keyboard-info-file.ts

Lines changed: 2 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -12,35 +12,25 @@ export interface KeyboardInfoFile {
1212
license?: "freeware" | "shareware" | "commercial" | "mit" | "other";
1313
languages?: string[] | {[bcp47: string]: KeyboardInfoFileLanguage};
1414
lastModifiedDate?: string;
15-
links?: KeyboardInfoFileLink[];
1615
packageFilename?: string;
1716
packageFileSize?: number;
1817
jsFilename?: string;
1918
jsFileSize?: number;
20-
documentationFilename?: string;
21-
documentationFileSize?: number;
2219
isRTL?: boolean;
2320
encodings: KeyboardInfoFileEncodings[];
2421
packageIncludes?: KeyboardInfoFileIncludes[];
2522
version?: string;
2623
minKeymanVersion?: string;
2724
helpLink?: string;
2825
platformSupport?: {[id in KeyboardInfoFilePlatform]?: KeyboardInfoFilePlatformSupport};
29-
legacyId?: number;
3026
sourcePath?: string;
3127
related?: {[id: string]: KeyboardInfoFileRelated};
3228
deprecated?: boolean;
3329
}
3430

35-
export interface KeyboardInfoFileLink {
36-
name: string;
37-
url: string;
38-
}
39-
4031
export interface KeyboardInfoFileRelated {
41-
deprecates?: string;
42-
deprecatedBy?: string;
43-
note?: string;
32+
deprecates?: boolean;
33+
deprecatedBy?: boolean;
4434
}
4535

4636
export interface KeyboardInfoFileLanguage {

developer/src/tike/compile/MergeKeyboardInfo.pas

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
# packageFileSize -- get from the size of the file
2020
# jsFilename -- from $keyboard_info_jsFilename
2121
# jsFileSize -- get from the size of the file
22-
# documentationFileSize -- get from the size of the file
2322
# isRTL -- from .js, KRTL\s*=\s*1
2423
# encodings -- from .kmx (existence of .js implies unicode)
2524
# packageIncludes -- from kmp.inf?
@@ -727,7 +726,7 @@ procedure TMergeKeyboardInfo.CheckOrAddEncodings;
727726
end;
728727

729728
//
730-
// packageFileSize, jsFileSize, documentationFileSize, all from the actual files
729+
// packageFileSize, jsFileSize, all from the actual files
731730
//
732731
procedure TMergeKeyboardInfo.CheckOrAddFileSizes;
733732
procedure DoFileSize(prefix: string);
@@ -756,7 +755,6 @@ procedure TMergeKeyboardInfo.CheckOrAddFileSizes;
756755
begin
757756
DoFileSize('js');
758757
DoFileSize('package');
759-
DoFileSize('documentation');
760758
end;
761759

762760
//

developer/src/tike/compile/ValidateKeyboardInfo.pas

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
unit ValidateKeyboardInfo;
22

3+
// TODO: this unit is deprecated
4+
35
interface
46

57
uses

0 commit comments

Comments
 (0)