Skip to content

Commit d03b507

Browse files
committed
fix: format package version sync before release
1 parent 4d7b15a commit d03b507

3 files changed

Lines changed: 72 additions & 59 deletions

File tree

package.json

Lines changed: 59 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -1,62 +1,62 @@
11
{
2-
"name": "@cortexkit/opencode-interceptor",
3-
"version": "0.1.2",
4-
"type": "module",
5-
"description": "OpenCode plugin for runtime HTTP interception diagnostics",
6-
"author": "ualtinok",
7-
"license": "MIT",
8-
"keywords": [
9-
"opencode",
10-
"plugin",
11-
"http",
12-
"interceptor",
13-
"debug",
14-
"diagnostics",
15-
"ai",
16-
"llm"
17-
],
18-
"repository": {
19-
"type": "git",
20-
"url": "https://github.com/cortexkit/opencode-interceptor"
21-
},
22-
"packageManager": "bun@1.3.11",
23-
"main": "dist/index.js",
24-
"types": "dist/index.d.ts",
25-
"exports": {
26-
".": {
27-
"types": "./dist/index.d.ts",
28-
"import": "./dist/index.js"
2+
"name": "@cortexkit/opencode-interceptor",
3+
"version": "0.1.2",
4+
"type": "module",
5+
"description": "OpenCode plugin for runtime HTTP interception diagnostics",
6+
"author": "ualtinok",
7+
"license": "MIT",
8+
"keywords": [
9+
"opencode",
10+
"plugin",
11+
"http",
12+
"interceptor",
13+
"debug",
14+
"diagnostics",
15+
"ai",
16+
"llm"
17+
],
18+
"repository": {
19+
"type": "git",
20+
"url": "https://github.com/cortexkit/opencode-interceptor"
21+
},
22+
"packageManager": "bun@1.3.11",
23+
"main": "dist/index.js",
24+
"types": "dist/index.d.ts",
25+
"exports": {
26+
".": {
27+
"types": "./dist/index.d.ts",
28+
"import": "./dist/index.js"
29+
}
30+
},
31+
"files": [
32+
"dist",
33+
"README.md",
34+
"LICENSE"
35+
],
36+
"oc-plugin": [
37+
"server"
38+
],
39+
"scripts": {
40+
"build": "bun build src/index.ts --outdir dist --target bun --format esm --external @opencode-ai/plugin && tsc -p tsconfig.build.json",
41+
"clean": "rm -rf dist",
42+
"lint": "biome check .",
43+
"lint:fix": "biome check --write .",
44+
"typecheck": "tsc --noEmit",
45+
"test": "bun test",
46+
"check": "bun run lint && bun run typecheck && bun test",
47+
"prepublishOnly": "bun run clean && bun run build"
48+
},
49+
"dependencies": {
50+
"@opencode-ai/plugin": "^1.4.10"
51+
},
52+
"peerDependencies": {
53+
"@opencode-ai/plugin": ">=1.4.0"
54+
},
55+
"devDependencies": {
56+
"@biomejs/biome": "^2.4.7",
57+
"@opencode-ai/sdk": "^1.4.10",
58+
"@types/node": "^22.15.30",
59+
"bun-types": "1.3.11",
60+
"typescript": "^5.8.3"
2961
}
30-
},
31-
"files": [
32-
"dist",
33-
"README.md",
34-
"LICENSE"
35-
],
36-
"oc-plugin": [
37-
"server"
38-
],
39-
"scripts": {
40-
"build": "bun build src/index.ts --outdir dist --target bun --format esm --external @opencode-ai/plugin && tsc -p tsconfig.build.json",
41-
"clean": "rm -rf dist",
42-
"lint": "biome check .",
43-
"lint:fix": "biome check --write .",
44-
"typecheck": "tsc --noEmit",
45-
"test": "bun test",
46-
"check": "bun run lint && bun run typecheck && bun test",
47-
"prepublishOnly": "bun run clean && bun run build"
48-
},
49-
"dependencies": {
50-
"@opencode-ai/plugin": "^1.4.10"
51-
},
52-
"peerDependencies": {
53-
"@opencode-ai/plugin": ">=1.4.0"
54-
},
55-
"devDependencies": {
56-
"@biomejs/biome": "^2.4.7",
57-
"@opencode-ai/sdk": "^1.4.10",
58-
"@types/node": "^22.15.30",
59-
"bun-types": "1.3.11",
60-
"typescript": "^5.8.3"
61-
}
6262
}

scripts/release.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,10 @@ echo "→ Syncing version to $VERSION..."
9595
bun scripts/version-sync.mjs "$VERSION"
9696
echo ""
9797

98+
echo "→ Verifying synced release files..."
99+
bun run lint 2>&1 || { echo "Error: Lint failed after version sync"; exit 1; }
100+
echo ""
101+
98102
# Step 4: Commit (skip if versions were already at target)
99103
echo "→ Committing version bump..."
100104
git add -A

scripts/version-sync.mjs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
*/
1313

1414
import { readFileSync, writeFileSync } from "node:fs";
15+
import { spawnSync } from "node:child_process";
1516
import { dirname, join } from "node:path";
1617
import { fileURLToPath } from "node:url";
1718

@@ -79,6 +80,14 @@ if (pkg.version === version) {
7980
pkg.version = version;
8081
if (!dryRun) {
8182
writeFileSync(pkgPath, `${JSON.stringify(pkg, null, 2)}\n`, "utf-8");
83+
const formatResult = spawnSync("bun", ["x", "biome", "format", "--write", pkgPath], {
84+
cwd: root,
85+
stdio: "inherit",
86+
});
87+
if (formatResult.status !== 0) {
88+
console.error("Failed to format package.json after version sync");
89+
process.exit(formatResult.status ?? 1);
90+
}
8291
}
8392
}
8493

0 commit comments

Comments
 (0)