fomantic-ui 2.10.0-beta.0 → 2.10.0-beta.10

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 (288) hide show
  1. package/.all-contributorsrc +9 -0
  2. package/.eslintrc.js +0 -10
  3. package/.github/workflows/ci.yml +3 -3
  4. package/CONTRIBUTING.md +4 -1
  5. package/CONTRIBUTORS.md +1 -0
  6. package/FAQ.md +7 -2
  7. package/README.md +5 -9
  8. package/ROADMAP.md +4 -4
  9. package/SECURITY.md +8 -7
  10. package/changelog-setup.js +64 -70
  11. package/dist/components/accordion.css +1 -1
  12. package/dist/components/accordion.js +103 -142
  13. package/dist/components/accordion.min.css +1 -1
  14. package/dist/components/accordion.min.js +2 -2
  15. package/dist/components/ad.css +1 -1
  16. package/dist/components/ad.min.css +1 -1
  17. package/dist/components/api.js +157 -210
  18. package/dist/components/api.min.js +2 -2
  19. package/dist/components/breadcrumb.css +1 -1
  20. package/dist/components/breadcrumb.min.css +1 -1
  21. package/dist/components/button.css +1 -2
  22. package/dist/components/button.min.css +2 -2
  23. package/dist/components/calendar.css +1 -2
  24. package/dist/components/calendar.js +314 -352
  25. package/dist/components/calendar.min.css +2 -2
  26. package/dist/components/calendar.min.js +2 -2
  27. package/dist/components/card.css +1 -1
  28. package/dist/components/card.min.css +1 -1
  29. package/dist/components/checkbox.css +1 -2
  30. package/dist/components/checkbox.js +85 -135
  31. package/dist/components/checkbox.min.css +2 -2
  32. package/dist/components/checkbox.min.js +2 -2
  33. package/dist/components/comment.css +1 -1
  34. package/dist/components/comment.min.css +1 -1
  35. package/dist/components/container.css +2 -4
  36. package/dist/components/container.min.css +2 -2
  37. package/dist/components/dimmer.css +1 -11
  38. package/dist/components/dimmer.js +61 -94
  39. package/dist/components/dimmer.min.css +2 -2
  40. package/dist/components/dimmer.min.js +2 -2
  41. package/dist/components/divider.css +1 -2
  42. package/dist/components/divider.min.css +2 -2
  43. package/dist/components/dropdown.css +30 -51
  44. package/dist/components/dropdown.js +736 -1055
  45. package/dist/components/dropdown.min.css +2 -2
  46. package/dist/components/dropdown.min.js +2 -2
  47. package/dist/components/embed.css +1 -1
  48. package/dist/components/embed.js +85 -114
  49. package/dist/components/embed.min.css +1 -1
  50. package/dist/components/embed.min.js +2 -2
  51. package/dist/components/emoji.css +3809 -7617
  52. package/dist/components/emoji.min.css +2 -2
  53. package/dist/components/feed.css +1 -1
  54. package/dist/components/feed.min.css +1 -1
  55. package/dist/components/flag.css +1 -1
  56. package/dist/components/flag.min.css +1 -1
  57. package/dist/components/flyout.css +2 -3
  58. package/dist/components/flyout.js +226 -355
  59. package/dist/components/flyout.min.css +2 -2
  60. package/dist/components/flyout.min.js +2 -2
  61. package/dist/components/form.css +5 -95
  62. package/dist/components/form.js +335 -444
  63. package/dist/components/form.min.css +2 -2
  64. package/dist/components/form.min.js +2 -2
  65. package/dist/components/grid.css +2 -58
  66. package/dist/components/grid.min.css +2 -2
  67. package/dist/components/header.css +1 -1
  68. package/dist/components/header.min.css +1 -1
  69. package/dist/components/icon.css +4 -4
  70. package/dist/components/icon.min.css +2 -2
  71. package/dist/components/image.css +1 -1
  72. package/dist/components/image.min.css +1 -1
  73. package/dist/components/input.css +1 -536
  74. package/dist/components/input.min.css +2 -2
  75. package/dist/components/item.css +1 -1
  76. package/dist/components/item.min.css +1 -1
  77. package/dist/components/label.css +1 -1
  78. package/dist/components/label.min.css +1 -1
  79. package/dist/components/list.css +1 -3
  80. package/dist/components/list.min.css +2 -2
  81. package/dist/components/loader.css +1 -1
  82. package/dist/components/loader.min.css +1 -1
  83. package/dist/components/menu.css +1 -9
  84. package/dist/components/menu.min.css +2 -2
  85. package/dist/components/message.css +1 -1
  86. package/dist/components/message.min.css +1 -1
  87. package/dist/components/modal.css +5 -9
  88. package/dist/components/modal.js +261 -384
  89. package/dist/components/modal.min.css +2 -2
  90. package/dist/components/modal.min.js +2 -2
  91. package/dist/components/nag.css +1 -1
  92. package/dist/components/nag.js +68 -98
  93. package/dist/components/nag.min.css +1 -1
  94. package/dist/components/nag.min.js +2 -2
  95. package/dist/components/placeholder.css +1 -1
  96. package/dist/components/placeholder.min.css +1 -1
  97. package/dist/components/popup.css +1 -2
  98. package/dist/components/popup.js +198 -271
  99. package/dist/components/popup.min.css +2 -2
  100. package/dist/components/popup.min.js +2 -2
  101. package/dist/components/progress.css +1 -1
  102. package/dist/components/progress.js +109 -144
  103. package/dist/components/progress.min.css +1 -1
  104. package/dist/components/progress.min.js +2 -2
  105. package/dist/components/rail.css +1 -1
  106. package/dist/components/rail.min.css +1 -1
  107. package/dist/components/rating.css +1 -1
  108. package/dist/components/rating.js +91 -123
  109. package/dist/components/rating.min.css +1 -1
  110. package/dist/components/rating.min.js +2 -2
  111. package/dist/components/reset.css +1 -1
  112. package/dist/components/reset.min.css +1 -1
  113. package/dist/components/reveal.css +1 -1
  114. package/dist/components/reveal.min.css +1 -1
  115. package/dist/components/search.css +2 -9
  116. package/dist/components/search.js +277 -379
  117. package/dist/components/search.min.css +2 -2
  118. package/dist/components/search.min.js +2 -2
  119. package/dist/components/segment.css +2 -7
  120. package/dist/components/segment.min.css +2 -2
  121. package/dist/components/shape.css +1 -2
  122. package/dist/components/shape.js +158 -224
  123. package/dist/components/shape.min.css +2 -2
  124. package/dist/components/shape.min.js +2 -2
  125. package/dist/components/sidebar.css +2 -3
  126. package/dist/components/sidebar.js +124 -206
  127. package/dist/components/sidebar.min.css +2 -2
  128. package/dist/components/sidebar.min.js +2 -2
  129. package/dist/components/site.css +9 -25
  130. package/dist/components/site.js +38 -57
  131. package/dist/components/site.min.css +2 -2
  132. package/dist/components/site.min.js +2 -2
  133. package/dist/components/slider.css +1 -1
  134. package/dist/components/slider.js +246 -329
  135. package/dist/components/slider.min.css +1 -1
  136. package/dist/components/slider.min.js +2 -2
  137. package/dist/components/state.js +70 -100
  138. package/dist/components/state.min.js +2 -2
  139. package/dist/components/statistic.css +1 -1
  140. package/dist/components/statistic.min.css +1 -1
  141. package/dist/components/step.css +1 -1
  142. package/dist/components/step.min.css +1 -1
  143. package/dist/components/sticky.css +1 -1
  144. package/dist/components/sticky.js +135 -180
  145. package/dist/components/sticky.min.css +1 -1
  146. package/dist/components/sticky.min.js +2 -2
  147. package/dist/components/tab.css +1 -1
  148. package/dist/components/tab.js +176 -244
  149. package/dist/components/tab.min.css +1 -1
  150. package/dist/components/tab.min.js +2 -2
  151. package/dist/components/table.css +3 -37
  152. package/dist/components/table.min.css +2 -2
  153. package/dist/components/text.css +1 -1
  154. package/dist/components/text.min.css +1 -1
  155. package/dist/components/toast.css +1 -3
  156. package/dist/components/toast.js +109 -147
  157. package/dist/components/toast.min.css +1 -1
  158. package/dist/components/toast.min.js +2 -2
  159. package/dist/components/transition.css +1 -1
  160. package/dist/components/transition.js +91 -146
  161. package/dist/components/transition.min.css +1 -1
  162. package/dist/components/transition.min.js +2 -2
  163. package/dist/components/visibility.js +146 -224
  164. package/dist/components/visibility.min.js +2 -2
  165. package/dist/semantic.css +3906 -8720
  166. package/dist/semantic.js +4397 -6155
  167. package/dist/semantic.min.css +2 -2
  168. package/dist/semantic.min.js +2 -2
  169. package/examples/assets/show-examples.js +2 -4
  170. package/gulpfile.js +5 -7
  171. package/package.json +20 -16
  172. package/scripts/nightly-version.js +7 -10
  173. package/src/README.md +3 -3
  174. package/src/definitions/behaviors/api.js +156 -209
  175. package/src/definitions/behaviors/form.js +334 -443
  176. package/src/definitions/behaviors/state.js +69 -99
  177. package/src/definitions/behaviors/visibility.js +145 -223
  178. package/src/definitions/collections/form.less +1 -13
  179. package/src/definitions/collections/grid.less +1 -61
  180. package/src/definitions/collections/menu.less +0 -11
  181. package/src/definitions/collections/table.less +1 -35
  182. package/src/definitions/elements/input.less +1 -61
  183. package/src/definitions/elements/segment.less +0 -6
  184. package/src/definitions/globals/site.js +37 -56
  185. package/src/definitions/globals/site.less +2 -18
  186. package/src/definitions/modules/accordion.js +102 -141
  187. package/src/definitions/modules/calendar.js +313 -351
  188. package/src/definitions/modules/checkbox.js +84 -134
  189. package/src/definitions/modules/dimmer.js +60 -93
  190. package/src/definitions/modules/dimmer.less +0 -9
  191. package/src/definitions/modules/dropdown.js +735 -1054
  192. package/src/definitions/modules/dropdown.less +31 -47
  193. package/src/definitions/modules/embed.js +84 -113
  194. package/src/definitions/modules/flyout.js +225 -354
  195. package/src/definitions/modules/modal.js +260 -383
  196. package/src/definitions/modules/modal.less +1 -1
  197. package/src/definitions/modules/nag.js +67 -97
  198. package/src/definitions/modules/popup.js +197 -270
  199. package/src/definitions/modules/progress.js +108 -143
  200. package/src/definitions/modules/rating.js +90 -122
  201. package/src/definitions/modules/search.js +276 -378
  202. package/src/definitions/modules/search.less +0 -3
  203. package/src/definitions/modules/shape.js +157 -223
  204. package/src/definitions/modules/sidebar.js +123 -205
  205. package/src/definitions/modules/slider.js +245 -328
  206. package/src/definitions/modules/slider.less +1 -1
  207. package/src/definitions/modules/sticky.js +134 -179
  208. package/src/definitions/modules/tab.js +175 -243
  209. package/src/definitions/modules/toast.js +108 -146
  210. package/src/definitions/modules/toast.less +1 -1
  211. package/src/definitions/modules/transition.js +90 -145
  212. package/src/theme.less +0 -13
  213. package/src/themes/basic/elements/icon.variables +1 -1
  214. package/src/themes/default/collections/grid.variables +0 -30
  215. package/src/themes/default/collections/table.variables +1 -5
  216. package/src/themes/default/elements/icon.variables +3 -3
  217. package/src/themes/default/globals/site.variables +8 -15
  218. package/src/themes/default/globals/variation.variables +1 -2
  219. package/src/themes/default/modules/dropdown.variables +1 -0
  220. package/src/themes/default/modules/slider.variables +1 -1
  221. package/src/themes/github/elements/icon.variables +1 -1
  222. package/src/themes/material/elements/icon.variables +1 -1
  223. package/tasks/README.md +1 -1
  224. package/tasks/admin/components/create.js +89 -122
  225. package/tasks/admin/components/init.js +34 -65
  226. package/tasks/admin/components/update.js +50 -61
  227. package/tasks/admin/distributions/create.js +71 -111
  228. package/tasks/admin/distributions/init.js +32 -63
  229. package/tasks/admin/distributions/update.js +49 -57
  230. package/tasks/admin/publish.js +1 -1
  231. package/tasks/admin/register.js +14 -19
  232. package/tasks/admin/release.js +2 -2
  233. package/tasks/build/assets.js +14 -18
  234. package/tasks/build/css.js +59 -68
  235. package/tasks/build/javascript.js +48 -56
  236. package/tasks/build.js +4 -6
  237. package/tasks/check-install.js +5 -8
  238. package/tasks/clean.js +5 -7
  239. package/tasks/collections/admin.js +14 -16
  240. package/tasks/collections/build.js +6 -8
  241. package/tasks/collections/docs.js +4 -6
  242. package/tasks/collections/install.js +2 -4
  243. package/tasks/collections/rtl.js +2 -4
  244. package/tasks/collections/various.js +2 -4
  245. package/tasks/config/admin/github.js +9 -19
  246. package/tasks/config/admin/templates/README.md +2 -2
  247. package/tasks/config/admin/templates/bower.json +2 -4
  248. package/tasks/config/admin/templates/composer.json +1 -1
  249. package/tasks/config/admin/templates/css-package.js +1 -4
  250. package/tasks/config/admin/templates/less-package.js +1 -3
  251. package/tasks/config/defaults.js +0 -1
  252. package/tasks/config/npm/gulpfile.js +4 -6
  253. package/tasks/config/project/config.js +27 -35
  254. package/tasks/config/project/install.js +64 -82
  255. package/tasks/config/project/release.js +7 -9
  256. package/tasks/config/tasks.js +16 -30
  257. package/tasks/config/user.js +14 -20
  258. package/tasks/docs/build.js +26 -31
  259. package/tasks/docs/metadata.js +30 -39
  260. package/tasks/docs/serve.js +23 -27
  261. package/tasks/install.js +94 -128
  262. package/tasks/rtl/build.js +2 -4
  263. package/tasks/rtl/watch.js +3 -5
  264. package/tasks/watch.js +13 -13
  265. package/test/meteor/fonts.js +1 -2
  266. package/test/modules/module.spec.js +16 -18
  267. package/types/fomantic-ui-calendar.d.ts +1 -1
  268. package/types/fomantic-ui-dropdown.d.ts +45 -1
  269. package/types/fomantic-ui-embed.d.ts +1 -1
  270. package/types/fomantic-ui-flyout.d.ts +1 -1
  271. package/types/fomantic-ui-form.d.ts +0 -7
  272. package/types/fomantic-ui-modal.d.ts +1 -1
  273. package/types/fomantic-ui-search.d.ts +12 -6
  274. package/types/fomantic-ui-toast.d.ts +1 -1
  275. package/src/themes/basic/assets/fonts/icons.woff +0 -0
  276. package/src/themes/default/assets/fonts/Lato-Bold.woff +0 -0
  277. package/src/themes/default/assets/fonts/Lato-BoldItalic.woff +0 -0
  278. package/src/themes/default/assets/fonts/Lato-Italic.woff +0 -0
  279. package/src/themes/default/assets/fonts/Lato-Regular.woff +0 -0
  280. package/src/themes/default/assets/fonts/LatoLatin-Bold.woff +0 -0
  281. package/src/themes/default/assets/fonts/LatoLatin-BoldItalic.woff +0 -0
  282. package/src/themes/default/assets/fonts/LatoLatin-Italic.woff +0 -0
  283. package/src/themes/default/assets/fonts/LatoLatin-Regular.woff +0 -0
  284. package/src/themes/default/assets/fonts/brand-icons.woff +0 -0
  285. package/src/themes/default/assets/fonts/icons.woff +0 -0
  286. package/src/themes/default/assets/fonts/outline-icons.woff +0 -0
  287. package/src/themes/github/assets/fonts/octicons.woff +0 -0
  288. package/src/themes/material/assets/fonts/icons.woff +0 -0
