release-it 15.0.0 → 15.1.1
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 +20 -12
- package/lib/index.js +1 -1
- package/lib/plugin/git/Git.js +2 -1
- package/package.json +12 -12
- package/test/git.js +14 -0
- package/test/github.js +3 -2
- package/test/plugins.js +1 -1
- package/test/tasks.interactive.js +4 -0
package/README.md
CHANGED
|
@@ -35,9 +35,8 @@ environments running Node.js v10 and v12. Also see [CHANGELOG.md](./CHANGELOG.md
|
|
|
35
35
|
|
|
36
36
|
## Installation
|
|
37
37
|
|
|
38
|
-
Although release-it is a **generic** release tool,
|
|
39
|
-
|
|
40
|
-
and it's ready:
|
|
38
|
+
Although release-it is a **generic** release tool, most projects use it for projects with npm packages. The recommended
|
|
39
|
+
way to install release-it uses npm and adds some minimal configuration to get started:
|
|
41
40
|
|
|
42
41
|
```bash
|
|
43
42
|
npm init release-it
|
|
@@ -46,7 +45,7 @@ npm init release-it
|
|
|
46
45
|
Alternatively, install it manually, and add the `release` script to `package.json`:
|
|
47
46
|
|
|
48
47
|
```bash
|
|
49
|
-
npm install
|
|
48
|
+
npm install -D release-it
|
|
50
49
|
```
|
|
51
50
|
|
|
52
51
|
```json
|
|
@@ -62,24 +61,33 @@ npm install --save-dev release-it
|
|
|
62
61
|
}
|
|
63
62
|
```
|
|
64
63
|
|
|
65
|
-
Now you can run `npm run release` from the command line (
|
|
64
|
+
Now you can run `npm run release` from the command line (put release-it arguments behind the `-- `):
|
|
66
65
|
|
|
67
66
|
```bash
|
|
68
67
|
npm run release
|
|
69
68
|
npm run release -- minor --ci
|
|
70
69
|
```
|
|
71
70
|
|
|
72
|
-
### Global
|
|
71
|
+
### Global Installation
|
|
73
72
|
|
|
74
|
-
|
|
73
|
+
#### Using npx or npm
|
|
74
|
+
|
|
75
|
+
Use npx to run release-it directly from anywhere:
|
|
75
76
|
|
|
76
77
|
```bash
|
|
77
|
-
# Run release-it from anywhere (without installation)
|
|
78
78
|
npx release-it
|
|
79
|
+
```
|
|
79
80
|
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
Or use npm to install and run release-it globally:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
npm install -g release-it
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
#### Using Homebrew
|
|
88
|
+
|
|
89
|
+
```bash
|
|
90
|
+
brew install release-it
|
|
83
91
|
```
|
|
84
92
|
|
|
85
93
|
## Usage
|
|
@@ -90,7 +98,7 @@ Release a new version:
|
|
|
90
98
|
release-it
|
|
91
99
|
```
|
|
92
100
|
|
|
93
|
-
You will be prompted to select the new version, and more prompts will follow based on your
|
|
101
|
+
You will be prompted to select the new version, and more prompts will follow based on your configuration.
|
|
94
102
|
|
|
95
103
|
Run release-it from the root of the project to prevent potential issues.
|
|
96
104
|
|
package/lib/index.js
CHANGED
package/lib/plugin/git/Git.js
CHANGED
|
@@ -168,7 +168,8 @@ class Git extends GitBase {
|
|
|
168
168
|
|
|
169
169
|
commit({ message = this.options.commitMessage, args = this.options.commitArgs } = {}) {
|
|
170
170
|
const msg = format(message, this.config.getContext());
|
|
171
|
-
|
|
171
|
+
const commitMessageArgs = msg ? ['--message', msg] : [];
|
|
172
|
+
return this.exec(['git', 'commit', ...commitMessageArgs, ...fixArgs(args)]).then(
|
|
172
173
|
() => this.setContext({ isCommitted: true }),
|
|
173
174
|
err => {
|
|
174
175
|
this.debug(err);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "release-it",
|
|
3
|
-
"version": "15.
|
|
3
|
+
"version": "15.1.1",
|
|
4
4
|
"description": "Generic CLI tool to automate versioning and package publishing related tasks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build",
|
|
@@ -66,39 +66,39 @@
|
|
|
66
66
|
"execa": "6.1.0",
|
|
67
67
|
"form-data": "4.0.0",
|
|
68
68
|
"git-url-parse": "11.6.0",
|
|
69
|
-
"globby": "13.1.
|
|
70
|
-
"got": "12.0
|
|
71
|
-
"inquirer": "
|
|
69
|
+
"globby": "13.1.2",
|
|
70
|
+
"got": "12.1.0",
|
|
71
|
+
"inquirer": "9.0.0",
|
|
72
72
|
"is-ci": "3.0.1",
|
|
73
73
|
"lodash": "4.17.21",
|
|
74
74
|
"mime-types": "2.1.35",
|
|
75
75
|
"new-github-release-url": "2.0.0",
|
|
76
76
|
"open": "8.4.0",
|
|
77
|
-
"ora": "6.1.
|
|
77
|
+
"ora": "6.1.2",
|
|
78
78
|
"os-name": "5.0.1",
|
|
79
79
|
"promise.allsettled": "1.0.5",
|
|
80
80
|
"proxy-agent": "5.0.0",
|
|
81
81
|
"semver": "7.3.7",
|
|
82
82
|
"shelljs": "0.8.5",
|
|
83
|
-
"update-notifier": "
|
|
83
|
+
"update-notifier": "6.0.2",
|
|
84
84
|
"url-join": "5.0.0",
|
|
85
85
|
"wildcard-match": "5.1.2",
|
|
86
86
|
"yargs-parser": "21.0.1"
|
|
87
87
|
},
|
|
88
88
|
"devDependencies": {
|
|
89
89
|
"@octokit/request-error": "2.1.0",
|
|
90
|
-
"ava": "4.
|
|
91
|
-
"eslint": "8.
|
|
90
|
+
"ava": "4.3.0",
|
|
91
|
+
"eslint": "8.18.0",
|
|
92
92
|
"eslint-config-prettier": "8.5.0",
|
|
93
93
|
"eslint-plugin-ava": "13.2.0",
|
|
94
94
|
"eslint-plugin-import": "2.26.0",
|
|
95
|
-
"eslint-plugin-prettier": "4.
|
|
95
|
+
"eslint-plugin-prettier": "4.1.0",
|
|
96
96
|
"mock-fs": "5.1.2",
|
|
97
97
|
"mock-stdio": "1.0.3",
|
|
98
|
-
"nock": "13.2.
|
|
98
|
+
"nock": "13.2.7",
|
|
99
99
|
"nyc": "15.1.0",
|
|
100
|
-
"prettier": "2.
|
|
101
|
-
"sinon": "
|
|
100
|
+
"prettier": "2.7.1",
|
|
101
|
+
"sinon": "14.0.0",
|
|
102
102
|
"strip-ansi": "7.0.1"
|
|
103
103
|
},
|
|
104
104
|
"engines": {
|
package/test/git.js
CHANGED
|
@@ -140,6 +140,20 @@ test.serial('should commit, tag and push with extra args', async t => {
|
|
|
140
140
|
stub.restore();
|
|
141
141
|
});
|
|
142
142
|
|
|
143
|
+
test.serial('should amend commit without message if not provided', async t => {
|
|
144
|
+
const bare = mkTmpDir();
|
|
145
|
+
sh.exec(`git init --bare ${bare}`);
|
|
146
|
+
sh.exec(`git clone ${bare} .`);
|
|
147
|
+
gitAdd('line', 'file', 'Add file');
|
|
148
|
+
const options = { git: { commitArgs: ['--amend', '--no-edit', '--no-verify'] } };
|
|
149
|
+
const gitClient = factory(Git, { options });
|
|
150
|
+
const stub = sinon.stub(gitClient.shell, 'exec').resolves();
|
|
151
|
+
await gitClient.stage('package.json');
|
|
152
|
+
await gitClient.commit();
|
|
153
|
+
t.deepEqual(stub.secondCall.args[0], ['git', 'commit', '--amend', '--no-edit', '--no-verify']);
|
|
154
|
+
stub.restore();
|
|
155
|
+
});
|
|
156
|
+
|
|
143
157
|
test.serial('should commit and tag with quoted characters', async t => {
|
|
144
158
|
const bare = mkTmpDir();
|
|
145
159
|
sh.exec(`git init --bare ${bare}`);
|
package/test/github.js
CHANGED
|
@@ -198,7 +198,8 @@ test('should create new release for unreleased tag', async t => {
|
|
|
198
198
|
});
|
|
199
199
|
|
|
200
200
|
test('should release to enterprise host', async t => {
|
|
201
|
-
const
|
|
201
|
+
const options = { git, github: { tokenRef, pushRepo: 'git://github.example.org:user/repo' } };
|
|
202
|
+
const github = factory(GitHub, { options });
|
|
202
203
|
const exec = sinon.stub(github.shell, 'exec').callThrough();
|
|
203
204
|
exec.withArgs('git remote get-url origin').resolves(`https://github.example.org/user/repo`);
|
|
204
205
|
exec.withArgs('git config --get remote.origin.url').resolves(`https://github.example.org/user/repo`);
|
|
@@ -307,7 +308,7 @@ test.serial('should skip authentication and collaborator checks when running on
|
|
|
307
308
|
|
|
308
309
|
t.is(authStub.callCount, 0);
|
|
309
310
|
t.is(collaboratorStub.callCount, 0);
|
|
310
|
-
t.is(github.getContext('username'),
|
|
311
|
+
t.is(github.getContext('username'), process.env.GITHUB_ACTOR);
|
|
311
312
|
|
|
312
313
|
authStub.restore();
|
|
313
314
|
collaboratorStub.restore();
|
package/test/plugins.js
CHANGED