@varlet/release 0.4.4 → 1.0.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 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
- ## Installation
17
-
18
- ```shell
19
- pnpm add @varlet/release -D
20
- ```
21
-
22
- ## Usage
23
-
24
- ### Using Command
25
-
26
- ```shell
27
- # Release all packages and generate changelogs
28
- npx vr release
29
-
30
- # Specify remote name
31
- npx vr release -r https://github.com/varletjs/varlet-release
32
- # or
33
- npx vr release --remote https://github.com/varletjs/varlet-release
34
-
35
- # Just generate changelogs
36
- npx vr changelog
37
-
38
- # Specify changelog filename
39
- npx vr changelog -f changelog.md
40
- # or
41
- npx vr changelog --file changelog.md
42
-
43
- # Lint commit message
44
- npx vr lint-commit -p .git/COMMIT_EDITMSG
45
-
46
- # Publish to npm, which can be called in the ci environment
47
- npx vr publish
48
- ```
49
-
50
- ### Configuration
51
-
52
- #### release
53
-
54
- | Params | Instructions |
55
- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------- |
56
- | -r --remote \<remote\> | Specify remote name |
57
- | -s --skip-npm-publish | Skip npm publish |
58
- | -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. |
59
- | -sc --skip-changelog | Skip generate changelog |
60
- | -sgt --skip-git-tag | Skip git tag |
61
- | -nt --npm-tag \<npmTag\> | npm tag |
62
-
63
- #### changelog
64
-
65
- | Params | Instructions |
66
- | ----------------------------------- | -------------------------- |
67
- | -f --file \<filename\> | Specify changelog filename |
68
- | -rc --releaseCount \<releaseCount\> | Release count |
69
- | -p --preset \<preset\> | Specify changelog preset |
70
-
71
- #### lint-commit
72
-
73
- | Params | Instructions |
74
- | ------------------------------- | ---------------------------------------------------------------------------------------------------------------------- |
75
- | -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 |
76
- | -r --commitMessageRe \<reg\> | Validate the regular of whether the commit message passes |
77
- | -e --errorMessage \<message\> | Validation failed to display error messages |
78
- | -w --warningMessage \<message\> | Validation failed to display warning messages |
79
-
80
- #### publish
81
-
82
- | Params | Instructions |
83
- | ------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |
84
- | -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 |
85
- | -nt --npm-tag \<npmTag\> | npm tag |
86
-
87
- ### Custom Handle
88
-
89
- #### Example
90
-
91
- ```js
92
- import { changelog, release } from '@varlet/release'
93
-
94
- // Do what you want to do...
95
- release()
96
- ```
97
-
98
- You can pass in a task that will be called before the publish after the package version is changed.
99
-
100
- ```js
101
- import { changelog, release } from '@varlet/release'
102
-
103
- async function task() {
104
- await doSomething1()
105
- await doSomething2()
106
- }
107
-
108
- release({ task })
109
- ```
110
-
111
- #### Types
112
-
113
- ```ts
114
- interface PublishCommandOptions {
115
- preRelease?: boolean
116
- checkRemoteVersion?: boolean
117
- npmTag?: string
118
- }
119
- function publish({ preRelease, checkRemoteVersion, npmTag }: PublishCommandOptions): Promise<void>
120
- function updateVersion(version: string): void
121
- interface ReleaseCommandOptions {
122
- remote?: string
123
- skipNpmPublish?: boolean
124
- skipChangelog?: boolean
125
- skipGitTag?: boolean
126
- npmTag?: string
127
- task?(newVersion: string, oldVersion: string): Promise<void>
128
- }
129
- function release(options: ReleaseCommandOptions): Promise<void>
130
-
131
- interface ChangelogCommandOptions {
132
- file?: string
133
- releaseCount?: number
134
- preset?:
135
- | 'angular'
136
- | 'atom'
137
- | 'codemirror'
138
- | 'conventionalcommits'
139
- | 'ember'
140
- | 'eslint'
141
- | 'express'
142
- | 'jquery'
143
- | 'jshint'
144
- }
145
- function changelog({ releaseCount, file, preset }?: ChangelogCommandOptions): Promise<void>
146
-
147
- const COMMIT_MESSAGE_RE: RegExp
148
- function isVersionCommitMessage(message: string): string | false | null
149
- function getCommitMessage(commitMessagePath: string): string
150
- interface CommitLintCommandOptions {
151
- commitMessagePath: string
152
- commitMessageRe?: string | RegExp
153
- errorMessage?: string
154
- warningMessage?: string
155
- }
156
- function commitLint(options: CommitLintCommandOptions): void
157
- ```
158
-
159
- ## License
160
-
161
- [MIT](https://github.com/varletjs/release/blob/main/LICENSE)
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)