@@ -3,7 +3,6 @@
3
3
  *******************************/
4
4
 
5
5
  @import "variation.variables";
6
- @supportIE: true;
7
6
 
8
7
  /* -------------------
9
8
  Fonts
@@ -44,7 +43,7 @@
44
43
  @fonts: {
45
44
  @regularLatin: {
46
45
  font-family: @fontName;
47
- src: url("@{fontPath}/@{fontFileNameLatin}-Regular.woff2") format("woff2") if(@supportIE, e(",") url("@{fontPath}/@{fontFileNameLatin}-Regular.woff") format("woff"));
46
+ src: url("@{fontPath}/@{fontFileNameLatin}-Regular.woff2") format("woff2");
48
47
  font-style: normal;
49
48
  font-weight: @normal;
50
49
  font-display: @fontDisplay;
@@ -53,7 +52,7 @@
53
52
  };
54
53
  @boldLatin: {
55
54
  font-family: @fontName;
56
- src: url("@{fontPath}/@{fontFileNameLatin}-Bold.woff2") format("woff2") if(@supportIE, e(",") url("@{fontPath}/@{fontFileNameLatin}-Bold.woff") format("woff"));
55
+ src: url("@{fontPath}/@{fontFileNameLatin}-Bold.woff2") format("woff2");
57
56
  font-style: normal;
58
57
  font-weight: @bold;
59
58
  font-display: @fontDisplay;
@@ -62,7 +61,7 @@
62
61
  };
63
62
  @italicLatin: {
64
63
  font-family: @fontName;
65
- src: url("@{fontPath}/@{fontFileNameLatin}-Italic.woff2") format("woff2") if(@supportIE, e(",") url("@{fontPath}/@{fontFileNameLatin}-Italic.woff") format("woff"));
64
+ src: url("@{fontPath}/@{fontFileNameLatin}-Italic.woff2") format("woff2");
66
65
  font-style: italic;
67
66
  font-weight: @normal;
68
67
  font-display: @fontDisplay;
@@ -71,7 +70,7 @@
71
70
  };
72
71
  @boldItalicLatin: {
73
72
  font-family: @fontName;
74
- src: url("@{fontPath}/@{fontFileNameLatin}-BoldItalic.woff2") format("woff2") if(@supportIE, e(",") url("@{fontPath}/@{fontFileNameLatin}-BoldItalic.woff") format("woff"));
73
+ src: url("@{fontPath}/@{fontFileNameLatin}-BoldItalic.woff2") format("woff2");
75
74
  font-style: italic;
76
75
  font-weight: @bold;
77
76
  font-display: @fontDisplay;
@@ -80,7 +79,7 @@
80
79
  };
81
80
  @regularSupplement: {
82
81
  font-family: @fontName;
83
- src: url("@{fontPath}/@{fontFileNameSupplement}-Regular.woff2") format("woff2") if(@supportIE, e(",") url("@{fontPath}/@{fontFileNameSupplement}-Regular.woff") format("woff"));
82
+ src: url("@{fontPath}/@{fontFileNameSupplement}-Regular.woff2") format("woff2");
84
83
  font-style: normal;
85
84
  font-weight: @normal;
86
85
  font-display: @fontDisplay;
@@ -89,7 +88,7 @@
89
88
  };
90
89
  @boldSupplement: {
91
90
  font-family: @fontName;
92
- src: url("@{fontPath}/@{fontFileNameSupplement}-Bold.woff2") format("woff2") if(@supportIE, e(",") url("@{fontPath}/@{fontFileNameSupplement}-Bold.woff") format("woff"));
91
+ src: url("@{fontPath}/@{fontFileNameSupplement}-Bold.woff2") format("woff2");
93
92
  font-style: normal;
94
93
  font-weight: @bold;
95
94
  font-display: @fontDisplay;
@@ -98,7 +97,7 @@
98
97
  };
99
98
  @italicSupplement: {
100
99
  font-family: @fontName;
101
- src: url("@{fontPath}/@{fontFileNameSupplement}-Italic.woff2") format("woff2") if(@supportIE, e(",") url("@{fontPath}/@{fontFileNameSupplement}-Italic.woff") format("woff"));
100
+ src: url("@{fontPath}/@{fontFileNameSupplement}-Italic.woff2") format("woff2");
102
101
  font-style: italic;
103
102
  font-weight: @normal;
104
103
  font-display: @fontDisplay;
@@ -107,7 +106,7 @@
107
106
  };
108
107
  @boldItalicSupplement: {
109
108
  font-family: @fontName;
110
- src: url("@{fontPath}/@{fontFileNameSupplement}-BoldItalic.woff2") format("woff2") if(@supportIE, e(",") url("@{fontPath}/@{fontFileNameSupplement}-BoldItalic.woff") format("woff"));
109
+ src: url("@{fontPath}/@{fontFileNameSupplement}-BoldItalic.woff2") format("woff2");
111
110
  font-style: italic;
112
111
  font-weight: @bold;
113
112
  font-display: @fontDisplay;
@@ -276,12 +275,6 @@
276
275
  @thumbInvertedInactiveBackground: rgba(255, 255, 255, 0.15);
277
276
  @thumbInvertedHoverBackground: rgba(255, 255, 255, 0.35);
278
277
 
279
- /* IE needs hex values */
280
- @trackBackgroundHex: #e6e6e6;
281
- @thumbBackgroundHex: #bfbfbf;
282
- @trackInvertedBackgroundHex: #323232;
283
- @thumbInvertedBackgroundHex: #656565;
284
-
285
278
  /* Scrolling */
