OneApp Docs
Getting Started

Essential Commands

Master the pnpm commands you'll use daily to develop, build, test, and manage packages in OneApp.

Need quick reference?

Why learn these commands?

Working in a monorepo without knowing the right commands is frustrating:

  • Wrong scope — Running commands in the wrong workspace wastes time
  • Failed builds — Don't know how to build specific packages or all at once
  • Dependency chaos — Adding packages to the wrong location breaks builds
  • Slow feedback — Running unnecessary commands across all workspaces

OneApp uses pnpm with workspace filtering (--filter) for targeted commands — letting you run builds, tests, and installs on specific packages or groups of packages — saving time and reducing errors.

Production-ready with parallel execution, intelligent caching via Turborepo, and workspace filters that work across 40+ packages.

Use cases

Master these commands to:

  • Develop efficiently — Start only the apps you need
  • Build selectively — Build one package or all dependencies
  • Manage dependencies — Add packages to the right workspace
  • Quality checks — Lint and type-check before committing
  • Clean installs — Fix dependency issues quickly

Development commands

Start development servers

Terminal
# Start the main web application (port 3000)
pnpm dev

# Start OneApp microfrontend architecture (ports 3000-3002)
pnpm dev:oneapp

# Start Storybook for component development (port 6006)
pnpm --filter=storybook dev

# Start documentation site (port 3003)
pnpm --filter=docs dev

# Start email template preview (port 3004)
pnpm --filter=email dev

Multiple apps simultaneously

Open multiple terminals to run different apps at the same time:

Terminal 1: pnpm dev (main app) Terminal 2: pnpm --filter=storybook dev (Storybook) Terminal 3: pnpm --filter=docs dev (docs)

Start specific workspaces

Terminal
# Start by package name
pnpm --filter=web dev
pnpm --filter=@repo/ui dev
pnpm --filter=oneapp-onstage dev

# Start by path
pnpm --filter=./apps/web dev
pnpm --filter=./platform/apps/docs dev

Building commands

Build all packages and apps

Terminal
# Build everything (respects dependency order)
pnpm build

# Build in parallel (faster, but more CPU intensive)
pnpm build --parallel

Build specific workspaces

Terminal
# Build a single package
pnpm --filter=@repo/ui build

# Build an app
pnpm --filter=web build
pnpm --filter=oneapp-api build

# Build a package and all its dependencies
pnpm --filter=web... build

# Build a package and all dependents
pnpm --filter=...@repo/ui build

Start production servers

Terminal
# Start production server (after build)
pnpm start

# Start specific app in production mode
pnpm --filter=web start
pnpm --filter=oneapp-onstage start

Code quality commands

Linting

Terminal
# Lint all packages
pnpm lint

# Lint specific workspace
pnpm --filter=web lint
pnpm --filter=@repo/ui lint

# Lint and auto-fix
pnpm --filter=web lint --fix

# Lint only changed files
pnpm lint --only-changed

Type checking

Terminal
# Type check all packages
pnpm typecheck

# Type check specific workspace
pnpm --filter=web typecheck
pnpm --filter=@repo/types typecheck

# Watch mode (continuous type checking)
pnpm --filter=web typecheck --watch

Full quality check

Terminal
# Recommended before creating a PR
pnpm build && pnpm lint && pnpm typecheck

# Or individually
pnpm build
pnpm lint
pnpm typecheck

Package management commands

Adding dependencies

Terminal
# Add production dependency to workspace
pnpm --filter=web add lodash
pnpm --filter=@repo/ui add clsx

# Add dev dependency
pnpm --filter=web add -D vitest
pnpm --filter=@repo/ui add -D @testing-library/react

# Add peer dependency (for libraries)
pnpm --filter=@repo/ui add -P react react-dom

# Add dependency to root (workspace-wide tooling only)
pnpm add -D -w prettier eslint typescript

Internal packages are automatic

When adding an internal package, pnpm automatically uses workspace:*:

pnpm --filter=web add @repo/ui
# Automatically becomes: "@repo/ui": "workspace:*"

Removing dependencies

Terminal
# Remove from workspace
pnpm --filter=web remove lodash

# Remove from root
pnpm remove -w prettier

Updating dependencies

Terminal
# Update specific package
pnpm --filter=web update lodash

# Update to latest version
pnpm --filter=web update lodash@latest

# Update all dependencies in a workspace
pnpm --filter=web update

# Interactive update (choose which to update)
pnpm --filter=web update -i

# Update all across monorepo
pnpm -r update

Installing dependencies

Terminal
# Install all dependencies
pnpm install

# Install for specific workspace
pnpm --filter=web install

# Install ignoring lockfile (when lockfile is outdated)
pnpm install --no-frozen-lockfile

# Force reinstall
pnpm install --force

Workspace filtering

The --filter flag is your most powerful tool:

Filter by package name

Terminal
# By exact name
pnpm --filter=web dev
pnpm --filter=@repo/ui build

# Multiple packages
pnpm --filter=@repo/ui --filter=@repo/utils build

Filter by path

Terminal
# By directory
pnpm --filter=./apps/web dev

# All packages in a directory
pnpm --filter="./packages/*" build
pnpm --filter="./teams/ai/**" lint

Filter by dependencies

Terminal
# Build package and all its dependencies
pnpm --filter=web... build

# Build all packages that depend on @repo/ui
pnpm --filter=...@repo/ui build

# Build package, its dependencies, and dependents
pnpm --filter=...@repo/ui... build

Filter by Git changes

Terminal
# Run command on packages with uncommitted changes
pnpm --filter="[HEAD]" build

# Run command on packages changed since main branch
pnpm --filter="[origin/main]" lint

# Changed packages and their dependents
pnpm --filter="...[origin/main]" build

Cleaning commands

Terminal
# Remove node_modules and build artifacts
pnpm clean

# Manual cleanup
rm -rf node_modules
rm -rf **/node_modules
rm -rf **/.next
rm -rf **/dist

# Clean and reinstall
pnpm clean && pnpm install

# Clear pnpm cache
pnpm store prune

Testing commands

Terminal
# Run tests (when configured)
pnpm test

# Test specific workspace
pnpm --filter=web test
pnpm --filter=@repo/ui test

# Watch mode
pnpm --filter=@repo/ui test --watch

# Coverage
pnpm --filter=@repo/ui test --coverage

Git and versioning commands

Changesets

Terminal
# Create a changeset (for versioning)
pnpm changeset

# Check changeset status
pnpm changeset:status

# Version packages (bumps versions)
pnpm changeset:version

# Publish packages (for library maintainers)
pnpm changeset:publish

Git operations

Terminal
# Check status
git status

# Create feature branch
git checkout -b feature/my-feature

# Stage and commit (triggers pre-commit hooks)
git add .
git commit -m "feat: add new feature"

# Push to remote
git push -u origin feature/my-feature

Quick reference

Common commands cheat sheet

TaskCommand
Start dev serverpnpm dev
Start OneApppnpm dev:oneapp
Start Storybookpnpm --filter=storybook dev
Build allpnpm build
Build specificpnpm --filter=<pkg> build
Lint allpnpm lint
Type check allpnpm typecheck
Full quality checkpnpm build && pnpm lint && pnpm typecheck
Add dependencypnpm --filter=<pkg> add <dep>
Remove dependencypnpm --filter=<pkg> remove <dep>
Update dependencypnpm --filter=<pkg> update <dep>
Install allpnpm install
Clean installpnpm clean && pnpm install
Run testspnpm --filter=<pkg> test
Create changesetpnpm changeset

Next steps

On this page