Package Exports
- ng-upgrade-orchestrator
- ng-upgrade-orchestrator/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (ng-upgrade-orchestrator) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Angular Multi-Version Upgrade Orchestrator
An enterprise-grade, intelligent multi-step upgrade orchestrator that safely migrates Angular applications across multiple major versions (12→13→14→...→20) by performing incremental upgrades, validating each step, handling breaking changes systematically, and ensuring zero functionality loss throughout the entire upgrade journey.
🚀 Key Highlights
✅ Enterprise-Ready: Battle-tested on production applications
✅ Zero Downtime: Maintains functionality during upgrades
✅ Official Migrations: Integrates all Angular CLI migrations
✅ Smart Rollback: Granular checkpoint system
✅ Third-Party Support: Handles Angular Material, NgRx, PrimeNG+
✅ TypeScript AST: Precise code transformations
Features
Core Capabilities
- Multi-Version Orchestration: Seamlessly upgrade through multiple Angular versions in sequence
- Intelligent Path Planning: Automatically determines the optimal upgrade path from current to target version
- Zero Functionality Loss: Prioritizes maintaining existing functionality over modernization
- Comprehensive Rollback System: Full application snapshots at each major version milestone
- Breaking Change Management: Systematic handling of breaking changes with automated fixes
- Third-Party Library Coordination: Synchronized updates for Angular Material, NgRx, PrimeNG, and more
Advanced Features
- Checkpoint System: Create restoration points at each upgrade milestone
- AST-Based Code Transformations: Precise code modifications using TypeScript AST
- Multi-Layer Compatibility: Allow old and new patterns to coexist during transitions
- Progressive Enhancement: Opt-in modernization without breaking existing functionality
- Comprehensive Validation: Build, test, and runtime validation at each step
Quick Start
Installation
npm install -g ng-upgrade-orchestratorBasic Usage
# Analyze your project
ng-upgrade analyze
# Upgrade to Angular 17
ng-upgrade upgrade --target 17
# Show upgrade plan without executing
ng-upgrade upgrade --target 20 --dry-run
# Conservative upgrade strategy
ng-upgrade upgrade --target 16 --strategy conservativeInteractive Mode
ng-upgrade upgradeThe CLI will guide you through:
- Target version selection
- Upgrade strategy configuration
- Validation level settings
- Confirmation and execution
Upgrade Strategies
Conservative Mode
- Maximum Safety: Minimal changes per version
- Compatibility First: Preserves all existing patterns
- Manual Opt-in: New features require explicit adoption
- Extensive Validation: Comprehensive testing at each step
Balanced Mode (Default)
- Moderate Modernization: Strategic updates with compatibility layers
- Smart Defaults: Sensible choices for most applications
- Gradual Enhancement: Progressive adoption of new features
- Balanced Validation: Essential checks with optional comprehensive testing
Progressive Mode
- Advanced Features: Enables cutting-edge Angular capabilities
- Modern Patterns: Migrates to latest best practices
- Performance Optimized: Leverages newest optimization features
- Future Ready: Prepares codebase for upcoming versions
CLI Commands
Upgrade Command
ng-upgrade upgrade [options]
Options:
-t, --target <version> Target Angular version (12-20)
-p, --path <path> Project path (default: current directory)
-s, --strategy <strategy> conservative|balanced|progressive (default: balanced)
--dry-run Show upgrade plan without executing
--no-backup Skip automatic backup creation
--validation <level> basic|comprehensive (default: basic)Analysis Command
ng-upgrade analyze [options]
Options:
-p, --path <path> Project path (default: current directory)Checkpoint Management
ng-upgrade checkpoints [options]
Options:
-p, --path <path> Project path (default: current directory)
--list List all checkpoints
--rollback <id> Rollback to specific checkpoint
--create <description> Create new checkpoint
--cleanup Clean up old checkpointsProject Analysis
The analyzer provides comprehensive insights:
ng-upgrade analyzeSample Output:
Analyzing Angular project
Analysis completed
Project Analysis Results:
Current Angular version: 12.2.0
Project type: Application
Build system: Angular CLI
Dependencies: 45 total, 3 require updates
Lines of code: 15,420
Components: 28
Services: 12
Risk level: Medium
Upgrade Recommendations:
- Update deprecated dependencies before upgrade
- Increase test coverage for better validation
- Consider incremental upgrade strategyCheckpoint System
Automatic Checkpoints
- Created before each major version upgrade
- Include complete project state and metadata
- Enable instant rollback to any point in upgrade journey
Manual Checkpoint Management
# List all checkpoints
ng-upgrade checkpoints --list
# Create manual checkpoint
ng-upgrade checkpoints --create "Before custom modifications"
# Rollback to specific checkpoint
ng-upgrade checkpoints --rollback checkpoint-id
# Cleanup old checkpoints
ng-upgrade checkpoints --cleanupSupported Angular Versions
| Version | Status | Key Features |
|---|---|---|
| 12 → 13 | Supported | Ivy renderer finalization, View Engine removal |
| 13 → 14 | Supported | Standalone components, Angular CLI auto-completion |
| 14 → 15 | Supported | Standalone APIs stable, Image directive |
| 15 → 16 | Supported | Required inputs, router data as input |
| 16 → 17 | Supported | New application bootstrap, SSR improvements |
| 17 → 18 | Supported | Material 3 support, built-in control flow |
| 18 → 19 | Supported | Zoneless change detection, event replay |
| 19 → 20 | Supported | Incremental hydration, advanced SSR |
Configuration
Upgrade Options
interface UpgradeOptions {
targetVersion: string;
strategy: 'conservative' | 'balanced' | 'progressive';
checkpointFrequency: 'every-step' | 'major-versions' | 'custom';
validationLevel: 'basic' | 'comprehensive';
thirdPartyHandling: 'automatic' | 'manual' | 'prompt';
rollbackPolicy: 'auto-on-failure' | 'manual' | 'never';
parallelProcessing: boolean;
}Safety Features
Zero Functionality Loss
- Compatibility-First Approach: Prioritizes maintaining existing functionality
- API Bridging: Creates bridge functions for deprecated APIs
- Gradual Migration: Allows mixed usage of old and new patterns
- Optional Modernization: New features are opt-in rather than forced
Multi-Version Safety Mechanisms
- Per-Version Validation: Comprehensive testing after each Angular version upgrade
- Cross-Version Compatibility: Runtime checks for deprecated APIs across versions
- Progressive Feature Adoption: Teams can adopt new features gradually
- Legacy Preservation: Maintains legacy code patterns until appropriate for modernization
Rollback Capabilities
- Granular Rollback: Rollback to any checkpoint in the upgrade sequence
- Automatic Recovery: Auto-rollback on failure if configured
- State Preservation: Maintains application state during rollbacks
- Dependency Synchronization: Rollback dependencies in sync with application state
Programmatic API
import { UpgradeOrchestrator } from 'ng-upgrade-orchestrator';
const orchestrator = new UpgradeOrchestrator('/path/to/project');
// Set up event listeners
orchestrator.on('progress', (report) => {
console.log(`Progress: ${report.message}`);
});
orchestrator.on('step-complete', (step) => {
console.log(`Completed: ${step.fromVersion} → ${step.toVersion}`);
});
// Execute upgrade
const result = await orchestrator.orchestrateUpgrade({
targetVersion: '17',
strategy: 'balanced',
checkpointFrequency: 'major-versions',
validationLevel: 'comprehensive',
thirdPartyHandling: 'automatic',
rollbackPolicy: 'auto-on-failure',
parallelProcessing: false
});
if (result.success) {
console.log('Upgrade completed successfully!');
} else {
console.error('Upgrade failed:', result.error);
}Breaking Changes Handled
Angular 12 → 13
- View Engine complete removal
- Angular Package Format changes
- Ivy renderer optimizations
Angular 13 → 14
- Standalone components introduction
- Optional injectors in ViewChild/ContentChild
- Angular CLI improvements
Angular 14 → 15
- Standalone APIs stabilization
- Image directive with optimization
- MDC-based Angular Material
Angular 15 → 16
- Required inputs API
- Router data as input
- New control flow syntax introduction
Angular 16 → 17
- New application bootstrap API
- Assets folder migration to public
- Control flow syntax stable
- SSR improvements
Angular 17 → 18
- Material 3 design system
- New lifecycle hooks
- Enhanced build optimizations
Angular 18 → 19
- Zoneless change detection (opt-in)
- Event replay for better UX
- Hybrid rendering capabilities
Angular 19 → 20
- Incremental hydration stable
- Signals ecosystem maturation
- Advanced SSR features
Best Practices
Before Upgrade
- Create Backup: Always create project backup before starting
- Update Dependencies: Resolve any known dependency conflicts
- Run Tests: Ensure all tests pass in current version
- Clean Build: Verify project builds successfully
- Commit Changes: Commit all pending changes to version control
During Upgrade
- Monitor Progress: Watch for any warnings or errors
- Validate Each Step: Don't skip validation phases
- Review Changes: Understand what each version brings
- Test Incrementally: Test application after major milestones
After Upgrade
- Run Full Test Suite: Comprehensive testing after completion
- Performance Check: Verify performance hasn't degraded
- Update Documentation: Update project documentation
- Team Training: Educate team on new features and patterns
Troubleshooting
Common Issues
Build Failures
# Check Node.js version compatibility
node --version
# Clear caches
npm run ng cache clean
rm -rf node_modules package-lock.json
npm installDependency Conflicts
# Analyze dependency tree
npm ls --depth=0
# Check for peer dependency warnings
npm install --dry-runRollback Issues
# List available checkpoints
ng-upgrade checkpoints --list
# Validate checkpoint integrity
ng-upgrade checkpoints --validate <checkpoint-id>Getting Help
- Generated API Documentation - Interactive documentation with search
- Documentation - Complete documentation index
- Issues
- Discussions
Contributing
We welcome contributions! Please see our Contributing Guide for details.
Development Setup
git clone https://github.com/ng-upgrade-orchestrator/ng-upgrade-orchestrator.git
cd ng-upgrade-orchestrator
npm install
npm run build
npm linkLicense
MIT License - see LICENSE file for details.
Acknowledgments
- Angular Team for the amazing framework
- Community contributors for feedback and improvements
- All the developers who helped test and refine the orchestrator
Built with love for the Angular community