Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI

on:
push:
branches: [main]
pull_request:
branches: [main]

jobs:
test:
name: Test on ${{ matrix.os }} / Node ${{ matrix.node }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
node: ['18', '20', '22']

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node }}
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run format check
run: npm run format:check

- name: Run unit tests
run: npm run test:unit

- name: Run integration tests
run: npm run test:integration

- name: Run E2E tests
run: npm run test:e2e
env:
ENABLE_NOTIFICATIONS: 'false'

coverage:
name: Coverage Report
runs-on: ubuntu-latest
needs: test

steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'

- name: Install dependencies
run: npm ci

- name: Run tests with coverage
run: npm run test:coverage
env:
ENABLE_NOTIFICATIONS: 'false'

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
with:
files: ./coverage/lcov.info
fail_ci_if_error: false
continue-on-error: true
25 changes: 25 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,37 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [2.1.0] - 2026-01-12

### Added

- **Testing infrastructure**: Comprehensive test suite using Vitest
- Unit tests for pure functions (sanitizeServerName, parseArguments, detectPortFromOutput, getLogViewerCommand)
- Integration tests for config loading and health checks
- E2E tests for CLI commands and workflows
- **CI/CD pipeline**: GitHub Actions workflow for automated testing
- Matrix testing on Ubuntu and macOS
- Node.js 18, 20, 22 support
- Code coverage reporting via Codecov
- **Test utilities**: Helper modules for CLI execution, mock servers, and temp project setup
- **ADR-002**: Architecture Decision Record documenting the Vitest testing strategy

### Changed

- Updated CLAUDE.md formatting for consistency

## [2.0.0] - 2026-01-09

### Changed

- **Breaking**: Complete architecture rewrite - now a self-contained TypeScript CLI
- **Breaking**: Switched from compiled output to running TypeScript directly via `tsx`
- **Breaking**: Removed modular `src/` architecture in favor of single `bin/dev.ts`
- Updated to use `tsx` instead of `ts-node` for TypeScript execution
- Simplified package structure for easier maintenance

### Added

- Native OS notifications via `node-notifier` for server events
- `doctor` command for environment diagnostics
- `restart` command for quick server restarts
Expand All @@ -23,13 +44,15 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Exponential backoff for health checks

### Removed

- Compiled `dist/` output (no build step required)
- Modular `src/` directory (consolidated into `bin/dev.ts`)
- Test suite (tests were for old architecture)

## [1.0.0] - 2024-09-19

### Added

- Initial release of dev
- Core server lifecycle management (start, stop, status)
- Process monitoring with PID tracking
Expand All @@ -44,6 +67,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Comprehensive documentation and examples

### Features

- **Commands**: init, start, stop, status, port, logs, cleanup
- **Configuration**: JSON-based server configuration
- **Monitoring**: Real-time process health monitoring
Expand All @@ -56,6 +80,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- **Platform Support**: macOS and Linux

### Technical Details

- Built with ES modules
- Requires Node.js >=18.0.0
- Uses child_process, fs, path, and util built-ins
Expand Down
5 changes: 5 additions & 0 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,27 +22,32 @@ npm run format:check
The codebase is a self-contained TypeScript CLI:

### Core Files (`bin/`)

- **`dev.ts`** - Main CLI script (~1200 lines, all-in-one)
- **`notify.ts`** - Native OS notification utility using node-notifier

### Key Concepts

#### Server Configuration

- Servers are defined in `.dev/servers.json` with command, preferredPort, and healthCheck
- Template variables: `{PORT}` for dynamic port assignment, `{ROLE}` for server name
- Automatic server inference from package.json scripts during `init`

#### Process Management

- PID tracking in `.dev/pid.json` with port, startTime, and status
- Automatic port conflict resolution (tries ports sequentially)
- Health checks before marking servers as successfully started
- Process cleanup and stale entry detection

#### Log Management

- Centralized logging in `.dev/log/` directory
- Configurable log viewers via `--log-viewer` flag or `DEV_LOG_VIEWER` environment variable

### File Structure

```
bin/
├── dev.ts # Main CLI script
Expand Down
Loading