release-it 17.5.0 → 17.6.0

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.
@@ -63,6 +63,7 @@
63
63
  "tokenRef": "GITLAB_TOKEN",
64
64
  "tokenHeader": "Private-Token",
65
65
  "certificateAuthorityFile": null,
66
+ "secure": null,
66
67
  "assets": null,
67
68
  "origin": null,
68
69
  "skipChecks": false
@@ -17,10 +17,17 @@ class GitLab extends Release {
17
17
  super(...args);
18
18
  this.registerPrompts(prompts);
19
19
  this.assets = [];
20
- const { certificateAuthorityFile } = this.options;
21
- this.certificateAuthorityOption = certificateAuthorityFile
22
- ? { https: { certificateAuthority: fs.readFileSync(certificateAuthorityFile) } }
23
- : {};
20
+ const { certificateAuthorityFile, secure } = this.options;
21
+
22
+ const httpsOptions = {
23
+ certificateAuthority: certificateAuthorityFile ? fs.readFileSync(certificateAuthorityFile) : undefined,
24
+ rejectUnauthorized: typeof secure === 'boolean' ? secure : undefined
25
+ };
26
+
27
+ // Remove keys with undefined values
28
+ const https = _.pickBy(httpsOptions, value => value !== undefined);
29
+
30
+ this.certificateAuthorityOption = _.isEmpty(https) ? {} : { https };
24
31
  }
25
32
 
26
33
  get client() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "release-it",
3
- "version": "17.5.0",
3
+ "version": "17.6.0",
4
4
  "description": "Generic CLI tool to automate versioning and package publishing-related tasks.",
5
5
  "keywords": [
6
6
  "build",
@@ -100,36 +100,36 @@
100
100
  "proxy-agent": "6.4.0",
101
101
  "semver": "7.6.2",
102
102
  "shelljs": "0.8.5",
103
- "update-notifier": "7.0.0",
103
+ "update-notifier": "7.1.0",
104
104
  "url-join": "5.0.0",
105
105
  "wildcard-match": "5.1.3",
106
106
  "yargs-parser": "21.1.1"
107
107
  },
108
108
  "devDependencies": {
109
- "@eslint/compat": "1.1.0",
109
+ "@eslint/compat": "1.1.1",
110
110
  "@eslint/eslintrc": "3.1.0",
111
- "@eslint/js": "9.6.0",
111
+ "@eslint/js": "9.7.0",
112
112
  "@octokit/request-error": "5.1.0",
113
- "@types/node": "20.14.9",
113
+ "@types/node": "20.14.10",
114
114
  "ava": "6.1.3",
115
- "eslint": "9.6.0",
115
+ "eslint": "9.7.0",
116
116
  "eslint-config-prettier": "9.1.0",
117
117
  "eslint-plugin-ava": "15.0.1",
118
- "eslint-plugin-import": "2.29.1",
118
+ "eslint-plugin-import-x": "3.0.1",
119
119
  "eslint-plugin-prettier": "5.1.3",
120
120
  "fs-monkey": "1.0.6",
121
- "globals": "15.7.0",
121
+ "globals": "15.8.0",
122
122
  "installed-check": "9.3.0",
123
- "knip": "5.23.2",
123
+ "knip": "5.26.0",
124
124
  "memfs": "4.9.3",
125
125
  "mock-stdio": "1.0.3",
126
126
  "nock": "13.5.4",
127
- "prettier": "3.3.2",
127
+ "prettier": "3.3.3",
128
128
  "remark-cli": "12.0.1",
129
129
  "remark-preset-webpro": "1.1.0",
130
130
  "sinon": "18.0.0",
131
131
  "strip-ansi": "7.1.0",
132
- "typescript": "5.5.2"
132
+ "typescript": "5.5.3"
133
133
  },
134
134
  "overrides": {
135
135
  "pac-resolver": "7.0.1",
@@ -46,6 +46,9 @@
46
46
  "certificateAuthorityFile": {
47
47
  "default": null
48
48
  },
49
+ "secure": {
50
+ "default": null
51
+ },
49
52
  "assets": {
50
53
  "default": null
51
54
  },
package/test/gitlab.js CHANGED
@@ -1,3 +1,4 @@
1
+ import fs from 'node:fs';
1
2
  import test from 'ava';
2
3
  import sinon from 'sinon';
3
4
  import nock from 'nock';
@@ -250,3 +251,50 @@ test('should skip checks', async t => {
250
251
 
251
252
  t.is(gitlab.log.exec.args.filter(entry => /checkReleaseMilestones/.test(entry[0])).length, 0);
252
253
  });
254
+
255
+ test('should handle certificate authority options', t => {
256
+ const sandbox = sinon.createSandbox();
257
+ sandbox.stub(fs, 'readFileSync').returns('test certificate');
258
+
259
+ {
260
+ const options = { gitlab: {} };
261
+ const gitlab = factory(GitLab, { options });
262
+ t.deepEqual(gitlab.certificateAuthorityOption, {});
263
+ }
264
+
265
+ {
266
+ const options = { gitlab: { certificateAuthorityFile: 'cert.crt' } };
267
+ const gitlab = factory(GitLab, { options });
268
+ t.deepEqual(gitlab.certificateAuthorityOption, { https: { certificateAuthority: 'test certificate' } });
269
+ }
270
+
271
+ {
272
+ const options = { gitlab: { secure: false } };
273
+ const gitlab = factory(GitLab, { options });
274
+ t.deepEqual(gitlab.certificateAuthorityOption, { https: { rejectUnauthorized: false } });
275
+ }
276
+
277
+ {
278
+ const options = { gitlab: { secure: true } };
279
+ const gitlab = factory(GitLab, { options });
280
+ t.deepEqual(gitlab.certificateAuthorityOption, { https: { rejectUnauthorized: true } });
281
+ }
282
+
283
+ {
284
+ const options = { gitlab: { certificateAuthorityFile: 'cert.crt', secure: true } };
285
+ const gitlab = factory(GitLab, { options });
286
+ t.deepEqual(gitlab.certificateAuthorityOption, {
287
+ https: { certificateAuthority: 'test certificate', rejectUnauthorized: true }
288
+ });
289
+ }
290
+
291
+ {
292
+ const options = { gitlab: { certificateAuthorityFile: 'cert.crt', secure: false } };
293
+ const gitlab = factory(GitLab, { options });
294
+ t.deepEqual(gitlab.certificateAuthorityOption, {
295
+ https: { certificateAuthority: 'test certificate', rejectUnauthorized: false }
296
+ });
297
+ }
298
+
299
+ sandbox.restore();
300
+ });
package/types/config.d.ts CHANGED
@@ -170,6 +170,9 @@ export interface Config {
170
170
 
171
171
  /** @default null */
172
172
  certificateAuthorityFile?: any;
173
+
174
+ /** @default null */
175
+ secure?: boolean;
173
176
 
174
177
  /** @default null */
175
178
  assets?: any;