@qooxdoo/framework 7.5.0 → 7.6.0
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/Manifest.json +169 -44
- package/bin/deploy/qx +7 -5
- package/lib/compiler/compile-info.json +70 -62
- package/lib/compiler/index.js +3809 -2695
- package/lib/resource/qx/tool/cli/templates/skeleton/desktop/source/class/custom/Application.tmpl.js +7 -7
- package/lib/resource/qx/tool/cli/templates/skeleton/desktop/source/class/custom/test/DemoTest.tmpl.js +10 -10
- package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/Application.tmpl.js +6 -6
- package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/page/Login.tmpl.js +9 -9
- package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/page/Overview.tmpl.js +5 -5
- package/lib/resource/qx/tool/cli/templates/skeleton/package/source/class/custom/demo/Application.tmpl.js +7 -7
- package/lib/resource/qx/tool/cli/templates/skeleton/package/source/class/custom/test/DemoTest.tmpl.js +10 -10
- package/lib/resource/qx/tool/cli/templates/skeleton/server/source/class/custom/Application.tmpl.js +6 -6
- package/lib/resource/qx/tool/cli/templates/skeleton/server/source/class/custom/test/DemoTest.tmpl.js +12 -12
- package/lib/resource/qx/tool/schema/Manifest-1-0-0.json +79 -26
- package/lib/resource/qx/tool/schema/Manifest-2-0-0.json +17 -26
- package/lib/resource/qx/tool/schema/compile-1-0-0.json +40 -53
- package/lib/resource/qx/tool/website/src/about.md +1 -1
- package/package.json +3 -3
- package/source/class/qx/bom/Font.js +36 -0
- package/source/class/qx/bom/webfonts/Validator.js +31 -6
- package/source/class/qx/bom/webfonts/WebFont.js +60 -64
- package/source/class/qx/bom/webfonts/WebFontLoader.js +461 -0
- package/source/class/qx/core/Object.js +1 -1
- package/source/class/qx/data/Array.js +27 -0
- package/source/class/qx/dev/FakeServer.js +1 -1
- package/source/class/qx/event/handler/Focus.js +2 -1
- package/source/class/qx/event/handler/GestureCore.js +1 -1
- package/source/class/qx/test/bom/webfonts/Validator.js +0 -6
- package/source/class/qx/test/core/Environment.js +8 -8
- package/source/class/qx/test/core/Validation.js +2 -2
- package/source/class/qx/test/dev/unit/Requirements.js +6 -6
- package/source/class/qx/test/io/transport/Websocket.js +1 -1
- package/source/class/qx/test/ui/basic/Image.js +3 -3
- package/source/class/qx/test/ui/basic/Label.js +0 -65
- package/source/class/qx/test/ui/form/Field.js +56 -52
- package/source/class/qx/theme/IndigoDark.js +1 -1
- package/source/class/qx/theme/classic/Font.js +7 -23
- package/source/class/qx/theme/iconfont/LoadMaterialIcons.js +2 -4
- package/source/class/qx/theme/iconfont/LoadMaterialIconsOutlined.js +2 -4
- package/source/class/qx/theme/iconfont/LoadMaterialIconsRound.js +2 -4
- package/source/class/qx/theme/iconfont/LoadMaterialIconsSharp.js +2 -4
- package/source/class/qx/theme/iconfont/LoadMaterialIconsTwoTone.js +2 -4
- package/source/class/qx/theme/indigo/DecorationDark.js +30 -0
- package/source/class/qx/theme/indigo/Font.js +8 -15
- package/source/class/qx/theme/manager/Font.js +151 -38
- package/source/class/qx/theme/modern/Font.js +1 -0
- package/source/class/qx/theme/simple/Font.js +3 -1
- package/source/class/qx/theme/tangible/Appearance.js +1 -0
- package/source/class/qx/theme/tangible/Font.js +9 -62
- package/source/class/qx/theme/tangible/Image.js +1 -4
- package/source/class/qx/tool/cli/Application.js +4 -1
- package/source/class/qx/tool/cli/Cli.js +34 -23
- package/source/class/qx/tool/cli/Watch.js +8 -6
- package/source/class/qx/tool/cli/api/CompilerApi.js +8 -0
- package/source/class/qx/tool/cli/commands/Add.js +1 -1
- package/source/class/qx/tool/cli/commands/Compile.js +24 -1
- package/source/class/qx/tool/cli/commands/Config.js +16 -141
- package/source/class/qx/tool/cli/commands/ExportGlyphs.js +134 -0
- package/source/class/qx/tool/cli/commands/Lint.js +1 -1
- package/source/class/qx/tool/cli/commands/Package.js +3 -0
- package/source/class/qx/tool/cli/commands/Pkg.js +1 -1
- package/source/class/qx/tool/cli/commands/Run.js +6 -7
- package/source/class/qx/tool/cli/commands/Serve.js +29 -36
- package/source/class/qx/tool/cli/commands/Test.js +3 -2
- package/source/class/qx/tool/cli/commands/add/Script.js +3 -1
- package/source/class/qx/tool/cli/commands/config/Delete.js +47 -0
- package/source/class/qx/tool/cli/commands/config/Get.js +52 -0
- package/source/class/qx/tool/cli/commands/config/List.js +81 -0
- package/source/class/qx/tool/cli/commands/config/Set.js +61 -0
- package/source/class/qx/tool/cli/commands/package/Install.js +3 -0
- package/source/class/qx/tool/cli/commands/package/Update.js +3 -3
- package/source/class/qx/tool/compiler/Analyser.js +45 -0
- package/source/class/qx/tool/compiler/ClassFile.js +43 -1
- package/source/class/qx/tool/compiler/Console.js +6 -1
- package/source/class/qx/tool/compiler/app/Application.js +19 -0
- package/source/class/qx/tool/compiler/app/Cldr.js +63 -26
- package/source/class/qx/tool/compiler/app/Library.js +51 -2
- package/source/class/qx/tool/compiler/app/ManifestFont.js +181 -0
- package/source/class/qx/tool/compiler/app/WebFont.js +144 -234
- package/source/class/qx/tool/compiler/makers/AppMaker.js +13 -0
- package/source/class/qx/tool/compiler/resources/ImageLoader.js +22 -12
- package/source/class/qx/tool/compiler/resources/Manager.js +2 -2
- package/source/class/qx/tool/compiler/resources/MetaLoader.js +7 -2
- package/source/class/qx/tool/compiler/resources/ResourceLoader.js +21 -0
- package/source/class/qx/tool/compiler/targets/Target.js +186 -67
- package/source/class/qx/tool/migration/M7_5_6.js +75 -0
- package/source/class/qx/tool/utils/Http.js +69 -0
- package/source/class/qx/ui/basic/Image.js +6 -2
- package/source/class/qx/ui/basic/Label.js +20 -38
- package/source/class/qx/ui/core/Widget.js +13 -42
- package/source/class/qx/ui/form/AbstractField.js +8 -2
- package/source/class/qx/ui/form/FileSelectorButton.js +5 -0
- package/source/class/qx/ui/table/pane/FocusIndicator.js +5 -4
- package/source/class/qx/ui/table/pane/Pane.js +14 -0
- package/source/class/qx/ui/table/pane/Scroller.js +3 -3
- package/source/class/qx/ui/virtual/core/Scroller.js +8 -2
- package/source/class/qx/ui/window/Window.js +9 -8
- package/source/resource/qx/iconfont/MaterialIcons/materialicons.json +10912 -0
- package/source/resource/qx/iconfont/MaterialIcons/materialiconsoutlined.json +10967 -0
- package/source/resource/qx/iconfont/MaterialIcons/materialiconsround.json +10992 -0
- package/source/resource/qx/iconfont/MaterialIcons/materialiconssharp.json +10992 -0
- package/source/resource/qx/iconfont/MaterialIcons/materialiconstwotone.json +9947 -0
- package/source/resource/qx/iconfont/MaterialIcons/x.json +10967 -0
- package/source/resource/qx/iconfont/export-glyphs.sh +22 -0
- package/source/resource/qx/mobile/scss/common/_gradients.scss +1 -1
- package/source/resource/qx/tool/cli/templates/skeleton/desktop/source/class/custom/Application.tmpl.js +7 -7
- package/source/resource/qx/tool/cli/templates/skeleton/desktop/source/class/custom/test/DemoTest.tmpl.js +10 -10
- package/source/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/Application.tmpl.js +6 -6
- package/source/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/page/Login.tmpl.js +9 -9
- package/source/resource/qx/tool/cli/templates/skeleton/mobile/source/class/custom/page/Overview.tmpl.js +5 -5
- package/source/resource/qx/tool/cli/templates/skeleton/package/source/class/custom/demo/Application.tmpl.js +7 -7
- package/source/resource/qx/tool/cli/templates/skeleton/package/source/class/custom/test/DemoTest.tmpl.js +10 -10
- package/source/resource/qx/tool/cli/templates/skeleton/server/source/class/custom/Application.tmpl.js +6 -6
- package/source/resource/qx/tool/cli/templates/skeleton/server/source/class/custom/test/DemoTest.tmpl.js +12 -12
- package/source/resource/qx/tool/schema/Manifest-1-0-0.json +79 -26
- package/source/resource/qx/tool/schema/Manifest-2-0-0.json +17 -26
- package/source/resource/qx/tool/schema/compile-1-0-0.json +40 -53
- package/source/resource/qx/tool/website/src/about.md +1 -1
- package/source/class/qx/bom/webfonts/Manager.js +0 -652
- package/source/class/qx/test/bom/webfonts/Manager.js +0 -238
|
@@ -27,6 +27,7 @@ require("app-module-path").addPath(process.cwd() + "/node_modules");
|
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* Handles compilation of the project
|
|
30
|
+
* @ignore(setImmediate)
|
|
30
31
|
*/
|
|
31
32
|
qx.Class.define("qx.tool.cli.commands.Compile", {
|
|
32
33
|
extend: qx.tool.cli.commands.Command,
|
|
@@ -111,6 +112,11 @@ qx.Class.define("qx.tool.cli.commands.Compile", {
|
|
|
111
112
|
type: "string"
|
|
112
113
|
},
|
|
113
114
|
|
|
115
|
+
"local-fonts": {
|
|
116
|
+
describe: "whether to prefer local font files over CDN",
|
|
117
|
+
type: "boolean"
|
|
118
|
+
},
|
|
119
|
+
|
|
114
120
|
watch: {
|
|
115
121
|
describe: "enables watching for changes and continuous compilation",
|
|
116
122
|
type: "boolean",
|
|
@@ -531,6 +537,10 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
|
|
|
531
537
|
* @return {Boolean} true if all makers succeeded
|
|
532
538
|
*/
|
|
533
539
|
async _loadConfigAndStartMaking() {
|
|
540
|
+
if (!this.getCompilerApi().compileJsonExists() && !qx.tool.cli.Cli.getInstance().compileJsExists()) {
|
|
541
|
+
qx.tool.compiler.Console.error("Cannot find either compile.json nor compile.js");
|
|
542
|
+
process.exit(1);
|
|
543
|
+
}
|
|
534
544
|
var config = this.getCompilerApi().getConfiguration();
|
|
535
545
|
var makers = (this.__makers = await this.createMakersFromConfig(config));
|
|
536
546
|
if (!makers || !makers.length) {
|
|
@@ -685,7 +695,7 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
|
|
|
685
695
|
);
|
|
686
696
|
|
|
687
697
|
watch.setConfigFilenames(arr);
|
|
688
|
-
return
|
|
698
|
+
return watch.start();
|
|
689
699
|
})
|
|
690
700
|
);
|
|
691
701
|
},
|
|
@@ -998,6 +1008,18 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
|
|
|
998
1008
|
target.setUpdatePoFiles(this.argv.updatePoFiles);
|
|
999
1009
|
target.setLibraryPoPolicy(this.argv.libraryPo);
|
|
1000
1010
|
|
|
1011
|
+
let fontsConfig = targetConfig.fonts || {};
|
|
1012
|
+
let preferLocalFonts = true;
|
|
1013
|
+
|
|
1014
|
+
if (this.argv.localFonts !== undefined) {
|
|
1015
|
+
preferLocalFonts = this.argv.localFonts;
|
|
1016
|
+
} else if (fontsConfig.local !== undefined) {
|
|
1017
|
+
preferLocalFonts = fontsConfig.local;
|
|
1018
|
+
}
|
|
1019
|
+
target.setPreferLocalFonts(preferLocalFonts);
|
|
1020
|
+
if (fontsConfig.fontTypes !== undefined) {
|
|
1021
|
+
target.setFontTypes(fontsConfig.fontTypes);
|
|
1022
|
+
}
|
|
1001
1023
|
// Take the command line for `minify` as most precedent only if provided
|
|
1002
1024
|
var minify;
|
|
1003
1025
|
if (process.argv.indexOf("--minify") > -1) {
|
|
@@ -1230,6 +1252,7 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
|
|
|
1230
1252
|
data.localModules || {},
|
|
1231
1253
|
false
|
|
1232
1254
|
);
|
|
1255
|
+
|
|
1233
1256
|
if (!qx.lang.Object.isEmpty(appConfig.localModules)) {
|
|
1234
1257
|
app.setLocalModules(appConfig.localModules);
|
|
1235
1258
|
}
|
|
@@ -13,13 +13,9 @@
|
|
|
13
13
|
|
|
14
14
|
Authors:
|
|
15
15
|
* John Spackman (john.spackman@zenesis.com, @johnspackman)
|
|
16
|
+
* Henner Kollmann (Henner.Kollmann@gmx.de, @hkollmann)
|
|
16
17
|
|
|
17
18
|
************************************************************************ */
|
|
18
|
-
const process = require("process");
|
|
19
|
-
const path = require("path");
|
|
20
|
-
const columnify = require("columnify");
|
|
21
|
-
const fs = qx.tool.utils.Promisify.fs;
|
|
22
|
-
|
|
23
19
|
/**
|
|
24
20
|
* Handles persistent configuration
|
|
25
21
|
*/
|
|
@@ -29,64 +25,20 @@ qx.Class.define("qx.tool.cli.commands.Config", {
|
|
|
29
25
|
|
|
30
26
|
statics: {
|
|
31
27
|
getYargsCommand() {
|
|
32
|
-
function run(argv, name) {
|
|
33
|
-
var cmd = new qx.tool.cli.commands.Config(argv);
|
|
34
|
-
return cmd[name](argv).catch(e => {
|
|
35
|
-
qx.tool.compiler.Console.error(e.stack || e.message);
|
|
36
|
-
process.exit(1);
|
|
37
|
-
});
|
|
38
|
-
}
|
|
39
28
|
return {
|
|
40
|
-
command: "config <
|
|
41
|
-
|
|
29
|
+
command: "config <command> [options]",
|
|
30
|
+
desc: "handles persistent configuration",
|
|
42
31
|
builder(yargs) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"set <key> <value>",
|
|
52
|
-
"Sets a configuration value",
|
|
53
|
-
() => {},
|
|
54
|
-
argv => run(argv, "cmdSet")
|
|
55
|
-
)
|
|
56
|
-
.command(
|
|
57
|
-
"get <key> [options]",
|
|
58
|
-
"Gets a configuration value",
|
|
59
|
-
{
|
|
60
|
-
bare: {
|
|
61
|
-
type: "boolean",
|
|
62
|
-
describe: "Restricts output to just the value"
|
|
63
|
-
}
|
|
64
|
-
},
|
|
65
|
-
|
|
66
|
-
argv => run(argv, "cmdGet")
|
|
67
|
-
)
|
|
68
|
-
.command(
|
|
69
|
-
"delete <key>",
|
|
70
|
-
"Deletes a configuration value",
|
|
71
|
-
() => {},
|
|
72
|
-
argv => run(argv, "cmdDelete")
|
|
73
|
-
)
|
|
74
|
-
.command(
|
|
75
|
-
"list",
|
|
76
|
-
"Lists all known configuration values",
|
|
77
|
-
{
|
|
78
|
-
all: {
|
|
79
|
-
type: "boolean",
|
|
80
|
-
describe: "Shows all keys, including unset"
|
|
81
|
-
}
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
argv => run(argv, "cmdList")
|
|
85
|
-
);
|
|
32
|
+
qx.tool.cli.Cli.addYargsCommands(
|
|
33
|
+
yargs,
|
|
34
|
+
["List", "Set", "Get", "Delete"],
|
|
35
|
+
|
|
36
|
+
"qx.tool.cli.commands.config"
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
return yargs.demandCommand().showHelpOnFail().help();
|
|
86
40
|
},
|
|
87
|
-
handler(
|
|
88
|
-
// Nothing
|
|
89
|
-
}
|
|
41
|
+
handler() {}
|
|
90
42
|
};
|
|
91
43
|
},
|
|
92
44
|
|
|
@@ -124,14 +76,14 @@ qx.Class.define("qx.tool.cli.commands.Config", {
|
|
|
124
76
|
},
|
|
125
77
|
|
|
126
78
|
members: {
|
|
127
|
-
|
|
79
|
+
_describe(key) {
|
|
128
80
|
var data = qx.tool.cli.commands.Config.KNOWN_VALUES[key];
|
|
129
81
|
return data && data.desc;
|
|
130
82
|
},
|
|
131
83
|
|
|
132
|
-
|
|
84
|
+
_checkKey(argv) {
|
|
133
85
|
if (!argv.quiet) {
|
|
134
|
-
let desc = this.
|
|
86
|
+
let desc = this._describe(argv.key);
|
|
135
87
|
if (!desc) {
|
|
136
88
|
qx.tool.compiler.Console.warn(
|
|
137
89
|
"Warning: Unrecognised configuration key " + argv.key
|
|
@@ -140,7 +92,7 @@ qx.Class.define("qx.tool.cli.commands.Config", {
|
|
|
140
92
|
}
|
|
141
93
|
},
|
|
142
94
|
|
|
143
|
-
|
|
95
|
+
_breakout(key) {
|
|
144
96
|
let pos = key.lastIndexOf(".");
|
|
145
97
|
let parentKey = pos > -1 ? key.substring(0, pos) : "";
|
|
146
98
|
let childKey = key.substring(pos + 1);
|
|
@@ -150,83 +102,6 @@ qx.Class.define("qx.tool.cli.commands.Config", {
|
|
|
150
102
|
parentKey: parentKey,
|
|
151
103
|
childKey: childKey
|
|
152
104
|
};
|
|
153
|
-
},
|
|
154
|
-
|
|
155
|
-
async cmdSet(argv) {
|
|
156
|
-
this.__checkKey(argv);
|
|
157
|
-
let cfg = await qx.tool.cli.ConfigDb.getInstance();
|
|
158
|
-
let setting = qx.tool.cli.commands.Config.KNOWN_VALUES[argv.key];
|
|
159
|
-
let value = argv.value;
|
|
160
|
-
if (setting && typeof setting.set == "function") {
|
|
161
|
-
value = await setting.set(value);
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
let keyInfo = this.__breakout(argv.key);
|
|
165
|
-
let parent = cfg.db(keyInfo.parentKey, {});
|
|
166
|
-
if (value === undefined) {
|
|
167
|
-
delete parent[keyInfo.childKey];
|
|
168
|
-
} else {
|
|
169
|
-
parent[keyInfo.childKey] = value;
|
|
170
|
-
}
|
|
171
|
-
await cfg.save();
|
|
172
|
-
},
|
|
173
|
-
|
|
174
|
-
async cmdDelete(argv) {
|
|
175
|
-
this.__checkKey(argv);
|
|
176
|
-
let cfg = await qx.tool.cli.ConfigDb.getInstance();
|
|
177
|
-
let keyInfo = this.__breakout(argv.key);
|
|
178
|
-
let parent = cfg.db(keyInfo.parentKey);
|
|
179
|
-
if (parent) {
|
|
180
|
-
delete parent[keyInfo.childKey];
|
|
181
|
-
}
|
|
182
|
-
await cfg.save();
|
|
183
|
-
},
|
|
184
|
-
|
|
185
|
-
async cmdGet(argv) {
|
|
186
|
-
this.__checkKey(argv);
|
|
187
|
-
let cfg = await qx.tool.cli.ConfigDb.getInstance();
|
|
188
|
-
let value = cfg.db(argv.key);
|
|
189
|
-
if (argv.bare) {
|
|
190
|
-
qx.tool.compiler.Console.info(value || "");
|
|
191
|
-
} else if (value !== undefined) {
|
|
192
|
-
qx.tool.compiler.Console.info(argv.key + "=" + value);
|
|
193
|
-
} else {
|
|
194
|
-
qx.tool.compiler.Console.info(argv.key + " is not set");
|
|
195
|
-
}
|
|
196
|
-
},
|
|
197
|
-
|
|
198
|
-
async cmdList(argv) {
|
|
199
|
-
let cfg = await qx.tool.cli.ConfigDb.getInstance();
|
|
200
|
-
|
|
201
|
-
let keys = {};
|
|
202
|
-
function scan(obj, parentKey) {
|
|
203
|
-
for (let [key, value] of Object.entries(obj)) {
|
|
204
|
-
let fullKey = parentKey + (parentKey.length ? "." : "") + key;
|
|
205
|
-
if (qx.tool.utils.Utils.isPlainObject(value)) {
|
|
206
|
-
scan(value, fullKey);
|
|
207
|
-
continue;
|
|
208
|
-
}
|
|
209
|
-
keys[fullKey] = true;
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
if (argv.all) {
|
|
213
|
-
for (let key in qx.tool.cli.commands.Config.KNOWN_VALUES) {
|
|
214
|
-
keys[key] = true;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
// Recursively get a list of all known keys
|
|
219
|
-
scan(cfg.db(), "");
|
|
220
|
-
keys = Object.keys(keys);
|
|
221
|
-
keys.sort();
|
|
222
|
-
keys = keys.map(key => ({
|
|
223
|
-
key: key,
|
|
224
|
-
value: cfg.db(key),
|
|
225
|
-
description: this.__describe(key) || "Unrecognised key"
|
|
226
|
-
}));
|
|
227
|
-
|
|
228
|
-
// Display each value
|
|
229
|
-
qx.tool.compiler.Console.info(columnify(keys));
|
|
230
105
|
}
|
|
231
106
|
}
|
|
232
107
|
});
|
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/* ************************************************************************
|
|
2
|
+
|
|
3
|
+
qooxdoo - the new era of web development
|
|
4
|
+
|
|
5
|
+
http://qooxdoo.org
|
|
6
|
+
|
|
7
|
+
Copyright:
|
|
8
|
+
2023 Zenesis Limited (https://www.zenesis.com)
|
|
9
|
+
|
|
10
|
+
License:
|
|
11
|
+
MIT: https://opensource.org/licenses/MIT
|
|
12
|
+
See the LICENSE file in the project's top-level directory for details.
|
|
13
|
+
|
|
14
|
+
Authors:
|
|
15
|
+
* John Spackman (@johnspackman)
|
|
16
|
+
|
|
17
|
+
************************************************************************ */
|
|
18
|
+
|
|
19
|
+
const fs = require("fs");
|
|
20
|
+
const path = require("upath");
|
|
21
|
+
const fontkit = require("@foliojs-fork/fontkit");
|
|
22
|
+
const tmp = require("tmp");
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Exports font ligatures as a map
|
|
26
|
+
*/
|
|
27
|
+
qx.Class.define("qx.tool.cli.commands.ExportGlyphs", {
|
|
28
|
+
extend: qx.tool.cli.commands.Command,
|
|
29
|
+
|
|
30
|
+
statics: {
|
|
31
|
+
getYargsCommand() {
|
|
32
|
+
return {
|
|
33
|
+
command: "export-glyphs font-file glyph-file",
|
|
34
|
+
describe: "export font glyphs & ligatures"
|
|
35
|
+
};
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
|
|
39
|
+
members: {
|
|
40
|
+
/**
|
|
41
|
+
* @override
|
|
42
|
+
*/
|
|
43
|
+
async process() {
|
|
44
|
+
let filename = this.argv.fontFile;
|
|
45
|
+
if (filename.match(/^https?:\/\//)) {
|
|
46
|
+
filename = await qx.tool.utils.Http.downloadToTempFile(
|
|
47
|
+
filename,
|
|
48
|
+
/^font\/(ttf|svg|eot|woff|woff2)$/
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
let font = await qx.tool.utils.Promisify.call(cb =>
|
|
52
|
+
fontkit.open(filename, null, cb)
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
if (!font.GSUB) {
|
|
56
|
+
qx.tool.compiler.Console.error(
|
|
57
|
+
`The webfont in ${filename} does not have any ligatures`
|
|
58
|
+
);
|
|
59
|
+
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
let glyphs = {};
|
|
64
|
+
|
|
65
|
+
// some IconFonts (MaterialIcons for example) use ligatures
|
|
66
|
+
// to name their icons. This code extracts the ligatures
|
|
67
|
+
// hat tip to Jossef Harush https://stackoverflow.com/questions/54721774/extracting-ttf-font-ligature-mappings/54728584
|
|
68
|
+
let ligatureName = {};
|
|
69
|
+
let lookupList = font.GSUB.lookupList.toArray();
|
|
70
|
+
let lookupListIndexes =
|
|
71
|
+
font.GSUB.featureList[0].feature.lookupListIndexes;
|
|
72
|
+
lookupListIndexes.forEach(index => {
|
|
73
|
+
let subTable = lookupList[index].subTables[0];
|
|
74
|
+
let leadingCharacters = [];
|
|
75
|
+
if (subTable.coverage.rangeRecords) {
|
|
76
|
+
subTable.coverage.rangeRecords.forEach(coverage => {
|
|
77
|
+
for (let i = coverage.start; i <= coverage.end; i++) {
|
|
78
|
+
let character = font.stringsForGlyph(i)[0];
|
|
79
|
+
leadingCharacters.push(character);
|
|
80
|
+
}
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
let ligatureSets = subTable.ligatureSets.toArray();
|
|
84
|
+
ligatureSets.forEach((ligatureSet, ligatureSetIndex) => {
|
|
85
|
+
let leadingCharacter = leadingCharacters[ligatureSetIndex];
|
|
86
|
+
ligatureSet.forEach(ligature => {
|
|
87
|
+
let character = font.stringsForGlyph(ligature.glyph)[0];
|
|
88
|
+
if (!character) {
|
|
89
|
+
// qx.tool.compiler.Console.log(`WARN: ${this.getName()} no character ${ligature}`);
|
|
90
|
+
return;
|
|
91
|
+
}
|
|
92
|
+
let ligatureText =
|
|
93
|
+
leadingCharacter +
|
|
94
|
+
ligature.components.map(x => font.stringsForGlyph(x)[0]).join("");
|
|
95
|
+
var hexId = character.charCodeAt(0).toString(16);
|
|
96
|
+
if (ligatureName[hexId] == undefined) {
|
|
97
|
+
ligatureName[hexId] = [ligatureText];
|
|
98
|
+
} else {
|
|
99
|
+
ligatureName[hexId].push(ligatureText);
|
|
100
|
+
}
|
|
101
|
+
});
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
|
|
105
|
+
font.characterSet.forEach(codePoint => {
|
|
106
|
+
let glyph = font.glyphForCodePoint(codePoint);
|
|
107
|
+
if (glyph.path.commands.length < 1 && !glyph.layers) {
|
|
108
|
+
return;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const found = gName => {
|
|
112
|
+
glyphs[gName] = {
|
|
113
|
+
advanceWidth: glyph.advanceWidth,
|
|
114
|
+
advanceHeight: glyph.advanceHeight,
|
|
115
|
+
codePoint
|
|
116
|
+
};
|
|
117
|
+
};
|
|
118
|
+
if (glyph.name) {
|
|
119
|
+
found(glyph.name);
|
|
120
|
+
}
|
|
121
|
+
var names = ligatureName[codePoint.toString(16)];
|
|
122
|
+
if (names) {
|
|
123
|
+
names.forEach(found);
|
|
124
|
+
}
|
|
125
|
+
});
|
|
126
|
+
|
|
127
|
+
await fs.promises.writeFile(
|
|
128
|
+
this.argv.glyphFile,
|
|
129
|
+
JSON.stringify(glyphs, null, 2),
|
|
130
|
+
"utf8"
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
});
|
|
@@ -113,7 +113,7 @@ qx.Class.define("qx.tool.cli.commands.Lint", {
|
|
|
113
113
|
helperFilePath = path.dirname(helperFilePath);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
let config =
|
|
116
|
+
let config = qx.tool.cli.Cli.getInstance().getParsedArgs();
|
|
117
117
|
let lintOptions = config.eslintConfig || {};
|
|
118
118
|
lintOptions.extends = lintOptions.extends || ["@qooxdoo/qx/browser"];
|
|
119
119
|
lintOptions.globals = Object.assign(
|
|
@@ -68,12 +68,12 @@ qx.Class.define("qx.tool.cli.commands.Run", {
|
|
|
68
68
|
let config = this.getCompilerApi().getConfiguration();
|
|
69
69
|
if (!config.run) {
|
|
70
70
|
qx.tool.compiler.Console.print("qx.tool.cli.run.noRunConfig");
|
|
71
|
-
process.exit(
|
|
71
|
+
process.exit(1);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
74
|
if (!config.run.application) {
|
|
75
75
|
qx.tool.compiler.Console.print("qx.tool.cli.run.noAppName");
|
|
76
|
-
process.exit(
|
|
76
|
+
process.exit(1);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
let maker = null;
|
|
@@ -85,14 +85,14 @@ qx.Class.define("qx.tool.cli.commands.Run", {
|
|
|
85
85
|
if (apps.length) {
|
|
86
86
|
if (maker) {
|
|
87
87
|
qx.tool.compiler.Console.print("qx.tool.cli.run.tooManyMakers");
|
|
88
|
-
process.exit(
|
|
88
|
+
process.exit(1);
|
|
89
89
|
}
|
|
90
90
|
if (apps.length != 1) {
|
|
91
91
|
qx.tool.compiler.Console.print(
|
|
92
92
|
"qx.tool.cli.run.tooManyApplications"
|
|
93
93
|
);
|
|
94
94
|
|
|
95
|
-
process.exit(
|
|
95
|
+
process.exit(1);
|
|
96
96
|
}
|
|
97
97
|
maker = tmp;
|
|
98
98
|
app = apps[0];
|
|
@@ -100,11 +100,11 @@ qx.Class.define("qx.tool.cli.commands.Run", {
|
|
|
100
100
|
});
|
|
101
101
|
if (!app) {
|
|
102
102
|
qx.tool.compiler.Console.print("qx.tool.cli.run.noAppName");
|
|
103
|
-
process.exit(
|
|
103
|
+
process.exit(1);
|
|
104
104
|
}
|
|
105
105
|
if (app.getType() != "node") {
|
|
106
106
|
qx.tool.compiler.Console.print("qx.tool.cli.run.mustBeNode");
|
|
107
|
-
process.exit(
|
|
107
|
+
process.exit(1);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
let target = maker.getTarget();
|
|
@@ -150,7 +150,6 @@ qx.Class.define("qx.tool.cli.commands.Run", {
|
|
|
150
150
|
child.stdout.on("data", function (data) {
|
|
151
151
|
console.log(data);
|
|
152
152
|
});
|
|
153
|
-
|
|
154
153
|
child.stderr.setEncoding("utf8");
|
|
155
154
|
child.stderr.on("data", function (data) {
|
|
156
155
|
console.error(data);
|
|
@@ -90,9 +90,6 @@ qx.Class.define("qx.tool.cli.commands.Serve", {
|
|
|
90
90
|
},
|
|
91
91
|
|
|
92
92
|
members: {
|
|
93
|
-
/** @type {qx.tool.utils.Website} the Website instance */
|
|
94
|
-
_website: null,
|
|
95
|
-
|
|
96
93
|
/*
|
|
97
94
|
* @Override
|
|
98
95
|
*/
|
|
@@ -100,18 +97,19 @@ qx.Class.define("qx.tool.cli.commands.Serve", {
|
|
|
100
97
|
this.argv.watch = true;
|
|
101
98
|
this.argv["machine-readable"] = false;
|
|
102
99
|
this.argv["feedback"] = false;
|
|
103
|
-
await super.process();
|
|
104
100
|
|
|
105
101
|
// build website if it hasn't been built yet.
|
|
106
|
-
const website =
|
|
102
|
+
const website = new qx.tool.utils.Website();
|
|
107
103
|
if (!(await fs.existsAsync(website.getTargetDir()))) {
|
|
108
104
|
qx.tool.compiler.Console.info(">>> Building startpage...");
|
|
109
|
-
await
|
|
105
|
+
await website.rebuildAll();
|
|
110
106
|
} else if (this.argv.rebuildStartpage) {
|
|
111
|
-
|
|
107
|
+
website.startWatcher();
|
|
112
108
|
}
|
|
113
|
-
|
|
114
|
-
|
|
109
|
+
this.addListenerOnce("made", () => {
|
|
110
|
+
this.runWebServer();
|
|
111
|
+
});
|
|
112
|
+
return super.process();
|
|
115
113
|
},
|
|
116
114
|
|
|
117
115
|
/**
|
|
@@ -210,36 +208,31 @@ qx.Class.define("qx.tool.cli.commands.Serve", {
|
|
|
210
208
|
res.send(JSON.stringify(appsData, null, 2));
|
|
211
209
|
});
|
|
212
210
|
}
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
server.on("error", e => {
|
|
222
|
-
if (e.code === "EADDRINUSE") {
|
|
223
|
-
qx.tool.compiler.Console.print(
|
|
224
|
-
"qx.tool.cli.serve.webAddrInUse",
|
|
225
|
-
config.serve.listenPort
|
|
226
|
-
);
|
|
227
|
-
|
|
228
|
-
process.exit(-1);
|
|
229
|
-
} else {
|
|
230
|
-
qx.tool.compiler.Console.log(
|
|
231
|
-
"Error when starting web server: " + e
|
|
232
|
-
);
|
|
233
|
-
}
|
|
234
|
-
});
|
|
235
|
-
server.listen(config.serve.listenPort, () => {
|
|
211
|
+
let server = http.createServer(app);
|
|
212
|
+
this.fireDataEvent("beforeStart", {
|
|
213
|
+
server: server,
|
|
214
|
+
application: app,
|
|
215
|
+
outputdir: defaultMaker.getTarget().getOutputDir()
|
|
216
|
+
});
|
|
217
|
+
server.on("error", e => {
|
|
218
|
+
if (e.code === "EADDRINUSE") {
|
|
236
219
|
qx.tool.compiler.Console.print(
|
|
237
|
-
"qx.tool.cli.serve.
|
|
238
|
-
|
|
220
|
+
"qx.tool.cli.serve.webAddrInUse",
|
|
221
|
+
config.serve.listenPort
|
|
239
222
|
);
|
|
240
223
|
|
|
241
|
-
|
|
242
|
-
}
|
|
224
|
+
process.exit(1);
|
|
225
|
+
} else {
|
|
226
|
+
qx.tool.compiler.Console.log("Error when starting web server: " + e);
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
server.listen(config.serve.listenPort, () => {
|
|
230
|
+
qx.tool.compiler.Console.print(
|
|
231
|
+
"qx.tool.cli.serve.webStarted",
|
|
232
|
+
"http://localhost:" + config.serve.listenPort
|
|
233
|
+
);
|
|
234
|
+
|
|
235
|
+
this.fireEvent("afterStart");
|
|
243
236
|
});
|
|
244
237
|
},
|
|
245
238
|
|
|
@@ -188,7 +188,7 @@ qx.Class.define("qx.tool.cli.commands.Test", {
|
|
|
188
188
|
See documentation at https://qooxdoo.org/docs/#/development/testing/`
|
|
189
189
|
);
|
|
190
190
|
|
|
191
|
-
process.exit(
|
|
191
|
+
process.exit(1);
|
|
192
192
|
}
|
|
193
193
|
});
|
|
194
194
|
|
|
@@ -206,6 +206,7 @@ qx.Class.define("qx.tool.cli.commands.Test", {
|
|
|
206
206
|
await test.execute();
|
|
207
207
|
}
|
|
208
208
|
// for bash exitcode is not allowed to be more then 255!
|
|
209
|
+
// We must exit the process here because serve runs infinite!
|
|
209
210
|
process.exit(Math.min(255, this.getExitCode()));
|
|
210
211
|
});
|
|
211
212
|
|
|
@@ -216,7 +217,7 @@ qx.Class.define("qx.tool.cli.commands.Test", {
|
|
|
216
217
|
// compile only
|
|
217
218
|
await qx.tool.cli.commands.Compile.prototype.process.call(this);
|
|
218
219
|
// since the server is not started, manually fire the event necessary for firing the "runTests" event
|
|
219
|
-
this.
|
|
220
|
+
await this.fireDataEventAsync("afterStart");
|
|
220
221
|
}
|
|
221
222
|
},
|
|
222
223
|
|
|
@@ -140,7 +140,9 @@ qx.Class.define("qx.tool.cli.commands.add.Script", {
|
|
|
140
140
|
}
|
|
141
141
|
// save
|
|
142
142
|
this.debug(script_list);
|
|
143
|
-
manifestModel
|
|
143
|
+
await manifestModel
|
|
144
|
+
.setValue("externalResources.script", script_list)
|
|
145
|
+
.save();
|
|
144
146
|
}
|
|
145
147
|
}
|
|
146
148
|
});
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/* ************************************************************************
|
|
2
|
+
|
|
3
|
+
qooxdoo - the new era of web development
|
|
4
|
+
|
|
5
|
+
http://qooxdoo.org
|
|
6
|
+
|
|
7
|
+
Copyright:
|
|
8
|
+
2017 Christian Boulanger
|
|
9
|
+
|
|
10
|
+
License:
|
|
11
|
+
MIT: https://opensource.org/licenses/MIT
|
|
12
|
+
See the LICENSE file in the project's top-level directory for details.
|
|
13
|
+
|
|
14
|
+
Authors:
|
|
15
|
+
* Christian Boulanger (info@bibliograph.org, @cboulanger)
|
|
16
|
+
* Henner Kollmann (Henner.Kollmann@gmx.de, @hkollmann)
|
|
17
|
+
|
|
18
|
+
************************************************************************ */
|
|
19
|
+
qx.Class.define("qx.tool.cli.commands.config.Delete", {
|
|
20
|
+
extend: qx.tool.cli.commands.Config,
|
|
21
|
+
statics: {
|
|
22
|
+
/**
|
|
23
|
+
* Returns the yargs command data
|
|
24
|
+
* @return {Object}
|
|
25
|
+
*/
|
|
26
|
+
getYargsCommand() {
|
|
27
|
+
return {
|
|
28
|
+
command: "delete <key>",
|
|
29
|
+
describe: "Deletes a configuration value"
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
members: {
|
|
35
|
+
async process() {
|
|
36
|
+
await super.process();
|
|
37
|
+
this._checkKey(this.argv);
|
|
38
|
+
let cfg = await qx.tool.cli.ConfigDb.getInstance();
|
|
39
|
+
let keyInfo = this._breakout(this.argv.key);
|
|
40
|
+
let parent = cfg.db(keyInfo.parentKey);
|
|
41
|
+
if (parent) {
|
|
42
|
+
delete parent[keyInfo.childKey];
|
|
43
|
+
}
|
|
44
|
+
await cfg.save();
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
});
|