@mxyhi/vibe-kanban 0.0.148 → 0.0.149-rc.1
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/bin/cli.js +9 -5
- package/bin/download.js +14 -6
- package/package.json +3 -2
package/bin/cli.js
CHANGED
|
@@ -96,7 +96,7 @@ function showProgress(downloaded, total) {
|
|
|
96
96
|
async function extractAndRun(baseName, launch) {
|
|
97
97
|
const binName = getBinaryName(baseName);
|
|
98
98
|
const binPath = path.join(versionCacheDir, binName);
|
|
99
|
-
|
|
99
|
+
let zipPath = path.join(versionCacheDir, `${baseName}.zip`);
|
|
100
100
|
|
|
101
101
|
// Clean old binary if exists
|
|
102
102
|
try {
|
|
@@ -109,12 +109,16 @@ async function extractAndRun(baseName, launch) {
|
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
111
|
|
|
112
|
-
// Download if not cached
|
|
112
|
+
// Download if not cached (or use local dev zip)
|
|
113
113
|
if (!fs.existsSync(zipPath)) {
|
|
114
|
-
|
|
114
|
+
const actionLabel = LOCAL_DEV_MODE ? "Using local binary" : "Downloading";
|
|
115
|
+
console.error(`${actionLabel} ${baseName}...`);
|
|
115
116
|
try {
|
|
116
|
-
|
|
117
|
-
|
|
117
|
+
// Always trust ensureBinary result path to avoid local dev path mismatch
|
|
118
|
+
zipPath = await ensureBinary(platformDir, baseName, showProgress);
|
|
119
|
+
if (!LOCAL_DEV_MODE) {
|
|
120
|
+
console.error(""); // newline after progress
|
|
121
|
+
}
|
|
118
122
|
} catch (err) {
|
|
119
123
|
console.error(`\nDownload failed: ${err.message}`);
|
|
120
124
|
process.exit(1);
|
package/bin/download.js
CHANGED
|
@@ -2,21 +2,29 @@ const https = require("https");
|
|
|
2
2
|
const fs = require("fs");
|
|
3
3
|
const path = require("path");
|
|
4
4
|
const crypto = require("crypto");
|
|
5
|
+
const ProxyAgent = require("proxy-agent");
|
|
5
6
|
|
|
6
7
|
// Replaced during npm publish by workflow
|
|
7
|
-
const RELEASE_REPO = "
|
|
8
|
-
const BINARY_TAG = "
|
|
8
|
+
const RELEASE_REPO = "mxyhi/vibe-kanban"; // e.g., mxyhi/vibe-kanban
|
|
9
|
+
const BINARY_TAG = "v0.0.149-rc.1"; // e.g., v0.0.135
|
|
9
10
|
const RELEASE_BASE_URL = `https://github.com/${RELEASE_REPO}/releases/download`;
|
|
10
11
|
const CACHE_DIR = path.join(require("os").homedir(), ".vibe-kanban", "bin");
|
|
11
12
|
|
|
12
|
-
// Local development mode: use binaries from npx-cli/dist
|
|
13
|
+
// Local development mode: use binaries from npx-cli/dist/<platform>/ instead of GitHub Releases
|
|
13
14
|
// Only activate if dist/ exists (i.e., running from source after local-build.sh)
|
|
14
15
|
const LOCAL_DIST_DIR = path.join(__dirname, "..", "dist");
|
|
15
16
|
const LOCAL_DEV_MODE = fs.existsSync(LOCAL_DIST_DIR) || process.env.VIBE_KANBAN_LOCAL === "1";
|
|
17
|
+
// ProxyAgent will pick HTTP/HTTPS/SOCKS proxy from env (HTTP(S)_PROXY/NO_PROXY).
|
|
18
|
+
const proxyAgent = new ProxyAgent();
|
|
19
|
+
|
|
20
|
+
function withProxyAgent(options = {}) {
|
|
21
|
+
if (options.agent) return options;
|
|
22
|
+
return { ...options, agent: proxyAgent };
|
|
23
|
+
}
|
|
16
24
|
|
|
17
25
|
async function fetchJson(url, options = {}) {
|
|
18
26
|
return new Promise((resolve, reject) => {
|
|
19
|
-
https.get(url, options, (res) => {
|
|
27
|
+
https.get(url, withProxyAgent(options), (res) => {
|
|
20
28
|
if (res.statusCode === 301 || res.statusCode === 302) {
|
|
21
29
|
return fetchJson(res.headers.location, options).then(resolve).catch(reject);
|
|
22
30
|
}
|
|
@@ -48,7 +56,7 @@ async function downloadFile(url, destPath, expectedSha256, onProgress) {
|
|
|
48
56
|
} catch {}
|
|
49
57
|
};
|
|
50
58
|
|
|
51
|
-
https.get(url, (res) => {
|
|
59
|
+
https.get(url, withProxyAgent(), (res) => {
|
|
52
60
|
if (res.statusCode === 301 || res.statusCode === 302) {
|
|
53
61
|
file.close();
|
|
54
62
|
cleanup();
|
|
@@ -104,7 +112,7 @@ function getAssetName(platform, binaryName) {
|
|
|
104
112
|
async function ensureBinary(platform, binaryName, onProgress) {
|
|
105
113
|
// In local dev mode, use binaries directly from npx-cli/dist/
|
|
106
114
|
if (LOCAL_DEV_MODE) {
|
|
107
|
-
const localZipPath = path.join(LOCAL_DIST_DIR,
|
|
115
|
+
const localZipPath = path.join(LOCAL_DIST_DIR, platform, `${binaryName}.zip`);
|
|
108
116
|
if (fs.existsSync(localZipPath)) {
|
|
109
117
|
return localZipPath;
|
|
110
118
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mxyhi/vibe-kanban",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.149-rc.1",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
7
7
|
"vibe-kanban": "bin/cli.js"
|
|
@@ -11,7 +11,8 @@
|
|
|
11
11
|
"license": "",
|
|
12
12
|
"description": "NPX wrapper around vibe-kanban and vibe-kanban-mcp",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"adm-zip": "^0.5.16"
|
|
14
|
+
"adm-zip": "^0.5.16",
|
|
15
|
+
"proxy-agent": "^6.5.0"
|
|
15
16
|
},
|
|
16
17
|
"files": [
|
|
17
18
|
"bin",
|