Skip to content

Commit 638456a

Browse files
committed
Refactor code structure for improved readability and maintainability
1 parent 6711189 commit 638456a

4 files changed

Lines changed: 9066 additions & 6 deletions

File tree

Dockerfile

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,16 @@ RUN apt-get update \
77
&& rm -rf /var/lib/apt/lists/*
88
WORKDIR /app
99

10+
11+
1012
FROM base AS deps
1113

12-
COPY package.json package-lock.json* ./
13-
RUN if [ -f package-lock.json ]; then npm ci; else npm install; fi
14+
COPY package.json package-lock.json ./
15+
RUN --mount=type=cache,target=/root/.npm \
16+
npm ci \
17+
&& npm install --no-save --ignore-scripts \
18+
@tailwindcss/oxide-linux-x64-gnu@4.1.18 \
19+
lightningcss-linux-x64-gnu@1.30.2
1420

1521
FROM base AS builder
1622

@@ -31,8 +37,9 @@ FROM base AS runner
3137
ENV NODE_ENV=production
3238
ENV NEXT_TELEMETRY_DISABLED=1
3339

34-
COPY package.json package-lock.json* ./
35-
RUN if [ -f package-lock.json ]; then npm ci --only=production; else npm install --only=production; fi
40+
COPY package.json package-lock.json ./
41+
RUN --mount=type=cache,target=/root/.npm \
42+
npm ci --omit=dev
3643

3744
COPY --from=builder /app/.next ./.next
3845
COPY --from=builder /app/public ./public

components/ai-elements/message.tsx

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ import {
3535
useState,
3636
} from "react";
3737
import { Streamdown } from "streamdown";
38-
import type { ExtraProps } from "streamdown";
3938

4039
export type MessageProps = HTMLAttributes<HTMLDivElement> & {
4140
from: UIMessage["role"];
@@ -392,7 +391,7 @@ const MarkdownCode = ({
392391
);
393392
};
394393

395-
const MarkdownPre = ({ children }: ComponentProps<"pre"> & ExtraProps) => children;
394+
const MarkdownPre = ({ children }: ComponentProps<"pre">) => children;
396395

397396
export const MessageResponse = memo(
398397
({ className, components, ...props }: MessageResponseProps) => (

docker-compose.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ services:
44
context: .
55
dockerfile: Dockerfile
66
args:
7+
NPM_CONFIG_REGISTRY: ${NPM_CONFIG_REGISTRY:-https://registry.npmjs.org/}
78
PUBLIC_SUPABASE_URL: ${PUBLIC_SUPABASE_URL}
89
PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY: ${PUBLIC_SUPABASE_PUBLISHABLE_DEFAULT_KEY}
910
environment:

0 commit comments

Comments
 (0)