@qooxdoo/framework 7.0.0-beta → 7.0.0-beta.4

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 (224) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/Manifest.json +11 -8
  3. package/bin/deploy/qx +0 -0
  4. package/lib/compiler/compile-info.json +86 -96
  5. package/lib/compiler/index.js +35547 -47284
  6. package/{source/class/qx/tool/compiler/targets → lib/resource/qx/tool/cli/templates}/TypeScriptWriter-base_declaration.txt +0 -0
  7. package/lib/resource/qx/tool/cli/templates/loader/loader-browser.tmpl.js +8 -2
  8. package/lib/resource/qx/tool/cli/templates/loader/loader-node.tmpl.js +24 -11
  9. package/lib/resource/qx/tool/cli/templates/loader/loader-rhino.tmpl.js +9 -2
  10. package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css +1 -1
  11. package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css.map +1 -44
  12. package/lib/resource/qx/tool/cli/templates/template_vars.js +1 -1
  13. package/lib/resource/qx/tool/loadsass.js +13 -0
  14. package/lib/resource/qx/tool/schema/Manifest-1-0-0.json +1 -2
  15. package/lib/resource/qx/tool/schema/Manifest-2-0-0.json +1 -2
  16. package/lib/resource/qx/tool/schema/compile-1-0-0.json +19 -9
  17. package/lib/resource/qx/tool/website/sass/qooxdoo.css +1 -1
  18. package/lib/resource/qx/tool/website/sass/qooxdoo.css.map +1 -9
  19. package/package.json +14 -14
  20. package/source/class/qx/Annotation.js +2 -2
  21. package/source/class/qx/Class.js +20 -4
  22. package/source/class/qx/Interface.js +6 -0
  23. package/source/class/qx/Promise.js +32 -2
  24. package/source/class/qx/bom/Element.js +1 -0
  25. package/source/class/qx/bom/Font.js +17 -2
  26. package/source/class/qx/bom/Iframe.js +10 -5
  27. package/source/class/qx/bom/Label.js +2 -1
  28. package/source/class/qx/bom/Template.js +2 -0
  29. package/source/class/qx/bom/client/Browser.js +11 -2
  30. package/source/class/qx/bom/client/OperatingSystem.js +16 -0
  31. package/source/class/qx/bom/element/Decoration.js +8 -5
  32. package/source/class/qx/bom/element/Dimension.js +46 -0
  33. package/source/class/qx/bom/webfonts/WebFont.js +10 -0
  34. package/source/class/qx/core/BaseInit.js +9 -3
  35. package/source/class/qx/core/Environment.js +1 -0
  36. package/source/class/qx/core/Property.js +2 -2
  37. package/source/class/qx/data/SingleValueBinding.js +6 -3
  38. package/source/class/qx/data/controller/CheckedList.js +18 -9
  39. package/source/class/qx/data/controller/List.js +8 -0
  40. package/source/class/qx/dev/unit/Sinon.js +1 -1
  41. package/source/class/qx/event/Utils.js +1 -1
  42. package/source/class/qx/event/handler/DragDrop.js +1 -1
  43. package/source/class/qx/event/handler/Gesture.js +3 -1
  44. package/source/class/qx/event/handler/Mouse.js +61 -22
  45. package/source/class/qx/event/handler/Video.js +111 -0
  46. package/source/class/qx/html/Element.js +47 -32
  47. package/source/class/qx/html/Image.js +2 -2
  48. package/source/class/qx/html/Node.js +34 -4
  49. package/source/class/qx/lang/Json.js +1 -0
  50. package/source/class/qx/lang/String.js +53 -1
  51. package/source/class/qx/test/Annotation.js +2 -1
  52. package/source/class/qx/test/Promise.js +5 -3
  53. package/source/class/qx/test/bom/Font.js +10 -1
  54. package/source/class/qx/test/core/Property.js +5 -3
  55. package/source/class/qx/test/html/Element.js +3 -3
  56. package/source/class/qx/test/lang/String.js +28 -0
  57. package/source/class/qx/test/type/BaseString.js +7 -0
  58. package/source/class/qx/test/ui/embed/Iframe.js +1 -0
  59. package/source/class/qx/test/ui/form/ComboBox.js +0 -42
  60. package/source/class/qx/test/ui/virtual/performance/AbstractLayerTest.js +6 -2
  61. package/source/class/qx/theme/manager/Decoration.js +0 -0
  62. package/source/class/qx/theme/manager/Font.js +11 -0
  63. package/source/class/qx/theme/tangible/Appearance.js +10 -0
  64. package/source/class/qx/theme/tangible/ColorDark.js +0 -0
  65. package/source/class/qx/theme/tangible/Decoration.js +6 -0
  66. package/source/class/qx/tool/cli/Cli.js +5 -3
  67. package/source/class/qx/tool/cli/Watch.js +52 -0
  68. package/source/class/qx/tool/cli/api/AbstractApi.js +1 -1
  69. package/source/class/qx/tool/cli/api/CompilerApi.js +16 -6
  70. package/source/class/qx/tool/cli/api/LibraryApi.js +1 -1
  71. package/source/class/qx/tool/cli/commands/Command.js +7 -0
  72. package/source/class/qx/tool/cli/commands/Compile.js +28 -9
  73. package/source/class/qx/tool/cli/commands/Lint.js +30 -11
  74. package/source/class/qx/tool/cli/commands/Package.js +1 -2
  75. package/source/class/qx/tool/cli/commands/Run.js +2 -25
  76. package/source/class/qx/tool/cli/commands/Serve.js +9 -0
  77. package/source/class/qx/tool/cli/commands/package/Publish.js +19 -10
  78. package/source/class/qx/tool/compiler/Analyser.js +22 -23
  79. package/source/class/qx/tool/compiler/ClassFile.js +3 -2
  80. package/source/class/qx/tool/compiler/Console.js +17 -1
  81. package/source/class/qx/tool/compiler/Preprocess.js +1 -1
  82. package/source/class/qx/tool/compiler/app/Application.js +4 -2
  83. package/source/class/qx/tool/compiler/app/Cldr.js +1 -1
  84. package/source/class/qx/tool/compiler/app/Library.js +82 -88
  85. package/source/class/qx/tool/compiler/app/Part.js +1 -1
  86. package/source/class/qx/tool/compiler/app/Translation.js +1 -1
  87. package/source/class/qx/tool/compiler/app/WebFont.js +5 -4
  88. package/source/class/qx/tool/compiler/jsdoc/ChildControlParser.js +1 -1
  89. package/source/class/qx/tool/compiler/jsdoc/CommandParser.js +1 -1
  90. package/source/class/qx/tool/compiler/jsdoc/ParamParser.js +1 -1
  91. package/source/class/qx/tool/compiler/jsdoc/Parser.js +1 -1
  92. package/source/class/qx/tool/compiler/jsdoc/ReturnParser.js +1 -1
  93. package/source/class/qx/tool/compiler/jsdoc/ThrowsParser.js +1 -1
  94. package/source/class/qx/tool/compiler/makers/AbstractAppMaker.js +1 -1
  95. package/source/class/qx/tool/compiler/makers/AppMaker.js +14 -14
  96. package/source/class/qx/tool/compiler/makers/Maker.js +1 -1
  97. package/source/class/qx/tool/compiler/resources/AbstractMatcher.js +1 -1
  98. package/source/class/qx/tool/compiler/resources/Asset.js +2 -2
  99. package/source/class/qx/tool/compiler/resources/ImageLoader.js +3 -2
  100. package/source/class/qx/tool/compiler/resources/Manager.js +5 -5
  101. package/source/class/qx/tool/compiler/resources/MetaLoader.js +1 -1
  102. package/source/class/qx/tool/compiler/resources/ResourceConverter.js +1 -1
  103. package/source/class/qx/tool/compiler/resources/ResourceLoader.js +1 -1
  104. package/source/class/qx/tool/compiler/resources/ScssConverter.js +9 -3
  105. package/source/class/qx/tool/compiler/resources/ScssFile.js +13 -12
  106. package/source/class/qx/tool/compiler/resources/ScssIncludeConverter.js +1 -1
  107. package/source/class/qx/tool/compiler/targets/BuildTarget.js +1 -1
  108. package/source/class/qx/tool/compiler/targets/SourceCodeCopier.js +1 -1
  109. package/source/class/qx/tool/compiler/targets/SourceTarget.js +1 -1
  110. package/source/class/qx/tool/compiler/targets/Target.js +70 -32
  111. package/source/class/qx/tool/compiler/targets/TypeScriptWriter.js +3 -4
  112. package/source/class/qx/tool/compiler/targets/meta/AbstractJavascriptMeta.js +22 -0
  113. package/source/class/qx/tool/compiler/targets/meta/ApplicationMeta.js +30 -0
  114. package/source/class/qx/tool/compiler/targets/meta/BootJs.js +22 -0
  115. package/source/class/qx/tool/compiler/targets/meta/Javascript.js +22 -0
  116. package/source/class/qx/tool/compiler/targets/meta/Package.js +37 -2
  117. package/source/class/qx/tool/compiler/targets/meta/PackageJavascript.js +22 -0
  118. package/source/class/qx/tool/compiler/targets/meta/Part.js +22 -0
  119. package/source/class/qx/tool/compiler/targets/meta/PolyfillJs.js +29 -7
  120. package/source/class/qx/tool/compiler/targets/meta/Uglify.js +23 -1
  121. package/source/class/qx/tool/config/Abstract.js +3 -3
  122. package/source/class/qx/tool/config/Utils.js +10 -1
  123. package/source/class/qx/tool/utils/IndexedArray.js +1 -1
  124. package/source/class/qx/tool/utils/Json.js +2 -2
  125. package/source/class/qx/tool/utils/LogManager.js +1 -1
  126. package/source/class/qx/tool/utils/Logger.js +1 -1
  127. package/source/class/qx/tool/utils/Promisify.js +1 -1
  128. package/source/class/qx/tool/utils/Utils.js +118 -1
  129. package/source/class/qx/tool/utils/Values.js +1 -1
  130. package/source/class/qx/tool/utils/Website.js +23 -18
  131. package/source/class/qx/tool/utils/files/FindFiles.js +1 -1
  132. package/source/class/qx/tool/utils/files/Utils.js +1 -1
  133. package/source/class/qx/tool/utils/json/Parser.js +1 -1
  134. package/source/class/qx/tool/utils/json/Stringify.js +1 -1
  135. package/source/class/qx/tool/utils/json/Tokenizer.js +1 -1
  136. package/source/class/qx/tool/utils/json/Writer.js +1 -1
  137. package/source/class/qx/type/BaseString.js +2 -1
  138. package/source/class/qx/ui/basic/Image.js +15 -7
  139. package/source/class/qx/ui/basic/Label.js +3 -1
  140. package/source/class/qx/ui/container/SlideBar.js +3 -0
  141. package/source/class/qx/ui/control/DateChooser.js +20 -1
  142. package/source/class/qx/ui/core/scroll/NativeScrollBar.js +3 -0
  143. package/source/class/qx/ui/core/scroll/ScrollBar.js +3 -0
  144. package/source/class/qx/ui/form/AbstractSelectBox.js +38 -6
  145. package/source/class/qx/ui/form/Button.js +3 -0
  146. package/source/class/qx/ui/form/CheckBox.js +25 -1
  147. package/source/class/qx/ui/form/CheckedList.js +2 -1
  148. package/source/class/qx/ui/form/ComboBox.js +36 -27
  149. package/source/class/qx/ui/form/List.js +3 -0
  150. package/source/class/qx/ui/form/MenuButton.js +24 -2
  151. package/source/class/qx/ui/form/RadioButton.js +7 -0
  152. package/source/class/qx/ui/form/RadioButtonGroup.js +3 -0
  153. package/source/class/qx/ui/form/RadioGroup.js +19 -0
  154. package/source/class/qx/ui/form/SelectBox.js +23 -1
  155. package/source/class/qx/ui/form/Slider.js +15 -0
  156. package/source/class/qx/ui/form/SplitButton.js +3 -0
  157. package/source/class/qx/ui/form/ToggleButton.js +8 -0
  158. package/source/class/qx/ui/menu/AbstractButton.js +24 -0
  159. package/source/class/qx/ui/menu/Button.js +3 -0
  160. package/source/class/qx/ui/menu/CheckBox.js +8 -0
  161. package/source/class/qx/ui/menu/Manager.js +2 -0
  162. package/source/class/qx/ui/menu/Menu.js +63 -1
  163. package/source/class/qx/ui/menu/RadioButton.js +10 -1
  164. package/source/class/qx/ui/menubar/Button.js +0 -27
  165. package/source/class/qx/ui/menubar/MenuBar.js +12 -0
  166. package/source/class/qx/ui/splitpane/Blocker.js +3 -0
  167. package/source/class/qx/ui/splitpane/HLayout.js +2 -2
  168. package/source/class/qx/ui/splitpane/Pane.js +4 -1
  169. package/source/class/qx/ui/splitpane/VLayout.js +2 -2
  170. package/source/class/qx/ui/table/Table.js +24 -2
  171. package/source/class/qx/ui/table/cellrenderer/Abstract.js +3 -1
  172. package/source/class/qx/ui/table/cellrenderer/AbstractImage.js +7 -3
  173. package/source/class/qx/ui/table/headerrenderer/HeaderCell.js +3 -0
  174. package/source/class/qx/ui/table/pane/Header.js +3 -0
  175. package/source/class/qx/ui/table/pane/Scroller.js +3 -7
  176. package/source/class/qx/ui/table/rowrenderer/Default.js +1 -1
  177. package/source/class/qx/ui/tabview/Page.js +26 -0
  178. package/source/class/qx/ui/tabview/TabView.js +3 -0
  179. package/source/class/qx/ui/toolbar/Button.js +2 -27
  180. package/source/class/qx/ui/toolbar/CheckBox.js +0 -27
  181. package/source/class/qx/ui/toolbar/RadioButton.js +21 -0
  182. package/source/class/qx/ui/toolbar/SplitButton.js +0 -28
  183. package/source/class/qx/ui/toolbar/ToolBar.js +3 -0
  184. package/source/class/qx/util/ColorUtil.js +2 -1
  185. package/source/class/qx/util/ResourceManager.js +16 -7
  186. package/source/class/qx/util/format/DateFormat.js +9 -0
  187. package/source/class/qxWeb.js +8 -4
  188. package/source/resource/qx/decoration/Indigo/font/JosefinSlab-SemiBold.ttf +0 -0
  189. package/source/resource/qx/decoration/Indigo/font/SIL Open Font License 1.1.txt +0 -0
  190. package/source/resource/qx/iconfont/MaterialIcons/fetch-fonts.sh +0 -0
  191. package/source/resource/qx/mobile/scss/common/_gradients.scss +3 -1
  192. package/source/resource/qx/mobile/scss/theme/indigo/_styles.scss +1 -1
  193. package/source/resource/qx/mobile/scss/ui/_carousel.scss +2 -2
  194. package/source/resource/qx/mobile/scss/ui/_checkbox.scss +3 -3
  195. package/source/resource/qx/mobile/scss/ui/_collapsible.scss +2 -2
  196. package/source/resource/qx/mobile/scss/ui/_picker.scss +4 -4
  197. package/source/resource/qx/mobile/scss/ui/_radiobutton.scss +4 -4
  198. package/source/resource/qx/mobile/scss/ui/_slider.scss +7 -7
  199. package/source/resource/qx/scss/_gradients.scss +3 -1
  200. package/source/resource/qx/scss/_mixins.scss +4 -2
  201. package/source/resource/qx/tool/bin/build-devtools +0 -0
  202. package/source/resource/qx/tool/bin/build-website +0 -0
  203. package/source/resource/qx/tool/bin/download-assets +0 -0
  204. package/source/resource/qx/tool/cli/templates/TypeScriptWriter-base_declaration.txt +13 -0
  205. package/source/resource/qx/tool/cli/templates/loader/loader-browser.tmpl.js +8 -2
  206. package/source/resource/qx/tool/cli/templates/loader/loader-node.tmpl.js +24 -11
  207. package/source/resource/qx/tool/cli/templates/loader/loader-rhino.tmpl.js +9 -2
  208. package/source/resource/qx/tool/cli/templates/skeleton/mobile/source/theme/custom/scss/_styles.scss +1 -1
  209. package/source/resource/qx/tool/cli/templates/template_vars.js +1 -1
  210. package/source/resource/qx/tool/loadsass.js +13 -0
  211. package/source/resource/qx/tool/schema/Manifest-1-0-0.json +1 -2
  212. package/source/resource/qx/tool/schema/Manifest-2-0-0.json +1 -2
  213. package/source/resource/qx/tool/schema/compile-1-0-0.json +19 -9
  214. package/source/resource/qx/website/scss/ui/_carousel.scss +2 -2
  215. package/lib/resource/qx/tool/website/.gitignore +0 -2
  216. package/source/class/qx/io/request/auth/.gitignore +0 -0
  217. package/source/class/qx/test/bom/client/.gitignore +0 -0
  218. package/source/class/qx/test/ui/control/.gitignore +0 -0
  219. package/source/class/qx/tool/compiler/Version.js +0 -20
  220. package/source/resource/qx/decoration/Modern/treevirtual/.gitignore +0 -0
  221. package/source/resource/qx/mobile/css/.gitignore +0 -3
  222. package/source/resource/qx/tool/website/.gitignore +0 -2
  223. package/source/resource/qx/website/.gitignore +0 -1
  224. package/source/resource/qx/website/scss/.gitignore +0 -1