286
279
  @scrollingMobileMaxHeight: 15em;
287
280
  @scrollingTabletMaxHeight: 18em;
@@ -293,7 +293,6 @@
293
293
 
294
294
  /* Grid */
295
295
  @variationGridInverted: true;
296
- @variationGridPage: true;
297
296
  @variationGridCelled: true;
298
297
  @variationGridCentered: true;
299
298
  @variationGridRelaxed: true;
@@ -790,7 +789,7 @@
790
789
 
791
790
  /* Emojis */
792
791
  @variationEmojiColons: true;
793
- @variationEmojiNoColons: true;
792
+ @variationEmojiNoColons: false;
794
793
  @variationEmojiDisabled: true;
795
794
  @variationEmojiLoading: true;
796
795
  @variationEmojiLink: true;
@@ -220,6 +220,7 @@
220
220
  @selectionVisibleIconOpacity: "";
221
221
 
222
222
  @selectionIconFocusOpacity: 1;
223
+ @actionIconFocusOpacity: ((@selectionIconFocusOpacity * 68) / 100);
223
224
 
224
225
  /* --------------
225
226
  Search
@@ -46,7 +46,7 @@
46
46
  -------------------- */
47
47
 
48
48
  /* Disabled */
49
- @disabledOpactiy: 0.5;
49
+ @disabledOpacity: 0.5;
50
50
  @disabledTrackFillColor: @background;
