@keymanapp/common-types 18.0.41-alpha → 18.0.46-alpha
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/src/consts/virtual-key-constants.d.ts +191 -191
- package/build/src/consts/virtual-key-constants.js +221 -221
- package/build/src/consts/virtual-key-constants.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.d.ts +5 -5
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js +72 -72
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-reader.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.d.ts +28 -28
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js +120 -120
- package/build/src/keyman-touch-layout/keyman-touch-layout-file-writer.js.map +1 -1
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.d.ts +95 -95
- package/build/src/keyman-touch-layout/keyman-touch-layout-file.js +52 -52
- package/build/src/kmx/element-string.d.ts +23 -23
- package/build/src/kmx/element-string.js +125 -125
- package/build/src/kmx/element-string.js.map +1 -1
- package/build/src/kmx/keyman-targets.d.ts +20 -20
- package/build/src/kmx/keyman-targets.js +79 -79
- package/build/src/kmx/keyman-targets.js.map +1 -1
- package/build/src/kmx/kmx-builder.d.ts +32 -32
- package/build/src/kmx/kmx-builder.js +189 -189
- package/build/src/kmx/kmx-builder.js.map +1 -1
- package/build/src/kmx/kmx-file-reader.d.ts +13 -13
- package/build/src/kmx/kmx-file-reader.js +134 -134
- package/build/src/kmx/kmx-file-reader.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-disp.d.ts +18 -18
- package/build/src/kmx/kmx-plus-builder/build-disp.js +27 -27
- package/build/src/kmx/kmx-plus-builder/build-disp.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-elem.d.ts +28 -28
- package/build/src/kmx/kmx-plus-builder/build-elem.js +89 -89
- package/build/src/kmx/kmx-plus-builder/build-elem.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-keys.d.ts +56 -56
- package/build/src/kmx/kmx-plus-builder/build-keys.js +107 -107
- package/build/src/kmx/kmx-plus-builder/build-keys.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-layr.d.ts +53 -53
- package/build/src/kmx/kmx-plus-builder/build-layr.js +101 -101
- package/build/src/kmx/kmx-plus-builder/build-layr.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-list.d.ts +35 -35
- package/build/src/kmx/kmx-plus-builder/build-list.js +66 -66
- package/build/src/kmx/kmx-plus-builder/build-list.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-loca.d.ts +11 -11
- package/build/src/kmx/kmx-plus-builder/build-loca.js +21 -21
- package/build/src/kmx/kmx-plus-builder/build-loca.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-meta.d.ts +16 -16
- package/build/src/kmx/kmx-plus-builder/build-meta.js +20 -20
- package/build/src/kmx/kmx-plus-builder/build-sect.d.ts +15 -15
- package/build/src/kmx/kmx-plus-builder/build-sect.js +15 -15
- package/build/src/kmx/kmx-plus-builder/build-sect.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-strs.d.ts +22 -22
- package/build/src/kmx/kmx-plus-builder/build-strs.js +46 -46
- package/build/src/kmx/kmx-plus-builder/build-strs.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-tran.d.ts +32 -32
- package/build/src/kmx/kmx-plus-builder/build-tran.js +69 -69
- package/build/src/kmx/kmx-plus-builder/build-tran.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-uset.d.ts +30 -30
- package/build/src/kmx/kmx-plus-builder/build-uset.js +60 -60
- package/build/src/kmx/kmx-plus-builder/build-uset.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/build-vars.d.ts +21 -21
- package/build/src/kmx/kmx-plus-builder/build-vars.js +48 -48
- package/build/src/kmx/kmx-plus-builder/build-vars.js.map +1 -1
- package/build/src/kmx/kmx-plus-builder/builder-section.d.ts +9 -9
- package/build/src/kmx/kmx-plus-builder/builder-section.js +2 -2
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.d.ts +42 -42
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js +137 -137
- package/build/src/kmx/kmx-plus-builder/kmx-plus-builder.js.map +1 -1
- package/build/src/kmx/kmx-plus.d.ts +322 -322
- package/build/src/kmx/kmx-plus.js +830 -830
- package/build/src/kmx/kmx-plus.js.map +1 -1
- package/build/src/kmx/kmx.d.ts +233 -233
- package/build/src/kmx/kmx.js +302 -302
- package/build/src/kmx/kmx.js.map +1 -1
- package/build/src/kmx/string-list.d.ts +35 -35
- package/build/src/kmx/string-list.js +88 -88
- package/build/src/kmx/string-list.js.map +1 -1
- package/build/src/kpj/keyman-developer-project.d.ts +78 -78
- package/build/src/kpj/keyman-developer-project.js +195 -195
- package/build/src/kpj/keyman-developer-project.js.map +1 -1
- package/build/src/kpj/kpj-file-reader.d.ts +18 -18
- package/build/src/kpj/kpj-file-reader.js +119 -119
- package/build/src/kpj/kpj-file-reader.js.map +1 -1
- package/build/src/kpj/kpj-file.d.ts +39 -39
- package/build/src/kpj/kpj-file.js +10 -10
- package/build/src/kvk/kvk-file-reader.d.ts +4 -4
- package/build/src/kvk/kvk-file-reader.js +37 -37
- package/build/src/kvk/kvk-file-reader.js.map +1 -1
- package/build/src/kvk/kvk-file-writer.d.ts +19 -19
- package/build/src/kvk/kvk-file-writer.js +77 -77
- package/build/src/kvk/kvk-file-writer.js.map +1 -1
- package/build/src/kvk/kvk-file.d.ts +66 -66
- package/build/src/kvk/kvk-file.d.ts.map +1 -1
- package/build/src/kvk/kvk-file.js +90 -90
- package/build/src/kvk/kvk-file.js.map +1 -1
- package/build/src/kvk/kvks-file-reader.d.ts +23 -23
- package/build/src/kvk/kvks-file-reader.js +175 -175
- package/build/src/kvk/kvks-file-reader.js.map +1 -1
- package/build/src/kvk/kvks-file-writer.d.ts +6 -6
- package/build/src/kvk/kvks-file-writer.js +106 -106
- package/build/src/kvk/kvks-file-writer.js.map +1 -1
- package/build/src/kvk/kvks-file.d.ts +43 -43
- package/build/src/kvk/kvks-file.js +9 -9
- package/build/src/kvk/visual-keyboard.d.ts +44 -44
- package/build/src/kvk/visual-keyboard.js +75 -75
- package/build/src/kvk/visual-keyboard.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.d.ts +60 -60
- package/build/src/ldml-keyboard/ldml-keyboard-testdata-xml.js +19 -19
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.d.ts +95 -95
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js +409 -409
- package/build/src/ldml-keyboard/ldml-keyboard-xml-reader.js.map +1 -1
- package/build/src/ldml-keyboard/ldml-keyboard-xml.d.ts +170 -170
- package/build/src/ldml-keyboard/ldml-keyboard-xml.js +55 -55
- package/build/src/ldml-keyboard/pattern-parser.d.ts +201 -201
- package/build/src/ldml-keyboard/pattern-parser.js +490 -490
- package/build/src/ldml-keyboard/pattern-parser.js.map +1 -1
- package/build/src/ldml-keyboard/unicodeset-parser-api.d.ts +37 -37
- package/build/src/ldml-keyboard/unicodeset-parser-api.js +27 -27
- package/build/src/main.d.ts +33 -33
- package/build/src/main.js +32 -32
- package/build/src/package/kmp-json-file.d.ts +115 -115
- package/build/src/package/kmp-json-file.js +1 -1
- package/build/src/package/kps-file.d.ts +175 -175
- package/build/src/package/kps-file.js +15 -15
- package/build/src/schema-validators.d.ts +13 -13
- package/build/src/schema-validators.js +25 -25
- package/build/src/schemas/displaymap.schema.d.ts +57 -57
- package/build/src/schemas/displaymap.schema.js +35 -35
- package/build/src/schemas/displaymap.schema.validator.d.mts +2 -2
- package/build/src/schemas/displaymap.schema.validator.mjs +266 -266
- package/build/src/schemas/displaymap.schema.validator.mjs.map +1 -1
- package/build/src/schemas/keyboard_info.schema.d.ts +209 -209
- package/build/src/schemas/keyboard_info.schema.js +98 -98
- package/build/src/schemas/keyboard_info.schema.validator.d.mts +2 -2
- package/build/src/schemas/keyboard_info.schema.validator.mjs +1160 -1160
- package/build/src/schemas/keyboard_info.schema.validator.mjs.map +1 -1
- package/build/src/schemas/keyman-touch-layout.clean.spec.d.ts +227 -227
- package/build/src/schemas/keyman-touch-layout.clean.spec.js +151 -151
- package/build/src/schemas/keyman-touch-layout.clean.spec.validator.d.mts +2 -2
- package/build/src/schemas/keyman-touch-layout.clean.spec.validator.mjs +1094 -1094
- package/build/src/schemas/keyman-touch-layout.clean.spec.validator.mjs.map +1 -1
- package/build/src/schemas/keyman-touch-layout.spec.d.ts +229 -229
- package/build/src/schemas/keyman-touch-layout.spec.js +140 -140
- package/build/src/schemas/keyman-touch-layout.spec.validator.d.mts +2 -2
- package/build/src/schemas/keyman-touch-layout.spec.validator.mjs +1436 -1436
- package/build/src/schemas/keyman-touch-layout.spec.validator.mjs.map +1 -1
- package/build/src/schemas/kmp.schema.d.ts +324 -324
- package/build/src/schemas/kmp.schema.js +353 -353
- package/build/src/schemas/kmp.schema.validator.d.mts +2 -2
- package/build/src/schemas/kmp.schema.validator.mjs +1627 -1627
- package/build/src/schemas/kmp.schema.validator.mjs.map +1 -1
- package/build/src/schemas/kpj-9.0.schema.d.ts +152 -152
- package/build/src/schemas/kpj-9.0.schema.js +131 -131
- package/build/src/schemas/kpj-9.0.schema.validator.d.mts +2 -2
- package/build/src/schemas/kpj-9.0.schema.validator.mjs +655 -655
- package/build/src/schemas/kpj-9.0.schema.validator.mjs.map +1 -1
- package/build/src/schemas/kpj.schema.d.ts +122 -122
- package/build/src/schemas/kpj.schema.js +129 -129
- package/build/src/schemas/kpj.schema.validator.d.mts +2 -2
- package/build/src/schemas/kpj.schema.validator.mjs +515 -515
- package/build/src/schemas/kpj.schema.validator.mjs.map +1 -1
- package/build/src/schemas/kvks.schema.d.ts +160 -160
- package/build/src/schemas/kvks.schema.js +182 -182
- package/build/src/schemas/kvks.schema.validator.d.mts +2 -2
- package/build/src/schemas/kvks.schema.validator.mjs +625 -625
- package/build/src/schemas/kvks.schema.validator.mjs.map +1 -1
- package/build/src/schemas/ldml-keyboard3.schema.d.ts +635 -635
- package/build/src/schemas/ldml-keyboard3.schema.js +696 -696
- package/build/src/schemas/ldml-keyboard3.schema.validator.d.mts +2 -2
- package/build/src/schemas/ldml-keyboard3.schema.validator.mjs +3117 -3117
- package/build/src/schemas/ldml-keyboard3.schema.validator.mjs.map +1 -1
- package/build/src/schemas/ldml-keyboardtest3.schema.d.ts +192 -192
- package/build/src/schemas/ldml-keyboardtest3.schema.js +225 -225
- package/build/src/schemas/ldml-keyboardtest3.schema.validator.d.mts +2 -2
- package/build/src/schemas/ldml-keyboardtest3.schema.validator.mjs +744 -744
- package/build/src/schemas/ldml-keyboardtest3.schema.validator.mjs.map +1 -1
- package/build/src/schemas.d.ts +2300 -2300
- package/build/src/schemas.js +23 -23
- package/build/src/util/common-events.d.ts +44 -44
- package/build/src/util/common-events.js +26 -26
- package/build/src/util/compiler-interfaces.d.ts +371 -371
- package/build/src/util/compiler-interfaces.d.ts.map +1 -1
- package/build/src/util/compiler-interfaces.js +380 -380
- package/build/src/util/compiler-interfaces.js.map +1 -1
- package/build/src/util/errors.d.ts +5 -5
- package/build/src/util/errors.js +5 -5
- package/build/src/util/file-types.d.ts +93 -93
- package/build/src/util/file-types.d.ts.map +1 -1
- package/build/src/util/file-types.js +142 -142
- package/build/src/util/file-types.js.map +1 -1
- package/build/src/util/util.d.ts +98 -98
- package/build/src/util/util.js +368 -368
- package/build/src/util/util.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,197 +1,197 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Version 1.0 and 2.0 of Keyman Developer Project .kpj file
|
|
3
|
-
//
|
|
1
|
+
//
|
|
2
|
+
// Version 1.0 and 2.0 of Keyman Developer Project .kpj file
|
|
3
|
+
//
|
|
4
4
|
|
|
5
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
6
|
-
import { KeymanFileTypes } from '../main.js';
|
|
7
|
-
export class KeymanDeveloperProject {
|
|
8
|
-
_projectFilename;
|
|
9
|
-
callbacks;
|
|
10
|
-
options;
|
|
11
|
-
files;
|
|
12
|
-
projectPath = '';
|
|
13
|
-
projectFile;
|
|
14
|
-
get projectFilename() {
|
|
15
|
-
return this._projectFilename;
|
|
16
|
-
}
|
|
17
|
-
constructor(_projectFilename, version, callbacks) {
|
|
18
|
-
this._projectFilename = _projectFilename;
|
|
19
|
-
this.callbacks = callbacks;
|
|
20
|
-
this.projectPath = this.callbacks.path.dirname(this._projectFilename);
|
|
21
|
-
this.options = new KeymanDeveloperProjectOptions(version);
|
|
22
|
-
this.files = [];
|
|
23
|
-
this.projectFile = new KeymanDeveloperProjectFile20(_projectFilename, callbacks);
|
|
24
|
-
}
|
|
25
|
-
/**
|
|
26
|
-
* Adds .kmn, .xml, .kps to project based on options.sourcePath
|
|
27
|
-
* @param projectFilename Full path to project.kpj (even if the file doesn't exist)
|
|
28
|
-
*/
|
|
29
|
-
populateFiles() {
|
|
30
|
-
if (this.options.version != '2.0') {
|
|
31
|
-
throw new Error('populateFiles can only be called on a v2.0 project');
|
|
32
|
-
}
|
|
33
|
-
let sourcePath = this.resolveProjectPath(this.options.sourcePath);
|
|
34
|
-
if (!this.callbacks.fs.existsSync(sourcePath)) {
|
|
35
|
-
return false;
|
|
36
|
-
}
|
|
37
|
-
let files = this.callbacks.fs.readdirSync(sourcePath);
|
|
38
|
-
for (let filename of files) {
|
|
39
|
-
let fullPath = this.callbacks.path.join(sourcePath, filename);
|
|
40
|
-
if (KeymanFileTypes.filenameIs(filename, ".xml" /* KeymanFileTypes.Source.LdmlKeyboard */)) {
|
|
41
|
-
try {
|
|
42
|
-
const data = this.callbacks.loadFile(fullPath);
|
|
43
|
-
const text = new TextDecoder().decode(data);
|
|
44
|
-
if (!text?.match(/<keyboard3/)) {
|
|
45
|
-
// Skip this .xml because we assume it isn't really a keyboard .xml
|
|
46
|
-
continue;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
catch (e) {
|
|
50
|
-
// We'll just silently skip this file because we were not able to load it,
|
|
51
|
-
// so let's hope it wasn't a real LDML keyboard XML :-)
|
|
52
|
-
continue;
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
if (KeymanFileTypes.sourceTypeFromFilename(filename) !== null) {
|
|
56
|
-
let file = new KeymanDeveloperProjectFile20(fullPath, this.callbacks);
|
|
57
|
-
this.files.push(file);
|
|
58
|
-
}
|
|
59
|
-
}
|
|
60
|
-
return this.files.length > 0;
|
|
61
|
-
}
|
|
62
|
-
isKeyboardProject() {
|
|
63
|
-
return !!this.files.find(file => file.fileType == ".kmn" /* KeymanFileTypes.Source.KeymanKeyboard */ || file.fileType == ".xml" /* KeymanFileTypes.Source.LdmlKeyboard */);
|
|
64
|
-
}
|
|
65
|
-
isLexicalModelProject() {
|
|
66
|
-
return !!this.files.find(file => file.fileType == ".model.ts" /* KeymanFileTypes.Source.Model */);
|
|
67
|
-
}
|
|
68
|
-
resolveProjectPath(p) {
|
|
69
|
-
// Replace placeholders in the target path
|
|
70
|
-
return p.replace('$PROJECTPATH', this.projectPath);
|
|
71
|
-
}
|
|
72
|
-
getOutputFilePath(type) {
|
|
73
|
-
// Roughly corresponds to Delphi TProject.GetTargetFileName
|
|
74
|
-
let p = this.options.version == '1.0' ?
|
|
75
|
-
this.options.buildPath || '$SOURCEPATH' :
|
|
76
|
-
this.options.buildPath;
|
|
77
|
-
// Replace placeholders in the target path
|
|
78
|
-
if (this.options.version == '1.0') {
|
|
79
|
-
// TODO: do we need to support $VERSION?
|
|
80
|
-
// $SOURCEPATH only supported in 1.0 projects
|
|
81
|
-
p = p.replace('$SOURCEPATH', this.callbacks.path.dirname(this._projectFilename));
|
|
82
|
-
}
|
|
83
|
-
p = this.resolveProjectPath(p);
|
|
84
|
-
const f = this.callbacks.path.basename(this._projectFilename, ".kpj" /* KeymanFileTypes.Source.Project */) + type;
|
|
85
|
-
return this.callbacks.path.normalize(this.callbacks.path.join(p, f));
|
|
86
|
-
}
|
|
87
|
-
resolveInputFilePath(file) {
|
|
88
|
-
return this.callbacks.resolveFilename(this._projectFilename, file.filePath);
|
|
89
|
-
}
|
|
90
|
-
resolveOutputFilePath(file, sourceExt, targetExt) {
|
|
91
|
-
// Roughly corresponds to Delphi TProject.GetTargetFileName
|
|
92
|
-
let p = this.options.version == '1.0' ?
|
|
93
|
-
this.options.buildPath || '$SOURCEPATH' :
|
|
94
|
-
this.options.buildPath;
|
|
95
|
-
// Replace placeholders in the target path
|
|
96
|
-
if (this.options.version == '1.0') {
|
|
97
|
-
// TODO: do we need to support $VERSION?
|
|
98
|
-
// $SOURCEPATH only supported in 1.0 projects
|
|
99
|
-
p = p.replace('$SOURCEPATH', this.callbacks.path.dirname(this.resolveInputFilePath(file)));
|
|
100
|
-
}
|
|
101
|
-
p = this.resolveProjectPath(p);
|
|
102
|
-
let f = file.filename.replace(new RegExp(`\\${sourceExt}$`, 'i'), targetExt);
|
|
103
|
-
return this.callbacks.path.normalize(this.callbacks.path.join(p, f));
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
;
|
|
107
|
-
export var KeymanDeveloperProjectType;
|
|
108
|
-
(function (KeymanDeveloperProjectType) {
|
|
109
|
-
KeymanDeveloperProjectType[KeymanDeveloperProjectType["Keyboard"] = 0] = "Keyboard";
|
|
110
|
-
KeymanDeveloperProjectType[KeymanDeveloperProjectType["LexicalModel"] = 1] = "LexicalModel";
|
|
111
|
-
})(KeymanDeveloperProjectType || (KeymanDeveloperProjectType = {}));
|
|
112
|
-
;
|
|
113
|
-
export class KeymanDeveloperProjectOptions {
|
|
114
|
-
buildPath;
|
|
115
|
-
sourcePath;
|
|
116
|
-
compilerWarningsAsErrors = false;
|
|
117
|
-
warnDeprecatedCode = true;
|
|
118
|
-
checkFilenameConventions = false; // missing option defaults to False
|
|
119
|
-
/**
|
|
120
|
-
* Skip building .keyboard_info and .model_info files, for example in
|
|
121
|
-
* unit tests or for legacy keyboards
|
|
122
|
-
*/
|
|
123
|
-
skipMetadataFiles;
|
|
124
|
-
projectType = KeymanDeveloperProjectType.Keyboard;
|
|
125
|
-
version;
|
|
126
|
-
constructor(version) {
|
|
127
|
-
this.version = version;
|
|
128
|
-
switch (version) {
|
|
129
|
-
case "1.0":
|
|
130
|
-
this.buildPath = '';
|
|
131
|
-
this.sourcePath = '';
|
|
132
|
-
this.skipMetadataFiles = true;
|
|
133
|
-
break;
|
|
134
|
-
case "2.0":
|
|
135
|
-
this.buildPath = '$PROJECTPATH/build';
|
|
136
|
-
this.sourcePath = '$PROJECTPATH/source';
|
|
137
|
-
this.skipMetadataFiles = false;
|
|
138
|
-
break;
|
|
139
|
-
default:
|
|
140
|
-
throw new Error('Invalid version');
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
}
|
|
144
|
-
;
|
|
145
|
-
;
|
|
146
|
-
export class KeymanDeveloperProjectFile10 {
|
|
147
|
-
id;
|
|
148
|
-
filePath;
|
|
149
|
-
fileVersion;
|
|
150
|
-
callbacks;
|
|
151
|
-
get filename() {
|
|
152
|
-
return this.callbacks.path.basename(this.filePath);
|
|
153
|
-
}
|
|
154
|
-
get fileType() {
|
|
155
|
-
return KeymanFileTypes.fromFilename(this.filename);
|
|
156
|
-
}
|
|
157
|
-
details; // 1.0 only
|
|
158
|
-
childFiles; // 1.0 only
|
|
159
|
-
constructor(id, filePath, fileVersion, callbacks) {
|
|
160
|
-
this.id = id;
|
|
161
|
-
this.filePath = filePath;
|
|
162
|
-
this.fileVersion = fileVersion;
|
|
163
|
-
this.callbacks = callbacks;
|
|
164
|
-
this.details = {};
|
|
165
|
-
this.childFiles = [];
|
|
166
|
-
}
|
|
167
|
-
}
|
|
168
|
-
;
|
|
169
|
-
export class KeymanDeveloperProjectFile20 {
|
|
170
|
-
filePath;
|
|
171
|
-
callbacks;
|
|
172
|
-
get filename() {
|
|
173
|
-
return this.callbacks.path.basename(this.filePath);
|
|
174
|
-
}
|
|
175
|
-
get fileType() {
|
|
176
|
-
return KeymanFileTypes.fromFilename(this.filename);
|
|
177
|
-
}
|
|
178
|
-
constructor(filePath, callbacks) {
|
|
179
|
-
this.filePath = filePath;
|
|
180
|
-
this.callbacks = callbacks;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
;
|
|
184
|
-
export class KeymanDeveloperProjectFileDetail_Kps {
|
|
185
|
-
name;
|
|
186
|
-
copyright;
|
|
187
|
-
version;
|
|
188
|
-
}
|
|
189
|
-
;
|
|
190
|
-
export class KeymanDeveloperProjectFileDetail_Kmn {
|
|
191
|
-
name;
|
|
192
|
-
copyright;
|
|
193
|
-
message;
|
|
194
|
-
}
|
|
195
|
-
;
|
|
5
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},n=(new Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ffb6f33c-4d59-5feb-b67e-f39c63733abe")}catch(e){}}();
|
|
6
|
+
import { KeymanFileTypes } from '../main.js';
|
|
7
|
+
export class KeymanDeveloperProject {
|
|
8
|
+
_projectFilename;
|
|
9
|
+
callbacks;
|
|
10
|
+
options;
|
|
11
|
+
files;
|
|
12
|
+
projectPath = '';
|
|
13
|
+
projectFile;
|
|
14
|
+
get projectFilename() {
|
|
15
|
+
return this._projectFilename;
|
|
16
|
+
}
|
|
17
|
+
constructor(_projectFilename, version, callbacks) {
|
|
18
|
+
this._projectFilename = _projectFilename;
|
|
19
|
+
this.callbacks = callbacks;
|
|
20
|
+
this.projectPath = this.callbacks.path.dirname(this._projectFilename);
|
|
21
|
+
this.options = new KeymanDeveloperProjectOptions(version);
|
|
22
|
+
this.files = [];
|
|
23
|
+
this.projectFile = new KeymanDeveloperProjectFile20(_projectFilename, callbacks);
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Adds .kmn, .xml, .kps to project based on options.sourcePath
|
|
27
|
+
* @param projectFilename Full path to project.kpj (even if the file doesn't exist)
|
|
28
|
+
*/
|
|
29
|
+
populateFiles() {
|
|
30
|
+
if (this.options.version != '2.0') {
|
|
31
|
+
throw new Error('populateFiles can only be called on a v2.0 project');
|
|
32
|
+
}
|
|
33
|
+
let sourcePath = this.resolveProjectPath(this.options.sourcePath);
|
|
34
|
+
if (!this.callbacks.fs.existsSync(sourcePath)) {
|
|
35
|
+
return false;
|
|
36
|
+
}
|
|
37
|
+
let files = this.callbacks.fs.readdirSync(sourcePath);
|
|
38
|
+
for (let filename of files) {
|
|
39
|
+
let fullPath = this.callbacks.path.join(sourcePath, filename);
|
|
40
|
+
if (KeymanFileTypes.filenameIs(filename, ".xml" /* KeymanFileTypes.Source.LdmlKeyboard */)) {
|
|
41
|
+
try {
|
|
42
|
+
const data = this.callbacks.loadFile(fullPath);
|
|
43
|
+
const text = new TextDecoder().decode(data);
|
|
44
|
+
if (!text?.match(/<keyboard3/)) {
|
|
45
|
+
// Skip this .xml because we assume it isn't really a keyboard .xml
|
|
46
|
+
continue;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
catch (e) {
|
|
50
|
+
// We'll just silently skip this file because we were not able to load it,
|
|
51
|
+
// so let's hope it wasn't a real LDML keyboard XML :-)
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
if (KeymanFileTypes.sourceTypeFromFilename(filename) !== null) {
|
|
56
|
+
let file = new KeymanDeveloperProjectFile20(fullPath, this.callbacks);
|
|
57
|
+
this.files.push(file);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
return this.files.length > 0;
|
|
61
|
+
}
|
|
62
|
+
isKeyboardProject() {
|
|
63
|
+
return !!this.files.find(file => file.fileType == ".kmn" /* KeymanFileTypes.Source.KeymanKeyboard */ || file.fileType == ".xml" /* KeymanFileTypes.Source.LdmlKeyboard */);
|
|
64
|
+
}
|
|
65
|
+
isLexicalModelProject() {
|
|
66
|
+
return !!this.files.find(file => file.fileType == ".model.ts" /* KeymanFileTypes.Source.Model */);
|
|
67
|
+
}
|
|
68
|
+
resolveProjectPath(p) {
|
|
69
|
+
// Replace placeholders in the target path
|
|
70
|
+
return p.replace('$PROJECTPATH', this.projectPath);
|
|
71
|
+
}
|
|
72
|
+
getOutputFilePath(type) {
|
|
73
|
+
// Roughly corresponds to Delphi TProject.GetTargetFileName
|
|
74
|
+
let p = this.options.version == '1.0' ?
|
|
75
|
+
this.options.buildPath || '$SOURCEPATH' :
|
|
76
|
+
this.options.buildPath;
|
|
77
|
+
// Replace placeholders in the target path
|
|
78
|
+
if (this.options.version == '1.0') {
|
|
79
|
+
// TODO: do we need to support $VERSION?
|
|
80
|
+
// $SOURCEPATH only supported in 1.0 projects
|
|
81
|
+
p = p.replace('$SOURCEPATH', this.callbacks.path.dirname(this._projectFilename));
|
|
82
|
+
}
|
|
83
|
+
p = this.resolveProjectPath(p);
|
|
84
|
+
const f = this.callbacks.path.basename(this._projectFilename, ".kpj" /* KeymanFileTypes.Source.Project */) + type;
|
|
85
|
+
return this.callbacks.path.normalize(this.callbacks.path.join(p, f));
|
|
86
|
+
}
|
|
87
|
+
resolveInputFilePath(file) {
|
|
88
|
+
return this.callbacks.resolveFilename(this._projectFilename, file.filePath);
|
|
89
|
+
}
|
|
90
|
+
resolveOutputFilePath(file, sourceExt, targetExt) {
|
|
91
|
+
// Roughly corresponds to Delphi TProject.GetTargetFileName
|
|
92
|
+
let p = this.options.version == '1.0' ?
|
|
93
|
+
this.options.buildPath || '$SOURCEPATH' :
|
|
94
|
+
this.options.buildPath;
|
|
95
|
+
// Replace placeholders in the target path
|
|
96
|
+
if (this.options.version == '1.0') {
|
|
97
|
+
// TODO: do we need to support $VERSION?
|
|
98
|
+
// $SOURCEPATH only supported in 1.0 projects
|
|
99
|
+
p = p.replace('$SOURCEPATH', this.callbacks.path.dirname(this.resolveInputFilePath(file)));
|
|
100
|
+
}
|
|
101
|
+
p = this.resolveProjectPath(p);
|
|
102
|
+
let f = file.filename.replace(new RegExp(`\\${sourceExt}$`, 'i'), targetExt);
|
|
103
|
+
return this.callbacks.path.normalize(this.callbacks.path.join(p, f));
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
;
|
|
107
|
+
export var KeymanDeveloperProjectType;
|
|
108
|
+
(function (KeymanDeveloperProjectType) {
|
|
109
|
+
KeymanDeveloperProjectType[KeymanDeveloperProjectType["Keyboard"] = 0] = "Keyboard";
|
|
110
|
+
KeymanDeveloperProjectType[KeymanDeveloperProjectType["LexicalModel"] = 1] = "LexicalModel";
|
|
111
|
+
})(KeymanDeveloperProjectType || (KeymanDeveloperProjectType = {}));
|
|
112
|
+
;
|
|
113
|
+
export class KeymanDeveloperProjectOptions {
|
|
114
|
+
buildPath;
|
|
115
|
+
sourcePath;
|
|
116
|
+
compilerWarningsAsErrors = false;
|
|
117
|
+
warnDeprecatedCode = true;
|
|
118
|
+
checkFilenameConventions = false; // missing option defaults to False
|
|
119
|
+
/**
|
|
120
|
+
* Skip building .keyboard_info and .model_info files, for example in
|
|
121
|
+
* unit tests or for legacy keyboards
|
|
122
|
+
*/
|
|
123
|
+
skipMetadataFiles;
|
|
124
|
+
projectType = KeymanDeveloperProjectType.Keyboard;
|
|
125
|
+
version;
|
|
126
|
+
constructor(version) {
|
|
127
|
+
this.version = version;
|
|
128
|
+
switch (version) {
|
|
129
|
+
case "1.0":
|
|
130
|
+
this.buildPath = '';
|
|
131
|
+
this.sourcePath = '';
|
|
132
|
+
this.skipMetadataFiles = true;
|
|
133
|
+
break;
|
|
134
|
+
case "2.0":
|
|
135
|
+
this.buildPath = '$PROJECTPATH/build';
|
|
136
|
+
this.sourcePath = '$PROJECTPATH/source';
|
|
137
|
+
this.skipMetadataFiles = false;
|
|
138
|
+
break;
|
|
139
|
+
default:
|
|
140
|
+
throw new Error('Invalid version');
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
;
|
|
145
|
+
;
|
|
146
|
+
export class KeymanDeveloperProjectFile10 {
|
|
147
|
+
id;
|
|
148
|
+
filePath;
|
|
149
|
+
fileVersion;
|
|
150
|
+
callbacks;
|
|
151
|
+
get filename() {
|
|
152
|
+
return this.callbacks.path.basename(this.filePath);
|
|
153
|
+
}
|
|
154
|
+
get fileType() {
|
|
155
|
+
return KeymanFileTypes.fromFilename(this.filename);
|
|
156
|
+
}
|
|
157
|
+
details; // 1.0 only
|
|
158
|
+
childFiles; // 1.0 only
|
|
159
|
+
constructor(id, filePath, fileVersion, callbacks) {
|
|
160
|
+
this.id = id;
|
|
161
|
+
this.filePath = filePath;
|
|
162
|
+
this.fileVersion = fileVersion;
|
|
163
|
+
this.callbacks = callbacks;
|
|
164
|
+
this.details = {};
|
|
165
|
+
this.childFiles = [];
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
;
|
|
169
|
+
export class KeymanDeveloperProjectFile20 {
|
|
170
|
+
filePath;
|
|
171
|
+
callbacks;
|
|
172
|
+
get filename() {
|
|
173
|
+
return this.callbacks.path.basename(this.filePath);
|
|
174
|
+
}
|
|
175
|
+
get fileType() {
|
|
176
|
+
return KeymanFileTypes.fromFilename(this.filename);
|
|
177
|
+
}
|
|
178
|
+
constructor(filePath, callbacks) {
|
|
179
|
+
this.filePath = filePath;
|
|
180
|
+
this.callbacks = callbacks;
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
;
|
|
184
|
+
export class KeymanDeveloperProjectFileDetail_Kps {
|
|
185
|
+
name;
|
|
186
|
+
copyright;
|
|
187
|
+
version;
|
|
188
|
+
}
|
|
189
|
+
;
|
|
190
|
+
export class KeymanDeveloperProjectFileDetail_Kmn {
|
|
191
|
+
name;
|
|
192
|
+
copyright;
|
|
193
|
+
message;
|
|
194
|
+
}
|
|
195
|
+
;
|
|
196
196
|
//# sourceMappingURL=keyman-developer-project.js.map
|
|
197
|
-
//# debugId=
|
|
197
|
+
//# debugId=ffb6f33c-4d59-5feb-b67e-f39c63733abe
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keyman-developer-project.js","sources":["../../../src/kpj/keyman-developer-project.ts"],"sourceRoot":"","names":[],"mappings":"AAAA,EAAE;AACF,4DAA4D;AAC5D,EAAE;;;AAEF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,MAAM,OAAO,sBAAsB;IAUb;IAA0E;IAT9F,OAAO,CAAgC;IACvC,KAAK,CAA+B;IACpC,WAAW,GAAW,EAAE,CAAC;IAChB,WAAW,CAA6B;IAEjD,IAAI,eAAe;QACjB,OAAO,IAAI,CAAC,gBAAgB,CAAC;IAC/B,CAAC;IAED,YAAoB,gBAAwB,EAAE,OAAsC,EAAU,SAA4B;QAAtG,qBAAgB,GAAhB,gBAAgB,CAAQ;QAAkD,cAAS,GAAT,SAAS,CAAmB;QACxH,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;QACtE,IAAI,CAAC,OAAO,GAAG,IAAI,6BAA6B,CAAC,OAAO,CAAC,CAAC;QAC1D,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC;QAChB,IAAI,CAAC,WAAW,GAAG,IAAI,4BAA4B,CAAC,gBAAgB,EAAE,SAAS,CAAC,CAAC;IACnF,CAAC;IACD;;;OAGG;IACH,aAAa;QACX,IAAG,IAAI,CAAC,OAAO,CAAC,OAAO,IAAI,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"keyman-developer-project.js","sources":["../../../src/kpj/keyman-developer-project.ts"],"sourceRoot":"","names":[],"mappings":"AAAA,EAAE;AACF,4DAA4D;AAC5D,EAAE;;;AAEF,OAAO,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAG7C,MAAM,OAAO,sBAAsB;IAUb;IAA0E;IAT9F,OAAO,CAAgC;IACvC,KAAK,CAA+B;IACpC,WAAW,G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AC;IACD,YAA4B,QAAgB,EAAmB,SAA4B;QAA/D,aAAQ,GAAR,QAAQ,CAAQ;QAAmB,cAAS,GAAT,SAAS,CAAmB;IAC3F,CAAC;CACF;AAAA,CAAC;AAEF,MAAM,OAAO,oCAAoC;IAC/C,IAAI,CAAU;IACd,SAAS,CAAU;IACnB,OAAO,CAAU;CAClB;AAAA,CAAC;AAEF,MAAM,OAAO,oCAAoC;IAC/C,IAAI,CAAU;IACd,SAAS,CAAU;IACnB,OAAO,CAAU;CAClB;AAAA,CAAC","debug_id":"ffb6f33c-4d59-5feb-b67e-f39c63733abe"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { KPJFile } from './kpj-file.js';
|
|
2
|
-
import { KeymanDeveloperProject } from './keyman-developer-project.js';
|
|
3
|
-
import { CompilerCallbacks } from '../util/compiler-interfaces.js';
|
|
4
|
-
export declare class KPJFileReader {
|
|
5
|
-
private callbacks;
|
|
6
|
-
constructor(callbacks: CompilerCallbacks);
|
|
7
|
-
read(file: Uint8Array): KPJFile;
|
|
8
|
-
validate(source: KPJFile): void;
|
|
9
|
-
private boolFromString;
|
|
10
|
-
transform(projectFilename: string, source: KPJFile): KeymanDeveloperProject;
|
|
11
|
-
private transformFilesVersion10;
|
|
12
|
-
/**
|
|
13
|
-
* xml2js will not place single-entry objects into arrays.
|
|
14
|
-
* Easiest way to fix this is to box them ourselves as needed
|
|
15
|
-
* @param source KVKSourceFile
|
|
16
|
-
*/
|
|
17
|
-
private boxArrays;
|
|
18
|
-
}
|
|
1
|
+
import { KPJFile } from './kpj-file.js';
|
|
2
|
+
import { KeymanDeveloperProject } from './keyman-developer-project.js';
|
|
3
|
+
import { CompilerCallbacks } from '../util/compiler-interfaces.js';
|
|
4
|
+
export declare class KPJFileReader {
|
|
5
|
+
private callbacks;
|
|
6
|
+
constructor(callbacks: CompilerCallbacks);
|
|
7
|
+
read(file: Uint8Array): KPJFile;
|
|
8
|
+
validate(source: KPJFile): void;
|
|
9
|
+
private boolFromString;
|
|
10
|
+
transform(projectFilename: string, source: KPJFile): KeymanDeveloperProject;
|
|
11
|
+
private transformFilesVersion10;
|
|
12
|
+
/**
|
|
13
|
+
* xml2js will not place single-entry objects into arrays.
|
|
14
|
+
* Easiest way to fix this is to box them ourselves as needed
|
|
15
|
+
* @param source KVKSourceFile
|
|
16
|
+
*/
|
|
17
|
+
private boxArrays;
|
|
18
|
+
}
|
|
19
19
|
//# sourceMappingURL=kpj-file-reader.d.ts.map
|