@qooxdoo/framework 7.0.0 → 7.2.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 (160) hide show
  1. package/CHANGELOG.md +10 -2
  2. package/Manifest.json +22 -22
  3. package/README.md +2 -4
  4. package/lib/compiler/compile-info.json +60 -58
  5. package/lib/compiler/index.js +1973 -1625
  6. package/lib/resource/qx/tool/cli/templates/loader/loader-browser.tmpl.js +1 -2
  7. package/lib/resource/qx/tool/schema/compile-1-0-0.json +11 -1
  8. package/npm-shrinkwrap.json +1738 -788
  9. package/package.json +10 -8
  10. package/source/class/qx/Interface.js +13 -15
  11. package/source/class/qx/dev/unit/MTestLoader.js +25 -33
  12. package/source/class/qx/dev/unit/TestResult.js +9 -13
  13. package/source/class/qx/event/handler/Focus.js +1 -1
  14. package/source/class/qx/html/Element.js +1 -1
  15. package/source/class/qx/html/Node.js +0 -1
  16. package/source/class/qx/io/request/AbstractRequest.js +42 -66
  17. package/source/class/qx/test/Interface.js +70 -6
  18. package/source/class/qx/test/Mixin.js +20 -17
  19. package/source/class/qx/test/Promise.js +67 -91
  20. package/source/class/qx/test/bom/History.js +11 -19
  21. package/source/class/qx/test/bom/WebWorker.js +7 -15
  22. package/source/class/qx/test/bom/media/MediaTestCase.js +10 -18
  23. package/source/class/qx/test/bom/media/Video.js +10 -18
  24. package/source/class/qx/test/bom/rest/Resource.js +3 -7
  25. package/source/class/qx/test/bom/rest/ResourceWithRemote.js +40 -56
  26. package/source/class/qx/test/bom/webfonts/Validator.js +12 -20
  27. package/source/class/qx/test/core/Object.js +3 -7
  28. package/source/class/qx/test/data/controller/List.js +18 -22
  29. package/source/class/qx/test/data/marshal/Json.js +10 -14
  30. package/source/class/qx/test/data/store/Json.js +337 -428
  31. package/source/class/qx/test/data/store/Jsonp.js +46 -66
  32. package/source/class/qx/test/data/store/RestWithRemote.js +10 -18
  33. package/source/class/qx/test/html/Element.js +4 -8
  34. package/source/class/qx/test/html/Iframe.js +48 -60
  35. package/source/class/qx/test/io/jsonrpc/Client.js +1 -1
  36. package/source/class/qx/test/io/request/JsonpWithRemote.js +6 -10
  37. package/source/class/qx/test/io/request/MRequest.js +13 -25
  38. package/source/class/qx/test/io/request/Xhr.js +5 -9
  39. package/source/class/qx/test/io/request/XhrWithRemote.js +50 -78
  40. package/source/class/qx/test/io/rest/Resource.js +3 -7
  41. package/source/class/qx/test/io/rest/ResourceWithRemote.js +41 -57
  42. package/source/class/qx/test/mobile/basic/Image.js +16 -24
  43. package/source/class/qx/test/mobile/container/Navigation.js +3 -7
  44. package/source/class/qx/test/mobile/container/Scroll.js +8 -12
  45. package/source/class/qx/test/mobile/page/Page.js +24 -44
  46. package/source/class/qx/test/performance/Property.js +2 -2
  47. package/source/class/qx/test/ui/basic/Image.js +32 -52
  48. package/source/class/qx/test/ui/core/Blocker.js +6 -14
  49. package/source/class/qx/test/ui/embed/Iframe.js +13 -21
  50. package/source/class/qx/test/ui/form/FileSelectorButton.js +32 -0
  51. package/source/class/qx/test/ui/form/FormValidator.js +147 -211
  52. package/source/class/qx/test/ui/form/Label.js +8 -16
  53. package/source/class/qx/test/ui/root/Inline.js +9 -13
  54. package/source/class/qx/test/ui/table/Table.js +6 -14
  55. package/source/class/qx/test/ui/toolbar/OverflowHandling.js +18 -30
  56. package/source/class/qx/test/ui/virtual/Pane.js +3 -7
  57. package/source/class/qx/test/util/DynamicScriptLoader.js +23 -42
  58. package/source/class/qx/theme/iconfont/LoadMaterialIcons.js +4 -4
  59. package/source/class/qx/theme/iconfont/LoadMaterialIconsOutlined.js +4 -4
  60. package/source/class/qx/theme/iconfont/LoadMaterialIconsRound.js +4 -4
  61. package/source/class/qx/theme/iconfont/LoadMaterialIconsSharp.js +4 -4
  62. package/source/class/qx/theme/iconfont/LoadMaterialIconsTwoTone.js +4 -4
  63. package/source/class/qx/theme/tangible/Appearance.js +22 -3
  64. package/source/class/qx/theme/tangible/ColorEngine.js +3 -3
  65. package/source/class/qx/theme/tangible/Decoration.js +3 -3
  66. package/source/class/qx/tool/cli/Watch.js +3 -7
  67. package/source/class/qx/tool/cli/api/AbstractApi.js +4 -1
  68. package/source/class/qx/tool/cli/api/CompilerApi.js +3 -7
  69. package/source/class/qx/tool/cli/commands/Compile.js +10 -1
  70. package/source/class/qx/tool/cli/commands/Lint.js +35 -21
  71. package/source/class/qx/tool/compiler/ClassFile.js +82 -2
  72. package/source/class/qx/tool/compiler/Es6ify.js +12 -5
  73. package/source/class/qx/tool/compiler/TargetError.js +26 -0
  74. package/source/class/qx/tool/compiler/app/Application.js +14 -0
  75. package/source/class/qx/tool/compiler/app/WebFont.js +8 -6
  76. package/source/class/qx/tool/compiler/targets/SourceCodeCopier.js +1 -1
  77. package/source/class/qx/tool/compiler/targets/Target.js +8 -0
  78. package/source/class/qx/tool/compiler/targets/meta/AbstractJavascriptMeta.js +2 -2
  79. package/source/class/qx/tool/compiler/targets/meta/Browserify.js +179 -0
  80. package/source/class/qx/tool/compiler/targets/meta/Uglify.js +11 -3
  81. package/source/class/qx/tool/utils/Json.js +1 -1
  82. package/source/class/qx/tool/utils/Website.js +2 -2
  83. package/source/class/qx/ui/basic/Label.js +13 -17
  84. package/source/class/qx/ui/core/MPlacement.js +13 -21
  85. package/source/class/qx/ui/core/Widget.js +2 -3
  86. package/source/class/qx/ui/core/scroll/NativeScrollBar.js +3 -7
  87. package/source/class/qx/ui/core/scroll/ScrollBar.js +3 -7
  88. package/source/class/qx/ui/embed/Iframe.js +40 -50
  89. package/source/class/qx/ui/form/AbstractField.js +8 -12
  90. package/source/class/qx/ui/form/AbstractSelectBox.js +4 -1
  91. package/source/class/qx/ui/form/ComboBox.js +7 -15
  92. package/source/class/qx/ui/form/DateField.js +13 -19
  93. package/source/class/qx/ui/form/FileSelectorButton.js +157 -0
  94. package/source/class/qx/ui/form/Spinner.js +7 -15
  95. package/source/class/qx/ui/form/TextArea.js +3 -7
  96. package/source/class/qx/ui/form/VirtualComboBox.js +8 -16
  97. package/source/class/qx/ui/form/VirtualSelectBox.js +21 -37
  98. package/source/class/qx/ui/layout/Canvas.js +2 -2
  99. package/source/class/qx/ui/mobile/container/MIScroll.js +3 -7
  100. package/source/class/qx/ui/progressive/headfoot/Progress.js +22 -34
  101. package/source/class/qx/ui/progressive/renderer/table/Row.js +2 -1
  102. package/source/class/qx/ui/progressive/renderer/table/cell/Boolean.js +24 -26
  103. package/source/class/qx/ui/progressive/renderer/table/cell/Icon.js +9 -7
  104. package/source/class/qx/ui/progressive/renderer/table/cell/Image.js +16 -13
  105. package/source/class/qx/ui/splitpane/Pane.js +14 -22
  106. package/source/class/qx/ui/table/MTableContextMenu.js +63 -71
  107. package/source/class/qx/ui/table/Table.js +3 -8
  108. package/source/class/qx/ui/table/model/Abstract.js +34 -1
  109. package/source/class/qx/ui/table/model/Remote.js +1 -0
  110. package/source/class/qx/ui/table/model/Simple.js +3 -0
  111. package/source/class/qx/ui/table/pane/Scroller.js +8 -12
  112. package/source/class/qx/ui/toolbar/FileSelectorButton.js +57 -0
  113. package/source/class/qx/ui/toolbar/Part.js +3 -7
  114. package/source/class/qx/ui/tree/VirtualTree.js +5 -9
  115. package/source/class/qx/ui/treevirtual/MNode.js +62 -5
  116. package/source/class/qx/ui/treevirtual/SimpleTreeDataModel.js +11 -3
  117. package/source/class/qx/ui/treevirtual/TreeVirtual.js +3 -7
  118. package/source/class/qx/ui/virtual/core/Pane.js +30 -42
  119. package/source/class/qx/util/DynamicScriptLoader.js +31 -43
  120. package/source/resource/qx/iconfont/MaterialIcons/materialicons-v126.eot +0 -0
  121. package/source/resource/qx/iconfont/MaterialIcons/{materialicons-v70.ttf → materialicons-v126.ttf} +0 -0
  122. package/source/resource/qx/iconfont/MaterialIcons/materialicons-v126.woff +0 -0
  123. package/source/resource/qx/iconfont/MaterialIcons/materialicons-v126.woff2 +0 -0
  124. package/source/resource/qx/iconfont/MaterialIcons/materialiconsoutlined-v101.eot +0 -0
  125. package/source/resource/qx/iconfont/MaterialIcons/materialiconsoutlined-v101.otf +0 -0
  126. package/source/resource/qx/iconfont/MaterialIcons/materialiconsoutlined-v101.woff +0 -0
  127. package/source/resource/qx/iconfont/MaterialIcons/materialiconsoutlined-v101.woff2 +0 -0
  128. package/source/resource/qx/iconfont/MaterialIcons/materialiconsround-v100.eot +0 -0
  129. package/source/resource/qx/iconfont/MaterialIcons/materialiconsround-v100.otf +0 -0
  130. package/source/resource/qx/iconfont/MaterialIcons/materialiconsround-v100.woff +0 -0
  131. package/source/resource/qx/iconfont/MaterialIcons/materialiconsround-v100.woff2 +0 -0
  132. package/source/resource/qx/iconfont/MaterialIcons/materialiconssharp-v101.eot +0 -0
  133. package/source/resource/qx/iconfont/MaterialIcons/materialiconssharp-v101.otf +0 -0
  134. package/source/resource/qx/iconfont/MaterialIcons/materialiconssharp-v101.woff +0 -0
  135. package/source/resource/qx/iconfont/MaterialIcons/materialiconssharp-v101.woff2 +0 -0
  136. package/source/resource/qx/iconfont/MaterialIcons/materialiconstwotone-v104.eot +0 -0
  137. package/source/resource/qx/iconfont/MaterialIcons/materialiconstwotone-v104.otf +0 -0
  138. package/source/resource/qx/iconfont/MaterialIcons/materialiconstwotone-v104.woff +0 -0
  139. package/source/resource/qx/iconfont/MaterialIcons/materialiconstwotone-v104.woff2 +0 -0
  140. package/source/resource/qx/tool/cli/templates/loader/loader-browser.tmpl.js +1 -2
  141. package/source/resource/qx/tool/schema/compile-1-0-0.json +11 -1
  142. package/source/resource/qx/iconfont/MaterialIcons/materialicons-v70.eot +0 -0
  143. package/source/resource/qx/iconfont/MaterialIcons/materialicons-v70.woff +0 -0
  144. package/source/resource/qx/iconfont/MaterialIcons/materialicons-v70.woff2 +0 -0
  145. package/source/resource/qx/iconfont/MaterialIcons/materialiconsoutlined-v38.eot +0 -0
  146. package/source/resource/qx/iconfont/MaterialIcons/materialiconsoutlined-v38.otf +0 -0
  147. package/source/resource/qx/iconfont/MaterialIcons/materialiconsoutlined-v38.woff +0 -0
  148. package/source/resource/qx/iconfont/MaterialIcons/materialiconsoutlined-v38.woff2 +0 -0
  149. package/source/resource/qx/iconfont/MaterialIcons/materialiconsround-v37.eot +0 -0
  150. package/source/resource/qx/iconfont/MaterialIcons/materialiconsround-v37.otf +0 -0
  151. package/source/resource/qx/iconfont/MaterialIcons/materialiconsround-v37.woff +0 -0
  152. package/source/resource/qx/iconfont/MaterialIcons/materialiconsround-v37.woff2 +0 -0
  153. package/source/resource/qx/iconfont/MaterialIcons/materialiconssharp-v38.eot +0 -0
  154. package/source/resource/qx/iconfont/MaterialIcons/materialiconssharp-v38.otf +0 -0
  155. package/source/resource/qx/iconfont/MaterialIcons/materialiconssharp-v38.woff +0 -0
  156. package/source/resource/qx/iconfont/MaterialIcons/materialiconssharp-v38.woff2 +0 -0
  157. package/source/resource/qx/iconfont/MaterialIcons/materialiconstwotone-v36.eot +0 -0
  158. package/source/resource/qx/iconfont/MaterialIcons/materialiconstwotone-v36.otf +0 -0
  159. package/source/resource/qx/iconfont/MaterialIcons/materialiconstwotone-v36.woff +0 -0
  160. package/source/resource/qx/iconfont/MaterialIcons/materialiconstwotone-v36.woff2 +0 -0
