commit-report 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 qqzhangyanhua
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,116 @@
1
+ # commit-report
2
+
3
+ [![npm version](https://img.shields.io/npm/v/commit-report.svg)](https://www.npmjs.com/package/commit-report)
4
+ [![license](https://img.shields.io/npm/l/commit-report.svg)](https://github.com/qqzhangyanhua/commitx/blob/main/LICENSE)
5
+ [![GitHub](https://img.shields.io/badge/GitHub-qqzhangyanhua%2Fcommitx-blue)](https://github.com/qqzhangyanhua/commitx)
6
+
7
+ Git 提交统计工具,递归扫描目录中的 Git 仓库,生成可视化 HTML 报告。
8
+
9
+ ## 预览
10
+
11
+ 查看 [示例报告](https://github.com/qqzhangyanhua/commitx#readme) 了解可视化效果。
12
+
13
+ ## 特性
14
+
15
+ - **递归扫描**:自动发现目录下所有 Git 仓库
16
+ - **多仓库支持**:交互式选择要分析的仓库,支持合并统计
17
+ - **多维度统计**:提交次数、代码行数、作者贡献、文件类型、目录活跃度、时间分布
18
+ - **可视化报告**:生成单文件 HTML 报告,包含 5 种 D3.js 交互式图表
19
+ - **明暗主题**:支持亮色/暗色主题切换,自动跟随系统设置
20
+
21
+ ## 安装
22
+
23
+ ```bash
24
+ # 全局安装
25
+ npm install -g commit-report
26
+
27
+ # 或直接使用 npx
28
+ npx commit-report
29
+ ```
30
+
31
+ ## 使用
32
+
33
+ ```bash
34
+ # 默认:扫描当前目录,统计最近 3 个月
35
+ commit-report
36
+
37
+ # 指定时间预设
38
+ commit-report --period 7d # 最近 7 天
39
+ commit-report --period 1m # 最近 1 个月
40
+ commit-report --period 6m # 最近 6 个月
41
+ commit-report --period 1y # 最近 1 年
42
+
43
+ # 自定义时间范围
44
+ commit-report --from 2024-01-01 --to 2024-06-30
45
+
46
+ # 指定目录
47
+ commit-report /path/to/projects
48
+
49
+ # 指定作者
50
+ commit-report --author "Alice"
51
+
52
+ # 自定义输出文件名
53
+ commit-report --output my-report.html
54
+
55
+ # 不自动打开浏览器
56
+ commit-report --no-open
57
+ ```
58
+
59
+ ## 参数
60
+
61
+ | 参数 | 缩写 | 默认值 | 说明 |
62
+ |------|------|--------|------|
63
+ | `--period` | `-p` | `3m` | 时间预设 (7d/1m/3m/6m/1y) |
64
+ | `--from` | `-f` | - | 起始日期 (YYYY-MM-DD) |
65
+ | `--to` | `-t` | - | 结束日期 (YYYY-MM-DD) |
66
+ | `--author` | `-a` | - | 过滤作者 |
67
+ | `--output` | `-o` | `commit-report.html` | 输出文件 |
68
+ | `--no-open` | - | `false` | 不打开浏览器 |
69
+ | `--depth` | `-d` | `20` | 最大扫描深度 |
70
+
71
+ ## 报告包含
72
+
73
+ - **概要卡片**:提交次数、新增行数、删除行数、变更文件数
74
+ - **提交热力图**:GitHub 风格日历热力图
75
+ - **时间分布图**:24 小时提交时间柱状图
76
+ - **文件类型占比**:甜甜圈图展示代码语言分布
77
+ - **作者排行榜**:按提交次数排名的横向柱状图
78
+ - **目录活跃度**:TOP 10 最活跃目录
79
+
80
+ ## 开发
81
+
82
+ ```bash
83
+ # 安装依赖
84
+ pnpm install
85
+
86
+ # 开发模式(监听文件变化)
87
+ pnpm dev
88
+
89
+ # 构建
90
+ pnpm build
91
+
92
+ # 本地测试
93
+ node dist/index.js --no-open /path/to/repos
94
+ ```
95
+
96
+ ## 技术栈
97
+
98
+ - TypeScript + tsup 构建
99
+ - Commander.js (CLI 参数解析)
100
+ - Inquirer.js (交互式选择)
101
+ - D3.js (数据可视化)
102
+ - Tailwind CSS (报告样式)
103
+
104
+ ## 问题反馈
105
+
106
+ 如果遇到问题或有功能建议,欢迎提交 [Issue](https://github.com/qqzhangyanhua/commitx/issues)。
107
+
108
+ ## License
109
+
110
+ MIT © [qqzhangyanhua](https://github.com/qqzhangyanhua)
111
+
112
+ ## 链接
113
+
114
+ - [GitHub 仓库](https://github.com/qqzhangyanhua/commitx)
115
+ - [npm 包页面](https://www.npmjs.com/package/commit-report)
116
+ - [问题追踪](https://github.com/qqzhangyanhua/commitx/issues)