@varlet/release 0.4.4 → 1.0.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 +163 -161
- package/README.zh-CN.md +163 -161
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +19 -0
- package/dist/index.d.ts +39 -26
- package/dist/index.js +278 -299
- package/package.json +37 -35
- package/bin/index.js +0 -47
- package/dist/index.cjs +0 -409
- package/dist/index.d.cts +0 -41
package/README.md
CHANGED
|
@@ -1,161 +1,163 @@
|
|
|
1
|
-
<h1 align="center">Varlet Release</h1>
|
|
2
|
-
|
|
3
|
-
<p align="center">
|
|
4
|
-
<span>English</span> |
|
|
5
|
-
<a href="https://github.com/varletjs/release/blob/main/README.zh-CN.md">中文</a>
|
|
6
|
-
</p>
|
|
7
|
-
<p align="center">
|
|
8
|
-
<a href="https://www.npmjs.com/package/@varlet/release" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/npm/v/@varlet/release" alt="NPM Version" /></a>
|
|
9
|
-
<a href="https://github.com/varletjs/release/blob/main/LICENSE" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/github/license/varletjs/release" alt="License" /></a>
|
|
10
|
-
</p>
|
|
11
|
-
|
|
12
|
-
## Intro
|
|
13
|
-
|
|
14
|
-
`Varlet Release` is a tool used for publishing all packages, generating change logs, and checking `commit messages`, relying on `pnpm`.
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
#
|
|
33
|
-
npx vr release
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
#
|
|
41
|
-
npx vr changelog
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
|
57
|
-
|
|
|
58
|
-
| -
|
|
59
|
-
| -
|
|
60
|
-
| -
|
|
61
|
-
| -
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
|
68
|
-
|
|
|
69
|
-
| -
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
|
76
|
-
|
|
|
77
|
-
| -
|
|
78
|
-
| -
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
|
85
|
-
|
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
| '
|
|
138
|
-
| '
|
|
139
|
-
| '
|
|
140
|
-
| '
|
|
141
|
-
| '
|
|
142
|
-
| '
|
|
143
|
-
| '
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
1
|
+
<h1 align="center">Varlet Release</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">
|
|
4
|
+
<span>English</span> |
|
|
5
|
+
<a href="https://github.com/varletjs/release/blob/main/README.zh-CN.md">中文</a>
|
|
6
|
+
</p>
|
|
7
|
+
<p align="center">
|
|
8
|
+
<a href="https://www.npmjs.com/package/@varlet/release" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/npm/v/@varlet/release" alt="NPM Version" /></a>
|
|
9
|
+
<a href="https://github.com/varletjs/release/blob/main/LICENSE" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/github/license/varletjs/release" alt="License" /></a>
|
|
10
|
+
</p>
|
|
11
|
+
|
|
12
|
+
## Intro
|
|
13
|
+
|
|
14
|
+
`Varlet Release` is a tool used for publishing all packages, generating change logs, and checking `commit messages`, relying on `pnpm`.
|
|
15
|
+
|
|
16
|
+
> `Varlet Release` requires `Node.js` ^20.19.0 || >=22.12.0 and `esm` only.
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
```shell
|
|
21
|
+
pnpm add @varlet/release -D
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Using Command
|
|
27
|
+
|
|
28
|
+
```shell
|
|
29
|
+
# Release all packages and generate changelogs
|
|
30
|
+
npx vr release
|
|
31
|
+
|
|
32
|
+
# Specify remote name
|
|
33
|
+
npx vr release -r https://github.com/varletjs/varlet-release
|
|
34
|
+
# or
|
|
35
|
+
npx vr release --remote https://github.com/varletjs/varlet-release
|
|
36
|
+
|
|
37
|
+
# Just generate changelogs
|
|
38
|
+
npx vr changelog
|
|
39
|
+
|
|
40
|
+
# Specify changelog filename
|
|
41
|
+
npx vr changelog -f changelog.md
|
|
42
|
+
# or
|
|
43
|
+
npx vr changelog --file changelog.md
|
|
44
|
+
|
|
45
|
+
# Lint commit message
|
|
46
|
+
npx vr lint-commit -p .git/COMMIT_EDITMSG
|
|
47
|
+
|
|
48
|
+
# Publish to npm, which can be called in the ci environment
|
|
49
|
+
npx vr publish
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
### Configuration
|
|
53
|
+
|
|
54
|
+
#### release
|
|
55
|
+
|
|
56
|
+
| Params | Instructions |
|
|
57
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
|
|
58
|
+
| -r --remote \<remote\> | Specify remote name |
|
|
59
|
+
| -s --skip-npm-publish | Skip npm publish |
|
|
60
|
+
| -c --check-remote-version | Check if the remote version of the npm package is the same as the one you want to publish locally, if so, stop execution. |
|
|
61
|
+
| -sc --skip-changelog | Skip generate changelog |
|
|
62
|
+
| -sgt --skip-git-tag | Skip git tag |
|
|
63
|
+
| -nt --npm-tag \<npmTag\> | npm tag |
|
|
64
|
+
|
|
65
|
+
#### changelog
|
|
66
|
+
|
|
67
|
+
| Params | Instructions |
|
|
68
|
+
| ----------------------------------- | -------------------------- |
|
|
69
|
+
| -f --file \<filename\> | Specify changelog filename |
|
|
70
|
+
| -rc --releaseCount \<releaseCount\> | Release count |
|
|
71
|
+
| -p --preset \<preset\> | Specify changelog preset |
|
|
72
|
+
|
|
73
|
+
#### lint-commit
|
|
74
|
+
|
|
75
|
+
| Params | Instructions |
|
|
76
|
+
| ------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
|
|
77
|
+
| -p --commitMessagePath \<path\> | The path of the temporary file to which the git message is submitted. The git hook commit-msg will pass this parameter |
|
|
78
|
+
| -r --commitMessageRe \<reg\> | Validate the regular of whether the commit message passes |
|
|
79
|
+
| -e --errorMessage \<message\> | Validation failed to display error messages |
|
|
80
|
+
| -w --warningMessage \<message\> | Validation failed to display warning messages |
|
|
81
|
+
|
|
82
|
+
#### publish
|
|
83
|
+
|
|
84
|
+
| Params | Instructions |
|
|
85
|
+
| ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
|
|
86
|
+
| -c --check-remote-version | Detects whether the remote version of the npm package is the same as the package version to be published locally, and if it is, skip the release |
|
|
87
|
+
| -nt --npm-tag \<npmTag\> | npm tag |
|
|
88
|
+
|
|
89
|
+
### Custom Handle
|
|
90
|
+
|
|
91
|
+
#### Example
|
|
92
|
+
|
|
93
|
+
```js
|
|
94
|
+
import { changelog, release } from '@varlet/release'
|
|
95
|
+
|
|
96
|
+
// Do what you want to do...
|
|
97
|
+
release()
|
|
98
|
+
```
|
|
99
|
+
|
|
100
|
+
You can pass in a task that will be called before the publish after the package version is changed.
|
|
101
|
+
|
|
102
|
+
```js
|
|
103
|
+
import { changelog, release } from '@varlet/release'
|
|
104
|
+
|
|
105
|
+
async function task() {
|
|
106
|
+
await doSomething1()
|
|
107
|
+
await doSomething2()
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
release({ task })
|
|
111
|
+
```
|
|
112
|
+
|
|
113
|
+
#### Types
|
|
114
|
+
|
|
115
|
+
```ts
|
|
116
|
+
interface PublishCommandOptions {
|
|
117
|
+
preRelease?: boolean
|
|
118
|
+
checkRemoteVersion?: boolean
|
|
119
|
+
npmTag?: string
|
|
120
|
+
}
|
|
121
|
+
function publish({ preRelease, checkRemoteVersion, npmTag }: PublishCommandOptions): Promise<void>
|
|
122
|
+
function updateVersion(version: string): void
|
|
123
|
+
interface ReleaseCommandOptions {
|
|
124
|
+
remote?: string
|
|
125
|
+
skipNpmPublish?: boolean
|
|
126
|
+
skipChangelog?: boolean
|
|
127
|
+
skipGitTag?: boolean
|
|
128
|
+
npmTag?: string
|
|
129
|
+
task?(newVersion: string, oldVersion: string): Promise<void>
|
|
130
|
+
}
|
|
131
|
+
function release(options: ReleaseCommandOptions): Promise<void>
|
|
132
|
+
|
|
133
|
+
interface ChangelogCommandOptions {
|
|
134
|
+
file?: string
|
|
135
|
+
releaseCount?: number
|
|
136
|
+
preset?:
|
|
137
|
+
| 'angular'
|
|
138
|
+
| 'atom'
|
|
139
|
+
| 'codemirror'
|
|
140
|
+
| 'conventionalcommits'
|
|
141
|
+
| 'ember'
|
|
142
|
+
| 'eslint'
|
|
143
|
+
| 'express'
|
|
144
|
+
| 'jquery'
|
|
145
|
+
| 'jshint'
|
|
146
|
+
}
|
|
147
|
+
function changelog({ releaseCount, file, preset }?: ChangelogCommandOptions): Promise<void>
|
|
148
|
+
|
|
149
|
+
const COMMIT_MESSAGE_RE: RegExp
|
|
150
|
+
function isVersionCommitMessage(message: string): string | false | null
|
|
151
|
+
function getCommitMessage(commitMessagePath: string): string
|
|
152
|
+
interface CommitLintCommandOptions {
|
|
153
|
+
commitMessagePath: string
|
|
154
|
+
commitMessageRe?: string | RegExp
|
|
155
|
+
errorMessage?: string
|
|
156
|
+
warningMessage?: string
|
|
157
|
+
}
|
|
158
|
+
function commitLint(options: CommitLintCommandOptions): void
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
## License
|
|
162
|
+
|
|
163
|
+
[MIT](https://github.com/varletjs/release/blob/main/LICENSE)
|