Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

fix(install): make bun install compile node-pty without a global node-gyp

Abdurrahman Fakhrul1734b5d4954e
diff --git a/bun.lock b/bun.lock
index 150e291c..b33914cc 100644
--- a/bun.lock
+++ b/bun.lock
@@ -67,6 +67,7 @@
"patchedDependencies": {
},
"overrides": {
"js-yaml": "^4.3.2",
diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md
index c69ec0fe..c3f8051e 100644
--- a/docs/CHANGELOG.md
+++ b/docs/CHANGELOG.md
@@ -13,6 +13,8 @@ this is the *what*, and it is what Settings → Account → About shows as “Wh
**Fixed**
+- `install` make bun install compile node-pty without a global node-gyp
+- `api` restore the models provider name the route extraction dropped (#169)
- `api` restore the models provider name the route extraction dropped (#168)
- `build` restore the turbopackIgnore annotation the route extraction dropped
@@ -24,7 +26,6 @@ this is the *what*, and it is what Settings → Account → About shows as “Wh
**Changed**
-- `auth` register the session cookie reader from the framework entry, so lib is next-free
- `api` every route handler is a thin adapter, and lib is next-free
- `lib` drop static next/* imports, plus three measured perf findings
diff --git a/package.json b/package.json
index 1dd44a4a..92b46168 100644
--- a/package.json
+++ b/package.json
@@ -137,6 +137,7 @@
"packageManager": "[email protected]",
"patchedDependencies": {
}
}
diff --git a/patches/[email protected] b/patches/[email protected]
new file mode 100644
index 00000000..60f3e287
--- /dev/null
+++ b/patches/[email protected]
@@ -0,0 +1,66 @@
+diff --git a/package.json b/package.json
+index 94a2c14381727674b8964c1b50e5e47a9205ffbc..c894b252679ab4f193913275dce0773da0eda7ec 100644
+--- a/package.json
++++ b/package.json
+@@ -38,7 +38,7 @@
+ "build": "tsc -b ./src/tsconfig.json",
+ "watch": "tsc -b -w ./src/tsconfig.json",
+ "lint": "eslint -c .eslintrc.js --ext .ts src/",
+- "install": "node scripts/prebuild.js || node-gyp rebuild",
++ "install": "node scripts/prebuild.js || node scripts/rebuild.js",
+ "postinstall": "node scripts/post-install.js",
+ "compileCommands": "node scripts/gen-compile-commands.js",
+ "test": "cross-env NODE_ENV=test mocha -R spec --exit lib/*.test.js",
+diff --git a/node_modules/node-pty/scripts/rebuild.js b/scripts/rebuild.js
+new file mode 100644
+index 0000000000000000000000000000000000000000..6211f1b6d9f92cead690fbeedf2f6477cb0470f5
+--- /dev/null
++++ b/scripts/rebuild.js
+@@ -0,0 +1,47 @@
++//@ts-check
++const { spawnSync } = require('child_process');
++const fs = require('fs');
++const path = require('path');
++
++function findNodeGyp() {
++ // 1. Direct command if available in PATH
++ const check = spawnSync('node-gyp', ['--version'], { encoding: 'utf8' });
++ if (check.status === 0) return { cmd: 'node-gyp', args: [] };
++
++ // 2. Locate from npm
++ try {
++ const whichCmd = process.platform === 'win32' ? 'where' : 'which';
++ const npmBin = spawnSync(whichCmd, ['npm'], { encoding: 'utf8' }).stdout.trim().split('\n')[0].trim();
++ if (npmBin) {
++ const realNpm = fs.realpathSync(npmBin);
++ const npmDir = path.dirname(realNpm);
++
++ // Check node-gyp-bin
++ const binGyp = path.join(npmDir, 'node-gyp-bin', process.platform === 'win32' ? 'node-gyp.cmd' : 'node-gyp');
++ if (fs.existsSync(binGyp)) {
++ return { cmd: binGyp, args: [] };
++ }
++
++ // Check bundled node-gyp.js
++ const jsGyp = path.join(npmDir, '../node_modules/node-gyp/bin/node-gyp.js');
++ if (fs.existsSync(jsGyp)) {
++ return { cmd: process.execPath, args: [jsGyp] };
++ }
++ }
++ } catch (err) {}
++
++ return null;
++}
++
++const gyp = findNodeGyp();
++if (!gyp) {
++ console.error('\x1b[31m> node-pty: node-gyp not found in PATH or via npm\x1b[0m');
++ process.exit(127);
++}
++
++const result = spawnSync(gyp.cmd, [...gyp.args, 'rebuild'], {
++ stdio: 'inherit',
++ cwd: path.join(__dirname, '..')
++});
++
++process.exit(result.status ?? 1);