Development Process
Prerequisites: Git, Node.js 22+, npm
Overview
Section titled “Overview”Jaypie development follows a baseline-driven workflow: establish baseline state, make changes, validate against baseline, commit incrementally.
Workflow
Section titled “Workflow”1. Establish Baseline
Section titled “1. Establish Baseline”Before making changes, run all validation:
npm run lintnpm run typechecknpm run buildnpm testRecord any existing issues. You’re only responsible for issues you introduce.
2. Make Changes
Section titled “2. Make Changes”Implement your changes in small, testable increments.
3. Validate
Section titled “3. Validate”After each logical change:
npm run typecheck -w packages/changed-packagenpm run build -w packages/changed-packagenpm test -w packages/changed-packagenpm run format -w packages/changed-package4. Commit
Section titled “4. Commit”Commit after each successful validation:
git add .git commit -m "type: scope: description"This creates restore points if later changes break things.
5. Repeat
Section titled “5. Repeat”Continue until feature is complete.
Validation Order
Section titled “Validation Order”- Typecheck - Catch type errors first
- Build - Ensure it compiles
- Test - Verify behavior
- Format - Fix lint issues
Run in this order because:
- Type errors can cause build failures
- Build failures can cause test failures
- Format should be last (auto-fixes)
Commit Messages
Section titled “Commit Messages”Format
Section titled “Format”type: scope: description| Type | Use Case |
|---|---|
feat |
New feature |
fix |
Bug fix |
refactor |
Code change (no behavior change) |
docs |
Documentation |
test |
Tests only |
chore |
Tooling, dependencies |
build |
Build configuration |
Examples
Section titled “Examples”feat: express: add streaming handlerfix: lambda: handle empty event recordsrefactor: kit: extract force utilitiestest: testkit: add error matcherschore: deps: update vitestTest-Driven Development
Section titled “Test-Driven Development”Red-Green-Refactor
Section titled “Red-Green-Refactor”- Red - Write failing test
- Green - Make test pass (minimal code)
- Refactor - Clean up
Test First Benefits
Section titled “Test First Benefits”- Clarifies requirements
- Ensures testability
- Documents behavior
- Prevents over-engineering
Code Review Checklist
Section titled “Code Review Checklist”Before submitting PR:
- All tests pass
- No type errors
- Build succeeds
- Lint passes
- Tests added for new code
- Documentation updated (if public API changed)
Handling Failures
Section titled “Handling Failures”Test Failure
Section titled “Test Failure”- Read error message carefully
- Check if test expectation is wrong
- Check if implementation is wrong
- Fix the root cause
Type Error
Section titled “Type Error”- Don’t use
anyto silence - Fix the type definition
- Use type guards if needed
Lint Error
Section titled “Lint Error”npm run format # Auto-fix most issuesFor remaining issues, fix manually or add exception comment with reason.
Working with Tests
Section titled “Working with Tests”Run Specific Test
Section titled “Run Specific Test”npm test -w packages/api -- --grep "health route"Watch Mode
Section titled “Watch Mode”npx vitest -w packages/apiCoverage
Section titled “Coverage”npm test -w packages/api -- --coverageUpdating Dependencies
Section titled “Updating Dependencies”# Update specific packagenpm install express@latest -w packages/api
# Update allnpm update
# Check outdatednpm outdatedVersion Bumping
Section titled “Version Bumping”Don’t bump versions in feature branches. Versions are bumped when merging to main.
If you need to bump for testing:
npm version patch -w packages/changed-packagenpm i --package-lock-only # Update lock fileRelated
Section titled “Related”- Branch Management - Git workflow
- Testing - Testing guide
- Patterns - Code patterns