added fast apply
if isEdit === true & Morph API Key is in .env: - Morph Fast Apply is activated.
This commit is contained in:
@@ -42,8 +42,8 @@ function parseAIResponse(response: string): ParsedResponse {
|
||||
const importPath = importMatch[1];
|
||||
// Skip relative imports and built-in React
|
||||
if (!importPath.startsWith('.') && !importPath.startsWith('/') &&
|
||||
importPath !== 'react' && importPath !== 'react-dom' &&
|
||||
!importPath.startsWith('@/')) {
|
||||
importPath !== 'react' && importPath !== 'react-dom' &&
|
||||
!importPath.startsWith('@/')) {
|
||||
// Extract package name (handle scoped packages like @heroicons/react)
|
||||
const packageName = importPath.startsWith('@')
|
||||
? importPath.split('/').slice(0, 2).join('/')
|
||||
@@ -495,7 +495,7 @@ export async function POST(request: NextRequest) {
|
||||
results.packagesInstalled = data.installedPackages;
|
||||
}
|
||||
} catch (parseError) {
|
||||
console.debug('Error parsing terminal output:', parseError);
|
||||
console.debug('Error parsing terminal output:', parseError);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -599,9 +599,9 @@ export async function POST(request: NextRequest) {
|
||||
normalizedPath = normalizedPath.substring(1);
|
||||
}
|
||||
if (!normalizedPath.startsWith('src/') &&
|
||||
!normalizedPath.startsWith('public/') &&
|
||||
normalizedPath !== 'index.html' &&
|
||||
!configFiles.includes(normalizedPath.split('/').pop() || '')) {
|
||||
!normalizedPath.startsWith('public/') &&
|
||||
normalizedPath !== 'index.html' &&
|
||||
!configFiles.includes(normalizedPath.split('/').pop() || '')) {
|
||||
normalizedPath = 'src/' + normalizedPath;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user