@hexonet/semantic-release-whmcs 4.0.3 → 4.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -74,8 +74,8 @@
74
74
  <span class="cline-any cline-yes">1x</span>
75
75
  <span class="cline-any cline-neutral">&nbsp;</span>
76
76
  <span class="cline-any cline-yes">1x</span>
77
- <span class="cline-any cline-yes">9x</span>
78
- <span class="cline-any cline-yes">9x</span>
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">&nbsp;</span>
80
80
  <span class="cline-any cline-neutral">&nbsp;</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) =&gt; {
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 2022-08-09T11:01:27.229Z
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 2022-08-09T11:01:27.229Z
172
+ at 2023-01-04T08:48:51.219Z
173
173
  </div>
174
174
  <script src="../prettify.js"></script>
175
175
  <script>
@@ -23,16 +23,16 @@
23
23
  <div class='clearfix'>
24
24
 
25
25
  <div class='fl pad1y space-right2'>
26
- <span class="strong">72.03% </span>
26
+ <span class="strong">72.26% </span>
27
27
  <span class="quiet">Statements</span>
28
- <span class='fraction'>170/236</span>
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">79.41% </span>
33
+ <span class="strong">80% </span>
34
34
  <span class="quiet">Branches</span>
35
- <span class='fraction'>54/68</span>
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.53% </span>
47
+ <span class="strong">72.76% </span>
48
48
  <span class="quiet">Lines</span>
49
- <span class='fraction'>169/233</span>
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="14" class="abs high">14/14</td>
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="12" class="abs high">12/12</td>
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="14" class="abs high">14/14</td>
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 2022-08-09T11:01:27.229Z
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) =&gt; {
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 2022-08-09T11:01:27.229Z
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">&nbsp;</span>
234
234
  <span class="cline-any cline-neutral">&nbsp;</span>
235
235
  <span class="cline-any cline-yes">5x</span>
236
- <span class="cline-any cline-yes">9x</span>
237
- <span class="cline-any cline-yes">9x</span>
238
- <span class="cline-any cline-yes">9x</span>
239
- <span class="cline-any cline-yes">9x</span>
240
- <span class="cline-any cline-yes">9x</span>
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">&nbsp;</span>
242
242
  <span class="cline-any cline-neutral">&nbsp;</span>
243
243
  <span class="cline-any cline-yes">5x</span>
@@ -409,7 +409,7 @@ module.exports = async (context) =&gt; {
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 2022-08-09T11:01:27.229Z
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">10x</span>
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">&nbsp;</span>
79
79
  <span class="cline-any cline-neutral">&nbsp;</span>
80
80
  <span class="cline-any cline-neutral">&nbsp;</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 2022-08-09T11:01:27.229Z
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 2022-08-09T11:01:27.229Z
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) =&gt; {
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 2022-08-09T11:01:27.229Z
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'>14/14</span>
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'>12/12</span>
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'>14/14</span>
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></td><td class="line-coverage quiet"><span class="cline-any cline-yes">1x</span>
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">&nbsp;</span>
91
94
  <span class="cline-any cline-yes">1x</span>
92
- <span class="cline-any cline-yes">5x</span>
93
- <span class="cline-any cline-yes">5x</span>
94
- <span class="cline-any cline-yes">5x</span>
95
- <span class="cline-any cline-yes">2x</span>
96
- <span class="cline-any cline-neutral">&nbsp;</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">&nbsp;</span>
98
- <span class="cline-any cline-yes">5x</span>
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">&nbsp;</span>
101
- <span class="cline-any cline-yes">5x</span>
103
+ <span class="cline-any cline-neutral">&nbsp;</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">&nbsp;</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">&nbsp;</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">&nbsp;</span>
107
113
  <span class="cline-any cline-neutral">&nbsp;</span>
108
114
  <span class="cline-any cline-neutral">&nbsp;</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) =&gt; {
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) =&gt; {
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 2022-08-09T11:01:27.229Z
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 (pluginConfig, context) {
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 (pluginConfig, context) {
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 (pluginConfig, context) {
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
- async function delVersion (pluginConfig, context) {
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 (pluginConfig, context) {
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: 'No WHMCS Marketplace credentials specified.',
7
+ message: "No WHMCS Marketplace credentials specified.",
4
8
  details:
5
- 'WHMCS Marketplace credentails have to be set in the `WHMCS_LOGIN` and `WHMCS_PASSWORD` environment variables on your CI environment.'
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: 'No WHMCS Marketplace Product ID specified.',
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: 'Invalid WHMCS Marketplace Product ID specified.',
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('aggregate-error')
2
- const resolveConfig = require('./resolve-config')
3
- const getError = require('./get-error')
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('EWHMCSNOCREDENTIALS'))
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('EWHMCSNOPRODUCTID'))
16
+ errors.push(getError("EWHMCSNOPRODUCTID"));
14
17
  }
15
18
  if (!/^[0-9]+$/.test(cfg.productid) || !parseInt(cfg.productid, 10)) {
16
- errors.push(getError('EWHMCSINVALIDPRODUCTID'))
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.3",
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/hexonet/semantic-release-whmcs#readme",
20
- "repository": "github:hexonet/semantic-release-whmcs",
21
- "bugs": "https://github.com/hexonet/semantic-release-whmcs/issues",
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": "^4.0.0",
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",