diff --git a/Dockerfile b/Dockerfile index aa6e0ce..e2a3dc9 100644 --- a/Dockerfile +++ b/Dockerfile @@ -27,12 +27,11 @@ ENV VITE_ANALYTICS_ENABLED=$VITE_ANALYTICS_ENABLED # Remove problematic packages from package.json to prevent them from being bundled RUN sed -i '/"mysql2"/d' package.json -RUN sed -i '/"drizzle-orm"/d' package.json +RUN sed -i '/"drizzle-orm"/d' package.json RUN sed -i '/"bcrypt"/d' package.json RUN sed -i '/"jsonwebtoken"/d' package.json RUN sed -i '/"@types\/bcrypt"/d' package.json RUN sed -i '/"@types\/jsonwebtoken"/d' package.json -RUN sed -i '/"nanoid"/d' package.json # Reinstall dependencies without server packages RUN npm install @@ -50,8 +49,8 @@ RUN echo "export const users = {}; export const scripts = {}; export const ratin # Create comprehensive mock API files using printf for reliable multiline content -# Mock API index with proper types and re-exports -RUN printf 'export const generateId = () => Math.random().toString(36).substr(2, 9);\nexport class ApiError extends Error {\n constructor(message: string, public status: number = 500) {\n super(message);\n this.name = "ApiError";\n }\n}\nexport * from "./scripts";\nexport * from "./users";\nexport * from "./ratings";\nexport * from "./analytics";\nexport * from "./collections";\nexport * from "./auth";' > src/lib/api/index.ts +# Mock API index with proper types and re-exports (keep nanoid import to match real API) +RUN printf 'import { nanoid } from "nanoid";\nexport const generateId = () => nanoid();\nexport class ApiError extends Error {\n constructor(message: string, public status: number = 500) {\n super(message);\n this.name = "ApiError";\n }\n}\nexport * from "./scripts";\nexport * from "./users";\nexport * from "./ratings";\nexport * from "./analytics";\nexport * from "./collections";\nexport * from "./auth";' > src/lib/api/index.ts # Mock auth API with individual function exports RUN printf 'export interface LoginCredentials {\n email: string;\n password: string;\n}\nexport interface RegisterData {\n email: string;\n username: string;\n displayName: string;\n password: string;\n}\nexport interface AuthToken {\n token: string;\n user: any;\n}\nexport async function login(credentials: LoginCredentials): Promise {\n return { token: "demo-token", user: { id: "1", username: "demo", email: "demo@example.com", displayName: "Demo User", isAdmin: false, isModerator: false } };\n}\nexport async function register(data: RegisterData): Promise {\n return { token: "demo-token", user: { id: "1", username: data.username, email: data.email, displayName: data.displayName, isAdmin: false, isModerator: false } };\n}\nexport async function refreshToken(token: string): Promise {\n return { token: "demo-token", user: { id: "1", username: "demo", email: "demo@example.com", displayName: "Demo User", isAdmin: false, isModerator: false } };\n}\nexport async function changePassword(userId: string, currentPassword: string, newPassword: string): Promise {\n return true;\n}' > src/lib/api/auth.ts