daily-git-summary 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/INSTALL.md +71 -0
- package/QUICKSTART.md +96 -0
- package/README.md +248 -0
- package/bin/daily-summary +4 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +218 -0
- package/dist/cli.js.map +1 -0
- package/dist/fileManager.d.ts +28 -0
- package/dist/fileManager.d.ts.map +1 -0
- package/dist/fileManager.js +137 -0
- package/dist/fileManager.js.map +1 -0
- package/dist/git.d.ts +14 -0
- package/dist/git.d.ts.map +1 -0
- package/dist/git.js +74 -0
- package/dist/git.js.map +1 -0
- package/dist/markdown.d.ts +10 -0
- package/dist/markdown.d.ts.map +1 -0
- package/dist/markdown.js +125 -0
- package/dist/markdown.js.map +1 -0
- package/dist/parser.d.ts +31 -0
- package/dist/parser.d.ts.map +1 -0
- package/dist/parser.js +136 -0
- package/dist/parser.js.map +1 -0
- package/dist/time.d.ts +34 -0
- package/dist/time.d.ts.map +1 -0
- package/dist/time.js +110 -0
- package/dist/time.js.map +1 -0
- package/dist/types.d.ts +49 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +49 -0
package/INSTALL.md
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# Quick Installation Guide
|
|
2
|
+
|
|
3
|
+
## Step 1: Install Globally
|
|
4
|
+
|
|
5
|
+
From the `daily-git-summary` directory, run:
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install -g .
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
This will make the `daily-summary` and `ds` commands available globally.
|
|
12
|
+
|
|
13
|
+
## Step 2: Test the Installation
|
|
14
|
+
|
|
15
|
+
Navigate to any git repository and run:
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
daily-summary
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
Or use the short alias:
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
ds
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
## Step 3: View Your Summary
|
|
28
|
+
|
|
29
|
+
The tool will create a file named `daily-summary-YYYY-MM-DD.md` in your current directory.
|
|
30
|
+
|
|
31
|
+
## Troubleshooting
|
|
32
|
+
|
|
33
|
+
### If the command is not found after installation:
|
|
34
|
+
|
|
35
|
+
1. Check your npm global bin directory:
|
|
36
|
+
|
|
37
|
+
```bash
|
|
38
|
+
npm bin -g
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
2. Make sure this directory is in your PATH environment variable.
|
|
42
|
+
|
|
43
|
+
3. On Windows, you may need to restart your terminal or IDE.
|
|
44
|
+
|
|
45
|
+
### If you get permission errors on Unix/Mac:
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
sudo npm install -g .
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Or configure npm to use a different directory:
|
|
52
|
+
|
|
53
|
+
```bash
|
|
54
|
+
npm config set prefix ~/.npm-global
|
|
55
|
+
# Add ~/.npm-global/bin to your PATH
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
## Uninstall
|
|
59
|
+
|
|
60
|
+
To uninstall the tool:
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
npm uninstall -g daily-git-summary
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
## Usage Tips
|
|
67
|
+
|
|
68
|
+
- Run `daily-summary --help` to see all options
|
|
69
|
+
- Use `daily-summary --no-file` to preview in terminal before saving
|
|
70
|
+
- Use `daily-summary --verbose` to debug any issues
|
|
71
|
+
- Use `daily-summary --date 2026-01-06` to generate summary for a past date
|
package/QUICKSTART.md
ADDED
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
# Quick Start Guide
|
|
2
|
+
|
|
3
|
+
## What This Tool Does
|
|
4
|
+
|
|
5
|
+
Scans your git commits (default: 6:00 PM yesterday to 6:00 PM today PHT) and creates a markdown summary perfect for your daily standup meetings. Automatically organizes files in a `.daily-git-summary/` folder and supports custom time ranges.
|
|
6
|
+
|
|
7
|
+
## Installation (One Time Setup)
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
cd daily-git-summary
|
|
11
|
+
npm install -g .
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Daily Usage
|
|
15
|
+
|
|
16
|
+
### Morning Standup Routine
|
|
17
|
+
|
|
18
|
+
1. Open your terminal
|
|
19
|
+
2. Navigate to your project directory
|
|
20
|
+
3. Run:
|
|
21
|
+
```bash
|
|
22
|
+
daily-summary
|
|
23
|
+
```
|
|
24
|
+
4. Open the generated `.daily-git-summary/daily-summary-2026-01-07.md` file
|
|
25
|
+
5. Use it for your standup meeting!
|
|
26
|
+
|
|
27
|
+
**Note:** The `.daily-git-summary/` folder is automatically added to `.gitignore` so your summaries stay local.
|
|
28
|
+
|
|
29
|
+
### What You'll Get
|
|
30
|
+
|
|
31
|
+
A markdown file with:
|
|
32
|
+
|
|
33
|
+
- ā
All your commits from yesterday (grouped by type)
|
|
34
|
+
- ā
Files you changed the most
|
|
35
|
+
- ā
Suggestions for what to work on today
|
|
36
|
+
- ā
Current branch and related issues
|
|
37
|
+
|
|
38
|
+
### Example Workflow
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Monday morning - forgot what you did Friday?
|
|
42
|
+
cd my-project
|
|
43
|
+
daily-summary --date 2026-01-05
|
|
44
|
+
|
|
45
|
+
# Tuesday morning - generate today's summary
|
|
46
|
+
cd my-project
|
|
47
|
+
daily-summary
|
|
48
|
+
|
|
49
|
+
# Different work hours? (9 AM to 6 PM)
|
|
50
|
+
daily-summary --start-time 09:00 --end-time 18:00
|
|
51
|
+
|
|
52
|
+
# Working in a different timezone?
|
|
53
|
+
daily-summary --timezone "America/New_York"
|
|
54
|
+
|
|
55
|
+
# Need a quick preview without saving?
|
|
56
|
+
daily-summary --no-file
|
|
57
|
+
|
|
58
|
+
# Want files in a specific folder?
|
|
59
|
+
daily-summary --folder docs/daily-standups
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## Understanding Your "Day"
|
|
63
|
+
|
|
64
|
+
Your "day" resets at **6:00 PM PHT by default**, which means:
|
|
65
|
+
|
|
66
|
+
- Commits from Monday 6:00 PM to Tuesday 6:00 PM = Tuesday's summary
|
|
67
|
+
- Perfect for next-day standup meetings where you discuss yesterday's work
|
|
68
|
+
|
|
69
|
+
**Customize it!** Use `--start-time` and `--end-time` to match your schedule:
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
# 9 AM to 5 PM workday
|
|
73
|
+
daily-summary --start-time 09:00 --end-time 17:00
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
## Tips
|
|
77
|
+
|
|
78
|
+
š” **Quick Preview**: Use `ds --no-file` for instant terminal output
|
|
79
|
+
|
|
80
|
+
š” **Custom Hours**: Set `--start-time` and `--end-time` to match your work schedule
|
|
81
|
+
|
|
82
|
+
š” **Auto Gitignore**: The summary folder is automatically added to `.gitignore`
|
|
83
|
+
|
|
84
|
+
š” **History**: Use `--date YYYY-MM-DD` to generate summaries for past dates
|
|
85
|
+
|
|
86
|
+
š” **Multiple Repos**: Run it in each repository separately, or create a script to aggregate
|
|
87
|
+
|
|
88
|
+
š” **Legacy Mode**: Use `--no-folder` if you prefer files in the root directory
|
|
89
|
+
|
|
90
|
+
## Troubleshooting
|
|
91
|
+
|
|
92
|
+
**"Not a git repository"**: Make sure you're inside a git project directory
|
|
93
|
+
|
|
94
|
+
**"No commits found"**: You may not have made any commits in the last 24 hours (6PM-6PM PHT)
|
|
95
|
+
|
|
96
|
+
**Need help?**: Run `daily-summary --help`
|
package/README.md
ADDED
|
@@ -0,0 +1,248 @@
|
|
|
1
|
+
# Daily Git Summary
|
|
2
|
+
|
|
3
|
+
A CLI tool that generates daily summaries of your git commits for standup meetings. Automatically groups commits by conventional commit type and respects your custom daily reset time of 6:00 PM PHT.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- ā
**Smart Time Range**: Defines a "day" as 6:00 PM yesterday to 6:00 PM today (PHT) by default
|
|
8
|
+
- ā
**Customizable Times**: Set your own start/end times and timezone
|
|
9
|
+
- ā
**Organized Storage**: Automatically saves to `.daily-git-summary/` folder
|
|
10
|
+
- ā
**Gitignore Integration**: Automatically adds summary folder to .gitignore
|
|
11
|
+
- ā
**Conventional Commits**: Parses and groups commits by type (feat, fix, refactor, etc.)
|
|
12
|
+
- ā
**Markdown Output**: Generates beautiful markdown summaries ready for sharing
|
|
13
|
+
- ā
**Terminal Display**: View summaries directly in your terminal with colored output
|
|
14
|
+
- ā
**File Statistics**: Shows most changed files and total stats
|
|
15
|
+
- ā
**Smart Suggestions**: Identifies WIP commits and related issues for planning your day
|
|
16
|
+
- ā
**Flexible**: Works with any git repository
|
|
17
|
+
|
|
18
|
+
## Installation
|
|
19
|
+
|
|
20
|
+
### Global Installation (Recommended)
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
# From the project directory
|
|
24
|
+
npm install -g .
|
|
25
|
+
|
|
26
|
+
# Or install from npm
|
|
27
|
+
npm install -g daily-git-summary
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Local Usage
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
# Build the project
|
|
34
|
+
npm run build
|
|
35
|
+
|
|
36
|
+
# Run from any git repository
|
|
37
|
+
node /path/to/daily-git-summary/dist/cli.js
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Usage
|
|
41
|
+
|
|
42
|
+
### Basic Usage
|
|
43
|
+
|
|
44
|
+
Run from any git repository to generate today's summary:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
daily-summary
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
Or use the short alias:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
ds
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
This will create a file named `daily-summary-2026-01-07.md` in the `.daily-git-summary/` folder and automatically add the folder to `.gitignore` if not already present.
|
|
57
|
+
|
|
58
|
+
### Options
|
|
59
|
+
|
|
60
|
+
```
|
|
61
|
+
Options:
|
|
62
|
+
-V, --version output the version number
|
|
63
|
+
-d, --date <YYYY-MM-DD> generate summary for a specific date
|
|
64
|
+
-o, --output <path> custom output path for the markdown file
|
|
65
|
+
--start-time <HH:MM> custom start time (24-hour format, default: 18:00)
|
|
66
|
+
--end-time <HH:MM> custom end time (24-hour format, default: 18:00)
|
|
67
|
+
--timezone <TZ> custom timezone (default: Asia/Manila)
|
|
68
|
+
--folder <path> folder for summaries (default: .daily-git-summary)
|
|
69
|
+
--no-folder save in current directory instead of folder
|
|
70
|
+
--no-file print to terminal only, do not save to file
|
|
71
|
+
-v, --verbose show debug information
|
|
72
|
+
-h, --help display help for command
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
### Examples
|
|
76
|
+
|
|
77
|
+
**Generate summary for today:**
|
|
78
|
+
|
|
79
|
+
```bash
|
|
80
|
+
daily-summary
|
|
81
|
+
# Saves to .daily-git-summary/ and automatically adds to .gitignore
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
**Custom work hours (9 AM to 5 PM):**
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
daily-summary --start-time 09:00 --end-time 17:00
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**Different timezone:**
|
|
91
|
+
|
|
92
|
+
```bash
|
|
93
|
+
daily-summary --timezone "America/New_York"
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
**Custom folder location:**
|
|
97
|
+
|
|
98
|
+
```bash
|
|
99
|
+
daily-summary --folder docs/standups
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
**Legacy behavior (save in current directory):**
|
|
103
|
+
|
|
104
|
+
```bash
|
|
105
|
+
daily-summary --no-folder
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
**Generate summary for a specific date:**
|
|
109
|
+
|
|
110
|
+
```bash
|
|
111
|
+
daily-summary --date 2026-01-06
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
**Print to terminal without saving:**
|
|
115
|
+
|
|
116
|
+
```bash
|
|
117
|
+
daily-summary --no-file
|
|
118
|
+
```
|
|
119
|
+
|
|
120
|
+
**Custom output file (overrides folder):**
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
daily-summary --output my-standup-notes.md
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
**Verbose mode for debugging:**
|
|
127
|
+
|
|
128
|
+
```bash
|
|
129
|
+
daily-summary --verbose
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
## Output Format
|
|
133
|
+
|
|
134
|
+
The generated markdown includes:
|
|
135
|
+
|
|
136
|
+
- **Overview**: Time period, commit count, files changed, current branch
|
|
137
|
+
- **What I Did Yesterday**: Commits grouped by type (Features, Bug Fixes, etc.)
|
|
138
|
+
- **Files Most Changed**: Top 10 files with change frequency
|
|
139
|
+
- **Suggested For Today**: Smart suggestions based on WIP commits, current branch, and issue numbers
|
|
140
|
+
|
|
141
|
+
### Sample Output
|
|
142
|
+
|
|
143
|
+
```markdown
|
|
144
|
+
# Daily Summary - January 7, 2026
|
|
145
|
+
|
|
146
|
+
## Overview
|
|
147
|
+
|
|
148
|
+
- **Period**: Jan 6, 6:00 PM - Jan 7, 6:00 PM PHT
|
|
149
|
+
- **Commits**: 5
|
|
150
|
+
- **Files Changed**: 12
|
|
151
|
+
- **Current Branch**: `feature/payment-integration`
|
|
152
|
+
|
|
153
|
+
## What I Did Yesterday
|
|
154
|
+
|
|
155
|
+
### Features (2 commits)
|
|
156
|
+
|
|
157
|
+
- feat(auth): implement JWT refresh token rotation
|
|
158
|
+
- feat(api): add pagination to user list endpoint
|
|
159
|
+
|
|
160
|
+
### Bug Fixes (2 commits)
|
|
161
|
+
|
|
162
|
+
- fix(payment): resolve race condition in checkout flow
|
|
163
|
+
- fix(ui): correct mobile responsive layout issues
|
|
164
|
+
|
|
165
|
+
### Documentation (1 commit)
|
|
166
|
+
|
|
167
|
+
- docs: update API documentation for payment endpoints
|
|
168
|
+
|
|
169
|
+
## Files Most Changed
|
|
170
|
+
|
|
171
|
+
1. `src/features/auth/hooks/useAuth.ts` (3 changes)
|
|
172
|
+
2. `src/features/payment/PaymentFlow.tsx` (2 changes)
|
|
173
|
+
|
|
174
|
+
## Suggested For Today
|
|
175
|
+
|
|
176
|
+
- Continue work on branch: `feature/payment-integration`
|
|
177
|
+
- Related issues: #123, #456
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
## How It Works
|
|
181
|
+
|
|
182
|
+
1. **Time Calculation**: Converts your configured time (default 6:00 PM PHT) to UTC and calculates the time range
|
|
183
|
+
2. **Git Query**: Fetches commits from the current repository within the time range
|
|
184
|
+
3. **Parsing**: Analyzes each commit using conventional commit format
|
|
185
|
+
4. **Grouping**: Organizes commits by type (feat, fix, refactor, etc.)
|
|
186
|
+
5. **File Management**: Creates `.daily-git-summary/` folder if needed
|
|
187
|
+
6. **Generation**: Creates a markdown file with all sections and statistics
|
|
188
|
+
|
|
189
|
+
## Conventional Commit Types
|
|
190
|
+
|
|
191
|
+
The tool recognizes these commit types:
|
|
192
|
+
|
|
193
|
+
- `feat`: New features
|
|
194
|
+
- `fix`: Bug fixes
|
|
195
|
+
- `refactor`: Code refactoring
|
|
196
|
+
- `perf`: Performance improvements
|
|
197
|
+
- `docs`: Documentation changes
|
|
198
|
+
- `style`: Code style/formatting
|
|
199
|
+
- `test`: Tests
|
|
200
|
+
- `build`: Build system changes
|
|
201
|
+
- `ops`: Operations/infrastructure
|
|
202
|
+
- `chore`: Miscellaneous tasks
|
|
203
|
+
|
|
204
|
+
Commits that don't follow conventional format are grouped under "Other".
|
|
205
|
+
|
|
206
|
+
## Development
|
|
207
|
+
|
|
208
|
+
### Build
|
|
209
|
+
|
|
210
|
+
```bash
|
|
211
|
+
npm run build
|
|
212
|
+
```
|
|
213
|
+
|
|
214
|
+
### Watch Mode
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
npm run dev
|
|
218
|
+
```
|
|
219
|
+
|
|
220
|
+
### Project Structure
|
|
221
|
+
|
|
222
|
+
```
|
|
223
|
+
daily-git-summary/
|
|
224
|
+
āāā src/
|
|
225
|
+
ā āāā cli.ts # CLI entry point and command handling
|
|
226
|
+
ā āāā git.ts # Git operations using simple-git
|
|
227
|
+
ā āāā parser.ts # Conventional commit parsing
|
|
228
|
+
ā āāā markdown.ts # Markdown generation
|
|
229
|
+
ā āāā time.ts # Time range calculations with PHT timezone
|
|
230
|
+
ā āāā types.ts # TypeScript type definitions
|
|
231
|
+
āāā bin/
|
|
232
|
+
ā āāā daily-summary # Executable symlink
|
|
233
|
+
āāā dist/ # Compiled JavaScript (generated)
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Requirements
|
|
237
|
+
|
|
238
|
+
- Node.js >= 16.0.0
|
|
239
|
+
- Git installed and configured
|
|
240
|
+
- A git repository with commits
|
|
241
|
+
|
|
242
|
+
## License
|
|
243
|
+
|
|
244
|
+
MIT
|
|
245
|
+
|
|
246
|
+
## Author
|
|
247
|
+
|
|
248
|
+
Created for daily standup meetings to quickly summarize your work.
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
20
|
+
var ownKeys = function(o) {
|
|
21
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
22
|
+
var ar = [];
|
|
23
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
24
|
+
return ar;
|
|
25
|
+
};
|
|
26
|
+
return ownKeys(o);
|
|
27
|
+
};
|
|
28
|
+
return function (mod) {
|
|
29
|
+
if (mod && mod.__esModule) return mod;
|
|
30
|
+
var result = {};
|
|
31
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
32
|
+
__setModuleDefault(result, mod);
|
|
33
|
+
return result;
|
|
34
|
+
};
|
|
35
|
+
})();
|
|
36
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
37
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
38
|
+
};
|
|
39
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
40
|
+
const commander_1 = require("commander");
|
|
41
|
+
const chalk_1 = __importDefault(require("chalk"));
|
|
42
|
+
const fs = __importStar(require("fs"));
|
|
43
|
+
const time_1 = require("./time");
|
|
44
|
+
const git_1 = require("./git");
|
|
45
|
+
const parser_1 = require("./parser");
|
|
46
|
+
const markdown_1 = require("./markdown");
|
|
47
|
+
const fileManager_1 = require("./fileManager");
|
|
48
|
+
const program = new commander_1.Command();
|
|
49
|
+
program
|
|
50
|
+
.name('daily-summary')
|
|
51
|
+
.description('Generate a daily summary of git commits for standup meetings')
|
|
52
|
+
.version('1.0.0')
|
|
53
|
+
.option('-d, --date <YYYY-MM-DD>', 'generate summary for a specific date')
|
|
54
|
+
.option('-o, --output <path>', 'custom output path for the markdown file')
|
|
55
|
+
.option('--start-time <HH:MM>', 'custom start time in 24-hour format (default: 18:00)')
|
|
56
|
+
.option('--end-time <HH:MM>', 'custom end time in 24-hour format (default: 18:00)')
|
|
57
|
+
.option('--timezone <TZ>', 'custom timezone (default: Asia/Manila)')
|
|
58
|
+
.option('--folder <path>', 'folder for summaries (default: .daily-git-summary)')
|
|
59
|
+
.option('--no-folder', 'save in current directory instead of folder')
|
|
60
|
+
.option('--no-file', 'print to terminal only, do not save to file')
|
|
61
|
+
.option('-v, --verbose', 'show debug information')
|
|
62
|
+
.parse(process.argv);
|
|
63
|
+
const options = program.opts();
|
|
64
|
+
async function main() {
|
|
65
|
+
try {
|
|
66
|
+
const cwd = process.cwd();
|
|
67
|
+
if (options.verbose) {
|
|
68
|
+
console.log(chalk_1.default.gray(`Working directory: ${cwd}`));
|
|
69
|
+
}
|
|
70
|
+
// Check if in git repository
|
|
71
|
+
const isRepo = await (0, git_1.isGitRepository)(cwd);
|
|
72
|
+
if (!isRepo) {
|
|
73
|
+
console.error(chalk_1.default.red('ā Error: Not a git repository'));
|
|
74
|
+
console.log(chalk_1.default.yellow('Please run this command from within a git repository.'));
|
|
75
|
+
process.exit(1);
|
|
76
|
+
}
|
|
77
|
+
// Validate and build time configuration
|
|
78
|
+
const timeConfig = {};
|
|
79
|
+
if (options.startTime) {
|
|
80
|
+
try {
|
|
81
|
+
(0, time_1.parseTimeString)(options.startTime);
|
|
82
|
+
timeConfig.startTime = options.startTime;
|
|
83
|
+
}
|
|
84
|
+
catch (error) {
|
|
85
|
+
console.error(chalk_1.default.red(`ā Error: ${error instanceof Error ? error.message : 'Invalid start time'}`));
|
|
86
|
+
process.exit(1);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
if (options.endTime) {
|
|
90
|
+
try {
|
|
91
|
+
(0, time_1.parseTimeString)(options.endTime);
|
|
92
|
+
timeConfig.endTime = options.endTime;
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
console.error(chalk_1.default.red(`ā Error: ${error instanceof Error ? error.message : 'Invalid end time'}`));
|
|
96
|
+
process.exit(1);
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
if (options.timezone) {
|
|
100
|
+
if (!(0, time_1.isValidTimezone)(options.timezone)) {
|
|
101
|
+
console.error(chalk_1.default.red('ā Error: Invalid timezone'));
|
|
102
|
+
console.log(chalk_1.default.yellow('Please use a valid IANA timezone (e.g., Asia/Manila, America/New_York)'));
|
|
103
|
+
process.exit(1);
|
|
104
|
+
}
|
|
105
|
+
timeConfig.timezone = options.timezone;
|
|
106
|
+
}
|
|
107
|
+
// Calculate time range
|
|
108
|
+
let timeRange;
|
|
109
|
+
let dateStr;
|
|
110
|
+
const timezone = timeConfig.timezone || 'Asia/Manila';
|
|
111
|
+
if (options.date) {
|
|
112
|
+
// Validate date format
|
|
113
|
+
if (!/^\d{4}-\d{2}-\d{2}$/.test(options.date)) {
|
|
114
|
+
console.error(chalk_1.default.red('ā Error: Invalid date format'));
|
|
115
|
+
console.log(chalk_1.default.yellow('Please use YYYY-MM-DD format (e.g., 2026-01-07)'));
|
|
116
|
+
process.exit(1);
|
|
117
|
+
}
|
|
118
|
+
timeRange = (0, time_1.calculateTimeRangeForDate)(options.date, timeConfig);
|
|
119
|
+
dateStr = options.date;
|
|
120
|
+
}
|
|
121
|
+
else {
|
|
122
|
+
timeRange = (0, time_1.calculateTimeRange)(undefined, timeConfig);
|
|
123
|
+
dateStr = (0, time_1.getDateString)(undefined, timezone);
|
|
124
|
+
}
|
|
125
|
+
if (options.verbose) {
|
|
126
|
+
console.log(chalk_1.default.gray(`Time range: ${timeRange.from.toISOString()} to ${timeRange.to.toISOString()}`));
|
|
127
|
+
if (Object.keys(timeConfig).length > 0) {
|
|
128
|
+
console.log(chalk_1.default.gray(`Time config: ${JSON.stringify(timeConfig)}`));
|
|
129
|
+
}
|
|
130
|
+
}
|
|
131
|
+
// Fetch commits
|
|
132
|
+
console.log(chalk_1.default.blue('š Fetching commits...'));
|
|
133
|
+
const commits = await (0, git_1.fetchCommits)(cwd, timeRange);
|
|
134
|
+
if (options.verbose) {
|
|
135
|
+
console.log(chalk_1.default.gray(`Found ${commits.length} commits`));
|
|
136
|
+
}
|
|
137
|
+
// Get current branch
|
|
138
|
+
const currentBranch = await (0, git_1.getCurrentBranch)(cwd);
|
|
139
|
+
// Parse commits
|
|
140
|
+
const parsedCommits = commits.map(parser_1.parseCommitMessage);
|
|
141
|
+
// Group commits by type
|
|
142
|
+
const groupedCommits = (0, parser_1.groupCommitsByType)(parsedCommits);
|
|
143
|
+
// Calculate statistics
|
|
144
|
+
const totalFilesChanged = (0, parser_1.countTotalFilesChanged)(commits);
|
|
145
|
+
const fileChangeFrequency = (0, parser_1.getFileChangeFrequency)(commits);
|
|
146
|
+
// Create summary object
|
|
147
|
+
const summary = {
|
|
148
|
+
date: dateStr,
|
|
149
|
+
timeRange,
|
|
150
|
+
commits: parsedCommits,
|
|
151
|
+
groupedCommits,
|
|
152
|
+
totalCommits: commits.length,
|
|
153
|
+
totalFilesChanged,
|
|
154
|
+
currentBranch,
|
|
155
|
+
fileChangeFrequency,
|
|
156
|
+
timezone: timezone,
|
|
157
|
+
};
|
|
158
|
+
// Generate markdown
|
|
159
|
+
const markdown = (0, markdown_1.generateMarkdown)(summary);
|
|
160
|
+
// Save to file (unless --no-file is specified)
|
|
161
|
+
if (options.file !== false) {
|
|
162
|
+
// Determine if folder should be used
|
|
163
|
+
const useFolder = options.folder !== false && !options.output;
|
|
164
|
+
const folderPath = typeof options.folder === 'string' ? options.folder : undefined;
|
|
165
|
+
const absolutePath = (0, fileManager_1.getOutputPath)(cwd, dateStr, {
|
|
166
|
+
output: options.output,
|
|
167
|
+
folder: folderPath,
|
|
168
|
+
useFolder: useFolder,
|
|
169
|
+
});
|
|
170
|
+
const relativePath = (0, fileManager_1.getRelativePath)(cwd, absolutePath);
|
|
171
|
+
fs.writeFileSync(absolutePath, markdown, 'utf-8');
|
|
172
|
+
console.log(chalk_1.default.green(`ā
Summary saved to: ${chalk_1.default.bold(relativePath)}`));
|
|
173
|
+
// Automatically add folder to gitignore if using folder mode
|
|
174
|
+
if (useFolder) {
|
|
175
|
+
const folderName = folderPath || '.daily-git-summary';
|
|
176
|
+
try {
|
|
177
|
+
const result = (0, fileManager_1.addToGitignore)(cwd, folderName);
|
|
178
|
+
if (result.added) {
|
|
179
|
+
console.log(chalk_1.default.green(`ā
${result.message}`));
|
|
180
|
+
}
|
|
181
|
+
else if (options.verbose) {
|
|
182
|
+
console.log(chalk_1.default.gray(result.message));
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
catch (error) {
|
|
186
|
+
if (options.verbose) {
|
|
187
|
+
console.log(chalk_1.default.yellow(`ā ļø ${error instanceof Error ? error.message : 'Could not update .gitignore'}`));
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
// Print to terminal
|
|
193
|
+
if (options.file === false || options.verbose) {
|
|
194
|
+
console.log((0, markdown_1.formatForTerminal)(summary, chalk_1.default));
|
|
195
|
+
}
|
|
196
|
+
// Summary stats
|
|
197
|
+
if (summary.totalCommits === 0) {
|
|
198
|
+
console.log(chalk_1.default.yellow('\nā ļø No commits found in this time period.'));
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
console.log(chalk_1.default.gray(`\nš Stats: ${summary.totalCommits} commits, ${summary.totalFilesChanged} files changed`));
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
if (error instanceof Error) {
|
|
206
|
+
console.error(chalk_1.default.red(`ā Error: ${error.message}`));
|
|
207
|
+
if (options.verbose) {
|
|
208
|
+
console.error(chalk_1.default.gray(error.stack));
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
else {
|
|
212
|
+
console.error(chalk_1.default.red('ā An unknown error occurred'));
|
|
213
|
+
}
|
|
214
|
+
process.exit(1);
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
main();
|
|
218
|
+
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,yCAAoC;AACpC,kDAA0B;AAC1B,uCAAyB;AAEzB,iCAAwH;AACxH,+BAAwE;AACxE,qCAKkB;AAClB,yCAAiE;AAEjE,+CAA+E;AAE/E,MAAM,OAAO,GAAG,IAAI,mBAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,eAAe,CAAC;KACrB,WAAW,CAAC,8DAA8D,CAAC;KAC3E,OAAO,CAAC,OAAO,CAAC;KAChB,MAAM,CAAC,yBAAyB,EAAE,sCAAsC,CAAC;KACzE,MAAM,CAAC,qBAAqB,EAAE,0CAA0C,CAAC;KACzE,MAAM,CAAC,sBAAsB,EAAE,sDAAsD,CAAC;KACtF,MAAM,CAAC,oBAAoB,EAAE,oDAAoD,CAAC;KAClF,MAAM,CAAC,iBAAiB,EAAE,wCAAwC,CAAC;KACnE,MAAM,CAAC,iBAAiB,EAAE,oDAAoD,CAAC;KAC/E,MAAM,CAAC,aAAa,EAAE,6CAA6C,CAAC;KACpE,MAAM,CAAC,WAAW,EAAE,6CAA6C,CAAC;KAClE,MAAM,CAAC,eAAe,EAAE,wBAAwB,CAAC;KACjD,KAAK,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;AAEvB,MAAM,OAAO,GAAe,OAAO,CAAC,IAAI,EAAE,CAAC;AAE3C,KAAK,UAAU,I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AAY,aAAa,OAAO,CAAC,iBAAiB,gBAAgB,CAAC,CAAC,CAAC;QACrH,CAAC;IAEH,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,IAAI,KAAK,YAAY,KAAK,EAAE,CAAC;YAC3B,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,YAAY,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;YAEtD,IAAI,OAAO,CAAC,OAAO,EAAE,CAAC;gBACpB,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC;YACzC,CAAC;QACH,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,KAAK,CAAC,eAAK,CAAC,GAAG,CAAC,6BAA6B,CAAC,CAAC,CAAC;QAC1D,CAAC;QAED,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;AACH,CAAC;AAED,IAAI,EAAE,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Ensures a directory exists, creating it if necessary
|
|
3
|
+
*/
|
|
4
|
+
export declare function ensureDirectoryExists(dirPath: string): void;
|
|
5
|
+
/**
|
|
6
|
+
* Gets the output file path based on options
|
|
7
|
+
*/
|
|
8
|
+
export declare function getOutputPath(cwd: string, dateStr: string, options: {
|
|
9
|
+
output?: string;
|
|
10
|
+
folder?: string;
|
|
11
|
+
useFolder?: boolean;
|
|
12
|
+
}): string;
|
|
13
|
+
/**
|
|
14
|
+
* Checks if a pattern exists in .gitignore
|
|
15
|
+
*/
|
|
16
|
+
export declare function isInGitignore(repoPath: string, pattern: string): boolean;
|
|
17
|
+
/**
|
|
18
|
+
* Adds a pattern to .gitignore if it doesn't exist
|
|
19
|
+
*/
|
|
20
|
+
export declare function addToGitignore(repoPath: string, pattern: string): {
|
|
21
|
+
added: boolean;
|
|
22
|
+
message: string;
|
|
23
|
+
};
|
|
24
|
+
/**
|
|
25
|
+
* Gets the relative path for display purposes
|
|
26
|
+
*/
|
|
27
|
+
export declare function getRelativePath(from: string, to: string): string;
|
|
28
|
+
//# sourceMappingURL=fileManager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fileManager.d.ts","sourceRoot":"","sources":["../src/fileManager.ts"],"names":[],"mappings":"AAKA;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAI3D;AAED;;GAEG;AACH,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,OAAO,EAAE;IACP,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,GACA,MAAM,CAqBR;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAkBxE;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAqCrG;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAGhE"}
|