feat(mcp): detect old vs new API usage for promoted components#3326
feat(mcp): detect old vs new API usage for promoted components#3326rivka-ungar merged 6 commits intovibe4from
Conversation
β¦migration tool Five components (Dropdown, AttentionBox, Modal, DatePicker, Dialog) had old/new versions in Vibe 3. After upgrading to v4, imports from @vibe/core silently point to the new API. This adds detection to distinguish old vs new API usage and surface actionable migration guidance before codemods run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Review Summary by QodoDetect promoted component API usage and surface migration guidance
WalkthroughsDescriptionβ’ Adds detection of old vs new API usage for five promoted components (Dropdown, AttentionBox, Modal, DatePicker, Dialog) β’ Surfaces actionable migration guidance with severity levels, API changes, and before/after examples β’ Inserts new migration step 3 to address old component APIs before running codemods β’ Renumbers subsequent migration steps (3β4, 4β5, 5β6, 6β7) with updated cross-references Diagramflowchart LR
A["Source Files"] -- "detectPromotedComponentImports()" --> B["Old vs New API Detection"]
B -- "classifies imports" --> C["PromotedComponentAnalysis"]
C -- "oldApiUsage/newApiUsage" --> D["Migration Recommendations"]
E["getPromotedComponentMigrationGuide()"] -- "provides guidance" --> D
D -- "severity + before/after" --> F["Step 3: Migrate Old Components"]
File Changes1. packages/mcp/src/server/tools/v4-migration.ts
|
Code Review by Qodo
1.
|
β¦emods After codemods rewrite @vibe/core/next β @vibe/core, old vs new API usage becomes indistinguishable. Updated warnings to make the ordering clear. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review by QodoNew Review StartedThis review has been superseded by a new analysisβ The new review experience is currently in Beta. Learn more |
Update migration step 4 (codemods) and promoted component recommendations to consistently warn that step 3 must complete before codemods run. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review by QodoNew Review StartedThis review has been superseded by a new analysisβ The new review experience is currently in Beta. Learn more |
Remove duplicated Dropdown API changes and before/after examples from the promoted component guide. Instead, reference the dedicated dropdown-migration tool which already provides comprehensive guidance. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Code Review by QodoNew Review StartedThis review has been superseded by a new analysisβ The new review experience is currently in Beta. Learn more |
Replace line-by-line regex with a pre-processing step that collapses multi-line imports into single logical lines before matching, preserving the start line number of the import keyword. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
|
Persistent review updated to latest commit 6f2a1cc |
|
Persistent review updated to latest commit 0077f8f |
CI Feedback π§A test triggered by this PR failed. Here is an AI-generated analysis of the failure:
|
User description
Summary
Details
In Vibe 3, these components had OLD versions in
@vibe/coreand NEW versions in@vibe/core/next. In Vibe 4, the new versions became the default in@vibe/core. If a user was importing the old version from@vibe/core, after upgrading their import path is "correct" but silently points to a completely different component with a different API. The codemods don't handle this because it's not a 1:1 prop change.Changes to
v4-migration.ts:PROMOTED_COMPONENTS,OldComponentDetection,PromotedComponentAnalysisinterfacesdetectPromotedComponentImports(): Parses imports to classify as old (@vibe/core) or new (@vibe/core/next), handles both quote stylesgetPromotedComponentMigrationGuide(): Structured guidance per component with severity, API changes, before/after code/nextimportsTest plan
yarn workspace @vibe/mcp buildcompiles successfully@vibe/coreimports β verifypromotedComponentAnalysis.oldApiUsagepopulated@vibe/core/nextimports β verifypromotedComponentAnalysis.newApiUsagepopulatedπ€ Generated with Claude Code
PR Type
Enhancement
Description
Adds detection of old vs new API usage for five promoted components (Dropdown, AttentionBox, Modal, DatePicker, Dialog)
Inserts new migration step 3 to address old component APIs before running codemods
Provides structured migration guidance with severity levels, API changes, and before/after examples
Handles multi-line imports by collapsing them into logical lines for accurate detection
Renumbers subsequent migration steps (3β4, 4β5, 5β6, 6β7) with updated cross-references
Diagram Walkthrough
File Walkthrough
v4-migration.ts
Add promoted component detection and migration guidanceΒ Βpackages/mcp/src/server/tools/v4-migration.ts
PROMOTED_COMPONENTSconstant andOldComponentDetection,PromotedComponentAnalysisinterfaces for tracking old vs new API usagecollapseImportLines()helper to handle multi-line importstatements by preserving start line numbers
detectPromotedComponentImports()function to parse importsand classify components as old (
@vibe/core) or new (@vibe/core/next)getPromotedComponentMigrationGuide()function providingstructured guidance per component with severity, API changes, and
before/after code examples
detailed instructions and warnings about ordering relative to codemods
all cross-references and warnings
analyzeProject()andscanAllFiles()workflowsgenerateRecommendations()to surface promoted componentfindings with severity levels and actionable guidance
3 must complete before codemods run