51
51
 
52
52
  /* -------------------
@@ -3,7 +3,7 @@
3
3
  @fonts: {
4
4
  @solid: {
5
5
  font-family: @fontName;
6
- src: url("@{fontPath}/@{fontName}.woff2") format("woff2") if(@supportIE, e(",") url("@{fontPath}/@{fontName}.woff") format("woff"));
6
+ src: url("@{fontPath}/@{fontName}.woff2") format("woff2");
7
7
  font-style: normal;
8
8
  font-weight: @normal;
9
9
  font-variant: normal;
@@ -2,7 +2,7 @@
2
2
  @fonts: {
3
3
  @solid: {
4
4
  font-family: @fontName;
5
- src: url("@{fontPath}/@{fontName}.woff2") format("woff2") if(@supportIE, e(",") url("@{fontPath}/@{fontName}.woff") format("woff"));
5
+ src: url("@{fontPath}/@{fontName}.woff2") format("woff2");
6
6
  font-style: normal;
7
7
  font-weight: @normal;
8
8
  font-variant: normal;
package/tasks/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  * Watch - Compile only changed files from source
4
4
  * Build - Build all files from source
5
5
  * Version - Output version number
6
- * Install - Run Installer to Set-up Paths
6
+ * Install - Run Installer to Set up Paths
7
7
 
8
8
  ## How to use
9
9
 
@@ -7,123 +7,102 @@
7
7
 
8
8
  * copy component files from release
9
9
  * create commonjs files as index.js for NPM release
10
- * create release notes that filter only items related to component
10
+ * create release notes that filter only items related to the component
11
11
  * custom package.json file from template
12
12
  * create bower.json from template
13
13
  * create README from template
14
14
  * create meteor.js file
15
15
  */
