Forge VSCode Extensions
A VSCode extension that helps migrate legacy UI components to Forge components with AI-powered assistance.
Features
- 🔍 Component Detection: Automatically detects legacy components that can be migrated to Forge
- 🎯 Smart Highlighting: Highlights detected components in your code
- 🤖 AI-Powered Migration: Uses AI to generate migration suggestions
- 📖 Documentation Links: Quick access to Forge component documentation
- ⚡ Interactive Preview: Preview migrations before applying them
Getting Started
Prerequisites
- Node.js (v14 or higher)
- VSCode (v1.60 or higher)
Installation & Development
Clone the repository
Install dependencies:
npm install
Open the project in VSCode
Press F5 to run the extension in a new Extension Development Host window
Open a project with OCL components to test
Usage
- Activate the extension: Press
Ctrl+F R G to toggle Forge Migration on/off
- Detect components: Open any React/TypeScript file - compatible components will be highlighted
- Migrate components:
- Use
Ctrl+. on highlighted components for quick actions
- Or hover for context menu options
- View documentation: Click "Open Documentation" to view Forge component docs
Supported File Types
.tsx - TypeScript React
.jsx - JavaScript React
.ts - TypeScript
.js - JavaScript
Commands
Ctrl+F R G - Toggle Forge Migration extension
Ctrl+. - Show quick actions for detected components
Forge Migration: Open Settings - Open configuration settings
Configuration
The extension can be configured through VS Code settings. Access these via:
- Command Palette:
Forge Migration: Open Settings
- VS Code Settings: Search for "Forge Migration"
Available Settings
| Setting |
Default |
Description |
forgeMigration.ai.family |
"gpt-4o" |
AI model family to use via GitHub Copilot (gpt-4o, gemini-2.5-pro, claude-sonnet-4.5 etc.) |
forgeMigration.workspaceRoot |
"" |
Override workspace root path. Empty = use VS Code workspace. Useful for monorepos |
forgeMigration.guidesPath |
"node_modules/dh-forge/dist/migration" |
Path to migration guide files (relative to workspace root) |
forgeMigration.includeAiComment |
true |
Include AI model info in migrated code comments for traceability |
Supported AI Models
The extension uses GitHub Copilot to access multiple AI model families:
- GPT Models:
gpt-4o, gpt-4.1, gpt-4
- Gemini Models:
gemini-2.5-pro
- Claude Models:
claude-sonnet-4.5, claude-sonnet-4
Workspace Root Configuration
The workspaceRoot setting allows you to override where the extension looks for migration guides.
Migration Guides
The extension looks for component-specific migration guides in the configured path. Guide files should:
- By default be linked to the migration guides in dh-forge
- Follow the naming pattern:
{ComponentName}.migration.md
- Contain markdown with migration instructions for the AI
Default guide location (from dh-forge package):
workspace-root/
└── node_modules/dh-forge/dist/migration/ # Default guides path
├── Button.migration.md
├── Input.migration.md
└── Modal.migration.md
Development
The extension is built with:
- TypeScript
- VSCode Extension API
- AI Language Models for migration assistance
Project Structure
src/
├── index.ts # Main extension entry point
├── utils/
│ ├── componentDetector.ts # Component detection logic
│ ├── componentHighlighter.ts # Visual highlighting
│ ├── codeActionProvider.ts # Quick actions
│ └── migrationProvider.ts # AI migration logic
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Test with
F5
- Submit a pull request
| |