From 45e9d8519ad25cbf388165b5cb47f42f360a6bf8 Mon Sep 17 00:00:00 2001 From: Daniil Koryto Date: Fri, 10 Apr 2026 19:09:24 +0300 Subject: [PATCH] fix: publish opencode-setup bin alias for npx --- CHANGELOG.md | 3 +++ package.json | 1 + src/constants/contract.ts | 3 ++- test/cli.test.ts | 1 + test/package-contract.test.ts | 4 ++++ 5 files changed, 11 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b4b387..0e37aab 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -32,6 +32,9 @@ ### Changed +- publish the `opencode-setup` bin alias so `npx @gonkagate/opencode-setup` + resolves on modern npm while keeping `gonkagate-opencode` as a compatible + direct command - replaced the scaffold-only CLI surface with the real shipped installer flow - made rerun the official safe update path with transactional rollback for changed managed files diff --git a/package.json b/package.json index bb194c8..dd82a6a 100644 --- a/package.json +++ b/package.json @@ -12,6 +12,7 @@ }, "type": "module", "bin": { + "opencode-setup": "bin/gonkagate-opencode.js", "gonkagate-opencode": "bin/gonkagate-opencode.js" }, "files": [ diff --git a/src/constants/contract.ts b/src/constants/contract.ts index dcee7a9..0fb71cb 100644 --- a/src/constants/contract.ts +++ b/src/constants/contract.ts @@ -1,5 +1,6 @@ export const CONTRACT_METADATA = { - binName: "gonkagate-opencode", + binName: "opencode-setup", + legacyBinName: "gonkagate-opencode", binPath: "bin/gonkagate-opencode.js", cliVersion: "0.2.2", // x-release-please-version curatedRegistryPublished: true, diff --git a/test/cli.test.ts b/test/cli.test.ts index e3e3581..1140e20 100644 --- a/test/cli.test.ts +++ b/test/cli.test.ts @@ -148,6 +148,7 @@ test("CLI wrapper exposes the shipped help surface", () => { }); assert.equal(helpResult.status, 0); + assert.match(helpResult.stdout, /Usage: opencode-setup/i); assert.match(helpResult.stdout, /Configure OpenCode to use GonkaGate/i); assert.match(helpResult.stdout, /validated-model-only/i); assert.match(helpResult.stdout, /--scope /); diff --git a/test/package-contract.test.ts b/test/package-contract.test.ts index be5de96..abfda0a 100644 --- a/test/package-contract.test.ts +++ b/test/package-contract.test.ts @@ -23,6 +23,10 @@ test("package metadata matches the scaffold contract", () => { packageJson.bin?.[CONTRACT_METADATA.binName], CONTRACT_METADATA.binPath, ); + assert.equal( + packageJson.bin?.[CONTRACT_METADATA.legacyBinName], + CONTRACT_METADATA.binPath, + ); assert.equal(packageJson.engines?.node, ">=22.14.0"); assert.equal(packageJson.files?.includes("dist"), true); assert.equal(packageJson.files?.includes("docs"), true);