@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.
Files changed (85) hide show
  1. package/Manifest.json +169 -44
  2. package/lib/compiler/compile-info.json +76 -68
  3. package/lib/compiler/index.js +3683 -2588
  4. package/lib/resource/qx/tool/schema/Manifest-1-0-0.json +79 -26
  5. package/lib/resource/qx/tool/schema/Manifest-2-0-0.json +17 -26
  6. package/lib/resource/qx/tool/schema/compile-1-0-0.json +40 -53
  7. package/package.json +2 -2
  8. package/source/class/qx/bom/Font.js +36 -0
  9. package/source/class/qx/bom/webfonts/Validator.js +31 -6
  10. package/source/class/qx/bom/webfonts/WebFont.js +60 -64
  11. package/source/class/qx/bom/webfonts/WebFontLoader.js +461 -0
  12. package/source/class/qx/core/Object.js +1 -1
  13. package/source/class/qx/data/Array.js +27 -0
  14. package/source/class/qx/dev/FakeServer.js +1 -1
  15. package/source/class/qx/event/handler/Focus.js +2 -1
  16. package/source/class/qx/event/handler/GestureCore.js +1 -1
  17. package/source/class/qx/test/bom/webfonts/Validator.js +0 -6
  18. package/source/class/qx/test/core/Environment.js +8 -8
  19. package/source/class/qx/test/core/Validation.js +2 -2
  20. package/source/class/qx/test/dev/unit/Requirements.js +6 -6
  21. package/source/class/qx/test/ui/basic/Image.js +3 -3
  22. package/source/class/qx/test/ui/basic/Label.js +0 -65
  23. package/source/class/qx/test/ui/form/Field.js +56 -52
  24. package/source/class/qx/theme/classic/Font.js +7 -23
  25. package/source/class/qx/theme/iconfont/LoadMaterialIcons.js +2 -4
  26. package/source/class/qx/theme/iconfont/LoadMaterialIconsOutlined.js +2 -4
  27. package/source/class/qx/theme/iconfont/LoadMaterialIconsRound.js +2 -4
  28. package/source/class/qx/theme/iconfont/LoadMaterialIconsSharp.js +2 -4
  29. package/source/class/qx/theme/iconfont/LoadMaterialIconsTwoTone.js +2 -4
  30. package/source/class/qx/theme/indigo/Font.js +8 -15
  31. package/source/class/qx/theme/manager/Font.js +151 -38
  32. package/source/class/qx/theme/modern/Font.js +1 -0
  33. package/source/class/qx/theme/simple/Font.js +3 -1
  34. package/source/class/qx/theme/tangible/Appearance.js +1 -0
  35. package/source/class/qx/theme/tangible/Font.js +9 -62
  36. package/source/class/qx/theme/tangible/Image.js +1 -4
  37. package/source/class/qx/tool/cli/Cli.js +12 -0
  38. package/source/class/qx/tool/cli/Watch.js +3 -0
  39. package/source/class/qx/tool/cli/api/CompilerApi.js +8 -0
  40. package/source/class/qx/tool/cli/commands/Add.js +1 -1
  41. package/source/class/qx/tool/cli/commands/Compile.js +22 -0
  42. package/source/class/qx/tool/cli/commands/Config.js +16 -141
  43. package/source/class/qx/tool/cli/commands/ExportGlyphs.js +134 -0
  44. package/source/class/qx/tool/cli/commands/Package.js +3 -0
  45. package/source/class/qx/tool/cli/commands/Pkg.js +1 -1
  46. package/source/class/qx/tool/cli/commands/config/Delete.js +47 -0
  47. package/source/class/qx/tool/cli/commands/config/Get.js +52 -0
  48. package/source/class/qx/tool/cli/commands/config/List.js +81 -0
  49. package/source/class/qx/tool/cli/commands/config/Set.js +61 -0
  50. package/source/class/qx/tool/cli/commands/package/Update.js +3 -3
  51. package/source/class/qx/tool/compiler/Analyser.js +45 -0
  52. package/source/class/qx/tool/compiler/ClassFile.js +41 -0
  53. package/source/class/qx/tool/compiler/Console.js +6 -1
  54. package/source/class/qx/tool/compiler/app/Application.js +19 -0
  55. package/source/class/qx/tool/compiler/app/Library.js +51 -2
  56. package/source/class/qx/tool/compiler/app/ManifestFont.js +181 -0
  57. package/source/class/qx/tool/compiler/app/WebFont.js +144 -234
  58. package/source/class/qx/tool/compiler/makers/AppMaker.js +13 -0
  59. package/source/class/qx/tool/compiler/resources/ImageLoader.js +22 -12
  60. package/source/class/qx/tool/compiler/resources/Manager.js +2 -2
  61. package/source/class/qx/tool/compiler/resources/MetaLoader.js +7 -2
  62. package/source/class/qx/tool/compiler/resources/ResourceLoader.js +21 -0
  63. package/source/class/qx/tool/compiler/targets/Target.js +186 -67
  64. package/source/class/qx/tool/migration/M7_5_6.js +75 -0
  65. package/source/class/qx/tool/utils/Http.js +69 -0
  66. package/source/class/qx/ui/basic/Label.js +20 -38
  67. package/source/class/qx/ui/form/AbstractField.js +8 -2
  68. package/source/class/qx/ui/form/FileSelectorButton.js +5 -0
  69. package/source/class/qx/ui/table/pane/FocusIndicator.js +5 -4
  70. package/source/class/qx/ui/table/pane/Pane.js +14 -0
  71. package/source/class/qx/ui/table/pane/Scroller.js +3 -3
  72. package/source/class/qx/ui/virtual/core/Scroller.js +8 -2
  73. package/source/class/qx/ui/window/Window.js +9 -8
  74. package/source/resource/qx/iconfont/MaterialIcons/materialicons.json +10912 -0
  75. package/source/resource/qx/iconfont/MaterialIcons/materialiconsoutlined.json +10967 -0
  76. package/source/resource/qx/iconfont/MaterialIcons/materialiconsround.json +10992 -0
  77. package/source/resource/qx/iconfont/MaterialIcons/materialiconssharp.json +10992 -0
  78. package/source/resource/qx/iconfont/MaterialIcons/materialiconstwotone.json +9947 -0
  79. package/source/resource/qx/iconfont/MaterialIcons/x.json +10967 -0
  80. package/source/resource/qx/iconfont/export-glyphs.sh +22 -0
  81. package/source/resource/qx/tool/schema/Manifest-1-0-0.json +79 -26
  82. package/source/resource/qx/tool/schema/Manifest-2-0-0.json +17 -26
  83. package/source/resource/qx/tool/schema/compile-1-0-0.json +40 -53
  84. package/source/class/qx/bom/webfonts/Manager.js +0 -652
  85. package/source/class/qx/test/bom/webfonts/Manager.js +0 -238
