Skip to content

Commit

Permalink
Merge pull request #12665 from keymanapp/chore/developer/package-desc…
Browse files Browse the repository at this point in the history
…ription-optional

chore(developer): make package subfile description fully optional
  • Loading branch information
mcdurdin authored Nov 25, 2024
2 parents 468d249 + 138f3c2 commit 2f401f5
Show file tree
Hide file tree
Showing 14 changed files with 68 additions and 68 deletions.
2 changes: 1 addition & 1 deletion common/web/types/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ function do_test() {

#-------------------------------------------------------------------------------------------------------------------

builder_run_action clean rm -rf ./build/ ./tsconfig.tsbuildinfo
builder_run_action clean rm -rf ./build/ ./tsconfig.tsbuildinfo ./src/schemas/ ./node_modules/ ./obj/
builder_run_action configure do_configure
builder_run_action build tsc --build
builder_run_action test do_test
Expand Down
2 changes: 1 addition & 1 deletion common/web/types/src/package/kmp-json-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export interface KmpJsonFileInfoItem {

export interface KmpJsonFileContentFile {
name: string;
description: string;
description?: string;
copyLocation?: number;
}

Expand Down
6 changes: 3 additions & 3 deletions developer/src/common/web/utils/src/types/kps/kps-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,11 @@ export interface KpsFileContentFiles {
export interface KpsFileContentFile {
Name: string;
/** @deprecated */
Description: string;
Description?: string;
/** @deprecated */
CopyLocation: string;
CopyLocation?: string;
/** @deprecated */
FileType: string;
FileType?: string;
}

export interface KpsFileLexicalModel {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Copyright URL="">© 2023 Geʾez Frontier Foundation</Copyright>
<Author URL="mailto:[email protected]">Geʾez Frontier Foundation</Author>
<Version URL="">1.0.1</Version>
<Description>The Tigrinya-Eritrea lexical model is based on the content found from 131 issues of the Haddas Eritrea (ሓዳስ ኤርትራ) newspaper.</Description>
<Description URL="">The Tigrinya-Eritrea lexical model is based on the content found from 131 issues of the Haddas Eritrea (ሓዳስ ኤርትራ) newspaper.</Description>
</Info>
<Files>
<File>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Version URL=""/>
<Name URL="">Kmhmu 2008</Name>
<Copyright URL="">© 2008-2018 John Durdin</Copyright>
<Description>Lao-script Kmhmu language keyboard</Description>
<Description URL="">Lao-script Kmhmu language keyboard</Description>
</Info>
<Files>
<File>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Copyright URL="">© 2023 Geʾez Frontier Foundation</Copyright>
<Author URL="mailto:[email protected]">Geʾez Frontier Foundation</Author>
<Version URL="">1.0.1</Version>
<Description>The Tigrinya-Eritrea lexical model is based on the content found from 131 issues of the Haddas Eritrea (ሓዳስ ኤርትራ) newspaper.</Description>
<Description URL="">The Tigrinya-Eritrea lexical model is based on the content found from 131 issues of the Haddas Eritrea (ሓዳስ ኤርትራ) newspaper.</Description>
</Info>
<Files>
<File>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
<Version URL=""></Version>
<Name URL="">Kmhmu 2008</Name>
<Copyright URL="">© 2008-2018 John Durdin</Copyright>
<Description>Lao-script Kmhmu language keyboard</Description>
<Description URL="">Lao-script Kmhmu language keyboard</Description>
</Info>
<Files>
<File>
Expand Down
8 changes: 4 additions & 4 deletions developer/src/kmc-package/src/compiler/kmp-compiler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -247,8 +247,8 @@ export class KmpCompiler implements KeymanCompiler {
kmp.files = kps.Files.File.map((file: KpsFile.KpsFileContentFile) => {
return {
name: this.normalizePath(file.Name),
description: (file.Description ?? '').trim(),
copyLocation: parseInt(file.CopyLocation, 10) || undefined
description: '', // kmp.json still requires description, but we ignore the input Description field
// note: we no longer emit copyLocation as of 18.0; it was always optional
// note: we don't emit fileType as that is not permitted in kmp.json
};
});
Expand All @@ -270,14 +270,14 @@ export class KmpCompiler implements KeymanCompiler {
if(kps.Keyboards && kps.Keyboards.Keyboard) {
kmp.files.push({
name: KMP_INF_FILENAME,
description: "Package information"
description: ""
});
}

// Add the standard kmp.json self-referential to match existing implementations
kmp.files.push({
name: KMP_JSON_FILENAME,
description: "Package information (JSON)"
description: ""
});

//
Expand Down
2 changes: 1 addition & 1 deletion developer/src/kmc-package/src/compiler/kmp-inf-writer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ export class KmpInfWriter {

for(let i = 0; i < this.data.files.length; i++) {
const file = this.data.files[i];
this.addString(i.toString(), `"${file.description}","${file.name}",${file.copyLocation??0}`);
this.addString(i.toString(), `"${file.description??''}","${file.name}",${file.copyLocation??0}`);
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"files": [
{
"name": "example.qaa.sencoten.model.js",
"description": "Lexical model example.qaa.sencoten.model.js"
"description": ""
},
{
"description": "Package information (JSON)",
"description": "",
"name": "kmp.json"
}
],
Expand Down
34 changes: 17 additions & 17 deletions developer/src/kmc-package/test/fixtures/khmer_angkor/ref/kmp.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,71 +30,71 @@
"files": [
{
"name": "khmer_angkor.js",
"description": "File khmer_angkor.js"
"description": ""
},
{
"name": "khmer_angkor.kvk",
"description": "File khmer_angkor.kvk"
"description": ""
},
{
"name": "khmer_angkor.kmx",
"description": "Keyboard Khmer Angkor"
"description": ""
},
{
"name": "keyboard_layout.png",
"description": "File keyboard_layout.png"
"description": ""
},
{
"name": "welcome.htm",
"description": "File welcome.htm"
"description": ""
},
{
"name": "FONTLOG.txt",
"description": "File FONTLOG.txt"
"description": ""
},
{
"name": "Mondulkiri-R.ttf",
"description": "Font Khmer Mondulkiri"
"description": ""
},
{
"name": "OFL.txt",
"description": "File OFL.txt"
"description": ""
},
{
"name": "OFL-FAQ.txt",
"description": "File OFL-FAQ.txt"
"description": ""
},
{
"name": "KAK_Documentation_EN.pdf",
"description": "File KAK_Documentation_EN.pdf"
"description": ""
},
{
"name": "KAK_Documentation_KH.pdf",
"description": "File KAK_Documentation_KH.pdf"
"description": ""
},
{
"name": "readme.htm",
"description": "File readme.htm"
"description": ""
},
{
"name": "image002.png",
"description": "File image002.png"
"description": ""
},
{
"name": "khmer_busra_kbd.ttf",
"description": "Font KhmerBusraKbd"
"description": ""
},
{
"name": "splash.gif",
"description": "File splash.gif"
"description": ""
},
{
"name": "kmp.inf",
"description": "Package information"
"description": ""
},
{
"name": "kmp.json",
"description": "Package information (JSON)"
"description": ""
}
],
"keyboards": [
Expand Down
28 changes: 14 additions & 14 deletions developer/src/kmc-package/test/fixtures/kmp.json/kmp.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,59 +40,59 @@
"files": [
{
"name": "ahom_star.kvk",
"description": "File ahom_star.kvk"
"description": ""
},
{
"name": "ahom_star.kmx",
"description": "Keyboard ahom_star"
"description": ""
},
{
"name": "ahom_star.js",
"description": "File ahom_star.js"
"description": ""
},
{
"name": "welcome.htm",
"description": "File welcome.htm"
"description": ""
},
{
"name": "desktop_layout_default.png",
"description": "File desktop_layout_default.png"
"description": ""
},
{
"name": "desktop_layout_shift.png",
"description": "File desktop_layout_shift.png"
"description": ""
},
{
"name": "phone_default.png",
"description": "File phone_default.png"
"description": ""
},
{
"name": "phone_longpress.png",
"description": "File phone_longpress.png"
"description": ""
},
{
"name": "phone_numeric.png",
"description": "File phone_numeric.png"
"description": ""
},
{
"name": "phone_shift.png",
"description": "File phone_shift.png"
"description": ""
},
{
"name": "readme.htm",
"description": "File readme.htm"
"description": ""
},
{
"name": "NotoSerifAhom-Regular.ttf",
"description": "Font Noto Serif Ahom Regular"
"description": ""
},
{
"name": "kmp.inf",
"description": "Package information"
"description": ""
},
{
"name": "kmp.json",
"description": "Package information (JSON)"
"description": ""
}
],
"keyboards": [
Expand Down
36 changes: 18 additions & 18 deletions developer/src/kmc-package/test/fixtures/kmp_2.0/kmp.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,75 +32,75 @@
"files": [
{
"name": "khmer_angkor.js",
"description": "File khmer_angkor.js"
"description": ""
},
{
"name": "khmer_angkor.kvk",
"description": "File khmer_angkor.kvk"
"description": ""
},
{
"name": "khmer_angkor.kmx",
"description": "Keyboard Khmer Angkor"
"description": ""
},
{
"name": "keyboard_layout.png",
"description": "File keyboard_layout.png"
"description": ""
},
{
"name": "welcome.htm",
"description": "File welcome.htm"
"description": ""
},
{
"name": "FONTLOG.txt",
"description": "File FONTLOG.txt"
"description": ""
},
{
"name": "Mondulkiri-R.ttf",
"description": "Font Khmer Mondulkiri"
"description": ""
},
{
"name": "OFL.txt",
"description": "File OFL.txt"
"description": ""
},
{
"name": "OFL-FAQ.txt",
"description": "File OFL-FAQ.txt"
"description": ""
},
{
"name": "KAK_Documentation_EN.pdf",
"description": "File KAK_Documentation_EN.pdf"
"description": ""
},
{
"name": "KAK_Documentation_KH.pdf",
"description": "File KAK_Documentation_KH.pdf"
"description": ""
},
{
"name": "readme.htm",
"description": "File readme.htm"
"description": ""
},
{
"name": "image002.png",
"description": "File image002.png"
"description": ""
},
{
"name": "khmer_busra_kbd.ttf",
"description": "Font KhmerBusraKbd"
"description": ""
},
{
"description": "Font DejaVuSans",
"description": "",
"name": "DejaVuSans.ttf"
},
{
"name": "splash.gif",
"description": "File splash.gif"
"description": ""
},
{
"name": "kmp.inf",
"description": "Package information"
"description": ""
},
{
"name": "kmp.json",
"description": "Package information (JSON)"
"description": ""
}
],
"keyboards": [
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,14 +22,14 @@
"files": [
{
"name": "../build/withfolders.qaa.sencoten.model.js",
"description": "Lexical model withfolders.qaa.sencoten.model.js"
"description": ""
},
{
"description": "Welcome file",
"description": "",
"name": "welcome.htm"
},
{
"description": "Package information (JSON)",
"description": "",
"name": "kmp.json"
}
],
Expand Down

0 comments on commit 2f401f5

Please sign in to comment.