@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.
- package/.eslintrc.js +13 -12
- package/.github/workflows/pull-request.yml +12 -10
- package/.github/workflows/push.yml +28 -16
- package/HISTORY.md +22 -0
- package/{base.css → coverage/base.css} +0 -0
- package/{block-navigation.js → coverage/block-navigation.js} +8 -0
- package/{coverage-final.json → coverage/coverage-final.json} +8 -8
- package/{favicon.png → coverage/favicon.png} +0 -0
- package/{index.html → coverage/index.html} +20 -15
- package/{lib → coverage/lib}/definitions/errors.js.html +21 -7
- package/{lib → coverage/lib}/definitions/index.html +8 -3
- package/{lib → coverage/lib}/delete-marketplace-version.js.html +10 -5
- package/{lib → coverage/lib}/get-error.js.html +9 -4
- package/{lib → coverage/lib}/get-github-releases.js.html +8 -3
- package/{lib → coverage/lib}/index.html +24 -19
- package/{lib → coverage/lib}/publish.js.html +83 -21
- package/{lib → coverage/lib}/puppet.js.html +12 -7
- package/{lib → coverage/lib}/resolve-config.js.html +9 -4
- package/{lib → coverage/lib}/scrape-marketplace-versions.js.html +8 -3
- package/{lib → coverage/lib}/set-compatible-versions.js.html +10 -5
- package/{lib → coverage/lib}/verify.js.html +12 -7
- package/{prettify.css → coverage/prettify.css} +0 -0
- package/{prettify.js → coverage/prettify.js} +0 -0
- package/{sort-arrow-sprite.png → coverage/sort-arrow-sprite.png} +0 -0
- package/{sorter.js → coverage/sorter.js} +26 -0
- package/lib/definitions/errors.js +6 -3
- package/lib/get-error.js +1 -1
- package/lib/publish.js +37 -18
- package/lib/verify.js +1 -1
- package/package.json +18 -19
- package/whmcs.js +0 -1
- package/test/publish.test.js +0 -83
- 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.
|
|
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
|
|
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"> </span>
|
|
194
219
|
<span class="cline-any cline-neutral"> </span>
|
|
195
220
|
<span class="cline-any cline-neutral"> </span>
|
|
221
|
+
<span class="cline-any cline-neutral"> </span>
|
|
222
|
+
<span class="cline-any cline-neutral"> </span>
|
|
196
223
|
<span class="cline-any cline-yes">3x</span>
|
|
224
|
+
<span class="cline-any cline-neutral"> </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"> </span>
|
|
@@ -207,6 +235,7 @@
|
|
|
207
235
|
<span class="cline-any cline-neutral"> </span>
|
|
208
236
|
<span class="cline-any cline-neutral"> </span>
|
|
209
237
|
<span class="cline-any cline-yes">3x</span>
|
|
238
|
+
<span class="cline-any cline-neutral"> </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"> </span>
|
|
@@ -246,6 +275,10 @@
|
|
|
246
275
|
<span class="cline-any cline-neutral"> </span>
|
|
247
276
|
<span class="cline-any cline-neutral"> </span>
|
|
248
277
|
<span class="cline-any cline-neutral"> </span>
|
|
278
|
+
<span class="cline-any cline-neutral"> </span>
|
|
279
|
+
<span class="cline-any cline-neutral"> </span>
|
|
280
|
+
<span class="cline-any cline-neutral"> </span>
|
|
281
|
+
<span class="cline-any cline-neutral"> </span>
|
|
249
282
|
<span class="cline-any cline-yes">1x</span>
|
|
250
283
|
<span class="cline-any cline-neutral"> </span>
|
|
251
284
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -257,6 +290,10 @@
|
|
|
257
290
|
<span class="cline-any cline-neutral"> </span>
|
|
258
291
|
<span class="cline-any cline-neutral"> </span>
|
|
259
292
|
<span class="cline-any cline-neutral"> </span>
|
|
293
|
+
<span class="cline-any cline-neutral"> </span>
|
|
294
|
+
<span class="cline-any cline-neutral"> </span>
|
|
295
|
+
<span class="cline-any cline-neutral"> </span>
|
|
296
|
+
<span class="cline-any cline-neutral"> </span>
|
|
260
297
|
<span class="cline-any cline-yes">1x</span>
|
|
261
298
|
<span class="cline-any cline-neutral"> </span>
|
|
262
299
|
<span class="cline-any cline-yes">1x</span>
|
|
@@ -264,6 +301,10 @@
|
|
|
264
301
|
<span class="cline-any cline-neutral"> </span>
|
|
265
302
|
<span class="cline-any cline-neutral"> </span>
|
|
266
303
|
<span class="cline-any cline-neutral"> </span>
|
|
304
|
+
<span class="cline-any cline-neutral"> </span>
|
|
305
|
+
<span class="cline-any cline-neutral"> </span>
|
|
306
|
+
<span class="cline-any cline-neutral"> </span>
|
|
307
|
+
<span class="cline-any cline-neutral"> </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"> </span>
|
|
279
320
|
<span class="cline-any cline-no"> </span>
|
|
280
321
|
<span class="cline-any cline-no"> </span>
|
|
322
|
+
<span class="cline-any cline-neutral"> </span>
|
|
323
|
+
<span class="cline-any cline-neutral"> </span>
|
|
324
|
+
<span class="cline-any cline-neutral"> </span>
|
|
281
325
|
<span class="cline-any cline-no"> </span>
|
|
282
326
|
<span class="cline-any cline-neutral"> </span>
|
|
283
327
|
<span class="cline-any cline-neutral"> </span>
|
|
@@ -307,11 +351,14 @@ module.exports = async (pluginConfig, context) => {
|
|
|
307
351
|
|
|
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(
|
|
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
|
|
|
313
359
|
let success = true
|
|
314
|
-
const { whmcsLOGIN, whmcsPASSWORD, whmcsPRODUCTID, DEBUG } =
|
|
360
|
+
const { whmcsLOGIN, whmcsPASSWORD, whmcsPRODUCTID, DEBUG } =
|
|
361
|
+
resolveConfig(context)
|
|
315
362
|
const { gotoOpts, navOpts, selectorOpts, page } = await puppet(DEBUG, logger)
|
|
316
363
|
|
|
317
364
|
debug(`WHMCS Marketplace Product ID: ${whmcsPRODUCTID}`)
|
|
@@ -322,8 +369,9 @@ module.exports = async (pluginConfig, context) => {
|
|
|
322
369
|
debug(`Notes: ${notes}`)
|
|
323
370
|
logger.log(`Release Notes: ${notes}`)
|
|
324
371
|
|
|
325
|
-
// strip markdown links from notes as not allowed to keep
|
|
326
|
-
const cleanedNotes = notes.replace(/\[(
|
|
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
|
+
|
|
327
375
|
const wmbase = 'https://marketplace.whmcs.com'
|
|
328
376
|
let url = `${wmbase}/user/login`
|
|
329
377
|
|
|
@@ -360,27 +408,39 @@ module.exports = async (pluginConfig, context) => {
|
|
|
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(
|
|
364
|
-
|
|
365
|
-
|
|
411
|
+
await page.$eval(
|
|
412
|
+
'#version',
|
|
413
|
+
(el, value) => {
|
|
414
|
+
el.value = value
|
|
415
|
+
},
|
|
416
|
+
version
|
|
417
|
+
)
|
|
366
418
|
debug('form input for version finished.')
|
|
367
419
|
|
|
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(
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
424
|
+
const dateString = await page.evaluate(
|
|
425
|
+
(d) =>
|
|
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
|
|
|
379
435
|
debug('form input for released_at finished.')
|
|
380
436
|
/* istanbul ignore next */
|
|
381
|
-
await page.$eval(
|
|
382
|
-
|
|
383
|
-
|
|
437
|
+
await page.$eval(
|
|
438
|
+
'#description',
|
|
439
|
+
(el, value) => {
|
|
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) => {
|
|
|
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(
|
|
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) => {
|
|
|
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
|
|
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.
|
|
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"> </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">
|
|
160
|
-
<span class="cline-any cline-yes">
|
|
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"> </span>
|
|
162
|
-
<span class="cline-any cline-yes">
|
|
168
|
+
<span class="cline-any cline-yes">113x</span>
|
|
163
169
|
<span class="cline-any cline-neutral"> </span>
|
|
164
170
|
<span class="cline-any cline-neutral"> </span>
|
|
165
171
|
<span class="cline-any cline-yes">5x</span>
|
|
@@ -249,10 +255,9 @@ module.exports = async (DEBUG, logger) => {
|
|
|
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
|
|
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.
|
|
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
|
|
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
|
|
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.
|
|
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.
|
|
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) => {
|
|
|
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
|
|
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'>
|
|
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'>
|
|
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-
|
|
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"> </span>
|
|
@@ -97,7 +103,7 @@
|
|
|
97
103
|
<span class="cline-any cline-yes">4x</span>
|
|
98
104
|
<span class="cline-any cline-neutral"> </span>
|
|
99
105
|
<span class="cline-any cline-neutral"> </span>
|
|
100
|
-
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">
|
|
106
|
+
<span class="cline-any cline-neutral"> </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
|
|
|
@@ -123,10 +129,9 @@ module.exports = async (pluginConfig, context) => {
|
|
|
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
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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(
|
|
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 } =
|
|
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(/\[(
|
|
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(
|
|
71
|
-
|
|
72
|
-
|
|
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(
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
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(
|
|
89
|
-
|
|
90
|
-
|
|
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(
|
|
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