blamewise 0.1.1 → 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
@@ -6,25 +6,43 @@ var __getProtoOf = Object.getPrototypeOf;
6
6
  var __defProp = Object.defineProperty;
7
7
  var __getOwnPropNames = Object.getOwnPropertyNames;
8
8
  var __hasOwnProp = Object.prototype.hasOwnProperty;
9
+ function __accessProp(key) {
10
+ return this[key];
11
+ }
12
+ var __toESMCache_node;
13
+ var __toESMCache_esm;
9
14
  var __toESM = (mod, isNodeMode, target) => {
15
+ var canCache = mod != null && typeof mod === "object";
16
+ if (canCache) {
17
+ var cache = isNodeMode ? __toESMCache_node ??= new WeakMap : __toESMCache_esm ??= new WeakMap;
18
+ var cached = cache.get(mod);
19
+ if (cached)
20
+ return cached;
21
+ }
10
22
  target = mod != null ? __create(__getProtoOf(mod)) : {};
11
23
  const to = isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target;
12
24
  for (let key of __getOwnPropNames(mod))
13
25
  if (!__hasOwnProp.call(to, key))
14
26
  __defProp(to, key, {
15
- get: () => mod[key],
27
+ get: __accessProp.bind(mod, key),
16
28
  enumerable: true
17
29
  });
30
+ if (canCache)
31
+ cache.set(mod, to);
18
32
  return to;
19
33
  };
20
34
  var __commonJS = (cb, mod) => () => (mod || cb((mod = { exports: {} }).exports, mod), mod.exports);
35
+ var __returnValue = (v) => v;
36
+ function __exportSetter(name, newValue) {
37
+ this[name] = __returnValue.bind(null, newValue);
38
+ }
21
39
  var __export = (target, all) => {
22
40
  for (var name in all)
23
41
  __defProp(target, name, {
24
42
  get: all[name],
25
43
  enumerable: true,
26
44
  configurable: true,
27
- set: (newValue) => all[name] = () => newValue
45
+ set: __exportSetter.bind(all, name)
28
46
  });
29
47
  };
30
48
  var __esm = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
@@ -4419,8 +4437,11 @@ function parseBlamePorcelain(raw) {
4419
4437
  }
4420
4438
  if (SHA_RE.test(line)) {
4421
4439
  const parts = line.split(" ");
4422
- currentSha = parts[0];
4423
- 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);
4424
4445
  lines.push({ sha: currentSha, finalLine });
4425
4446
  if (!commits.has(currentSha)) {
4426
4447
  collecting = true;
@@ -4612,10 +4633,10 @@ function parseGitLog(raw) {
4612
4633
  `).filter(Boolean).map((line) => {
4613
4634
  const parts = line.split("|");
4614
4635
  return {
4615
- sha: parts[0],
4616
- author: parts[1],
4617
- authorMail: parts[2],
4618
- date: parts[3],
4636
+ sha: parts[0] ?? "",
4637
+ author: parts[1] ?? "",
4638
+ authorMail: parts[2] ?? "",
4639
+ date: parts[3] ?? "",
4619
4640
  subject: parts.slice(4).join("|")
4620
4641
  };
4621
4642
  });
package/package.json CHANGED
@@ -1,7 +1,12 @@
1
1
  {
2
2
  "name": "blamewise",
3
3
  "type": "module",
4
- "version": "0.1.1",
4
+ "version": "0.1.6",
5
+ "packageManager": "bun@1.3.12",
6
+ "repository": {
7
+ "type": "git",
8
+ "url": "https://github.com/gtn1024/blamewise"
9
+ },
5
10
  "module": "src/cli.ts",
6
11
  "bin": {
7
12
  "blamewise": "dist/blamewise.js"
@@ -27,6 +32,7 @@
27
32
  "devDependencies": {
28
33
  "@antfu/eslint-config": "^8.1.1",
29
34
  "@types/bun": "latest",
35
+ "@types/node": "^25.6.0",
30
36
  "eslint": "^10.2.0",
31
37
  "jiti": "^2.6.1"
32
38
  }