@@ -58,29 +58,21 @@ qx.Class.define("qx.test.util.DynamicScriptLoader", {
58
58
 
59
59
  var l1Ready = false;
60
60
  var l2Ready = false;
61
- l1.addListenerOnce(
62
- "ready",
63
- function () {
64
- l1Ready = true;
65
- this.resume(function () {
66
- this.assertTrue(l1Ready && l2Ready);
67
- this.assertEquals(
68
- qx.test.DYNAMICSCRIPTTEST.second.third,
69
- "dynamically loaded"
70
- );
71
- }, this);
72
- },
73
- this
74
- );
61
+ l1.addListenerOnce("ready", () => {
62
+ l1Ready = true;
63
+ this.resume(function () {
64
+ this.assertTrue(l1Ready && l2Ready);
65
+ this.assertEquals(
66
+ qx.test.DYNAMICSCRIPTTEST.second.third,
67
+ "dynamically loaded"
68
+ );
69
+ }, this);
70
+ });
75
71
 
76
- l2.addListenerOnce(
77
- "ready",
78
- function () {
79
- l2Ready = true;
80
- this.assertTrue(!l1Ready && l2Ready);
81
- },
82
- this
83
- );
72
+ l2.addListenerOnce("ready", () => {
73
+ l2Ready = true;
74
+ this.assertTrue(!l1Ready && l2Ready);
75
+ });
84
76
 
85
77
  l1.start();
86
78
  l2.start();
@@ -100,13 +92,9 @@ qx.Class.define("qx.test.util.DynamicScriptLoader", {
100
92
  noEvent = false;
101
93
  }
102
94
  });
103
- loader.addListenerOnce(
104
- "ready",
105
- function () {
106
- this.assertTrue(noEvent);
107
- },
108
- this
109
- );
95
+ loader.addListenerOnce("ready", () => {
96
+ this.assertTrue(noEvent);
97
+ });
110
98
 
111
99
  loader.start();
112
100
  },
