Common commands and workflows for Forms Platform development.
# Use correct Node version
nvm install # Install Node version from .nvmrc
# Install dependencies
pnpm install # Install all workspace dependencies
# One-time: Install Playwright browsers (version must match exactly)
pnpm dlx playwright@1.51.1 install --with-deps
# Install Docker or Podman
# See: documents/podman-integration.md for Podman setup# Build all packages (required before dev)
pnpm build
# Start development servers
pnpm dev # Astro (localhost:4321) + Storybook (localhost:61610)
# Type checking
pnpm typecheck # Check all packages
# Code quality
pnpm lint # Lint all packages
pnpm format # Format with Prettier (runs automatically on commit)# Run all tests
pnpm test # Full test suite (requires Docker/Podman)
# Watch mode
pnpm vitest # Watch mode for all packages
# Test specific package
pnpm --filter @flexion/forms test # Test forms package
pnpm --filter @flexion/forms-design test:watch # Watch mode for design package
# End-to-end tests
pnpm test:e2e:dev # E2E tests in dev mode
pnpm test:e2e:ci # E2E tests in CI mode# Add dependency to specific package
pnpm --filter @flexion/forms add lodash
# Add dev dependency to workspace root
pnpm add -Dw prettier
# Remove dependency
pnpm --filter @flexion/forms remove lodash
# Update dependencies
pnpm update # Update all dependencies# Build commands
pnpm build # Build all packages via Turborepo
pnpm --filter @flexion/forms build # Build specific package
# Cleanup commands
pnpm clean:dist # Remove all build artifacts recursively
pnpm clean:modules # Remove all node_modules recursively
# Full reset workflow
pnpm clean:modules # Step 1: Remove node_modules
pnpm install # Step 2: Reinstall
pnpm build # Step 3: Rebuild all# Access command-line operations
./manage.sh --help # View available CLI commands- Create pattern file in
packages/forms/src/patterns/ - Implement pattern interface with
type,id, anddata - Add pattern builder if needed
- Export from
packages/forms/src/patterns/index.ts - Add tests in
*.test.tsfile - Update pattern README
- Create component in
packages/design/src/components/ - Add Storybook story in
*.stories.tsx - Add component tests
- Export from
packages/design/src/index.ts - Document props and usage
- Create migration in
packages/database/src/migrations/ - Use Knex migration format
- Test against both PostgreSQL and SQLite
- Update database schema types if needed
# Run specific application
pnpm --filter spotlight dev # Run Spotlight app
pnpm --filter sandbox dev # Run Sandbox app
pnpm --filter server-doj dev # Run DOJ serverSymptom: Unexplained build failures
# Solution: Clean and rebuild
pnpm clean:dist
pnpm clean:modules
pnpm install
pnpm buildSymptom: Database tests failing
- Ensure Docker/Podman is running
- Check PostgreSQL container is accessible
- Verify
.envfiles are configured
Symptom: Playwright tests failing
- Ensure browsers installed:
pnpm dlx playwright@1.51.1 install --with-deps - Verify version matches exactly (1.51.1)
- Check local and CI environments match
Symptom: Dev server won't start
- Run
pnpm buildfirst (required beforepnpm dev) - Check ports 4321 and 61610 are available
- Clear build artifacts:
pnpm clean:dist
Symptom: Hot reload not working
- Restart dev server
- Check file watchers limit (Linux):
sudo sysctl fs.inotify.max_user_watches=524288
Symptom: TypeScript errors in IDE but not in CLI
- Restart TypeScript server in IDE
- Run
pnpm typecheckto verify - Check
tsconfig.jsonis correctly configured
Symptom: Module not found errors
- Verify package is in
dependenciesordevDependencies - Run
pnpm installagain - Check workspace protocol versions in
package.json
Symptom: Version conflicts
- Use
pnpm why <package>to trace dependency tree - Use
pnpm updateto resolve - Check peer dependency requirements
Key environment variables (see .env.sample files in each app):
DATABASE_URL- PostgreSQL connection stringBASEURL- Base URL for static buildsNODE_ENV- Environment (development, production, test)
| File | Purpose |
|---|---|
.nvmrc |
Node version specification |
pnpm-workspace.yaml |
Workspace configuration |
turbo.json |
Turborepo build configuration |
vitest.workspace.ts |
Vitest workspace configuration |
manage.sh |
CLI tool wrapper |
- DOCS.md - Full documentation index
- Architecture - System design
- ADRs - Architectural decisions
- Package READMEs - Package-specific documentation
- AGENTS.md - Repository guidelines for AI agents
- CLAUDE.md - Claude Code specific guidance
- Patterns and Conventions - Coding standards
- Podman Integration - Container setup