Skip to content

Commit

Permalink
doc: add CONTRIBUTING.MD
Browse files Browse the repository at this point in the history
  • Loading branch information
brickspert committed Jul 1, 2019
1 parent 6762ed2 commit a36ce5f
Show file tree
Hide file tree
Showing 3 changed files with 77 additions and 4 deletions.
42 changes: 42 additions & 0 deletions CONTRIBUTING.MD
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
# 贡献指南

> 参考 ant design [贡献指南](https://ant.design/docs/react/contributing-cn)
这篇指南会指导你如何为 `@umijs/hooks` 贡献一份自己的力量,请在你要提 issue 或者 pull request 之前花几分钟来阅读一遍这篇指南。

## 透明的开发

我们所有的工作都会放在 [GitHub](https://github.com/umijs/hooks) 上。不管是核心团队的成员还是外部贡献者的 pull request 都需要经过同样流程的 review。

## 分支管理

我们长期维护两个分支 master 和 feature。如果你要修一个 bug,那么请发 pull request 到 master;如果你要提一个增加新功能的 pull request,那么请基于 feature 分支来做。

## 新增功能

如果你想新增一个 Hook,我们建议你先建立一个 issue,说明该 Hook 的应用场景及用法。

一个标准的 Hook 应该包含 `index.ts``index.mdx``index.test.ts` 三个文件,参考 [useTitle](https://github.com/umijs/hooks/tree/master/src/useTitle)

## Pull Request

我们会关注所有的 pull request,会 review 以及合并你的代码,也有可能要求你做一些修改或者告诉你我们为什么不能接受这样的修改。

在你发送 Pull Request 之前,请确认你是按照下面的步骤来做的:

1. 基于 [正确的分支](#分支管理) 做修改。

2. 如果你修复了一个 bug 或者新增了一个功能,请确保写了相应的测试,这很重要。

3. 确认所有的测试是通过的 `npm run test`


## 开发流程

在你 clone 代码并且使用 `npm install` 安装完依赖后,你还可以运行下面几个常用的命令:

1. `npm start` 在本地运行 `@umijs/hooks` 网站。

2. `npm run test` 运行测试。

3. `npm run build` 构建编译。
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,43 @@

react hooks library

## Usage
[![NPM version][image-1]][1] [![NPM downloads][image-2]][2]

```sh

## 📦 Install

```
npm i @umijs/hooks --save
```

## 🔨 Usage

```
import { useTitle } from '@umijs/hooks';
```

## ⌨️ Development

```
$ git clone [email protected]:umijs/hooks.git
$ cd hooks
$ npm install
$ npm start
```
Open your browser and visit http://127.0.0.1:8001/hooks , see more at Development.

## 🤝 Contributing

@umi/hooks 正处于起步阶段,欢迎大家参与共建。
共建请参考[贡献指南](CONTRIBUTING.MD)

## LICENSE

MIT


[1]: https://www.npmjs.com/package/@umijs/hooks
[2]: https://npmjs.org/package/@umijs/hooks

[image-1]: https://img.shields.io/npm/v/@umijs/hooks.svg?style=flat
[image-2]: https://img.shields.io/npm/dm/@umijs/hooks.svg?style=flat
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"name": "hooks",
"name": "@umijs/hooks",
"version": "0.0.1",
"description": "react hooks library",
"keywords": [
Expand All @@ -13,6 +13,7 @@
"email": "[email protected]"
},
"repository": "https://github.com/umijs/hooks",
"homepage": "https://github.com/umijs/hooks",
"scripts": {
"start": "npm run dev",
"dev": "father doc dev",
Expand All @@ -21,7 +22,6 @@
"cov": "father test --coverage",
"help": "father help",
"precommit": "father pre-commit",
"pub:npm": "npm run build & father publish --registry=https://www.npmjs.com",
"pub:doc": "father doc build & father doc deploy"
},
"peerDependencies": {
Expand Down

0 comments on commit a36ce5f

Please sign in to comment.