@hexonet/semantic-release-whmcs 3.1.0 → 3.1.3

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 (33) hide show
  1. package/.eslintrc.js +13 -12
  2. package/.github/workflows/pull-request.yml +12 -10
  3. package/.github/workflows/push.yml +28 -16
  4. package/HISTORY.md +22 -0
  5. package/{base.css → coverage/base.css} +0 -0
  6. package/{block-navigation.js → coverage/block-navigation.js} +8 -0
  7. package/{coverage-final.json → coverage/coverage-final.json} +8 -8
  8. package/{favicon.png → coverage/favicon.png} +0 -0
  9. package/{index.html → coverage/index.html} +20 -15
  10. package/{lib → coverage/lib}/definitions/errors.js.html +21 -7
  11. package/{lib → coverage/lib}/definitions/index.html +8 -3
  12. package/{lib → coverage/lib}/delete-marketplace-version.js.html +10 -5
  13. package/{lib → coverage/lib}/get-error.js.html +9 -4
  14. package/{lib → coverage/lib}/get-github-releases.js.html +8 -3
  15. package/{lib → coverage/lib}/index.html +24 -19
  16. package/{lib → coverage/lib}/publish.js.html +83 -21
  17. package/{lib → coverage/lib}/puppet.js.html +12 -7
  18. package/{lib → coverage/lib}/resolve-config.js.html +9 -4
  19. package/{lib → coverage/lib}/scrape-marketplace-versions.js.html +8 -3
  20. package/{lib → coverage/lib}/set-compatible-versions.js.html +10 -5
  21. package/{lib → coverage/lib}/verify.js.html +12 -7
  22. package/{prettify.css → coverage/prettify.css} +0 -0
  23. package/{prettify.js → coverage/prettify.js} +0 -0
  24. package/{sort-arrow-sprite.png → coverage/sort-arrow-sprite.png} +0 -0
  25. package/{sorter.js → coverage/sorter.js} +26 -0
  26. package/lib/definitions/errors.js +6 -3
  27. package/lib/get-error.js +1 -1
  28. package/lib/publish.js +37 -18
  29. package/lib/verify.js +1 -1
  30. package/package.json +18 -19
  31. package/whmcs.js +0 -1
  32. package/test/publish.test.js +0 -83
  33. package/test/verify.test.js +0 -59
@@ -30,7 +30,7 @@
30
30
 
31
31
 
32
32
  <div class='fl pad1y space-right2'>
33
- <span class="strong">71.43% </span>
33
+ <span class="strong">71.42% </span>
34
34
  <span class="quiet">Branches</span>
35
35
  <span class='fraction'>10/14</span>
36
36
  </div>
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line high'></div>
59
65
  <pre><table class="coverage">
@@ -174,7 +180,26 @@
174
180
  <a name='L115'></a><a href='#L115'>115</a>
175
181
  <a name='L116'></a><a href='#L116'>116</a>
176
182
  <a name='L117'></a><a href='#L117'>117</a>
177
- <a name='L118'></a><a href='#L118'>118</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
183
+ <a name='L118'></a><a href='#L118'>118</a>
184
+ <a name='L119'></a><a href='#L119'>119</a>
185
+ <a name='L120'></a><a href='#L120'>120</a>
186
+ <a name='L121'></a><a href='#L121'>121</a>
187
+ <a name='L122'></a><a href='#L122'>122</a>
188
+ <a name='L123'></a><a href='#L123'>123</a>
189
+ <a name='L124'></a><a href='#L124'>124</a>
190
+ <a name='L125'></a><a href='#L125'>125</a>
191
+ <a name='L126'></a><a href='#L126'>126</a>
192
+ <a name='L127'></a><a href='#L127'>127</a>
193
+ <a name='L128'></a><a href='#L128'>128</a>
194
+ <a name='L129'></a><a href='#L129'>129</a>
195
+ <a name='L130'></a><a href='#L130'>130</a>
196
+ <a name='L131'></a><a href='#L131'>131</a>
197
+ <a name='L132'></a><a href='#L132'>132</a>
198
+ <a name='L133'></a><a href='#L133'>133</a>
199
+ <a name='L134'></a><a href='#L134'>134</a>
200
+ <a name='L135'></a><a href='#L135'>135</a>
201
+ <a name='L136'></a><a href='#L136'>136</a>
202
+ <a name='L137'></a><a href='#L137'>137</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
178
203
  <span class="cline-any cline-yes">1x</span>
