wukong-gitlog-cli 1.0.39 → 1.0.40
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc +1 -0
- package/.prettierrc +2 -1
- package/CHANGELOG.md +95 -0
- package/README.md +93 -173
- package/README.zh-CN.md +85 -137
- package/bin/wukong-gitlog-cli +0 -0
- package/doc//347/233/256/345/275/225/347/273/223/346/236/204.md +2871 -0
- package/package.json +32 -29
- package/rc/.wukonggitlogrc +53 -0
- package/scripts/compareHourlyCounts.mjs +42 -0
- package/scripts/compareLatest.mjs +106 -0
- package/src/app/analyzeAction.mjs +120 -0
- package/src/app/exportAction.mjs +215 -0
- package/src/app/exportActionProgress.mjs +37 -0
- package/src/app/helpers.mjs +292 -0
- package/src/app/initAction.mjs +110 -0
- package/src/app/initActionWithTemp.mjs +192 -0
- package/src/app/journalAction.mjs +117 -0
- package/src/app/overtimeAction.mjs +100 -0
- package/src/app/runProfileEnd.mjs +0 -0
- package/src/app/serveAction.mjs +73 -0
- package/src/app/versionAction.mjs +7 -0
- package/src/cli/defineOptions.mjs +209 -0
- package/src/cli/index.mjs +0 -0
- package/src/cli/parseOptions.mjs +126 -8
- package/src/constants/index.mjs +16 -2
- package/src/domain/author/analyze.mjs +6 -0
- package/src/domain/author/map.mjs +0 -0
- package/src/domain/export/exportAuthor.mjs +28 -0
- package/src/domain/export/exportAuthorChanges.mjs +27 -0
- package/src/domain/export/exportAuthorChangesJson.mjs +31 -0
- package/src/domain/export/exportByMonth.mjs +157 -0
- package/src/domain/export/exportByWeek.mjs +121 -0
- package/src/domain/export/exportCommits.mjs +26 -0
- package/src/domain/export/exportCommitsExcel.mjs +45 -0
- package/src/domain/export/exportCommitsJson.mjs +31 -0
- package/src/domain/export/index.mjs +91 -0
- package/src/domain/git/ensureGitAvailable.mjs +66 -0
- package/src/domain/git/ensureGitRepo.mjs +41 -0
- package/src/domain/git/getGitFeatures.mjs +59 -0
- package/src/domain/git/getGitLogs.mjs +326 -0
- package/src/domain/git/getGitUser.mjs +44 -0
- package/src/domain/git/getRepoRoot.mjs +32 -0
- package/src/domain/git/gitCapability.mjs +119 -0
- package/src/domain/git/index.mjs +96 -0
- package/src/domain/git/resolveGerrit.mjs +102 -0
- package/src/domain/overtime/analyze.mjs +48 -0
- package/src/domain/overtime/index.mjs +3 -0
- package/src/domain/overtime/perPeriod.mjs +15 -0
- package/src/domain/overtime/render.mjs +15 -0
- package/src/i18n/index.mjs +38 -0
- package/src/i18n/resources.mjs +252 -0
- package/src/index.mjs +132 -649
- package/src/infra/cache.mjs +0 -0
- package/src/infra/configStore.mjs +128 -0
- package/src/infra/fs.mjs +0 -0
- package/src/infra/path.mjs +0 -0
- package/src/output/csv/overtime.mjs +12 -0
- package/src/output/csv.mjs +0 -0
- package/src/output/data/readData.mjs +54 -0
- package/src/output/data/writeData.mjs +145 -0
- package/src/output/excel/commits.mjs +9 -0
- package/src/output/excel/outputExcelDayReport.mjs +92 -0
- package/src/output/excel/perPeriod.mjs +24 -0
- package/src/{excel.mjs → output/excel.mjs} +3 -2
- package/src/output/index.mjs +79 -0
- package/src/output/json/overtime.mjs +9 -0
- package/src/output/tab/overtime.mjs +12 -0
- package/src/output/tab.mjs +0 -0
- package/src/output/text/commits.mjs +9 -0
- package/src/output/text/index.mjs +3 -0
- package/src/output/text/outputTxtDayReport.mjs +74 -0
- package/src/output/text/overtime.mjs +18 -0
- package/src/output/utils/getEsmJs.mjs +10 -0
- package/src/output/utils/index.mjs +14 -0
- package/src/output/utils/outputPath.mjs +19 -0
- package/src/output/utils/writeFile.mjs +10 -0
- package/src/serve/index.mjs +0 -0
- package/src/{server.mjs → serve/startServer.mjs} +21 -3
- package/src/serve/writeData.mjs +0 -0
- package/src/utils/authorNormalizer.mjs +28 -2
- package/src/utils/buildAuthorChangeStats.mjs +44 -0
- package/src/utils/deepMerge.mjs +13 -0
- package/src/utils/getPackage.mjs +11 -0
- package/src/utils/getProfileDirFile.mjs +12 -0
- package/src/utils/{file.mjs → groupRecords.mjs} +8 -9
- package/src/utils/index.mjs +5 -2
- package/src/utils/logger.mjs +28 -17
- package/src/utils/profiler.mjs +0 -101
- package/src/utils/resolve.mjs +11 -0
- package/src/utils/showVersionInfo.mjs +6 -2
- package/src/utils/time.mjs +0 -0
- package/src/utils/wait.mjs +2 -0
- package/web/app.js +3197 -257
- package/web/index.html +171 -22
- package/web/revoke/alpha1/app.js +4324 -0
- package/web/revoke/alpha1/index.html +266 -0
- package/web/revoke/app.before.js +3139 -0
- package/web/revoke/index-before.html +181 -0
- package/web/static/style.css +116 -9
- package/src/git.mjs +0 -256
- package/src/handlers/handleServe.mjs +0 -203
- package/src/lib/configStore.mjs +0 -11
- package/src/lib/memoize.mjs +0 -14
- package/src/utils/analyzeOvertimeCached.mjs +0 -7
- package/src/utils/checkUpdate.mjs +0 -130
- package/src/utils/exitWithTime.mjs +0 -17
- package/src/utils/handleSuccess.mjs +0 -9
- package/src/utils/logDev.mjs +0 -19
- package/src/utils/output.mjs +0 -26
- package/src/utils/profiler/diff.mjs +0 -26
- package/src/utils/profiler/format.mjs +0 -11
- package/src/utils/profiler/index.mjs +0 -144
- package/src/utils/profiler/trace.mjs +0 -26
- package/src/utils/time/scopeTimer.mjs +0 -37
- package/src/utils/time/timer.mjs +0 -33
- package/src/utils/time/withTimer.mjs +0 -11
- package/src/utils/timer.mjs +0 -35
- /package/src/{overtime → domain/overtime}/createOvertimeStats.mjs +0 -0
- /package/src/{overtime → domain/overtime}/overtime.mjs +0 -0
- /package/src/{json.mjs → output/json.mjs} +0 -0
- /package/src/{renderAuthorMapText.mjs → output/renderAuthorMapText.mjs} +0 -0
- /package/src/{stats-text.mjs → output/stats-text.mjs} +0 -0
- /package/src/{stats.mjs → output/stats.mjs} +0 -0
- /package/src/{text.mjs → output/text.mjs} +0 -0
package/.eslintrc
CHANGED
package/.prettierrc
CHANGED
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"bracketSpacing": true,
|
|
3
3
|
"importOrder": [
|
|
4
|
+
|
|
4
5
|
"^./conf(.*)(?<!.css)$",
|
|
5
|
-
"^(#|#company|#command|#ui|components|#utils|#constants||#lib|utils|config|vendored-lib)(/(.*)(?<!.css)$)",
|
|
6
|
+
"^(#|#company|#command|#ui|#src|components|#utils|#constants||#lib|utils|config|vendored-lib)(/(.*)(?<!.css)$)",
|
|
6
7
|
"^(src|@)/(.*)(?<!.css)$",
|
|
7
8
|
"^[./]",
|
|
8
9
|
"^api/(.*)(?<!.css)$",
|
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,101 @@
|
|
|
2
2
|
|
|
3
3
|
All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
|
|
4
4
|
|
|
5
|
+
### [1.0.40](https://github.com/tomatobybike/wukong-gitlog-cli/compare/v1.0.39...v1.0.40) (2026-02-12)
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
### Features
|
|
9
|
+
|
|
10
|
+
* 🎸 --info options ([724a5c4](https://github.com/tomatobybike/wukong-gitlog-cli/commit/724a5c4b582b045682da388a83819c556d88cc7f))
|
|
11
|
+
* 🎸 --version ([0b4a4df](https://github.com/tomatobybike/wukong-gitlog-cli/commit/0b4a4df2c97113e99f2e5ce2cf008c8afe9530e7))
|
|
12
|
+
* 🎸 按照日期生成每天日报 ([67ecf56](https://github.com/tomatobybike/wukong-gitlog-cli/commit/67ecf56a4a0f53269a89d0f9e43409ae86ddd6d2))
|
|
13
|
+
* 🎸 本周加班时长排名 ([964be32](https://github.com/tomatobybike/wukong-gitlog-cli/commit/964be32a657312af8ddb889d4af7c387909f314d))
|
|
14
|
+
* 🎸 采样区间 ([5e4aa4f](https://github.com/tomatobybike/wukong-gitlog-cli/commit/5e4aa4f94edd43fb23f3158587ee5d98342bc66f))
|
|
15
|
+
* 🎸 采样时间 ([fa298f5](https://github.com/tomatobybike/wukong-gitlog-cli/commit/fa298f58f55bcbd15eaa080dcfe9649bf9d8eba8))
|
|
16
|
+
* 🎸 拆分代码结构 ([0497a5a](https://github.com/tomatobybike/wukong-gitlog-cli/commit/0497a5afdf93f94b87cc35efc4cbafb6a61e503f))
|
|
17
|
+
* 🎸 导出 overtime_commits.csv ([d1f3022](https://github.com/tomatobybike/wukong-gitlog-cli/commit/d1f3022b7e6354ee345d3b872bd43ce85d653145))
|
|
18
|
+
* 🎸 导出 overtime_commits.txt 导出 overtime_commits.tab.txt ([290e629](https://github.com/tomatobybike/wukong-gitlog-cli/commit/290e629b0678a4c3ba6ec60a0521d2e71eed2101))
|
|
19
|
+
* 🎸 导出每月数据 ([bec386e](https://github.com/tomatobybike/wukong-gitlog-cli/commit/bec386e17cba0e6c02fe821cdc5dc9e24fe6d0a3))
|
|
20
|
+
* 🎸 进度条 ([368892a](https://github.com/tomatobybike/wukong-gitlog-cli/commit/368892ad112fa7357c629ed12b80d765e10570d0))
|
|
21
|
+
* 🎸 进度条优化 ([ff7c105](https://github.com/tomatobybike/wukong-gitlog-cli/commit/ff7c10559c16fc6cdee3a635df8489a011602b21))
|
|
22
|
+
* 🎸 开发者 累计加班时长 ([2124e5c](https://github.com/tomatobybike/wukong-gitlog-cli/commit/2124e5cf721cc0c483d5bc3c59a64be1558d9fb5))
|
|
23
|
+
* 🎸 开发者 午休最晚提交 ([cfcb62c](https://github.com/tomatobybike/wukong-gitlog-cli/commit/cfcb62c796d4444a3471a71a0ddb8268efed0b99))
|
|
24
|
+
* 🎸 默认参数 ([a8b8c37](https://github.com/tomatobybike/wukong-gitlog-cli/commit/a8b8c373825b51b8c8d79b3060b76608b05a39c9))
|
|
25
|
+
* 🎸 去掉zx,修复windows安装docker导致wsl引起的错误 ([c689aa9](https://github.com/tomatobybike/wukong-gitlog-cli/commit/c689aa9af25ccde7d94d4b24f2aceddfc3b589f5))
|
|
26
|
+
* 🎸 删除冗余的dom ([0acdf10](https://github.com/tomatobybike/wukong-gitlog-cli/commit/0acdf107bbcd68eed934d7f6810d6c9744a9df18))
|
|
27
|
+
* 🎸 完善总数 ([34957c9](https://github.com/tomatobybike/wukong-gitlog-cli/commit/34957c9780d9d43038d0eaeaf9c466c63f271e14))
|
|
28
|
+
* 🎸 午休工作总时长 ([5e61010](https://github.com/tomatobybike/wukong-gitlog-cli/commit/5e61010b18b6e14b753e7605584e334f0f1709f2))
|
|
29
|
+
* 🎸 午休时长 ([6a0d401](https://github.com/tomatobybike/wukong-gitlog-cli/commit/6a0d401e48eccfac00fb53059779886a6d60ad4a))
|
|
30
|
+
* 🎸 新版本新的目录结构 ([c93b52a](https://github.com/tomatobybike/wukong-gitlog-cli/commit/c93b52a771f1f3f8b38fd9e08f845f6c06413d16))
|
|
31
|
+
* 🎸 优化进度条 ([37df680](https://github.com/tomatobybike/wukong-gitlog-cli/commit/37df680bcb2474d0251c64f294ba38496c62d0df))
|
|
32
|
+
* 🎸 优化serve改为前端计算overtime ([dda27de](https://github.com/tomatobybike/wukong-gitlog-cli/commit/dda27de2d99ddd928776b9c3da5b1ffe3394abd9))
|
|
33
|
+
* 🎸 优化web 根据对象内容隐藏对应图表卡片 ([f212abe](https://github.com/tomatobybike/wukong-gitlog-cli/commit/f212abe14b7f9c45221f78ff886a9dbd2a419205))
|
|
34
|
+
* 🎸 重构代码 ([5cc810c](https://github.com/tomatobybike/wukong-gitlog-cli/commit/5cc810c6ac1cb0bdae49cb9258e3de7ff88875fc))
|
|
35
|
+
* 🎸 昼魔侠排行榜 ([6239271](https://github.com/tomatobybike/wukong-gitlog-cli/commit/6239271a4aa624b017781a24123b0420ab6cd936))
|
|
36
|
+
* 🎸 自动更换端口 ([ff2188e](https://github.com/tomatobybike/wukong-gitlog-cli/commit/ff2188efe697275b307c9ff92dc8f796f2460d6d))
|
|
37
|
+
* 🎸 最晚一次提交时间 ([1b21d4a](https://github.com/tomatobybike/wukong-gitlog-cli/commit/1b21d4a5b5384f0ddc48c90db0373785ef7bf382))
|
|
38
|
+
* 🎸 all author ([4a65af2](https://github.com/tomatobybike/wukong-gitlog-cli/commit/4a65af2ccf12ae0169e4dc2052db31b7352e8af4))
|
|
39
|
+
* 🎸 analyzeAction ([26eec68](https://github.com/tomatobybike/wukong-gitlog-cli/commit/26eec68e66994dd194fc25938c06e9d31a132c8c))
|
|
40
|
+
* 🎸 author ([10140c3](https://github.com/tomatobybike/wukong-gitlog-cli/commit/10140c37a39977cb9cd951a7f9c90db81744c751))
|
|
41
|
+
* 🎸 author.changes.mjs create ([06a094a](https://github.com/tomatobybike/wukong-gitlog-cli/commit/06a094a9420701891fbc6683fc30b5366349c7fa))
|
|
42
|
+
* 🎸 authorAliases ([aecf170](https://github.com/tomatobybike/wukong-gitlog-cli/commit/aecf17005d1e3d5a4e66e1b9929709c1b120f749))
|
|
43
|
+
* 🎸 auto init rc.yaml ([212353d](https://github.com/tomatobybike/wukong-gitlog-cli/commit/212353d31edf59e2c6e5e34c14993e1443954f74))
|
|
44
|
+
* 🎸 autofit mobile ([3605a9a](https://github.com/tomatobybike/wukong-gitlog-cli/commit/3605a9a1aece6511ed5b996a0f05af165852c536))
|
|
45
|
+
* 🎸 beta 版本新目录结构 ([c4ddd5c](https://github.com/tomatobybike/wukong-gitlog-cli/commit/c4ddd5c19cc60b2d33226ead0040d4fb42a6b719))
|
|
46
|
+
* 🎸 chart order ([711ccfe](https://github.com/tomatobybike/wukong-gitlog-cli/commit/711ccfef636607954f595188dac51dcac10c253b))
|
|
47
|
+
* 🎸 command journal cmd ([1ba9fad](https://github.com/tomatobybike/wukong-gitlog-cli/commit/1ba9fadd3a4b2e332661a7658d02db3666361959))
|
|
48
|
+
* 🎸 create author.txt ([da33af7](https://github.com/tomatobybike/wukong-gitlog-cli/commit/da33af7f5e6605416a33545c9fc658870a5f528b))
|
|
49
|
+
* 🎸 dayreport 去重 ([902b1f4](https://github.com/tomatobybike/wukong-gitlog-cli/commit/902b1f46c0473a251c8ab9a8ba8147fe31ef2f4d))
|
|
50
|
+
* 🎸 del log ([a2f19fa](https://github.com/tomatobybike/wukong-gitlog-cli/commit/a2f19fad2b3fa6f149a36fd4daa7159233a27b28))
|
|
51
|
+
* 🎸 export day report excel and txt ([edb51f0](https://github.com/tomatobybike/wukong-gitlog-cli/commit/edb51f08bc7b04d7b32e8bd96f3f956f06b1bbba))
|
|
52
|
+
* 🎸 export each week ([b774969](https://github.com/tomatobybike/wukong-gitlog-cli/commit/b774969ac67ea53906464cd6aa14f839857235f3))
|
|
53
|
+
* 🎸 export overtime ([cae5c44](https://github.com/tomatobybike/wukong-gitlog-cli/commit/cae5c44789a418c1105eee239a4d4bd6b6f17297))
|
|
54
|
+
* 🎸 export overtime ([758ba8a](https://github.com/tomatobybike/wukong-gitlog-cli/commit/758ba8ac09710c9144216352e77c7c985e425061))
|
|
55
|
+
* 🎸 findPkgRoot,辅助函数:向上寻找包含 package.json 的根目录 并启动serve ([5e06a3a](https://github.com/tomatobybike/wukong-gitlog-cli/commit/5e06a3a4b2ab25f415607a8fb1940be6f9fe7934))
|
|
56
|
+
* 🎸 git auto ignore ([0d3c834](https://github.com/tomatobybike/wukong-gitlog-cli/commit/0d3c8340c12e3d380fe47ce4795458a1624be31b))
|
|
57
|
+
* 🎸 handleExportByMonth导出每月数据 ([be57f28](https://github.com/tomatobybike/wukong-gitlog-cli/commit/be57f28330f30136866ab6a180aa5f8e1d7dcef0))
|
|
58
|
+
* 🎸 handleExportCommits ([6e18f3c](https://github.com/tomatobybike/wukong-gitlog-cli/commit/6e18f3cb9f5a12a1d7d60ff19676f504ec3beac9))
|
|
59
|
+
* 🎸 handleExportCommitsJson ,handleExportAuthorChangesJson ([db63749](https://github.com/tomatobybike/wukong-gitlog-cli/commit/db63749675058c322426057cacac03ac825fd819))
|
|
60
|
+
* 🎸 i18n en and cn ([9c98b86](https://github.com/tomatobybike/wukong-gitlog-cli/commit/9c98b866454dddccd6f6954aba9794f69cc4eed8))
|
|
61
|
+
* 🎸 init 支持 .wukonggitlogrc,.wukonggitlogrc.js,.wukonggitlo ([ae30c54](https://github.com/tomatobybike/wukong-gitlog-cli/commit/ae30c5433bf44aaec2b9a5fc630c4eabf78e5504))
|
|
62
|
+
* 🎸 init ems ([dd34dba](https://github.com/tomatobybike/wukong-gitlog-cli/commit/dd34dba16cf5fae9346fb7eef004cf4de9bfc283))
|
|
63
|
+
* 🎸 initActionWithTemp ([34348e6](https://github.com/tomatobybike/wukong-gitlog-cli/commit/34348e6c489176a3ec714a811976224b34b01bfa))
|
|
64
|
+
* 🎸 journal 数据去重掉cherry pick的 ([977a4d9](https://github.com/tomatobybike/wukong-gitlog-cli/commit/977a4d966c89c44194f4d7d4ccf2b3d7262a0214))
|
|
65
|
+
* 🎸 journal cmd ([efb39a8](https://github.com/tomatobybike/wukong-gitlog-cli/commit/efb39a826fb4dcae9555811613708f355364732b))
|
|
66
|
+
* 🎸 log git ([b0f4c45](https://github.com/tomatobybike/wukong-gitlog-cli/commit/b0f4c4512633f88d5b9843f8ad4c9f1c4abcba9b))
|
|
67
|
+
* 🎸 lunch work time ([7ada3eb](https://github.com/tomatobybike/wukong-gitlog-cli/commit/7ada3eb4f02b56527660060154a845e8d1eb56d4))
|
|
68
|
+
* 🎸 osLocale ([a6dad80](https://github.com/tomatobybike/wukong-gitlog-cli/commit/a6dad80accb6b67200178833d6d83448747935d7))
|
|
69
|
+
* 🎸 out-parent web serve ([6fbc857](https://github.com/tomatobybike/wukong-gitlog-cli/commit/6fbc857aff1d3434b8a767f2b341cd353b68523e))
|
|
70
|
+
* 🎸 overtime ([a4ae89e](https://github.com/tomatobybike/wukong-gitlog-cli/commit/a4ae89e6be9bdef109ff8ba8bdbd67f435c5eb7a))
|
|
71
|
+
* 🎸 overtime.mjs data ([d63c4d4](https://github.com/tomatobybike/wukong-gitlog-cli/commit/d63c4d4e725c917f69cab7e8f2c64c1785fb897a))
|
|
72
|
+
* 🎸 pie chart ([141f65b](https://github.com/tomatobybike/wukong-gitlog-cli/commit/141f65b3a1af9986d088ba35f630128682617b44))
|
|
73
|
+
* 🎸 profile ([97bf236](https://github.com/tomatobybike/wukong-gitlog-cli/commit/97bf236faf310bd621d5850b3f96feb74b0566b7))
|
|
74
|
+
* 🎸 render authorTotalOvertimeRank ([04dd3d8](https://github.com/tomatobybike/wukong-gitlog-cli/commit/04dd3d8d0c241e5de248905ca6f2ca4014507096))
|
|
75
|
+
* 🎸 slider add index ([84a1f9b](https://github.com/tomatobybike/wukong-gitlog-cli/commit/84a1f9b964187c6cd4818117200199c4495f22a6))
|
|
76
|
+
* 🎸 tabsTotalCommits charts ([6e435b5](https://github.com/tomatobybike/wukong-gitlog-cli/commit/6e435b52a992818ecb1429738b74de4e336bbdb7))
|
|
77
|
+
* 🎸 tooltips 排序 ([1a4269f](https://github.com/tomatobybike/wukong-gitlog-cli/commit/1a4269f8c7248aff34102dae9c4b317eb32e2c17))
|
|
78
|
+
* 🎸 update profile add dir ([3171dc6](https://github.com/tomatobybike/wukong-gitlog-cli/commit/3171dc6b5e236985e266b5cbc4b1838abf65a422))
|
|
79
|
+
* 🎸 update wukong-profile ([9b9fbc6](https://github.com/tomatobybike/wukong-gitlog-cli/commit/9b9fbc68c9b8985c6b59b399bc801788c6c88d5a))
|
|
80
|
+
* 🎸 wukong-progress ([4b41ae4](https://github.com/tomatobybike/wukong-gitlog-cli/commit/4b41ae4ebaad5d8c537898be975167ec4c772f26))
|
|
81
|
+
|
|
82
|
+
|
|
83
|
+
### Bug Fixes
|
|
84
|
+
|
|
85
|
+
* 🐛 eslint warning ([5a145aa](https://github.com/tomatobybike/wukong-gitlog-cli/commit/5a145aa9836e1126e85281da1039d2777a1efbe3))
|
|
86
|
+
* 🐛 exit ([12e5839](https://github.com/tomatobybike/wukong-gitlog-cli/commit/12e5839104125cc0144115b89af93d5b076e49fb))
|
|
87
|
+
* 🐛 export i18n ([c2880ea](https://github.com/tomatobybike/wukong-gitlog-cli/commit/c2880ea26130eb4a17a163e614d237dd60f53b89))
|
|
88
|
+
* 🐛 fix bug ([3158f55](https://github.com/tomatobybike/wukong-gitlog-cli/commit/3158f55a1cfddcc8eb2e5162c62c101804fc553b))
|
|
89
|
+
* 🐛 fix front bug ([aec940f](https://github.com/tomatobybike/wukong-gitlog-cli/commit/aec940f8b38a6d698f6adab42cd235b16e93cb8e))
|
|
90
|
+
* 🐛 fix lost data ([4126979](https://github.com/tomatobybike/wukong-gitlog-cli/commit/4126979a7ceb48073dd346ae851ce464be63c3a4))
|
|
91
|
+
* 🐛 fix some bug ([cc7144b](https://github.com/tomatobybike/wukong-gitlog-cli/commit/cc7144b173ea41a860949fec309bbb699ad19e40))
|
|
92
|
+
* 🐛 init i18n ([ce30157](https://github.com/tomatobybike/wukong-gitlog-cli/commit/ce301570d96ad2d233882f0a041d8428f5a4d798))
|
|
93
|
+
* 🐛 journal ([2ac89f1](https://github.com/tomatobybike/wukong-gitlog-cli/commit/2ac89f1e19d833bd9a1fc94451a69b88cc24d33f))
|
|
94
|
+
* 🐛 lost data ([baf74ec](https://github.com/tomatobybike/wukong-gitlog-cli/commit/baf74ec0694cd48800f39e81768ef03d848d344b))
|
|
95
|
+
* 🐛 missing dependencies ([7d9a403](https://github.com/tomatobybike/wukong-gitlog-cli/commit/7d9a403e478c56ebeb9c63a13b0efde1229d123b))
|
|
96
|
+
* 🐛 missing dependencies ([368aaeb](https://github.com/tomatobybike/wukong-gitlog-cli/commit/368aaeb61d6449f49036b8a29b06e2c096460a2a))
|
|
97
|
+
* 🐛 overtime i18n ([bc855f7](https://github.com/tomatobybike/wukong-gitlog-cli/commit/bc855f764d1a02d4b5eeca7d4a6d0c3294e38c30))
|
|
98
|
+
* 🐛 server i18n ([3a408e6](https://github.com/tomatobybike/wukong-gitlog-cli/commit/3a408e63273e2e9ca09b434d8106a6babf5d8792))
|
|
99
|
+
|
|
5
100
|
### [1.0.39](https://github.com/tomatobybike/wukong-gitlog-cli/compare/v1.0.38...v1.0.39) (2025-12-29)
|
|
6
101
|
|
|
7
102
|
|
package/README.md
CHANGED
|
@@ -1,246 +1,166 @@
|
|
|
1
|
-
|
|
1
|
+
# 📦 `wukong-gitlog-cli`
|
|
2
2
|
|
|
3
|
-
<p align="center">
|
|
4
|
-
<img src="https://raw.githubusercontent.com/tomatobybike/wukong-gitlog-cli/main/images/logo.svg" width="200" alt="wukong-dev Logo" />
|
|
5
|
-
</p>
|
|
3
|
+
<p align="center"> <img src="https://raw.githubusercontent.com/tomatobybike/wukong-gitlog-cli/main/images/logo.svg" width="200" alt="wukong-dev Logo" /> </p> <p align="center"> <a href="https://www.npmjs.com/package/wukong-gitlog-cli"><img src="https://img.shields.io/npm/v/wukong-gitlog-cli.svg" alt="npm version"></a> <a href="https://www.npmjs.com/package/wukong-gitlog-cli"><img src="https://img.shields.io/npm/dm/wukong-gitlog-cli.svg" alt="downloads"></a> <a href="https://github.com/tomatobybike/wukong-gitlog-cli/blob/master/LICENSE"><img src="https://img.shields.io/github/license/tomatobybike/wukong-gitlog-cli.svg" alt="license"></a> <a href="https://github.com/tomatobybike/wukong-gitlog-cli"><img src="https://img.shields.io/github/stars/tomatobybike/wukong-gitlog-cli.svg?style=social" alt="GitHub stars"></a> <a href="https://github.com/tomatobybike/wukong-gitlog-cli/issues"><img src="https://img.shields.io/github/issues/tomatobybike/wukong-gitlog-cli.svg" alt="issues"></a> </p>
|
|
6
4
|
|
|
7
|
-
|
|
8
|
-
<a href="https://www.npmjs.com/package/wukong-gitlog-cli"><img src="https://img.shields.io/npm/v/wukong-gitlog-cli.svg" alt="npm version"></a>
|
|
9
|
-
<a href="https://www.npmjs.com/package/wukong-gitlog-cli"><img src="https://img.shields.io/npm/dm/wukong-gitlog-cli.svg" alt="downloads"></a>
|
|
10
|
-
<a href="https://github.com/tomatobybike/wukong-gitlog-cli/blob/master/LICENSE"><img src="https://img.shields.io/github/license/tomatobybike/wukong-gitlog-cli.svg" alt="license"></a>
|
|
11
|
-
<a href="https://github.com/tomatobybike/wukong-gitlog-cli"><img src="https://img.shields.io/github/stars/tomatobybike/wukong-gitlog-cli.svg?style=social" alt="GitHub stars"></a>
|
|
12
|
-
<a href="https://github.com/tomatobybike/wukong-gitlog-cli/issues"><img src="https://img.shields.io/github/issues/tomatobybike/wukong-gitlog-cli.svg" alt="issues"></a>
|
|
13
|
-
</p>
|
|
5
|
+
An enhanced Git commit log analysis and export tool. Supports **Excel / JSON / TXT** output, grouped statistics, overtime culture analysis, Gerrit link integration, and a visual Web Dashboard.
|
|
14
6
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
## English | [简体中文](./README.zh-CN.md)
|
|
18
|
-
|
|
19
|
-
## Features
|
|
20
|
-
|
|
21
|
-
- Export commit logs to JSON / text or Excel (XLSX)
|
|
22
|
-
- Group commits by date (day / month)
|
|
23
|
-
- Include a daily stats sheet in Excel
|
|
24
|
-
- Optional Gerrit links per commit (custom template or prefix)
|
|
25
|
-
- Small, dependency-friendly CLI using ZX and ExcelJS
|
|
7
|
+
## [中文](./README.zh-CN.md) | English
|
|
26
8
|
|
|
27
9
|
---
|
|
28
10
|
|
|
29
|
-
##
|
|
11
|
+
## ✨ Features
|
|
30
12
|
|
|
31
|
-
-
|
|
32
|
-
-
|
|
33
|
-
-
|
|
34
|
-
-
|
|
13
|
+
- **Multi-format Export**: Export Git logs to JSON, Text, or Excel (XLSX).
|
|
14
|
+
- **Flexible Grouping**: Support grouping by day or month.
|
|
15
|
+
- **Overtime Analysis**: Analyze daily work hours, holidays, weekends, and cumulative risks.
|
|
16
|
+
- **Gerrit Integration**: Customizable Gerrit URL templates (`{{hash}}`, `{{changeId}}`, `{{changeNumber}}`).
|
|
17
|
+
- **Web Dashboard**: Interactive local dashboard with charts and risk summaries.
|
|
18
|
+
- **Deduplication**: Automatically deduplicate commits by `Change-Id`.
|
|
19
|
+
- **Author Mapping**: Support `authorAliases` to merge different emails/names into one person.
|
|
35
20
|
|
|
36
21
|
---
|
|
37
22
|
|
|
38
|
-
## Installation
|
|
23
|
+
## 📥 Installation
|
|
39
24
|
|
|
40
|
-
Install globally
|
|
25
|
+
Install globally (recommended):
|
|
41
26
|
|
|
42
27
|
```bash
|
|
43
|
-
# Or install via npm when published:
|
|
44
28
|
npm i -g wukong-gitlog-cli
|
|
45
|
-
|
|
29
|
+
# or
|
|
46
30
|
yarn global add wukong-gitlog-cli
|
|
47
31
|
|
|
48
|
-
#
|
|
32
|
+
# Run
|
|
49
33
|
wukong-gitlog-cli --help
|
|
50
34
|
```
|
|
51
35
|
|
|
52
36
|
---
|
|
53
37
|
|
|
54
|
-
##
|
|
38
|
+
## 🚀 Quick Start
|
|
55
39
|
|
|
56
40
|
```bash
|
|
57
|
-
|
|
58
|
-
|
|
41
|
+
# Initialize configuration
|
|
42
|
+
wukong-gitlog-cli init
|
|
59
43
|
|
|
60
|
-
|
|
61
|
-
wukong-gitlog-cli
|
|
44
|
+
# Analyze and start web dashboard
|
|
45
|
+
wukong-gitlog-cli serve --overtime
|
|
62
46
|
```
|
|
63
47
|
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
- `--author <name>` Filter commits by author name
|
|
67
|
-
- `--email <email>` Filter commits by author email
|
|
68
|
-
- `--since <date>` Start date (e.g., 2025-01-01)
|
|
69
|
-
- `--until <date>` End date
|
|
70
|
-
- `--limit <n>` Limit number of commits
|
|
71
|
-
- `--no-merges` Exclude merge commits
|
|
72
|
-
- `--json` Output JSON
|
|
73
|
-
- `--format <type>` Output format: `text` | `excel` | `json` (default: `text`)
|
|
74
|
-
- `--group-by <type>` Group commits by date: `day` | `month`
|
|
75
|
-
- `--overtime` Analyze overtime culture: output counts/percentages for commits outside work hours and on non-workdays (per-person breakdown)
|
|
76
|
-
- `--country <code>` Country/region for holidays (CN|US). Default: `CN`.
|
|
77
|
-
- `--work-start <hour>` Workday start hour. Default: `9`.
|
|
78
|
-
- `--work-end <hour>` Workday end hour. Default: `18`.
|
|
79
|
-
- `--lunch-start <hour>` Lunch break start hour. Default: `12`.
|
|
80
|
-
- `--lunch-end <hour>` Lunch break end hour. Default: `14`.
|
|
81
|
-
- `--stats` Include a `Stats` sheet in the Excel export
|
|
82
|
-
- `--gerrit-api <url>` Optional: Gerrit REST API base URL for resolving `{{changeNumber}}` (e.g. `https://gerrit.example.com/gerrit`)
|
|
83
|
-
- `--gerrit-auth <token>` Optional: Authorization for Gerrit REST API (either `user:pass` for Basic or token string for Bearer)
|
|
84
|
-
- `--gerrit <prefix>` Show Gerrit URL for each commit (supports templates `{{hash}}`, `{{changeId}}` and `{{changeNumber}}`; `{{changeId}}` falls back to `hash` when absent; `{{changeNumber}}` requires `--gerrit-api` and falls back to `changeId` or `hash`)
|
|
85
|
-
- `--out <file>` Output file name (without path). Defaults: `commits.json` / `commits.txt` / `commits.xlsx`
|
|
86
|
-
- `--out-dir <dir>` Output directory path — supports relative or absolute path, e.g., `--out-dir ../output`
|
|
87
|
-
- `--serve` Start the local web service and view the submission statistics (data files will be generated under output/data)
|
|
88
|
-
- `--port <n>` Local web service port (default: 3000)
|
|
89
|
-
- `--serve-only` Only start the web service without exporting or analyzing data (using existing data in output/data)
|
|
90
|
-
- `--version` show version information
|
|
91
|
-
|
|
92
|
-
> Output files are written to an `output/` directory in the current working directory.
|
|
93
|
-
>
|
|
94
|
-
> Tip: Use `--out-parent` or `--out-dir ../output` to write outputs into the parent folder's `output/` to avoid accidentally committing generated files to your repository.
|
|
95
|
-
|
|
96
|
-
### Per-period outputs
|
|
97
|
-
|
|
98
|
-
You can generate per-month and per-week outputs under `output/month/` and `output/week/` using the `--per-period-formats` option. Example:
|
|
48
|
+
---
|
|
99
49
|
|
|
100
|
-
|
|
101
|
-
wukong-gitlog-cli --overtime --limit 200 --format text --out commits.txt --per-period-formats csv,tab
|
|
102
|
-
```
|
|
50
|
+
## 🛠 Commands
|
|
103
51
|
|
|
104
|
-
|
|
52
|
+
The tool is organized into several subcommands:
|
|
105
53
|
|
|
54
|
+
### 1. `init`
|
|
55
|
+
Initialize configuration file (`.wukonggitlogrc` in YAML, JS, or JSON format).
|
|
106
56
|
```bash
|
|
107
|
-
wukong-gitlog-cli
|
|
108
|
-
wukong-gitlog-cli --overtime --limit 200 --format text --out commits.txt --per-period-formats xlsx --per-period-excel-mode files
|
|
57
|
+
wukong-gitlog-cli init [-f, --force]
|
|
109
58
|
```
|
|
110
59
|
|
|
111
|
-
|
|
112
|
-
|
|
60
|
+
### 2. `analyze`
|
|
61
|
+
Core analysis command. Fetches logs and performs comprehensive analysis.
|
|
113
62
|
```bash
|
|
114
|
-
wukong-gitlog-cli
|
|
63
|
+
wukong-gitlog-cli analyze [options]
|
|
115
64
|
```
|
|
116
65
|
|
|
117
|
-
###
|
|
118
|
-
|
|
119
|
-
You can start a small static web dashboard to visualize commit statistics and charts. It will export raw commits and analyzed stats into `output/data/` as `commits.mjs` and `overtime-stats.mjs`, and start a local web server serving `web/` and `output/data/`:
|
|
120
|
-
|
|
66
|
+
### 3. `overtime`
|
|
67
|
+
Focused on overtime culture analysis.
|
|
121
68
|
```bash
|
|
122
|
-
|
|
123
|
-
wukong-gitlog-cli --serve --overtime --limit 200 --out commits.txt
|
|
124
|
-
|
|
125
|
-
# Start server only (use existing output/data)
|
|
126
|
-
wukong-gitlog-cli --serve-only
|
|
127
|
-
|
|
128
|
-
# Custom port
|
|
129
|
-
wukong-gitlog-cli --serve --port 8080 --overtime --limit 200 --out commits.txt
|
|
69
|
+
wukong-gitlog-cli overtime [options]
|
|
130
70
|
```
|
|
131
71
|
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
<p align="center">
|
|
135
|
-
<img src="https://raw.githubusercontent.com/tomatobybike/wukong-gitlog-cli/main/images/web/overtime.jpg" width="400" alt="wukong-dev Logo" />
|
|
136
|
-
</p>
|
|
137
|
-
|
|
138
|
-
---
|
|
139
|
-
|
|
140
|
-
## Gerrit support
|
|
141
|
-
|
|
142
|
-
Use the `--gerrit` option to include a Gerrit link for each commit. You can provide a template containing `{{hash}}` to place the full commit hash into the URL, for example:
|
|
143
|
-
|
|
72
|
+
### 4. `export`
|
|
73
|
+
Focuses on exporting data to different formats.
|
|
144
74
|
```bash
|
|
145
|
-
wukong-gitlog-cli
|
|
75
|
+
wukong-gitlog-cli export [options]
|
|
146
76
|
```
|
|
147
77
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
You can also use `{{changeId}}` in the template to reference Gerrit change id. The tool will try to extract a `Change-Id: I...` value from the commit body and replace `{{changeId}}` with it. If it can't find a `Change-Id`, the CLI will fall back to using the commit `hash`.
|
|
151
|
-
|
|
152
|
-
The Gerrit link will show up in:
|
|
153
|
-
|
|
154
|
-
- The text output if `--format text` (as a new `Gerrit` column)
|
|
155
|
-
- The Excel export as a `Gerrit` column if `--format excel`
|
|
156
|
-
- JSON output will include a `gerrit` field for each record when `--gerrit` is used
|
|
157
|
-
- JSON output will include a `gerrit` field for each record when `--gerrit` is used
|
|
158
|
-
- When `--gerrit` uses `{{changeId}}`, the CLI will try to extract `Change-Id:` from the commit body and include `changeId` and `body` in the JSON record. If no `Change-Id` is present, the CLI falls back to `hash` when forming the Gerrit URL.
|
|
159
|
-
|
|
160
|
-
Note: `--out <file>` is the filename only and the directory used to store that file depends on:
|
|
161
|
-
|
|
162
|
-
- The default directory `./output/` in the current working directory
|
|
163
|
-
- `--out-dir <dir>` to override the target folder (relative or absolute)
|
|
164
|
-
- `--out-parent` to write to the parent repository folder `../output/` (same as `--out-dir ../output`)
|
|
165
|
-
|
|
166
|
-
For example:
|
|
167
|
-
|
|
78
|
+
### 5. `journal`
|
|
79
|
+
Generate daily journals/logs.
|
|
168
80
|
```bash
|
|
169
|
-
|
|
170
|
-
wukong-gitlog-cli --out parent.json --out-parent
|
|
171
|
-
wukong-gitlog-cli --out demo.txt --out-dir ../temp
|
|
81
|
+
wukong-gitlog-cli journal [options]
|
|
172
82
|
```
|
|
173
83
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
## Examples
|
|
177
|
-
|
|
178
|
-
Export as text, grouped by month, with Gerrit links:
|
|
179
|
-
|
|
84
|
+
### 6. `serve`
|
|
85
|
+
Start local Web Dashboard. It automatically runs analysis before starting.
|
|
180
86
|
```bash
|
|
181
|
-
wukong-gitlog-cli
|
|
87
|
+
wukong-gitlog-cli serve [--port <n>]
|
|
182
88
|
```
|
|
183
89
|
|
|
184
|
-
|
|
185
|
-
wukong-gitlog-cli --format text --group-by month --gerrit "https://gerrit.example.com/c/project/+/{{changeNumber}}" --gerrit-api <GERRIT_API_BASE_URL>
|
|
90
|
+
---
|
|
186
91
|
|
|
187
|
-
|
|
92
|
+
## ⚙️ Options
|
|
93
|
+
|
|
94
|
+
### Global Options
|
|
95
|
+
- `-l, --lang <code>`: Set language (en, zh-CN).
|
|
96
|
+
- `--debug`: Enable debug mode.
|
|
97
|
+
- `--info`: Show environment info (Git version, OS, etc.).
|
|
98
|
+
|
|
99
|
+
### Git Options (for `analyze`, `overtime`, `export`, `journal`)
|
|
100
|
+
- `--author <name>`: Filter by author name.
|
|
101
|
+
- `--email <email>`: Filter by author email.
|
|
102
|
+
- `--since <date>`: Start date (e.g., 2025-01-01).
|
|
103
|
+
- `--until <date>`: End date.
|
|
104
|
+
- `--limit <n>`: Limit number of commits.
|
|
105
|
+
- `--no-merges`: Exclude merge commits.
|
|
106
|
+
- `--path <path>`: Git repository path.
|
|
107
|
+
|
|
108
|
+
### Analysis Options
|
|
109
|
+
- `--work-start <hour>`: Standard work start hour (default: 9).
|
|
110
|
+
- `--work-end <hour>`: Standard work end hour (default: 18).
|
|
111
|
+
- `--overnight-cutoff <hour>`: Hour to cutoff for overnight work (default: 6).
|
|
112
|
+
- `--country <code>`: Holiday calendar (CN, US, etc.).
|
|
113
|
+
|
|
114
|
+
### Output Options
|
|
115
|
+
- `-f, --format <type>`: Output format (text, excel, json).
|
|
116
|
+
- `--out <file>`: Output filename.
|
|
117
|
+
- `--out-dir <dir>`: Output directory.
|
|
118
|
+
- `--stats`: Include statistics in Excel.
|
|
188
119
|
|
|
189
|
-
|
|
190
|
-
# HTTP Basic: username:password
|
|
191
|
-
wukong-gitlog-cli --format text --gerrit "https://gerrit.example.com/c/project/+/{{changeNumber}}" --gerrit-api <GERRIT_API_BASE_URL> --gerrit-auth "username:password"
|
|
120
|
+
---
|
|
192
121
|
|
|
193
|
-
|
|
194
|
-
wukong-gitlog-cli --format text --gerrit "https://gerrit.example.com/c/project/+/{{changeNumber}}" --gerrit-api <GERRIT_API_BASE_URL> --gerrit-auth "MYTOKEN"
|
|
195
|
-
```
|
|
122
|
+
## 📊 Web Dashboard
|
|
196
123
|
|
|
197
|
-
|
|
124
|
+
Start the server to view interactive charts:
|
|
198
125
|
|
|
199
126
|
```bash
|
|
200
|
-
wukong-gitlog-cli
|
|
127
|
+
wukong-gitlog-cli serve --overtime --port 3000
|
|
201
128
|
```
|
|
202
129
|
|
|
203
|
-
|
|
130
|
+
Visit `http://localhost:3000` to see:
|
|
131
|
+
- Commit distribution by day/month.
|
|
132
|
+
- Overtime trends and peak hours.
|
|
133
|
+
- **Recent 30-day Overtime Risk**: Automatically calculates cumulative overtime for the last 30 days and flags risks (Mild, Moderate, Severe).
|
|
204
134
|
|
|
205
|
-
|
|
206
|
-
wukong-gitlog-cli --json --out commits.json
|
|
207
|
-
```
|
|
135
|
+
---
|
|
208
136
|
|
|
209
|
-
|
|
137
|
+
## 🔗 Gerrit Support
|
|
210
138
|
|
|
139
|
+
Use templates in Gerrit URLs:
|
|
211
140
|
```bash
|
|
212
|
-
wukong-gitlog-cli
|
|
141
|
+
wukong-gitlog-cli analyze --gerrit "https://gerrit.example.com/c/project/+/{{hash}}"
|
|
213
142
|
```
|
|
214
143
|
|
|
215
|
-
|
|
216
|
-
|
|
144
|
+
To use numeric `changeNumber`, provide the Gerrit API:
|
|
217
145
|
```bash
|
|
218
|
-
wukong-gitlog-cli --
|
|
146
|
+
wukong-gitlog-cli analyze --gerrit "https://gerrit.example.com/c/project/+/{{changeNumber}}" --gerrit-api https://gerrit.example.com/gerrit
|
|
219
147
|
```
|
|
220
148
|
|
|
221
|
-
|
|
149
|
+
---
|
|
222
150
|
|
|
223
|
-
|
|
224
|
-
- Internally `src/utils/index.mjs` acts as a barrel that re-exports helper functions located in `src/utils/`.
|
|
225
|
-
- If you plan to reuse the helpers in other modules, import from `./src/utils/index.mjs` explicitly.
|
|
226
|
-
- The Excel export uses `exceljs` and adds an `autoFilter` to the sheet header.
|
|
151
|
+
## 🧾 Author Mapping (`authorAliases`)
|
|
227
152
|
|
|
228
|
-
|
|
153
|
+
Merge multiple identities in configuration:
|
|
229
154
|
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
155
|
+
```yaml
|
|
156
|
+
authorAliases:
|
|
157
|
+
"tomatoboy@abc.com": "tomatoboy"
|
|
158
|
+
"tomato@xxx.com": "tomatoboy"
|
|
159
|
+
"Tom Jacky": "tomatoboy"
|
|
234
160
|
```
|
|
235
161
|
|
|
236
162
|
---
|
|
237
163
|
|
|
238
|
-
##
|
|
239
|
-
|
|
240
|
-
PRs are welcome — add tests and keep changes modular. If you add new CLI flags or new fields in commit records, please update this README accordingly.
|
|
241
|
-
|
|
242
|
-
---
|
|
243
|
-
|
|
244
|
-
## License
|
|
164
|
+
## 📄 License
|
|
245
165
|
|
|
246
166
|
MIT
|