@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
@@ -1,3 +1,25 @@
1
+ /* ************************************************************************
2
+ *
3
+ * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
+ * toolchain
5
+ *
6
+ * https://github.com/qooxdoo/qooxdoo-compiler
7
+ *
8
+ * Copyright:
9
+ * 2011-2021 Zenesis Limited, http://www.zenesis.com
10
+ *
11
+ * License:
12
+ * MIT: https://opensource.org/licenses/MIT
13
+ *
14
+ * This software is provided under the same licensing terms as Qooxdoo,
15
+ * please see the LICENSE file in the Qooxdoo project's top-level directory
16
+ * for details.
17
+ *
18
+ * Authors:
19
+ * * John Spackman (john.spackman@zenesis.com, @johnspackman)
20
+ *
21
+ * ************************************************************************/
22
+
1
23
  /**
2
24
  * ApplicationMeta collects all the data about an application being compiled by a target,
3
25
  * in a form easily navigated and well documented.
@@ -33,6 +55,14 @@ qx.Class.define("qx.tool.compiler.targets.meta.ApplicationMeta", {
33
55
  // Any object
34
56
  },
35
57
 
58
+ /**
59
+ * Whether to add timestamps to all URLs (cache busting)
60
+ */
61
+ addTimestampsToUrls: {
62
+ init: true,
63
+ check: "Boolean"
64
+ },
65
+
36
66
  appLibrary: {
37
67
  check: "qx.tool.compiler.app.Library"
38
68
  },
@@ -1,3 +1,25 @@
1
+ /* ************************************************************************
2
+ *
3
+ * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
+ * toolchain
5
+ *
6
+ * https://github.com/qooxdoo/qooxdoo-compiler
7
+ *
8
+ * Copyright:
9
+ * 2011-2021 Zenesis Limited, http://www.zenesis.com
10
+ *
11
+ * License:
12
+ * MIT: https://opensource.org/licenses/MIT
13
+ *
14
+ * This software is provided under the same licensing terms as Qooxdoo,
15
+ * please see the LICENSE file in the Qooxdoo project's top-level directory
16
+ * for details.
17
+ *
18
+ * Authors:
19
+ * * John Spackman (john.spackman@zenesis.com, @johnspackman)
20
+ *
21
+ * ************************************************************************/
22
+
1
23
 
2
24
  const fs = qx.tool.utils.Promisify.fs;
3
25
  const path = require("upath");
@@ -1,3 +1,25 @@
1
+ /* ************************************************************************
2
+ *
3
+ * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
+ * toolchain
5
+ *
6
+ * https://github.com/qooxdoo/qooxdoo-compiler
7
+ *
8
+ * Copyright:
9
+ * 2011-2021 Zenesis Limited, http://www.zenesis.com
10
+ *
11
+ * License:
12
+ * MIT: https://opensource.org/licenses/MIT
13
+ *
14
+ * This software is provided under the same licensing terms as Qooxdoo,
15
+ * please see the LICENSE file in the Qooxdoo project's top-level directory
16
+ * for details.
17
+ *
18
+ * Authors:
19
+ * * John Spackman (john.spackman@zenesis.com, @johnspackman)
20
+ *
21
+ * ************************************************************************/
22
+
1
23
  const fs = qx.tool.utils.Promisify.fs;
2
24
 
3
25
  /**
@@ -1,4 +1,27 @@
1
+ /* ************************************************************************
2
+ *
3
+ * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
+ * toolchain
5
+ *
6
+ * https://github.com/qooxdoo/qooxdoo-compiler
7
+ *
8
+ * Copyright:
9
+ * 2011-2021 Zenesis Limited, http://www.zenesis.com
10
+ *
11
+ * License:
12
+ * MIT: https://opensource.org/licenses/MIT
13
+ *
14
+ * This software is provided under the same licensing terms as Qooxdoo,
15
+ * please see the LICENSE file in the Qooxdoo project's top-level directory
16
+ * for details.
17
+ *
18
+ * Authors:
19
+ * * John Spackman (john.spackman@zenesis.com, @johnspackman)
20
+ *
21
+ * ************************************************************************/
22
+
1
23
  const path = require("upath");
