From 0a8c475d1b48307dfc64294108b3d920055e3023 Mon Sep 17 00:00:00 2001 From: Tomasz Borys Date: Sun, 29 Mar 2026 20:41:35 +0100 Subject: [PATCH 1/3] fix: chmod node-pty spawn-helper in postinstall --- package.json | 6 ++++-- scripts/postinstall.mjs | 14 ++++++++++++++ 2 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 scripts/postinstall.mjs diff --git a/package.json b/package.json index d823bd8..24e0838 100644 --- a/package.json +++ b/package.json @@ -25,7 +25,8 @@ "src/pwa/icons/", "README.md", "CHANGELOG.md", - "LICENSE" + "LICENSE", + "scripts/postinstall.mjs" ], "publishConfig": { "provenance": true @@ -55,7 +56,8 @@ "test:pw:chromium": "playwright test --project=chromium-android", "test:pw:webkit": "playwright test --project=webkit-iphone", "release": "semantic-release", - "prepublishOnly": "pnpm run lint:ox && pnpm run lint:knip && pnpm run build:dist && pnpm run lint:publint" + "prepublishOnly": "pnpm run lint:ox && pnpm run lint:knip && pnpm run build:dist && pnpm run lint:publint", + "postinstall": "node scripts/postinstall.mjs" }, "devDependencies": { "@biomejs/biome": "^1.9.0", diff --git a/scripts/postinstall.mjs b/scripts/postinstall.mjs new file mode 100644 index 0000000..628c4ba --- /dev/null +++ b/scripts/postinstall.mjs @@ -0,0 +1,14 @@ +import { chmodSync, existsSync } from "node:fs" +import { createRequire } from "node:module" +import { join, dirname } from "node:path" + +const require = createRequire(import.meta.url) +try { + const ptyDir = dirname(require.resolve("node-pty/package.json")) + for (const arch of ["darwin-arm64", "darwin-x64"]) { + const helper = join(ptyDir, "prebuilds", arch, "spawn-helper") + if (existsSync(helper)) chmodSync(helper, 0o755) + } +} catch { + // node-pty not found, skip +} From 7056097d2efbf665ffc485ada9cd24e29477aa80 Mon Sep 17 00:00:00 2001 From: Connor Adams Date: Sun, 29 Mar 2026 21:54:32 +0100 Subject: [PATCH 2/3] chore: fix biome lint/format in postinstall script Single quotes, tabs, sorted imports to match project conventions. --- scripts/postinstall.mjs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/scripts/postinstall.mjs b/scripts/postinstall.mjs index 628c4ba..f16be65 100644 --- a/scripts/postinstall.mjs +++ b/scripts/postinstall.mjs @@ -1,14 +1,14 @@ -import { chmodSync, existsSync } from "node:fs" -import { createRequire } from "node:module" -import { join, dirname } from "node:path" +import { chmodSync, existsSync } from 'node:fs' +import { createRequire } from 'node:module' +import { dirname, join } from 'node:path' const require = createRequire(import.meta.url) try { - const ptyDir = dirname(require.resolve("node-pty/package.json")) - for (const arch of ["darwin-arm64", "darwin-x64"]) { - const helper = join(ptyDir, "prebuilds", arch, "spawn-helper") - if (existsSync(helper)) chmodSync(helper, 0o755) - } + const ptyDir = dirname(require.resolve('node-pty/package.json')) + for (const arch of ['darwin-arm64', 'darwin-x64']) { + const helper = join(ptyDir, 'prebuilds', arch, 'spawn-helper') + if (existsSync(helper)) chmodSync(helper, 0o755) + } } catch { - // node-pty not found, skip + // node-pty not found, skip } From 9c105d30ef8d77d6c3efcfa4d6804ed9575e8208 Mon Sep 17 00:00:00 2001 From: Connor Adams Date: Sun, 29 Mar 2026 21:56:06 +0100 Subject: [PATCH 3/3] chore: add removal note for node-pty postinstall workaround Link to upstream issue so we know when to delete this. --- scripts/postinstall.mjs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/scripts/postinstall.mjs b/scripts/postinstall.mjs index f16be65..472d575 100644 --- a/scripts/postinstall.mjs +++ b/scripts/postinstall.mjs @@ -1,3 +1,6 @@ +// Workaround for microsoft/node-pty#850 — spawn-helper prebuild ships without +// execute permission on macOS, causing "posix_spawnp failed" at runtime. +// Remove this script once node-pty >=1.2.0 stable is released and we upgrade. import { chmodSync, existsSync } from 'node:fs' import { createRequire } from 'node:module' import { dirname, join } from 'node:path'