bolt.diy/app/routes/api.update.ts
Stijnus fc3dd8c84c Final UI V3
# UI V3 Changelog

Major updates and improvements in this release:

## Core Changes
- Complete NEW REWRITTEN UI system overhaul (V3) with semantic design tokens
- New settings management system with drag-and-drop capabilities
- Enhanced provider system supporting multiple AI services
- Improved theme system with better dark mode support
- New component library with consistent design patterns

## Technical Updates
- Reorganized project architecture for better maintainability
- Performance optimizations and bundle size improvements
- Enhanced security features and access controls
- Improved developer experience with better tooling
- Comprehensive testing infrastructure

## New Features
- Background rays effect for improved visual feedback
- Advanced tab management system
- Automatic and manual update support
- Enhanced error handling and visualization
- Improved accessibility across all components

For detailed information about all changes and improvements, please see the full changelog.
2025-02-02 01:42:30 +01:00

46 lines
1.3 KiB
TypeScript

import { json } from '@remix-run/node';
import type { ActionFunction } from '@remix-run/node';
interface UpdateRequestBody {
branch: string;
}
export const action: ActionFunction = async ({ request }) => {
if (request.method !== 'POST') {
return json({ error: 'Method not allowed' }, { status: 405 });
}
try {
const body = await request.json();
// Type guard to check if body has the correct shape
if (!body || typeof body !== 'object' || !('branch' in body) || typeof body.branch !== 'string') {
return json({ error: 'Invalid request body: branch is required and must be a string' }, { status: 400 });
}
const { branch } = body as UpdateRequestBody;
// Instead of direct Git operations, we'll return instructions
return json({
success: true,
message: 'Please update manually using the following steps:',
instructions: [
`1. git fetch origin ${branch}`,
`2. git pull origin ${branch}`,
'3. pnpm install',
'4. pnpm build',
'5. Restart the application',
],
});
} catch (error) {
console.error('Update preparation failed:', error);
return json(
{
success: false,
error: error instanceof Error ? error.message : 'Unknown error occurred while preparing update',
},
{ status: 500 },
);
}
};