@@ -115,19 +103,12 @@ qx.Class.define("qx.test.util.DynamicScriptLoader", {
115
103
  "qx/test/dynamicscriptloader/xyc.js"
116
104
  ]);
117
105
 
118
- loader.addListenerOnce(
119
- "failed",
120
- function (e) {
121
- var data = e.getData();
122
- this.resume(function () {
123
- this.assertEquals(
124
- data.script,
125
- "qx/test/dynamicscriptloader/xyc.js"
126
- );
127
- }, this);
128
- },
129
- this
130
- );
106
+ loader.addListenerOnce("failed", e => {
107
+ var data = e.getData();
108
+ this.resume(function () {
109
+ this.assertEquals(data.script, "qx/test/dynamicscriptloader/xyc.js");
110
+ }, this);
111
+ });
131
112
 
132
113
  loader.start();
133
114
  this.wait();
@@ -20,9 +20,9 @@
20
20
  * A dummy class to trigger the compiler to copy the MaterialIcons font files
21
21
  */
22
22
  /**
23
- * @asset(qx/iconfont/MaterialIcons/materialicons-v70.ttf)
24
- * @asset(qx/iconfont/MaterialIcons/materialicons-v70.woff2)
25
- * @asset(qx/iconfont/MaterialIcons/materialicons-v70.woff)
26
- * @asset(qx/iconfont/MaterialIcons/materialicons-v70.eot)
23
+ * @asset(qx/iconfont/MaterialIcons/materialicons-v126.ttf)
24
+ * @asset(qx/iconfont/MaterialIcons/materialicons-v126.woff2)
25
+ * @asset(qx/iconfont/MaterialIcons/materialicons-v126.woff)
26
+ * @asset(qx/iconfont/MaterialIcons/materialicons-v126.eot)
27
27
  */
