@gilware/bumpwise 0.0.0-stage → 1.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +34 -2
- package/bin/bumpwise.js +104 -0
- package/package.json +11 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Gilware
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,3 +1,35 @@
|
|
|
1
|
-
#
|
|
1
|
+
# Bumpwise command line and MCP server
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Bumpwise checks Java and Kotlin projects for breaking changes, from their compiled classes:
|
|
4
|
+
|
|
5
|
+
- **Before a dependency upgrade:** which places in your project (file and line) the new version breaks. Maven
|
|
6
|
+
Central and Google Maven (AndroidX, Compose, Firebase), including BOMs such as `compose-bom`.
|
|
7
|
+
- **Before a library release:** whether the build breaks the last published version, and which version number the
|
|
8
|
+
release needs.
|
|
9
|
+
|
|
10
|
+
This package is a small launcher: it downloads the Bumpwise command line once from gilware.com, checks its SHA-256,
|
|
11
|
+
and runs it. It needs Java 17 or later.
|
|
12
|
+
|
|
13
|
+
## As an MCP server for AI coding agents
|
|
14
|
+
|
|
15
|
+
```sh
|
|
16
|
+
claude mcp add bumpwise -- npx -y @gilware/bumpwise mcp
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Other clients: run `npx -y @gilware/bumpwise mcp` as a stdio server. Tools: `check_api_compatibility` and
|
|
20
|
+
`check_dependency_upgrade`. Build the project first; Bumpwise reads the build output.
|
|
21
|
+
|
|
22
|
+
## In a terminal
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
npx @gilware/bumpwise upgrade com.google.guava:guava
|
|
26
|
+
npx @gilware/bumpwise upgrade --changed-since origin/main
|
|
27
|
+
npx @gilware/bumpwise check
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
Exit codes: 0 safe, 1 breaks, 2 could not tell. Full documentation: https://gilware.com/bumpwise/cli/
|
|
31
|
+
|
|
32
|
+
The launcher is MIT. The Bumpwise command line is free to use and not open source
|
|
33
|
+
(https://gilware.com/legal/eula/). Made by Gilware.
|
|
34
|
+
|
|
35
|
+
<!-- mcp-name: io.github.gilware/bumpwise -->
|
package/bin/bumpwise.js
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Launcher for the Bumpwise command line (https://gilware.com/bumpwise/cli/). Downloads the published jar once,
|
|
3
|
+
// checks its SHA-256, and runs it with Java 17 or later. As an MCP server (`bumpwise mcp`) stdout belongs to the
|
|
4
|
+
// protocol, so this launcher only ever writes to stderr.
|
|
5
|
+
"use strict";
|
|
6
|
+
const { spawn, spawnSync } = require("node:child_process");
|
|
7
|
+
const crypto = require("node:crypto");
|
|
8
|
+
const fs = require("node:fs");
|
|
9
|
+
const https = require("node:https");
|
|
10
|
+
const os = require("node:os");
|
|
11
|
+
const path = require("node:path");
|
|
12
|
+
|
|
13
|
+
const VERSION = "1.1.3";
|
|
14
|
+
const SHA256 = "dd159161b04fb518a3ec6adaeeb975d6b7231784825e259415fa26eeb0b1160c";
|
|
15
|
+
const URL = `https://gilware.com/bumpwise/cli/bumpwise-${VERSION}.jar`;
|
|
16
|
+
|
|
17
|
+
function fail(message) {
|
|
18
|
+
process.stderr.write(`bumpwise: ${message}\n`);
|
|
19
|
+
process.exit(2);
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function cacheDir() {
|
|
23
|
+
if (process.env.BUMPWISE_HOME) return process.env.BUMPWISE_HOME;
|
|
24
|
+
if (process.platform === "win32") return path.join(process.env.LOCALAPPDATA || os.homedir(), "bumpwise");
|
|
25
|
+
return path.join(process.env.XDG_CACHE_HOME || path.join(os.homedir(), ".cache"), "bumpwise");
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function javaCommand() {
|
|
29
|
+
const exe = process.platform === "win32" ? "java.exe" : "java";
|
|
30
|
+
if (process.env.JAVA_HOME) {
|
|
31
|
+
const candidate = path.join(process.env.JAVA_HOME, "bin", exe);
|
|
32
|
+
if (fs.existsSync(candidate)) return candidate;
|
|
33
|
+
}
|
|
34
|
+
return "java";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function checkJava(java) {
|
|
38
|
+
const result = spawnSync(java, ["-version"], { encoding: "utf8" });
|
|
39
|
+
if (result.error) fail("Java was not found. Bumpwise needs Java 17 or later: install one (for example from https://adoptium.net) or set JAVA_HOME.");
|
|
40
|
+
const match = /version "(\d+)(?:\.(\d+))?/.exec(`${result.stderr}${result.stdout}`);
|
|
41
|
+
const major = match ? (match[1] === "1" ? Number(match[2]) : Number(match[1])) : 0;
|
|
42
|
+
if (major < 17) fail(`Bumpwise needs Java 17 or later, and '${java}' is ${match ? match[0].slice(9) : "an unknown version"}.`);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
function sha256(file) {
|
|
46
|
+
return crypto.createHash("sha256").update(fs.readFileSync(file)).digest("hex");
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
function download(url, file, redirects = 0) {
|
|
50
|
+
return new Promise((resolve, reject) => {
|
|
51
|
+
const request = https.get(url, { headers: { "User-Agent": `bumpwise-npm/${VERSION}` } }, (response) => {
|
|
52
|
+
if ([301, 302, 303, 307, 308].includes(response.statusCode) && response.headers.location && redirects < 5) {
|
|
53
|
+
response.resume();
|
|
54
|
+
resolve(download(new globalThis.URL(response.headers.location, url).toString(), file, redirects + 1));
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (response.statusCode !== 200) {
|
|
58
|
+
response.resume();
|
|
59
|
+
reject(new Error(`HTTP ${response.statusCode} from ${url}`));
|
|
60
|
+
return;
|
|
61
|
+
}
|
|
62
|
+
const out = fs.createWriteStream(file);
|
|
63
|
+
response.pipe(out);
|
|
64
|
+
out.on("finish", () => out.close(resolve));
|
|
65
|
+
out.on("error", reject);
|
|
66
|
+
});
|
|
67
|
+
request.on("error", reject);
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async function jar() {
|
|
72
|
+
const dir = cacheDir();
|
|
73
|
+
const file = path.join(dir, `bumpwise-${VERSION}.jar`);
|
|
74
|
+
if (fs.existsSync(file) && sha256(file) === SHA256) return file;
|
|
75
|
+
fs.mkdirSync(dir, { recursive: true });
|
|
76
|
+
const part = `${file}.${process.pid}.part`;
|
|
77
|
+
process.stderr.write(`bumpwise: downloading the command line ${VERSION} (once)...\n`);
|
|
78
|
+
for (let attempt = 1; ; attempt++) {
|
|
79
|
+
try {
|
|
80
|
+
await download(URL, part);
|
|
81
|
+
break;
|
|
82
|
+
} catch (e) {
|
|
83
|
+
fs.rmSync(part, { force: true });
|
|
84
|
+
if (attempt >= 3) fail(`the download from ${URL} failed (${e.message}). Check the internet connection and try again.`);
|
|
85
|
+
process.stderr.write(`bumpwise: download failed (${e.message}), trying again...\n`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
if (sha256(part) !== SHA256) {
|
|
89
|
+
fs.rmSync(part, { force: true });
|
|
90
|
+
fail("the downloaded file is not the published one (SHA-256 mismatch). Nothing was changed; try again later.");
|
|
91
|
+
}
|
|
92
|
+
fs.renameSync(part, file);
|
|
93
|
+
return file;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
(async () => {
|
|
97
|
+
const java = javaCommand();
|
|
98
|
+
checkJava(java);
|
|
99
|
+
const file = await jar();
|
|
100
|
+
const child = spawn(java, ["-jar", file, ...process.argv.slice(2)], { stdio: "inherit" });
|
|
101
|
+
for (const signal of ["SIGINT", "SIGTERM"]) process.on(signal, () => child.kill(signal));
|
|
102
|
+
child.on("exit", (code, signal) => (signal ? process.kill(process.pid, signal) : process.exit(code ?? 2)));
|
|
103
|
+
child.on("error", (e) => fail(e.message));
|
|
104
|
+
})();
|
package/package.json
CHANGED
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gilware/bumpwise",
|
|
3
|
-
"version": "
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
}
|
|
3
|
+
"version": "1.1.3",
|
|
4
|
+
"description": "Launcher for the Bumpwise command line and MCP server: what a dependency upgrade breaks in a Java or Kotlin project, and whether a library build breaks its last release.",
|
|
5
|
+
"mcpName": "io.github.gilware/bumpwise",
|
|
6
|
+
"bin": { "bumpwise": "bin/bumpwise.js" },
|
|
7
|
+
"files": ["bin/", "README.md", "LICENSE"],
|
|
8
|
+
"engines": { "node": ">=18" },
|
|
9
|
+
"keywords": ["mcp", "mcp-server", "java", "kotlin", "maven", "gradle", "android", "dependency-upgrade", "binary-compatibility", "semver", "dependabot"],
|
|
10
|
+
"homepage": "https://gilware.com/bumpwise/cli/",
|
|
11
|
+
"author": "Gilware <hello@gilware.com>",
|
|
12
|
+
"license": "MIT"
|
|
13
|
+
}
|