-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
256 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
dist/** | ||
|
||
*.md | ||
CHANGELOG.md | ||
.github/** | ||
.history/** | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
The MIT License (MIT) | ||
|
||
Copyright (c) 2022 varlet | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<h1 align="center">@varlet/release</h1> | ||
|
||
<p align="center"> | ||
<span>English</span> | | ||
<a href="https://github.com/varletjs/release/blob/main/README.zh-CN.md">中文</a> | ||
</p> | ||
<p align="center"> | ||
<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> | ||
<a href="https://github.com/valetjs/release/blob/master/LICENSE" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/github/license/varletjs/release" alt="License" /></a> | ||
</p> | ||
|
||
## Intro | ||
|
||
`@varlet/release` is a tool to release all packages and generate changelogs. | ||
|
||
## Installation | ||
|
||
### npm | ||
|
||
```shell | ||
npm install --save-dev @varlet/release | ||
``` | ||
|
||
### yarn | ||
|
||
```shell | ||
yarn add @varlet/release -D | ||
``` | ||
|
||
### pnpm | ||
|
||
```shell | ||
pnpm add @varlet/release -D | ||
``` | ||
|
||
## Usage | ||
|
||
### Using Command | ||
|
||
```shell | ||
# Release all packages and generate changelogs | ||
npx vr release | ||
|
||
# Specify remote name | ||
npx vr release -r <remote> | ||
# or | ||
npx vr release --remote <remote> | ||
|
||
# Just generate changelogs | ||
npx vr changelog | ||
|
||
# Specify changelog filename | ||
npx vr changelog -f <filename> | ||
# or | ||
npx vr changelog --file <filename> | ||
|
||
``` | ||
|
||
### Configuration | ||
|
||
#### release | ||
|
||
| Params | Instructions | | ||
| -------------------- | ------------------- | | ||
| -r --remote <remote> | Specify remote name | | ||
|
||
#### changelog | ||
|
||
| Params | Instructions | | ||
| --------------------------------- | -------------------------- | | ||
| -f --file <filename> | Specify changelog filename | | ||
| -rc --releaseCount <releaseCount> | Release count | | ||
|
||
### Custom Handle | ||
|
||
#### Example | ||
|
||
```js | ||
import { release, changelog } from '@varlet/release' | ||
|
||
// Do what you want to do... | ||
release() | ||
``` | ||
|
||
You can pass in a task that will be called before the publish after the package version is changed. | ||
|
||
```js | ||
import { release, changelog } from '@varlet/release' | ||
|
||
async function task() { | ||
await doSomething1() | ||
await doSomething2() | ||
} | ||
|
||
release({ task }) | ||
``` | ||
|
||
#### Types | ||
|
||
```ts | ||
interface ReleaseCommandOptions { | ||
remote?: string | ||
task?(): Promise<void> | ||
} | ||
function release(options: ReleaseCommandOptions): Promise<void> | ||
|
||
interface ChangelogCommandOptions { | ||
file?: string | ||
releaseCount?: number | ||
} | ||
function changelog({ releaseCount, file }?: ChangelogCommandOptions): Promise<void> | ||
``` | ||
|
||
## License | ||
|
||
[MIT](https://github.com/varletjs/release/blob/main/LICENSE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
<h1 align="center">@varlet/release</h1> | ||
|
||
<p align="center"> | ||
<span>中文</span> | | ||
<a href="https://github.com/varletjs/release/blob/main/README.md">English</a> | ||
</p> | ||
<p align="center"> | ||
<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> | ||
<a href="https://github.com/valetjs/release/blob/master/LICENSE" target="_blank" rel="noopener noreferrer"><img src="https://badgen.net/github/license/varletjs/release" alt="License" /></a> | ||
</p> | ||
|
||
## 介绍 | ||
|
||
`@varlet/release 是一个用于发布所有包并生成变更日志的工具。 | ||
|
||
## 安装 | ||
|
||
### npm | ||
|
||
```shell | ||
npm install --save-dev @varlet/release | ||
``` | ||
|
||
### yarn | ||
|
||
```shell | ||
yarn add @varlet/release -D | ||
``` | ||
|
||
### pnpm | ||
|
||
```shell | ||
pnpm add @varlet/release -D | ||
``` | ||
|
||
## 使用 | ||
|
||
### 使用命令 | ||
|
||
```shell | ||
# 发布所有包并生成变更日志 | ||
npx vr release | ||
|
||
# 指定远程仓库名称 | ||
npx vr release -r <remote> | ||
# or | ||
npx vr release --remote <remote> | ||
|
||
# 仅生成变更日志 | ||
npx vr changelog | ||
|
||
# 指定变更日志文件名 | ||
npx vr changelog -f <filename> | ||
# or | ||
npx vr changelog --file <filename> | ||
|
||
``` | ||
|
||
### 配置 | ||
|
||
#### release | ||
|
||
| 参数 | 说明 | | ||
| -------------------- | ---------------- | | ||
| -r --remote <remote> | 指定远程仓库名称 | | ||
|
||
#### changelog | ||
|
||
| 参数 | 说明 | | ||
| --------------------------------- | ------------------ | | ||
| -f --file <filename> | 指定变更日志文件名 | | ||
| -rc --releaseCount <releaseCount> | 发布数量 | | ||
|
||
### 自定义处理 | ||
|
||
#### 示例 | ||
|
||
```js | ||
import { release, changelog } from '@varlet/release' | ||
|
||
// Do what you want to do... | ||
release() | ||
``` | ||
|
||
你可以传入一个 `task`,在包版本更改后,在发布之前会调用 `task`。 | ||
|
||
```js | ||
import { release, changelog } from '@varlet/release' | ||
|
||
async function task() { | ||
await doSomething1() | ||
await doSomething2() | ||
} | ||
|
||
release({ task }) | ||
``` | ||
|
||
#### 类型 | ||
|
||
```ts | ||
interface ReleaseCommandOptions { | ||
remote?: string | ||
task?(): Promise<void> | ||
} | ||
function release(options: ReleaseCommandOptions): Promise<void> | ||
|
||
interface ChangelogCommandOptions { | ||
file?: string | ||
releaseCount?: number | ||
} | ||
function changelog({ releaseCount, file }?: ChangelogCommandOptions): Promise<void> | ||
``` | ||
|
||
## License | ||
|
||
[MIT](https://github.com/varletjs/release/blob/main/LICENSE) |