-
Notifications
You must be signed in to change notification settings - Fork 273
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: update getting involved in contributing (#433)
- Loading branch information
Showing
2 changed files
with
15 additions
and
14 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 |
---|---|---|
|
@@ -2,11 +2,11 @@ | |
title: 如何贡献 | ||
--- | ||
|
||
### 提交贡献意向 | ||
### 参与贡献 | ||
|
||
请填写[《贡献者加入意向收集》](https://wj.qq.com/s2/9772260/7cbe/)问卷,帮助我们了解你的意向和个人信息,TDesign 团队将在 2 个工作日内联系你。 | ||
TDesign 的大部分协作都是在 Github 完全公开透明地进行的,如果你有兴趣为 TDesign 的建设贡献一份力量,随时欢迎修复问题和提交新的功能。同时,我们的成员会持续观察不同方向的仓库的活跃贡献者,如果我们觉得你的提交、贡献与我们的想法大部分时间都是一致的,而且也有可能长期合作下去,我们会主动联系你,让我们更进一步地在这个开源项目上合作,当然了,项目也会时不时给你发放一些福利 🎁。 | ||
|
||
在提交意向和成为我们的一员之前,请务必先阅读以下的行为准则和协作规范指南。 | ||
在开始贡献之前,可以先阅读以下的行为准则和协作规范指南。 | ||
|
||
### 行为准则 | ||
|
||
|
@@ -44,16 +44,17 @@ TDesign 使用 Github issues 进行 bug 报告和新 feature 建议。在报告 | |
|
||
请使用 SSH 方式 clone 仓库,TDesign 的一些仓库使用了 git submodule 方式来额外引入 [Tencent/tdesign-common](https://github.com/Tencent/tdesign-common) 中的公共样式,使用 HTTPS 方式可能会导致后续更新 submodule 目录失败。 | ||
|
||
``` Shell | ||
```Shell | ||
$ git clone [email protected]:${USER}/${PROJECT}.git | ||
``` | ||
|
||
本地环境请确保 Node 版本在 12.0.0 及以上,建议升级到 16.0.0 及以上,我们一般只保证当前 Node LTS 版本下项目运行正常。 | ||
|
||
#### 设置 Git 账户信息 | ||
|
||
请不要使用公司内部 Git 账号直接提交代码,这可能会在 commit 历史中暴露你的 ID 或公司邮箱等信息,可以通过如下方式设置本地仓库的 Git 信息: | ||
|
||
``` Shell | ||
```Shell | ||
## cd ${PROJECT} 本地仓库目录 | ||
$ git config user.name "your name" | ||
$ git config user.email "your email address" | ||
|
@@ -67,7 +68,7 @@ $ git config user.email "your email address" | |
|
||
但仍然建议在 clone 仓库至本地后通过添加 upstream 的方式来关联远端上游仓库: | ||
|
||
``` Shell | ||
```Shell | ||
$ git remote add upstream https://github.com/Tencent/${PROJECT}.git | ||
$ git remote -v | ||
> origin [email protected]:${USER}/${PROJECT}.git (fetch) | ||
|
@@ -78,19 +79,18 @@ $ git remote -v | |
|
||
这样你可以直接在本地通过如下方式将 upstream 官方仓库的改动同步到本地: | ||
|
||
``` Shell | ||
```Shell | ||
git fetch upstream | ||
git rebase upstream/develop | ||
``` | ||
|
||
参考 [Configuring a remote for a fork](https://docs.github.com/en/pull-requests/collaborating-with-pull-requests/working-with-forks/configuring-a-remote-for-a-fork) | ||
|
||
|
||
#### 创建 PR | ||
|
||
在同步官方仓库代码后,请从 develop 分支(TDesign 仓库均以 develop 作为默认最新的开发分支)创建新的 feat/fix 分支: | ||
|
||
``` Shell | ||
```Shell | ||
git checkout develop | ||
git checkout -b feat/xxx | ||
``` | ||
|
@@ -101,13 +101,14 @@ feat 指代新特性如新组件或者组件新功能,日常问题修复以 fi | |
|
||
参与某个技术栈贡献时,请参照仓库中的 `DEVELOP_GUIDE.md` 来进行本地开发工作。 | ||
|
||
本地开发完成后,需要执行 `npm run lint` 及 `npm run test` 并保证结果通过。 | ||
本地开发完成后,需要执行 `npm run lint` 及 `npm run test` 并保证结果通过。 | ||
|
||
- lint 指令会检查本次提交的代码是否通过了 eslint 检查,某些未通过的代码可以通过执行 `npm run lint:fix` 来自动修复。 | ||
- test 指令会检查本次改动影响了哪些组件的 snapshot,比如改动了 Button 的实现,其他依赖了 Button 的 Dialog/InputNumber 等组件的 snapshot 也可能会有相应变动,请仔细检查这些差异是否符合预期,这可以防止本次修改和相关联组件发生不可预料的变动。确认无误后可以通过 `npm run test:update` 指令来更新 snapshot 并提交上来 | ||
|
||
#### 提交代码 | ||
|
||
``` Shell | ||
```Shell | ||
git add . | ||
git commit -m "feat: button commit message" | ||
git push origin feat/xxx | ||
|