Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: add contributing guide #2732

Merged
merged 1 commit into from
Oct 30, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
60 changes: 60 additions & 0 deletions CONTRIBUTING-zh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# 贡献指南

我们真的很高兴你有兴趣为 qiankun 贡献。在提交您的代码之前,请务必花点时间阅读以下指南:

### 1. 安装 Node.js 和 pnpm

前往 <https://nodejs.org/> 下载并安装适合你的操作系统的最新稳定版本。安装 pnpm: <https://pnpm.io/installation>

### 2. 分叉并签出你自己的仓库

进入 <https://github.com/umjs/qiankun>,点击“Fork”按钮。然后按照 [GitHub 文档](https://help.github.com/articles/fork-a-repo)进行分叉和克隆。

克隆自己的分叉:

```shell
git clone https://github.com/<你的 Github 用户名>/qiankun
```

在克隆仓库后,需要运行 `pnpm install` 以获得所有必要的依赖。

```shell
cd qiankun
pnpm install
```

此步骤必须连接网络。它需要下载很多依赖。

**注意**:每次从主仓库拉取代码后都重新运行 `pnpm install` 有助于确保使用最新的开发依赖。

### 3. 更改代码 & 补充/更新测试用例

测试代码位于 `__tests__/`,测试框架采用 [vitest](https://vitest.dev/)。

### 4. 执行测试

提交代码前请确保测试任务通过✅。

```shell
pnpm run ci
```

### 5. 提交变更

qiankun 使用 [conventional commits](https://www.conventionalcommits.org/)。

### 6. 执行 changeset (可选)

如果你的更改包含功能性变更,请执行:

```shell
pnpm changeset
```

qiankun 遵循[语义化版本](https://semver.org/),根据你的变更类型选择相对应的类型:

- major: 不兼容的API更改
- minor: 向后兼容的方式添加功能
- patch: 向后兼容的错误修复

### 7. 提交 pull request
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Contribution Guide

We're truly delighted that you're interested in contributing to qiankun. Before submitting your code, please take some time to read through the following guidelines:

## 1. Install Node.js and pnpm

Visit [nodejs.org](https://nodejs.org/) to download and install the latest stable version suitable for your operating system. Install pnpm: [pnpm.io/installation](https://pnpm.io/installation)

## 2. Fork and check out your own repository

Go to [github.com/umjs/qiankun](https://github.com/umjs/qiankun), click the “Fork” button. Then follow the [GitHub documentation](https://help.github.com/articles/fork-a-repo) to fork and clone.

Clone your own fork:

```shell
git clone https://github.com/<Your Github Username>/qiankun
```

This step requires an internet connection as it will download many dependencies.

**Note**: Every time you pull the code from the main repository, re-running `pnpm install` helps ensure you are using the latest development dependencies.

## 3. Modify the code & supplement/update test cases

Test code is located in `__tests__/`, and the testing framework used is [vitest](https://vitest.dev/).

## 4. Execute tests

Before submitting your code, make sure the test tasks pass✅.

```shell
pnpm run ci
```

## 5. Commit changes

qiankun uses [conventional commits](https://www.conventionalcommits.org/).

## 6. Execute changeset (optional)

If your changes include functional changes, please run:

```shell
pnpm changeset
```

qiankun adheres to [semantic versioning](https://semver.org/). Choose the type corresponding to your changes:

- major: Incompatible API changes
- minor: Add features in a backward-compatible manner
- patch: Backward-compatible bug fixes

## 7. Submit pull request
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ Visit `http://localhost:7099`.

See [Qiankun 3.0 Roadmap](https://github.com/umijs/qiankun/discussions/1378)

## 🤝 Contributing

See [contributing guide](./CONTRIBUTING.md).

## 👥 Contributors

Thanks to all the contributors!
Expand Down