# Analyze Source: https://docs.depfixer.com/cli/analyze Scan your project for dependency issues # Analyze Command The default `npx depfixer` command runs a smart analysis that scans your project and offers to fix any issues found. ## Usage ```bash theme={null} npx depfixer [options] ``` ## Options | Option | Description | | -------------- | ------------------------------------ | | `--path ` | Project directory (default: current) | | `--json` | Output as JSON | | `--ci` | CI mode with exit codes | ## How It Works ### 1. Free Audit First, DepFixer performs a free audit showing your health score and issues: ``` 📊 ANALYSIS REPORT ────────────────────────────────────────────────── 🏥 Health: [████████░░] 72/100 (WARNING) ⚠️ Issues: 10 Conflicts Found SEVERITY BREAKDOWN -------------------------------------------------- CRITICAL 1 issue require attention HIGH 3 issues with compatibility problems MEDIUM 2 issues with version conflicts LOW 4 issues to review + 2 missing peer dependencies to install. Unlock to see details and recommended fixes. 💡 DIAGNOSIS: Deep dependency graph conflicts detected. Manual resolution is likely to fail. 🔒 SOLUTION: ✓ Deterministic fix calculated. [?] Unlock recommended versions? ``` ### 2. Unlock Prompt A cost box shows the credit cost: ``` +--------------------------------------------------+ | | | COST TO ANALYZE: 15 CREDITS | | PLAN SIZE: Tier: Small | | | +--------------------------------------------------+ ``` ### 3. Full Solution (After Payment) Once paid, you see the complete fix with recommended versions: ``` 🔓 FULL ANALYSIS ────────────────────────────────────────────────── PACKAGE CURRENT TARGET TYPE --------------------------------------------------------------------------- @angular/core 16.0.0 17.3.0 Major @angular/cli 16.0.0 17.3.0 Major typescript 4.9.5 5.4.5 Major rxjs 7.5.0 7.8.1 Minor --------------------------------------------------------------------------- eslint - 8.57.0 Add ⚙️ Engine Requirements: • Node.js: >=18.13.0 📦 Packages to Add: + eslint Required as peer dependency by eslint-config-next (^8.0.0) ``` ## Issue Types Detected | Type | Description | | ----------------------------- | ------------------------------------------------------- | | **Peer Dependency Conflict** | Package requires a different version of another package | | **Missing Peer Dependency** | Required peer dependency not installed | | **Version Mismatch** | Packages in same ecosystem have incompatible versions | | **Deprecated Package** | Package is deprecated, replacement available | | **Framework Incompatibility** | Package version incompatible with your framework | ## JSON Output ```bash theme={null} npx depfixer --json ``` ```json theme={null} { "mode": "audit", "analysisId": "abc123", "healthScore": 72, "totalPackages": 45, "summary": { "critical": 1, "high": 3, "medium": 2, "low": 4 }, "issueCount": 10, "conflicts": [...], "framework": { "name": "angular", "version": "16.0.0" }, "cost": 15, "tierName": "Small" } ``` ## CI Mode ```bash theme={null} npx depfixer --ci ``` Requires `DEPFIXER_TOKEN` environment variable: ``` CI Mode - Dependency Analysis ──────────────────────────────────────── Health Score: 72/100 Total Packages: 45 Issues Found: 10 Critical: 1 High: 3 Medium: 2 Low: 4 Pipeline should fail - critical/high issues detected ``` Exit codes: * `0` - No critical/high issues * `1` - Critical or high issues found * `2` - Error (auth, network) ## Audit vs Full Mode | Feature | Audit (Free) | Full (Paid) | | ------------------------ | ------------ | ----------- | | Health score | ✓ | ✓ | | Issue count | ✓ | ✓ | | Severity breakdown | ✓ | ✓ | | Package names | Limited | ✓ | | **Recommended versions** | ✗ | ✓ | | **Apply fixes** | ✗ | ✓ | # CI Mode Source: https://docs.depfixer.com/cli/auth/ci-mode API key authentication for CI/CD pipelines # CI Mode Authentication For automated environments like CI/CD pipelines, DepFixer supports API key authentication via environment variables. ## Setup ### 1. Generate API Key 1. Log in to [app.depfixer.com](https://app.depfixer.com) 2. Go to **Settings** → **API Keys** 3. Click **Generate New Key** 4. Copy the key (shown only once) ### 2. Add to CI Environment Store the key as a secret in your CI platform. **GitHub Actions:** 1. Go to **Settings** → **Secrets and variables** → **Actions** 2. Click **New repository secret** 3. Name: `DEPFIXER_TOKEN` 4. Value: Your API key **GitLab CI:** 1. Go to **Settings** → **CI/CD** → **Variables** 2. Add variable with key `DEPFIXER_TOKEN` and mask it ### 3. Use in Pipeline ```bash theme={null} npx depfixer --ci ``` The CLI automatically uses `DEPFIXER_TOKEN` when `--ci` flag is present. ## GitHub Actions Example ```yaml theme={null} name: Dependency Check on: pull_request: paths: - 'package.json' - 'package-lock.json' jobs: check-deps: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Setup Node.js uses: actions/setup-node@v4 with: node-version: '20' - name: Check Dependencies run: npx depfixer --ci env: DEPFIXER_TOKEN: ${{ secrets.DEPFIXER_TOKEN }} ``` ## GitLab CI Example ```yaml theme={null} dependency-check: image: node:20 script: - npx depfixer --ci rules: - changes: - package.json - package-lock.json ``` ## Exit Codes | Code | Meaning | Pipeline | | ---- | ----------------------------- | -------- | | `0` | No critical/high issues | Pass | | `1` | Critical or high issues found | Fail | | `2` | Error (auth, network) | Fail | ## CI Output ``` CI Mode - Dependency Analysis ──────────────────────────────────────── Health Score: 72/100 Total Packages: 45 Issues Found: 10 Critical: 1 High: 3 Medium: 2 Low: 4 Pipeline should fail - critical/high issues detected ``` ## JSON Output For parsing in scripts: ```bash theme={null} npx depfixer --ci --json ``` ```json theme={null} { "success": true, "mode": "ci", "healthScore": 85, "totalPackages": 45, "summary": { "critical": 0, "high": 1, "medium": 3, "low": 2 }, "requiresAttention": true } ``` ## Security Best Practices 1. **Never commit API keys** - Use environment variables 2. **Rotate keys periodically** - Generate new keys quarterly 3. **One key per purpose** - Separate keys for CI, scripts, etc. 4. **Monitor usage** - Check key activity in dashboard # Device Code Flow Source: https://docs.depfixer.com/cli/auth/device-flow How CLI authentication works # Device Code Authentication DepFixer uses a device code flow for secure CLI authentication. This is the same pattern used by GitHub CLI, Vercel, and other modern developer tools. ## How It Works 1. **CLI requests code** - You run `npx depfixer login` 2. **Server generates code** - A unique verification code is created 3. **Browser opens** - You're taken to the verification page 4. **You authorize** - Enter the code and log in 5. **CLI receives token** - Access granted automatically ## Step by Step ### 1. Initiate Login ```bash theme={null} npx depfixer login ``` ### 2. Receive Verification Code ``` 🔐 DEVICE CODE LOGIN ────────────────────────────────────────────────── Your verification code: ABCD-1234 Opening browser to complete login... Waiting for authorization... ``` ### 3. Authorize in Browser In the browser: 1. Log in or create an account 2. Verify the code matches 3. Click "Authorize" ### 4. CLI Receives Token ``` ✓ Logged in successfully 👤 ACCOUNT DETAILS ──────────────────────────────────────── Name: John Doe Email: john@example.com Credits: 100 available ``` ## Security Benefits | Feature | Benefit | | ---------------------- | ------------------------------- | | **No password in CLI** | Password never touches terminal | | **Short-lived codes** | Codes expire in 15 minutes | | **User verification** | User must manually approve | | **Device binding** | Tokens tied to specific device | | **Revocable** | Revoke access anytime from web | ## Token Lifecycle * **Access Token**: 1 hour lifetime, auto-refreshes * **Refresh Token**: 30 days lifetime * **After 30 days**: Re-login required ## Manual Authorization If the browser doesn't open automatically: 1. Copy the URL from the terminal 2. Paste into any browser 3. Complete authorization 4. Return to CLI ## Troubleshooting ### Code Not Recognized The code may have expired (15 minute limit). Run `npx depfixer login` again. ### Polling Timeout The CLI polls for 5 minutes. If you didn't complete authorization in time, run login again. ### Network Issues Check your internet connection and try again. # Fix Source: https://docs.depfixer.com/cli/fix Apply fixes from a previous analysis # Fix Command The fix command applies fixes from a previous analysis without re-running the analysis. ## Usage ```bash theme={null} npx depfixer fix [options] ``` ## Options | Option | Description | | -------------- | ------------------------------------ | | `--path ` | Project directory (default: current) | ## How It Works ### Session Caching When you run `npx depfixer` and complete the payment but don't apply fixes, the session is saved: ``` .depfixer/ session.json # Stores analysis ID, payment status, file hash ``` ### Applying Fixes Later ```bash theme={null} npx depfixer fix ``` ``` Loading session... Session found: Analysis ID: abc123 Status: PAID Analyzed: 2 hours ago Fetching solution... 🔓 FULL ANALYSIS ────────────────────────────────────────────────── PACKAGE CURRENT TARGET TYPE --------------------------------------------------------------------------- @angular/core 16.0.0 17.3.0 Major typescript 4.9.5 5.4.5 Major Apply fix to package.json? (Enter/Esc) ``` ## Hash Verification DepFixer verifies your `package.json` hasn't changed since the analysis: ``` ⚠ Warning: package.json has been modified since analysis The fixes were calculated for a different version of your package.json. Applying them may cause unexpected results. Continue anyway? (Enter/Esc) ``` ## Session File Structure The session is stored in `.depfixer/session.json`: ```json theme={null} { "analysisId": "abc123-def456", "intent": "ANALYZE", "originalFileHash": "sha256:...", "cost": 15, "tierName": "Small", "status": "PAID", "timestamp": "2024-01-15T10:30:00Z" } ``` ## Use Cases ### Deferred Fixes 1. Run analysis during work hours 2. Review changes with team 3. Apply fixes during maintenance window ```bash theme={null} # Morning: Analyze npx depfixer # Pay but select "No" when asked to apply # Evening: Apply npx depfixer fix ``` ## Backup When fixes are applied, DepFixer creates a backup: ``` package.json.bak # Original package.json before fixes ``` To restore: ```bash theme={null} # Windows copy package.json.bak package.json # macOS/Linux cp package.json.bak package.json ``` ## Error Handling ### No Session Found ``` Error: No session found Run `npx depfixer` first to analyze your project. ``` ### Unpaid Session ``` Error: Analysis not paid The previous analysis was not completed. Run `npx depfixer` to continue. ``` # Login Source: https://docs.depfixer.com/cli/login Authenticate with DepFixer # Login Command The login command authenticates you with DepFixer using a secure device code flow. ## Usage ```bash theme={null} npx depfixer login ``` ## How It Works ### 1. Generate Code DepFixer generates a unique code for your device: ``` 🔐 DEVICE CODE LOGIN ────────────────────────────────────────────────── Your verification code: ABCD-1234 Opening browser to complete login... Waiting for authorization... ``` ### 2. Browser Authorization Your browser opens to the verification page where you: 1. Enter the code (auto-filled if you clicked the link) 2. Log in or create an account 3. Approve the CLI access ### 3. CLI Confirmation Once approved, the CLI confirms: ``` ✓ Logged in successfully 👤 ACCOUNT DETAILS ──────────────────────────────────────── Name: John Doe Email: john@example.com Credits: 100 available ``` ## Token Storage Credentials are stored securely at: ``` ~/.depfixer/credentials.json ``` File permissions are set to `0600` (owner read/write only). ## Token Refresh Tokens are automatically refreshed when: * Access token expires (1 hour lifetime) * You run any authenticated command You don't need to log in again unless: * You explicitly log out * Refresh token expires (30 days) * You revoke access from the web dashboard ## Troubleshooting ### Browser Doesn't Open Manually visit the URL shown in the terminal and enter the code. ### Code Expired Codes expire after 15 minutes. Run `npx depfixer login` again. ### Already Logged In If you're already logged in, you'll see your account info. Log out first with `npx depfixer logout` if you need to switch accounts. # Migrate Source: https://docs.depfixer.com/cli/migrate Upgrade your framework to a newer version # Migrate Command The migrate command helps you upgrade your framework (Angular, React, Vue) to a newer version with automatic dependency alignment. ## Usage ```bash theme={null} npx depfixer migrate [options] ``` ## Options | Option | Description | | -------------- | ------------------------------------ | | `--path ` | Project directory (default: current) | ## How It Works ### 1. Framework Detection DepFixer automatically detects your framework: ``` ██████╗ ███████╗ ██████╗ ███████╗██╗██╗ ██╗███████╗██████╗ ██╔══██╗ ██╔════╝ ██╔══██╗██╔════╝██║╚██╗██╔╝██╔════╝██╔══██╗ ██║ ██║ █████╗ ██████╔╝█████╗ ██║ ╚███╔╝ █████╗ ██████╔╝ ██║ ██║ ██╔══╝ ██╔═══╝ ██╔══╝ ██║ ██╔██╗ ██╔══╝ ██╔══██╗ ██████╔╝ ███████╗ ██║ ██║ ██║██╔╝ ██╗███████╗██║ ██║ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ Upgrade Fearlessly. We Handle the Rest. ⚡ DepFixer CLI v1.0.0 ────────────────────────────────────────────────── 📦 PROJECT: my-angular-app Framework: Angular 16.0.0 Fetching available versions... ``` ### 2. Version Selection Use arrow keys to select your target version: ``` Select target version: Angular 19 (Latest) -> 19.0.0 - Latest stable > Angular 18 (LTS) -> 18.2.0 - Long-term support Angular 17 -> 17.3.0 - Stable Up/Down Navigate Enter Select Esc Cancel ``` ### 3. Migration Plan Review what will change: ``` 🚀 MIGRATION PLAN: Angular 16 → 18 ────────────────────────────────────────────────── 📊 Projection: • Health: 65/100 → 95/100 (Estimated) • Packages: 12 updates • Breaking: ⚠️ 2 Major Changes PACKAGE CURRENT TARGET TYPE --------------------------------------------------------------------------- @angular/core 16.0.0 18.2.0 Major @angular/cli 16.0.0 18.2.0 Major @angular/compiler 16.0.0 18.2.0 Major typescript 4.9.5 5.4.5 Major zone.js 0.13.0 0.14.0 Minor rxjs 7.5.0 7.8.1 Patch +--------------------------------------------------+ | | | MIGRATION COST: 35 CREDITS | | PLAN SIZE: Tier: Standard | | | +--------------------------------------------------+ ``` ### 4. Apply Migration After confirmation and payment: ``` ✨ SUCCESS ────────────────────────────────────────────────── ✓ 12 Packages Updated ✓ Backup: package.json.bak 👉 NEXT STEP: Run the following command to finalize changes: $ npm install ``` ## Supported Migrations ### Angular | From | To | Notes | | ---- | ----- | ------------------------------- | | 12.x | 15-19 | Multi-version jump supported | | 13.x | 16-19 | TypeScript upgrade included | | 14.x | 17-19 | Standalone components available | | 15.x | 18-19 | Signals API available | | 16.x | 18-19 | Control flow syntax | | 17.x | 18-19 | Latest features | ### React | From | To | Notes | | ---- | ----- | ------------------------- | | 16.x | 17-19 | Concurrent mode available | | 17.x | 18-19 | Automatic batching | | 18.x | 19 | React Compiler ready | ### Vue | From | To | Notes | | ---- | ---- | --------------------------------- | | 2.x | 3.x | Composition API, major rewrite | | 3.0 | 3.4+ | Script setup, improved reactivity | ## What Gets Updated The migrate command updates: * **Core framework packages** - Main framework and related packages * **TypeScript** - Version compatible with target framework * **Build tools** - CLI, webpack plugins, etc. * **Ecosystem packages** - Router, state management, UI libraries * **Type definitions** - `@types/*` packages ## Migration vs Analyze | Feature | Analyze | Migrate | | ------------------ | ------- | ------- | | Fix current issues | Yes | No | | Upgrade framework | No | Yes | | Version selection | No | Yes | | Multi-version jump | No | Yes | **Tip:** Run `npx depfixer` (analyze) first to fix current issues, then use `migrate` to upgrade your framework version. # CLI Overview Source: https://docs.depfixer.com/cli/overview All DepFixer commands at a glance # CLI Overview ## Commands | Command | Description | Auth Required | | ---------------------- | ---------------------------------- | ---------------------- | | `npx depfixer` | Smart analysis with fix flow | No (audit) → Yes (fix) | | `npx depfixer migrate` | Interactive framework migration | Yes | | `npx depfixer fix` | Apply fixes from previous analysis | Yes | | `npx depfixer login` | Authenticate with DepFixer | No | | `npx depfixer logout` | Clear stored credentials | No | | `npx depfixer whoami` | Show account information | Yes | ## Global Options | Option | Description | | --------------- | ---------------------------------------------- | | `--path ` | Project directory (default: current directory) | | `--json` | Output results as JSON | | `--ci` | CI mode with exit codes | | `-v, --version` | Show version number | | `-h, --help` | Show help | ## Environment Variables | Variable | Description | | ---------------- | -------------------------------------------------------------- | | `DEPFIXER_TOKEN` | API key for CI/CD pipelines (see [CI Mode](/cli/auth/ci-mode)) | ## Exit Codes | Code | Meaning | | ---- | ------------------------------------------------ | | `0` | Success - no issues or all issues fixed | | `1` | Issues found (critical/high severity in CI mode) | | `2` | Critical error (auth failure, network error) | ## Examples ### Basic Analysis ```bash theme={null} # Analyze current directory npx depfixer # Analyze specific project npx depfixer --path ./my-project ``` ### CI Integration ```bash theme={null} # Run in CI with exit codes npx depfixer --ci # JSON output for parsing npx depfixer --json ``` ### Migration ```bash theme={null} # Interactive framework upgrade npx depfixer migrate ``` ### Authentication ```bash theme={null} # Log in npx depfixer login # Check account npx depfixer whoami # Log out npx depfixer logout ``` ## Requirements * **Node.js**: 18.0.0 or higher * **npm**: 8.0.0 or higher (for `npx`) ## GitHub Report bugs, request features, and join discussions on our GitHub: * [GitHub Repository](https://github.com/depfixer/CLI) * [Report a Bug](https://github.com/depfixer/CLI/issues/new?template=bug_report.md) * [Request a Feature](https://github.com/depfixer/CLI/issues/new?template=feature_request.md) **Open Source Roadmap**: We're planning to open-source the CLI in the future. Follow our GitHub for updates! # Whoami Source: https://docs.depfixer.com/cli/whoami Display current account information # Whoami Command The whoami command shows your current account information and credit balance. ## Usage ```bash theme={null} npx depfixer whoami ``` ## Output ``` 👤 ACCOUNT DETAILS ──────────────────────────────────────── Name: John Doe Email: john@example.com Credits: 100 available ``` ### With Active Pass If you have an active unlimited pass: ``` 👤 ACCOUNT DETAILS ──────────────────────────────────────── Name: John Doe Email: john@example.com Plan: 24H Unlimited Pass ✓ Credits: 100 available ``` ## Information Displayed | Field | Description | | ----------- | ------------------------------------- | | **Name** | Your account display name | | **Email** | Email address associated with account | | **Plan** | Active subscription pass (if any) | | **Credits** | Current credit balance | ## Not Logged In If you're not authenticated: ``` Not logged in Run `npx depfixer login` to authenticate. ``` ## Use Cases ### Check Balance Before Analysis ```bash theme={null} # Check credits npx depfixer whoami # If sufficient, run analysis npx depfixer ``` ### Verify Login After logging in on a new machine: ```bash theme={null} npx depfixer login # ... complete auth flow ... npx depfixer whoami # Verify correct account ``` # Angular Migration Guide Source: https://docs.depfixer.com/guides/angular-migration Step-by-step guide to upgrading Angular versions # Angular Migration Guide This guide walks you through upgrading your Angular application using DepFixer. ## Supported Migrations | Current Version | Target Versions | | --------------- | ------------------ | | Angular 12 | 15, 16, 17, 18, 19 | | Angular 13 | 16, 17, 18, 19 | | Angular 14 | 17, 18, 19 | | Angular 15 | 18, 19 | | Angular 16 | 18, 19 | | Angular 17 | 18, 19 | | Angular 18 | 19 | DepFixer supports multi-version jumps. You can go directly from Angular 12 to Angular 18. ## Before You Start ### 1. Check Current State ```bash theme={null} npx depfixer ``` Fix any existing issues before migrating. A clean health score makes migration smoother. ### 2. Commit Current Changes ```bash theme={null} git add -A git commit -m "chore: pre-migration checkpoint" ``` ## Migration Steps ### Step 1: Run Migration Command ```bash theme={null} npx depfixer migrate ``` ### Step 2: Select Target Version Use arrow keys to navigate and Enter to select: ``` Select target version: Angular 19 (Latest) -> 19.0.0 - Latest stable > Angular 18 (LTS) -> 18.2.0 - Long-term support Angular 17 -> 17.3.0 - Stable ``` ### Step 3: Review and Apply After payment, the migration is applied: ``` ✨ SUCCESS ────────────────────────────────────────────────── ✓ 12 Packages Updated ✓ Backup: package.json.bak 👉 NEXT STEP: Run the following command to finalize changes: $ npm install ``` ## Post-Migration Steps ### 1. Install Dependencies ```bash theme={null} npm install ``` ### 2. Run Angular Schematics (Optional) Some migrations require code changes: ```bash theme={null} ng update @angular/core @angular/cli ``` ### 3. Fix Any Remaining Issues ```bash theme={null} npx depfixer ng build ``` ## TypeScript Versions | Angular | TypeScript | | ------- | ---------- | | 19 | 5.5 - 5.6 | | 18 | 5.4 - 5.5 | | 17 | 5.2 - 5.4 | | 16 | 4.9 - 5.1 | | 15 | 4.8 - 4.9 | ## Version-Specific Changes ### Angular 16 → 17 * **Standalone by default** - Components are standalone unless specified * **New control flow** - `@if`, `@for`, `@switch` syntax * **Deferred loading** - `@defer` for lazy loading ### Angular 17 → 18 * **Zoneless support** - Experimental zoneless change detection * **Signal-based inputs** - `input()` function for reactive inputs * **New build system** - `application` builder with esbuild ### Angular 18 → 19 * **Incremental hydration** - Partial hydration for SSR * **Resource API** - Reactive data fetching primitives * **linkedSignal** - Derived signals with reset capability ## Rollback If migration fails, restore from backup: ```bash theme={null} # Restore package.json copy package.json.bak package.json # Windows cp package.json.bak package.json # macOS/Linux # Reinstall original dependencies npm install ``` # CI Integration Source: https://docs.depfixer.com/guides/ci-integration Add DepFixer to your CI/CD pipeline # CI Integration Automate dependency health checks in your CI/CD pipeline to catch issues before they reach production. ## Quick Start ### 1. Generate API Key Get your API key from [app.depfixer.com/settings/api-keys](https://app.depfixer.com/settings/api-keys) ### 2. Add Secret Store as `DEPFIXER_TOKEN` in your CI platform. ### 3. Add Step ```yaml theme={null} - run: npx depfixer --ci env: DEPFIXER_TOKEN: ${{ secrets.DEPFIXER_TOKEN }} ``` ## GitHub Actions ```yaml theme={null} name: Dependency Check on: pull_request: paths: - 'package.json' - 'package-lock.json' push: branches: [main] jobs: check-deps: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: actions/setup-node@v4 with: node-version: '20' - name: Check Dependencies run: npx depfixer --ci env: DEPFIXER_TOKEN: ${{ secrets.DEPFIXER_TOKEN }} ``` ## GitLab CI ```yaml theme={null} stages: - check dependency-check: stage: check image: node:20 script: - npx depfixer --ci rules: - changes: - package.json - package-lock.json ``` Add `DEPFIXER_TOKEN` in **Settings → CI/CD → Variables** ## Exit Codes | Code | Meaning | Pipeline | | ---- | ----------------------------- | -------- | | `0` | No critical/high issues | Pass | | `1` | Critical or high issues found | Fail | | `2` | Error (auth, network) | Fail | ## JSON Output For parsing in scripts: ```bash theme={null} npx depfixer --ci --json ``` ```json theme={null} { "mode": "ci", "healthScore": 85, "totalPackages": 45, "summary": { "critical": 0, "high": 1, "medium": 3, "low": 2 }, "requiresAttention": true } ``` ## Block PR on Low Score ```yaml theme={null} - name: Check Dependencies run: | RESULT=$(npx depfixer --ci --json) SCORE=$(echo $RESULT | jq '.healthScore') if [ "$SCORE" -lt 70 ]; then echo "Health score $SCORE is below threshold (70)" exit 1 fi env: DEPFIXER_TOKEN: ${{ secrets.DEPFIXER_TOKEN }} ``` ## Scheduled Audits ```yaml theme={null} name: Weekly Dependency Audit on: schedule: - cron: '0 9 * * 1' # Every Monday at 9am jobs: audit: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - name: Run Audit run: npx depfixer --ci env: DEPFIXER_TOKEN: ${{ secrets.DEPFIXER_TOKEN }} ``` ## Troubleshooting ### Token Not Found ``` Error: DEPFIXER_TOKEN not set ``` Ensure the secret is added to your CI platform and passed as an environment variable. ### Network Timeout Add retry logic: ```yaml theme={null} - name: Check Dependencies run: | for i in 1 2 3; do npx depfixer --ci && break || sleep 10 done env: DEPFIXER_TOKEN: ${{ secrets.DEPFIXER_TOKEN }} ``` # GitHub Action Source: https://docs.depfixer.com/guides/github-action Automatically check dependencies on every pull request ## Overview The DepFixer GitHub Action analyzes your project's dependencies on every pull request, posting a detailed report as a PR comment with health score, conflicts found, and fix commands. ## Quick Start ### 1. Get an API Key Go to [app.depfixer.com/dashboard/api-keys](https://app.depfixer.com/dashboard/api-keys) and create a new API key. ### 2. Add Secret to GitHub In your repository, go to **Settings > Secrets and variables > Actions > New repository secret**. * **Name**: `DEPFIXER_API_KEY` * **Value**: Your API key (starts with `dfx_live_`) ### 3. Create Workflow Add this file to your repository: ```yaml .github/workflows/depfixer.yml theme={null} name: Dependency Check on: [pull_request] jobs: depfixer: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: depfixer/action@v1 with: api-key: ${{ secrets.DEPFIXER_API_KEY }} ``` That's it! DepFixer will now check your dependencies on every PR. ## Configuration | Input | Description | Default | | ------------------- | ------------------------------------- | ---------------- | | `api-key` | Your DepFixer API key (required) | --- | | `fail-on-conflicts` | Fail the check if conflicts are found | `true` | | `package-json-path` | Path to package.json | `./package.json` | | `min-health-score` | Minimum health score to pass | `0` | | `post-comment` | Post results as PR comment | `true` | ## Outputs | Output | Description | | ----------------- | ----------------------------------- | | `health-score` | The dependency health score (0-100) | | `conflicts-count` | Number of conflicts found | | `exit-code` | 0 if passed, 1 if failed | ## Advanced Examples ### Fail on Low Health Score ```yaml theme={null} - uses: depfixer/action@v1 with: api-key: ${{ secrets.DEPFIXER_API_KEY }} min-health-score: 80 ``` ### Custom package.json Path (Monorepo) ```yaml theme={null} - uses: depfixer/action@v1 with: api-key: ${{ secrets.DEPFIXER_API_KEY }} package-json-path: ./packages/frontend/package.json ``` ### Run on Push to Main ```yaml theme={null} name: Dependency Check on: push: branches: [main] pull_request: jobs: depfixer: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: depfixer/action@v1 with: api-key: ${{ secrets.DEPFIXER_API_KEY }} ``` ### Scheduled Weekly Check ```yaml theme={null} name: Weekly Dependency Audit on: schedule: - cron: '0 9 * * 1' # Every Monday at 9 AM jobs: depfixer: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: depfixer/action@v1 with: api-key: ${{ secrets.DEPFIXER_API_KEY }} post-comment: false ``` ## PR Comment When `post-comment` is enabled, DepFixer posts a comment on the PR with: * Health score * Issue summary by severity (critical, high, medium, low) * Detailed conflict list (collapsible) * Fix commands (copy-paste ready) The comment is automatically updated on subsequent pushes to avoid spam. ## Usage Limits | Plan | Monthly Runs | | ---------- | ------------ | | Free | 50 | | Pro | 500 | | Enterprise | Unlimited | View your usage at [app.depfixer.com/dashboard/api-keys](https://app.depfixer.com/dashboard/api-keys). ## Troubleshooting ### "Invalid or expired API key" Verify your secret is set correctly. The key should start with `dfx_live_`. ### "Run limit exceeded" You've reached your monthly limit. Upgrade your plan or wait for the monthly reset. ### Action doesn't post comment Ensure the workflow has `pull_request` trigger and the `post-comment` input is `true` (default). # MCP Server Source: https://docs.depfixer.com/guides/mcp-setup Use DepFixer tools directly in Claude Code, Cursor, and Windsurf ## Overview The DepFixer MCP (Model Context Protocol) server lets AI coding assistants analyze your dependencies, check compatibility, and plan migrations -- all from within your IDE. ## Setup ### Claude Code Add to your project's `.claude/settings.json` or global settings: ```json theme={null} { "mcpServers": { "depfixer": { "command": "npx", "args": ["@depfixer/mcp-server"], "env": { "DEPFIXER_API_KEY": "dfx_live_YOUR_KEY" } } } } ``` ### Cursor Add to `.cursor/mcp.json` in your project root: ```json theme={null} { "mcpServers": { "depfixer": { "command": "npx", "args": ["@depfixer/mcp-server"], "env": { "DEPFIXER_API_KEY": "dfx_live_YOUR_KEY" } } } } ``` ### Windsurf Add to your Windsurf MCP configuration: ```json theme={null} { "mcpServers": { "depfixer": { "command": "npx", "args": ["@depfixer/mcp-server"], "env": { "DEPFIXER_API_KEY": "dfx_live_YOUR_KEY" } } } } ``` The API key is optional. Without it, you get audit-mode analysis (issues found but no fix recommendations). With an API key, you get full analysis + migration planning. Get your API key at [app.depfixer.com/dashboard/api-keys](https://app.depfixer.com/dashboard/api-keys). ## Available Tools ### depfixer\_analyze Analyze a package.json for dependency conflicts and health issues. **Input:** * `packageJson` (string): The raw contents of a package.json file **Output:** Health score, issue summary, conflict details, and fix commands. **Example prompt:** "Analyze my package.json for dependency issues" ### depfixer\_check\_compatibility Check if a specific package version is compatible with your framework. **Input:** * `packageName` (string): The npm package name * `packageVersion` (string): The version to check * `framework` (string): Framework name (angular, react) * `frameworkVersion` (string): Your framework version **Output:** Compatible/not compatible, reason, and recommended version. **Example prompt:** "Is @angular/material 17.0.0 compatible with Angular 16?" ### depfixer\_migrate Plan a framework migration with health score projections. **Input:** * `packageJson` (string): The raw contents of a package.json file * `targetFramework` (string): Target framework name * `targetVersion` (string): Target version **Output:** Before/after health scores, packages to update, breaking changes, and commands. **Example prompt:** "Plan a migration from Angular 16 to Angular 18" The migrate tool requires an API key. Without one, it will return an error with instructions to set up authentication. ## Environment Variables | Variable | Description | Default | | ------------------ | --------------------- | --------------------------------- | | `DEPFIXER_API_URL` | API endpoint URL | `https://api.depfixer.com/api/v1` | | `DEPFIXER_API_KEY` | Your DepFixer API key | --- (optional) | ## Local Development To test with a local DepFixer server: ```json theme={null} { "mcpServers": { "depfixer": { "command": "npx", "args": ["@depfixer/mcp-server"], "env": { "DEPFIXER_API_URL": "http://localhost:3000/api/v1", "DEPFIXER_API_KEY": "dfx_live_YOUR_KEY" } } } } ``` ## Troubleshooting ### "API key required" Some tools (migrate) require an API key. Add `DEPFIXER_API_KEY` to your MCP config env. ### Tools not appearing Restart your IDE after changing MCP configuration. Check that `npx @depfixer/mcp-server` runs without errors. ### Connection timeout The analysis may take 10-30 seconds for large projects. If timeouts persist, check your network connection. # React Upgrade Guide Source: https://docs.depfixer.com/guides/react-upgrade Step-by-step guide to upgrading React versions # React Upgrade Guide This guide walks you through upgrading your React application using DepFixer. ## Supported Upgrades | Current Version | Target Versions | | --------------- | --------------- | | React 16 | 17, 18, 19 | | React 17 | 18, 19 | | React 18 | 19 | ## Before You Start ### 1. Check Current State ```bash theme={null} npx depfixer ``` Fix any existing issues before upgrading. ### 2. Commit Current Changes ```bash theme={null} git add -A git commit -m "chore: pre-upgrade checkpoint" ``` ## Upgrade Steps ### Step 1: Run Migration Command ```bash theme={null} npx depfixer migrate ``` ### Step 2: Select Target Version ``` Select target version: > React 19 (Latest) -> 19.0.0 - Latest stable React 18 (LTS) -> 18.3.0 - Long-term support ``` ### Step 3: Apply After payment: ``` ✨ SUCCESS ────────────────────────────────────────────────── ✓ 8 Packages Updated ✓ Backup: package.json.bak 👉 NEXT STEP: Run the following command to finalize changes: $ npm install ``` ## Post-Upgrade Steps ### 1. Install Dependencies ```bash theme={null} npm install ``` ### 2. Update Entry Point (React 18+) If upgrading from React 17 or earlier: ```tsx theme={null} // Old (React 17) import ReactDOM from 'react-dom'; ReactDOM.render(, document.getElementById('root')); // New (React 18+) import { createRoot } from 'react-dom/client'; const root = createRoot(document.getElementById('root')!); root.render(); ``` ### 3. Fix TypeScript Errors ```bash theme={null} npx tsc --noEmit ``` ## React 17 → 18 Changes ### Automatic Batching React 18 batches all state updates, not just those in event handlers: ```tsx theme={null} // React 17: Two renders // React 18: One render (batched) setTimeout(() => { setCount(c => c + 1); setFlag(f => !f); }, 1000); ``` ### Strict Mode React 18 Strict Mode mounts/unmounts components twice in development: ```tsx theme={null} useEffect(() => { const subscription = subscribe(); return () => subscription.unsubscribe(); // Must clean up! }, []); ``` ## React 18 → 19 Changes ### New JSX Transform Required ```json theme={null} // tsconfig.json { "compilerOptions": { "jsx": "react-jsx" } } ``` ### ref as Prop React 19 passes `ref` as a normal prop: ```tsx theme={null} // React 18 const Input = forwardRef((props, ref) => ( )); // React 19 (forwardRef not needed) function Input({ ref, ...props }) { return ; } ``` ## Rollback If upgrade fails: ```bash theme={null} cp package.json.bak package.json rm -rf node_modules npm install ``` # Introduction Source: https://docs.depfixer.com/introduction Fix JavaScript dependency conflicts in seconds # What is DepFixer? DepFixer is a CLI tool that analyzes your JavaScript/TypeScript projects for dependency conflicts and provides intelligent fixes. ## Key Features * **Analyze** - Scan your package.json for version conflicts, missing peer dependencies, and compatibility issues * **Fix** - Get recommended version updates that resolve all conflicts while maintaining compatibility * **Migrate** - Upgrade your framework (Angular, React, Vue) to newer versions with automatic dependency alignment * **CI Ready** - Run in CI/CD pipelines with JSON output and exit codes for automated quality gates * **GitHub Action** - Automated dependency checks on every PR with health scores and fix commands ([setup guide](/guides/github-action)) * **MCP Server** - Dependency analysis inside Claude Code, Cursor, and Windsurf via the Model Context Protocol ([setup guide](/guides/mcp-setup)) ## Supported Frameworks * **Angular** 9 - 20 * **React** 16 - 19 * **Vue** 2 - 3 ## How It Works 1. **Analyze** - DepFixer reads your `package.json` and checks each dependency against our database of 1M+ packages 2. **Detect** - We identify peer dependency conflicts, version mismatches, deprecated packages, and framework incompatibilities 3. **Resolve** - Our engine calculates the optimal set of version updates that satisfy all constraints 4. **Apply** - One command updates your `package.json` with the fixes ## Why DepFixer? * **Redis-first architecture** - Instant analysis with no database queries during scans * **Framework-aware** - Understands Angular, React, Vue ecosystem rules * **Battle-tested** - 60+ test fixtures covering real-world scenarios * **Pay-per-use** - Credit-based pricing, no subscriptions required ## Quick Start ```bash theme={null} # Using npx (no install required) npx depfixer # Or install globally npm install -g depfixer depfixer ``` Run the command in your project directory and DepFixer will analyze your dependencies and guide you through fixing any issues. # Credits Source: https://docs.depfixer.com/pricing/credits Understanding the DepFixer credit system # Credit System DepFixer uses a pay-per-use credit system. You only pay for what you use. ## How It Works 1. **Audit is free** - Run `npx depfixer` unlimited times to see issues 2. **Fixes cost credits** - Pay credits to unlock solutions 3. **Credits never expire** - Use them whenever you need ## Credit Costs Credits are based on project size (number of packages): | Project Size | Packages | Credits | | -------------- | --------- | ------- | | **Micro** | 0 - 24 | 5 | | **Small** | 25 - 49 | 15 | | **Standard** | 50 - 99 | 35 | | **Heavy** | 100 - 149 | 55 | | **Large** | 150 - 499 | 85 | | **Enterprise** | 500 - 999 | 150 | | **Titan** | 1000+ | 250 | Package count includes both `dependencies` and `devDependencies`. ## Example A typical Angular project with 75 packages: ``` +--------------------------------------------------+ | | | COST TO ANALYZE: 35 CREDITS | | PLAN SIZE: Tier: Standard | | | +--------------------------------------------------+ ``` ## When Are Credits Deducted? Credits are deducted **only when you unlock solutions**: 1. Run `npx depfixer` - **Free** (shows issues) 2. Press Enter to unlock - **Free** (login prompt) 3. Complete login - **Free** 4. Confirm unlock - **Credits deducted** 5. Apply fixes - **Free** (already paid) ## Checking Balance ```bash theme={null} npx depfixer whoami ``` ``` 👤 ACCOUNT DETAILS ──────────────────────────────────────── Name: John Doe Email: john@example.com Credits: 100 available ``` ## Buying Credits Purchase credit packs at [app.depfixer.com/pricing](https://app.depfixer.com/pricing) | Pack | Credits | Price | | ---------- | ------- | ----- | | Starter | 50 | \$5 | | Developer | 200 | \$15 | | Team | 500 | \$30 | | Enterprise | 2000 | \$100 | ## Tips to Save Credits 1. **Fix issues first** - Run free audit, manually fix easy issues, then pay for remaining 2. **Use passes for regular work** - Unlimited passes pay off after 3-4 Standard projects/month 3. **Batch fixes** - Analyze all your projects, then fix them together # Pricing Tiers Source: https://docs.depfixer.com/pricing/tiers DepFixer pricing plans # Pricing Tiers Choose the plan that works best for you. ## Free Tier **\$0 - Forever free** **Included:** * Unlimited audits * Health score * Issue detection * Severity breakdown **Not Included:** * Recommended versions * Auto-fix * Migration planning Perfect for checking project health and evaluating DepFixer. ```bash theme={null} npx depfixer # Always free to see issues ``` ## Pay-Per-Use **Buy credits, use when needed** | Pack | Credits | Price | Per Credit | | ---------- | ------- | ----- | ---------- | | Starter | 50 | \$5 | \$0.10 | | Developer | 200 | \$15 | \$0.075 | | Team | 500 | \$30 | \$0.06 | | Enterprise | 2000 | \$100 | \$0.05 | **Credit costs by project size:** | Size | Packages | Credits | | ---------- | -------- | ------- | | Micro | 0-24 | 5 | | Small | 25-49 | 15 | | Standard | 50-99 | 35 | | Heavy | 100-149 | 55 | | Large | 150-499 | 85 | | Enterprise | 500-999 | 150 | | Titan | 1000+ | 250 | Perfect for occasional fixes and one-time cleanups. ## Unlimited Pass **\$19/month - Unlimited usage** **Everything in Free, plus:** * Unlimited fixes * Unlimited migrations * Priority analysis * Email support **Break-even:** \~2-3 Standard projects/month Perfect for freelancers and regular maintenance. ## Feature Comparison | Feature | Free | Pay-Per-Use | Unlimited | | -------------------- | ---- | ----------- | --------- | | Audit | ✓ | ✓ | ✓ | | Health Score | ✓ | ✓ | ✓ | | Issue Detection | ✓ | ✓ | ✓ | | Recommended Versions | ✗ | ✓ | ✓ | | Auto-Fix | ✗ | ✓ | ✓ | | Migration | ✗ | ✓ | ✓ | | CI Mode | ✗ | ✓ | ✓ | ## FAQ **Do credits expire?** No, credits never expire. Use them whenever you need. **Can I switch plans?** Yes, upgrade or downgrade anytime. **What payment methods are accepted?** All major credit cards via Stripe. **Is there a free trial?** The free tier is unlimited. You can audit as many projects as you want before paying. **What counts as a package?** Every entry in `dependencies` and `devDependencies` counts as one package. ## Get Started ```bash theme={null} npx depfixer ``` Try the free audit, then decide if you need credits or an unlimited pass. # Quickstart Source: https://docs.depfixer.com/quickstart Get started with DepFixer in 30 seconds # Quickstart ## Prerequisites * Node.js 18 or higher * A JavaScript/TypeScript project with a `package.json` ## Installation ### Option 1: Use npx (no install) ```bash theme={null} npx depfixer ``` ### Option 2: Install globally ```bash theme={null} npm install -g depfixer ``` Then run: ```bash theme={null} depfixer ``` ## Step 1: Run DepFixer Open your terminal in your project directory and run `depfixer` (or `npx depfixer`). ## Step 2: Review the Analysis DepFixer will display the ASCII logo and scan your dependencies: ``` ██████╗ ███████╗ ██████╗ ███████╗██╗██╗ ██╗███████╗██████╗ ██╔══██╗ ██╔════╝ ██╔══██╗██╔════╝██║╚██╗██╔╝██╔════╝██╔══██╗ ██║ ██║ █████╗ ██████╔╝█████╗ ██║ ╚███╔╝ █████╗ ██████╔╝ ██║ ██║ ██╔══╝ ██╔═══╝ ██╔══╝ ██║ ██╔██╗ ██╔══╝ ██╔══██╗ ██████╔╝ ███████╗ ██║ ██║ ██║██╔╝ ██╗███████╗██║ ██║ ╚═════╝ ╚══════╝ ╚═╝ ╚═╝ ╚═╝╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ Dependency Hell? We've Got the Cure. ⚡ DepFixer CLI v1.0.0 ────────────────────────────────────────────────── 📦 PROJECT: my-angular-app Framework: Angular ✓ Analysis complete 📊 ANALYSIS REPORT ────────────────────────────────────────────────── 🏥 Health: [████████░░] 72/100 (WARNING) ⚠️ Issues: 10 Conflicts Found ``` ## Step 3: Review Issues For smaller issue counts, you'll see a severity breakdown: ``` SEVERITY BREAKDOWN -------------------------------------------------- CRITICAL 1 issue require attention HIGH 3 issues with compatibility problems MEDIUM 2 issues with version conflicts LOW 4 issues to review Unlock to see details and recommended fixes. ``` ## Step 4: Unlock Solutions If issues are found, you'll see a cost box: ``` +--------------------------------------------------+ | | | COST TO ANALYZE: 15 CREDITS | | PLAN SIZE: Tier: Small | | | +--------------------------------------------------+ [?] Continue to login? (Enter/Esc) ``` Press `Enter` to proceed. ## Step 5: Authenticate First-time users will see the device code flow: ``` 🔐 DEVICE CODE LOGIN ────────────────────────────────────────────────── Your verification code: ABCD-1234 Opening browser to complete login... Waiting for authorization... ``` Enter the code in your browser to authenticate. ## Step 6: Apply Fixes Once authenticated with sufficient credits, you'll see the full solution: ``` 🔓 FULL ANALYSIS ────────────────────────────────────────────────── PACKAGE CURRENT TARGET TYPE --------------------------------------------------------------------------- @angular/core 16.0.0 17.3.0 Major @angular/cli 16.0.0 17.3.0 Major typescript 4.9.5 5.4.5 Major rxjs 7.5.0 7.8.1 Minor ──────────────────────────────────────── 📝 Only package.json will be modified 💾 A backup (package.json.bak) will be created ──────────────────────────────────────── Apply fix to package.json? (Enter/Esc) ``` Press `Enter` to apply. ## Step 7: Done! ``` ✨ SUCCESS ────────────────────────────────────────────────── ✓ 4 Packages Updated ✓ Backup: package.json.bak 👉 NEXT STEP: Run the following command to finalize changes: $ npm install ``` Run `npm install` to install the updated dependencies. ## Other Ways to Use DepFixer ### GitHub Action Automatically check dependencies on every pull request: ```yaml .github/workflows/depfixer.yml theme={null} name: Dependency Check on: [pull_request] jobs: depfixer: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 - uses: depfixer/action@v1 with: api-key: ${{ secrets.DEPFIXER_API_KEY }} ``` See the [GitHub Action guide](/guides/github-action) for full configuration options. ### MCP Server (AI IDE Integration) Use DepFixer tools directly in Claude Code, Cursor, or Windsurf: ```bash theme={null} npx @depfixer/mcp-server ``` Then ask your AI assistant: "Analyze my package.json for dependency issues" See the [MCP Server guide](/guides/mcp-setup) for setup instructions.