Skip to content

Commit

Permalink
docs: optimize contribution scripts & docs
Browse files Browse the repository at this point in the history
  • Loading branch information
beetcb committed Oct 26, 2021
1 parent 6e08a09 commit bc2c605
Show file tree
Hide file tree
Showing 7 changed files with 38 additions and 6 deletions.
29 changes: 29 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Cea Contribution Guide

## 1. Bootstrap repo

Cea 采用 monorepo 模式,我们首先需要安装和链接依赖,这些操作只需通过一个命令完成:

```bash
npm run bootstrap
```

## 2. Debug packages

本仓库内置 vscode 调试配置文件,推荐使用 vscode 进行调试

## 3. Build packages

编译所有 NPM 包:

```bash
npm run build
```

## 4. Build docs

重新生成文档:

```bash
npm run docs
```
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@

若未接入今日校园,只能爬取网页获得凭据:cea 的登录页爬取策略比较智能(并非 `hard coded`),默认根据第一个登录表单完成全部逻辑,这保证了不错的兼容性

如确实遇到了边缘情况,有能力的话可以提交 PR ,只需修改 `./core/src/compatibility/edge-case.ts` 文件,添加你的学校:
如确实遇到了边缘情况,有能力的话可以提交 PR (参考 [Contribution Guide](./CONTRIBUTING.md)),只需修改 `./core/src/compatibility/edge-case.ts` 文件,添加你的学校:

```diff
const schoolEdgeCases = {
Expand Down Expand Up @@ -117,6 +117,10 @@ cea.start()

- [`cea-check-in`](./docs/api/plugins/check-in/README.md)

## 贡献指南

参考 [Contribution Guide](./CONTRIBUTING.md)

## 插件开发

> 插件开发流程:引入 cea-core 的功能 -> 开发功能 -> 导出一个无入参出参的函数
Expand Down
2 changes: 1 addition & 1 deletion core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lib/src/**/*.[tj]s"
],
"scripts": {
"build:debug": "esbuild ./src/*.ts ./src/**/*.ts --outdir=lib/src/ --format=cjs --sourcemap"
"build:debug": "npx esbuild $(npx globby src/*.ts src/**/*.ts) --outdir=lib/src/ --sourcemap"
},
"keywords": [
"今日校园",
Expand Down
2 changes: 0 additions & 2 deletions core/src/types/conf.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import { CookieRawObject } from './cookie'
export { DefaultProps, EdgeCasesSchools } from '../compatibility/edge-case.js'

export type UsersConf = Array<UserConfOpts>

export type UserConfOpts = {
username: string
password: string
Expand Down
2 changes: 1 addition & 1 deletion internal/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"lib/src/**/*.[tj]s"
],
"scripts": {
"build:debug": "esbuild ./src/*.ts --outdir=lib/src/ --format=cjs --sourcemap"
"build:debug": "npx esbuild $(npx globby ./src/*.ts) --outdir=lib/src/ --sourcemap"
},
"keywords": [],
"author": "",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
"env-cmd": "^10.1.0",
"esbuild": "^0.12.15",
"esno": "^0.10.1",
"globby-cli": "^1.0.1",
"lerna": "^4.0.0",
"ts-jest": "^27.0.4",
"typedoc-github-wiki-theme": "^0.3.0",
Expand Down
2 changes: 1 addition & 1 deletion plugins/check-in/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"lib/src/**/*.[tj]s"
],
"scripts": {
"build:debug": "esbuild ./src/*.ts --outdir=lib/src/ --format=cjs --sourcemap"
"build:debug": "npx esbuild $(npx globby ./src/*.ts) --outdir=lib/src/ --sourcemap"
},
"keywords": [],
"author": "",
Expand Down

0 comments on commit bc2c605

Please sign in to comment.