Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,8 @@
"url": "git+https://github.com/modem-dev/hunk.git"
},
"bin": {
"hunk": "./bin/hunk.cjs"
"hunk": "./bin/hunk.cjs",
"hunkdiff": "./bin/hunk.cjs"
},
"workspaces": [
"packages/*"
Expand Down
1 change: 1 addition & 0 deletions scripts/stage-prebuilt-npm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ function stageMetaPackage(
description: rootPackage.description,
bin: {
hunk: "./bin/hunk.cjs",
hunkdiff: "./bin/hunk.cjs",
},
files: ["bin", "dist/npm", "skills", "README.md", "LICENSE"],
type: rootPackage.type,
Expand Down
8 changes: 8 additions & 0 deletions test/cli/entrypoint.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ describe("CLI entrypoint contracts", () => {
expect(existsSync(resolvedPath)).toBe(true);
});

test("package manifest exposes hunkdiff as an npm exec alias", () => {
const packageJson = require("../../package.json");
expect(packageJson.bin).toEqual({
hunk: "./bin/hunk.cjs",
hunkdiff: "./bin/hunk.cjs",
});
});

test("bin wrapper fails clearly when the bundled skill is missing", () => {
const tempDir = mkdtempSync(join(tmpdir(), "hunk-wrapper-skill-missing-"));
const tempBinDir = join(tempDir, "bin");
Expand Down
Loading