179
204
  <span class="cline-any cline-yes">1x</span>
180
205
  <span class="cline-any cline-yes">1x</span>
@@ -193,7 +218,10 @@
193
218
  <span class="cline-any cline-no">&nbsp;</span>
194
219
  <span class="cline-any cline-neutral">&nbsp;</span>
195
220
  <span class="cline-any cline-neutral">&nbsp;</span>
221
+ <span class="cline-any cline-neutral">&nbsp;</span>
222
+ <span class="cline-any cline-neutral">&nbsp;</span>
196
223
  <span class="cline-any cline-yes">3x</span>
224
+ <span class="cline-any cline-neutral">&nbsp;</span>
197
225
  <span class="cline-any cline-yes">3x</span>
198
226
  <span class="cline-any cline-yes">3x</span>
199
227
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -207,6 +235,7 @@
207
235
  <span class="cline-any cline-neutral">&nbsp;</span>
208
236
  <span class="cline-any cline-neutral">&nbsp;</span>
209
237
  <span class="cline-any cline-yes">3x</span>
238
+ <span class="cline-any cline-neutral">&nbsp;</span>
210
239
  <span class="cline-any cline-yes">3x</span>
211
240
  <span class="cline-any cline-yes">3x</span>
212
241
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -246,6 +275,10 @@
246
275
  <span class="cline-any cline-neutral">&nbsp;</span>
247
276
  <span class="cline-any cline-neutral">&nbsp;</span>
248
277
  <span class="cline-any cline-neutral">&nbsp;</span>
278
+ <span class="cline-any cline-neutral">&nbsp;</span>
279
+ <span class="cline-any cline-neutral">&nbsp;</span>
280
+ <span class="cline-any cline-neutral">&nbsp;</span>
281
+ <span class="cline-any cline-neutral">&nbsp;</span>
249
282
  <span class="cline-any cline-yes">1x</span>
250
283
  <span class="cline-any cline-neutral">&nbsp;</span>
251
284
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -257,6 +290,10 @@
257
290
  <span class="cline-any cline-neutral">&nbsp;</span>
258
291
  <span class="cline-any cline-neutral">&nbsp;</span>
259
292
  <span class="cline-any cline-neutral">&nbsp;</span>
293
+ <span class="cline-any cline-neutral">&nbsp;</span>
294
+ <span class="cline-any cline-neutral">&nbsp;</span>
295
+ <span class="cline-any cline-neutral">&nbsp;</span>
296
+ <span class="cline-any cline-neutral">&nbsp;</span>
260
297
  <span class="cline-any cline-yes">1x</span>
261
298
  <span class="cline-any cline-neutral">&nbsp;</span>
262
299
  <span class="cline-any cline-yes">1x</span>
@@ -264,6 +301,10 @@
264
301
  <span class="cline-any cline-neutral">&nbsp;</span>
265
302
  <span class="cline-any cline-neutral">&nbsp;</span>
266
303
  <span class="cline-any cline-neutral">&nbsp;</span>
304
+ <span class="cline-any cline-neutral">&nbsp;</span>
305
+ <span class="cline-any cline-neutral">&nbsp;</span>
306
+ <span class="cline-any cline-neutral">&nbsp;</span>
307
+ <span class="cline-any cline-neutral">&nbsp;</span>
267
308
  <span class="cline-any cline-yes">1x</span>
268
309
  <span class="cline-any cline-yes">1x</span>
269
310
  <span class="cline-any cline-yes">1x</span>
@@ -278,6 +319,9 @@
278
319
  <span class="cline-any cline-neutral">&nbsp;</span>
279
320
  <span class="cline-any cline-no">&nbsp;</span>
280
321
  <span class="cline-any cline-no">&nbsp;</span>
322
+ <span class="cline-any cline-neutral">&nbsp;</span>
323
+ <span class="cline-any cline-neutral">&nbsp;</span>
324
+ <span class="cline-any cline-neutral">&nbsp;</span>
281
325
  <span class="cline-any cline-no">&nbsp;</span>
282
326
  <span class="cline-any cline-neutral">&nbsp;</span>