28
28
  qx.Class.define("qx.theme.iconfont.LoadMaterialIcons", {});
@@ -20,9 +20,9 @@
20
20
  * A dummy class to trigger the compiler to copy the MaterialIconsOutlined font files
21
21
  */
22
22
  /**
23
- * @asset(qx/iconfont/MaterialIcons/materialiconsoutlined-v38.otf)
24
- * @asset(qx/iconfont/MaterialIcons/materialiconsoutlined-v38.woff2)
25
- * @asset(qx/iconfont/MaterialIcons/materialiconsoutlined-v38.woff)
26
- * @asset(qx/iconfont/MaterialIcons/materialiconsoutlined-v38.eot)
23
+ * @asset(qx/iconfont/MaterialIcons/materialiconsoutlined-v101.otf)
24
+ * @asset(qx/iconfont/MaterialIcons/materialiconsoutlined-v101.woff2)
25
+ * @asset(qx/iconfont/MaterialIcons/materialiconsoutlined-v101.woff)
26
+ * @asset(qx/iconfont/MaterialIcons/materialiconsoutlined-v101.eot)
27
27
  */
28
28
  qx.Class.define("qx.theme.iconfont.LoadMaterialIconsOutlined", {});
@@ -20,9 +20,9 @@
20
20
  * A dummy class to trigger the compiler to copy the MaterialIconsRound font files
21
21
  */
22
22
  /**
23
- * @asset(qx/iconfont/MaterialIcons/materialiconsround-v37.otf)
24
- * @asset(qx/iconfont/MaterialIcons/materialiconsround-v37.woff2)
25
- * @asset(qx/iconfont/MaterialIcons/materialiconsround-v37.woff)
26
- * @asset(qx/iconfont/MaterialIcons/materialiconsround-v37.eot)
23
+ * @asset(qx/iconfont/MaterialIcons/materialiconsround-v100.otf)
24
+ * @asset(qx/iconfont/MaterialIcons/materialiconsround-v100.woff2)
25
+ * @asset(qx/iconfont/MaterialIcons/materialiconsround-v100.woff)
26
+ * @asset(qx/iconfont/MaterialIcons/materialiconsround-v100.eot)
27
27
  */
28
28
  qx.Class.define("qx.theme.iconfont.LoadMaterialIconsRound", {});
@@ -20,9 +20,9 @@
20
20
  * A dummy class to trigger the compiler to copy the MaterialIconsSharpe font files
21
21
  */
22
22
  /**
23
- * @asset(qx/iconfont/MaterialIcons/materialiconssharp-v38.otf)
24
- * @asset(qx/iconfont/MaterialIcons/materialiconssharp-v38.woff2)
25
- * @asset(qx/iconfont/MaterialIcons/materialiconssharp-v38.woff)
26
- * @asset(qx/iconfont/MaterialIcons/materialiconssharp-v38.eot)
23
+ * @asset(qx/iconfont/MaterialIcons/materialiconssharp-v101.otf)
24
+ * @asset(qx/iconfont/MaterialIcons/materialiconssharp-v101.woff2)
25
+ * @asset(qx/iconfont/MaterialIcons/materialiconssharp-v101.woff)
26
+ * @asset(qx/iconfont/MaterialIcons/materialiconssharp-v101.eot)
27
27
  */
28
28
  qx.Class.define("qx.theme.iconfont.LoadMaterialIconsSharp", {});
@@ -20,9 +20,9 @@
20
20
  * A dummy class to trigger the compiler to copy the MaterialIconsTwoTone font files
21
21
  */
