Skip to content

Commit

Permalink
docs: add README
Browse files Browse the repository at this point in the history
  • Loading branch information
a145789 committed Nov 14, 2023
1 parent c92c5a0 commit 3aeba30
Show file tree
Hide file tree
Showing 5 changed files with 256 additions and 3 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/release-tag.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,5 @@ jobs:
with:
tag_name: ${{ github.ref }}
body: |
更新内容请查看[CHANGELOG](https://github.com/varletjs/varlet/blob/dev/CHANGELOG.md)。
Please refer to [CHANGELOG](https://github.com/varletjs/varlet/blob/dev/CHANGELOG.md) for details.
更新内容请查看[CHANGELOG](https://github.com/varletjs/release/blob/main/CHANGELOG.md)。
Please refer to [CHANGELOG](https://github.com/varletjs/release/blob/main/CHANGELOG.md) for details.
2 changes: 1 addition & 1 deletion .prettierignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
dist/**

*.md
CHANGELOG.md
.github/**
.history/**

Expand Down
21 changes: 21 additions & 0 deletions LICENCE
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.
116 changes: 116 additions & 0 deletions README.md
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)
116 changes: 116 additions & 0 deletions README.zh-CN.md
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)

0 comments on commit 3aeba30

Please sign in to comment.