283
327
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -307,11 +351,14 @@ module.exports = async (pluginConfig, context) =&gt; {
307
351
  &nbsp;
308
352
  <span class="missing-if-branch" title="if path not taken" >I</span>if (!notes || !notes.length || !version || !version.length) {
309
353
  <span class="cstat-no" title="statement not covered" > debug('publishing new product version failed. No input data available.')</span>
310
- <span class="cstat-no" title="statement not covered" > logger.error('WHMCS Marketplace publishing new product version failed. No input data available.')</span>
354
+ <span class="cstat-no" title="statement not covered" > logger.error(</span>
355
+ 'WHMCS Marketplace publishing new product version failed. No input data available.'
356
+ )
311
357
  }
312
358
  &nbsp;
313
359
  let success = true
314
- const { whmcsLOGIN, whmcsPASSWORD, whmcsPRODUCTID, DEBUG } = resolveConfig(context)
360
+ const { whmcsLOGIN, whmcsPASSWORD, whmcsPRODUCTID, DEBUG } =
361
+ resolveConfig(context)
315
362
  const { gotoOpts, navOpts, selectorOpts, page } = await puppet(DEBUG, logger)
316
363
  &nbsp;
317
364
  debug(`WHMCS Marketplace Product ID: ${whmcsPRODUCTID}`)
@@ -322,8 +369,9 @@ module.exports = async (pluginConfig, context) =&gt; {
322
369
  debug(`Notes: ${notes}`)
323
370
  logger.log(`Release Notes: ${notes}`)
324
371
  &nbsp;
325
- // strip markdown links from notes as not allowed to keep
326
- const cleanedNotes = notes.replace(/\[(.*?)\]\((.+?)\)/gm, '$1')
372
+ // strip markdown links from notes as not allowed to keep (taken from remove-markdown and cleaned up)
373
+ const cleanedNotes = notes.replace(/\[([^[\]]*)\]\([^()]*\)/gm, '$1')
374
+ &nbsp;
327
375
  const wmbase = 'https://marketplace.whmcs.com'
328
376
  let url = `${wmbase}/user/login`
329
377
  &nbsp;
@@ -360,27 +408,39 @@ module.exports = async (pluginConfig, context) =&gt; {
360
408
  await page.waitForSelector(selector, selectorOpts)
361
409
  debug('product page submit button selector found')
362
410
  /* istanbul ignore next */
363
- await page.$eval('#version', (el, value) =&gt; {
364
- el.value = value
365
- }, version)
411
+ await page.$eval(
412
+ '#version',
413
+ (el, value) =&gt; {
414
+ el.value = value
415
+ },
416
+ version
417
+ )
366
418
  debug('form input for version finished.')
367
419
  &nbsp;
368
420
  // fill input type date with localized string
369
421
  // https://www.mattzeunert.com/2020/04/01/filling-out-a-date-input-with-puppeteer.html
370
422
  const date = releaseDate ? <span class="branch-0 cbranch-no" title="branch not covered" >new Date(releaseDate) </span>: new Date()
371
423
  /* istanbul ignore next */
372
- const dateString = await page.evaluate(d =&gt; new Date(d).toLocaleDateString(navigator.language, {
373
- day: '2-digit',
374
- month: '2-digit',
375
- year: 'numeric'
376
- }), date.toISOString())
424
+ const dateString = await page.evaluate(
425
+ (d) =&gt;
426
+ new Date(d).toLocaleDateString(navigator.language, {
427
+ day: '2-digit',
428
+ month: '2-digit',
429
+ year: 'numeric'
430
+ }),
431
+ date.toISOString()
432
+ )
377
433
  await page.type('#released_at', dateString)
378
434
  &nbsp;
379
435
  debug('form input for released_at finished.')
380
436
  /* istanbul ignore next */
381
- await page.$eval('#description', (el, value) =&gt; {
382
- el.value = value
383
- }, cleanedNotes)
437
+ await page.$eval(
438
+ '#description',
439
+ (el, value) =&gt; {
440
+ el.value = value
441
+ },
442
+ cleanedNotes
443
+ )
384
444
  debug('form input for description finished.')
385
445
  const nav = page.waitForNavigation(navOpts)
386
446
  await page.hover(selector)
@@ -394,7 +454,10 @@ module.exports = async (pluginConfig, context) =&gt; {
394
454
  success = true
395
455
  } catch (error) {
396
456
  <span class="cstat-no" title="statement not covered" > debug('publishing new product version failed.', error.message)</span>
397
- <span class="cstat-no" title="statement not covered" > logger.error('WHMCS Marketplace publishing new product version failed.', error.message)</span>
457
+ <span class="cstat-no" title="statement not covered" > logger.error(</span>
458
+ 'WHMCS Marketplace publishing new product version failed.',
459
+ error.message
460
+ )
398
461
  <span class="cstat-no" title="statement not covered" > success = false</span>
399
462
  }
400
463
  }
@@ -414,10 +477,9 @@ module.exports = async (pluginConfig, context) =&gt; {
414
477
  </div><!-- /wrapper -->
415
478
  <div class='footer quiet pad2 space-top1 center small'>
416
479
  Code coverage generated by
417
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
418
- at Wed May 19 2021 12:08:32 GMT+0000 (Coordinated Universal Time)
480
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
481
+ at Wed Jun 08 2022 11:13:31 GMT+0000 (Coordinated Universal Time)
419
482
  </div>
420
- </div>
421
483
  <script src="../prettify.js"></script>
422
484
  <script>
423
485
  window.onload = function () {
@@ -30,7 +30,7 @@
30
30
 
31
31
 
32
32
  <div class='fl pad1y space-right2'>
33
- <span class="strong">66.67% </span>
33
+ <span class="strong">66.66% </span>
34
34
  <span class="quiet">Branches</span>
35
35
  <span class='fraction'>4/6</span>
36
36
  </div>
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line medium'></div>
59
65
  <pre><table class="coverage">
@@ -156,10 +162,10 @@
156
162
  <span class="cline-any cline-neutral">&nbsp;</span>
157
163
  <span class="cline-any cline-yes">5x</span>
158
164
  <span class="cline-any cline-yes">5x</span>
159
- <span class="cline-any cline-yes">441x</span>
160
- <span class="cline-any cline-yes">205x</span>
165
+ <span class="cline-any cline-yes">336x</span>
166
+ <span class="cline-any cline-yes">223x</span>
161
167
  <span class="cline-any cline-neutral">&nbsp;</span>
162
- <span class="cline-any cline-yes">236x</span>
168
+ <span class="cline-any cline-yes">113x</span>
163
169
  <span class="cline-any cline-neutral">&nbsp;</span>
164
170
  <span class="cline-any cline-neutral">&nbsp;</span>
165
171
  <span class="cline-any cline-yes">5x</span>
@@ -249,10 +255,9 @@ module.exports = async (DEBUG, logger) =&gt; {
249
255
  </div><!-- /wrapper -->
250
256
  <div class='footer quiet pad2 space-top1 center small'>
251
257
  Code coverage generated by
252
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
253
- at Wed May 19 2021 12:08:32 GMT+0000 (Coordinated Universal Time)
258
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
259
+ at Wed Jun 08 2022 11:13:31 GMT+0000 (Coordinated Universal Time)
254
260
  </div>
255
- </div>
256
261
  <script src="../prettify.js"></script>
257
262
  <script>
258
263
  window.onload = function () {
@@ -30,7 +30,7 @@
30
30
 
31
31
 
32
32
  <div class='fl pad1y space-right2'>
33
- <span class="strong">94.12% </span>
33
+ <span class="strong">94.11% </span>
34
34
  <span class="quiet">Branches</span>
35
35
  <span class='fraction'>16/17</span>
36
36
  </div>
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line high'></div>
59
65
  <pre><table class="coverage">
@@ -90,10 +96,9 @@
90
96
  </div><!-- /wrapper -->
91
97
  <div class='footer quiet pad2 space-top1 center small'>
92
98
  Code coverage generated by
93
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
94
- at Wed May 19 2021 12:08:32 GMT+0000 (Coordinated Universal Time)
99
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
100
+ at Wed Jun 08 2022 11:13:31 GMT+0000 (Coordinated Universal Time)
95
101
  </div>
96
- </div>
97
102
  <script src="../prettify.js"></script>
98
103
  <script>
99
104
  window.onload = function () {
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line low'></div>
59
65
  <pre><table class="coverage">
@@ -300,10 +306,9 @@ const puppet = <span class="cstat-no" title="statement not covered" >require('./
300
306
  </div><!-- /wrapper -->
301
307
  <div class='footer quiet pad2 space-top1 center small'>
302
308
  Code coverage generated by
303
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
304
- at Wed May 19 2021 12:08:32 GMT+0000 (Coordinated Universal Time)
309
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
310
+ at Wed Jun 08 2022 11:13:31 GMT+0000 (Coordinated Universal Time)
305
311
  </div>
306
- </div>
307
312
  <script src="../prettify.js"></script>
308
313
  <script>
309
314
  window.onload = function () {
@@ -23,7 +23,7 @@
23
23
  <div class='clearfix'>
24
24
 
25
25
  <div class='fl pad1y space-right2'>
26
- <span class="strong">87.04% </span>
26
+ <span class="strong">87.03% </span>
27
27
  <span class="quiet">Statements</span>
28
28
  <span class='fraction'>47/54</span>
29
29
  </div>
@@ -44,7 +44,7 @@
44
44
 
45
45
 
46
46
  <div class='fl pad1y space-right2'>
47
- <span class="strong">87.04% </span>
47
+ <span class="strong">87.03% </span>
48
48
  <span class="quiet">Lines</span>
49
49
  <span class='fraction'>47/54</span>
50
50
  </div>
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line high'></div>
59
65
  <pre><table class="coverage">
@@ -354,10 +360,9 @@ module.exports = async (pluginConfig, context) =&gt; {
354
360
  </div><!-- /wrapper -->
355
361
  <div class='footer quiet pad2 space-top1 center small'>
356
362
  Code coverage generated by
357
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
358
- at Wed May 19 2021 12:08:32 GMT+0000 (Coordinated Universal Time)
363
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
364
+ at Wed Jun 08 2022 11:13:31 GMT+0000 (Coordinated Universal Time)
359
365
  </div>
360
- </div>
361
366
  <script src="../prettify.js"></script>
362
367
  <script>
363
368
  window.onload = function () {
@@ -25,7 +25,7 @@
25
25
  <div class='fl pad1y space-right2'>
26
26
  <span class="strong">100% </span>
27
27
  <span class="quiet">Statements</span>
28
- <span class='fraction'>13/13</span>
28
+ <span class='fraction'>14/14</span>
29
29
  </div>
30
30
 
31
31
 
@@ -46,7 +46,7 @@
46
46
  <div class='fl pad1y space-right2'>
47
47
  <span class="strong">100% </span>
48
48
  <span class="quiet">Lines</span>
49
- <span class='fraction'>13/13</span>
49
+ <span class='fraction'>14/14</span>
50
50
  </div>
51
51
 
52
52
 
@@ -54,6 +54,12 @@
54
54
  <p class="quiet">
55
55
  Press <em>n</em> or <em>j</em> to go to the next uncovered block, <em>b</em>, <em>p</em> or <em>k</em> for the previous block.
56
56
  </p>
57
+ <template id="filterTemplate">
58
+ <div class="quiet">
59
+ Filter:
60
+ <input oninput="onInput()" type="search" id="fileSearch">
61
+ </div>
62
+ </template>
57
63
  </div>
58
64
  <div class='status-line high'></div>
59
65
  <pre><table class="coverage">
@@ -77,7 +83,7 @@
77
83
  <a name='L18'></a><a href='#L18'>18</a>
78
84
  <a name='L19'></a><a href='#L19'>19</a>
79
85
  <a name='L20'></a><a href='#L20'>20</a>
80
- <a name='L21'></a><a href='#L21'>21</a></td><td class="line-coverage quiet"><span class="cline-any cline-neutral">&nbsp;</span>
86
+ <a name='L21'></a><a href='#L21'>21</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
81
87
  <span class="cline-any cline-yes">1x</span>
82
88
  <span class="cline-any cline-yes">1x</span>
83
89
  <span class="cline-any cline-neutral">&nbsp;</span>
@@ -97,7 +103,7 @@
97
103
  <span class="cline-any cline-yes">4x</span>
98
104
  <span class="cline-any cline-neutral">&nbsp;</span>
99
105
  <span class="cline-any cline-neutral">&nbsp;</span>
100
- <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">import AggregateError from 'aggregate-error'
106
+ <span class="cline-any cline-neutral">&nbsp;</span></td><td class="text"><pre class="prettyprint lang-js">const AggregateError = require('aggregate-error')
101
107
  const resolveConfig = require('./resolve-config')
102
108
  const getError = require('./get-error')
103
109
  &nbsp;
@@ -123,10 +129,9 @@ module.exports = async (pluginConfig, context) =&gt; {
123
129
  </div><!-- /wrapper -->
124
130
  <div class='footer quiet pad2 space-top1 center small'>
125
131
  Code coverage generated by
126
- <a href="https://istanbul.js.org/" target="_blank">istanbul</a>
127
- at Wed May 19 2021 12:08:32 GMT+0000 (Coordinated Universal Time)
132
+ <a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
133
+ at Wed Jun 08 2022 11:13:31 GMT+0000 (Coordinated Universal Time)
128
134
  </div>
129
- </div>
130
135
  <script src="../prettify.js"></script>
131
136
  <script>
132
137
  window.onload = function () {
File without changes
File without changes
@@ -24,6 +24,31 @@ var addSorting = (function() {
24
24
  return getTableHeader().querySelectorAll('th')[n];
25
25
  }
26
26
 
27
+ function onFilterInput() {
28
+ const searchValue = document.getElementById('fileSearch').value;
29
+ const rows = document.getElementsByTagName('tbody')[0].children;
30
+ for (let i = 0; i < rows.length; i++) {
31
+ const row = rows[i];
32
+ if (
33
+ row.textContent
34
+ .toLowerCase()
35
+ .includes(searchValue.toLowerCase())
36
+ ) {
37
+ row.style.display = '';
38
+ } else {
39
+ row.style.display = 'none';
40
+ }
41
+ }
42
+ }
43
+
44
+ // loads the search box
45
+ function addSearchBox() {
46
+ var template = document.getElementById('filterTemplate');
47
+ var templateClone = template.content.cloneNode(true);
48
+ templateClone.getElementById('fileSearch').oninput = onFilterInput;
49
+ template.parentElement.appendChild(templateClone);
50
+ }
51
+
27
52
  // loads all columns
28
53
  function loadColumns() {
29
54
  var colNodes = getTableHeader().querySelectorAll('th'),
@@ -162,6 +187,7 @@ var addSorting = (function() {
162
187
  }
163
188
  cols = loadColumns();
164
189
  loadData();
190
+ addSearchBox();
165
191
  addSortIndicators();
166
192
  enableUI();
167
193
  };
@@ -1,14 +1,17 @@
1
1
  module.exports = {
2
2
  EWHMCSNOCREDENTIALS: () => ({
3
3
  message: 'No WHMCS Marketplace credentials specified.',
4
- details: 'WHMCS Marketplace credentails have to be set in the `WHMCS_LOGIN` and `WHMCS_PASSWORD` environment variables on your CI environment.'
4
+ details:
5
+ 'WHMCS Marketplace credentails have to be set in the `WHMCS_LOGIN` and `WHMCS_PASSWORD` environment variables on your CI environment.'
5
6
  }),
6
7
  EWHMCSNOPRODUCTID: () => ({
7
8
  message: 'No WHMCS Marketplace Product ID specified.',
8
- details: 'The product id of your listed product at the WHMCS Marketplace has to be set in the `WHMCS_PRODUCTID` environment variable on your CI environment. You\'ll find that number in url when visiting the product page in WHMCS Marketplace.'
9
+ details:
10
+ "The product id of your listed product at the WHMCS Marketplace has to be set in the `WHMCS_PRODUCTID` environment variable on your CI environment. You'll find that number in url when visiting the product page in WHMCS Marketplace."
9
11
  }),
10
12
  EWHMCSINVALIDPRODUCTID: () => ({
11
13
  message: 'Invalid WHMCS Marketplace Product ID specified.',
12
- details: 'The product id of your listed product at the WHMCS Marketplace has to be set in the `WHMCS_PRODUCTID` environment variable on your CI environment. You\'ll find that number in url when visiting the product page in WHMCS Marketplace.'
14
+ details:
15
+ "The product id of your listed product at the WHMCS Marketplace has to be set in the `WHMCS_PRODUCTID` environment variable on your CI environment. You'll find that number in url when visiting the product page in WHMCS Marketplace."
13
16
  })
14
17
  }
package/lib/get-error.js CHANGED
@@ -1,7 +1,7 @@
1
1
  const SemanticReleaseError = require('@semantic-release/error')
2
2
  const ERROR_DEFINITIONS = require('./definitions/errors.js')
3
3
 
4
- module.exports = code => {
4
+ module.exports = (code) => {
5
5
  const { message, details } = ERROR_DEFINITIONS[code]()
6
6
  return new SemanticReleaseError(message, code, details)
7
7
  }
package/lib/publish.js CHANGED
@@ -14,11 +14,14 @@ module.exports = async (pluginConfig, context) => {
14
14
 
15
15
  if (!notes || !notes.length || !version || !version.length) {
16
16
  debug('publishing new product version failed. No input data available.')
17
- logger.error('WHMCS Marketplace publishing new product version failed. No input data available.')
17
+ logger.error(
18
+ 'WHMCS Marketplace publishing new product version failed. No input data available.'
19
+ )
18
20
  }
19
21
 
20
22
  let success = true
21
- const { whmcsLOGIN, whmcsPASSWORD, whmcsPRODUCTID, DEBUG } = resolveConfig(context)
23
+ const { whmcsLOGIN, whmcsPASSWORD, whmcsPRODUCTID, DEBUG } =
24
+ resolveConfig(context)
22
25
  const { gotoOpts, navOpts, selectorOpts, page } = await puppet(DEBUG, logger)
23
26
 
24
27
  debug(`WHMCS Marketplace Product ID: ${whmcsPRODUCTID}`)
@@ -29,8 +32,9 @@ module.exports = async (pluginConfig, context) => {
29
32
  debug(`Notes: ${notes}`)
30
33
  logger.log(`Release Notes: ${notes}`)
31
34
 
32
- // strip markdown links from notes as not allowed to keep
33
- const cleanedNotes = notes.replace(/\[(.*?)\]\((.+?)\)/gm, '$1')
35
+ // strip markdown links from notes as not allowed to keep (taken from remove-markdown and cleaned up)
36
+ const cleanedNotes = notes.replace(/\[([^[\]]*)\]\([^()]*\)/gm, '$1')
37
+
34
38
  const wmbase = 'https://marketplace.whmcs.com'
35
39
  let url = `${wmbase}/user/login`
36
40
 
@@ -66,28 +70,40 @@ module.exports = async (pluginConfig, context) => {
66
70
  const selector = 'div.listing-edit-container form button[type="submit"]'
67
71
  await page.waitForSelector(selector, selectorOpts)
68
72
  debug('product page submit button selector found')
69
- /* istanbul ignore next */
70
- await page.$eval('#version', (el, value) => {
71
- el.value = value
72
- }, version)
73
+ /* istanbul ignore next */
74
+ await page.$eval(
75
+ '#version',
76
+ (el, value) => {
77
+ el.value = value
78
+ },
79
+ version
80
+ )
73
81
  debug('form input for version finished.')
74
82
 
75
83
  // fill input type date with localized string
76
84
  // https://www.mattzeunert.com/2020/04/01/filling-out-a-date-input-with-puppeteer.html
77
85
  const date = releaseDate ? new Date(releaseDate) : new Date()
78
86
  /* istanbul ignore next */
79
- const dateString = await page.evaluate(d => new Date(d).toLocaleDateString(navigator.language, {
80
- day: '2-digit',
81
- month: '2-digit',
82
- year: 'numeric'
83
- }), date.toISOString())
87
+ const dateString = await page.evaluate(
88
+ (d) =>
89
+ new Date(d).toLocaleDateString(navigator.language, {
90
+ day: '2-digit',
91
+ month: '2-digit',
92
+ year: 'numeric'
93
+ }),
94
+ date.toISOString()
95
+ )
84
96
  await page.type('#released_at', dateString)
85
97
 
86
98
  debug('form input for released_at finished.')
87
- /* istanbul ignore next */
88
- await page.$eval('#description', (el, value) => {
89
- el.value = value
90
- }, cleanedNotes)
99
+ /* istanbul ignore next */
100
+ await page.$eval(
101
+ '#description',
102
+ (el, value) => {
103
+ el.value = value
104
+ },
105
+ cleanedNotes
106
+ )
91
107
  debug('form input for description finished.')
92
108
  const nav = page.waitForNavigation(navOpts)
93
109
  await page.hover(selector)
@@ -101,7 +117,10 @@ module.exports = async (pluginConfig, context) => {
101
117
  success = true
102
118
  } catch (error) {
103
119
  debug('publishing new product version failed.', error.message)
104
- logger.error('WHMCS Marketplace publishing new product version failed.', error.message)
120
+ logger.error(
121
+ 'WHMCS Marketplace publishing new product version failed.',
122
+ error.message
123
+ )
105
124
  success = false
106
125
  }
107
126
  }
package/lib/verify.js CHANGED
@@ -1,4 +1,4 @@
1
- import AggregateError from 'aggregate-error'
1
+ const AggregateError = require('aggregate-error')
2
2
  const resolveConfig = require('./resolve-config')
3
3
  const getError = require('./get-error')
4
4