@zimezone/z-command 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -1
- package/dist/commands/init.d.ts.map +1 -1
- package/dist/commands/init.js +34 -9
- package/dist/commands/init.js.map +1 -1
- package/package.json +8 -3
- package/templates.zip +0 -0
- package/templates/agents/accessibility-expert.agent.md +0 -56
- package/templates/agents/ai-engineer.agent.md +0 -61
- package/templates/agents/angular-architect.agent.md +0 -49
- package/templates/agents/api-designer.agent.md +0 -40
- package/templates/agents/api-documenter.agent.md +0 -161
- package/templates/agents/architect-review.agent.md +0 -146
- package/templates/agents/arm-cortex-expert.agent.md +0 -288
- package/templates/agents/azure-infra-engineer.agent.md +0 -57
- package/templates/agents/backend-architect.agent.md +0 -309
- package/templates/agents/backend-developer.agent.md +0 -61
- package/templates/agents/backend-security-coder.agent.md +0 -152
- package/templates/agents/bash-pro.agent.md +0 -285
- package/templates/agents/blockchain-developer.agent.md +0 -57
- package/templates/agents/build-engineer.agent.md +0 -56
- package/templates/agents/business-analyst.agent.md +0 -47
- package/templates/agents/c-pro.agent.md +0 -35
- package/templates/agents/c4-code.agent.md +0 -320
- package/templates/agents/c4-component.agent.md +0 -227
- package/templates/agents/c4-container.agent.md +0 -248
- package/templates/agents/c4-context.agent.md +0 -235
- package/templates/agents/cli-developer.agent.md +0 -57
- package/templates/agents/cloud-architect.agent.md +0 -56
- package/templates/agents/code-architect.agent.md +0 -63
- package/templates/agents/code-reviewer.agent.md +0 -49
- package/templates/agents/competitive-analyst.agent.md +0 -48
- package/templates/agents/conductor-validator.agent.md +0 -245
- package/templates/agents/context-manager.agent.md +0 -55
- package/templates/agents/cpp-pro.agent.md +0 -59
- package/templates/agents/csharp-developer.agent.md +0 -57
- package/templates/agents/csharp-pro.agent.md +0 -38
- package/templates/agents/customer-support.agent.md +0 -148
- package/templates/agents/data-engineer.agent.md +0 -55
- package/templates/agents/data-researcher.agent.md +0 -55
- package/templates/agents/data-scientist.agent.md +0 -56
- package/templates/agents/database-admin.agent.md +0 -142
- package/templates/agents/database-administrator.agent.md +0 -50
- package/templates/agents/database-architect.agent.md +0 -238
- package/templates/agents/database-optimizer.agent.md +0 -144
- package/templates/agents/debugger.agent.md +0 -30
- package/templates/agents/deployment-engineer.agent.md +0 -0
- package/templates/agents/devops-engineer.agent.md +0 -59
- package/templates/agents/devops-troubleshooter.agent.md +0 -138
- package/templates/agents/django-developer.agent.md +0 -50
- package/templates/agents/django-pro.agent.md +0 -159
- package/templates/agents/docs-architect.agent.md +0 -77
- package/templates/agents/documentation-engineer.agent.md +0 -57
- package/templates/agents/dotnet-architect.agent.md +0 -175
- package/templates/agents/dx-optimizer.agent.md +0 -63
- package/templates/agents/electron-pro.agent.md +0 -56
- package/templates/agents/elixir-pro.agent.md +0 -38
- package/templates/agents/embedded-systems.agent.md +0 -55
- package/templates/agents/error-detective.agent.md +0 -32
- package/templates/agents/event-sourcing-architect.agent.md +0 -42
- package/templates/agents/fastapi-pro.agent.md +0 -171
- package/templates/agents/fintech-engineer.agent.md +0 -57
- package/templates/agents/firmware-analyst.agent.md +0 -330
- package/templates/agents/flutter-expert.agent.md +0 -50
- package/templates/agents/frontend-developer.agent.md +0 -59
- package/templates/agents/frontend-security-coder.agent.md +0 -149
- package/templates/agents/fullstack-developer.agent.md +0 -46
- package/templates/agents/git-workflow-manager.agent.md +0 -57
- package/templates/agents/golang-pro.agent.md +0 -50
- package/templates/agents/graphql-architect.agent.md +0 -48
- package/templates/agents/haskell-pro.agent.md +0 -37
- package/templates/agents/hr-pro.agent.md +0 -105
- package/templates/agents/incident-responder.agent.md +0 -190
- package/templates/agents/ios-developer.agent.md +0 -198
- package/templates/agents/iot-engineer.agent.md +0 -56
- package/templates/agents/java-architect.agent.md +0 -48
- package/templates/agents/java-pro.agent.md +0 -156
- package/templates/agents/javascript-pro.agent.md +0 -35
- package/templates/agents/julia-pro.agent.md +0 -187
- package/templates/agents/kotlin-specialist.agent.md +0 -50
- package/templates/agents/laravel-specialist.agent.md +0 -50
- package/templates/agents/legacy-modernizer.agent.md +0 -56
- package/templates/agents/legal-advisor.agent.md +0 -49
- package/templates/agents/llm-architect.agent.md +0 -58
- package/templates/agents/malware-analyst.agent.md +0 -272
- package/templates/agents/mcp-developer.agent.md +0 -54
- package/templates/agents/mermaid-expert.agent.md +0 -39
- package/templates/agents/microservices-architect.agent.md +0 -47
- package/templates/agents/minecraft-bukkit-pro.agent.md +0 -104
- package/templates/agents/ml-engineer.agent.md +0 -56
- package/templates/agents/mlops-engineer.agent.md +0 -56
- package/templates/agents/mobile-developer.agent.md +0 -45
- package/templates/agents/mobile-security-coder.agent.md +0 -163
- package/templates/agents/monorepo-architect.agent.md +0 -44
- package/templates/agents/multi-agent-coordinator.agent.md +0 -55
- package/templates/agents/network-engineer.agent.md +0 -57
- package/templates/agents/nextjs-developer.agent.md +0 -48
- package/templates/agents/nlp-engineer.agent.md +0 -58
- package/templates/agents/observability-engineer.agent.md +0 -228
- package/templates/agents/payment-integration.agent.md +0 -56
- package/templates/agents/performance-engineer.agent.md +0 -167
- package/templates/agents/performance-optimizer.agent.md +0 -57
- package/templates/agents/php-pro.agent.md +0 -43
- package/templates/agents/platform-engineer.agent.md +0 -57
- package/templates/agents/posix-shell-pro.agent.md +0 -284
- package/templates/agents/postgres-pro.agent.md +0 -58
- package/templates/agents/product-manager.agent.md +0 -55
- package/templates/agents/project-manager.agent.md +0 -57
- package/templates/agents/prompt-engineer.agent.md +0 -58
- package/templates/agents/python-pro.agent.md +0 -48
- package/templates/agents/quant-analyst.agent.md +0 -32
- package/templates/agents/rails-expert.agent.md +0 -50
- package/templates/agents/react-specialist.agent.md +0 -49
- package/templates/agents/refactoring-specialist.agent.md +0 -56
- package/templates/agents/reference-builder.agent.md +0 -167
- package/templates/agents/research-analyst.agent.md +0 -63
- package/templates/agents/reverse-engineer.agent.md +0 -202
- package/templates/agents/risk-manager.agent.md +0 -41
- package/templates/agents/ruby-pro.agent.md +0 -35
- package/templates/agents/rust-pro.agent.md +0 -156
- package/templates/agents/sales-automator.agent.md +0 -35
- package/templates/agents/scala-pro.agent.md +0 -60
- package/templates/agents/scrum-master.agent.md +0 -54
- package/templates/agents/search-specialist.agent.md +0 -59
- package/templates/agents/security-analyst.agent.md +0 -57
- package/templates/agents/security-auditor.agent.md +0 -138
- package/templates/agents/security-engineer.agent.md +0 -57
- package/templates/agents/seo-authority-builder.agent.md +0 -116
- package/templates/agents/seo-cannibalization-detector.agent.md +0 -103
- package/templates/agents/seo-content-auditor.agent.md +0 -63
- package/templates/agents/seo-content-planner.agent.md +0 -88
- package/templates/agents/seo-content-refresher.agent.md +0 -98
- package/templates/agents/seo-content-writer.agent.md +0 -76
- package/templates/agents/seo-keyword-strategist.agent.md +0 -75
- package/templates/agents/seo-meta-optimizer.agent.md +0 -72
- package/templates/agents/seo-snippet-hunter.agent.md +0 -94
- package/templates/agents/seo-specialist.agent.md +0 -57
- package/templates/agents/seo-structure-architect.agent.md +0 -88
- package/templates/agents/service-mesh-expert.agent.md +0 -41
- package/templates/agents/sql-pro.agent.md +0 -146
- package/templates/agents/sre-engineer.agent.md +0 -58
- package/templates/agents/swift-expert.agent.md +0 -49
- package/templates/agents/task-distributor.agent.md +0 -47
- package/templates/agents/tdd-orchestrator.agent.md +0 -183
- package/templates/agents/technical-writer.agent.md +0 -48
- package/templates/agents/temporal-python-pro.agent.md +0 -349
- package/templates/agents/terraform-engineer.agent.md +0 -57
- package/templates/agents/terraform-specialist.agent.md +0 -137
- package/templates/agents/test-automator.agent.md +0 -203
- package/templates/agents/test-engineer.agent.md +0 -55
- package/templates/agents/threat-modeling-expert.agent.md +0 -44
- package/templates/agents/trend-analyst.agent.md +0 -47
- package/templates/agents/tutorial-engineer.agent.md +0 -118
- package/templates/agents/typescript-pro.agent.md +0 -48
- package/templates/agents/ui-designer.agent.md +0 -48
- package/templates/agents/ui-ux-designer.agent.md +0 -188
- package/templates/agents/ui-visual-validator.agent.md +0 -192
- package/templates/agents/ux-researcher.agent.md +0 -48
- package/templates/agents/vector-database-engineer.agent.md +0 -43
- package/templates/agents/vue-expert.agent.md +0 -48
- package/templates/agents/websocket-engineer.agent.md +0 -49
- package/templates/agents/workflow-orchestrator.agent.md +0 -48
- package/templates/skills/angular-migration/SKILL.md +0 -410
- package/templates/skills/api-design-principles/SKILL.md +0 -528
- package/templates/skills/api-design-principles/assets/api-design-checklist.md +0 -155
- package/templates/skills/api-design-principles/assets/rest-api-template.py +0 -182
- package/templates/skills/api-design-principles/references/graphql-schema-design.md +0 -583
- package/templates/skills/api-design-principles/references/rest-best-practices.md +0 -408
- package/templates/skills/architecture-decision-records/SKILL.md +0 -428
- package/templates/skills/architecture-patterns/SKILL.md +0 -494
- package/templates/skills/async-python-patterns/SKILL.md +0 -694
- package/templates/skills/auth-implementation-patterns/SKILL.md +0 -634
- package/templates/skills/changelog-automation/SKILL.md +0 -552
- package/templates/skills/code-review/SKILL.md +0 -62
- package/templates/skills/code-review-excellence/SKILL.md +0 -520
- package/templates/skills/competitive-landscape/SKILL.md +0 -479
- package/templates/skills/context-driven-development/SKILL.md +0 -385
- package/templates/skills/cost-optimization/SKILL.md +0 -274
- package/templates/skills/cqrs-implementation/SKILL.md +0 -554
- package/templates/skills/data-quality-frameworks/SKILL.md +0 -587
- package/templates/skills/data-storytelling/SKILL.md +0 -453
- package/templates/skills/database-migration/SKILL.md +0 -424
- package/templates/skills/dbt-transformation-patterns/SKILL.md +0 -561
- package/templates/skills/debugging-strategies/SKILL.md +0 -527
- package/templates/skills/defi-protocol-templates/SKILL.md +0 -454
- package/templates/skills/dependency-upgrade/SKILL.md +0 -409
- package/templates/skills/deployment-pipeline-design/SKILL.md +0 -359
- package/templates/skills/distributed-tracing/SKILL.md +0 -438
- package/templates/skills/dotnet-backend-patterns/SKILL.md +0 -815
- package/templates/skills/dotnet-backend-patterns/assets/repository-template.cs +0 -523
- package/templates/skills/dotnet-backend-patterns/assets/service-template.cs +0 -336
- package/templates/skills/dotnet-backend-patterns/references/dapper-patterns.md +0 -544
- package/templates/skills/dotnet-backend-patterns/references/ef-core-best-practices.md +0 -355
- package/templates/skills/e2e-testing-patterns/SKILL.md +0 -547
- package/templates/skills/employment-contract-templates/SKILL.md +0 -507
- package/templates/skills/error-handling-patterns/SKILL.md +0 -636
- package/templates/skills/event-store-design/SKILL.md +0 -437
- package/templates/skills/fastapi-templates/SKILL.md +0 -567
- package/templates/skills/git-advanced-workflows/SKILL.md +0 -400
- package/templates/skills/github-actions-templates/SKILL.md +0 -333
- package/templates/skills/go-concurrency-patterns/SKILL.md +0 -655
- package/templates/skills/grafana-dashboards/SKILL.md +0 -369
- package/templates/skills/helm-chart-scaffolding/SKILL.md +0 -544
- package/templates/skills/helm-chart-scaffolding/assets/Chart.yaml.template +0 -42
- package/templates/skills/helm-chart-scaffolding/assets/values.yaml.template +0 -185
- package/templates/skills/helm-chart-scaffolding/references/chart-structure.md +0 -500
- package/templates/skills/helm-chart-scaffolding/scripts/validate-chart.sh +0 -244
- package/templates/skills/javascript-testing-patterns/SKILL.md +0 -1025
- package/templates/skills/langchain-architecture/SKILL.md +0 -338
- package/templates/skills/llm-evaluation/SKILL.md +0 -471
- package/templates/skills/microservices-patterns/SKILL.md +0 -595
- package/templates/skills/modern-javascript-patterns/SKILL.md +0 -911
- package/templates/skills/monorepo-management/SKILL.md +0 -622
- package/templates/skills/nextjs-app-router-patterns/SKILL.md +0 -544
- package/templates/skills/nodejs-backend-patterns/SKILL.md +0 -1020
- package/templates/skills/nx-workspace-patterns/SKILL.md +0 -452
- package/templates/skills/openapi-spec-generation/SKILL.md +0 -1028
- package/templates/skills/paypal-integration/SKILL.md +0 -467
- package/templates/skills/pci-compliance/SKILL.md +0 -466
- package/templates/skills/postgresql/SKILL.md +0 -204
- package/templates/skills/projection-patterns/SKILL.md +0 -490
- package/templates/skills/prometheus-configuration/SKILL.md +0 -392
- package/templates/skills/prompt-engineering-patterns/SKILL.md +0 -201
- package/templates/skills/prompt-engineering-patterns/assets/few-shot-examples.json +0 -106
- package/templates/skills/prompt-engineering-patterns/assets/prompt-template-library.md +0 -246
- package/templates/skills/prompt-engineering-patterns/references/chain-of-thought.md +0 -399
- package/templates/skills/prompt-engineering-patterns/references/few-shot-learning.md +0 -369
- package/templates/skills/prompt-engineering-patterns/references/prompt-optimization.md +0 -414
- package/templates/skills/prompt-engineering-patterns/references/prompt-templates.md +0 -470
- package/templates/skills/prompt-engineering-patterns/references/system-prompts.md +0 -189
- package/templates/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +0 -279
- package/templates/skills/python-packaging/SKILL.md +0 -870
- package/templates/skills/python-performance-optimization/SKILL.md +0 -869
- package/templates/skills/python-testing-patterns/SKILL.md +0 -907
- package/templates/skills/rag-implementation/SKILL.md +0 -403
- package/templates/skills/react-modernization/SKILL.md +0 -513
- package/templates/skills/react-native-architecture/SKILL.md +0 -671
- package/templates/skills/react-state-management/SKILL.md +0 -429
- package/templates/skills/risk-metrics-calculation/SKILL.md +0 -555
- package/templates/skills/rust-async-patterns/SKILL.md +0 -517
- package/templates/skills/secrets-management/SKILL.md +0 -346
- package/templates/skills/security-requirement-extraction/SKILL.md +0 -677
- package/templates/skills/security-review/SKILL.md +0 -78
- package/templates/skills/shellcheck-configuration/SKILL.md +0 -454
- package/templates/skills/similarity-search-patterns/SKILL.md +0 -558
- package/templates/skills/slo-implementation/SKILL.md +0 -329
- package/templates/skills/sql-optimization-patterns/SKILL.md +0 -493
- package/templates/skills/stripe-integration/SKILL.md +0 -442
- package/templates/skills/systematic-debugging/SKILL.md +0 -57
- package/templates/skills/tailwind-design-system/SKILL.md +0 -666
- package/templates/skills/temporal-python-testing/SKILL.md +0 -158
- package/templates/skills/temporal-python-testing/resources/integration-testing.md +0 -455
- package/templates/skills/temporal-python-testing/resources/local-setup.md +0 -553
- package/templates/skills/temporal-python-testing/resources/replay-testing.md +0 -462
- package/templates/skills/temporal-python-testing/resources/unit-testing.md +0 -328
- package/templates/skills/terraform-module-library/SKILL.md +0 -249
- package/templates/skills/terraform-module-library/references/aws-modules.md +0 -63
- package/templates/skills/test-driven-development/SKILL.md +0 -46
- package/templates/skills/threat-mitigation-mapping/SKILL.md +0 -745
- package/templates/skills/track-management/SKILL.md +0 -593
- package/templates/skills/typescript-advanced-types/SKILL.md +0 -717
- package/templates/skills/ui-ux-pro-max/SKILL.md +0 -352
- package/templates/skills/ui-ux-pro-max/data/charts.csv +0 -26
- package/templates/skills/ui-ux-pro-max/data/colors.csv +0 -97
- package/templates/skills/ui-ux-pro-max/data/icons.csv +0 -101
- package/templates/skills/ui-ux-pro-max/data/landing.csv +0 -31
- package/templates/skills/ui-ux-pro-max/data/products.csv +0 -97
- package/templates/skills/ui-ux-pro-max/data/prompts.csv +0 -24
- package/templates/skills/ui-ux-pro-max/data/react-performance.csv +0 -45
- package/templates/skills/ui-ux-pro-max/data/styles.csv +0 -59
- package/templates/skills/ui-ux-pro-max/data/typography.csv +0 -58
- package/templates/skills/ui-ux-pro-max/data/ui-reasoning.csv +0 -101
- package/templates/skills/ui-ux-pro-max/data/ux-guidelines.csv +0 -100
- package/templates/skills/ui-ux-pro-max/data/web-interface.csv +0 -31
- package/templates/skills/ui-ux-pro-max/scripts/core.py +0 -258
- package/templates/skills/ui-ux-pro-max/scripts/design_system.py +0 -547
- package/templates/skills/ui-ux-pro-max/scripts/search.py +0 -76
- package/templates/skills/uv-package-manager/SKILL.md +0 -831
- package/templates/skills/vector-index-tuning/SKILL.md +0 -521
- package/templates/skills/wcag-audit-patterns/SKILL.md +0 -555
- package/templates/skills/workflow-orchestration-patterns/SKILL.md +0 -316
- package/templates/skills/workflow-patterns/SKILL.md +0 -623
- package/templates/skills/writing-plans/SKILL.md +0 -64
|
@@ -1,409 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: dependency-upgrade
|
|
3
|
-
description: Manage major dependency version upgrades with compatibility analysis, staged rollout, and comprehensive testing. Use when upgrading framework versions, updating major dependencies, or managing breaking changes in libraries.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
# Dependency Upgrade
|
|
7
|
-
|
|
8
|
-
Master major dependency version upgrades, compatibility analysis, staged upgrade strategies, and comprehensive testing approaches.
|
|
9
|
-
|
|
10
|
-
## When to Use This Skill
|
|
11
|
-
|
|
12
|
-
- Upgrading major framework versions
|
|
13
|
-
- Updating security-vulnerable dependencies
|
|
14
|
-
- Modernizing legacy dependencies
|
|
15
|
-
- Resolving dependency conflicts
|
|
16
|
-
- Planning incremental upgrade paths
|
|
17
|
-
- Testing compatibility matrices
|
|
18
|
-
- Automating dependency updates
|
|
19
|
-
|
|
20
|
-
## Semantic Versioning Review
|
|
21
|
-
|
|
22
|
-
```
|
|
23
|
-
MAJOR.MINOR.PATCH (e.g., 2.3.1)
|
|
24
|
-
|
|
25
|
-
MAJOR: Breaking changes
|
|
26
|
-
MINOR: New features, backward compatible
|
|
27
|
-
PATCH: Bug fixes, backward compatible
|
|
28
|
-
|
|
29
|
-
^2.3.1 = >=2.3.1 <3.0.0 (minor updates)
|
|
30
|
-
~2.3.1 = >=2.3.1 <2.4.0 (patch updates)
|
|
31
|
-
2.3.1 = exact version
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
## Dependency Analysis
|
|
35
|
-
|
|
36
|
-
### Audit Dependencies
|
|
37
|
-
```bash
|
|
38
|
-
# npm
|
|
39
|
-
npm outdated
|
|
40
|
-
npm audit
|
|
41
|
-
npm audit fix
|
|
42
|
-
|
|
43
|
-
# yarn
|
|
44
|
-
yarn outdated
|
|
45
|
-
yarn audit
|
|
46
|
-
|
|
47
|
-
# Check for major updates
|
|
48
|
-
npx npm-check-updates
|
|
49
|
-
npx npm-check-updates -u # Update package.json
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Analyze Dependency Tree
|
|
53
|
-
```bash
|
|
54
|
-
# See why a package is installed
|
|
55
|
-
npm ls package-name
|
|
56
|
-
yarn why package-name
|
|
57
|
-
|
|
58
|
-
# Find duplicate packages
|
|
59
|
-
npm dedupe
|
|
60
|
-
yarn dedupe
|
|
61
|
-
|
|
62
|
-
# Visualize dependencies
|
|
63
|
-
npx madge --image graph.png src/
|
|
64
|
-
```
|
|
65
|
-
|
|
66
|
-
## Compatibility Matrix
|
|
67
|
-
|
|
68
|
-
```javascript
|
|
69
|
-
// compatibility-matrix.js
|
|
70
|
-
const compatibilityMatrix = {
|
|
71
|
-
'react': {
|
|
72
|
-
'16.x': {
|
|
73
|
-
'react-dom': '^16.0.0',
|
|
74
|
-
'react-router-dom': '^5.0.0',
|
|
75
|
-
'@testing-library/react': '^11.0.0'
|
|
76
|
-
},
|
|
77
|
-
'17.x': {
|
|
78
|
-
'react-dom': '^17.0.0',
|
|
79
|
-
'react-router-dom': '^5.0.0 || ^6.0.0',
|
|
80
|
-
'@testing-library/react': '^12.0.0'
|
|
81
|
-
},
|
|
82
|
-
'18.x': {
|
|
83
|
-
'react-dom': '^18.0.0',
|
|
84
|
-
'react-router-dom': '^6.0.0',
|
|
85
|
-
'@testing-library/react': '^13.0.0'
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
};
|
|
89
|
-
|
|
90
|
-
function checkCompatibility(packages) {
|
|
91
|
-
// Validate package versions against matrix
|
|
92
|
-
}
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
## Staged Upgrade Strategy
|
|
96
|
-
|
|
97
|
-
### Phase 1: Planning
|
|
98
|
-
```bash
|
|
99
|
-
# 1. Identify current versions
|
|
100
|
-
npm list --depth=0
|
|
101
|
-
|
|
102
|
-
# 2. Check for breaking changes
|
|
103
|
-
# Read CHANGELOG.md and MIGRATION.md
|
|
104
|
-
|
|
105
|
-
# 3. Create upgrade plan
|
|
106
|
-
echo "Upgrade order:
|
|
107
|
-
1. TypeScript
|
|
108
|
-
2. React
|
|
109
|
-
3. React Router
|
|
110
|
-
4. Testing libraries
|
|
111
|
-
5. Build tools" > UPGRADE_PLAN.md
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
### Phase 2: Incremental Updates
|
|
115
|
-
```bash
|
|
116
|
-
# Don't upgrade everything at once!
|
|
117
|
-
|
|
118
|
-
# Step 1: Update TypeScript
|
|
119
|
-
npm install typescript@latest
|
|
120
|
-
|
|
121
|
-
# Test
|
|
122
|
-
npm run test
|
|
123
|
-
npm run build
|
|
124
|
-
|
|
125
|
-
# Step 2: Update React (one major version at a time)
|
|
126
|
-
npm install react@17 react-dom@17
|
|
127
|
-
|
|
128
|
-
# Test again
|
|
129
|
-
npm run test
|
|
130
|
-
|
|
131
|
-
# Step 3: Continue with other packages
|
|
132
|
-
npm install react-router-dom@6
|
|
133
|
-
|
|
134
|
-
# And so on...
|
|
135
|
-
```
|
|
136
|
-
|
|
137
|
-
### Phase 3: Validation
|
|
138
|
-
```javascript
|
|
139
|
-
// tests/compatibility.test.js
|
|
140
|
-
describe('Dependency Compatibility', () => {
|
|
141
|
-
it('should have compatible React versions', () => {
|
|
142
|
-
const reactVersion = require('react/package.json').version;
|
|
143
|
-
const reactDomVersion = require('react-dom/package.json').version;
|
|
144
|
-
|
|
145
|
-
expect(reactVersion).toBe(reactDomVersion);
|
|
146
|
-
});
|
|
147
|
-
|
|
148
|
-
it('should not have peer dependency warnings', () => {
|
|
149
|
-
// Run npm ls and check for warnings
|
|
150
|
-
});
|
|
151
|
-
});
|
|
152
|
-
```
|
|
153
|
-
|
|
154
|
-
## Breaking Change Handling
|
|
155
|
-
|
|
156
|
-
### Identifying Breaking Changes
|
|
157
|
-
```bash
|
|
158
|
-
# Use changelog parsers
|
|
159
|
-
npx changelog-parser react 16.0.0 17.0.0
|
|
160
|
-
|
|
161
|
-
# Or manually check
|
|
162
|
-
curl https://raw.githubusercontent.com/facebook/react/main/CHANGELOG.md
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
### Codemod for Automated Fixes
|
|
166
|
-
```bash
|
|
167
|
-
# React upgrade codemods
|
|
168
|
-
npx react-codeshift <transform> <path>
|
|
169
|
-
|
|
170
|
-
# Example: Update lifecycle methods
|
|
171
|
-
npx react-codeshift \
|
|
172
|
-
--parser tsx \
|
|
173
|
-
--transform react-codeshift/transforms/rename-unsafe-lifecycles.js \
|
|
174
|
-
src/
|
|
175
|
-
```
|
|
176
|
-
|
|
177
|
-
### Custom Migration Script
|
|
178
|
-
```javascript
|
|
179
|
-
// migration-script.js
|
|
180
|
-
const fs = require('fs');
|
|
181
|
-
const glob = require('glob');
|
|
182
|
-
|
|
183
|
-
glob('src/**/*.tsx', (err, files) => {
|
|
184
|
-
files.forEach(file => {
|
|
185
|
-
let content = fs.readFileSync(file, 'utf8');
|
|
186
|
-
|
|
187
|
-
// Replace old API with new API
|
|
188
|
-
content = content.replace(
|
|
189
|
-
/componentWillMount/g,
|
|
190
|
-
'UNSAFE_componentWillMount'
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
// Update imports
|
|
194
|
-
content = content.replace(
|
|
195
|
-
/import { Component } from 'react'/g,
|
|
196
|
-
"import React, { Component } from 'react'"
|
|
197
|
-
);
|
|
198
|
-
|
|
199
|
-
fs.writeFileSync(file, content);
|
|
200
|
-
});
|
|
201
|
-
});
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
## Testing Strategy
|
|
205
|
-
|
|
206
|
-
### Unit Tests
|
|
207
|
-
```javascript
|
|
208
|
-
// Ensure tests pass before and after upgrade
|
|
209
|
-
npm run test
|
|
210
|
-
|
|
211
|
-
// Update test utilities if needed
|
|
212
|
-
npm install @testing-library/react@latest
|
|
213
|
-
```
|
|
214
|
-
|
|
215
|
-
### Integration Tests
|
|
216
|
-
```javascript
|
|
217
|
-
// tests/integration/app.test.js
|
|
218
|
-
describe('App Integration', () => {
|
|
219
|
-
it('should render without crashing', () => {
|
|
220
|
-
render(<App />);
|
|
221
|
-
});
|
|
222
|
-
|
|
223
|
-
it('should handle navigation', () => {
|
|
224
|
-
const { getByText } = render(<App />);
|
|
225
|
-
fireEvent.click(getByText('Navigate'));
|
|
226
|
-
expect(screen.getByText('New Page')).toBeInTheDocument();
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### Visual Regression Tests
|
|
232
|
-
```javascript
|
|
233
|
-
// visual-regression.test.js
|
|
234
|
-
describe('Visual Regression', () => {
|
|
235
|
-
it('should match snapshot', () => {
|
|
236
|
-
const { container } = render(<App />);
|
|
237
|
-
expect(container.firstChild).toMatchSnapshot();
|
|
238
|
-
});
|
|
239
|
-
});
|
|
240
|
-
```
|
|
241
|
-
|
|
242
|
-
### E2E Tests
|
|
243
|
-
```javascript
|
|
244
|
-
// cypress/e2e/app.cy.js
|
|
245
|
-
describe('E2E Tests', () => {
|
|
246
|
-
it('should complete user flow', () => {
|
|
247
|
-
cy.visit('/');
|
|
248
|
-
cy.get('[data-testid="login"]').click();
|
|
249
|
-
cy.get('input[name="email"]').type('user@example.com');
|
|
250
|
-
cy.get('button[type="submit"]').click();
|
|
251
|
-
cy.url().should('include', '/dashboard');
|
|
252
|
-
});
|
|
253
|
-
});
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
## Automated Dependency Updates
|
|
257
|
-
|
|
258
|
-
### Renovate Configuration
|
|
259
|
-
```json
|
|
260
|
-
// renovate.json
|
|
261
|
-
{
|
|
262
|
-
"extends": ["config:base"],
|
|
263
|
-
"packageRules": [
|
|
264
|
-
{
|
|
265
|
-
"matchUpdateTypes": ["minor", "patch"],
|
|
266
|
-
"automerge": true
|
|
267
|
-
},
|
|
268
|
-
{
|
|
269
|
-
"matchUpdateTypes": ["major"],
|
|
270
|
-
"automerge": false,
|
|
271
|
-
"labels": ["major-update"]
|
|
272
|
-
}
|
|
273
|
-
],
|
|
274
|
-
"schedule": ["before 3am on Monday"],
|
|
275
|
-
"timezone": "America/New_York"
|
|
276
|
-
}
|
|
277
|
-
```
|
|
278
|
-
|
|
279
|
-
### Dependabot Configuration
|
|
280
|
-
```yaml
|
|
281
|
-
# .github/dependabot.yml
|
|
282
|
-
version: 2
|
|
283
|
-
updates:
|
|
284
|
-
- package-ecosystem: "npm"
|
|
285
|
-
directory: "/"
|
|
286
|
-
schedule:
|
|
287
|
-
interval: "weekly"
|
|
288
|
-
open-pull-requests-limit: 5
|
|
289
|
-
reviewers:
|
|
290
|
-
- "team-leads"
|
|
291
|
-
commit-message:
|
|
292
|
-
prefix: "chore"
|
|
293
|
-
include: "scope"
|
|
294
|
-
```
|
|
295
|
-
|
|
296
|
-
## Rollback Plan
|
|
297
|
-
|
|
298
|
-
```javascript
|
|
299
|
-
// rollback.sh
|
|
300
|
-
#!/bin/bash
|
|
301
|
-
|
|
302
|
-
# Save current state
|
|
303
|
-
git stash
|
|
304
|
-
git checkout -b upgrade-branch
|
|
305
|
-
|
|
306
|
-
# Attempt upgrade
|
|
307
|
-
npm install package@latest
|
|
308
|
-
|
|
309
|
-
# Run tests
|
|
310
|
-
if npm run test; then
|
|
311
|
-
echo "Upgrade successful"
|
|
312
|
-
git add package.json package-lock.json
|
|
313
|
-
git commit -m "chore: upgrade package"
|
|
314
|
-
else
|
|
315
|
-
echo "Upgrade failed, rolling back"
|
|
316
|
-
git checkout main
|
|
317
|
-
git branch -D upgrade-branch
|
|
318
|
-
npm install # Restore from package-lock.json
|
|
319
|
-
fi
|
|
320
|
-
```
|
|
321
|
-
|
|
322
|
-
## Common Upgrade Patterns
|
|
323
|
-
|
|
324
|
-
### Lock File Management
|
|
325
|
-
```bash
|
|
326
|
-
# npm
|
|
327
|
-
npm install --package-lock-only # Update lock file only
|
|
328
|
-
npm ci # Clean install from lock file
|
|
329
|
-
|
|
330
|
-
# yarn
|
|
331
|
-
yarn install --frozen-lockfile # CI mode
|
|
332
|
-
yarn upgrade-interactive # Interactive upgrades
|
|
333
|
-
```
|
|
334
|
-
|
|
335
|
-
### Peer Dependency Resolution
|
|
336
|
-
```bash
|
|
337
|
-
# npm 7+: strict peer dependencies
|
|
338
|
-
npm install --legacy-peer-deps # Ignore peer deps
|
|
339
|
-
|
|
340
|
-
# npm 8+: override peer dependencies
|
|
341
|
-
npm install --force
|
|
342
|
-
```
|
|
343
|
-
|
|
344
|
-
### Workspace Upgrades
|
|
345
|
-
```bash
|
|
346
|
-
# Update all workspace packages
|
|
347
|
-
npm install --workspaces
|
|
348
|
-
|
|
349
|
-
# Update specific workspace
|
|
350
|
-
npm install package@latest --workspace=packages/app
|
|
351
|
-
```
|
|
352
|
-
|
|
353
|
-
## Resources
|
|
354
|
-
|
|
355
|
-
- **references/semver.md**: Semantic versioning guide
|
|
356
|
-
- **references/compatibility-matrix.md**: Common compatibility issues
|
|
357
|
-
- **references/staged-upgrades.md**: Incremental upgrade strategies
|
|
358
|
-
- **references/testing-strategy.md**: Comprehensive testing approaches
|
|
359
|
-
- **assets/upgrade-checklist.md**: Step-by-step checklist
|
|
360
|
-
- **assets/compatibility-matrix.csv**: Version compatibility table
|
|
361
|
-
- **scripts/audit-dependencies.sh**: Dependency audit script
|
|
362
|
-
|
|
363
|
-
## Best Practices
|
|
364
|
-
|
|
365
|
-
1. **Read Changelogs**: Understand what changed
|
|
366
|
-
2. **Upgrade Incrementally**: One major version at a time
|
|
367
|
-
3. **Test Thoroughly**: Unit, integration, E2E tests
|
|
368
|
-
4. **Check Peer Dependencies**: Resolve conflicts early
|
|
369
|
-
5. **Use Lock Files**: Ensure reproducible installs
|
|
370
|
-
6. **Automate Updates**: Use Renovate or Dependabot
|
|
371
|
-
7. **Monitor**: Watch for runtime errors post-upgrade
|
|
372
|
-
8. **Document**: Keep upgrade notes
|
|
373
|
-
|
|
374
|
-
## Upgrade Checklist
|
|
375
|
-
|
|
376
|
-
```markdown
|
|
377
|
-
Pre-Upgrade:
|
|
378
|
-
- [ ] Review current dependency versions
|
|
379
|
-
- [ ] Read changelogs for breaking changes
|
|
380
|
-
- [ ] Create feature branch
|
|
381
|
-
- [ ] Backup current state (git tag)
|
|
382
|
-
- [ ] Run full test suite (baseline)
|
|
383
|
-
|
|
384
|
-
During Upgrade:
|
|
385
|
-
- [ ] Upgrade one dependency at a time
|
|
386
|
-
- [ ] Update peer dependencies
|
|
387
|
-
- [ ] Fix TypeScript errors
|
|
388
|
-
- [ ] Update tests if needed
|
|
389
|
-
- [ ] Run test suite after each upgrade
|
|
390
|
-
- [ ] Check bundle size impact
|
|
391
|
-
|
|
392
|
-
Post-Upgrade:
|
|
393
|
-
- [ ] Full regression testing
|
|
394
|
-
- [ ] Performance testing
|
|
395
|
-
- [ ] Update documentation
|
|
396
|
-
- [ ] Deploy to staging
|
|
397
|
-
- [ ] Monitor for errors
|
|
398
|
-
- [ ] Deploy to production
|
|
399
|
-
```
|
|
400
|
-
|
|
401
|
-
## Common Pitfalls
|
|
402
|
-
|
|
403
|
-
- Upgrading all dependencies at once
|
|
404
|
-
- Not testing after each upgrade
|
|
405
|
-
- Ignoring peer dependency warnings
|
|
406
|
-
- Forgetting to update lock file
|
|
407
|
-
- Not reading breaking change notes
|
|
408
|
-
- Skipping major versions
|
|
409
|
-
- Not having rollback plan
|