@@ -87,48 +87,6 @@ qx.Class.define("qx.test.ui.form.ComboBox",
87
87
  this.flush();
88
88
  },
89
89
 
90
- testFocusTextOnClose: function() {
91
- var combobox = this.__createComboBox();
92
- this.getRoot().add(combobox);
93
- this.flush();
94
-
95
- // Open list popup
96
- combobox.open();
97
- this.flush();
98
-
99
- // Select item
100
- var list = combobox.getChildControl("list");
101
- var item = list.findItem("Item 0");
102
- list.setSelection([item]);
103
- this.flush();
104
-
105
- // Asssert focus on close
106
- this.spy(combobox, "tabFocus");
107
- combobox.close();
108
- this.assertCalled(combobox.tabFocus);
109
-
110
- this.getRoot().removeAll();
111
- combobox.dispose();
112
- },
113
-
114
- testNotFocusTextOnCloseWhenInvisibleBefore: function() {
115
- var combobox = this.__createComboBox();
116
- this.getRoot().add(combobox);
117
- this.flush();
118
-
119
- // Enter value
120
- combobox.setValue("Item 0");
121
- this.flush();
122
-
123
- // Assert not focus on close
124
- this.spy(combobox, "tabFocus");
125
- combobox.close();
126
- this.assertNotCalled(combobox.tabFocus);
127
-
128
- this.getRoot().removeAll();
129
- combobox.dispose();
130
- },
131
-
132
90
  __createComboBox : function(initValue)