16
16
 
17
- const
18
- // node dependencies
19
- fs = require('fs'),
20
- path = require('path'),
21
- gulp = require('gulp'),
17
+ // node dependencies
18
+ const fs = require('node:fs');
19
+ const path = require('node:path');
20
+ const gulp = require('gulp');
22
21
 
23
- // admin dependencies
24
- concatFileNames = require('@fomantic/gulp-concat-filenames'),
25
- flatten = require('gulp-flatten'),
26
- jsonEditor = require('gulp-json-editor'),
27
- plumber = require('@fomantic/gulp-plumber'),
28
- rename = require('gulp-rename'),
29
- replace = require('gulp-replace'),
30
- tap = require('gulp-tap'),
22
+ // admin dependencies
23
+ const concatFileNames = require('@fomantic/gulp-concat-filenames');
24
+ const flatten = require('gulp-flatten');
25
+ const jsonEditor = require('gulp-json-editor');
26
+ const plumber = require('@fomantic/gulp-plumber');
27
+ const rename = require('gulp-rename');
28
+ const replace = require('gulp-replace');
29
+ const tap = require('gulp-tap');
31
30
 
32
- // config
33
- config = require('../../config/user'),
34
- release = require('../../config/admin/release'),
35
- project = require('../../config/project/release'),
31
+ // config
32
+ const config = require('../../config/user');
33
+ const release = require('../../config/admin/release');
34
+ const project = require('../../config/project/release');
36
35
 
37
- // shorthand
38
- version = project.version,
39
- output = config.paths.output
40
- ;
36
+ // shorthand
37
+ const version = project.version;
38
+ const output = config.paths.output;
41
39
 
