Skip to content

Commit 71a0635

Browse files
xuexbyugasun
authored andcommitted
docs: add a statement and a CONTRIBUTING doc (#36)
* docs: add a statement * docs: add the CONTRIBUTING doc * feat: remove system restrictions
1 parent 37b87de commit 71a0635

File tree

3 files changed

+95
-6
lines changed

3 files changed

+95
-6
lines changed

.github/CONTRIBUTING.md

+89
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
# 用户贡献指南
2+
3+
非常感谢您关注 [@xuexb/github-bot](https://github.com/xuexb/github-bot) 项目,在提交您的贡献之前,请务必认真阅读以下准则。
4+
5+
1. [问题反馈](#issue)
6+
1. [开发指南](#develop)
7+
1. [本地调试](#debug)
8+
1. [常用脚本命令( npm scripts )](#npm-scripts)
9+
1. [代码风格](#code-spec)
10+
1. [项目结构](#dir-spec)
11+
1. [提交请求(pull request)](#pull-request)
12+
1. [提交信息规范](#commit-message-spec)
13+
1. [后记](#open-source)
14+
15+
<a id="issue"></a>
16+
## 问题反馈
17+
18+
1. 请避免提交重复的 issue,在提交之前搜索现有的 issue 。
19+
1. 请使用 [创建 issue](https://xuexb.github.io/github-bot/create-issue.html) 页面反馈问题,否则将直接被关闭。
20+
21+
<a id="develop"></a>
22+
## 开发设置
23+
24+
需要安装 [nodejs](https://nodejs.org) 版本7.8.0+ ,下载项目到本地后安装依赖 `npm install` ,安装完成后将自动添加 git commit 提交信息格式检查和提交前代码格式验证。
25+
26+
<a id="debug"></a>
27+
### 本地调试
28+
29+
目前是基于 [github api](https://developer.github.com/v3/) + <https://github.com/octokit/node-github> 接口说明 + 在线 github webhook 实时触发调试,计划添加一个 mock 服务,支持在本地实时的调试代码功能。
30+
31+
<a id="npm-scripts"></a>
32+
### 常用脚本命令( npm scripts )
33+
34+
``` bash
35+
# 基于 koa 启动本地服务器接口
36+
$ npm run start
37+
38+
# 使用 eslint 验证代码风格
39+
$ npm run lint
40+
```
41+
42+
<a id="code-spec"></a>
43+
### 代码风格
44+
45+
使用 es6 开发,基于 <https://standardjs.com/> 编写代码,基于 [eslint](https://eslint.org/) 验证代码格式。
46+
47+
<a id="dir-spec"></a>
48+
### 项目结构
49+
50+
```
51+
.
52+
├── create-issue.html - 创建 issue 页面,会往内容里注入一些特殊的标识用来让 bot 判断是否规范
53+
├── env - 环境配置模板
54+
└── src
55+
├── app.js - 服务启动入口
56+
├── github.js - 基于 https://github.com/octokit/node-github + async 完成接口对外统一
57+
├── modules - 以功能为目录区分形成模块
58+
│ ├── issues - issue
59+
│ │ ├── autoAssign.js - 根据配置自动 assign 给指定的人
60+
│ │ ├── autoLabel.js - 根据 create-issue.html 页面注入的标记自动给 issue 打对应的 label
61+
│ │ ├── replyInvalid.js - 判断是否有 create-issue.html 页面注入的标记,不存在则自动关闭
62+
│ │ └── replyNeedDemo.js - 回复需要相关 demo 链接
63+
│ ├── pull_request - PR
64+
│ │ ├── autoReviewRequest.js - 根据配置自动 reviewer 给指定的人
65+
│ │ ├── replyInvalidTitle.js - 根据标题规范自动提醒需要修改
66+
│ │ └── titlePrefixToLabel.js - 根据标题规范化前缀和配置,自动打上 label
67+
│ └── releases - releases
68+
│ └── autoReleaseNote.js - 添加新 tag 时自动根据距离上一个 tag 的 commit log 自动归类,发布 releases notes
69+
└── utils.js - 常用工具方法
70+
```
71+
72+
<a id="pull-request"></a>
73+
### 提交请求(pull request)
74+
75+
1. fork mipengine/www.mipengine.org
76+
1. 把个人仓库(repository)克隆到电脑上,并安装所依赖的插件。
77+
1. 开始编辑,并自测通过(后续Todo: 添加测试用例)后提前代码。
78+
1. 推送(push)分支。
79+
1. 建立一个新的合并申请(pull request)并描述变动。
80+
81+
<a id="commit-message-spec"></a>
82+
## 提交信息规范
83+
84+
git commit 信息和 pull request 标题必须遵循 [commit-log-和-pr-标题规则](https://github.com/xuexb/github-bot#commit-log-和-pr-标题规则) ,否则不予合入。
85+
86+
<a id="open-source"></a>
87+
## 后记
88+
89+
感谢您的贡献, github-bot 因您而更完善。

README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ Github robot
44

55
[![Build Status](https://travis-ci.org/xuexb/github-bot.svg?branch=master)](https://travis-ci.org/xuexb/github-bot)
66

7+
## 声明
8+
9+
[仓库@xuexb/github-bot](https://github.com/xuexb/github-bot/) 是用来演示 github-bot 的基本功能,因为具体需要实现的功能,可能因项目而不同,如果你需要她,你可以 fork 并相应的添加、删除功能。以下功能是一些常用的 show case 。
10+
711
## 功能 - Feature
812

913
### Issue
@@ -89,10 +93,10 @@ vim .env
8993
npm start
9094
```
9195

92-
###
93-
9496
## contributors
9597

98+
> [用户贡献指南](.github/CONTRIBUTING.md)
99+
96100
- [@yugasun](https://github.com/yugasun/)
97101
- [@xuexb](https://github.com/xuexb/)
98102

package.json

-4
Original file line numberDiff line numberDiff line change
@@ -55,10 +55,6 @@
5555
}
5656
}
5757
},
58-
"os": [
59-
"darwin",
60-
"linux"
61-
],
6258
"devDependencies": {
6359
"eslint": "^4.9.0",
6460
"eslint-config-standard": "^10.2.1",

0 commit comments

Comments
 (0)