133
91
  {
134
92
  var comboBox = new qx.ui.form.ComboBox();
@@ -130,7 +130,9 @@ qx.Class.define("qx.test.ui.virtual.performance.AbstractLayerTest",
130
130
 
131
131
  profile : function(name, fcn, context, count)
132
132
  {
133
- if (window.console && window.console.profile) console.profile(name + "; " + this.classname);
133
+ if (window.console && window.console.profile) {
134
+ console.profile(name + "; " + this.classname);
135
+ }
134
136
 
135
137
  var times = [];
136
138
  for (var i=0,l=count; i<l; i++)
@@ -148,7 +150,9 @@ qx.Class.define("qx.test.ui.virtual.performance.AbstractLayerTest",
148
150
  //this.warn(";" + name + "; avg(" + avg + "ms); " + times.join("ms; ") + "ms;");
149
151
  this.warn(";" + name + ";avg:" + avg + ";" + times.join(";"));
150
152
 
151
- if (window.console && window.console.profile) console.profileEnd(name + " " + this.classname);
153
+ if (window.console && window.console.profile) {
154
+ console.profileEnd(name + " " + this.classname);
155
+ }
152
156
  }
153
157
  }
154
158
 
File without changes
@@ -127,6 +127,17 @@ qx.Class.define("qx.theme.manager.Font",
127
127
 
128
128
  return cache[value] = fo.set(theme.fonts[value]);
129
129
  }
130
+ if (qx.core.Environment.get("qx.debug")) {
131
+ if (theme) {
132
+ if (!this.__warnedMissingFonts) {
133
+ this.__warnedMissingFonts = {};
134
+ }
135
+ if (!this.__warnedMissingFonts[value]) {
136
+ this.__warnedMissingFonts[value] = true;
137
+ this.debug(`Cannot resolve a font named ${value} - available fonts are ${Object.keys(theme.fonts).join(", ")}`);
138
+ }
139
+ }
140
+ }
130
141
 
131
142
  return value;
132
143
  },
@@ -242,6 +242,16 @@ qx.Theme.define("qx.theme.tangible.Appearance", {
242
242
  };
243
243
  }
244
244
  },
