Skip to content

Commit fcd6b83

Browse files
authored
fix(cli): expose hunkdiff npm exec alias (#295)
1 parent b0a22c1 commit fcd6b83

3 files changed

Lines changed: 11 additions & 1 deletion

File tree

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@
2020
"url": "git+https://github.com/modem-dev/hunk.git"
2121
},
2222
"bin": {
23-
"hunk": "./bin/hunk.cjs"
23+
"hunk": "./bin/hunk.cjs",
24+
"hunkdiff": "./bin/hunk.cjs"
2425
},
2526
"workspaces": [
2627
"packages/*"

scripts/stage-prebuilt-npm.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ function stageMetaPackage(
9595
description: rootPackage.description,
9696
bin: {
9797
hunk: "./bin/hunk.cjs",
98+
hunkdiff: "./bin/hunk.cjs",
9899
},
99100
files: ["bin", "dist/npm", "skills", "README.md", "LICENSE"],
100101
type: rootPackage.type,

test/cli/entrypoint.test.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,14 @@ describe("CLI entrypoint contracts", () => {
167167
expect(existsSync(resolvedPath)).toBe(true);
168168
});
169169

170+
test("package manifest exposes hunkdiff as an npm exec alias", () => {
171+
const packageJson = require("../../package.json");
172+
expect(packageJson.bin).toEqual({
173+
hunk: "./bin/hunk.cjs",
174+
hunkdiff: "./bin/hunk.cjs",
175+
});
176+
});
177+
170178
test("bin wrapper fails clearly when the bundled skill is missing", () => {
171179
const tempDir = mkdtempSync(join(tmpdir(), "hunk-wrapper-skill-missing-"));
172180
const tempBinDir = join(tempDir, "bin");

0 commit comments

Comments
 (0)