@hexonet/semantic-release-whmcs 4.0.3 → 4.0.4
Sign up to get free protection for your applications and to get access to all the features.
- package/CONTRIBUTING.md +1 -1
- package/HISTORY.md +69 -62
- package/README.md +5 -5
- package/coverage/coverage-final.json +10 -10
- package/coverage/index.html +19 -19
- package/coverage/lib/definitions/errors.js.html +19 -7
- package/coverage/lib/definitions/index.html +7 -7
- package/coverage/lib/delete-marketplace-version.js.html +19 -19
- package/coverage/lib/get-error.js.html +3 -3
- package/coverage/lib/get-github-releases.js.html +1 -1
- package/coverage/lib/index.html +10 -10
- package/coverage/lib/publish.js.html +1 -1
- package/coverage/lib/puppet.js.html +6 -6
- package/coverage/lib/resolve-config.js.html +2 -2
- package/coverage/lib/scrape-marketplace-versions.js.html +1 -1
- package/coverage/lib/set-compatible-versions.js.html +1 -1
- package/coverage/lib/verify.js.html +22 -13
- package/index.js +16 -9
- package/lib/definitions/errors.js +12 -8
- package/lib/verify.js +13 -10
- package/package.json +5 -5
@@ -74,8 +74,8 @@
|
|
74
74
|
<span class="cline-any cline-yes">1x</span>
|
75
75
|
<span class="cline-any cline-neutral"> </span>
|
76
76
|
<span class="cline-any cline-yes">1x</span>
|
77
|
-
<span class="cline-any cline-yes">
|
78
|
-
<span class="cline-any cline-yes">
|
77
|
+
<span class="cline-any cline-yes">13x</span>
|
78
|
+
<span class="cline-any cline-yes">13x</span>
|
79
79
|
<span class="cline-any cline-neutral"> </span>
|
80
80
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">const SemanticReleaseError = require('@semantic-release/error')
|
81
81
|
const ERROR_DEFINITIONS = require('./definitions/errors.js')
|
@@ -91,7 +91,7 @@ module.exports = (code) => {
|
|
91
91
|
<div class='footer quiet pad2 space-top1 center small'>
|
92
92
|
Code coverage generated by
|
93
93
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
94
|
-
at
|
94
|
+
at 2023-01-04T08:48:51.219Z
|
95
95
|
</div>
|
96
96
|
<script src="../prettify.js"></script>
|
97
97
|
<script>
|
@@ -169,7 +169,7 @@ const GitHub = <span class="cstat-no" title="statement not covered" >require('gi
|
|
169
169
|
<div class='footer quiet pad2 space-top1 center small'>
|
170
170
|
Code coverage generated by
|
171
171
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
172
|
-
at
|
172
|
+
at 2023-01-04T08:48:51.219Z
|
173
173
|
</div>
|
174
174
|
<script src="../prettify.js"></script>
|
175
175
|
<script>
|
package/coverage/lib/index.html
CHANGED
@@ -23,16 +23,16 @@
|
|
23
23
|
<div class='clearfix'>
|
24
24
|
|
25
25
|
<div class='fl pad1y space-right2'>
|
26
|
-
<span class="strong">72.
|
26
|
+
<span class="strong">72.26% </span>
|
27
27
|
<span class="quiet">Statements</span>
|
28
|
-
<span class='fraction'>
|
28
|
+
<span class='fraction'>172/238</span>
|
29
29
|
</div>
|
30
30
|
|
31
31
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
33
|
-
<span class="strong">
|
33
|
+
<span class="strong">80% </span>
|
34
34
|
<span class="quiet">Branches</span>
|
35
|
-
<span class='fraction'>
|
35
|
+
<span class='fraction'>56/70</span>
|
36
36
|
</div>
|
37
37
|
|
38
38
|
|
@@ -44,9 +44,9 @@
|
|
44
44
|
|
45
45
|
|
46
46
|
<div class='fl pad1y space-right2'>
|
47
|
-
<span class="strong">72.
|
47
|
+
<span class="strong">72.76% </span>
|
48
48
|
<span class="quiet">Lines</span>
|
49
|
-
<span class='fraction'>
|
49
|
+
<span class='fraction'>171/235</span>
|
50
50
|
</div>
|
51
51
|
|
52
52
|
|
@@ -204,13 +204,13 @@
|
|
204
204
|
<div class="chart"><div class="cover-fill cover-full" style="width: 100%"></div><div class="cover-empty" style="width: 0%"></div></div>
|
205
205
|
</td>
|
206
206
|
<td data-value="100" class="pct high">100%</td>
|
207
|
-
<td data-value="
|
207
|
+
<td data-value="16" class="abs high">16/16</td>
|
208
208
|
<td data-value="100" class="pct high">100%</td>
|
209
|
-
<td data-value="
|
209
|
+
<td data-value="14" class="abs high">14/14</td>
|
210
210
|
<td data-value="100" class="pct high">100%</td>
|
211
211
|
<td data-value="1" class="abs high">1/1</td>
|
212
212
|
<td data-value="100" class="pct high">100%</td>
|
213
|
-
<td data-value="
|
213
|
+
<td data-value="16" class="abs high">16/16</td>
|
214
214
|
</tr>
|
215
215
|
|
216
216
|
</tbody>
|
@@ -221,7 +221,7 @@
|
|
221
221
|
<div class='footer quiet pad2 space-top1 center small'>
|
222
222
|
Code coverage generated by
|
223
223
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
224
|
-
at
|
224
|
+
at 2023-01-04T08:48:51.219Z
|
225
225
|
</div>
|
226
226
|
<script src="../prettify.js"></script>
|
227
227
|
<script>
|
@@ -355,7 +355,7 @@ module.exports = async (pluginConfig, context) => {
|
|
355
355
|
<div class='footer quiet pad2 space-top1 center small'>
|
356
356
|
Code coverage generated by
|
357
357
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
358
|
-
at
|
358
|
+
at 2023-01-04T08:48:51.219Z
|
359
359
|
</div>
|
360
360
|
<script src="../prettify.js"></script>
|
361
361
|
<script>
|
@@ -233,11 +233,11 @@
|
|
233
233
|
<span class="cline-any cline-neutral"> </span>
|
234
234
|
<span class="cline-any cline-neutral"> </span>
|
235
235
|
<span class="cline-any cline-yes">5x</span>
|
236
|
-
<span class="cline-any cline-yes">
|
237
|
-
<span class="cline-any cline-yes">
|
238
|
-
<span class="cline-any cline-yes">
|
239
|
-
<span class="cline-any cline-yes">
|
240
|
-
<span class="cline-any cline-yes">
|
236
|
+
<span class="cline-any cline-yes">8x</span>
|
237
|
+
<span class="cline-any cline-yes">8x</span>
|
238
|
+
<span class="cline-any cline-yes">8x</span>
|
239
|
+
<span class="cline-any cline-yes">8x</span>
|
240
|
+
<span class="cline-any cline-yes">8x</span>
|
241
241
|
<span class="cline-any cline-neutral"> </span>
|
242
242
|
<span class="cline-any cline-neutral"> </span>
|
243
243
|
<span class="cline-any cline-yes">5x</span>
|
@@ -409,7 +409,7 @@ module.exports = async (context) => {
|
|
409
409
|
<div class='footer quiet pad2 space-top1 center small'>
|
410
410
|
Code coverage generated by
|
411
411
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
412
|
-
at
|
412
|
+
at 2023-01-04T08:48:51.219Z
|
413
413
|
</div>
|
414
414
|
<script src="../prettify.js"></script>
|
415
415
|
<script>
|
@@ -74,7 +74,7 @@
|
|
74
74
|
<a name='L9'></a><a href='#L9'>9</a>
|
75
75
|
<a name='L10'></a><a href='#L10'>10</a>
|
76
76
|
<a name='L11'></a><a href='#L11'>11</a>
|
77
|
-
<a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">
|
77
|
+
<a name='L12'></a><a href='#L12'>12</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">11x</span>
|
78
78
|
<span class="cline-any cline-neutral"> </span>
|
79
79
|
<span class="cline-any cline-neutral"> </span>
|
80
80
|
<span class="cline-any cline-neutral"> </span>
|
@@ -103,7 +103,7 @@
|
|
103
103
|
<div class='footer quiet pad2 space-top1 center small'>
|
104
104
|
Code coverage generated by
|
105
105
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
106
|
-
at
|
106
|
+
at 2023-01-04T08:48:51.219Z
|
107
107
|
</div>
|
108
108
|
<script src="../prettify.js"></script>
|
109
109
|
<script>
|
@@ -205,7 +205,7 @@ const path = <span class="cstat-no" title="statement not covered" >require('path
|
|
205
205
|
<div class='footer quiet pad2 space-top1 center small'>
|
206
206
|
Code coverage generated by
|
207
207
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
208
|
-
at
|
208
|
+
at 2023-01-04T08:48:51.219Z
|
209
209
|
</div>
|
210
210
|
<script src="../prettify.js"></script>
|
211
211
|
<script>
|
@@ -283,7 +283,7 @@ module.exports = async (pluginConfig, context) => {
|
|
283
283
|
<div class='footer quiet pad2 space-top1 center small'>
|
284
284
|
Code coverage generated by
|
285
285
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
286
|
-
at
|
286
|
+
at 2023-01-04T08:48:51.219Z
|
287
287
|
</div>
|
288
288
|
<script src="../prettify.js"></script>
|
289
289
|
<script>
|
@@ -25,14 +25,14 @@
|
|
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'>16/16</span>
|
29
29
|
</div>
|
30
30
|
|
31
31
|
|
32
32
|
<div class='fl pad1y space-right2'>
|
33
33
|
<span class="strong">100% </span>
|
34
34
|
<span class="quiet">Branches</span>
|
35
|
-
<span class='fraction'>
|
35
|
+
<span class='fraction'>14/14</span>
|
36
36
|
</div>
|
37
37
|
|
38
38
|
|
@@ -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'>16/16</span>
|
50
50
|
</div>
|
51
51
|
|
52
52
|
|
@@ -84,25 +84,31 @@
|
|
84
84
|
<a name='L19'></a><a href='#L19'>19</a>
|
85
85
|
<a name='L20'></a><a href='#L20'>20</a>
|
86
86
|
<a name='L21'></a><a href='#L21'>21</a>
|
87
|
-
<a name='L22'></a><a href='#L22'>22</a
|
87
|
+
<a name='L22'></a><a href='#L22'>22</a>
|
88
|
+
<a name='L23'></a><a href='#L23'>23</a>
|
89
|
+
<a name='L24'></a><a href='#L24'>24</a>
|
90
|
+
<a name='L25'></a><a href='#L25'>25</a></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
|
88
91
|
<span class="cline-any cline-yes">1x</span>
|
89
92
|
<span class="cline-any cline-yes">1x</span>
|
90
93
|
<span class="cline-any cline-neutral"> </span>
|
91
94
|
<span class="cline-any cline-yes">1x</span>
|
92
|
-
<span class="cline-any cline-yes">
|
93
|
-
<span class="cline-any cline-yes">
|
94
|
-
<span class="cline-any cline-yes">
|
95
|
-
<span class="cline-any cline-yes">
|
96
|
-
<span class="cline-any cline-neutral"> </span>
|
95
|
+
<span class="cline-any cline-yes">6x</span>
|
96
|
+
<span class="cline-any cline-yes">6x</span>
|
97
|
+
<span class="cline-any cline-yes">6x</span>
|
98
|
+
<span class="cline-any cline-yes">1x</span>
|
97
99
|
<span class="cline-any cline-neutral"> </span>
|
98
|
-
<span class="cline-any cline-yes">
|
100
|
+
<span class="cline-any cline-yes">6x</span>
|
99
101
|
<span class="cline-any cline-yes">3x</span>
|
100
102
|
<span class="cline-any cline-neutral"> </span>
|
101
|
-
<span class="cline-any cline-
|
103
|
+
<span class="cline-any cline-neutral"> </span>
|
104
|
+
<span class="cline-any cline-yes">6x</span>
|
102
105
|
<span class="cline-any cline-yes">4x</span>
|
103
106
|
<span class="cline-any cline-neutral"> </span>
|
107
|
+
<span class="cline-any cline-yes">6x</span>
|
108
|
+
<span class="cline-any cline-yes">5x</span>
|
109
|
+
<span class="cline-any cline-neutral"> </span>
|
110
|
+
<span class="cline-any cline-yes">6x</span>
|
104
111
|
<span class="cline-any cline-yes">5x</span>
|
105
|
-
<span class="cline-any cline-yes">4x</span>
|
106
112
|
<span class="cline-any cline-neutral"> </span>
|
107
113
|
<span class="cline-any cline-neutral"> </span>
|
108
114
|
<span class="cline-any cline-neutral"> </span></td><td class="text"><pre class="prettyprint lang-js">const AggregateError = require('aggregate-error')
|
@@ -112,6 +118,9 @@ const getError = require('./get-error')
|
|
112
118
|
module.exports = async (pluginConfig, context) => {
|
113
119
|
const cfg = resolveConfig(context)
|
114
120
|
const errors = []
|
121
|
+
if (cfg.ghtoken === false) {
|
122
|
+
errors.push(getError('ENOGHTOKEN'))
|
123
|
+
}
|
115
124
|
if (cfg.login === false || cfg.password === false) {
|
116
125
|
errors.push(getError('EWHMCSNOCREDENTIALS'))
|
117
126
|
}
|
@@ -133,7 +142,7 @@ module.exports = async (pluginConfig, context) => {
|
|
133
142
|
<div class='footer quiet pad2 space-top1 center small'>
|
134
143
|
Code coverage generated by
|
135
144
|
<a href="https://istanbul.js.org/" target="_blank" rel="noopener noreferrer">istanbul</a>
|
136
|
-
at
|
145
|
+
at 2023-01-04T08:48:51.219Z
|
137
146
|
</div>
|
138
147
|
<script src="../prettify.js"></script>
|
139
148
|
<script>
|
package/index.js
CHANGED
@@ -5,17 +5,17 @@ const setCompatibleVersions = require('./lib/set-compatible-versions')
|
|
5
5
|
const githubReleases = require('./lib/get-github-releases.js')
|
6
6
|
const marketplaceVersions = require('./lib/scrape-marketplace-versions.js')
|
7
7
|
|
8
|
-
let verified
|
8
|
+
let verified;
|
9
9
|
|
10
10
|
/**
|
11
11
|
* Called by semantic-release during the verify step
|
12
12
|
* @param {*} pluginConfig The semantic-release plugin config
|
13
13
|
* @param {*} context The context provided by semantic-release
|
14
14
|
*/
|
15
|
-
async function verifyConditions
|
15
|
+
async function verifyConditions(pluginConfig, context) {
|
16
16
|
if (!verified) {
|
17
|
-
await verifyWHMCS(pluginConfig, context)
|
18
|
-
verified = true
|
17
|
+
await verifyWHMCS(pluginConfig, context);
|
18
|
+
verified = true;
|
19
19
|
}
|
20
20
|
}
|
21
21
|
|
@@ -24,12 +24,12 @@ async function verifyConditions (pluginConfig, context) {
|
|
24
24
|
* @param {*} pluginConfig The semantic-release plugin config
|
25
25
|
* @param {*} context The context provided by semantic-release
|
26
26
|
*/
|
27
|
-
async function publish
|
27
|
+
async function publish(pluginConfig, context) {
|
28
28
|
await verifyConditions(pluginConfig, context)
|
29
29
|
return publishWHMCS(pluginConfig, context)
|
30
30
|
}
|
31
31
|
|
32
|
-
async function syncVersions
|
32
|
+
async function syncVersions(pluginConfig, context) {
|
33
33
|
await verifyConditions(pluginConfig, context)
|
34
34
|
const releases = await githubReleases(pluginConfig, context)
|
35
35
|
|
@@ -49,21 +49,28 @@ async function syncVersions (pluginConfig, context) {
|
|
49
49
|
}
|
50
50
|
}
|
51
51
|
|
52
|
-
|
52
|
+
|
53
|
+
async function delVersion(pluginConfig, context) {
|
53
54
|
await verifyConditions(pluginConfig, context)
|
54
55
|
await deleteVersion(pluginConfig, context)
|
55
56
|
}
|
56
57
|
|
57
|
-
async function updateCompatibility
|
58
|
+
async function updateCompatibility(pluginConfig, context) {
|
58
59
|
await verifyConditions(pluginConfig, context)
|
59
60
|
await setCompatibleVersions(pluginConfig, context)
|
60
61
|
}
|
61
62
|
|
63
|
+
async function fail(pluginConfig, context) {
|
64
|
+
await verifyConditions(pluginConfig, context)
|
65
|
+
}
|
66
|
+
|
62
67
|
module.exports = {
|
68
|
+
verifyConditions,
|
63
69
|
publish,
|
70
|
+
fail,
|
64
71
|
syncVersions,
|
65
72
|
delVersion,
|
66
73
|
githubReleases,
|
67
74
|
marketplaceVersions,
|
68
75
|
updateCompatibility
|
69
|
-
}
|
76
|
+
}
|
@@ -1,17 +1,21 @@
|
|
1
1
|
module.exports = {
|
2
|
+
ENOGHTOKEN: () => ({
|
3
|
+
message: "No Github Token specified.",
|
4
|
+
details: "Please create a `GH_TOKEN` in repository secrets.",
|
5
|
+
}),
|
2
6
|
EWHMCSNOCREDENTIALS: () => ({
|
3
|
-
message:
|
7
|
+
message: "No WHMCS Marketplace credentials specified.",
|
4
8
|
details:
|
5
|
-
|
9
|
+
"WHMCS Marketplace credentails have to be set in the `WHMCS_LOGIN` and `WHMCS_PASSWORD` environment variables on your CI environment.",
|
6
10
|
}),
|
7
11
|
EWHMCSNOPRODUCTID: () => ({
|
8
|
-
message:
|
12
|
+
message: "No WHMCS Marketplace Product ID specified.",
|
9
13
|
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."
|
14
|
+
"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.",
|
11
15
|
}),
|
12
16
|
EWHMCSINVALIDPRODUCTID: () => ({
|
13
|
-
message:
|
17
|
+
message: "Invalid WHMCS Marketplace Product ID specified.",
|
14
18
|
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."
|
16
|
-
})
|
17
|
-
}
|
19
|
+
"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.",
|
20
|
+
}),
|
21
|
+
};
|
package/lib/verify.js
CHANGED
@@ -1,21 +1,24 @@
|
|
1
|
-
const AggregateError = require(
|
2
|
-
const resolveConfig = require(
|
3
|
-
const getError = require(
|
1
|
+
const AggregateError = require("aggregate-error");
|
2
|
+
const resolveConfig = require("./resolve-config");
|
3
|
+
const getError = require("./get-error");
|
4
4
|
|
5
5
|
module.exports = async (pluginConfig, context) => {
|
6
|
-
const cfg = resolveConfig(context)
|
7
|
-
const errors = []
|
6
|
+
const cfg = resolveConfig(context);
|
7
|
+
const errors = [];
|
8
|
+
if (cfg.ghtoken === false) {
|
9
|
+
errors.push(getError("ENOGHTOKEN"));
|
10
|
+
}
|
8
11
|
if (cfg.login === false || cfg.password === false) {
|
9
|
-
errors.push(getError(
|
12
|
+
errors.push(getError("EWHMCSNOCREDENTIALS"));
|
10
13
|
}
|
11
14
|
// TODO: we might test Marketplace login using given credentials
|
12
15
|
if (cfg.productid === false) {
|
13
|
-
errors.push(getError(
|
16
|
+
errors.push(getError("EWHMCSNOPRODUCTID"));
|
14
17
|
}
|
15
18
|
if (!/^[0-9]+$/.test(cfg.productid) || !parseInt(cfg.productid, 10)) {
|
16
|
-
errors.push(getError(
|
19
|
+
errors.push(getError("EWHMCSINVALIDPRODUCTID"));
|
17
20
|
}
|
18
21
|
if (errors.length > 0) {
|
19
|
-
throw new AggregateError(errors)
|
22
|
+
throw new AggregateError(errors);
|
20
23
|
}
|
21
|
-
}
|
24
|
+
};
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "@hexonet/semantic-release-whmcs",
|
3
3
|
"description": "`semantic-release` plugin for auto-publishing on WHMCS marketplace",
|
4
|
-
"version": "4.0.
|
4
|
+
"version": "4.0.4",
|
5
5
|
"private": false,
|
6
6
|
"publishConfig": {
|
7
7
|
"access": "public"
|
@@ -16,9 +16,9 @@
|
|
16
16
|
"node": ">=16.15.1",
|
17
17
|
"npm": ">=8.11.0"
|
18
18
|
},
|
19
|
-
"homepage": "https://github.com/
|
20
|
-
"repository": "github:
|
21
|
-
"bugs": "https://github.com/
|
19
|
+
"homepage": "https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-whmcs#readme",
|
20
|
+
"repository": "github:centralnicgroup-opensource/rtldev-middleware-semantic-release-whmcs",
|
21
|
+
"bugs": "https://github.com/centralnicgroup-opensource/rtldev-middleware-semantic-release-whmcs/issues",
|
22
22
|
"maintainers": [
|
23
23
|
{
|
24
24
|
"name": "Kai Schwarz",
|
@@ -59,7 +59,7 @@
|
|
59
59
|
"@semantic-release/changelog": "^6.0.1",
|
60
60
|
"@semantic-release/exec": "^6.0.2",
|
61
61
|
"@semantic-release/git": "^10.0.1",
|
62
|
-
"ava": "^
|
62
|
+
"ava": "^5.1.0",
|
63
63
|
"eslint": "^8.0.1",
|
64
64
|
"eslint-config-standard": "^17.0.0",
|
65
65
|
"eslint-plugin-import": "^2.25.2",
|