openmux 0.1.10 → 0.1.12
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/package.json +1 -3
- package/scripts/postinstall.cjs +0 -137
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openmux",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.12",
|
|
4
4
|
"description": "Terminal multiplexer with master-stack tiling layout",
|
|
5
5
|
"module": "src/index.tsx",
|
|
6
6
|
"type": "module",
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
},
|
|
10
10
|
"files": [
|
|
11
11
|
"bin",
|
|
12
|
-
"scripts/postinstall.cjs",
|
|
13
12
|
"README.md",
|
|
14
13
|
"LICENSE"
|
|
15
14
|
],
|
|
@@ -21,7 +20,6 @@
|
|
|
21
20
|
"build:release": "./scripts/build.sh --release",
|
|
22
21
|
"install:local": "./scripts/build.sh --install",
|
|
23
22
|
"prepare": "effect-language-service patch",
|
|
24
|
-
"postinstall": "node scripts/postinstall.cjs",
|
|
25
23
|
"test": "vitest run",
|
|
26
24
|
"test:watch": "vitest",
|
|
27
25
|
"release": "standard-version",
|
package/scripts/postinstall.cjs
DELETED
|
@@ -1,137 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* openmux postinstall script
|
|
5
|
-
* Downloads prebuilt binaries from GitHub releases
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
|
-
const fs = require("fs");
|
|
9
|
-
const path = require("path");
|
|
10
|
-
const https = require("https");
|
|
11
|
-
const { execSync } = require("child_process");
|
|
12
|
-
|
|
13
|
-
const REPO = "monotykamary/openmux";
|
|
14
|
-
const PACKAGE_ROOT = path.join(__dirname, "..");
|
|
15
|
-
const DIST_DIR = path.join(PACKAGE_ROOT, "dist");
|
|
16
|
-
|
|
17
|
-
function getPlatform() {
|
|
18
|
-
const platform = process.platform;
|
|
19
|
-
const arch = process.arch;
|
|
20
|
-
|
|
21
|
-
let os;
|
|
22
|
-
switch (platform) {
|
|
23
|
-
case "darwin":
|
|
24
|
-
os = "darwin";
|
|
25
|
-
break;
|
|
26
|
-
case "linux":
|
|
27
|
-
os = "linux";
|
|
28
|
-
break;
|
|
29
|
-
default:
|
|
30
|
-
throw new Error(`Unsupported platform: ${platform}`);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
let cpu;
|
|
34
|
-
switch (arch) {
|
|
35
|
-
case "x64":
|
|
36
|
-
cpu = "x64";
|
|
37
|
-
break;
|
|
38
|
-
case "arm64":
|
|
39
|
-
cpu = "arm64";
|
|
40
|
-
break;
|
|
41
|
-
default:
|
|
42
|
-
throw new Error(`Unsupported architecture: ${arch}`);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
return { os, arch: cpu, target: `${os}-${cpu}` };
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
function getVersion() {
|
|
49
|
-
const packageJson = require(path.join(PACKAGE_ROOT, "package.json"));
|
|
50
|
-
return `v${packageJson.version}`;
|
|
51
|
-
}
|
|
52
|
-
|
|
53
|
-
function fetch(url) {
|
|
54
|
-
return new Promise((resolve, reject) => {
|
|
55
|
-
https.get(url, { headers: { "User-Agent": "openmux-installer" } }, (res) => {
|
|
56
|
-
if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
|
|
57
|
-
// Follow redirect
|
|
58
|
-
fetch(res.headers.location).then(resolve).catch(reject);
|
|
59
|
-
return;
|
|
60
|
-
}
|
|
61
|
-
if (res.statusCode !== 200) {
|
|
62
|
-
reject(new Error(`HTTP ${res.statusCode}: ${url}`));
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
resolve(res);
|
|
66
|
-
}).on("error", reject);
|
|
67
|
-
});
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
async function downloadFile(url, destPath) {
|
|
71
|
-
console.log(`Downloading ${url}...`);
|
|
72
|
-
|
|
73
|
-
const response = await fetch(url);
|
|
74
|
-
const writeStream = fs.createWriteStream(destPath);
|
|
75
|
-
|
|
76
|
-
return new Promise((resolve, reject) => {
|
|
77
|
-
response.pipe(writeStream);
|
|
78
|
-
writeStream.on("finish", () => {
|
|
79
|
-
writeStream.close();
|
|
80
|
-
resolve();
|
|
81
|
-
});
|
|
82
|
-
writeStream.on("error", reject);
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
async function main() {
|
|
87
|
-
// Skip in CI or when OPENMUX_SKIP_DOWNLOAD is set
|
|
88
|
-
if (process.env.CI || process.env.OPENMUX_SKIP_DOWNLOAD) {
|
|
89
|
-
console.log("Skipping binary download");
|
|
90
|
-
return;
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
try {
|
|
94
|
-
const { target } = getPlatform();
|
|
95
|
-
const version = getVersion();
|
|
96
|
-
|
|
97
|
-
console.log(`Installing openmux ${version} for ${target}...`);
|
|
98
|
-
|
|
99
|
-
const url = `https://github.com/${REPO}/releases/download/${version}/openmux-${version}-${target}.tar.gz`;
|
|
100
|
-
|
|
101
|
-
// Ensure dist directory exists
|
|
102
|
-
fs.mkdirSync(DIST_DIR, { recursive: true });
|
|
103
|
-
|
|
104
|
-
const tarballPath = path.join(DIST_DIR, "download.tar.gz");
|
|
105
|
-
|
|
106
|
-
await downloadFile(url, tarballPath);
|
|
107
|
-
|
|
108
|
-
console.log("Extracting...");
|
|
109
|
-
|
|
110
|
-
// Use native tar command to extract
|
|
111
|
-
execSync(`tar -xzf "${tarballPath}" -C "${DIST_DIR}"`, { stdio: "inherit" });
|
|
112
|
-
|
|
113
|
-
// Clean up tarball
|
|
114
|
-
fs.unlinkSync(tarballPath);
|
|
115
|
-
|
|
116
|
-
// Make binary executable
|
|
117
|
-
const binaryPath = path.join(DIST_DIR, "openmux-bin");
|
|
118
|
-
if (fs.existsSync(binaryPath)) {
|
|
119
|
-
fs.chmodSync(binaryPath, 0o755);
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
// Make wrapper executable
|
|
123
|
-
const wrapperPath = path.join(DIST_DIR, "openmux");
|
|
124
|
-
if (fs.existsSync(wrapperPath)) {
|
|
125
|
-
fs.chmodSync(wrapperPath, 0o755);
|
|
126
|
-
}
|
|
127
|
-
|
|
128
|
-
console.log("openmux installed successfully!");
|
|
129
|
-
} catch (error) {
|
|
130
|
-
// Don't fail the install if download fails
|
|
131
|
-
// User might be building from source
|
|
132
|
-
console.warn(`Warning: Could not download prebuilt binary: ${error.message}`);
|
|
133
|
-
console.warn("You may need to build from source: bun run build");
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
main();
|