Fix syntax highlighting theme resolution and update Docker build for restored API files

This commit is contained in:
2025-08-15 23:50:26 +01:00
parent 5d7a1cce2d
commit a96df855f5

View File

@ -32,7 +32,6 @@ 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<AuthToken> {\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<AuthToken> {\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<AuthToken> {\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<boolean> {\n return true;\n}' > src/lib/api/auth.ts