Skip to content

Commit 9ea7f90

Browse files
Revert chunking configuration
This commit reverts the recent changes to the chunking configuration in vite.config.ts due to build failures.
1 parent c98e133 commit 9ea7f90

6 files changed

Lines changed: 55 additions & 42 deletions

File tree

src/App.tsx

Lines changed: 33 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -5,34 +5,34 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
55
import { BrowserRouter, Routes, Route, Navigate, useParams } from "react-router";
66
import { AuthProvider, useAuth } from "./hooks/useAuth";
77
import { TagsProvider } from "./contexts/TagsContext";
8-
import { lazy, Suspense } from "react";
8+
import * as React from "react";
99

1010
// Lazy-loaded components
11-
const DashboardLayout = lazy(() => import("./components/layout/DashboardLayout"));
12-
const Dashboard = lazy(() => import("./pages/Dashboard"));
13-
const ProjectsPage = lazy(() => import("./pages/ProjectsPage"));
14-
const ProjectDetailPage = lazy(() => import("./pages/projects/ProjectDetailPage"));
15-
const AIToolsPage = lazy(() => import("./pages/AIToolsPage"));
16-
const ApplicationsPage = lazy(() => import("./pages/ApplicationsPage"));
17-
const ServersPage = lazy(() => import("./pages/ServersPage"));
18-
const ProfilePage = lazy(() => import("./pages/ProfilePage"));
19-
const LoginPage = lazy(() => import("./pages/auth/LoginPage"));
20-
const RegisterPage = lazy(() => import("./pages/auth/RegisterPage"));
21-
const NotFound = lazy(() => import("./pages/NotFound"));
22-
const LandingPage = lazy(() => import("./pages/LandingPage"));
23-
const OrganizationsPage = lazy(() => import("./pages/OrganizationsPage"));
24-
const OrganizationDetailPage = lazy(() => import("./pages/OrganizationDetailPage"));
25-
26-
const NewProjectPage = lazy(() => import("./pages/projects/NewProjectPage"));
27-
const NewApplicationPage = lazy(() => import("./pages/applications/NewApplicationPage"));
28-
const NewServerPage = lazy(() => import("./pages/servers/NewServerPage"));
29-
const NewToolPage = lazy(() => import("./pages/ai-tools/NewToolPage"));
30-
31-
const ApplicationDetailPage = lazy(() => import("./pages/applications/ApplicationDetailPage"));
32-
const ApiFormPage = lazy(() => import("./pages/applications/api/ApiFormPage"));
33-
const ServiceFormPage = lazy(() => import("./pages/applications/service/ServiceFormPage"));
34-
const MessageFormPage = lazy(() => import("./pages/applications/message/MessageFormPage"));
35-
const ServerDetailPage = lazy(() => import("./pages/servers/ServerDetailPage"));
11+
const DashboardLayout = React.lazy(() => import("./components/layout/DashboardLayout"));
12+
const Dashboard = React.lazy(() => import("./pages/Dashboard"));
13+
const ProjectsPage = React.lazy(() => import("./pages/ProjectsPage"));
14+
const ProjectDetailPage = React.lazy(() => import("./pages/projects/ProjectDetailPage"));
15+
const AIToolsPage = React.lazy(() => import("./pages/AIToolsPage"));
16+
const ApplicationsPage = React.lazy(() => import("./pages/ApplicationsPage"));
17+
const ServersPage = React.lazy(() => import("./pages/ServersPage"));
18+
const ProfilePage = React.lazy(() => import("./pages/ProfilePage"));
19+
const LoginPage = React.lazy(() => import("./pages/auth/LoginPage"));
20+
const RegisterPage = React.lazy(() => import("./pages/auth/RegisterPage"));
21+
const NotFound = React.lazy(() => import("./pages/NotFound"));
22+
const LandingPage = React.lazy(() => import("./pages/LandingPage"));
23+
const OrganizationsPage = React.lazy(() => import("./pages/OrganizationsPage"));
24+
const OrganizationDetailPage = React.lazy(() => import("./pages/OrganizationDetailPage"));
25+
26+
const NewProjectPage = React.lazy(() => import("./pages/projects/NewProjectPage"));
27+
const NewApplicationPage = React.lazy(() => import("./pages/applications/NewApplicationPage"));
28+
const NewServerPage = React.lazy(() => import("./pages/servers/NewServerPage"));
29+
const NewToolPage = React.lazy(() => import("./pages/ai-tools/NewToolPage"));
30+
31+
const ApplicationDetailPage = React.lazy(() => import("./pages/applications/ApplicationDetailPage"));
32+
const ApiFormPage = React.lazy(() => import("./pages/applications/api/ApiFormPage"));
33+
const ServiceFormPage = React.lazy(() => import("./pages/applications/service/ServiceFormPage"));
34+
const MessageFormPage = React.lazy(() => import("./pages/applications/message/MessageFormPage"));
35+
const ServerDetailPage = React.lazy(() => import("./pages/servers/ServerDetailPage"));
3636

