2021-05-27 13:35:08 +08:00
|
|
|
|
# Contributing
|
|
|
|
|
|
|
|
|
|
- For document & bug fix, please create pull request to `main` branch.
|
|
|
|
|
- For new features, please create pull request to `feat` branch.
|
|
|
|
|
|
2021-06-05 23:18:03 +08:00
|
|
|
|
## Useful Commands
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# open the dev server, please note that hot module reload doesn't work well
|
|
|
|
|
# if you find anything doesn't work, just refresh the page
|
2021-06-08 12:16:08 +08:00
|
|
|
|
# if you can't open the page at first time, try to do some refresh
|
2021-06-05 23:18:03 +08:00
|
|
|
|
npm run dev
|
|
|
|
|
|
|
|
|
|
# testing
|
|
|
|
|
npm run test
|
|
|
|
|
|
|
|
|
|
# testing some component
|
|
|
|
|
npm run test -- src/xxx
|
|
|
|
|
|
|
|
|
|
# testing with coverage
|
|
|
|
|
npm run test:cov
|
|
|
|
|
|
|
|
|
|
# lint code
|
|
|
|
|
npm run lint:code
|
|
|
|
|
|
|
|
|
|
# check type
|
|
|
|
|
npm run lint:type
|
|
|
|
|
|
|
|
|
|
# lint code & type
|
|
|
|
|
npm run lint
|
|
|
|
|
```
|
|
|
|
|
|
2021-05-27 13:35:08 +08:00
|
|
|
|
# 贡献代码
|
|
|
|
|
|
|
|
|
|
- 对于文档和 bug fix,请对 `main` 分支提交 Pull Request
|
|
|
|
|
- 对于新特性,请对 `feat` 分支提交 Pull Request
|
2021-06-05 23:18:03 +08:00
|
|
|
|
|
|
|
|
|
## 有用的指令
|
|
|
|
|
|
|
|
|
|
```bash
|
|
|
|
|
# 开启开发服务器,注意热更新不是很好用
|
|
|
|
|
# 如果你觉得哪里有问题,刷新页面即可
|
2021-06-08 12:16:08 +08:00
|
|
|
|
# 第一次运行打不开时,你可以试试刷新几次浏览器
|
2021-06-05 23:18:03 +08:00
|
|
|
|
npm run dev
|
|
|
|
|
|
|
|
|
|
# 测试
|
|
|
|
|
npm run test
|
|
|
|
|
|
|
|
|
|
# 测试某个组件
|
|
|
|
|
npm run test -- src/xxx
|
|
|
|
|
|
|
|
|
|
# 生成覆盖率报告
|
|
|
|
|
npm run test:cov
|
|
|
|
|
|
|
|
|
|
# 检查代码风格
|
|
|
|
|
npm run lint:code
|
|
|
|
|
|
|
|
|
|
# 检查类型
|
|
|
|
|
npm run lint:type
|
|
|
|
|
|
|
|
|
|
# 上面俩个都检查
|
|
|
|
|
npm run lint
|
|
|
|
|
```
|