Skip to content

Commit ec87bf3

Browse files
committed
fix: include built plugin in npm package
1 parent d5e0c14 commit ec87bf3

6 files changed

Lines changed: 23 additions & 4 deletions

File tree

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ bun run catalog:ci # entry used by the catalog-sync workflow
9999

100100
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`.
101101

102-
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`.
102+
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`.
103103

104104
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.
105105

‎opencode.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"$schema": "https://opencode.ai/config.json",
33
"model": "commandcode/deepseek-v4-flash",
44
"small_model": "commandcode/deepseek-v4-flash",
5-
"plugin": ["@brainervirus/opencode-commandcode/server"],
5+
"plugins": ["@brainervirus/opencode-commandcode"],
66
"provider": {
77
"commandcode": {
88
"npm": "@ai-sdk/openai-compatible",

‎package.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@
6666
"test:integration": "bun test tests/integration/",
6767
"test:all": "bun test",
6868
"typecheck": "tsc --noEmit",
69-
"prepack": "bun run scripts/verify-manifest-version.ts",
69+
"prepack": "bun run build && bun run scripts/verify-manifest-version.ts",
7070
"verify:release-candidate": "bun run scripts/verify-release-candidate.ts",
7171
"generate-readme": "bun run scripts/generate-readme.ts",
7272
"sync": "bun run scripts/sync-models.ts",

‎scripts/analyze-release-scope.ts‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ const PRODUCT_FILES = new Set([
1010
"models.json",
1111
"manifest.json",
1212
"_version.txt",
13+
"package.json",
1314
]);
1415

1516
export function isProductPath(file: string): boolean {

‎scripts/verify-release-candidate.ts‎

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,14 @@ import { tmpdir } from "os";
66
import { join } from "path";
77

88
const ROOT = join(import.meta.dir, "..");
9-
const REQUIRED = ["plugin.ts", "models.json", "manifest.json", "package.json", "src/catalog.ts"];
9+
const REQUIRED = [
10+
"dist/plugin.js",
11+
"plugin.ts",
12+
"models.json",
13+
"manifest.json",
14+
"package.json",
15+
"src/catalog.ts",
16+
];
1017
const FORBIDDEN = ["tests/", "docs/", ".github/"];
1118

1219
const dir = mkdtempSync(join(tmpdir(), "cc-pack-"));

‎tests/unit/analyze-release-scope.test.ts‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,17 @@ describe("analyzeReleaseScope", () => {
8686
}
8787
});
8888

89+
test("package fixes yield a release", () => {
90+
const r = repo();
91+
r.tag("v0.6.0");
92+
try {
93+
r.commit("fix: package the built plugin", { "package.json": "{}\n" });
94+
expect(analyzeReleaseScope(r.root)).toEqual({ level: "patch" });
95+
} finally {
96+
r.cleanup();
97+
}
98+
});
99+
89100
test("catalog file updates still release", () => {
90101
const r = repo();
91102
r.tag("v0.6.0");

0 commit comments

Comments
 (0)