24
+ const fs = require("fs");
2
25
 
3
26
  /**
4
27
  * A Package is a collection of files and resources, used by either the boot process
@@ -241,11 +264,23 @@ qx.Class.define("qx.tool.compiler.targets.meta.Package", {
241
264
  uris: [ ]
242
265
  };
243
266
  let appRoot = this.__appMeta.getApplicationRoot();
267
+ const toUri = filename => {
268
+ if (this.__appMeta.isAddTimestampsToUrls()) {
269
+ let stat = fs.statSync(filename, { throwIfNoEntry: false });
270
+ let uri = path.relative(appRoot, filename);
271
+ if (stat) {
272
+ uri += "?" + stat.mtimeMs;
273
+ }
274
+ return uri;
275
+ } else {
276
+ return path.relative(appRoot, filename);
277
+ }
278
+ }
244
279
  if (!this.isEmbedAllJavascript()) {
245
- data.uris = this.__javascriptMetas.map(js => path.relative(appRoot, js.getFilename()));
280
+ data.uris = this.__javascriptMetas.map(js => toUri(js.getFilename()));
246
281
  }
247
282
  if (this.isNeedsWriteToDisk()) {
248
- data.uris.unshift(path.relative(appRoot, this.__javascript.getFilename()));
283
+ data.uris.unshift(toUri(this.__javascript.getFilename()));
249
284
  }
250
285
  },
251
286
 
@@ -1,3 +1,25 @@
1
+ /* ************************************************************************
2
+ *
3
+ * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
+ * toolchain
5
+ *
6
+ * https://github.com/qooxdoo/qooxdoo-compiler
7
+ *
8
+ * Copyright:
9
+ * 2011-2021 Zenesis Limited, http://www.zenesis.com
10
+ *
11
+ * License:
12
+ * MIT: https://opensource.org/licenses/MIT
13
+ *
14
+ * This software is provided under the same licensing terms as Qooxdoo,
15
+ * please see the LICENSE file in the Qooxdoo project's top-level directory
16
+ * for details.
17
+ *
18
+ * Authors:
19
+ * * John Spackman (john.spackman@zenesis.com, @johnspackman)
20
+ *
21
+ * ************************************************************************/
22
+
1
23
  const path = require("upath");
2
24
 
3
25
  /**
@@ -1,3 +1,25 @@
1
+ /* ************************************************************************
2
+ *
3
+ * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
+ * toolchain
5
+ *
6
+ * https://github.com/qooxdoo/qooxdoo-compiler
7
+ *
8
+ * Copyright:
9
+ * 2011-2021 Zenesis Limited, http://www.zenesis.com
10
+ *
11
+ * License:
12
+ * MIT: https://opensource.org/licenses/MIT
13
+ *
14
+ * This software is provided under the same licensing terms as Qooxdoo,
15
+ * please see the LICENSE file in the Qooxdoo project's top-level directory
16
+ * for details.
17
+ *
18
+ * Authors:
19
+ * * John Spackman (john.spackman@zenesis.com, @johnspackman)
20
+ *
21
+ * ************************************************************************/
22
+
1
23
 
2
24
  /**
3
25
  * A Part collects together all of the javascript files required for a single
@@ -1,30 +1,52 @@
1
+ /* ************************************************************************
2
+ *
3
+ * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
+ * toolchain
5
+ *
6
+ * https://github.com/qooxdoo/qooxdoo-compiler
7
+ *
8
+ * Copyright:
9
+ * 2011-2021 Zenesis Limited, http://www.zenesis.com
10
+ *
11
+ * License:
12
+ * MIT: https://opensource.org/licenses/MIT
13
+ *
14
+ * This software is provided under the same licensing terms as Qooxdoo,
15
+ * please see the LICENSE file in the Qooxdoo project's top-level directory
16
+ * for details.
17
+ *
18
+ * Authors:
19
+ * * John Spackman (john.spackman@zenesis.com, @johnspackman)
20
+ *
21
+ * ************************************************************************/
22
+
1
23
  const fs = qx.tool.utils.Promisify.fs;
