From ec87bf33e3e0800f4ae05b21bab0c0a6fdc4e1eb Mon Sep 17 00:00:00 2001 From: Cristhofer Pincetti Date: Sat, 26 Sep 2026 20:59:39 -0300 Subject: [PATCH] fix: include built plugin in npm package --- README.md | 2 +- opencode.json | 2 +- package.json | 2 +- scripts/analyze-release-scope.ts | 1 + scripts/verify-release-candidate.ts | 9 ++++++++- tests/unit/analyze-release-scope.test.ts | 11 +++++++++++ 6 files changed, 23 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 78107d4..3392217 100644 --- a/README.md +++ b/README.md @@ -99,7 +99,7 @@ bun run catalog:ci # entry used by the catalog-sync workflow Entry points: `plugin.ts` owns all config-hook logic (dual default `{ id, setup }` plus `server`); `index.ts` re-exports the plugin plus the `createCommandCode` SDK factory; `src/entry.ts` is bundle glue for `scripts/build-plugin.ts` only — it produces `dist/plugin.js`. -CI (`.github/workflows/catalog-sync.yml`) opens a `fix(catalog)` PR every 6 hours when Command Code ships a new catalog; if extraction fails it opens a `catalog-break` issue instead. The PR auto-merges after **check (test)**, **check (typecheck)**, **check (lint)**, **check (format)**, and **check (pack)** are green. `.github/workflows/release.yml` then runs **semantic-release** (npm publish + GitHub Release + tag). Do not push to `main`. +CI (`.github/workflows/catalog-sync.yml`) opens a `fix(catalog)` PR every 6 hours when Command Code ships a new catalog; if extraction fails it opens a `catalog-break` issue instead. The PR auto-merges after **check (test)**, **check (typecheck)**, **check (lint)**, **check (format)**, and **check (pack)** are green. `.github/workflows/release.yml` then runs **semantic-release** (build + verified npm publish + GitHub Release + tag). Do not push to `main`. The GitHub Actions secret name is `NPMJS`. It is mapped to both `NPM_TOKEN` and `NODE_AUTH_TOKEN`. Use an npm **Automation** token (bypasses 2FA). A login token from `~/.npmrc` fails CI with `EOTP`. Catalog PRs get a real CI run when `RELEASE_SYNC_TOKEN` is a PAT; `GITHUB_TOKEN` can open the PR but GitHub will not start workflows from that event. diff --git a/opencode.json b/opencode.json index 0d850e9..dc49803 100644 --- a/opencode.json +++ b/opencode.json @@ -2,7 +2,7 @@ "$schema": "https://opencode.ai/config.json", "model": "commandcode/deepseek-v4-flash", "small_model": "commandcode/deepseek-v4-flash", - "plugin": ["@brainervirus/opencode-commandcode/server"], + "plugins": ["@brainervirus/opencode-commandcode"], "provider": { "commandcode": { "npm": "@ai-sdk/openai-compatible", diff --git a/package.json b/package.json index 0799d54..a33b661 100644 --- a/package.json +++ b/package.json @@ -66,7 +66,7 @@ "test:integration": "bun test tests/integration/", "test:all": "bun test", "typecheck": "tsc --noEmit", - "prepack": "bun run scripts/verify-manifest-version.ts", + "prepack": "bun run build && bun run scripts/verify-manifest-version.ts", "verify:release-candidate": "bun run scripts/verify-release-candidate.ts", "generate-readme": "bun run scripts/generate-readme.ts", "sync": "bun run scripts/sync-models.ts", diff --git a/scripts/analyze-release-scope.ts b/scripts/analyze-release-scope.ts index 19838fe..7b7f4db 100644 --- a/scripts/analyze-release-scope.ts +++ b/scripts/analyze-release-scope.ts @@ -10,6 +10,7 @@ const PRODUCT_FILES = new Set([ "models.json", "manifest.json", "_version.txt", + "package.json", ]); export function isProductPath(file: string): boolean { diff --git a/scripts/verify-release-candidate.ts b/scripts/verify-release-candidate.ts index c80fd1b..6b73add 100644 --- a/scripts/verify-release-candidate.ts +++ b/scripts/verify-release-candidate.ts @@ -6,7 +6,14 @@ import { tmpdir } from "os"; import { join } from "path"; const ROOT = join(import.meta.dir, ".."); -const REQUIRED = ["plugin.ts", "models.json", "manifest.json", "package.json", "src/catalog.ts"]; +const REQUIRED = [ + "dist/plugin.js", + "plugin.ts", + "models.json", + "manifest.json", + "package.json", + "src/catalog.ts", +]; const FORBIDDEN = ["tests/", "docs/", ".github/"]; const dir = mkdtempSync(join(tmpdir(), "cc-pack-")); diff --git a/tests/unit/analyze-release-scope.test.ts b/tests/unit/analyze-release-scope.test.ts index 913ed7b..533dbe5 100644 --- a/tests/unit/analyze-release-scope.test.ts +++ b/tests/unit/analyze-release-scope.test.ts @@ -86,6 +86,17 @@ describe("analyzeReleaseScope", () => { } }); + test("package fixes yield a release", () => { + const r = repo(); + r.tag("v0.6.0"); + try { + r.commit("fix: package the built plugin", { "package.json": "{}\n" }); + expect(analyzeReleaseScope(r.root)).toEqual({ level: "patch" }); + } finally { + r.cleanup(); + } + }); + test("catalog file updates still release", () => { const r = repo(); r.tag("v0.6.0");