每週都得發週報,挺煩的。就寫一個自動生成周報的工具。
# 安裝
npm i -g wll8/gitday
# 例: 以 月/周/天 的形式導出報告
gitday --x-template=month-week-day
# 查看使用說明
gitday --help
先來一個功能說明:
讀取 git log 的數據生成類似月報/週報/日報的 markdown 文檔.
參數:
--help 顯示使用方法
--author=[作者名稱] 默認爲 git config user.name 的值
--after=[時間範圍] 默認爲 --x-template 的最大標誌日期, 例如 month-week 則自動取最近一個月. 支持 git 的參數形式
--x-template=[格式模板] 默認 week, 支持 month/week/day 或其組合
示例:
gitday --x-template=month
## 2021年01月
- commitMsg
- commitMsg
gitday --x-template=month-week
## 2021年01月
### 第1周
- commitMsg
- commitMsg
gitday --x-template=month-week-day
## 2021年01月
### 第1周
#### 21日 星期1
- commitMsg
- commitMsg
gitday --x-template=week
## 2021年01月 第1周
- commitMsg
- commitMsg
gitday --x-template=week-day
## 2021年01月 第1周
### 21日 星期1
- commitMsg
- commitMsg
gitday --x-template=day
## 2021年01月24日
- commitMsg
- commitMsg
再給給大家看看來一個自動生成的月報摘錄:
2022年04月
第4周
21日 星期四
- test: 併發測試
- build: 添加發布命令
20日 星期三
- chore: 使用依賴鎖文件
-
fix(test): 處理測試功能的一些錯誤
- MOCKM_REGISTRY 環境變量用於保證穩定的自動安裝依賴
- —require 用於處理並行測試時不能正確顯示 html
-
feat: 簡化 —config 參數輸出的內容
更改 full.mm.config.js 爲 simple.mm.config.js, 讓配置看起來更容易使用, 不那麼嚇人和混亂.
- test: 並行運行測試
18日 星期一
- refactor: 支持傳入完善的配置, 拆分測試用例
- doc: 完善更新日誌
第3周
15日 星期五
-
feat: 支持從 config.api 攔截 config.db 的接口
config = { api: { '/books/:id' (req, res, next) { // 在所有自定義 api 之前添加中間件 req.body.a = 1 // 修改用戶傳入的數據 next() res.mm.resHandleJsonApi = (arg) => { arg.res.locals.data // json-server 原始的數據 arg.data // 經預處理的數據, 例如將分頁統計放置於響應體中 arg.resHandleJsonApi // 是全局 config.resHandleJsonApi 的引用, 若無需處理則直接 return arg.data arg.data.a = 2 // 修改響應, 不會存儲到 db.json return arg.resHandleJsonApi(arg) } }, }, db: { book: [ { name: `js`, }, ] }, }
12日 星期二
-
fix: config.api 是 config.proxy 的子路徑並攜帶參數時應能覆蓋
例如以下配置不應導致
/api/test?a=1
不能使用config = { proxy: { '/api/': `http://172.16.203.81/api/`, }, api: { '/api/test': {msg: 123}, }, }
11日 星期一
- index on dev: b356560 doc: 添加 todo
- doc: 添加 todo
-
feat: 重放時特殊處理 get 攜帶 body 的情況
在瀏覽器端 get 請求是不能攜帶 body 的, 包括
{}
.
第2周
08日 星期五
- refactor: 使用 undefined 更直觀的表述
沒有做任何事
-
fix: 處理邊界情況
confg.proxy['/']
可能爲對象, 當時應取對象中的 target - refactor: 去除冗餘的邏輯
- feat: 支持禁用請求記錄
第1周
01日 星期五
- doc: update log
- feat: 未啓動進程守護時, 遇到錯誤連同父進程退出
- feat: 在錯誤日誌中保存退出碼
-
fix: 重載時 global.INJECTION_REQUEST 中的值不應丟失
- server 應該把值保存在文件中, 而不是變量中
- client 應在請求時獲取 INJECTION_REQUEST, 而不是刷新頁面才獲取
2022年03月
第5周
31日 星期四
- fix: 刪除 apiWeb 中的空對象, 避免手動編輯 apiWeb 時出現重複的 key
28日 星期一
- doc: 添加 todo