Skip to content

Commit

Permalink
docs: add Simplified Chinese CONTRIBUTING.md support.
Browse files Browse the repository at this point in the history
  • Loading branch information
OXeu committed Jun 6, 2024
1 parent 167c6f1 commit 7fc5ba9
Show file tree
Hide file tree
Showing 3 changed files with 92 additions and 25 deletions.
55 changes: 30 additions & 25 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
# Contributing to Rin
# Rin 做贡献

We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.
我们很乐意接受您对这个项目的补丁和贡献。您只需遵循一些小指南即可。

# Commit-msg Hook
We have a sample commit-msg hook in scripts/commit-msg.sh. To set it up, run:
# Commit-msg 钩子
我们在 scripts/commit-msg.sh 中有一个示例 commit-msg hook。请运行以下命令设置:

```sh
ln -s ../../scripts/commit-msg.sh commit-msg
```

This will run following checks on staged files before each commit:
这将在每次提交之前运行以下检查:

1. `tsc` to check TypeScript files
2. check if commit message is starting with one of the following: feat|chore|fix|docs|ci|style|test|pref
1. `tsc` 检查前端代码是否存在语法错误与未使用变量与引用
2. 检查提交消息是否以以下之一开头:feat|chore|fix|docs|ci|style|test|pref

If you want to skip the hook, run `git commit` with `--no-verify` option.
如果您想跳过钩子,请使用 `--no-verify` 选项运行 `git commit`

# Setup Development Environment
# 设置开发环境

1. Fork & Clone the repository
2. Install [Node](https://nodejs.org/en/download/package-manager) & [Bun](https://bun.sh/)
3. Install dependencies
1. Fork & Clone 仓库

2. 安装 [Node](https://nodejs.org/en/download/package-manager) & [Bun](https://bun.sh/)

3. 安装依赖项
```sh
bun i
```
4. Copy the `wrangler.example.toml` file to `wrangler.toml` and fill in the necessary information
5. Copy the `client/.env.example` file to `client/.env` and fill in the necessary information
5. Start the development server

4.`wrangler.example.toml` 文件复制到 `wrangler.toml` 并填写必要信息

5.`client/.env.example` 文件复制到 `client/.env` 并填写必要信息

5. 启动开发服务器
```sh
bun dev
```
6. For more control over the development server, you can run the dev command in the client directory and the server directory separately:

6. 为了更好地控制开发服务器,您可以分别在客户端目录和服务器目录中运行 dev 命令:
```sh
# tty1
cd client
Expand All @@ -41,18 +47,17 @@ cd server
bun dev
```

# Submitting changes
# 提交更改

1. Get at least one +1 on your PR before you push.
For simple patches, it will only take a minute for someone to review it.
1. 对于简单的补丁,只需一分钟即可有人对其进行审核。

2. Don't force push small changes after making the PR ready for review. Doing so will force readers to re-read your entire PR, which will delay the review process.
2. PR 准备好进行审核后,不要强制推送小的更改。这样做会迫使维护者重新阅读您的整个 PR,从而延迟审核过程。

3. Always keep the CI green.
3. 始终保持 CI 为绿色。

4. Do not push, if the CI failed on your PR. Even if you think it's not your patch's fault. Help to fix the root cause if something else has broken the CI, before pushing.
4. 如果 CI 在您的 PR 上失败,请不要推送。即使您认为这不是补丁的错误。如果其他原因破坏了 CI,请在推送之前帮助修复根本原因。

*Happy Hacking!*
*开始愉快的写代码吧!*

# Code reviews
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.
# 代码审核
所有提交,包括项目成员的提交,都需要审核。我们使用 GitHub 拉取请求来实现此目的。有关使用拉取请求的更多信息,请参阅 GitHub 帮助。
58 changes: 58 additions & 0 deletions CONTRIBUTING_en_US.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
# Contributing to Rin

We'd love to accept your patches and contributions to this project. There are just a few small guidelines you need to follow.

# Commit-msg Hook
We have a sample commit-msg hook in scripts/commit-msg.sh. To set it up, run:

```sh
ln -s ../../scripts/commit-msg.sh commit-msg
```

This will run following checks on staged files before each commit:

1. `tsc` to check TypeScript files
2. check if commit message is starting with one of the following: feat|chore|fix|docs|ci|style|test|pref

If you want to skip the hook, run `git commit` with `--no-verify` option.

# Setup Development Environment

1. Fork & Clone the repository
2. Install [Node](https://nodejs.org/en/download/package-manager) & [Bun](https://bun.sh/)
3. Install dependencies
```sh
bun i
```
4. Copy the `wrangler.example.toml` file to `wrangler.toml` and fill in the necessary information
5. Copy the `client/.env.example` file to `client/.env` and fill in the necessary information
5. Start the development server
```sh
bun dev
```
6. For more control over the development server, you can run the dev command in the client directory and the server directory separately:
```sh
# tty1
cd client
bun dev

# tty2
cd server
bun dev
```

# Submitting changes

1. Get at least one +1 on your PR before you push.
For simple patches, it will only take a minute for someone to review it.

2. Don't force push small changes after making the PR ready for review. Doing so will force readers to re-read your entire PR, which will delay the review process.

3. Always keep the CI green.

4. Do not push, if the CI failed on your PR. Even if you think it's not your patch's fault. Help to fix the root cause if something else has broken the CI, before pushing.

*Happy Hacking!*

# Code reviews
All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose. Consult GitHub Help for more information on using pull requests.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ Rin 是一个基于 Cloudflare Pages + Workers + D1 + R2 全家桶的博客,

2. [环境变量列表](./docs/ENV.md)

3. [贡献指南](./CONTRIBUTING.md)

4. [行为准则](./CODE_OF_CONDUCT.md)

## Star History

[![Star History Chart](https://api.star-history.com/svg?repos=OXeu/Rin&type=Date)](https://star-history.com/#OXeu/Rin&Date)
Expand Down

0 comments on commit 7fc5ba9

Please sign in to comment.