2
24
  const path = require("upath");
3
25
 
4
26
  /**
5
- * Represents a "polyfill.js" that is generated as part of a compile
27
+ * Represents a "polyfill.js" that is generated as part of a compile
6
28
  */
7
29
  qx.Class.define("qx.tool.compiler.targets.meta.PolyfillJs", {
8
30
  extend: qx.tool.compiler.targets.meta.AbstractJavascriptMeta,
9
-
31
+
10
32
  construct(appMeta) {
11
33
  this.base(arguments, appMeta, `${appMeta.getApplicationRoot()}polyfill.js`);
12
34
  },
13
-
35
+
14
36
  properties: {
15
37
  needsWriteToDisk: {
16
38
  init: true,
17
39
  refine: true
18
40
  }
19
41
  },
20
-
42
+
21
43
  members: {
22
-
44
+
23
45
  /*
24
46
  * @Override
25
47
  */
26
48
  async writeSourceCodeToStream(ws) {
27
- const srcFilename = path.join(require.resolve("@babel/polyfill"), "../../dist/polyfill.js");
49
+ const srcFilename = path.join(require.resolve("core-js-bundle"), "../minified.js");
28
50
  let rs = fs.createReadStream(srcFilename, "utf8");
29
51
  await new Promise((resolve, reject) => {
30
52
  rs.on("end", resolve);
@@ -32,7 +54,7 @@ qx.Class.define("qx.tool.compiler.targets.meta.PolyfillJs", {
32
54
  rs.pipe(ws, { end: false });
33
55
  });
34
56
  },
35
-
57
+
36
58
  /*
37
59
  * @Override
38
60
  */
@@ -1,6 +1,28 @@
1
+ /* ************************************************************************
2
+ *
3
+ * qooxdoo-compiler - node.js based replacement for the Qooxdoo python
4
+ * toolchain
5
+ *
6
+ * https://github.com/qooxdoo/qooxdoo-compiler
7
+ *
8
+ * Copyright:
9
+ * 2011-2021 Zenesis Limited, http://www.zenesis.com
10
+ *
11
+ * License:
12
+ * MIT: https://opensource.org/licenses/MIT
13
+ *
14
+ * This software is provided under the same licensing terms as Qooxdoo,
15
+ * please see the LICENSE file in the Qooxdoo project's top-level directory
16
+ * for details.
17
+ *
18
+ * Authors:
19
+ * * John Spackman (john.spackman@zenesis.com, @johnspackman)
20
+ *
21
+ * ************************************************************************/
22
+
1
23
  const fs = qx.tool.utils.Promisify.fs;
2
24
  const path = require("upath");
3
- const UglifyJS = require("uglify-es");
25
+ const UglifyJS = require("uglify-js");
4
26
 
5
27
  qx.Class.define("qx.tool.compiler.targets.meta.Uglify", {
6
28
  extend: qx.tool.compiler.targets.meta.AbstractJavascriptMeta,
@@ -332,7 +332,7 @@ qx.Class.define("qx.tool.config.Abstract", {
332
332
  */
333
333
  setValue(prop_path, value, options) {
334
334
  let originalValue = this.getValue(prop_path, options);
335
- set_value(this.getData(), prop_path, value, options);
335
+ set_value(this.getData(), prop_path, value, {preservePaths:false});
336
336
  try {
337
337
  this.validate();
338
338
  } catch (e) {
@@ -340,7 +340,7 @@ qx.Class.define("qx.tool.config.Abstract", {
340
340
  if (originalValue === undefined) {
341
341
  unset_value(this.getData(), prop_path);
342
342
  } else {
343
- set_value(this.getData(), prop_path, originalValue, options);
343
+ set_value(this.getData(), prop_path, originalValue, {preservePaths:false});
344
344
  }
345
345
  // throw
346
346
  throw e;
@@ -362,7 +362,7 @@ qx.Class.define("qx.tool.config.Abstract", {
362
362
  this.validate();
363
363
  } catch (e) {
364
364
  // revert value
365
- set_value(this.getData(), prop_path, originalValue, options);
365
+ set_value(this.getData(), prop_path, originalValue, {preservePaths:false});
366
366
  // throw
367
367
  throw e;
368
368
  }
@@ -191,7 +191,7 @@ qx.Class.define("qx.tool.config.Utils", {
191
191
 
192
192
  throw new qx.tool.utils.Utils.UserError(`Path to the qx library cannot be determined.`);
193
193
  };
194
-
194
+
195
195
  this.__qxPathPromise = getQxPathImpl();
196
196
  return await this.__qxPathPromise;
197
197
  },
@@ -217,6 +217,15 @@ qx.Class.define("qx.tool.config.Utils", {
217
217
  return qx.tool.config.Utils.getLibraryVersion(qxpath);
218
218
  },
219
219
 
220
+ /**
221
+ * returns the compiler version.
222
+ * The version is written during compiler compile into the enviroment
223
+ * @return {String}
224
+ */
225
+ getCompilerVersion() {
226
+ return qx.core.Environment.get("qx.compiler.version");
227
+ },
228
+
220
229
  /**
221
230
  * Returns the qooxdoo version used in the application in the current or given
222
231
  * directory. Throws if no such version can be determined
@@ -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-2017 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-2018 Zenesis Limited, http://www.zenesis.com
@@ -59,7 +59,7 @@ qx.Class.define("qx.tool.utils.Json", {
59
59
  validate(json, schema, warnOnly=false) {
60
60
  let ajv = new Ajv({
61
61
  allErrors: true,
62
- jsonPointers: true
62
+ strict: false
63
63
  });
64
64
  if (qx.lang.Type.isArray(schema)) {
65
65
  ajv.addSchema(schema);
@@ -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-2017 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-2017 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-2017 Zenesis Limited, http://www.zenesis.com
@@ -20,6 +20,7 @@ const fs = require("fs");
20
20
  const async = require("async");
21
21
  const {promisify} = require("util");
22
22
  const child_process = require("child_process");
23
+ const psTree = require("ps-tree");
23
24
 
24
25
  /**
25
26
  * Utility methods
@@ -275,7 +276,7 @@ qx.Class.define("qx.tool.utils.Utils", {
275
276
  if (!options.log) {
276
277
  options.log = console.log;
277
278
  }
278
- return new Promise((resolve, reject) => {
279
+ return await new Promise((resolve, reject) => {
279
280
  let env = process.env;
280
281
  if (options.env) {
281
282
  env = Object.assign({}, env);
@@ -363,6 +364,122 @@ qx.Class.define("qx.tool.utils.Utils", {
363
364
  });
364
365
  },
365
366
 
367
+ /**
368
+ * Parses a command line and separates them out into an array that can be given to `child_process.spawn` etc
369
+ *
370
+ * @param {String} cmd
371
+ * @returns {String[]}
372
+ */
373
+ parseCommand(str) {
374
+ let inQuote = null;
375
+ let inArg = false;
376
+ let lastC = null;
377
+ let start = 0;
378
+ let args = [];
379
+ for (let i = 0; i < str.length; i++) {
380
+ let c = str[i];
381
+ if (inQuote) {
382
+ if (c == inQuote) {
383
+ inQuote = null;
384
+ }
385
+ continue;
386
+ }
387
+ if (c == "\"" || c == "\'") {
388
+ inQuote = c;
389
+ if (!inArg) {
390
+ inArg = true;
391
+ start = i;
392
+ }
393
+ continue;
394
+ }
395
+ if (c == " " || c == "\t") {
396
+ if (inArg) {
397
+ let arg = str.substring(start, i);
398
+ args.push(arg);
399
+ inArg = false;
400
+ }
401
+ } else {
402
+ if (!inArg) {
403
+ inArg = true;
404
+ start = i;
405
+ }
406
+ }
407
+ }
408
+ if (inArg) {
409
+ let arg = str.substring(start);
410
+ args.push(arg);
411
+ }
412
+ return args;
413
+ },
414
+
415
+ /**
416
+ * Quotes special characters in the argument array, ensuring that they are safe to pass to the command line
417
+ *
418
+ * @param {String[]} cmd
419
+ * @returns {String[]}
420
+ */
421
+ quoteCommand(cmd) {
422
+ const SPECIALS = "&*?;# \"";
423
+ cmd = cmd.map(arg => {
424
+ let c = arg[0];
425
+ if ((c == '\'' || c == '\"') && c == arg[arg.length-1]) {
426
+ return arg;
427
+ }
428
+ if (arg.indexOf('\'') > -1) {
429
+ if (arg.indexOf('\"') > -1) {
430
+ return "$'" + arg.replace(/'/g, "\\'") + "'";
431
+ }
432
+ return '\"' + arg + '\"';
433
+ }
434
+ for (let i = 0; i < SPECIALS.length; i++) {
435
+ if (arg.indexOf(SPECIALS[i]) > -1) {
436
+ return "'" + arg + "'";
437
+ }
438
+ }
439
+ return arg;
440
+ });
441
+ return cmd;
442
+ },
443
+
444
+ /**
445
+ * Reformats a command line
446
+ *
447
+ * @param {String} cmd
448
+ * @returns {String}
449
+ */
450
+ formatCommand(cmd) {
451
+ return qx.tool.utils.Utils.quoteCommand(cmd).join(" ");
452
+ },
453
+
454
+ /**
455
+ * Kills a process tree
456
+ *
457
+ * @param {Number} parentId parent process ID to kill
458
+ */
459
+ async killTree(parentId) {
460
+ await new qx.Promise((resolve, reject) => {
461
+ psTree(parentId, function (err, children) {
462
+ if (err) {
463
+ reject(err);
464
+ return;
465
+ }
466
+ children.forEach(item => {
467
+ try {
468
+ process.kill(item.PID);
469
+ } catch (ex) {
470
+ // Nothing
471
+ }
472
+ });
473
+ try {
474
+ process.kill(parentId);
475
+ } catch (ex) {
476
+ // Nothing
477
+ }
478
+ resolve();
479
+ });
480
+ });
481
+ },
482
+
366
483
  /**
367
484
  * Returns the absolute path to the template directory
368
485
  * @return {String}
@@ -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-2017 Zenesis Limited, http://www.zenesis.com
@@ -29,7 +29,12 @@ const layouts = require("metalsmith-layouts");
29
29
  const markdown = require("metalsmith-markdown");
30
30
  //const filenames = require("metalsmith-filenames");
31
31
  //var permalinks = require("metalsmith-permalinks");
32
- const sass = require("node-sass");
32
+ /**
33
+ * @external(qx/tool/loadsass.js)
34
+ * @ignore(loadSass)
35
+ */
36
+ /* global loadSass */
37
+ const sass = loadSass();
33
38
  const chokidar = require("chokidar");
34
39
 
35
40
  // config
@@ -76,19 +81,19 @@ qx.Class.define("qx.tool.utils.Website", {
76
81
  members: {
77
82
  /** @type {chokidar} watcher */
78
83
  __watcher: null,
79
-
84
+
80
85
  /** @type {Boolean} whether the watcher is ready yet */
81
86
  __watcherReady: false,
82
-
87
+
83
88
  /** @type {Integer} setTimeout timer ID for debouncing builds */
84
89
  __rebuildTimer: null,
85
-
90
+
86
91
  /** @type {Boolean} Whether the build is currently taking place */
87
92
  __rebuilding: false,
88
-
93
+
89
94
  /** @type {Boolean} Whether a rebuild is needed ASAP */
90
95
  __needsRebuild: false,
91
-
96
+
92
97
  /**
93
98
  * Starts the watcher for files in the source directory and compiles as needed
94
99
  */
@@ -118,10 +123,10 @@ qx.Class.define("qx.tool.utils.Website", {
118
123
  this.__watcherReady = false;
119
124
  }
120
125
  },
121
-
126
+
122
127
  /**
123
128
  * Whether the watcher is running
124
- *
129
+ *
125
130
  * @return {Boolean} true if its running
126
131
  */
127
132
  isWatching() {
@@ -136,7 +141,7 @@ qx.Class.define("qx.tool.utils.Website", {
136
141
  await this.__rebuildPromise;
137
142
  }
138
143
  },
139
-
144
+
140
145
  /**
141
146
  * Rebuilds everything needed for the website
142
147
  */
@@ -147,7 +152,7 @@ qx.Class.define("qx.tool.utils.Website", {
147
152
 
148
153
  /**
149
154
  * Event handler for changes to the source files
150
- *
155
+ *
151
156
  * @param type {String} type of change, one of "change", "add", "unlink"
152
157
  * @param filename {String} the file that changed
153
158
  */
@@ -158,13 +163,13 @@ qx.Class.define("qx.tool.utils.Website", {
158
163
  }
159
164
  }
160
165
  },
161
-
166
+
162
167
  /**
163
168
  * Triggers a rebuild of the website, asynchronously. Unless immediate is true,
164
169
  * the rebuild will only happen after a short delay; but each time this is called,
165
170
  * the delay is restarted. This is to allow multiple files to be changed without
166
171
  * swamping the processor with compilations.
167
- *
172
+ *
168
173
  * @param immediate {Boolean?} if true, rebuild starts ASAP
169
174
  */
170
175
  triggerRebuild(immediate) {
@@ -172,16 +177,16 @@ qx.Class.define("qx.tool.utils.Website", {
172
177
  this.__needsRebuild = true;
173
178
  return;
174
179
  }
175
-
180
+
176
181
  let rebuilderImpl = async () => {
177
182
  await this.rebuildAll();
178
-
183
+
179
184
  if (this.__needsRebuild) {
180
185
  this.__needsRebuild = false;
181
186
  await rebuilderImpl();
182
187
  }
183
188
  };
184
-
189
+
185
190
  let rebuilder = async () => {
186
191
  this.__rebuilding = true;
187
192
  try {
@@ -192,14 +197,14 @@ qx.Class.define("qx.tool.utils.Website", {
192
197
  this.__rebuilding = false;
193
198
  }
194
199
  };
195
-
200
+
196
201
  if (this.__rebuildTimer) {
197
202
  clearTimeout(this.__rebuildTimer);
198
203
  this.__rebuildTimer = null;
199
204
  }
200
205
  this.__rebuildTimer = setTimeout(rebuilder, immediate ? 1 : 250);
201
206
  },
202
-
207
+
203
208
  /**
204
209
  * Metalsmith Plugin that collates a list of pages that are to be included in the site navigation
205
210
  * into the metadata, along with their URLs.
@@ -262,7 +267,7 @@ qx.Class.define("qx.tool.utils.Website", {
262
267
  }
263
268
  let [unused, name, ext] = m;
264
269
  if (unused) {
265
- // this is simply to avoid linting errors until https://github.com/qooxdoo/qooxdoo-compiler/issues/461 is fixed
270
+ // this is simply to avoid linting errors until https://github.com/qooxdoo/qooxdoo/issues/461 is fixed
266
271
  }
267
272
  let data = await fs.readFileAsync(path.join(partialsDir, filename), "utf8");
268
273
  let fn;