From 11811819f13368c4288d0e4967c03e8707da4ccc Mon Sep 17 00:00:00 2001 From: h Date: Wed, 21 Jan 2026 01:31:01 +0100 Subject: [PATCH] fix(frontend): not building --- docker-compose.yml | 4 ++ frontend/.gitignore | 3 - frontend/Dockerfile | 11 ++-- frontend/bun.lock | 1 - frontend/src/convex/_generated/api.d.ts | 35 ------------ frontend/src/lib/convex/_generated/api.d.ts | 55 +++++++++++++++++++ .../src/{ => lib}/convex/_generated/api.js | 2 +- .../convex/_generated/dataModel.d.ts | 37 +++++++------ .../{ => lib}/convex/_generated/server.d.ts | 34 ++++++------ .../src/{ => lib}/convex/_generated/server.js | 16 +++--- frontend/svelte.config.js | 20 +++---- frontend/vite.config.ts | 4 +- 12 files changed, 121 insertions(+), 101 deletions(-) delete mode 100644 frontend/src/convex/_generated/api.d.ts create mode 100644 frontend/src/lib/convex/_generated/api.d.ts rename frontend/src/{ => lib}/convex/_generated/api.js (87%) rename frontend/src/{ => lib}/convex/_generated/dataModel.d.ts (60%) rename frontend/src/{ => lib}/convex/_generated/server.d.ts (89%) rename frontend/src/{ => lib}/convex/_generated/server.js (95%) diff --git a/docker-compose.yml b/docker-compose.yml index 35fb8a0..a2a9adf 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -69,6 +69,8 @@ services: build: context: ./frontend dockerfile: Dockerfile + args: + - PUBLIC_CONVEX_URL=${PUBLIC_CONVEX_URL} image: stealth-ai-relay/frontend profiles: - frontend @@ -85,6 +87,8 @@ services: build: context: ./frontend dockerfile: Dockerfile + args: + - PUBLIC_CONVEX_URL=${PUBLIC_CONVEX_URL} image: stealth-ai-relay/frontend volumes: - ./frontend:/app diff --git a/frontend/.gitignore b/frontend/.gitignore index f118987..3b462cb 100644 --- a/frontend/.gitignore +++ b/frontend/.gitignore @@ -21,6 +21,3 @@ Thumbs.db # Vite vite.config.js.timestamp-* vite.config.ts.timestamp-* - -# Convex -src/lib/convex/_generated diff --git a/frontend/Dockerfile b/frontend/Dockerfile index b7d85f7..38730ca 100644 --- a/frontend/Dockerfile +++ b/frontend/Dockerfile @@ -3,15 +3,14 @@ FROM oven/bun:alpine ENV TERM=xterm-256color ENV COLORTERM=truecolor +ARG PUBLIC_CONVEX_URL +ENV PUBLIC_CONVEX_URL=$PUBLIC_CONVEX_URL + WORKDIR /app -COPY package.json bun.lock* ./ - -RUN bun install --frozen-lockfile - COPY . . -RUN bun --bun svelte-kit sync -RUN bun --bun run build +RUN bun i +RUN bun run build ENTRYPOINT ["bun"] diff --git a/frontend/bun.lock b/frontend/bun.lock index e772d16..8f6e8b2 100644 --- a/frontend/bun.lock +++ b/frontend/bun.lock @@ -1,6 +1,5 @@ { "lockfileVersion": 1, - "configVersion": 0, "workspaces": { "": { "name": "frontend", diff --git a/frontend/src/convex/_generated/api.d.ts b/frontend/src/convex/_generated/api.d.ts deleted file mode 100644 index 7211fce..0000000 --- a/frontend/src/convex/_generated/api.d.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* eslint-disable */ -/** - * Generated `api` utility. - * - * THIS CODE IS AUTOMATICALLY GENERATED. - * - * To regenerate, run `npx convex dev`. - * @module - */ - -import type { ApiFromModules, FilterApi, FunctionReference } from 'convex/server'; - -declare const fullApi: ApiFromModules<{}>; - -/** - * A utility for referencing Convex functions in your app's public API. - * - * Usage: - * ```js - * const myFunctionReference = api.myModule.myFunction; - * ``` - */ -export declare const api: FilterApi>; - -/** - * A utility for referencing Convex functions in your app's internal API. - * - * Usage: - * ```js - * const myFunctionReference = internal.myModule.myFunction; - * ``` - */ -export declare const internal: FilterApi>; - -export declare const components: {}; diff --git a/frontend/src/lib/convex/_generated/api.d.ts b/frontend/src/lib/convex/_generated/api.d.ts new file mode 100644 index 0000000..1f51849 --- /dev/null +++ b/frontend/src/lib/convex/_generated/api.d.ts @@ -0,0 +1,55 @@ +/* eslint-disable */ +/** + * Generated `api` utility. + * + * THIS CODE IS AUTOMATICALLY GENERATED. + * + * To regenerate, run `npx convex dev`. + * @module + */ + +import type * as chats from "../chats.js"; +import type * as messages from "../messages.js"; +import type * as pendingGenerations from "../pendingGenerations.js"; +import type * as users from "../users.js"; + +import type { + ApiFromModules, + FilterApi, + FunctionReference, +} from "convex/server"; + +declare const fullApi: ApiFromModules<{ + chats: typeof chats; + messages: typeof messages; + pendingGenerations: typeof pendingGenerations; + users: typeof users; +}>; + +/** + * A utility for referencing Convex functions in your app's public API. + * + * Usage: + * ```js + * const myFunctionReference = api.myModule.myFunction; + * ``` + */ +export declare const api: FilterApi< + typeof fullApi, + FunctionReference +>; + +/** + * A utility for referencing Convex functions in your app's internal API. + * + * Usage: + * ```js + * const myFunctionReference = internal.myModule.myFunction; + * ``` + */ +export declare const internal: FilterApi< + typeof fullApi, + FunctionReference +>; + +export declare const components: {}; diff --git a/frontend/src/convex/_generated/api.js b/frontend/src/lib/convex/_generated/api.js similarity index 87% rename from frontend/src/convex/_generated/api.js rename to frontend/src/lib/convex/_generated/api.js index 24593c7..44bf985 100644 --- a/frontend/src/convex/_generated/api.js +++ b/frontend/src/lib/convex/_generated/api.js @@ -8,7 +8,7 @@ * @module */ -import { anyApi, componentsGeneric } from 'convex/server'; +import { anyApi, componentsGeneric } from "convex/server"; /** * A utility for referencing Convex functions in your app's API. diff --git a/frontend/src/convex/_generated/dataModel.d.ts b/frontend/src/lib/convex/_generated/dataModel.d.ts similarity index 60% rename from frontend/src/convex/_generated/dataModel.d.ts rename to frontend/src/lib/convex/_generated/dataModel.d.ts index 4fcece6..f97fd19 100644 --- a/frontend/src/convex/_generated/dataModel.d.ts +++ b/frontend/src/lib/convex/_generated/dataModel.d.ts @@ -8,29 +8,29 @@ * @module */ -import { AnyDataModel } from 'convex/server'; -import type { GenericId } from 'convex/values'; - -/** - * No `schema.ts` file found! - * - * This generated code has permissive types like `Doc = any` because - * Convex doesn't know your schema. If you'd like more type safety, see - * https://docs.convex.dev/using/schemas for instructions on how to add a - * schema file. - * - * After you change a schema, rerun codegen with `npx convex dev`. - */ +import type { + DataModelFromSchemaDefinition, + DocumentByName, + TableNamesInDataModel, + SystemTableNames, +} from "convex/server"; +import type { GenericId } from "convex/values"; +import schema from "../schema.js"; /** * The names of all of your Convex tables. */ -export type TableNames = string; +export type TableNames = TableNamesInDataModel; /** * The type of a document stored in Convex. + * + * @typeParam TableName - A string literal type of the table name (like "users"). */ -export type Doc = any; +export type Doc = DocumentByName< + DataModel, + TableName +>; /** * An identifier for a document in Convex. @@ -42,8 +42,11 @@ export type Doc = any; * * IDs are just strings at runtime, but this type can be used to distinguish them from other * strings when type checking. + * + * @typeParam TableName - A string literal type of the table name (like "users"). */ -export type Id = GenericId; +export type Id = + GenericId; /** * A type describing your Convex data model. @@ -54,4 +57,4 @@ export type Id = GenericId * This type is used to parameterize methods like `queryGeneric` and * `mutationGeneric` to make them type-safe. */ -export type DataModel = AnyDataModel; +export type DataModel = DataModelFromSchemaDefinition; diff --git a/frontend/src/convex/_generated/server.d.ts b/frontend/src/lib/convex/_generated/server.d.ts similarity index 89% rename from frontend/src/convex/_generated/server.d.ts rename to frontend/src/lib/convex/_generated/server.d.ts index 1cc047e..bec05e6 100644 --- a/frontend/src/convex/_generated/server.d.ts +++ b/frontend/src/lib/convex/_generated/server.d.ts @@ -9,17 +9,17 @@ */ import { - ActionBuilder, - HttpActionBuilder, - MutationBuilder, - QueryBuilder, - GenericActionCtx, - GenericMutationCtx, - GenericQueryCtx, - GenericDatabaseReader, - GenericDatabaseWriter -} from 'convex/server'; -import type { DataModel } from './dataModel.js'; + ActionBuilder, + HttpActionBuilder, + MutationBuilder, + QueryBuilder, + GenericActionCtx, + GenericMutationCtx, + GenericQueryCtx, + GenericDatabaseReader, + GenericDatabaseWriter, +} from "convex/server"; +import type { DataModel } from "./dataModel.js"; /** * Define a query in this Convex app's public API. @@ -29,7 +29,7 @@ import type { DataModel } from './dataModel.js'; * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export declare const query: QueryBuilder; +export declare const query: QueryBuilder; /** * Define a query that is only accessible from other Convex functions (but not from the client). @@ -39,7 +39,7 @@ export declare const query: QueryBuilder; * @param func - The query function. It receives a {@link QueryCtx} as its first argument. * @returns The wrapped query. Include this as an `export` to name it and make it accessible. */ -export declare const internalQuery: QueryBuilder; +export declare const internalQuery: QueryBuilder; /** * Define a mutation in this Convex app's public API. @@ -49,7 +49,7 @@ export declare const internalQuery: QueryBuilder; * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export declare const mutation: MutationBuilder; +export declare const mutation: MutationBuilder; /** * Define a mutation that is only accessible from other Convex functions (but not from the client). @@ -59,7 +59,7 @@ export declare const mutation: MutationBuilder; * @param func - The mutation function. It receives a {@link MutationCtx} as its first argument. * @returns The wrapped mutation. Include this as an `export` to name it and make it accessible. */ -export declare const internalMutation: MutationBuilder; +export declare const internalMutation: MutationBuilder; /** * Define an action in this Convex app's public API. @@ -72,7 +72,7 @@ export declare const internalMutation: MutationBuilder; * @param func - The action. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped action. Include this as an `export` to name it and make it accessible. */ -export declare const action: ActionBuilder; +export declare const action: ActionBuilder; /** * Define an action that is only accessible from other Convex functions (but not from the client). @@ -80,7 +80,7 @@ export declare const action: ActionBuilder; * @param func - The function. It receives an {@link ActionCtx} as its first argument. * @returns The wrapped function. Include this as an `export` to name it and make it accessible. */ -export declare const internalAction: ActionBuilder; +export declare const internalAction: ActionBuilder; /** * Define an HTTP action. diff --git a/frontend/src/convex/_generated/server.js b/frontend/src/lib/convex/_generated/server.js similarity index 95% rename from frontend/src/convex/_generated/server.js rename to frontend/src/lib/convex/_generated/server.js index a18aa28..bf3d25a 100644 --- a/frontend/src/convex/_generated/server.js +++ b/frontend/src/lib/convex/_generated/server.js @@ -9,14 +9,14 @@ */ import { - actionGeneric, - httpActionGeneric, - queryGeneric, - mutationGeneric, - internalActionGeneric, - internalMutationGeneric, - internalQueryGeneric -} from 'convex/server'; + actionGeneric, + httpActionGeneric, + queryGeneric, + mutationGeneric, + internalActionGeneric, + internalMutationGeneric, + internalQueryGeneric, +} from "convex/server"; /** * Define a query in this Convex app's public API. diff --git a/frontend/svelte.config.js b/frontend/svelte.config.js index 1d5479b..b787fcb 100644 --- a/frontend/svelte.config.js +++ b/frontend/svelte.config.js @@ -1,18 +1,18 @@ import adapter from 'svelte-adapter-bun'; -import { vitePreprocess } from '@sveltejs/vite-plugin-svelte'; +import {vitePreprocess} from '@sveltejs/vite-plugin-svelte'; /** @type {import('@sveltejs/kit').Config} */ const config = { - // Consult https://svelte.dev/docs/kit/integrations - // for more information about preprocessors - preprocess: vitePreprocess(), + // Consult https://svelte.dev/docs/kit/integrations + // for more information about preprocessors + preprocess: vitePreprocess(), - kit: { - // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list. - // If your environment is not supported, or you settled on a specific environment, switch out the adapter. - // See https://svelte.dev/docs/kit/adapters for more information about adapters. - adapter: adapter() - } + kit: { + // adapter-auto only supports some environments, see https://svelte.dev/docs/kit/adapter-auto for a list. + // If your environment is not supported, or you settled on a specific environment, switch out the adapter. + // See https://svelte.dev/docs/kit/adapters for more information about adapters. + adapter: adapter() + } }; export default config; diff --git a/frontend/vite.config.ts b/frontend/vite.config.ts index 2d35c4f..56f40c7 100644 --- a/frontend/vite.config.ts +++ b/frontend/vite.config.ts @@ -2,6 +2,4 @@ import tailwindcss from '@tailwindcss/vite'; import { sveltekit } from '@sveltejs/kit/vite'; import { defineConfig } from 'vite'; -export default defineConfig({ - plugins: [tailwindcss(), sveltekit()] -}); +export default defineConfig({ plugins: [tailwindcss(), sveltekit()] });