@happy-nut/monacori 0.1.8 → 0.1.9
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
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@happy-nut/monacori",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "Validation control plane for AI-generated code changes.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"repository": {
|
|
@@ -20,6 +20,7 @@
|
|
|
20
20
|
"dist",
|
|
21
21
|
"assets",
|
|
22
22
|
"scripts/patch-electron-name.mjs",
|
|
23
|
+
"scripts/fix-pty-spawn-helper.mjs",
|
|
23
24
|
"README.md",
|
|
24
25
|
"LICENSE"
|
|
25
26
|
],
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
"scripts": {
|
|
30
31
|
"build": "tsc -p tsconfig.json && node scripts/copy-viewer-assets.mjs",
|
|
31
32
|
"icon": "node scripts/gen-icon.mjs",
|
|
32
|
-
"postinstall": "node scripts/patch-electron-name.mjs",
|
|
33
|
+
"postinstall": "node scripts/patch-electron-name.mjs && node scripts/fix-pty-spawn-helper.mjs",
|
|
33
34
|
"prepare": "npm run build",
|
|
34
35
|
"smoke": "npm run build && node dist/cli.js --help"
|
|
35
36
|
},
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
// node-pty's macOS prebuild ships `spawn-helper` without the executable bit (it's lost in the npm
|
|
2
|
+
// tarball), so a fresh GLOBAL install fails with "posix_spawnp failed" the instant the integrated
|
|
3
|
+
// terminal tries to start a shell — there is no build/Release fallback in a published install, only the
|
|
4
|
+
// prebuild. (A local source build keeps +x, which is why it only reproduces for end users.) Restore +x
|
|
5
|
+
// on every spawn-helper we can find: each prebuild arch dir plus any local source build. Idempotent and
|
|
6
|
+
// best-effort — it never throws so it can't break `npm install`.
|
|
7
|
+
import { chmodSync, existsSync, readdirSync } from "node:fs";
|
|
8
|
+
import { createRequire } from "node:module";
|
|
9
|
+
import { dirname, join } from "node:path";
|
|
10
|
+
|
|
11
|
+
const require = createRequire(import.meta.url);
|
|
12
|
+
|
|
13
|
+
let ptyDir;
|
|
14
|
+
try {
|
|
15
|
+
ptyDir = dirname(require.resolve("node-pty/package.json"));
|
|
16
|
+
} catch {
|
|
17
|
+
process.exit(0); // node-pty not installed (e.g. a non-Electron context) — nothing to fix
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
const targets = [join(ptyDir, "build", "Release", "spawn-helper")];
|
|
21
|
+
const prebuilds = join(ptyDir, "prebuilds");
|
|
22
|
+
if (existsSync(prebuilds)) {
|
|
23
|
+
for (const arch of readdirSync(prebuilds)) {
|
|
24
|
+
targets.push(join(prebuilds, arch, "spawn-helper"));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
for (const file of targets) {
|
|
29
|
+
try {
|
|
30
|
+
if (existsSync(file)) chmodSync(file, 0o755);
|
|
31
|
+
} catch {
|
|
32
|
+
/* best-effort: a failed chmod just means the terminal may not start; don't fail the install */
|
|
33
|
+
}
|
|
34
|
+
}
|