Overview
Each package in the Happy Development monorepo has its own build process. This guide covers building all packages for development and production.Prerequisites
Ensure you have:- Completed the development setup
- Installed all dependencies with
yarn install - Run
yarn generatein the server package (if applicable)
Building All Packages
From the repository root:Building happy-cli
Development Build
For local development without building:Production Build
Build distributable packages:dist/index.cjs- CommonJS bundledist/index.mjs- ES Module bundledist/index.d.cts- CommonJS type definitionsdist/index.d.mts- ESM type definitions
Running Built Binary
After building:Development Variants
The CLI supports parallel dev and stable installations:Building happy-app
Type Checking
Always run type-checking after changes:Development Builds
Local Development Server
Environment Variants
Native Builds
Prebuild (Generate Native Projects)
ios/ and android/ directories from Expo configuration.
EAS Cloud Builds
Over-the-Air (OTA) Updates
macOS Desktop (Tauri)
Web Build
Building happy-server
Type Checking
Standalone Executable
Build a single executable with embedded runtime:dist/happy-server with:
- Compiled TypeScript
- Bundled dependencies
- Embedded PGLite WASM files
- Prisma migrations
Development Server
Docker Builds
The server includes a multi-stage Dockerfile:Building happy-agent
Production Build
dist/index.cjs/dist/index.mjs- Type definitions
- Binary in
bin/happy-agent.mjs
Development
Building happy-wire
Production Build
Development
No build needed during development - packages import directly from source.Publishing Packages
All packages userelease-it for publishing:
Individual Package
- Runs tests
- Builds the package
- Bumps version
- Creates git tag
- Publishes to npm
All Packages
From the repository root:Build Output
CLI, Agent, and Wire Packages
App Package
No build artifacts in repo:- Development: Run via Expo dev server
- Production: Built via EAS or local Xcode/Android Studio
Server Package
Common Build Issues
TypeScript Errors
Run type-checking to identify issues:Dependency Issues
Reinstall dependencies:Prisma Client Out of Sync
Cache Issues
Clear build caches:Expo Prebuild Issues
Continuous Integration
All packages include:- Pre-publish hooks that run tests and builds
- Type-checking before builds
- Test suite execution
- Type-check (
tsc --noEmit) - Run tests (
vitest run) - Bundle code (
pkgrollorexpo build) - Verify output
Next Steps
- Set up testing to validate builds
- Review project structure to understand package dependencies
- Read setup guide for development environment