245
+ "material-button/icon": {
246
+ alias: "atom/label",
247
+
248
+ style: function(states) {
249
+ return {
250
+ textColor: states.disabled ?
251
+ "text-disabled-on-primary" : "text-on-primary"
252
+ };
253
+ }
254
+ },
245
255
 
246
256
  "button-frame": {
247
257
  alias: "atom",
File without changes
@@ -101,6 +101,12 @@ qx.Theme.define("qx.theme.tangible.Decoration",
101
101
  transitionDuration: "0.1s"
102
102
  }
103
103
  },
104
+ "material-button-hovered-invalid": {
105
+ include: "material-button-hovered",
106
+ style: {
107
+ color: "error"
108
+ }
109
+ },
104
110
  "material-button-pressed": {
105
111
  include: "material-button",
106
112
  style: {
@@ -239,7 +239,9 @@ Version: v${await qx.tool.config.Utils.getQxVersion()}
239
239
  this._compilerApi.setCommand(command);
240
240
  await this.__notifyLibraries();
241
241
  try {
242
- return await command.process();
242
+ const res = await command.process();
243
+ await this._compilerApi.afterProcessFinished(command, res);
244
+ return res;
243
245
  } catch (e) {
244
246
  qx.tool.compiler.Console.error("Error: " + (e.stack || e.message));
245
247
  process.exit(1);
@@ -420,8 +422,8 @@ Version: v${await qx.tool.config.Utils.getQxVersion()}
420
422
  if (config.libraries && needLibraries) {
421
423
  let neededLibraries = config.libraries.filter(libData => !fs.existsSync(libData + "/Manifest.json"));
422
424
  if (neededLibraries.length) {
423
- if (!fs.existsSync(qx.tool.config.Manifest.config.fileName)) {
424
- qx.tool.compiler.Console.error("Libraries are missing and there is no Manifest.json in the current directory so we cannot attempt to install them; the missing libraries are: \n " + neededLibraries.join("\n "));
425
+ if (!fs.existsSync(qx.tool.config.Manifest.config.fileName)) {
426
+ qx.tool.compiler.Console.error("Libraries are missing and there is no Manifest.json in the current directory so we cannot attempt to install them; the missing libraries are: \n " + neededLibraries.join("\n "));
425
427
  process.exit(1);
426
428
  }
427
429
  qx.tool.compiler.Console.info("One or more libraries not found - trying to install them from library repository...");
@@ -32,6 +32,9 @@ qx.Class.define("qx.tool.cli.Watch", {
32
32
  };
33
33
  this.__debounceChanges = {};
34
34
  this.__configFilenames = [];
35
+ this.__runWhenWatching = {};
36
+
37
+ maker.addListener("writtenApplication", this._onWrittenApplication, this);
35
38
  },
36
39
 
37
40
  properties: {
@@ -60,6 +63,10 @@ qx.Class.define("qx.tool.cli.Watch", {
60
63
  __makeTimerId: null,
61
64
  __debounceChanges: null,
62
65
  __configFilenames: null,
66
+ __madeApplications: null,
67
+
68
+ /** @type{Map<String,Object>} list of runWhenWatching configurations, indexed by app name */
69
+ __runWhenWatching: null,
63
70
 
64
71
  async setConfigFilenames(arr) {
65
72
  if (!arr) {
@@ -69,6 +76,50 @@ qx.Class.define("qx.tool.cli.Watch", {
69
76
  }
70
77
  },
71
78
 
79
+ setRunWhenWatching(appName, config) {
80
+ this.__runWhenWatching[appName] = config;
81
+ let arr = qx.tool.utils.Utils.parseCommand(config.command);
82
+ config._cmd = arr.shift();
83
+ config._args = arr;
84
+ },
85
+
86
+ async _onWrittenApplication(evt) {
87
+ let appInfo = evt.getData();
88
+ let name = appInfo.application.getName();
89
+ let config = this.__runWhenWatching[name];
90
+ if (!config) {
91
+ return;
92
+ }
93
+
94
+ if (config._process) {
95
+ try {
96
+ await qx.tool.utils.Utils.killTree(config._process.pid);
97
+ } catch (ex) {
98
+ //Nothing
99
+ }
100
+ if (config._processPromise) {
101
+ await config._processPromise;
102
+ }
103
+ config._process = null;
104
+ }
105
+
106
+ console.log("Starting application: " + config._cmd + " " + config._args.join(" "));
107
+ config._processPromise = new qx.Promise((resolve, reject) => {
108
+ let child = config._process = require("child_process").spawn(config._cmd, config._args);
109
+ child.stdout.setEncoding("utf8");
110
+ child.stdout.on("data", data => console.log(data));
111
+ child.stderr.setEncoding("utf8");
112
+ child.stderr.on("data", data => console.log(data));
113
+
114
+ child.on("close", function(code) {
115
+ console.log("Application has terminated");
116
+ config._process = null;
117
+ resolve();
118
+ });
119
+ child.on("error", err => console.error("Application has failed: " + err));
120
+ });
121
+ },
122
+
72
123
  start() {
73
124
  if (this.isDebug()) {
74
125
  qx.tool.compiler.Console.debug("DEBUG: Starting watch");
@@ -170,6 +221,7 @@ qx.Class.define("qx.tool.cli.Watch", {
170
221
 
171
222
  function make() {
172
223
  Console.print("qx.tool.cli.watch.makingApplications");
224
+ t.__madeApplications = null;
173
225
  var startTime = new Date().getTime();
174
226
  t.__stats.classesCompiled = 0;
175
227
  t.__outOfDate = false;
@@ -3,7 +3,7 @@
3
3
  * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
4
  * toolchain
5
5
  *
6
- * https://github.com/qooxdoo/qooxdoo-compiler
6
+ * https://github.com/qooxdoo/qooxdoo
7
7
  *
8
8
  * Copyright:
9
9
  * 2011-2019 Zenesis Limited, http://www.zenesis.com
@@ -3,7 +3,7 @@
3
3
  * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
4
  * toolchain
5
5
  *
6
- * https://github.com/qooxdoo/qooxdoo-compiler
6
+ * https://github.com/qooxdoo/qooxdoo
7
7
  *
8
8
  * Copyright:
9
9
  * 2011-2019 Zenesis Limited, http://www.zenesis.com
@@ -25,7 +25,7 @@ const fs = qx.tool.utils.Promisify.fs;
25
25
 
26
26
  /**
27
27
  * Provides an API for the compiler
28
- *
28
+ *
29
29
  */
30
30
  qx.Class.define("qx.tool.cli.api.CompilerApi", {
31
31
  extend: qx.tool.cli.api.AbstractApi,
@@ -75,7 +75,7 @@ qx.Class.define("qx.tool.cli.api.CompilerApi", {
75
75
 
76
76
  /**
77
77
  * called after deployment happens
78
- *
78
+ *
79
79
  * @param data {Object} contains deployment infos with the following properties:
80
80
  * targetDir : {String} The target dir of the build
81
81
  * deployDir : {String} The output dir for the deployment
@@ -89,7 +89,7 @@ qx.Class.define("qx.tool.cli.api.CompilerApi", {
89
89
 
90
90
  /**
91
91
  * Loads the configuration data
92
- *
92
+ *
93
93
  * @overridden
94
94
  */
95
95
  async load() {
@@ -102,6 +102,16 @@ qx.Class.define("qx.tool.cli.api.CompilerApi", {
102
102
  return this.base(arguments);
103
103
  },
104
104
 
105
+ /**
106
+ * runs after the whole process is finished
107
+ * @param cmd {qx.tool.cli.commands.Command} current command
108
+ * @param res {boolean} result of the just finished process
109
+ */
110
+ async afterProcessFinished(cmd, res) {
111
+ // Nothing
112
+ },
113
+
114
+
105
115
  /**
106
116
  * Called after all libraries have been loaded and added to the compilation data
107
117
  */
@@ -113,7 +123,7 @@ qx.Class.define("qx.tool.cli.api.CompilerApi", {
113
123
 
114
124
  /**
115
125
  * Adds a library configuration
116
- *
126
+ *
117
127
  * @param libraryApi {LibraryApi} the configuration for the library
118
128
  */
119
129
  addLibraryApi(libraryApi) {
@@ -123,7 +133,7 @@ qx.Class.define("qx.tool.cli.api.CompilerApi", {
123
133
 
124
134
  /**
125
135
  * Returns an array of library configurations
126
- *
136
+ *
127
137
  * @return {LibraryApi[]}
128
138
  */
129
139
  getLibraryApis() {
@@ -3,7 +3,7 @@
3
3
  * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
4
  * toolchain
5
5
  *
6
- * https://github.com/qooxdoo/qooxdoo-compiler
6
+ * https://github.com/qooxdoo/qooxdoo
7
7
  *
8
8
  * Copyright:
9
9
  * 2011-2019 Zenesis Limited, http://www.zenesis.com
@@ -127,6 +127,13 @@ qx.Class.define("qx.tool.cli.commands.Command", {
127
127
  */
128
128
  getQxPath: qx.tool.config.Utils.getQxPath.bind(qx.tool.config.Utils),
129
129
 
130
+ /**
131
+ *
132
+ * @returns @see {@link qx.tool.config.Utils#getCompilerVersion}
133
+ */
134
+ getCompilerVersion() {
135
+ return qx.tool.config.Utils.getCompilerVersion();
136
+ },
130
137
 
131
138
  /**
132
139
  * Returns the qooxdoo version, either from the `--qx-version` command line
@@ -326,7 +326,7 @@ qx.Class.define("qx.tool.cli.commands.Compile", {
326
326
 
327
327
  if (this.argv.verbose) {
328
328
  console.log(`
329
- Compiler: v${qx.tool.compiler.Version.VERSION} in ${require.main.filename}
329
+ Compiler: v${this.getCompilerVersion()} in ${require.main.filename}
330
330
  Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
331
331
  }
332
332
 
@@ -530,6 +530,11 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
530
530
 
531
531
  // Continuous make
532
532
  let watch = new qx.tool.cli.Watch(maker);
533
+ config.applications.forEach(appConfig => {
534
+ if (appConfig.runWhenWatching) {
535
+ watch.setRunWhenWatching(appConfig.name, appConfig.runWhenWatching);
536
+ }
537
+ });
533
538
  if (this.argv["watch-debug"]) {
534
539
  watch.setDebug(true);
535
540
  }
@@ -622,8 +627,9 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
622
627
  allAppNames[appConfig.name] = appConfig;
623
628
  }
624
629
  if (appConfig.group) {
625
- if (typeof appConfig.group == "string")
626
- appConfig.group = [ appConfig.group ];
630
+ if (typeof appConfig.group == "string") {
631
+ appConfig.group = [ appConfig.group ];
632
+ }
627
633
  }
628
634
  appConfig.index = index;
629
635
  let appType = appConfig.type||"browser";
@@ -733,6 +739,7 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
733
739
  /*
734
740
  * There is still only one target per maker, so convert our list of targetConfigs into an array of makers
735
741
  */
742
+ let targetOutputPaths = {};
736
743
  let makers = [];
737
744
  targetConfigs.forEach(targetConfig => {
738
745
  if (!targetConfig.appConfigs) {
@@ -742,12 +749,14 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
742
749
  let appConfigs = targetConfig.appConfigs.filter(appConfig => {
743
750
  if (argvAppGroups) {
744
751
  let groups = appConfig.group||[];
745
- if (!groups.find(groupName => !!argvAppGroups[groupName]))
752
+ if (!groups.find(groupName => !!argvAppGroups[groupName])) {
746
753
  return false;
754
+ }
747
755
  }
748
756
  if (argvAppNames && appConfig.name) {
749
- if (!argvAppNames[appConfig.name])
757
+ if (!argvAppNames[appConfig.name]) {
750
758
  return false;
759
+ }
751
760
  }
752
761
  return true;
753
762
  });
@@ -762,6 +771,11 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
762
771
  if (!outputPath) {
763
772
  throw new qx.tool.utils.Utils.UserError("Missing output-path for target " + targetConfig.type);
764
773
  }
774
+ let absOutputPath = path.resolve(outputPath);
775
+ if (targetOutputPaths[absOutputPath]) {
776
+ throw new qx.tool.utils.Utils.UserError(`Multiple output targets share the same target directory ${outputPath} - each target output must be unique`);
777
+ }
778
+ targetOutputPaths[absOutputPath] = true;
765
779
 
766
780
  var maker = new qx.tool.compiler.makers.AppMaker();
767
781
  if (!this.argv["erase"]) {
@@ -781,6 +795,11 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
781
795
  if (targetConfig.uri) {
782
796
  qx.tool.compiler.Console.print("qx.tool.cli.compile.deprecatedUri", "target.uri", targetConfig.uri);
783
797
  }
798
+ if (targetConfig.addTimestampsToUrls !== undefined) {
799
+ target.setAddTimestampsToUrls(targetConfig.addTimestampsToUrls);
800
+ } else {
801
+ target.setAddTimestampsToUrls(target instanceof qx.tool.compiler.targets.BuildTarget);
802
+ }
784
803
  if (targetConfig.writeCompileInfo || this.argv.writeCompileInfo) {
785
804
  target.setWriteCompileInfo(true);
786
805
  }
@@ -1057,15 +1076,15 @@ Framework: v${await this.getQxVersion()} in ${await this.getQxPath()}`);
1057
1076
  let requires_uris = Object.getOwnPropertyNames(requires)
1058
1077
  .filter(uri => !libs.find(lib => lib.getLibraryInfo().name === uri));
1059
1078
 
1060
- let urisToInstall = requires_uris.filter(name => name !== "@qooxdoo/framework");
1079
+ let urisToInstall = requires_uris.filter(name => (name !== "@qooxdoo/framework") && (name !== "@qooxdoo/compiler"));
1061
1080
 
1062
1081
  let pkg_libs = Object.getOwnPropertyNames(packages);
1063
1082
  if (urisToInstall.length > 0 && pkg_libs.length === 0) {
1064
1083
  // if we don't have package data
1065
1084
  if (this.argv.download) {
1066
- if (!fs.existsSync(qx.tool.config.Manifest.config.fileName)) {
1067
- Console.error("Libraries are missing and there is no Manifest.json in the current directory so we cannot attempt to install them; the missing libraries are: \n " +
1068
- urisToInstall.join("\n ") + "\nThe library which refers to the missing libraries is " + lib.getNamespace() + " in " + lib.getRootDir());
1085
+ if (!fs.existsSync(qx.tool.config.Manifest.config.fileName)) {
1086
+ Console.error("Libraries are missing and there is no Manifest.json in the current directory so we cannot attempt to install them; the missing libraries are: \n " +
1087
+ urisToInstall.join("\n ") + "\nThe library which refers to the missing libraries is " + lib.getNamespace() + " in " + lib.getRootDir());
1069
1088
  process.exit(1);
1070
1089
  }
1071
1090
  // but we're instructed to download the libraries
@@ -16,8 +16,9 @@
16
16
 
17
17
  ************************************************************************ */
18
18
 
19
- const CLIEngine = require("eslint").CLIEngine;
19
+ const {ESLint} = require("eslint");
20
20
  const fs = qx.tool.utils.Promisify.fs;
21
+ const path = require("path");
21
22
  const replaceInFile = require("replace-in-file");
22
23
 
23
24
  qx.Class.define("qx.tool.cli.commands.Lint", {
@@ -85,12 +86,21 @@ qx.Class.define("qx.tool.cli.commands.Lint", {
85
86
 
86
87
  process: async function() {
87
88
  await this.__applyFixes();
88
- let config;
89
- config = await qx.tool.cli.Cli.getInstance().getParsedArgs();
89
+
90
+ let helperFilePath = require.main.path;
91
+ while (true) {
92
+ if (await fs.existsAsync(path.join(helperFilePath, "node_modules"))) {
93
+ break;
94
+ }
95
+ helperFilePath = path.dirname(helperFilePath);
96
+ }
97
+
98
+ let config = await qx.tool.cli.Cli.getInstance().getParsedArgs();
90
99
  let lintOptions = config.eslintConfig || {};
91
100
  lintOptions.extends = lintOptions.extends || ["@qooxdoo/qx/browser"];
92
101
  lintOptions.globals = Object.assign(lintOptions.globals || {}, await this.__addGlobals(config));
93
- let linter = new CLIEngine({
102
+ let linter = new ESLint({
103
+ cwd: helperFilePath,
94
104
  cache: this.argv.cache || false,
95
105
  baseConfig: lintOptions,
96
106
  useEslintrc: this.argv.useEslintrc,
@@ -98,15 +108,24 @@ qx.Class.define("qx.tool.cli.commands.Lint", {
98
108
  });
99
109
  let files = this.argv.files || [];
100
110
  if (files.length === 0) {
101
- files.push("source/class/");
111
+ files.push("source/class/**/*.js");
112
+ }
113
+ for (let i = 0; i < files.length; i++) {
114
+ files[i] = path.join(process.cwd(), files[i]);
102
115
  }
103
- if (this.argv.config) {
104
- const fileConfig = linter.getConfigForFile(files[0]);
116
+ if (this.argv.printConfig) {
117
+ const fileConfig = await linter.calculateConfigForFile(files[0]);
105
118
  qx.tool.compiler.Console.info(JSON.stringify(fileConfig, null, " "));
106
119
  } else {
107
- let report = linter.executeOnFiles(files);
120
+ let report = await linter.lintFiles(files);
121
+ report.errorCount = 0;
122
+ report.warningCount =0;
123
+ for (const r of report) {
124
+ report.errorCount += r.errorCount;
125
+ report.warningCount += r.warningCount;
126
+ }
108
127
  if (this.argv.fix) {
109
- CLIEngine.outputFixes(report);
128
+ await ESLint.outputFixes(report);
110
129
  }
111
130
  if (report.errorCount > 0 || report.warningCount > 0) {
112
131
  let outputFormat = this.argv.format || "codeframe";
@@ -115,8 +134,8 @@ qx.Class.define("qx.tool.cli.commands.Lint", {
115
134
  if (report.errorCount + report.warningCount > 150) {
116
135
  outputFormat = "compact";
117
136
  }
118
- const formatter = linter.getFormatter(outputFormat);
119
- const s = formatter(report.results);
137
+ const formatter = await linter.loadFormatter(outputFormat);
138
+ const s = formatter.format(report);
120
139
  if (this.argv.outputFile) {
121
140
  if (this.argv.verbose) {
122
141
  qx.tool.compiler.Console.info(`Report to be written to ${this.argv.outputFile}`);
@@ -18,7 +18,6 @@
18
18
  const fs = qx.tool.utils.Promisify.fs;
19
19
  const path = require("upath");
20
20
  const process = require("process");
21
- const jsonlint = require("jsonlint");
22
21
  const stringify = require("json-stable-stringify");
23
22
 
24
23
  /**
@@ -213,7 +212,7 @@ qx.Class.define("qx.tool.cli.commands.Package", {
213
212
  return this.__cache;
214
213
  }
215
214
  try {
216
- this.__cache = jsonlint.parse(fs.readFileSync(this.getCachePath(), "UTF-8"));
215
+ this.__cache = JSON.parse(fs.readFileSync(this.getCachePath(), "UTF-8"));
217
216
  } catch (e) {
218
217
  this.__cache = {
219
218
  repos : {
@@ -18,7 +18,7 @@
18
18
 
19
19
  const path = require("upath");
20
20
  const process = require("process");
21
- const psTree = require("ps-tree");
21
+
22
22
  /**
23
23
  * Runs a server application
24
24
  */
@@ -97,29 +97,6 @@ qx.Class.define("qx.tool.cli.commands.Run", {
97
97
 
98
98
  let target = maker.getTarget();
99
99
 
100
- function kill(parentId) {
101
- return new qx.Promise((resolve, reject) => {
102
- psTree(parentId, function (err, children) {
103
- if (err) {
104
- reject(err);
105
- return;
106
- }
107
- children.forEach(item => {
108
- try {
109
- process.kill(item.PID);
110
- } catch (ex) {
111
- // Nothing
112
- }
113
- });
114
- try {
115
- process.kill(parentId);
116
- } catch (ex) {
117
- // Nothing
118
- }
119
- resolve();
120
- });
121
- });
122
- }
123
100
 
124
101
  let scriptname = path.join(target.getApplicationRoot(app), "index.js");
125
102
  let args = config.run.arguments||"";
@@ -150,7 +127,7 @@ qx.Class.define("qx.tool.cli.commands.Run", {
150
127
  }
151
128
 
152
129
  try {
153
- await kill(this.__process.pid);
130
+ await qx.tool.utils.Utils.killTree(this.__process.pid);
154
131
  } catch (ex) {
155
132
  //Nothing
156
133
  }
@@ -147,6 +147,15 @@ qx.Class.define("qx.tool.cli.commands.Serve", {
147
147
  }
148
148
  var config = this._getConfig();
149
149
  const app = express();
150
+ app.use((req, res, next) => {
151
+ res.set({
152
+ "Access-Control-Allow-Origin": "*",
153
+ "Access-Control-Allow-Headers": "Origin, X-Requested-With, Content-Type, Accept",
154
+ "Access-Control-Allow-Methods": "GET, POST, PATCH, DELETE, OPTIONS",
155
+ "Content-Security-Policy": "default-src * data: blob: filesystem: about: ws: wss: 'unsafe-inline' 'unsafe-eval'; script-src * data: blob: 'unsafe-inline' 'unsafe-eval'; connect-src * data: blob: 'unsafe-inline'; img-src * data: blob: 'unsafe-inline'; frame-src * data: blob: ; style-src * data: blob: 'unsafe-inline'; font-src * data: blob: 'unsafe-inline';"
156
+ })
157
+ next();
158
+ });
150
159
  const website = new qx.tool.utils.Website();
151
160
  if (!this.__showStartpage) {
152
161
  app.use("/", express.static(defaultMaker.getTarget().getOutputDir()));