release-it 15.0.0-esm.6 → 15.1.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.
- package/README.md +33 -26
- package/lib/index.js +1 -1
- package/lib/plugin/git/Git.js +2 -1
- package/package.json +9 -9
- package/test/git.js +14 -0
- package/test/github.js +2 -1
- package/test/plugins.js +1 -1
- package/test/tasks.interactive.js +4 -0
package/README.md
CHANGED
|
@@ -20,6 +20,11 @@ system, and hooks to execute any command you need to test, build, and/or publish
|
|
|
20
20
|
[](https://github.com/release-it/release-it/actions)
|
|
21
21
|
[](https://www.npmjs.com/package/release-it)
|
|
22
22
|
|
|
23
|
+
## Announcement
|
|
24
|
+
|
|
25
|
+
The latest major version is v15, supporting Node.js 14 and up (as Node.js v12 is EOL). Use release-it v14 for
|
|
26
|
+
environments running Node.js v10 and v12. Also see [CHANGELOG.md](./CHANGELOG.md).
|
|
27
|
+
|
|
23
28
|
## Links
|
|
24
29
|
|
|
25
30
|
- See [CHANGELOG.md](./CHANGELOG.md) for major/breaking updates, and
|
|
@@ -30,9 +35,8 @@ system, and hooks to execute any command you need to test, build, and/or publish
|
|
|
30
35
|
|
|
31
36
|
## Installation
|
|
32
37
|
|
|
33
|
-
Although release-it is a **generic** release tool,
|
|
34
|
-
|
|
35
|
-
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:
|
|
36
40
|
|
|
37
41
|
```bash
|
|
38
42
|
npm init release-it
|
|
@@ -41,7 +45,7 @@ npm init release-it
|
|
|
41
45
|
Alternatively, install it manually, and add the `release` script to `package.json`:
|
|
42
46
|
|
|
43
47
|
```bash
|
|
44
|
-
npm install
|
|
48
|
+
npm install -D release-it
|
|
45
49
|
```
|
|
46
50
|
|
|
47
51
|
```json
|
|
@@ -57,24 +61,33 @@ npm install --save-dev release-it
|
|
|
57
61
|
}
|
|
58
62
|
```
|
|
59
63
|
|
|
60
|
-
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 `-- `):
|
|
61
65
|
|
|
62
66
|
```bash
|
|
63
67
|
npm run release
|
|
64
68
|
npm run release -- minor --ci
|
|
65
69
|
```
|
|
66
70
|
|
|
67
|
-
### Global
|
|
71
|
+
### Global Installation
|
|
72
|
+
|
|
73
|
+
#### Using npx or npm
|
|
68
74
|
|
|
69
|
-
Use
|
|
75
|
+
Use npx to run release-it directly from anywhere:
|
|
70
76
|
|
|
71
77
|
```bash
|
|
72
|
-
# Run release-it from anywhere (without installation)
|
|
73
78
|
npx release-it
|
|
79
|
+
```
|
|
74
80
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
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
|
|
78
91
|
```
|
|
79
92
|
|
|
80
93
|
## Usage
|
|
@@ -85,7 +98,7 @@ Release a new version:
|
|
|
85
98
|
release-it
|
|
86
99
|
```
|
|
87
100
|
|
|
88
|
-
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.
|
|
89
102
|
|
|
90
103
|
Run release-it from the root of the project to prevent potential issues.
|
|
91
104
|
|
|
@@ -156,7 +169,8 @@ remote.
|
|
|
156
169
|
## GitHub Releases
|
|
157
170
|
|
|
158
171
|
GitHub projects can have releases attached to Git tags, containing release notes and assets. There are two ways to add
|
|
159
|
-
[GitHub releases](https://
|
|
172
|
+
[GitHub releases](https://docs.github.com/en/repositories/releasing-projects-on-github/about-releases) in your
|
|
173
|
+
release-it flow:
|
|
160
174
|
|
|
161
175
|
1. Automated (requires a `GITHUB_TOKEN`)
|
|
162
176
|
2. Manual (using the GitHub web interface with pre-populated fields)
|
|
@@ -326,29 +340,22 @@ While mostly used as a CLI tool, release-it can be used as a dependency to integ
|
|
|
326
340
|
- [antonmedv/fx](https://github.com/antonmedv/fx)
|
|
327
341
|
- [blockchain/blockchain-wallet-v4-frontend](https://github.com/blockchain/blockchain-wallet-v4-frontend)
|
|
328
342
|
- [callstack/linaria](https://github.com/callstack/linaria)
|
|
343
|
+
- [callstack/react-native-paper](https://github.com/callstack/react-native-paper)
|
|
329
344
|
- [ember-cli/ember-cli](https://github.com/ember-cli/ember-cli)
|
|
330
|
-
- [metalsmith/metalsmith](https://github.com/metalsmith/metalsmith)
|
|
331
|
-
- [react-native-paper](https://github.com/callstack/react-native-paper)
|
|
332
345
|
- [js-cookie/js-cookie](https://github.com/js-cookie/js-cookie)
|
|
333
|
-
- [
|
|
346
|
+
- [metalsmith/metalsmith](https://github.com/metalsmith/metalsmith)
|
|
334
347
|
- [mozilla/readability](https://github.com/mozilla/readability)
|
|
335
348
|
- [redis/node-redis](https://github.com/redis/node-redis)
|
|
349
|
+
- [saleor/saleor](https://github.com/saleor/saleor)
|
|
336
350
|
- [shipshapecode/shepherd](https://github.com/shipshapecode/shepherd)
|
|
351
|
+
- [StevenBlack/hosts](https://github.com/StevenBlack/hosts)
|
|
337
352
|
- [swagger-api/swagger-ui](https://github.com/swagger-api/swagger-ui) +
|
|
338
353
|
[swagger-editor](https://github.com/swagger-api/swagger-editor)
|
|
339
|
-
- [StevenBlack/hosts](https://github.com/StevenBlack/hosts)
|
|
340
354
|
- [tabler/tabler](https://github.com/tabler/tabler) + [tabler-icons](https://github.com/tabler/tabler-icons)
|
|
341
355
|
- [youzan/vant](https://github.com/youzan/vant)
|
|
342
356
|
- [Repositories that depend on release-it](https://github.com/release-it/release-it/network/dependents)
|
|
343
357
|
- GitHub search for [filename:.release-it.json](https://github.com/search?q=filename%3A.release-it.json)
|
|
344
358
|
|
|
345
|
-
##
|
|
359
|
+
## License
|
|
346
360
|
|
|
347
|
-
|
|
348
|
-
- [GitHub Help](https://docs.github.com) (→
|
|
349
|
-
[About Releases](https://docs.github.com/free-pro-team@latest/github/administering-a-repository/about-releases))
|
|
350
|
-
- [npm Blog: Publishing what you mean to publish](https://blog.npmjs.org/post/165769683050/publishing-what-you-mean-to-publish)
|
|
351
|
-
- [npm Documentation: package.json](https://docs.npmjs.com/cli/v6/configuring-npm/package-json)
|
|
352
|
-
- [Prereleases and npm](https://medium.com/@mbostock/prereleases-and-npm-e778fc5e2420)
|
|
353
|
-
- [Glob Primer (node-glob)](https://github.com/isaacs/node-glob#glob-primer) (release-it uses
|
|
354
|
-
[globby](https://github.com/sindresorhus/globby#readme))
|
|
361
|
+
[MIT](./LICENSE)
|
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.0",
|
|
4
4
|
"description": "Generic CLI tool to automate versioning and package publishing related tasks.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"build",
|
|
@@ -66,9 +66,9 @@
|
|
|
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",
|
|
@@ -87,18 +87,18 @@
|
|
|
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
95
|
"eslint-plugin-prettier": "4.0.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`);
|
package/test/plugins.js
CHANGED