mirror of
https://github.com/samsonjs/vibetunnel.git
synced 2026-04-22 14:06:02 +00:00
fix build on macOS Tahoe
This commit is contained in:
parent
f25194d3c8
commit
5a954377d6
4 changed files with 43 additions and 35 deletions
|
|
@ -278,6 +278,11 @@ fi
|
|||
echo "✓ All sanity checks passed"
|
||||
|
||||
# Save the current hash as the previous hash for next build
|
||||
cp "${HASH_FILE}" "${PREVIOUS_HASH_FILE}"
|
||||
if [ -f "${HASH_FILE}" ]; then
|
||||
cp "${HASH_FILE}" "${PREVIOUS_HASH_FILE}"
|
||||
else
|
||||
# If hash file doesn't exist, create it with the current hash value
|
||||
echo "${CURRENT_HASH}" > "${PREVIOUS_HASH_FILE}"
|
||||
fi
|
||||
|
||||
echo "Web frontend build completed successfully"
|
||||
|
|
@ -119,10 +119,13 @@ if (nodeVersion < 20) {
|
|||
function patchNodePty() {
|
||||
console.log('Preparing node-pty for SEA build...');
|
||||
|
||||
// Always reinstall to ensure clean state
|
||||
console.log('Reinstalling node-pty to ensure clean state...');
|
||||
execSync('rm -rf node_modules/@homebridge/node-pty-prebuilt-multiarch', { stdio: 'inherit' });
|
||||
execSync('npm install @homebridge/node-pty-prebuilt-multiarch --silent --no-fund --no-audit', { stdio: 'inherit' });
|
||||
// Skip reinstall if already exists
|
||||
if (!fs.existsSync('node_modules/@homebridge/node-pty-prebuilt-multiarch')) {
|
||||
console.log('Installing node-pty...');
|
||||
execSync('npm install @homebridge/node-pty-prebuilt-multiarch --silent --no-fund --no-audit --no-save', { stdio: 'inherit' });
|
||||
} else {
|
||||
console.log('node-pty already installed, skipping reinstall...');
|
||||
}
|
||||
|
||||
// If using custom Node.js, rebuild native modules
|
||||
if (customNodePath) {
|
||||
|
|
@ -284,11 +287,13 @@ if (process.env.NODE_PTY_SPAWN_HELPER_PATH) {
|
|||
}
|
||||
}`;
|
||||
|
||||
// Find and replace the helperPath section
|
||||
content = content.replace(
|
||||
/var helperPath;[\s\S]*?helperPath = helperPath\.replace\('node_modules\.asar', 'node_modules\.asar\.unpacked'\);/m,
|
||||
helperPathPatch
|
||||
);
|
||||
// Find and replace the helperPath section - be more specific to avoid double braces
|
||||
const helperPathRegex = /var helperPath;[\s\S]*?helperPath = helperPath\.replace\('node_modules\.asar', 'node_modules\.asar\.unpacked'\);\s*}/m;
|
||||
if (helperPathRegex.test(content)) {
|
||||
content = content.replace(helperPathRegex, helperPathPatch);
|
||||
} else {
|
||||
console.log('Warning: Could not find expected helperPath pattern in unixTerminal.js');
|
||||
}
|
||||
|
||||
fs.writeFileSync(unixTerminalFile, content);
|
||||
}
|
||||
|
|
@ -363,7 +368,7 @@ async function main() {
|
|||
const buildTimestamp = Date.now();
|
||||
|
||||
// Use esbuild directly without custom loader since we're patching node-pty
|
||||
let esbuildCmd = `npx esbuild src/cli.ts \\
|
||||
let esbuildCmd = `npx --no-install esbuild src/cli.ts \\
|
||||
--bundle \\
|
||||
--platform=node \\
|
||||
--target=node20 \\
|
||||
|
|
@ -469,10 +474,8 @@ async function main() {
|
|||
console.log(' - Copied spawn-helper');
|
||||
}
|
||||
|
||||
// 9. Restore original node-pty (AFTER copying the custom-built version)
|
||||
console.log('\nRestoring original node-pty for development...');
|
||||
execSync('rm -rf node_modules/@homebridge/node-pty-prebuilt-multiarch', { stdio: 'inherit' });
|
||||
execSync('npm install @homebridge/node-pty-prebuilt-multiarch --silent --no-fund --no-audit', { stdio: 'inherit' });
|
||||
// 9. Skip restoration since we're using --no-save
|
||||
console.log('\nKeeping patched node-pty (use npm install to restore original)...');
|
||||
|
||||
console.log('\n✅ Build complete!');
|
||||
console.log(`\nPortable executable created in native/ directory:`);
|
||||
|
|
|
|||
34
web/package-lock.json
generated
34
web/package-lock.json
generated
|
|
@ -3353,13 +3353,12 @@
|
|||
}
|
||||
},
|
||||
"node_modules/commander": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
|
||||
"integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",
|
||||
"dev": true,
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
"node": "^12.20.0 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/component-emitter": {
|
||||
|
|
@ -3380,9 +3379,9 @@
|
|||
"license": "MIT"
|
||||
},
|
||||
"node_modules/concurrently": {
|
||||
"version": "9.1.2",
|
||||
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.1.2.tgz",
|
||||
"integrity": "sha512-H9MWcoPsYddwbOGM6difjVwVZHl63nwMEwDJG/L7VGtuaJhb12h2caPG2tVPWs7emuYix252iGfqOyrz1GczTQ==",
|
||||
"version": "9.2.0",
|
||||
"resolved": "https://registry.npmjs.org/concurrently/-/concurrently-9.2.0.tgz",
|
||||
"integrity": "sha512-IsB/fiXTupmagMW4MNp2lx2cdSN2FfZq78vF90LBB+zZHArbIQZjQtzXCiXnvTxCZSvXanTqFLWBjw2UkLx1SQ==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
|
|
@ -6415,15 +6414,6 @@
|
|||
"node": ">=14.0.0"
|
||||
}
|
||||
},
|
||||
"node_modules/postject/node_modules/commander": {
|
||||
"version": "9.5.0",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
||||
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": "^12.20.0 || >=14"
|
||||
}
|
||||
},
|
||||
"node_modules/prebuild-install": {
|
||||
"version": "7.1.3",
|
||||
"resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.3.tgz",
|
||||
|
|
@ -7474,6 +7464,16 @@
|
|||
"node": ">=16 || 14 >=14.17"
|
||||
}
|
||||
},
|
||||
"node_modules/sucrase/node_modules/commander": {
|
||||
"version": "4.1.1",
|
||||
"resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz",
|
||||
"integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==",
|
||||
"dev": true,
|
||||
"license": "MIT",
|
||||
"engines": {
|
||||
"node": ">= 6"
|
||||
}
|
||||
},
|
||||
"node_modules/superagent": {
|
||||
"version": "10.2.1",
|
||||
"resolved": "https://registry.npmjs.org/superagent/-/superagent-10.2.1.tgz",
|
||||
|
|
|
|||
|
|
@ -14,17 +14,17 @@ execSync('node scripts/copy-assets.js', { stdio: 'inherit' });
|
|||
|
||||
// Build CSS
|
||||
console.log('Building CSS...');
|
||||
execSync('npx tailwindcss -i ./src/client/styles.css -o ./public/bundle/styles.css --minify', { stdio: 'inherit' });
|
||||
execSync('node node_modules/tailwindcss/lib/cli.js -i ./src/client/styles.css -o ./public/bundle/styles.css --minify', { stdio: 'inherit' });
|
||||
|
||||
// Bundle client JavaScript
|
||||
console.log('Bundling client JavaScript...');
|
||||
process.env.NODE_ENV = 'production';
|
||||
execSync('node scripts/build-client.js', { stdio: 'inherit' });
|
||||
execSync('esbuild src/client/test-terminals-entry.ts --bundle --outfile=public/bundle/terminal.js --format=esm --minify', { stdio: 'inherit' });
|
||||
execSync('./node_modules/esbuild/bin/esbuild src/client/test-terminals-entry.ts --bundle --outfile=public/bundle/terminal.js --format=esm --minify', { stdio: 'inherit' });
|
||||
|
||||
// Build server TypeScript
|
||||
console.log('Building server...');
|
||||
execSync('tsc', { stdio: 'inherit' });
|
||||
execSync('node node_modules/typescript/lib/tsc.js', { stdio: 'inherit' });
|
||||
|
||||
// Build native executable
|
||||
console.log('Building native executable...');
|
||||
|
|
|
|||
Loading…
Reference in a new issue