42
40
  module.exports = function (callback) {
43
- let
44
- stream,
45
- index,
46
- tasks = []
47
- ;
41
+ let index;
42
+ let tasks = [];
48
43
 
49
44
  for (index in release.components) {
50
- let
51
- component = release.components[index]
52
- ;
45
+ let component = release.components[index];
53
46
 
54
47
  // streams... designed to save time and make coding fun...
55
48
  (function (component) {
56
- let
57
- outputDirectory = path.join(release.outputRoot, component),
58
- isJavascript = fs.existsSync(output.compressed + component + '.js'),
59
- isCSS = fs.existsSync(output.compressed + component + '.css'),
60
- capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1),
61
- packageName = release.packageRoot + component,
62
- repoName = release.componentRepoRoot + capitalizedComponent,
63
- gitURL = 'https://github.com/' + release.org + '/' + repoName + '.git',
64
- repoURL = 'https://github.com/' + release.org + '/' + repoName + '/',
65
- concatSettings = {
66
- newline: '',
67
- root: outputDirectory,
68
- prepend: " '",
69
- append: "',",
49
+ let outputDirectory = path.join(release.outputRoot, component);
50
+ let isJavascript = fs.existsSync(output.compressed + component + '.js');
51
+ let isCSS = fs.existsSync(output.compressed + component + '.css');
52
+ let capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1);
53
+ let packageName = release.packageRoot + component;
54
+ let repoName = release.componentRepoRoot + capitalizedComponent;
55
+ let gitURL = 'https://github.com/' + release.org + '/' + repoName + '.git';
56
+ let concatSettings = {
57
+ newline: '',
58
+ root: outputDirectory,
59
+ prepend: " '",
60
+ append: "',",
61
+ };
62
+ let regExp = {
63
+ match: {
64
+ // templated values
65
+ name: '{component}',
66
+ titleName: '{Component}',
67
+ version: '{version}',
68
+ files: '{files}',
69
+ // release notes
70
+ spacedVersions: /(###.*\n)\n+(?=###)/gm,
71
+ spacedLists: /(^- .*\n)\n+(?=^-)/gm,
72
+ trim: /^\s+|\s+$/g,
73
+ unrelatedNotes: new RegExp('^((?!(^.*(' + component + ').*$|###.*)).)*$', 'gmi'),
74
+ whitespace: /\n\s*\n\s*\n/gm,
75
+ // npm
76
+ componentExport: /(.*)\$\.fn\.\w+\s*=\s*function\(([^)]*)\)\s*{/g,
77
+ componentReference: '$.fn.' + component,
78
+ settingsExport: /\$\.fn\.\w+\.settings\s*=/g,
79
+ settingsReference: /\$\.fn\.\w+\.settings/g,
80
+ trailingComma: /,(?=[^,]*$)/,
81
+ jQuery: /jQuery/g,
70
82
  },
71
- regExp = {
72
- match: {
73
- // templated values
74
- name: '{component}',
75
- titleName: '{Component}',
76
- version: '{version}',
77
- files: '{files}',
78
- // release notes
79
- spacedVersions: /(###.*\n)\n+(?=###)/gm,
80
- spacedLists: /(^- .*\n)\n+(?=^-)/gm,
81
- trim: /^\s+|\s+$/g,
82
- unrelatedNotes: new RegExp('^((?!(^.*(' + component + ').*$|###.*)).)*$', 'gmi'),
83
- whitespace: /\n\s*\n\s*\n/gm,
84
- // npm
85
- componentExport: /(.*)\$\.fn\.\w+\s*=\s*function\(([^)]*)\)\s*{/g,
86
- componentReference: '$.fn.' + component,
87
- settingsExport: /\$\.fn\.\w+\.settings\s*=/g,
88
- settingsReference: /\$\.fn\.\w+\.settings/g,
89
- trailingComma: /,(?=[^,]*$)/,
90
- jQuery: /jQuery/g,
91
- },
92
- replace: {
93
- // readme
94
- name: component,
95
- titleName: capitalizedComponent,
96
- // release notes
97
- spacedVersions: '',
98
- spacedLists: '$1',
99
- trim: '',
100
- unrelatedNotes: '',
101
- whitespace: '\n\n',
102
- // npm
103
- componentExport: 'var _module = module;\n$1module.exports = function($2) {',
104
- componentReference: '_module.exports',
105
- settingsExport: 'module.exports.settings =',
106
- settingsReference: '_module.exports.settings',
107
- jQuery: 'require("jquery")',
108
- },
83
+ replace: {
84
+ // readme
85
+ name: component,
86
+ titleName: capitalizedComponent,
87
+ // release notes
88
+ spacedVersions: '',
89
+ spacedLists: '$1',
90
+ trim: '',
91
+ unrelatedNotes: '',
92
+ whitespace: '\n\n',
93
+ // npm
94
+ componentExport: 'var _module = module;\n$1module.exports = function($2) {',
95
+ componentReference: '_module.exports',
96
+ settingsExport: 'module.exports.settings =',
97
+ settingsReference: '_module.exports.settings',
98
+ jQuery: 'require("jquery")',
109
99
  },
110
- task = {
111
- all: component + ' creating',
112
- repo: component + ' create repo',
113
- bower: component + ' create bower.json',
114
- readme: component + ' create README',
115
- npm: component + ' create NPM Module',
116
- notes: component + ' create release notes',
117
- composer: component + ' create composer.json',
118
- package: component + ' create package.json',
119
- meteor: component + ' create meteor package.js',
120
- },
121
- // paths to includable assets
122
- manifest = {
123
- assets: outputDirectory + '/assets/**/' + component + '?(s).*',
124
- component: outputDirectory + '/' + component + '+(.js|.css)',
125
- }
126
- ;
100
+ };
101
+ // paths to includable assets
102
+ let manifest = {
103
+ assets: outputDirectory + '/assets/**/' + component + '?(s).*',
104
+ component: outputDirectory + '/' + component + '+(.js|.css)',
105
+ };
127
106
 
128
107
  // copy dist files into output folder adjusting asset paths
129
108
  function copyDist() {
@@ -131,8 +110,7 @@ module.exports = function (callback) {
131
110
  .pipe(plumber())
132
111
  .pipe(flatten())
133
112
  .pipe(replace(release.paths.source, release.paths.output))
134
- .pipe(gulp.dest(outputDirectory))
135
- ;
113
+ .pipe(gulp.dest(outputDirectory));
136
114
  }
137
115
 
138
116
  // create npm module
@@ -146,8 +124,7 @@ module.exports = function (callback) {
146
124
  .pipe(replace(regExp.match.settingsReference, regExp.replace.settingsReference))
147
125
  .pipe(replace(regExp.match.jQuery, regExp.replace.jQuery))
148
126
  .pipe(rename('index.js'))
149
- .pipe(gulp.dest(outputDirectory))
150
- ;
127
+ .pipe(gulp.dest(outputDirectory));
151
128
  }
152
129
 
153
130
  // create readme
@@ -157,8 +134,7 @@ module.exports = function (callback) {
157
134
  .pipe(flatten())
158
135
  .pipe(replace(regExp.match.name, regExp.replace.name))
159
136
  .pipe(replace(regExp.match.titleName, regExp.replace.titleName))
160
- .pipe(gulp.dest(outputDirectory))
161
- ;
137
+ .pipe(gulp.dest(outputDirectory));
162
138
  }
163
139
 
164
140
  // extend bower.json
@@ -184,8 +160,7 @@ module.exports = function (callback) {
184
160
 
185
161
  return bower;
186
162
  }))
187
- .pipe(gulp.dest(outputDirectory))
188
- ;
163
+ .pipe(gulp.dest(outputDirectory));
189
164
  }
190
165
 
191
166
  // extend package.json
@@ -213,8 +188,7 @@ module.exports = function (callback) {
213
188
 
214
189
  return npm;
215
190
  }))
216
- .pipe(gulp.dest(outputDirectory))
217
- ;
191
+ .pipe(gulp.dest(outputDirectory));
218
192
  }
219
193
 
220
194
  // extend composer.json
@@ -237,8 +211,7 @@ module.exports = function (callback) {
237
211
 
238
212
  return composer;
239
213
  }))
