diff --git a/.github/workflows/renovate.yml b/.github/workflows/renovate.yml index 79cbba3..22ac71a 100644 --- a/.github/workflows/renovate.yml +++ b/.github/workflows/renovate.yml @@ -14,8 +14,17 @@ jobs: renovate: name: Run Renovate Bot runs-on: ubuntu-latest + env: + RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }} steps: + - name: Validate Renovate token + if: ${{ env.RENOVATE_TOKEN == '' }} + run: | + echo "RENOVATE_TOKEN is not configured." + echo "Set repository secret RENOVATE_TOKEN (fine-grained token with Contents: Read/Write and Pull requests: Read/Write)." + exit 1 + - name: Checkout repository uses: actions/checkout@v4 @@ -23,7 +32,7 @@ jobs: uses: renovatebot/github-action@v44.0.3 with: configurationFile: renovate.json - token: ${{ secrets.RENOVATE_TOKEN || github.token }} + token: ${{ env.RENOVATE_TOKEN }} env: LOG_LEVEL: debug RENOVATE_REPOSITORIES: ${{ github.repository }} diff --git a/IMPLEMENTATION_SUMMARY.md b/IMPLEMENTATION_SUMMARY.md deleted file mode 100644 index 17567ce..0000000 --- a/IMPLEMENTATION_SUMMARY.md +++ /dev/null @@ -1,280 +0,0 @@ -# Implementation Summary: Cross-Platform Testing Infrastructure - -## What Was Done - -### 1. **Fixed Dependency Issue** ✅ - -**Problem**: `Cannot find package '@inquirer/core'` error when running `npx create-react-forge@latest` - -**Solution**: Added `@inquirer/core` as an explicit dependency in `package.json` - -```json -"dependencies": { - "@inquirer/core": "^9.1.0", - "@inquirer/prompts": "^8.2.0", - // ... other deps -} -``` - -This ensures proper peer dependency resolution on all platforms. - ---- - -### 2. **Created Cross-Platform Test Suite** ✅ - -#### File: `src/__tests__/integration/cross-platform-cli.test.ts` - -Tests for platform-specific behaviors: - -- **Path Handling**: Windows `\` vs Unix `/` separators -- **Case Sensitivity**: Windows/macOS case-insensitive, Linux case-sensitive -- **Line Endings**: CRLF vs LF handling -- **Special Characters**: Directory names with hyphens, underscores, camelCase -- **Permissions**: File permissions on Unix systems -- **Package Manager Detection**: npm, yarn, pnpm detection per platform - -#### File: `src/__tests__/integration/e2e-cli.test.ts` - -End-to-end CLI command tests: - -- Version and help flags -- Exit code verification -- Output consistency -- Concurrent execution handling -- Environment variables -- Error handling -- Platform-specific path handling - ---- - -### 3. **Added GitHub Actions CI/CD Pipeline** ✅ - -#### File: `.github/workflows/cross-platform-tests.yml` - -Comprehensive multi-platform testing: - -**Test Matrix**: - -- OS: Ubuntu Latest, Windows Latest, macOS Latest -- Node: 20.x, 22.x -- **Total combinations**: 6 - -**Jobs**: - -1. **test**: Runs all test suites (unit, integration, cross-platform, e2e) -2. **e2e-scaffold-test**: Tests actual CLI scaffolding command on each platform -3. **lint**: Linter and format checks -4. **build-artifacts**: Verifies build output and TypeScript definitions - -**Each Test Job Verifies**: - -- ✅ Dependencies install correctly -- ✅ Project builds without errors -- ✅ All test suites pass -- ✅ Linter passes -- ✅ CLI can be invoked -- ✅ TypeScript definitions are generated - ---- - -### 4. **Documentation** ✅ - -#### File: `CROSS_PLATFORM_TESTING.md` - -Comprehensive guide covering: - -- Overview of testing strategy -- Test coverage breakdown -- How to run tests locally -- CI/CD pipeline details -- Platform differences (Windows, macOS, Linux) -- Troubleshooting guide -- Best practices for adding new tests - -#### Updates to `README.md` - -Added new section: - -- "Cross-Platform Support" highlighting Windows, macOS, Linux testing -- Updated troubleshooting with module resolution fixes -- Added new npm scripts documentation - ---- - -### 5. **Local Testing Scripts** ✅ - -#### File: `scripts/test-local.sh` (Unix/Linux/macOS) - -Bash script that: - -- Checks Node.js version -- Installs dependencies -- Builds project -- Runs unit tests -- Runs cross-platform tests -- Runs E2E CLI tests -- Tests CLI execution -- Shows platform info -- Displays coverage info - -#### File: `scripts/test-local.bat` (Windows) - -Batch script with same functionality for Windows users - ---- - -### 6. **New npm Scripts** ✅ - -Added to `package.json`: - -```json -"scripts": { - "test:cross-platform": "vitest run src/__tests__/integration/cross-platform-cli.test.ts", - "test:e2e": "vitest run src/__tests__/integration/e2e-cli.test.ts", - "test:local": "bash scripts/test-local.sh" -} -``` - ---- - -## Running Tests Locally - -### Quick Test - -```bash -npm test -``` - -### Cross-Platform Specific Tests - -```bash -npm run test:cross-platform -``` - -### E2E CLI Tests - -```bash -npm run test:e2e -``` - -### Full Local Test Suite - -```bash -npm run test:local # Unix/Linux/macOS -scripts/test-local.bat # Windows -``` - -### Watch Mode - -```bash -npm run test:watch -``` - -### With Coverage - -```bash -npm run test:coverage -``` - ---- - -## Platform-Specific Testing - -### Windows (`win32`) - -- Path separators: `\` -- Case-insensitive file system -- CRLF line endings -- Special handling in CI workflow - -### macOS (`darwin`) - -- Path separators: `/` -- Case-insensitive file system (default) -- LF line endings -- Code signing considerations - -### Linux - -- Path separators: `/` -- Case-sensitive file system -- LF line endings -- Permission handling - ---- - -## CI/CD Benefits - -✅ **Early Detection**: Catch platform-specific bugs before release -✅ **Regression Prevention**: Ensure fixes work across all platforms -✅ **Release Confidence**: Verified working on Windows, macOS, Linux -✅ **Node Compatibility**: Tested on Node 20.x and 22.x -✅ **Automated**: Runs on every push and PR automatically - ---- - -## File Summary - -| File | Purpose | Platform | -| ------------------------------------------------------ | ---------------------------------------- | ---------------- | -| `package.json` | Added `@inquirer/core` + new npm scripts | All | -| `src/__tests__/integration/cross-platform-cli.test.ts` | Platform-specific behavior tests | All | -| `src/__tests__/integration/e2e-cli.test.ts` | CLI command execution tests | All | -| `.github/workflows/cross-platform-tests.yml` | Multi-platform CI/CD | GitHub | -| `CROSS_PLATFORM_TESTING.md` | Testing documentation | All | -| `README.md` | Updated with testing info | All | -| `scripts/test-local.sh` | Unix test automation | Unix/Linux/macOS | -| `scripts/test-local.bat` | Windows test automation | Windows | - ---- - -## Next Steps - -1. **Run Tests Locally**: Execute `npm run test:local` to verify everything works -2. **Push to GitHub**: Workflow will run on all platforms automatically -3. **Review Results**: Check GitHub Actions for any platform-specific issues -4. **Add to CI**: Ensure workflow runs on every PR -5. **Monitor**: Track test results for platform issues - ---- - -## Troubleshooting - -### Module Resolution Error - -``` -Error: Cannot find package '@inquirer/core' -``` - -**Solution**: Run `npm install` to reinstall dependencies - -### Path Issues on Windows - -- Use `path.join()` instead of hardcoding `/` or `\` -- Use `path.sep` for consistent separators - -### Case Sensitivity Issues - -- Be aware of case differences between platforms -- Tests check for this automatically - -### Node Version Issues - -- Ensure Node 20.9.0+: `node -v` -- CI tests on both 20.x and 22.x - ---- - -## Success Criteria ✅ - -- [x] Fixed `@inquirer/core` dependency error -- [x] Created comprehensive cross-platform tests -- [x] Set up GitHub Actions CI/CD pipeline -- [x] Tests run on Windows, macOS, Linux -- [x] Tests run on Node 20.x and 22.x -- [x] Documentation complete -- [x] Local test scripts working -- [x] npm scripts added -- [x] README updated - -All requirements implemented and ready for production! diff --git a/README.md b/README.md index 502dc92..2fa8f26 100644 --- a/README.md +++ b/README.md @@ -120,16 +120,24 @@ This repo now uses Renovate to auto-update dependencies (including template mani ### One-time setup -1. No additional token is required. Renovate uses the default `secrets.GITHUB_TOKEN`. -2. Enable repository auto-merge in GitHub settings. -3. Protect `master` and require CI checks before merge. +1. Create a repository secret named `RENOVATE_TOKEN`. +2. Use a fine-grained GitHub token scoped to this repository with: + - Contents: Read and write + - Pull requests: Read and write +3. Enable repository auto-merge in GitHub settings. +4. Protect `master`, require CI checks before merge, and enable merge queue. + +Why: PRs created with `GITHUB_TOKEN` do not trigger downstream `pull_request` workflows. Using `RENOVATE_TOKEN` ensures CI checks run and automerge can complete. Workflow file: `.github/workflows/renovate.yml` Config file: `renovate.json` Behavior: -- All dependency updates (major, minor, patch) auto-merge after checks pass. +- Renovate runs with controlled concurrency (`prConcurrentLimit` and `branchConcurrentLimit` set to `3`) to reduce conflicts. +- Major updates are never auto-merged and require manual review. +- Minor, patch, pin, and digest updates are grouped into fewer PRs and auto-merge after checks pass. +- Renovate automatically rebases dependency PRs when they fall behind `master`. - Custom regex managers keep template manifests, the resolver registry, and README dependency rows in sync. ## Screenshot diff --git a/TESTING_STRATEGY.md b/TESTING_STRATEGY.md deleted file mode 100644 index 6811569..0000000 --- a/TESTING_STRATEGY.md +++ /dev/null @@ -1,433 +0,0 @@ -# Testing Strategy & Coverage Map - -## Overview - -The create-react-forge project has implemented an **enterprise-grade testing strategy** with comprehensive coverage across all major components, configurations, and platforms. - ---- - -## Testing Pyramid - -``` - △ - / \ - / \ E2E Scenarios (30+ tests) - / E2E \ - Real-world configs - /________\ - Integration paths - / \ - / \ Integration (100+ tests) - / Integration \ - Component interaction - /________________\ - Data flow - / \ - / \ Unit Tests (70+ tests) - / Unit \ - Individual functions - / \ - Edge cases - /__________________________\ -``` - ---- - -## Testing Layers - -### Layer 1: Unit Tests (70+ tests) - -**Location**: `src/__tests__/*.test.ts` - -Tests individual functions and components in isolation. - -**Coverage**: - -- ✅ CLI parsing and validation -- ✅ Configuration builder -- ✅ Config validation -- ✅ Template utilities -- ✅ Dependency resolution -- ✅ Plugin system -- ✅ README generation -- ✅ Architecture generation -- ✅ Styling alignment -- ✅ Testing configuration - -**Running**: `npm test` - ---- - -### Layer 2: Integration Tests (60+ tests) - -**Location**: `src/__tests__/integration/*.test.ts` - -Tests interaction between multiple components. - -**Coverage**: - -- ✅ Template loading and merging -- ✅ Package.json generation -- ✅ Build verification -- ✅ Template-based generation -- ✅ Generator orchestration - -**Running**: `npm test -- src/__tests__/integration/` - ---- - -### Layer 3: Comprehensive Component Tests (180+ tests) - -#### 3a. Config Builder Tests (50+ tests) - -**File**: `src/__tests__/config-builder-comprehensive.test.ts` - -Tests the entire configuration system with all options. - -``` -✅ Fluent API ✅ Validation -✅ All runtimes ✅ Merging -✅ All languages ✅ Edge cases -✅ All styling ✅ Complex scenarios -✅ All state management -✅ All test runners -✅ All package managers -``` - -**Running**: `npm test -- config-builder-comprehensive.test.ts` - ---- - -#### 3b. Template System Tests (40+ tests) - -**File**: `src/__tests__/template-system-comprehensive.test.ts` - -Tests template loading and composition for all combinations. - -``` -✅ Template loading ✅ Runtime combinations -✅ Styling templates ✅ State management -✅ Testing templates ✅ Data fetching -✅ Consistency ✅ Complex combinations -``` - -**Running**: `npm test -- template-system-comprehensive.test.ts` - ---- - -#### 3c. Generator Tests (50+ tests) - -**File**: `src/__tests__/generator-comprehensive.test.ts` - -Tests project generation for all configuration combinations. - -``` -✅ Basic generation ✅ Testing setup -✅ File structure ✅ State management -✅ package.json ✅ Package managers -✅ Dependencies ✅ Data fetching -✅ Documentation ✅ Complex scenarios -``` - -**Running**: `npm test -- generator-comprehensive.test.ts` - ---- - -### Layer 4: E2E Scenario Tests (30+ tests) - -**Location**: `src/__tests__/integration/e2e-scenarios.test.ts` - -Tests real-world project configurations end-to-end. - -#### Scenarios Tested: - -1. **Startup SPA** (Vite, TS, Tailwind, Zustand, Full Testing, TanStack Query) -2. **Enterprise Next.js** (Next.js, TS, Redux, Jest, Cypress, pnpm) -3. **Lightweight Project** (Vite, JS, CSS Modules, No Testing) -4. **Component Library** (Vite, TS, Styled Components, Jest Unit Only) -5. **Data-Heavy App** (Next.js, TS, TanStack Query, Redux) -6. **Jotai-Based** (Vite, TS, Styled Components, Jotai) -7. **Multi-PM Support** (npm, yarn, pnpm with same config) -8. **All Options Combinations** (Runtime, Language, Styling, State combinations) - -**Running**: `npm test -- src/__tests__/integration/e2e-scenarios.test.ts` - ---- - -### Layer 5: Cross-Platform Tests (30+ tests) - -**Location**: `src/__tests__/integration/cross-platform-cli.test.ts` - -Tests platform-specific behaviors on Windows, macOS, and Linux. - -``` -✅ Path handling ✅ Case sensitivity -✅ Line endings ✅ File permissions -✅ Special characters ✅ Package manager detection -``` - -**Running**: `npm test -- src/__tests__/integration/cross-platform-cli.test.ts` - ---- - -### Layer 6: CLI E2E Tests (15+ tests) - -**Location**: `src/__tests__/integration/e2e-cli.test.ts` - -Tests CLI command execution and error handling. - -``` -✅ Version/help ✅ Exit codes -✅ Output consistency ✅ Error handling -✅ Concurrent execution -``` - -**Running**: `npm test -- src/__tests__/integration/e2e-cli.test.ts` - ---- - -## Test Coverage Matrix - -### Configuration Options Tested - -| Category | Options | Total | -| --------------- | --------------------------------------------- | ----- | -| Runtime | Vite, Next.js | 2 | -| Language | TypeScript, JavaScript | 2 | -| Styling | Tailwind, Styled Components, CSS Modules, CSS | 4 | -| State | Zustand, Redux, Jotai, none | 4 | -| Unit Runner | Vitest, Jest | 2 | -| E2E Runner | Playwright, Cypress, none | 3 | -| Package Manager | npm, yarn, pnpm | 3 | -| Data Fetching | on, off | 2 | -| Git Init | on, off | 2 | - -**Theoretical Maximum**: 2 × 2 × 4 × 4 × 2 × 3 × 3 × 2 × 2 = **3,456 combinations** -**Critical Paths Tested**: 100+ - ---- - -## CI/CD Integration - -### Test Execution Pipeline - -``` -┌─────────────────────┐ -│ Push / PR / Main │ -└──────────┬──────────┘ - │ - ┌────▼────┐ - │ Matrix │ (Windows, macOS, Ubuntu) × (Node 20.x, 22.x) - │ 6 Jobs │ - └────┬────┘ - │ - ┌──────┴──────┬────────────┬────────────────┬──────────────┐ - │ │ │ │ │ - ▼ ▼ ▼ ▼ ▼ -┌────────┐ ┌─────────┐ ┌──────────┐ ┌──────────────┐ ┌──────┐ -│ Build │ │ Unit │ │ Integ │ │ Comprehensive│ │ E2E │ -│ Tests │ │ Tests │ │ Tests │ │ Tests │ │Tests │ -└────────┘ └─────────┘ └──────────┘ └──────────────┘ └──────┘ - │ │ │ │ │ - └─────────────┴────────────┴────────────────┴──────────────┘ - │ - ┌────▼─────┐ - │ Artifact │ - │ Upload │ - └───────────┘ -``` - ---- - -## Test Statistics - -### By Type - -| Type | Count | Focus | -| ----------------- | -------- | ---------------------- | -| Unit Tests | 70+ | Individual functions | -| Integration Tests | 60+ | Component interaction | -| Config Builder | 50+ | Configuration system | -| Template System | 40+ | Template loading | -| Generator | 50+ | Project generation | -| E2E Scenarios | 30+ | Real-world configs | -| Cross-Platform | 30+ | Platform compatibility | -| CLI E2E | 15+ | CLI commands | -| **Total** | **200+** | **All layers** | - -### By Coverage - -| Component | Coverage | Status | -| --------------- | -------- | ----------------- | -| Config System | 95%+ | ✅ Complete | -| Template System | 90%+ | ✅ Complete | -| Generator | 95%+ | ✅ Complete | -| CLI | 85%+ | ✅ Good | -| **Overall** | **95%+** | ✅ **Enterprise** | - -### By Platform - -| Platform | Test Count | Status | -| --------- | ---------- | --------- | -| Windows | 30+ | ✅ Tested | -| macOS | 30+ | ✅ Tested | -| Linux | 30+ | ✅ Tested | -| Node 20.x | 100+ | ✅ Tested | -| Node 22.x | 100+ | ✅ Tested | - ---- - -## Quality Gates - -### Pre-Commit Checks - -```bash -npm run lint -npm test -``` - -### Pre-Push Checks - -```bash -npm run test:coverage # Must be > 95% -npm run build # Must compile -npm test # All tests must pass -``` - -### Pre-Release Checks - -- ✅ All tests pass on all platforms -- ✅ Coverage > 95% -- ✅ No breaking changes -- ✅ All scenarios validated - ---- - -## Test Commands Quick Reference - -```bash -# Run all tests -npm test - -# Watch mode (rerun on file change) -npm run test:watch - -# Coverage report -npm run test:coverage - -# Cross-platform tests -npm run test:cross-platform - -# E2E CLI tests -npm run test:e2e - -# Specific test file -npm test -- config-builder-comprehensive.test.ts - -# Test with UI -npm run test:ui - -# Local full test suite -npm run test:local -``` - ---- - -## Test Maintenance - -### Adding Tests - -1. **Identify gap** in coverage -2. **Create test file** in appropriate layer -3. **Follow naming** convention: `[-comprehensive].test.ts` -4. **Add to CI** if integration/e2e test -5. **Document** test coverage - -### Updating Tests - -1. **Update unit tests** when modifying functions -2. **Update integration tests** when changing component interaction -3. **Update scenarios** when adding features -4. **Run coverage** to ensure > 95% - -### Debugging Tests - -```bash -# Verbose output -npm test -- --reporter=verbose - -# Single test -npm test -- --grep="test name pattern" - -# Debug mode -node --inspect-brk ./node_modules/vitest/vitest.mjs run --no-coverage -``` - ---- - -## Testing Best Practices - -### ✅ Do's - -- ✅ Test behavior, not implementation -- ✅ Use descriptive test names -- ✅ Group related tests -- ✅ Mock external dependencies -- ✅ Test edge cases -- ✅ Maintain > 95% coverage -- ✅ Run tests before committing -- ✅ Update tests with code changes - -### ❌ Don'ts - -- ❌ Test multiple things in one test -- ❌ Use hardcoded values in tests -- ❌ Skip flaky tests without fixing -- ❌ Ignore coverage drops -- ❌ Test implementation details -- ❌ Create brittle tests -- ❌ Run tests in random order -- ❌ Mix unit and integration tests - ---- - -## Continuous Improvement - -### Monitoring - -Monitor key metrics: - -- **Coverage Trend**: Should stay > 95% -- **Test Execution Time**: Should be < 10 minutes -- **Failure Rate**: Should be < 1% -- **Platform Issues**: Any OS-specific failures - -### Expansion Plan - -As features grow, add tests for: - -- New configuration options -- New runtime support -- New styling solutions -- New plugins -- New integrations -- Performance regressions - ---- - -## Documentation - -- **COMPREHENSIVE_TESTS.md** - Complete test guide -- **TEST_IMPLEMENTATION_COMPLETE.md** - Summary -- **CROSS_PLATFORM_TESTING.md** - Platform-specific -- **QUICK_START_TESTING.md** - Quick reference - ---- - -## Summary - -✅ **200+ test cases** across 6 layers -✅ **95%+ code coverage** maintained -✅ **200+ configuration combinations** tested -✅ **Cross-platform** validation (Windows, macOS, Linux) -✅ **Node 20.x & 22.x** compatibility -✅ **Automated CI/CD** on every commit -✅ **Enterprise-grade** quality assurance - ---- - -**Status**: 🎉 **PRODUCTION READY** diff --git a/TEST_IMPLEMENTATION_COMPLETE.md b/TEST_IMPLEMENTATION_COMPLETE.md deleted file mode 100644 index e959907..0000000 --- a/TEST_IMPLEMENTATION_COMPLETE.md +++ /dev/null @@ -1,283 +0,0 @@ -# 🎉 Comprehensive Test Suite - Implementation Complete - -## Summary - -✅ **4 New Comprehensive Test Files** added with **200+ test cases** -✅ **All tests integrated** into GitHub Actions CI/CD pipeline -✅ **Cross-platform testing** (Windows, macOS, Linux) with Node 20.x & 22.x -✅ **Real-world scenario testing** for all configuration combinations -✅ **Complete documentation** for test coverage and usage - ---- - -## What Was Added - -### 1️⃣ Config Builder Comprehensive Tests - -📁 File: `src/__tests__/config-builder-comprehensive.test.ts` - -- **Test Cases**: 50+ -- **Coverage**: 95%+ -- **Focus**: Configuration validation, fluent API, option combinations - -### 2️⃣ Template System Comprehensive Tests - -📁 File: `src/__tests__/template-system-comprehensive.test.ts` - -- **Test Cases**: 40+ -- **Coverage**: 90%+ -- **Focus**: Template loading, composition, styling, state management - -### 3️⃣ Generator Comprehensive Tests - -📁 File: `src/__tests__/generator-comprehensive.test.ts` - -- **Test Cases**: 50+ -- **Coverage**: 95%+ -- **Focus**: Project generation, file creation, dependencies - -### 4️⃣ E2E Scenario Tests - -📁 File: `src/__tests__/integration/e2e-scenarios.test.ts` - -- **Test Cases**: 30+ -- **Coverage**: 100% -- **Focus**: Real-world configurations (8 scenarios) - ---- - -## Test Scenarios Covered - -### 🚀 Real-World Configurations - -1. **Startup SPA** - - Vite + TypeScript + Tailwind + Zustand + Full Testing + TanStack Query - -2. **Enterprise Next.js** - - Next.js + TypeScript + Redux + Jest + Cypress + pnpm - -3. **Lightweight Project** - - Vite + JavaScript + CSS Modules (No Testing) - -4. **Component Library** - - Vite + TypeScript + Styled Components + Jest (Unit Only) - -5. **Data-Heavy App** - - Next.js + TypeScript + TanStack Query + Redux - -6. **Jotai-Based** - - Vite + TypeScript + Styled Components + Jotai - -7. **Multi-PM Support** - - Same config with npm, yarn, pnpm - -8. **All Options Combinations** - - 4 runtime+language × 4 styling × 4 state management - ---- - -## CI/CD Integration - -### ✅ Automated Test Execution - -Tests run automatically on: - -- **Every push** to `main` and `develop` -- **Every pull request** -- **6 OS/Node combinations**: Ubuntu + Windows + macOS × Node 20.x & 22.x - -### 📊 Test Execution Order - -``` -1. npm test (All unit tests) -2. npm test -- src/__tests__/integration/ (Integration tests) -3. npm test -- cross-platform-cli.test.ts (Platform compatibility) -4. npm test -- e2e-cli.test.ts (CLI commands) -5. npm test -- e2e-scenarios.test.ts (Real-world scenarios) -6. npm test -- config-builder-comprehensive.test.ts -7. npm test -- template-system-comprehensive.test.ts -8. npm test -- generator-comprehensive.test.ts -``` - ---- - -## Test Statistics - -| Metric | Value | -| ------------------------------- | ------------- | -| **Total Test Files** | 28 | -| **New Test Files** | 4 | -| **Total Test Cases** | 200+ | -| **Code Coverage** | 95%+ | -| **Configuration Combos Tested** | 100+ | -| **Real-World Scenarios** | 8 | -| **Cross-Platform Tests** | 6 (OS × Node) | - ---- - -## Running Tests Locally - -### Quick Start - -```bash -# Run all tests -npm test - -# Specific test suite -npm test -- config-builder-comprehensive.test.ts -npm test -- template-system-comprehensive.test.ts -npm test -- generator-comprehensive.test.ts -npm test -- src/__tests__/integration/e2e-scenarios.test.ts - -# Watch mode -npm run test:watch - -# Coverage report -npm run test:coverage -``` - ---- - -## Test Coverage Breakdown - -### Configuration System (50+ tests) - -✅ Fluent API chaining -✅ All runtime options (Vite, Next.js) -✅ All language options (TS, JS) -✅ All styling solutions (4 options) -✅ All state management (4 options) -✅ All test runners (Vitest, Jest, Playwright, Cypress) -✅ Package managers (npm, yarn, pnpm) -✅ Validation & merging - -### Template System (40+ tests) - -✅ Template loading for all runtimes -✅ Template composition -✅ Styling-specific templates -✅ State management templates -✅ Testing framework templates -✅ Complex combinations - -### Project Generator (50+ tests) - -✅ Basic generation -✅ Directory structure -✅ package.json creation -✅ Dependencies injection -✅ Documentation generation -✅ Runtime-specific setup - -### Real-World Scenarios (30+ tests) - -✅ 8 production-ready configurations -✅ All feature combinations -✅ Package manager support -✅ Quality assurance - ---- - -## What's Tested - -### ✅ Configuration Options - -- 2 Runtimes (Vite, Next.js) -- 2 Languages (TypeScript, JavaScript) -- 4 Styling Solutions -- 4 State Management Options -- 3 Unit Test Runners -- 3 E2E Test Runners -- 3 Package Managers -- Data Fetching (on/off) -- Git Init (on/off) - -### ✅ Project Generation - -- File creation -- Directory structure -- package.json validity -- Dependencies correctness -- Documentation generation -- TypeScript config -- Build config -- Test config - -### ✅ Cross-Platform Compatibility - -- Windows path handling -- macOS-specific issues -- Linux file permissions -- Line ending differences -- Case sensitivity - ---- - -## Documentation - -### 📖 Files Created/Updated - -- `COMPREHENSIVE_TESTS.md` - Complete testing guide -- `.github/workflows/cross-platform-tests.yml` - Updated with all tests -- `QUICK_START_TESTING.md` - Quick reference -- `CROSS_PLATFORM_TESTING.md` - Platform-specific info - ---- - -## Quality Assurance - -✅ **Pre-Release Validation**: All tests must pass -✅ **Platform Coverage**: Windows, macOS, Linux -✅ **Node Version Support**: 20.x & 22.x -✅ **Configuration Coverage**: 100+ combinations -✅ **Real-World Scenarios**: 8 production setups -✅ **Code Coverage**: 95%+ maintained - ---- - -## Key Features - -🎯 **Comprehensive**: 200+ test cases covering all major features -🚀 **Fast**: Complete test suite runs in < 10 minutes -🔄 **Automated**: Runs on every commit automatically -📊 **Measured**: 95%+ code coverage tracked -🌐 **Cross-Platform**: Tested on Windows, macOS, Linux -📝 **Well-Documented**: Complete testing guides provided - ---- - -## Success Criteria ✅ - -- [x] All tests pass on all platforms -- [x] 200+ test cases implemented -- [x] 95%+ code coverage maintained -- [x] Real-world scenarios validated -- [x] CI/CD fully integrated -- [x] Cross-platform compatibility verified -- [x] Documentation complete -- [x] All test types covered - ---- - -## Next Steps - -1. ✅ Review test coverage: `npm run test:coverage` -2. ✅ Run all tests: `npm test` -3. ✅ Verify CI/CD: Check GitHub Actions -4. ✅ Monitor quality: Keep tests green -5. ✅ Expand tests: Add more scenarios as features grow - ---- - -## Summary - -The create-react-forge project now has **enterprise-grade testing** with: - -- ✅ 200+ test cases -- ✅ 95%+ code coverage -- ✅ Cross-platform validation -- ✅ Real-world scenario testing -- ✅ Automated CI/CD pipeline -- ✅ Complete documentation - -**Status**: 🎉 **READY FOR PRODUCTION** diff --git a/renovate.json b/renovate.json index 377e97f..26be587 100644 --- a/renovate.json +++ b/renovate.json @@ -7,8 +7,9 @@ "dependencyDashboardApproval": false, "prCreation": "immediate", "prHourlyLimit": 0, - "prConcurrentLimit": 0, - "branchConcurrentLimit": 0, + "prConcurrentLimit": 3, + "branchConcurrentLimit": 3, + "rebaseWhen": "behind-base-branch", "recreateWhen": "always", "lockFileMaintenance": { "enabled": true, @@ -128,8 +129,19 @@ ], "packageRules": [ { - "description": "Automerge all dependency updates after checks pass", - "matchUpdateTypes": ["major", "minor", "patch", "pin", "digest"], + "description": "Never automerge major updates", + "matchUpdateTypes": ["major"], + "automerge": false + }, + { + "description": "Group non-major updates to reduce PR volume and conflict churn", + "matchUpdateTypes": ["minor", "patch", "pin", "digest"], + "groupName": "non-major dependencies", + "groupSlug": "non-major-dependencies" + }, + { + "description": "Automerge non-major dependency updates after checks pass", + "matchUpdateTypes": ["minor", "patch", "pin", "digest"], "automerge": true, "automergeType": "pr", "platformAutomerge": true