4.9 KiB
Build System
VibeTunnel uses platform-specific build systems for each component: Xcode for macOS and iOS applications, pnpm for the web frontend, and Bun for creating standalone executables. The build system supports both development and release builds with comprehensive automation scripts for code signing, notarization, and distribution.
The main build orchestration happens through shell scripts in mac/scripts/ that coordinate building native applications, bundling the web frontend, and packaging everything together. Release builds include code signing, notarization, DMG creation, and automated GitHub releases with Sparkle update support.
Build Workflows
macOS Application Build
Development Build - Quick build without code signing:
cd mac
./scripts/build.sh --configuration Debug
Release Build - Full build with code signing:
cd mac
./scripts/build.sh --configuration Release --sign
Key Script: mac/scripts/build.sh (lines 39-222)
- Builds Bun executable from web frontend
- Compiles macOS app using xcodebuild
- Handles code signing if requested
- Verifies version consistency with
mac/VibeTunnel/version.xcconfig
Web Frontend Build
Development Mode - Watch mode with hot reload:
cd web
pnpm run dev
Production Build - Optimized bundles:
cd web
pnpm run build
Bun Executable - Standalone binary with native modules:
cd web
node build-native.js
Key Files:
web/package.json- Build scripts and dependencies (lines 6-34)web/build-native.js- Bun compilation and native module bundling (lines 83-135)
iOS Application Build
Generate Xcode Project - From project.yml:
cd ios
xcodegen generate
Build via Xcode - Open ios/VibeTunnel.xcodeproj and build
Key File: ios/project.yml - XcodeGen configuration (lines 1-92)
Release Workflow
Complete Release - Build, sign, notarize, and publish:
cd mac
./scripts/release.sh stable # Stable release
./scripts/release.sh beta 1 # Beta release
Key Script: mac/scripts/release.sh (lines 1-100+)
- Validates environment and dependencies
- Builds with appropriate flags
- Signs and notarizes app
- Creates DMG
- Publishes GitHub release
- Updates Sparkle appcast
Platform Setup
macOS Requirements
Development Tools:
- Xcode 16.0+ with command line tools
- Node.js 20+ and pnpm
- Bun runtime (installed via npm)
- xcbeautify (optional, for cleaner output)
Release Requirements:
- Valid Apple Developer certificate
- App Store Connect API keys for notarization
- Sparkle EdDSA keys in
mac/private/
Configuration Files:
apple/Local.xcconfig- Local development settingsmac/VibeTunnel/version.xcconfig- Version numbersmac/Shared.xcconfig- Shared build settings
Web Frontend Requirements
Tools:
- Node.js 20+ with npm
- Bun runtime for standalone builds
Native Modules:
@homebridge/node-pty-prebuilt-multiarch- Terminal emulation- Platform-specific binaries in
web/native/:pty.node- Native PTY modulespawn-helper- Process spawning helpervibetunnel- Bun executable
iOS Requirements
Tools:
- Xcode 16.0+
- XcodeGen (install via Homebrew)
- iOS 18.0+ deployment target
Dependencies:
- SwiftTerm package via SPM
Reference
Build Targets
macOS Xcode Workspace (mac/VibeTunnel.xcworkspace):
- VibeTunnel scheme - Main application
- Debug configuration - Development builds
- Release configuration - Distribution builds
Web Build Scripts (web/package.json):
dev- Development server with watchersbuild- Production TypeScript compilationbundle- Client-side asset bundlingtypecheck- TypeScript validationlint- ESLint code quality checks
Build Scripts
Core Build Scripts (mac/scripts/):
build.sh- Main build orchestratorbuild-bun-executable.sh- Bun compilation (lines 31-92)copy-bun-executable.sh- Bundle integrationcodesign-app.sh- Code signingnotarize-app.sh- Apple notarizationcreate-dmg.sh- DMG packaginggenerate-appcast.sh- Sparkle updates
Helper Scripts:
preflight-check.sh- Pre-build validationversion.sh- Version managementclean.sh- Build cleanupverify-app.sh- Post-build verification
Troubleshooting
Common Issues:
- Bun build fails - Check
web/build-native.jspatches (lines 11-79) - Code signing errors - Verify
apple/Local.xcconfigsettings - Notarization fails - Check API keys in environment
- Version mismatch - Update
mac/VibeTunnel/version.xcconfig
Build Artifacts:
- macOS app:
mac/build/Build/Products/Release/VibeTunnel.app - Web bundles:
web/public/bundle/ - Native executables:
web/native/ - iOS app:
ios/build/
Clean Build:
cd mac && ./scripts/clean.sh
cd ../web && npm run clean