240
- .pipe(gulp.dest(outputDirectory))
241
- ;
214
+ .pipe(gulp.dest(outputDirectory));
242
215
  }
243
216
 
244
217
  // create release notes
@@ -252,15 +225,12 @@ module.exports = function (callback) {
252
225
  .pipe(replace(regExp.match.spacedVersions, regExp.replace.spacedVersions))
253
226
  .pipe(replace(regExp.match.spacedLists, regExp.replace.spacedLists))
254
227
  .pipe(replace(regExp.match.trim, regExp.replace.trim))
255
- .pipe(gulp.dest(outputDirectory))
256
- ;
228
+ .pipe(gulp.dest(outputDirectory));
257
229
  }
258
230
 
259
231
  // Creates meteor package.js
260
232
  function createMeteorPackage() {
261
- let
262
- filenames = ''
263
- ;
233
+ let filenames = '';
264
234
 
265
235
  return gulp.src(manifest.component)
266
236
  .pipe(concatFileNames('empty.txt', concatSettings))
@@ -284,12 +254,9 @@ module.exports = function (callback) {
284
254
  .pipe(replace(regExp.match.version, version))
285
255
  .pipe(replace(regExp.match.files, filenames))
286
256
  .pipe(rename(release.files.meteor))
287
- .pipe(gulp.dest(outputDirectory))
288
- ;
289
- })
290
- ;
291
- })
292
- ;
257
+ .pipe(gulp.dest(outputDirectory));
258
+ });
259
+ });
293
260
  }
294
261
 