22
22
  /**
23
- * @asset(qx/iconfont/MaterialIcons/materialiconstwotone-v36.otf)
24
- * @asset(qx/iconfont/MaterialIcons/materialiconstwotone-v36.woff2)
25
- * @asset(qx/iconfont/MaterialIcons/materialiconstwotone-v36.woff)
26
- * @asset(qx/iconfont/MaterialIcons/materialiconstwotone-v36.eot)
23
+ * @asset(qx/iconfont/MaterialIcons/materialiconstwotone-v104.otf)
24
+ * @asset(qx/iconfont/MaterialIcons/materialiconstwotone-v104.woff2)
25
+ * @asset(qx/iconfont/MaterialIcons/materialiconstwotone-v104.woff)
26
+ * @asset(qx/iconfont/MaterialIcons/materialiconstwotone-v104.eot)
27
27
  */
28
28
  qx.Class.define("qx.theme.iconfont.LoadMaterialIconsTwoTone", {});
@@ -634,7 +634,8 @@ qx.Theme.define("qx.theme.tangible.Appearance", {
634
634
  style(states) {
635
635
  return {
636
636
  decorator: undefined,
637
- padding: [2, 2]
637
+ padding: [2, 2],
638
+ backgroundColor: "surface"
638
639
  };
639
640
  }
640
641
  },
@@ -644,7 +645,10 @@ qx.Theme.define("qx.theme.tangible.Appearance", {
644
645
  alias: "selectbox",
645
646
 
646
647
  style(states) {
647
- return { padding: [0, 2] };
648
+ return {
649
+ padding: [0, 2],
650
+ backgroundColor: "surface"
651
+ };
648
652
  }
649
653
  },
650
654
 
@@ -653,7 +657,10 @@ qx.Theme.define("qx.theme.tangible.Appearance", {
653
657
  alias: "combobox",
654
658
 
655
659
  style(states) {
656
- return { decorator: undefined };
660
+ return {
661
+ decorator: undefined,
662
+ backgroundColor: "surface"
663
+ };
657
664
  }
658
665
  },
659
666
 
@@ -999,6 +1006,18 @@ qx.Theme.define("qx.theme.tangible.Appearance", {
999
1006
  };
1000
1007
  }
1001
1008
  },
1009
+ "menubar-button/icon": {
1010
+ style(states) {
1011
+ return {
1012
+ textColor: states.disabled
1013
+ ? "text-disabled-on-surface"
1014
+ : ( states.pressed || states.hovered )
1015
+ ? "text-on-primary"
1016
+ : "text-on-surface"
1017
+ }
1018
+ }
1019
+ },
1020
+
1002
1021
 
1003
1022
  /*
1004
1023
  ---------------------------------------------------------------------------
@@ -87,7 +87,7 @@ var helper = {
87
87
  var color = d[0];
88
88
  var state = d[1];
89
89
  switch (state) {
90
- case "focussed":
90
+ case "focused":
91
91
  return qx.util.ColorUtil.scale(color, {
92
92
  lightness: 10,
93
93
  saturation: 10
@@ -159,10 +159,10 @@ qx.Theme.define("qx.theme.tangible.ColorEngine", {
159
159
  "text-on-error": helper.onX,
160
160
  "primary-hovered": helper.xState,
161
161
  "primary-disabled": helper.xState,
162
- "primary-focussed": helper.xState,
162
+ "primary-focused": helper.xState,
163
163
  "primary-selected": helper.xState,
164
164
  "primary-selected_disabled": helper.xState,
165
- "error-focussed": helper.xState,
165
+ "error-focused": helper.xState,
166
166
 
167
167
  // alpha colors
168
168
  "primary-alpha-5": helper.setAlpha,
@@ -40,7 +40,7 @@ qx.Theme.define("qx.theme.tangible.Decoration", {
40
40
  include: "material-textfield",
41
41
  style: {
42
42
  widthBottom: 2,
43
- colorBottom: "primary-focussed"
43
+ colorBottom: "primary-focused"
44
44
  }
45
45
  },
46
46
 
@@ -56,7 +56,7 @@ qx.Theme.define("qx.theme.tangible.Decoration", {
56
56
  include: "material-textfield",
57
57
  style: {
58
58
  widthBottom: 2,
59
- colorBottom: "error-focussed"
59
+ colorBottom: "error-focused"
60
60
  }
61
61
  },
62
62
 
@@ -287,7 +287,7 @@ qx.Theme.define("qx.theme.tangible.Decoration", {
287
287
  "button-box-pressed": {
288
288
  include: "button-box",
289
289
 
290
- style: { backgroundColor: "primary-focussed" }
290
+ style: { backgroundColor: "primary-focused" }
291
291
  },
292
292
 
293
293
  "button-box-pressed-hovered": {
@@ -140,13 +140,9 @@ qx.Class.define("qx.tool.cli.Watch", {
140
140
 
141
141
  var dirs = [];
142
142
  var analyser = this.__maker.getAnalyser();
143
- analyser.addListener(
144
- "compiledClass",
145
- function () {
146
- this.__stats.classesCompiled++;
147
- },
148
- this
149
- );
143
+ analyser.addListener("compiledClass", () => {
144
+ this.__stats.classesCompiled++;
145
+ });
150
146
 
151
147
  dirs.push(qx.tool.config.Compile.config.fileName);
152
148
  dirs.push("compile.js");
@@ -86,7 +86,10 @@ qx.Class.define("qx.tool.cli.api.AbstractApi", {
86
86
  */
87
87
  loadNpmModule(module) {
88
88
  const { execSync } = require("child_process");
89
- let s = `npm install --no-save --no-package-lock ${module}`;
89
+ // since npm 7 --no-save deletes the node_modules folder
90
+ // see https://github.com/npm/cli/pull/3907
91
+ // let s = `npm install --no-save --no-package-lock ${module}`;
92
+ let s = `npm install --no-package-lock ${module}`;
90
93
  qx.tool.compiler.Console.info(s);
91
94
  execSync(s, {
92
95
  stdio: "inherit"
@@ -33,13 +33,9 @@ qx.Class.define("qx.tool.cli.api.CompilerApi", {
33
33
  construct() {
34
34
  super();
35
35
  this.__libraryApis = {};
36
- this.addListener(
37
- "changeCommand",
38
- function () {
39
- this.afterCommandLoaded(this.getCommand());
40
- },
41
- this
42
- );
36
+ this.addListener("changeCommand", () => {
37
+ this.afterCommandLoaded(this.getCommand());
38
+ });
43
39
  },
44
40
 
45
41
  properties: {
@@ -359,6 +359,9 @@ qx.Class.define("qx.tool.cli.commands.Compile", {
359
359
  this.argv["feedback"] = configDb.db("qx.default.feedback", true);
360
360
  }
361
361
 
362
+ // Validate compile.json against the schema
363
+ await qx.tool.config.Compile.getInstance().load();
364
+
362
365
  if (this.argv.verbose) {
363
366
  console.log(`
364
367
  Compiler: v${this.getCompilerVersion()} in ${require.main.filename}
@@ -915,6 +918,7 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
915
918
  */
916
919
  let targetOutputPaths = {};
917
920
  let makers = [];
921
+
918
922
  targetConfigs.forEach(targetConfig => {
919
923
  if (!targetConfig.appConfigs) {
920
924
  qx.tool.compiler.Console.print(
@@ -1203,7 +1207,8 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
1203
1207
  "loaderTemplate",
1204
1208
  "publish",
1205
1209
  "deploy",
1206
- "standalone"
1210
+ "standalone",
1211
+ "localModules"
1207
1212
  ].forEach(name => {
1208
1213
  if (appConfig[name] !== undefined) {
1209
1214
  var fname = "set" + qx.lang.String.firstUp(name);
@@ -1225,6 +1230,10 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
1225
1230
  app.setDescription(appConfig.description);
1226
1231
  }
1227
1232
 
1233
+ if (appConfig.localModules) {
1234
+ app.setLocalModules(appConfig.localModules);
1235
+ }
1236
+
1228
1237
  var parts = appConfig.parts || targetConfig.parts || data.parts;
1229
1238
  if (parts) {
1230
1239
  if (!parts.boot) {
@@ -95,7 +95,15 @@ qx.Class.define("qx.tool.cli.commands.Lint", {
95
95
 
96
96
  members: {
97
97
  async process() {
98
- await this.__applyFixes();
98
+ let files = this.argv.files || [];
99
+ if (files.length === 0) {
100
+ files.push("source/class/**/*.js");
101
+ }
102
+ for (let i = 0; i < files.length; i++) {
103
+ files[i] = path.join(process.cwd(), files[i]);
104
+ }
105
+
106
+ await this.__applyFixes(files);
99
107
 
100
108
  let helperFilePath = require.main.path;
101
109
  while (true) {
@@ -112,14 +120,14 @@ qx.Class.define("qx.tool.cli.commands.Lint", {
112
120
  lintOptions.globals || {},
113
121
  await this.__addGlobals(config)
114
122
  );
123
+
115
124
  lintOptions.parser = "@babel/eslint-parser";
116
125
  lintOptions.parserOptions = lintOptions.parserOptions || {};
117
126
  lintOptions.parserOptions.requireConfigFile = false;
118
127
  lintOptions.parserOptions.babelOptions = {
119
128
  cwd: helperFilePath,
120
- plugins: [
121
- "@babel/plugin-syntax-jsx"
122
- ],
129
+ plugins: ["@babel/plugin-syntax-jsx"],
130
+
123
131
  parserOpts: {
124
132
  allowSuperOutsideMethod: true
125
133
  }
@@ -134,13 +142,6 @@ qx.Class.define("qx.tool.cli.commands.Lint", {
134
142
  fix: this.argv.fix
135
143
  });
136
144
 
137
- let files = this.argv.files || [];
138
- if (files.length === 0) {
139
- files.push("source/class/**/*.js");
140
- }
141
- for (let i = 0; i < files.length; i++) {
142
- files[i] = path.join(process.cwd(), files[i]);
143
- }
144
145
  if (this.argv.printConfig) {
145
146
  const fileConfig = await linter.calculateConfigForFile(files[0]);
146
147
  qx.tool.compiler.Console.info(JSON.stringify(fileConfig, null, " "));
@@ -157,13 +158,27 @@ qx.Class.define("qx.tool.cli.commands.Lint", {
157
158
  }
158
159
  if (report.errorCount > 0 || report.warningCount > 0) {
159
160
  let outputFormat = this.argv.format || "codeframe";
160
-
161
- // If there are too many errors, the pretty formatter is appallingly slow
162
- if (report.errorCount + report.warningCount > 150) {
163
- outputFormat = "compact";
164
- }
165
161
  const formatter = await linter.loadFormatter(outputFormat);
166
162
  const s = formatter.format(report);
163
+ // If there are too many errors, the pretty formatter is appallingly slow so if the
164
+ // user has not specified a format, change to compact mode
165
+ const maxDefaultFormatErrorCount = 150;
166
+ if (
167
+ report.errorCount + report.warningCount >
168
+ maxDefaultFormatErrorCount
169
+ ) {
170
+ if (!this.argv.format) {
171
+ qx.tool.compiler.Console.info(
172
+ `Total errors and warnings exceed ${maxDefaultFormatErrorCount}, switching to "compact" style report`
173
+ );
174
+
175
+ outputFormat = "compact";
176
+ } else {
177
+ qx.tool.compiler.Console.info(
178
+ `Total errors and warnings exceed ${maxDefaultFormatErrorCount}, the report may take some time to generate.`
179
+ );
180
+ }
181
+ }
167
182
  if (this.argv.outputFile) {
168
183
  if (this.argv.verbose) {
169
184
  qx.tool.compiler.Console.info(
@@ -220,19 +235,18 @@ qx.Class.define("qx.tool.cli.commands.Lint", {
220
235
  * @return {Promise<void>}
221
236
  * @private
222
237
  */
223
- async __applyFixes() {
238
+ async __applyFixes(files) {
224
239
  const fixParams = this.argv.fixJsdocParams;
225
240
  if (fixParams && fixParams !== "off") {
226
- let replaceInFiles = [];
227
241
  const regex =
228
242
  fixParams === "type-first"
229
243
  ? /@param\s+([\w$]+)\s+({[\w|[\]{}<>?. ]+})/g
230
244
  : /@param\s+({[\w|[\]{}<>?. ]+})\s+([\w$]+)/g;
231
- replaceInFiles.push({
232
- files: "source/class/**/*.js",
245
+ let replaceInFiles = {
246
+ files: files,
233
247
  from: regex,
234
248
  to: "@param $2 $1"
235
- });
249
+ };
236
250
 
237
251
  await replaceInFile(replaceInFiles);
238
252
  }
@@ -223,6 +223,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
223
223
  };
224
224
 
225
225
  this.__externals = [];
226
+ this.__commonjsModules = {};
226
227
 
227
228
  this.__taskQueueDrains = [];
228
229
  this.__taskQueue = async.queue(function (task, cb) {
@@ -281,6 +282,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
281
282
  __privates: null,
282
283
  __blockedPrivates: null,
283
284
  __externals: null,
285
+ __commonjsModules: null,
284
286
 
285
287
  _onTaskQueueDrain() {
286
288
  var cbs = this.__taskQueueDrain;
@@ -390,6 +392,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
390
392
  qx.tool.compiler.ClassFile.JSX_OPTIONS
391
393
  ]
392
394
  ],
395
+
393
396
  generatorOpts: {
394
397
  compact: false
395
398
  },
@@ -496,6 +499,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
496
499
  delete dbClassInfo.translations;
497
500
  delete dbClassInfo.markers;
498
501
  delete dbClassInfo.fatalCompileError;
502
+ delete dbClassInfo.commonjsModules;
499
503
  for (var key in this.__dbClassInfo) {
500
504
  dbClassInfo[key] = this.__dbClassInfo[key];
501
505
  }
@@ -667,6 +671,16 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
667
671
  dbClassInfo.fatalCompileError = true;
668
672
  }
669
673
 
674
+ // CommonJS modules
675
+ if (Object.keys(this.__commonjsModules).length > 0) {
676
+ dbClassInfo.commonjsModules = {};
677
+ for (let moduleName in this.__commonjsModules) {
678
+ dbClassInfo.commonjsModules[moduleName] = [
679
+ ...this.__commonjsModules[moduleName]
680
+ ];
681
+ }
682
+ }
683
+
670
684
  return dbClassInfo;
671
685
  },
672
686
 
@@ -1648,6 +1662,58 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
1648
1662
  }
1649
1663
  }
1650
1664
 
1665
+ // Are we looking at the Identifier `require`, and is it a
1666
+ // function call (identified by having
1667
+ // `path.node.arguments`? If so, we'll add the discovered
1668
+ // module to the list of modules that must be browserified
1669
+ // if the application is destined for the browser.
1670
+ let scope;
1671
+ let applicationTypes = t.__analyser.getApplicationTypes();
1672
+
1673
+ if (
1674
+ path.node.callee.type == "Identifier" &&
1675
+ path.node?.callee?.name == "require" &&
1676
+ path.node.arguments?.length == 1 &&
1677
+ applicationTypes.includes("browser")
1678
+ ) {
1679
+ // See if this is a reference to global `require` or
1680
+ // something in the scope chain
1681
+ for (scope = t.__scope; scope; scope = scope.parent) {
1682
+ if (scope.vars["require"]) {
1683
+ // It's in the scope chain. Ignore it.
1684
+ break;
1685
+ }
1686
+ }
1687
+ // Did we reach top level without finding it in a local scope?
1688
+ if (!scope) {
1689
+ // Yup. It's the global one we're looking for. Ensure the argument is valid.
1690
+ let arg = path.node.arguments[0];
1691
+ if (types.isLiteral(arg)) {
1692
+ if (typeof arg.value != "string") {
1693
+ log.error(
1694
+ `${t.__className}: ` +
1695
+ "Only literal string arguments to require() are supported: " +
1696
+ arg.value
1697
+ );
1698
+ } else {
1699
+ qx.tool.compiler.Console.log(
1700
+ `${t.__className}:${path.node.loc.start.line}:` +
1701
+ ` automatically detected \'require(${arg.value})\``
1702
+ );
1703
+ t.addCommonjsModule(
1704
+ arg.value,
1705
+ t.__className,
1706
+ path.node.loc.start.line
1707
+ );
1708
+
1709
+ // Don't show "unresolved" error for `require` since the
1710
+ // browserified code defines it as a global
1711
+ t.addIgnore("require");
1712
+ }
1713
+ }
1714
+ }
1715
+ }
1716
+
1651
1717
  if (
1652
1718
  types.isMemberExpression(path.node.callee) ||
1653
1719
  (es6ClassDeclarations == 0 &&
@@ -1828,6 +1894,7 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
1828
1894
  types.stringLiteral(t.__classMeta.functionName)
1829
1895
  ]
1830
1896
  );
1897
+
1831
1898
  expr = types.memberExpression(expr, types.identifier("call"));
1832
1899
  } else if (t.__classMeta.functionName == "$$constructor") {
1833
1900
  expr = expandMemberExpression(
@@ -1836,8 +1903,8 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
1836
1903
  } else if (t.__classMeta.className) {
1837
1904
  expr = expandMemberExpression(
1838
1905
  t.__classMeta.className +
1839
- ".superclass" +
1840
- ".prototype." +
1906
+ ".superclass" +
1907
+ ".prototype." +
1841
1908
  t.__classMeta.functionName +
1842
1909
  ".call"
1843
1910
  );
@@ -2506,6 +2573,19 @@ qx.Class.define("qx.tool.compiler.ClassFile", {
2506
2573
  }
2507
2574
  },
2508
2575
 
2576
+ /**
2577
+ * Adds a CommonJS module to be browserified
2578
+ *
2579
+ * @param name {String} name of the module
2580
+ */
2581
+ addCommonjsModule(moduleName, className, linenum) {
2582
+ if (!this.__commonjsModules[moduleName]) {
2583
+ this.__commonjsModules[moduleName] = new Set();
2584
+ }
2585
+
2586
+ this.__commonjsModules[moduleName].add(`${className}:${linenum}`);
2587
+ },
2588
+
2509
2589
  /**
2510
2590
  * Adds an ignored symbol
2511
2591
  * @param name {String} name of the symbol
@@ -106,6 +106,7 @@ qx.Class.define("qx.tool.compiler.Es6ify", {
106
106
  construct(filename) {
107
107
  super();
108
108
  this.__filename = filename;
109
+ this.__knownApiFunctions = ["addListener", "addListenerOnce"];
109
110
  },
110
111
 
111
112
  properties: {
@@ -125,6 +126,7 @@ qx.Class.define("qx.tool.compiler.Es6ify", {
125
126
 
126
127
  members: {
127
128
  __filename: null,
129
+ __knownApiFunctions: null,
128
130
 
129
131
  async transform() {
130
132
  let src = await fs.promises.readFile(this.__filename, "utf8");
@@ -174,7 +176,9 @@ qx.Class.define("qx.tool.compiler.Es6ify", {
174
176
  while (true) {
175
177
  cycleCount++;
176
178
  if (cycleCount > 10) {
177
- qx.tool.compiler.Console.warn(`Can not find a stable format for ${this.__filename}`);
179
+ qx.tool.compiler.Console.warn(
180
+ `Can not find a stable format for ${this.__filename}`
181
+ );
178
182
  break;
179
183
  }
180
184
  result = babelCore.transform(src, config);
@@ -275,6 +279,7 @@ qx.Class.define("qx.tool.compiler.Es6ify", {
275
279
  let t = this;
276
280
  const isTest = this.__filename.indexOf("/test/") > -1;
277
281
  let arrowFunctions = this.getArrowFunctions();
282
+ let knownApiFunctions = this.__knownApiFunctions;
278
283
 
279
284
  return {
280
285
  visitor: {
@@ -282,13 +287,15 @@ qx.Class.define("qx.tool.compiler.Es6ify", {
282
287
  if (path.node.callee.type == "MemberExpression") {
283
288
  let callee = collapseMemberExpression(path.node.callee);
284
289
  if (arrowFunctions == "careful") {
285
- if (!callee.endsWith(".addListener")) {
290
+ if (
291
+ !knownApiFunctions.some(fName => callee.endsWith("." + fName))
292
+ ) {
286
293
  return;
287
294
  }
288
295
  if (
289
296
  path.node.arguments.length != 3 ||
290
297
  path.node.arguments[0].type != "StringLiteral" ||
291
- path.node.arguments[1].type != "ArrowFunctionExpression" ||
298
+ path.node.arguments[1].type != "FunctionExpression" ||
292
299
  path.node.arguments[2].type != "ThisExpression"
293
300
  ) {
294
301
  return;
@@ -324,14 +331,14 @@ qx.Class.define("qx.tool.compiler.Es6ify", {
324
331
  * @returns
325
332
  */
326
333
  __pluginRemoveUnnecessaryThis() {
334
+ let knownApiFunctions = this.__knownApiFunctions;
327
335
  return {
328
336
  visitor: {
329
337
  CallExpression(path) {
330
338
  if (
331
339
  path.node.callee.type == "MemberExpression" &&
332
- path.node.callee.object.type == "ThisExpression" &&
333
340
  path.node.callee.property.type == "Identifier" &&
334
- path.node.callee.property.name == "addListener" &&
341
+ knownApiFunctions.includes(path.node.callee.property.name) &&
335
342
  path.node.arguments.length == 3 &&
336
343
  path.node.arguments[0].type == "StringLiteral" &&
337
344
  path.node.arguments[1].type == "ArrowFunctionExpression" &&