@qooxdoo/framework 7.5.1 → 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/lib/compiler/compile-info.json +76 -68
- package/lib/compiler/index.js +3683 -2588
- 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/package.json +2 -2
- 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/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/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/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/Cli.js +12 -0
- package/source/class/qx/tool/cli/Watch.js +3 -0
- 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 +22 -0
- 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/Package.js +3 -0
- package/source/class/qx/tool/cli/commands/Pkg.js +1 -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/Update.js +3 -3
- package/source/class/qx/tool/compiler/Analyser.js +45 -0
- package/source/class/qx/tool/compiler/ClassFile.js +41 -0
- 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/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/Label.js +20 -38
- 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/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/class/qx/bom/webfonts/Manager.js +0 -652
- package/source/class/qx/test/bom/webfonts/Manager.js +0 -238
|
@@ -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
|
+
});
|
|
@@ -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
|
+
});
|
|
@@ -0,0 +1,52 @@
|
|
|
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.Get", {
|
|
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: "get <key> [options]",
|
|
29
|
+
describe: "Gets a configuration value"
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
|
|
34
|
+
members: {
|
|
35
|
+
/**
|
|
36
|
+
* Lists library packages compatible with the current project
|
|
37
|
+
*/
|
|
38
|
+
async process() {
|
|
39
|
+
await super.process();
|
|
40
|
+
this._checkKey(this.argv);
|
|
41
|
+
let cfg = await qx.tool.cli.ConfigDb.getInstance();
|
|
42
|
+
let value = cfg.db(this.argv.key);
|
|
43
|
+
if (this.argv.bare) {
|
|
44
|
+
qx.tool.compiler.Console.info(value || "");
|
|
45
|
+
} else if (value !== undefined) {
|
|
46
|
+
qx.tool.compiler.Console.info(this.argv.key + "=" + value);
|
|
47
|
+
} else {
|
|
48
|
+
qx.tool.compiler.Console.info(this.argv.key + " is not set");
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
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
|
+
const columnify = require("columnify");
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Lists compatible packages
|
|
23
|
+
*/
|
|
24
|
+
qx.Class.define("qx.tool.cli.commands.config.List", {
|
|
25
|
+
extend: qx.tool.cli.commands.Config,
|
|
26
|
+
statics: {
|
|
27
|
+
/**
|
|
28
|
+
* Returns the yargs command data
|
|
29
|
+
* @return {Object}
|
|
30
|
+
*/
|
|
31
|
+
getYargsCommand() {
|
|
32
|
+
return {
|
|
33
|
+
command: "list",
|
|
34
|
+
describe: "Lists all known configuration values",
|
|
35
|
+
builder: {
|
|
36
|
+
all: {
|
|
37
|
+
type: "boolean",
|
|
38
|
+
describe: "Shows all keys, including unset"
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
},
|
|
44
|
+
|
|
45
|
+
members: {
|
|
46
|
+
async process() {
|
|
47
|
+
await super.process();
|
|
48
|
+
let cfg = await qx.tool.cli.ConfigDb.getInstance();
|
|
49
|
+
|
|
50
|
+
let keys = {};
|
|
51
|
+
function scan(obj, parentKey) {
|
|
52
|
+
for (let [key, value] of Object.entries(obj)) {
|
|
53
|
+
let fullKey = parentKey + (parentKey.length ? "." : "") + key;
|
|
54
|
+
if (qx.tool.utils.Utils.isPlainObject(value)) {
|
|
55
|
+
scan(value, fullKey);
|
|
56
|
+
continue;
|
|
57
|
+
}
|
|
58
|
+
keys[fullKey] = true;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
if (this.argv.all) {
|
|
62
|
+
for (let key in qx.tool.cli.commands.Config.KNOWN_VALUES) {
|
|
63
|
+
keys[key] = true;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
// Recursively get a list of all known keys
|
|
68
|
+
scan(cfg.db(), "");
|
|
69
|
+
keys = Object.keys(keys);
|
|
70
|
+
keys.sort();
|
|
71
|
+
keys = keys.map(key => ({
|
|
72
|
+
key: key,
|
|
73
|
+
value: cfg.db(key),
|
|
74
|
+
description: this._describe(key) || "Unrecognised key"
|
|
75
|
+
}));
|
|
76
|
+
|
|
77
|
+
// Display each value
|
|
78
|
+
qx.tool.compiler.Console.info(columnify(keys));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
});
|
|
@@ -0,0 +1,61 @@
|
|
|
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.Set", {
|
|
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: "set <key> <value>",
|
|
29
|
+
describe: "Sets a configuration value",
|
|
30
|
+
builder: {
|
|
31
|
+
all: {
|
|
32
|
+
type: "boolean",
|
|
33
|
+
describe: "Shows all keys, including unset"
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
},
|
|
39
|
+
|
|
40
|
+
members: {
|
|
41
|
+
async process() {
|
|
42
|
+
await super.process();
|
|
43
|
+
this._checkKey(this.argv);
|
|
44
|
+
let cfg = await qx.tool.cli.ConfigDb.getInstance();
|
|
45
|
+
let setting = qx.tool.cli.commands.Config.KNOWN_VALUES[this.argv.key];
|
|
46
|
+
let value = this.argv.value;
|
|
47
|
+
if (setting && typeof setting.set == "function") {
|
|
48
|
+
value = await setting.set(value);
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
let keyInfo = this._breakout(this.argv.key);
|
|
52
|
+
let parent = cfg.db(keyInfo.parentKey, {});
|
|
53
|
+
if (value === undefined) {
|
|
54
|
+
delete parent[keyInfo.childKey];
|
|
55
|
+
} else {
|
|
56
|
+
parent[keyInfo.childKey] = value;
|
|
57
|
+
}
|
|
58
|
+
await cfg.save();
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
});
|
|
@@ -325,10 +325,10 @@ qx.Class.define("qx.tool.cli.commands.package.Update", {
|
|
|
325
325
|
}
|
|
326
326
|
|
|
327
327
|
// create a list of libraries via their manifests
|
|
328
|
-
for (let [index,
|
|
328
|
+
for (let [index, manifest] of manifests.entries()) {
|
|
329
329
|
let manifest_data;
|
|
330
|
-
manifest_path = path.join(
|
|
331
|
-
|
|
330
|
+
const manifest_path = path.join(
|
|
331
|
+
manifest.path,
|
|
332
332
|
qx.tool.config.Manifest.config.fileName
|
|
333
333
|
);
|
|
334
334
|
|
|
@@ -61,6 +61,7 @@ qx.Class.define("qx.tool.compiler.Analyser", {
|
|
|
61
61
|
this.__translations = {};
|
|
62
62
|
this.__classFiles = {};
|
|
63
63
|
this.__environmentChecks = {};
|
|
64
|
+
this.__fonts = {};
|
|
64
65
|
},
|
|
65
66
|
|
|
66
67
|
properties: {
|
|
@@ -194,6 +195,9 @@ qx.Class.define("qx.tool.compiler.Analyser", {
|
|
|
194
195
|
__cldrs: null,
|
|
195
196
|
__translations: null,
|
|
196
197
|
|
|
198
|
+
/** @type{qx.tool.compiler.app.ManifestFont[]} list of fonts in provides.fonts */
|
|
199
|
+
__fonts: null,
|
|
200
|
+
|
|
197
201
|
__classFiles: null,
|
|
198
202
|
__environmentChecks: null,
|
|
199
203
|
__inDefer: false,
|
|
@@ -1415,6 +1419,47 @@ qx.Class.define("qx.tool.compiler.Analyser", {
|
|
|
1415
1419
|
this.__librariesByNamespace[library.getNamespace()] = library;
|
|
1416
1420
|
},
|
|
1417
1421
|
|
|
1422
|
+
/**
|
|
1423
|
+
* Returns a font by name
|
|
1424
|
+
*
|
|
1425
|
+
* @param {String} name
|
|
1426
|
+
* @param {Boolean?} create whether to create the font if it does not exist (default is false)
|
|
1427
|
+
* @returns {qx.tool.app.ManifestFont?} null if it does not exist and `create` is falsey
|
|
1428
|
+
*/
|
|
1429
|
+
getFont(name, create) {
|
|
1430
|
+
let font = this.__fonts[name] || null;
|
|
1431
|
+
if (!font && create) {
|
|
1432
|
+
font = this.__fonts[name] = new qx.tool.compiler.app.ManifestFont(name);
|
|
1433
|
+
}
|
|
1434
|
+
return font;
|
|
1435
|
+
},
|
|
1436
|
+
|
|
1437
|
+
/**
|
|
1438
|
+
* Detects whether the filename is one of the fonts
|
|
1439
|
+
*
|
|
1440
|
+
* @param {String} filename
|
|
1441
|
+
* @returns {Boolean} whether the filename is a font asset
|
|
1442
|
+
*/
|
|
1443
|
+
isFontAsset(filename) {
|
|
1444
|
+
let isFont = false;
|
|
1445
|
+
if (filename.endsWith("svg")) {
|
|
1446
|
+
for (let fontName in this.__fonts) {
|
|
1447
|
+
let font = this.__fonts[fontName];
|
|
1448
|
+
let sources = font.getSources() || [];
|
|
1449
|
+
isFont = sources.find(source => source == filename);
|
|
1450
|
+
}
|
|
1451
|
+
}
|
|
1452
|
+
return isFont;
|
|
1453
|
+
},
|
|
1454
|
+
/**
|
|
1455
|
+
* Returns the map of all fonts, indexed by name
|
|
1456
|
+
*
|
|
1457
|
+
* @returns {Map<String,qx.tool.app.ManifestFont>}
|
|
1458
|
+
*/
|
|
1459
|
+
getFonts() {
|
|
1460
|
+
return this.__fonts;
|
|
1461
|
+
},
|
|
1462
|
+
|
|
1418
1463
|
/**
|
|
1419
1464
|
* Adds a required class to be analysed by analyseClasses()
|
|
1420
1465
|
*
|