295
262
  tasks.push(gulp.series(
@@ -6,45 +6,31 @@
6
6
 
7
7
  This task pulls the latest version of each component from GitHub
8
8
 
9
- * Creates new repo if doesn't exist (locally & GitHub)
10
- * Adds remote it doesn't exists
9
+ * Creates new repo if it doesn't exist (locally & GitHub)
10
+ * Adds remote if it doesn't exist
11
11
  * Pulls latest changes from repo
12
12
 
13
13
  */
14
14
 
15
- const
16
- // node dependencies
17
- fs = require('fs'),
18
- path = require('path'),
19
- del = require('del'),
20
- console = require('@fomantic/better-console'),
21
- gulp = require('gulp'),
22
- git = require('@fomantic/gulp-git'),
23
- mkdirp = require('mkdirp'),
24
-
25
- // admin files
26
- release = require('../../config/admin/release'),
27
- project = require('../../config/project/release'),
28
-
29
- // oAuth configuration for GitHub
30
- oAuth = fs.existsSync(path.join(__dirname, '/../../config/admin/oauth.js'))
31
- ? require('../../config/admin/oauth.js') // eslint-disable-line import/extensions
32
- : false,
33
-
34
- // shorthand
35
- version = project.version
36
- ;
15
+ // node dependencies
16
+ const fs = require('fs-extra');
17
+ const path = require('node:path');
18
+ const console = require('@fomantic/better-console');
19
+ const git = require('@fomantic/gulp-git');
37
20
 
38
- module.exports = function (callback) {
39
- const github = require('../../config/admin/github'); // eslint-disable-line global-require
21
+ // admin files
22
+ const release = require('../../config/admin/release');
23
+
24
+ // oAuth configuration for GitHub
25
+ const oAuth = fs.pathExistsSync(path.join(__dirname, '/../../config/admin/oauth.js'))
26
+ ? require('../../config/admin/oauth.js') // eslint-disable-line import/extensions
27
+ : false;
40
28
 
41
- let
42
- index = -1,
43
- total = release.components.length,
44
- timer,
45
- stream,
46
- stepRepo
47
- ;
29
+ module.exports = function (callback) {
30
+ let index = -1;
31
+ let total = release.components.length;
32
+ let timer;
33
+ let stepRepo;
48
34
 
49
35
  if (!oAuth) {
50
36
  console.error('Must add oauth token for GitHub in tasks/config/admin/oauth.js');
@@ -52,7 +38,7 @@ module.exports = function (callback) {
52
38
  return;
53
39
  }
54
40
 
55
- // Do Git commands synchronously per component, to avoid issues
41
+ // Do Git commands synchronously per component to avoid issues
56
42
  stepRepo = function () {
57
43
  index += 1;
58
44
 
@@ -62,32 +48,27 @@ module.exports = function (callback) {
62
48
  return;
63
49
  }
64
50
 
65
- let
66
- component = release.components[index],
67
- outputDirectory = path.resolve(release.outputRoot + component),
68
- capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1),
69
- repoName = release.componentRepoRoot + capitalizedComponent,
51
+ let component = release.components[index];
52
+ let outputDirectory = path.resolve(release.outputRoot + component);
53
+ let capitalizedComponent = component.charAt(0).toUpperCase() + component.slice(1);
54
+ let repoName = release.componentRepoRoot + capitalizedComponent;
70
55
 
71
- gitOptions = { cwd: outputDirectory },
72
- pullOptions = { args: '-q', cwd: outputDirectory, quiet: true },
73
- resetOptions = { args: '-q --hard', cwd: outputDirectory, quiet: true },
56
+ let gitOptions = { cwd: outputDirectory };
57
+ let pullOptions = { args: '-q', cwd: outputDirectory, quiet: true };
58
+ let resetOptions = { args: '-q --hard', cwd: outputDirectory, quiet: true };
74
59
 
75
- gitURL = 'git@github.com:' + release.org + '/' + repoName + '.git',
76
- repoURL = 'https://github.com/' + release.org + '/' + repoName + '/',
77
- localRepoSetup = fs.existsSync(path.join(outputDirectory, '.git'))
78
- ;
60
+ let gitURL = 'git@github.com:' + release.org + '/' + repoName + '.git';
61
+ let localRepoSetup = fs.pathExistsSync(path.join(outputDirectory, '.git'));
79
62
 
80
63
  console.log('Processing repository: ' + outputDirectory);
81
64
 
82
- // create folder if doesn't exist
83
- if (!fs.existsSync(outputDirectory)) {
84
- mkdirp.sync(outputDirectory);
85
- }
65
+ // create folder if it doesn't exist
66
+ fs.ensureDirSync(outputDirectory);
86
67
 
87
68
  // clean folder
88
69
  if (release.outputRoot.startsWith('../repos')) {
89
70
  console.info('Cleaning dir', outputDirectory);
90
- del.sync([outputDirectory + '**/*'], { silent: true, force: true });
71
+ fs.removeSync(outputDirectory);
91
72
  }
92
73
 
93
74
  // set-up local repo
@@ -109,17 +90,6 @@ module.exports = function (callback) {
109
90
  });
110
91
  }
111
92
 
112
- function createRepo() {
113
- console.info('Creating GitHub repo ' + repoURL);
114
- github.repos.createFromOrg({
115
- org: release.org,
116
- name: repoName,
117
- homepage: release.homepage,
118
- }, function () {
119
- setupRepo();
120
- });
121
- }
122
-
123
93
  function addRemote() {
124
94
  console.info('Adding remote origin as ' + gitURL);
125
95
  git.addRemote('origin', gitURL, gitOptions, function () {
@@ -129,14 +99,14 @@ module.exports = function (callback) {
129
99
 
130
100
  function pullFiles() {
131
101
  console.info('Pulling ' + component + ' files');
132
- git.pull('origin', 'master', pullOptions, function (error) {
102
+ git.pull('origin', 'master', pullOptions, function () {
133
103
  resetFiles();
134
104
  });
135
105
  }
136
106
 
137
107
  function resetFiles() {
138
108
  console.info('Resetting files to head');
139
- git.reset('HEAD', resetOptions, function (error) {
109
+ git.reset('HEAD', resetOptions, function () {
140
110
  nextRepo();
141
111
  });
142
112
  }
@@ -154,7 +124,6 @@ module.exports = function (callback) {
154
124
  pullFiles();
155
125
  } else {
156
126
  setupRepo();
157
- // createRepo() only use to create remote repo (easier to do manually)
158
127
  }
159
128
  };
160
129