blamewise 0.1.4 → 0.1.6

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 gtn1024
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 CHANGED
@@ -1,13 +1,21 @@
1
1
  # blamewise
2
2
 
3
+ [中文](./README-zh.md) | English
4
+
3
5
  A CLI tool that helps new team members understand code ownership and change history using local git data. Zero cloud dependencies, fully private.
4
6
 
5
7
  ## Install
6
8
 
9
+ **npm:**
10
+
7
11
  ```bash
8
- bun install
12
+ npm install -g blamewise
9
13
  ```
10
14
 
15
+ **Binary:**
16
+
17
+ Download the binary for your platform from [GitHub Releases](https://github.com/gtn1024/blamewise/releases).
18
+
11
19
  ## Usage
12
20
 
13
21
  ### Who knows this file?
@@ -15,8 +23,8 @@ bun install
15
23
  Rank authors by expertise on a file (lines owned + commit frequency + recency):
16
24
 
17
25
  ```bash
18
- bun run src/cli.ts who-knows <path>
19
- bun run src/cli.ts who-knows src/index.ts -n 5
26
+ blamewise who-knows <path>
27
+ blamewise who-knows src/index.ts -n 5
20
28
  ```
21
29
 
22
30
  ### Why did this file change?
@@ -24,8 +32,8 @@ bun run src/cli.ts who-knows src/index.ts -n 5
24
32
  Show recent commits with reasons for changes:
25
33
 
26
34
  ```bash
27
- bun run src/cli.ts why <path>
28
- bun run src/cli.ts why src/index.ts -n 10
35
+ blamewise why <path>
36
+ blamewise why src/index.ts -n 10
29
37
  ```
30
38
 
31
39
  ### Options
@@ -37,6 +45,13 @@ bun run src/cli.ts why src/index.ts -n 10
37
45
  ## Development
38
46
 
39
47
  ```bash
40
- bun run src/cli.ts --help
48
+ git clone https://github.com/gtn1024/blamewise.git
49
+ cd blamewise
50
+ bun install
41
51
  bun test
52
+ bun run src/cli.ts --help
42
53
  ```
54
+
55
+ ## License
56
+
57
+ [MIT](./LICENSE)
package/dist/blamewise.js CHANGED
@@ -4437,8 +4437,11 @@ function parseBlamePorcelain(raw) {
4437
4437
  }
4438
4438
  if (SHA_RE.test(line)) {
4439
4439
  const parts = line.split(" ");
4440
- currentSha = parts[0];
4441
- const finalLine = Number.parseInt(parts[2], 10);
4440
+ const sha = parts[0];
4441
+ if (!sha)
4442
+ continue;
4443
+ currentSha = sha;
4444
+ const finalLine = Number.parseInt(parts[2] ?? "", 10);
4442
4445
  lines.push({ sha: currentSha, finalLine });
4443
4446
  if (!commits.has(currentSha)) {
4444
4447
  collecting = true;
@@ -4630,10 +4633,10 @@ function parseGitLog(raw) {
4630
4633
  `).filter(Boolean).map((line) => {
4631
4634
  const parts = line.split("|");
4632
4635
  return {
4633
- sha: parts[0],
4634
- author: parts[1],
4635
- authorMail: parts[2],
4636
- date: parts[3],
4636
+ sha: parts[0] ?? "",
4637
+ author: parts[1] ?? "",
4638
+ authorMail: parts[2] ?? "",
4639
+ date: parts[3] ?? "",
4637
4640
  subject: parts.slice(4).join("|")
4638
4641
  };
4639
4642
  });
package/package.json CHANGED
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "name": "blamewise",
3
3
  "type": "module",
4
- "version": "0.1.4",
4
+ "version": "0.1.6",
5
+ "packageManager": "bun@1.3.12",
5
6
  "repository": {
6
7
  "type": "git",
7
8
  "url": "https://github.com/gtn1024/blamewise"
@@ -31,6 +32,7 @@
31
32
  "devDependencies": {
32
33
  "@antfu/eslint-config": "^8.1.1",
33
34
  "@types/bun": "latest",
35
+ "@types/node": "^25.6.0",
34
36
  "eslint": "^10.2.0",
35
37
  "jiti": "^2.6.1"
36
38
  }