release-it 19.0.1 → 19.0.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/README.md +1 -1
- package/config/release-it.json +1 -1
- package/lib/plugin/git/Git.js +8 -6
- package/lib/plugin/npm/npm.js +2 -1
- package/lib/shell.js +43 -13
- package/package.json +17 -18
- package/schema/gitlab.json +1 -1
- package/types/config.d.ts +1 -1
package/README.md
CHANGED
|
@@ -162,7 +162,7 @@ GitLab projects can have releases attached to Git tags, containing release notes
|
|
|
162
162
|
releases][32]:
|
|
163
163
|
|
|
164
164
|
- Configure `gitlab.release: true`
|
|
165
|
-
- Obtain a [personal access token][33] (release-it
|
|
165
|
+
- Obtain a [personal access token][33] (release-it needs the `api` and `self_rotate` scopes).
|
|
166
166
|
- Make sure the token is [available as an environment variable][34].
|
|
167
167
|
|
|
168
168
|
→ See [GitLab Releases][35] for more details.
|
package/config/release-it.json
CHANGED
package/lib/plugin/git/Git.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EOL } from 'node:os';
|
|
2
|
-
import {
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
3
|
import matcher from 'wildcard-match';
|
|
4
4
|
import { format, e, fixArgs, once, castArray } from '../../util.js';
|
|
5
5
|
import GitBase from '../GitBase.js';
|
|
@@ -11,11 +11,13 @@ const options = { write: false };
|
|
|
11
11
|
|
|
12
12
|
const docs = 'https://git.io/release-it-git';
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
(
|
|
17
|
-
(
|
|
18
|
-
|
|
14
|
+
async function isGitRepo() {
|
|
15
|
+
return await new Promise(resolve => {
|
|
16
|
+
const process = spawn('git', ['rev-parse', '--git-dir']);
|
|
17
|
+
process.on('close', code => resolve(code === 0));
|
|
18
|
+
process.on('error', () => resolve(false));
|
|
19
|
+
});
|
|
20
|
+
}
|
|
19
21
|
|
|
20
22
|
class Git extends GitBase {
|
|
21
23
|
constructor(...args) {
|
package/lib/plugin/npm/npm.js
CHANGED
|
@@ -14,6 +14,7 @@ const DEFAULT_TAG = 'latest';
|
|
|
14
14
|
const DEFAULT_TAG_PRERELEASE = 'next';
|
|
15
15
|
const NPM_BASE_URL = 'https://www.npmjs.com';
|
|
16
16
|
const NPM_PUBLIC_PATH = '/package';
|
|
17
|
+
const DEFAULT_TIMEOUT = 10;
|
|
17
18
|
|
|
18
19
|
class npm extends Plugin {
|
|
19
20
|
static isEnabled(options) {
|
|
@@ -32,7 +33,7 @@ class npm extends Plugin {
|
|
|
32
33
|
|
|
33
34
|
const { publish, skipChecks } = this.options;
|
|
34
35
|
|
|
35
|
-
const timeout = Number(this.options.timeout) * 1000;
|
|
36
|
+
const timeout = Number(this.options.timeout ?? DEFAULT_TIMEOUT) * 1000;
|
|
36
37
|
|
|
37
38
|
if (publish === false || isPrivate) return;
|
|
38
39
|
|
package/lib/shell.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import util from 'node:util';
|
|
2
|
-
import
|
|
3
|
-
import { x } from 'tinyexec';
|
|
2
|
+
import { spawn, exec } from 'node:child_process';
|
|
4
3
|
import { format } from './util.js';
|
|
5
4
|
|
|
6
5
|
const debug = util.debug('release-it:shell');
|
|
@@ -53,7 +52,7 @@ class Shell {
|
|
|
53
52
|
|
|
54
53
|
execStringCommand(command, options, { isExternal }) {
|
|
55
54
|
return new Promise((resolve, reject) => {
|
|
56
|
-
const proc =
|
|
55
|
+
const proc = exec(command, (err, stdout, stderr) => {
|
|
57
56
|
stdout = stdout.toString().trimEnd();
|
|
58
57
|
const code = !err ? 0 : err === 'undefined' ? 1 : err.code;
|
|
59
58
|
debug({ command, options, code, stdout, stderr });
|
|
@@ -68,21 +67,52 @@ class Shell {
|
|
|
68
67
|
});
|
|
69
68
|
}
|
|
70
69
|
|
|
71
|
-
async execWithArguments(command, options, { isExternal }) {
|
|
70
|
+
async execWithArguments(command, options = {}, { isExternal } = {}) {
|
|
72
71
|
const [program, ...programArgs] = command;
|
|
73
72
|
|
|
74
73
|
try {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
74
|
+
return await new Promise((resolve, reject) => {
|
|
75
|
+
const proc = spawn(program, programArgs, {
|
|
76
|
+
// we want to capture all output from the process so the extra 2 pipe
|
|
77
|
+
stdio: ['inherit', 'pipe', 'pipe'],
|
|
78
|
+
...options
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
let stdout = '';
|
|
82
|
+
let stderr = '';
|
|
83
|
+
|
|
84
|
+
proc.stdout.on('data', data => {
|
|
85
|
+
stdout += data.toString();
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
proc.stderr.on('data', data => {
|
|
89
|
+
stderr += data.toString();
|
|
90
|
+
});
|
|
91
|
+
|
|
92
|
+
proc.on('close', code => {
|
|
93
|
+
stdout = stdout === '""' ? '' : stdout;
|
|
94
|
+
this.log.verbose(stdout, { isExternal });
|
|
95
|
+
debug({ command, options, stdout, stderr });
|
|
96
|
+
|
|
97
|
+
if (code === 0) {
|
|
98
|
+
resolve((stdout || stderr).trim());
|
|
99
|
+
} else {
|
|
100
|
+
if (stdout) {
|
|
101
|
+
this.log.log(`\n${stdout}`);
|
|
102
|
+
}
|
|
103
|
+
debug({ code, command, options, stdout, stderr });
|
|
104
|
+
reject(new Error(stderr || stdout || `Process exited with code ${code}`));
|
|
105
|
+
}
|
|
106
|
+
});
|
|
107
|
+
|
|
108
|
+
proc.on('error', err => {
|
|
109
|
+
debug(err);
|
|
110
|
+
reject(new Error(err.message));
|
|
111
|
+
});
|
|
112
|
+
});
|
|
80
113
|
} catch (err) {
|
|
81
|
-
if (err.output.stdout) {
|
|
82
|
-
this.log.log(`\n${err.output.stdout}`);
|
|
83
|
-
}
|
|
84
114
|
debug(err);
|
|
85
|
-
return Promise.reject(
|
|
115
|
+
return Promise.reject(err);
|
|
86
116
|
}
|
|
87
117
|
}
|
|
88
118
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-it",
|
|
3
|
-
"version": "19.0.
|
|
3
|
+
"version": "19.0.3",
|
|
4
4
|
"description": "Generic CLI tool to automate versioning and package publishing-related tasks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build",
|
|
@@ -80,42 +80,41 @@
|
|
|
80
80
|
"dependencies": {
|
|
81
81
|
"@nodeutils/defaults-deep": "1.1.0",
|
|
82
82
|
"@octokit/rest": "21.1.1",
|
|
83
|
-
"@phun-ky/typeof": "1.2.
|
|
83
|
+
"@phun-ky/typeof": "1.2.8",
|
|
84
84
|
"async-retry": "1.3.3",
|
|
85
|
-
"c12": "3.0.
|
|
85
|
+
"c12": "3.0.4",
|
|
86
86
|
"ci-info": "^4.2.0",
|
|
87
87
|
"eta": "3.5.0",
|
|
88
88
|
"git-url-parse": "16.1.0",
|
|
89
|
-
"inquirer": "12.
|
|
89
|
+
"inquirer": "12.6.3",
|
|
90
90
|
"issue-parser": "7.0.1",
|
|
91
91
|
"lodash.get": "4.4.2",
|
|
92
92
|
"lodash.merge": "4.6.2",
|
|
93
93
|
"mime-types": "3.0.1",
|
|
94
94
|
"new-github-release-url": "2.0.0",
|
|
95
|
-
"open": "10.1.
|
|
95
|
+
"open": "10.1.2",
|
|
96
96
|
"ora": "8.2.0",
|
|
97
|
-
"os-name": "6.
|
|
97
|
+
"os-name": "6.1.0",
|
|
98
98
|
"proxy-agent": "6.5.0",
|
|
99
|
-
"semver": "7.7.
|
|
100
|
-
"
|
|
101
|
-
"tinyglobby": "0.2.12",
|
|
99
|
+
"semver": "7.7.2",
|
|
100
|
+
"tinyglobby": "0.2.14",
|
|
102
101
|
"undici": "6.21.2",
|
|
103
102
|
"url-join": "5.0.0",
|
|
104
103
|
"wildcard-match": "5.1.4",
|
|
105
104
|
"yargs-parser": "21.1.1"
|
|
106
105
|
},
|
|
107
106
|
"devDependencies": {
|
|
108
|
-
"@eslint/compat": "1.2.
|
|
107
|
+
"@eslint/compat": "1.2.9",
|
|
109
108
|
"@eslint/eslintrc": "3.3.1",
|
|
110
|
-
"@eslint/js": "9.
|
|
109
|
+
"@eslint/js": "9.27.0",
|
|
111
110
|
"@octokit/request-error": "6.1.8",
|
|
112
|
-
"@types/node": "20.17.
|
|
113
|
-
"eslint": "9.
|
|
114
|
-
"eslint-plugin-import-x": "4.
|
|
115
|
-
"globals": "16.
|
|
111
|
+
"@types/node": "20.17.32",
|
|
112
|
+
"eslint": "9.27.0",
|
|
113
|
+
"eslint-plugin-import-x": "4.13.3",
|
|
114
|
+
"globals": "16.2.0",
|
|
116
115
|
"installed-check": "9.3.0",
|
|
117
|
-
"knip": "5.
|
|
118
|
-
"mentoss": "0.
|
|
116
|
+
"knip": "5.59.1",
|
|
117
|
+
"mentoss": "0.11.0",
|
|
119
118
|
"mock-stdio": "1.0.3",
|
|
120
119
|
"prettier": "3.5.3",
|
|
121
120
|
"remark-cli": "12.0.1",
|
|
@@ -128,7 +127,7 @@
|
|
|
128
127
|
"socks": "2.8.3"
|
|
129
128
|
},
|
|
130
129
|
"engines": {
|
|
131
|
-
"node": "^20.
|
|
130
|
+
"node": "^20.12.0 || >=22.0.0"
|
|
132
131
|
},
|
|
133
132
|
"remarkConfig": {
|
|
134
133
|
"plugins": [
|
package/schema/gitlab.json
CHANGED