@@ -102,16 +102,12 @@ qx.Class.define("qx.theme.manager.Font", {
102
102
  // the theme and are not updating the cache
103
103
  var theme = this.getTheme();
104
104
  if (theme !== null && theme.fonts[value]) {
105
- var font = this.__getFontClass(theme.fonts[value]);
106
- var fo = new font();
107
-
108
- // Inject information about custom charcter set tests before we apply the
109
- // complete blob in one.
110
- if (theme.fonts[value].comparisonString) {
111
- fo.setComparisonString(theme.fonts[value].comparisonString);
105
+ let createdFonts = this.__initialiseFonts(theme.fonts);
106
+ let font = createdFonts[value] || null;
107
+ if (font) {
108
+ cache[value] = font;
112
109
  }
113
-
114
- return (cache[value] = fo.set(theme.fonts[value]));
110
+ return font;
115
111
  }
116
112
  if (qx.core.Environment.get("qx.debug")) {
117
113
  if (theme) {
@@ -154,16 +150,16 @@ qx.Class.define("qx.theme.manager.Font", {
154
150
  // the theme and are not updating the cache
155
151
  var theme = this.getTheme();
156
152
  if (theme !== null && value && theme.fonts[value]) {
157
- var font = this.__getFontClass(theme.fonts[value]);
158
- var fo = new font();
153
+ var fontClass = this.__getFontClass(theme.fonts[value]);
154
+ var font = new fontClass();
159
155
 
160
156
  // Inject information about custom charcter set tests before we apply the
161
157
  // complete blob in one.
162
158
  if (theme.fonts[value].comparisonString) {
163
- fo.setComparisonString(theme.fonts[value].comparisonString);
159
+ font.setComparisonString(theme.fonts[value].comparisonString);
164
160
  }
165
161
 
166
- cache[value] = fo.set(theme.fonts[value]);
162
+ cache[value] = font.set(theme.fonts[value]);
167
163
  return true;
168
164
  }
169
165
 
@@ -195,41 +191,149 @@ qx.Class.define("qx.theme.manager.Font", {
195
191
  }
196
192
  },
197
193
 
198
- // apply method
199
- _applyTheme(value) {
200
- var dest = (this._dynamic = {});
194
+ /**
195
+ * Initialises fonts from a set of font definitions (eg from a theme Font configuration)
196
+ *
197
+ * @param {Map<String,Object>} fontDefs indexed by font ID
198
+ * @return {Map<String,qx.bom.Font>} created fonts
199
+ */
200
+ __initialiseFonts(fontDefs) {
201
+ let webFontDefs = [];
202
+ let createdFonts = {};
203
+
204
+ for (var fontId in fontDefs) {
205
+ let fontDef = fontDefs[fontId];
206
+ if (fontDef.include && fontDefs[fontDef.include]) {
207
+ this.__resolveInclude(fontDefs, fontId);
208
+ }
201
209
 
202
- for (var key in dest) {
203
- if (dest[key].themed) {
204
- dest[key].dispose();
205
- delete dest[key];
210
+ if (fontDef.fontName) {
211
+ let preset = this._manifestFonts[fontDef.fontName];
212
+ Object.keys(preset).forEach(presetKey => {
213
+ if (fontDef[presetKey] === undefined) {
214
+ fontDef[presetKey] = preset[presetKey];
215
+ }
216
+ });
206
217
  }
207
- }
208
218
 
209
- if (value) {
210
- var source = this._manifestFonts
211
- ? Object.assign(value.fonts, this._manifestFonts)
212
- : value.fonts;
219
+ // If the theme font is defining sources, then we want to intercept that and either
220
+ // fabricate a Manifest font, or if the qx.bom.webfonts.WebFont has already been
221
+ // created we need to add the font face definition to the existing one
222
+ if (fontDef.sources) {
223
+ // Make sure the font family is specified in the font definition (it was previously allowable to
224
+ // only specify the font family in the sources object)
225
+ if (
226
+ fontDef.sources.family &&
227
+ fontDef.family.indexOf(fontDef.sources.family) < 0
228
+ ) {
229
+ fontDef.family.unshift(fontDef.sources.family);
230
+ }
231
+ let family = fontDef.family[0];
232
+
233
+ // Make sure that there is a font definition
234
+ if (!fontDefs[family]) {
235
+ fontDefs[family] = {
236
+ fontFaces: []
237
+ };
238
+ }
239
+
240
+ // Create a lookup of the fontFaces within the font definition
241
+ let fontFacesLookup = {};
242
+ fontDefs[family].fontFaces.forEach(fontFace => {
243
+ let fontKey = qx.bom.webfonts.WebFontLoader.createFontLookupKey(
244
+ fontFace.family,
245
+ fontFace.fontWeight,
246
+ fontFace.fontStyle
247
+ );
248
+
249
+ fontFacesLookup[fontKey] = fontFace;
250
+ });
251
+ let fontKey = qx.bom.webfonts.WebFontLoader.createFontLookupKey(
252
+ fontDef.sources.family,
253
+ fontDef.sources.fontWeight,
254
+ fontDef.sources.fontStyle
255
+ );
256
+
257
+ if (!fontFacesLookup[fontKey]) {
258
+ let fontFace = {
259
+ fontFamily: fontDef.sources.family,
260
+ fontWeight: fontDef.sources.fontWeight,
261
+ fontStyle: fontDef.sources.fontStyle
262
+ };
263
+
264
+ fontDefs[family].fontFaces.push(fontFace);
265
+ }
266
+ }
267
+ if (fontDef.css || fontDef.fontFaces) {
268
+ webFontDefs.push(fontDef);
269
+ }
270
+ var fontClass = this.__getFontClass(fontDef);
271
+ var font = new fontClass();
272
+
273
+ // Inject information about custom charcter set tests before we apply the
274
+ // complete blob in one.
275
+ if (fontDef.comparisonString) {
276
+ font.setComparisonString(fontDef.comparisonString);
277
+ }
213
278
 
214
- for (var key in source) {
215
- if (source[key].include && source[source[key].include]) {
216
- this.__resolveInclude(source, key);
279
+ createdFonts[fontId] = font;
280
+ qx.Class.getProperties(qx.bom.Font).forEach(propertyName => {
281
+ let value = fontDef[propertyName];
282
+ if (value !== undefined) {
283
+ font["set" + qx.lang.String.firstUp(propertyName)](value);
217
284
  }
285
+ });
286
+ createdFonts[fontId].themed = true;
287
+ }
218
288
 
219
- var font = this.__getFontClass(source[key]);
220
- var fo = new font();
289
+ // Load all of the web fonts
290
+ for (let webFontDef of webFontDefs) {
291
+ let loader = qx.bom.webfonts.WebFontLoader.getLoader(
292
+ webFontDef.family[0],
293
+ true
294
+ );
221
295
 
222
- // Inject information about custom charcter set tests before we apply the
223
- // complete blob in one.
224
- if (source[key].comparisonString) {
225
- fo.setComparisonString(source[key].comparisonString);
296
+ ["css", "fontFaces", "comparisonString", "version"].forEach(
297
+ propertyName => {
298
+ if (webFontDef[propertyName]) {
299
+ loader["set" + qx.lang.String.firstUp(propertyName)](
300
+ webFontDef[propertyName]
301
+ );
302
+ }
226
303
  }
304
+ );
227
305
 
228
- dest[key] = fo.set(source[key]);
229
- dest[key].themed = true;
306
+ loader.load();
307
+ }
308
+
309
+ // Initialise the fonts, including those that refer to the loaded web fonts
310
+ for (let fontId in createdFonts) {
311
+ let font = createdFonts[fontId];
312
+ font.loadComplete();
313
+ }
314
+
315
+ return createdFonts;
316
+ },
317
+
318
+ // apply method
319
+ _applyTheme(value) {
320
+ let createdFonts = (this._dynamic = {});
321
+
322
+ for (let key in createdFonts) {
323
+ if (createdFonts[key].themed) {
324
+ createdFonts[key].dispose();
325
+ delete createdFonts[key];
230
326
  }
231
327
  }
232
- this._setDynamic(dest);
328
+
329
+ if (value) {
330
+ var fonts = this._manifestFonts
331
+ ? Object.assign(value.fonts, this._manifestFonts)
332
+ : value.fonts;
333
+ createdFonts = this.__initialiseFonts(fonts);
334
+ }
335
+
336
+ this._setDynamic(createdFonts);
233
337
  },
234
338
 
235
339
  /**
@@ -239,10 +343,19 @@ qx.Class.define("qx.theme.manager.Font", {
239
343
  * @return {Class}
240
344
  */
241
345
  __getFontClass(config) {
242
- if (config.sources) {
346
+ if (config.fontFaces || config.css) {
243
347
  return qx.bom.webfonts.WebFont;
244
348
  }
245
349
  return qx.bom.Font;
350
+ },
351
+
352
+ /**
353
+ * Returns the font information output by the compiler
354
+ * @internal subject to change
355
+ * @return {Object}
356
+ */
357
+ getManifestFonts() {
358
+ return this._manifestFonts;
246
359
  }
247
360
  },
248
361
 
@@ -19,6 +19,7 @@
19
19
 
20
20
  /**
21
21
  * The modern font theme.
22
+ *
22
23
  */
23
24
  qx.Theme.define("qx.theme.modern.Font", {
24
25
  fonts: {
@@ -18,6 +18,8 @@
18
18
 
19
19
  /**
20
20
  * The simple qooxdoo font theme.
21
+ *
22
+ * @usefont(qx.theme.monospace)
21
23
  */
22
24
  qx.Theme.define("qx.theme.simple.Font", {
23
25
  fonts: {
@@ -44,7 +46,7 @@ qx.Theme.define("qx.theme.simple.Font", {
44
46
 
45
47
  monospace: {
46
48
  size: 11,
47
- family: ["DejaVu Sans Mono", "Courier New", "monospace"]
49
+ fontName: "qx.theme.monospace"
48
50
  }
49
51
  }
50
52
  });
@@ -34,6 +34,7 @@
34
34
  * @asset(qx/icon/Tango/16/actions/window-close.png)
35
35
  * @asset(qx/icon/Tango/16/actions/dialog-cancel.png)
36
36
  * @asset(qx/icon/Tango/16/actions/dialog-ok.png)
37
+ * @usefont(MaterialIcons)
37
38
  */
38
39
  qx.Theme.define("qx.theme.tangible.Appearance", {
39
40
  appearances: {
@@ -17,15 +17,12 @@
17
17
  This theme is based in large parts on the osparc.theme
18
18
 
19
19
  ************************************************************************ */
20
- /**
21
- * @asset(qx/font/Roboto/*.woff)
22
- * @asset(qx/font/Roboto/*.woff2)
23
- * @asset(qx/font/Roboto/*.eot)
24
- * @asset(qx/font/Roboto/*.ttf)
25
- * @asset(qx/iconfont/MaterialIcons/*)
26
- */
20
+
27
21
  /**
28
22
  * The simple qooxdoo font theme.
23
+ *
24
+ * @usefont(Roboto)
25
+ * @usefont(Roboto Mono)
29
26
  */
30
27
  qx.Theme.define("qx.theme.tangible.Font", {
31
28
  fonts: {
@@ -33,17 +30,7 @@ qx.Theme.define("qx.theme.tangible.Font", {
33
30
  size: 14,
34
31
  family: ["sans-serif"],
35
32
  color: "text-primary-on-surface",
36
- sources: [
37
- {
38
- family: "Roboto",
39
- source: [
40
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.eot",
41
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.woff2",
42
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.woff",
43
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.ttf"
44
- ]
45
- }
46
- ]
33
+ fontName: "Roboto"
47
34
  },
48
35
 
49
36
  bold: {
@@ -51,68 +38,28 @@ qx.Theme.define("qx.theme.tangible.Font", {
51
38
  family: ["sans-serif"],
52
39
  bold: true,
53
40
  color: "text-primary-on-surface",
54
- sources: [
55
- {
56
- family: "Roboto",
57
- source: [
58
- "qx/font/Roboto/roboto-v18-latin_latin-ext-700.eot",
59
- "qx/font/Roboto/roboto-v18-latin_latin-ext-700.woff2",
60
- "qx/font/Roboto/roboto-v18-latin_latin-ext-700.woff",
61
- "qx/font/Roboto/roboto-v18-latin_latin-ext-700.ttf"
62
- ]
63
- }
64
- ]
41
+ fontName: "Roboto"
65
42
  },
66
43
 
67
44
  headline: {
68
45
  size: 24,
69
46
  family: ["sans-serif"],
70
47
  color: "text-primary-on-surface",
71
- sources: [
72
- {
73
- family: "Roboto",
74
- source: [
75
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.eot",
76
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.woff2",
77
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.woff",
78
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.ttf"
79
- ]
80
- }
81
- ]
48
+ fontName: "Roboto"
82
49
  },
83
50
 
84
51
  small: {
85
52
  size: 12,
86
53
  family: ["sans-serif"],
87
54
  color: "text-primary-on-surface",
88
- sources: [
89
- {
90
- family: "Roboto",
91
- source: [
92
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.eot",
93
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.woff2",
94
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.woff",
95
- "qx/font/Roboto/roboto-v18-latin_latin-ext-regular.ttf"
96
- ]
97
- }
98
- ]
55
+ fontName: "Roboto"
99
56
  },
100
57
 
101
58
  monospace: {
102
59
  size: 14,
103
60
  family: ["monospace"],
104
61
  color: "text-primary-on-surface",
105
- sources: [
106
- {
107
- family: "Roboto Mono",
108
- source: [
109
- "qx/font/Roboto/roboto-mono-v6-latin_latin-ext-regular.eot",
110
- "qx/font/Roboto/roboto-mono-v6-latin_latin-ext-regular.woff2",
111
- "qx/font/Roboto/roboto-mono-v6-latin_latin-ext-regular.woff",
112
- "qx/font/Roboto/roboto-mono-v6-latin_latin-ext-regular.ttf"
113
- ]
114
- }
115
- ]
62
+ fontName: "Roboto Mono"
116
63
  }
117
64
  }
118
65
  });
@@ -24,11 +24,8 @@
24
24
  /**
25
25
  * Mapping class for all images used in the tangible theme.
26
26
  *
27
- * @asset(qx/iconfont/MaterialIcons/materialicons-v50.ttf)
28
- * @asset(qx/iconfont/MaterialIcons/materialicons-v50.woff2)
29
- * @asset(qx/iconfont/MaterialIcons/materialicons-v50.woff)
30
- * @asset(qx/iconfont/MaterialIcons/materialicons-v50.eot)
31
27
  * @asset(qx/static/blank.png)
28
+ * @usefont(MaterialIcons)
32
29
  */
33
30
 
34
31
  qx.Class.define("qx.theme.tangible.Image", {
@@ -36,6 +36,7 @@ qx.Class.define("qx.tool.cli.Cli", {
36
36
  if (qx.tool.cli.Cli.__instance) {
37
37
  throw new Error("qx.tool.cli.Cli has already been initialized!");
38
38
  }
39
+ this.__compileJsExists = false;
39
40
  qx.tool.cli.Cli.__instance = this;
40
41
  // include & register log appender
41
42
  qx.log.appender.NodeConsole;
@@ -189,6 +190,7 @@ Version: v${await qx.tool.config.Utils.getQxVersion()}
189
190
  "Config",
190
191
  "Deploy",
191
192
  "Es6ify",
193
+ "ExportGlyphs",
192
194
  "Package",
193
195
  "Pkg", // alias for Package
194
196
  "Create",
@@ -326,6 +328,7 @@ Version: v${await qx.tool.config.Utils.getQxVersion()}
326
328
 
327
329
  let CompilerApi = qx.tool.cli.api.CompilerApi;
328
330
  if (await fs.existsAsync(compileJsFilename)) {
331
+ this.__compileJsExists = true;
329
332
  let compileJs = await this.__loadJs(compileJsFilename);
330
333
  this._compileJsFilename = compileJsFilename;
331
334
  if (compileJs.CompilerApi) {
@@ -608,6 +611,15 @@ Version: v${await qx.tool.config.Utils.getQxVersion()}
608
611
  }
609
612
  },
610
613
 
614
+ /**
615
+ * Returns if the file compile.js exists
616
+ *
617
+ * @returns {Boolean}
618
+ */
619
+ compileJsExists(){
620
+ return this.__compileJsExists;
621
+ },
622
+
611
623
  /**
612
624
  * Returns the CompilerApi instance
613
625
  *
@@ -21,6 +21,9 @@ const fs = require("fs");
21
21
  const path = require("upath");
22
22
  const chokidar = require("chokidar");
23
23
 
24
+ /**
25
+ * @ignore(setImmediate)
26
+ */
24
27
  qx.Class.define("qx.tool.cli.Watch", {
25
28
  extend: qx.core.Object,
26
29
 
@@ -33,6 +33,7 @@ qx.Class.define("qx.tool.cli.api.CompilerApi", {
33
33
  construct() {
34
34
  super();
35
35
  this.__libraryApis = {};
36
+ this.__compileJsonExists = true;
36
37
  this.addListener("changeCommand", () => {
37
38
  this.afterCommandLoaded(this.getCommand());
38
39
  });
@@ -101,11 +102,18 @@ qx.Class.define("qx.tool.cli.api.CompilerApi", {
101
102
  let config = {};
102
103
  if (await fs.existsAsync(compileJsonPath)) {
103
104
  config = await qx.tool.utils.Json.loadJsonAsync(compileJsonPath);
105
+ } else {
106
+ this.__compileJsonExists = false;
107
+
104
108
  }
105
109
  this.setConfiguration(config);
106
110
  return super.load();
107
111
  },
108
112
 
113
+ compileJsonExists(){
114
+ return this.__compileJsonExists;
115
+ },
116
+
109
117
  /**
110
118
  * runs after the whole process is finished
111
119
  * @param cmd {qx.tool.cli.commands.Command} current command
@@ -35,7 +35,7 @@ qx.Class.define("qx.tool.cli.commands.Add", {
35
35
 
36
36
  return yargs.demandCommand().showHelpOnFail().help();
37
37
  },
38
- handler(argv) {}
38
+ handler() {}
39
39
  };
40
40
  }
41
41
  },
@@ -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) {
@@ -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) {