Skip to content

Commit c524683

Browse files
committed
feat: update package versions and add version bump script
1 parent e864f2c commit c524683

File tree

6 files changed

+71
-5
lines changed

6 files changed

+71
-5
lines changed

deno.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"tasks": {
55
"precommit": "deno lint && deno check && deno fmt",
66
"test": "deno test --allow-all packages/*/tests/",
7-
"build": "deno check packages/*/mod.ts"
7+
"build": "deno check packages/*/mod.ts",
8+
"version": "deno run --allow-read --allow-write scripts/version.ts"
89
},
910
"workspace": [
1011
"./packages/utils",

packages/cli/deno.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "@mcpc/cli",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/mcpc-tech/mcpc.git"
7+
},
48
"exports": {
59
".": "./mod.ts",
610
"./server": "./src/server.ts",

packages/core/deno.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "@mcpc/core",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/mcpc-tech/mcpc.git"
7+
},
48
"exports": {
59
".": "./mod.ts",
610
"./plugins": "./plugins.ts",

packages/mcp-sampling-ai-provider/deno.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "@mcpc/mcp-sampling-ai-provider",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/mcpc-tech/mcpc.git"
7+
},
48
"exports": {
59
".": "./mod.ts"
610
},

packages/utils/deno.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,10 @@
11
{
22
"name": "@mcpc/utils",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
4+
"repository": {
5+
"type": "git",
6+
"url": "git+https://github.com/mcpc-tech/mcpc.git"
7+
},
48
"exports": {
59
".": "./mod.ts",
610
"./json": "./src/json.ts",

scripts/version.ts

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
#!/usr/bin/env -S deno run --allow-read --allow-write
2+
3+
const args = Deno.args;
4+
const versionType = args[0] || "patch"; // patch, minor, major
5+
6+
if (!["patch", "minor", "major"].includes(versionType)) {
7+
console.error("Usage: deno task version [patch|minor|major]");
8+
Deno.exit(1);
9+
}
10+
11+
function bumpVersion(version: string, type: string): string {
12+
const [major, minor, patch] = version.split(".").map(Number);
13+
14+
switch (type) {
15+
case "major":
16+
return `${major + 1}.0.0`;
17+
case "minor":
18+
return `${major}.${minor + 1}.0`;
19+
case "patch":
20+
return `${major}.${minor}.${patch + 1}`;
21+
default:
22+
return version;
23+
}
24+
}
25+
26+
const packages = [
27+
"./packages/utils/deno.json",
28+
"./packages/core/deno.json",
29+
"./packages/cli/deno.json",
30+
"./packages/mcp-sampling-ai-provider/deno.json",
31+
];
32+
33+
for (const pkgPath of packages) {
34+
const content = await Deno.readTextFile(pkgPath);
35+
const pkg = JSON.parse(content);
36+
const oldVersion = pkg.version;
37+
const newVersion = bumpVersion(oldVersion, versionType);
38+
39+
pkg.version = newVersion;
40+
41+
await Deno.writeTextFile(
42+
pkgPath,
43+
JSON.stringify(pkg, null, 2) + "\n",
44+
);
45+
46+
console.log(`${pkg.name}: ${oldVersion}${newVersion}`);
47+
}
48+
49+
console.log(`\n✓ All packages updated to ${versionType} version`);

0 commit comments

Comments
 (0)