3737
const queryClient = new QueryClient({
3838
defaultOptions: {
@@ -44,7 +44,7 @@ const queryClient = new QueryClient({
4444
});
4545

4646
const AuthenticatedRoute = ({ children }: { children: React.ReactNode }) => {
47-
const { session, loading } = useAuth();
47+
const { user, loading } = useAuth();
4848

4949
if (loading) {
5050
return <div className="flex h-screen w-full items-center justify-center">Loading...</div>;
@@ -54,13 +54,13 @@ const AuthenticatedRoute = ({ children }: { children: React.ReactNode }) => {
5454
};
5555

5656
const RedirectIfAuthenticated = ({ children }: { children: React.ReactNode }) => {
57-
const { session, loading } = useAuth();
57+
const { user, loading } = useAuth();
5858

5959
if (loading) {
6060
return <div className="flex h-screen w-full items-center justify-center">Loading...</div>;
6161
}
6262

63-
if (session.user) {
63+
if (user) {
6464
return <Navigate to="/" replace />;
6565
}
6666

@@ -82,9 +82,9 @@ const RedirectWithSlug: React.FC<RedirectWithSlugProps> = ({ path }) => {
8282
};
8383

8484
const AppRoutes = () => {
85-
const { session } = useAuth();
85+
const { user } = useAuth();
8686

87-
if (!session.user && window.location.pathname === '/') {
87+
if (!user && window.location.pathname === '/') {
8888
return (
8989
<Routes>
9090
<Route element={<DashboardLayout />}>
@@ -182,9 +182,9 @@ const App = () => {
182182
<BrowserRouter>
183183
<AuthProvider>
184184
<TagsProvider>
185-
<Suspense fallback={<div className="flex h-screen w-full items-center justify-center">Loading...</div>}>
185+
<React.Suspense fallback={<div className="flex h-screen w-full items-center justify-center">Loading...</div>}>
186186
<AppRoutes />
187-
</Suspense>
187+
</React.Suspense>
188188
</TagsProvider>
189189
</AuthProvider>
190190
</BrowserRouter>

src/components/servers/ServersList.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Server as ServerType } from '@/types/server';
44
import ServerCard from './ServerCard';
55
import ServerSkeleton from './ServerSkeleton';
66
import EmptyServerState from './EmptyServerState';
7-
import { Tag } from '@/types/application';
7+
import { Tag } from '@/types/tag';
88

99
interface ServersListProps {
1010
servers: ServerType[];

src/components/ui/badge.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ export interface BadgeProps
2828
extends React.HTMLAttributes<HTMLDivElement>,
2929
VariantProps<typeof badgeVariants> {
3030
children?: React.ReactNode;
31+
className?: string; // Add explicit className prop
3132
}
3233

3334
function Badge({ className, variant, children, ...props }: BadgeProps) {

src/hooks/useAuth.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1+
12
import * as React from 'react';
23
import { supabase } from '@/integrations/supabase/client';
3-
import { User } from '@/types/auth';
4+
import type { User } from '@supabase/supabase-js';
45

56
interface AuthContextType {
67
user: User | null;
@@ -33,7 +34,11 @@ export const AuthProvider: React.FC<{ children: React.ReactNode }> = ({ children
3334
const register = async (email: string) => {
3435
try {
3536
setLoading(true);
36-
const { error } = await supabase.auth.signUp({ email, options: { emailRedirectTo: `${window.location.origin}/profile` } });
37+
const { error } = await supabase.auth.signUp({
38+
email,
39+
password: crypto.randomUUID(), // Generate a random password as we're using OTP
40+
options: { emailRedirectTo: `${window.location.origin}/profile` }
41+
});
3742
if (error) throw error;
3843
alert('Check your email for the registration link!');
3944
} catch (error: any) {

src/types/server.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
1+
12
import { Tag } from './tag';
2-
import { ApplicationStatus } from './application';
3+
4+
// Define ApplicationStatus enum here instead of importing it
5+
export enum ApplicationStatus {
6+
ACTIVE = 'active',
7+
INACTIVE = 'inactive',
8+
MAINTENANCE = 'maintenance',
9+
DEVELOPMENT = 'development',
10+
DEPRECATED = 'deprecated',
11+
PLANNING = 'planning',
12+
}
313

414
export interface Server {
515
id: string;

src/vite-env.d.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11

22
/// <reference types="vite/client" />
33

4-
// Ensure React is properly recognized
5-
declare module 'react' {
6-
// Re-export all React types
7-
export * from 'react/index';
8-
}
4+
// This ensures React types are properly available throughout the application
5+
import * as React from 'react';

0 commit comments

Comments
 (0)