diff --git a/apps/scout/convex/http.ts b/apps/scout/convex/http.ts index 6be93d3..08242a6 100644 --- a/apps/scout/convex/http.ts +++ b/apps/scout/convex/http.ts @@ -2,7 +2,7 @@ import { httpRouter } from "convex/server"; import { routeAll } from "@samebase/convex-hosting"; import { components } from "./_generated/api"; import { handlePolarEvent } from "./polar"; -import { versionId } from "../.convex-hosting/version.js"; +import { assets } from "../.convex-hosting/version.js"; // Type only, nothing is bundled: the type of the server build imported below, so this file // typechecks before the first build. import type {} from "@samebase/convex-hosting-tanstack-start/server-build"; @@ -32,7 +32,7 @@ http.route({ // HEAD through GET. Convex picks an exact path, then the longest prefix, so the Polar webhook, the // Convex Auth component's /auth prefix, where it serves its key set, and the identity hub // component's /auth/hub prefix, where the hub returns to /auth/hub/callback, keep winning over "/". -const site = routeAll(http, components.hosting, versionId, server); +const site = routeAll({ http, component: components.hosting, assets, worker: server }); // Exact routes for the three session routes of src/server.ts: the /auth prefix of the component // would otherwise take them. for (const path of ["/auth/signin", "/auth/refresh", "/auth/signout"]) { diff --git a/apps/scout/convex/polar.test.ts b/apps/scout/convex/polar.test.ts index e5bbb85..7d3261a 100644 --- a/apps/scout/convex/polar.test.ts +++ b/apps/scout/convex/polar.test.ts @@ -13,7 +13,9 @@ import type { Doc } from "./_generated/dataModel"; // convex/http.ts imports the server build and the site version, which only a build and a deploy // write, and hands both to routeAll when it loads. The webhook route reads neither. vi.mock("../dist/server/server.js", () => ({ default: { fetch: async () => new Response() } })); -vi.mock("../.convex-hosting/version.js", () => ({ versionId: "test" })); +vi.mock("../.convex-hosting/version.js", () => ({ + assets: { format: 1, versionId: "test", markToken: "test", files: null }, +})); const modules = import.meta.glob("./**/*.ts"); const organizationId = "11111111-1111-4111-8111-111111111111"; diff --git a/apps/scout/convex/siteVersion.ts b/apps/scout/convex/siteVersion.ts index 372317b..977b56b 100644 --- a/apps/scout/convex/siteVersion.ts +++ b/apps/scout/convex/siteVersion.ts @@ -1,10 +1,10 @@ import { v } from "convex/values"; -import { versionId } from "../.convex-hosting/version.js"; +import { assets } from "../.convex-hosting/version.js"; // oxlint-disable-next-line no-restricted-imports -- Protocol boundary: the site version is public and has no viewer. import { query } from "./_generated/server"; export const get = query({ args: {}, returns: v.string(), - handler: () => versionId, + handler: () => assets.versionId, }); diff --git a/apps/scout/package.json b/apps/scout/package.json index eebad96..1f333c6 100644 --- a/apps/scout/package.json +++ b/apps/scout/package.json @@ -39,7 +39,7 @@ "@convex-dev/workpool": "^0.4.14", "@polar-sh/sdk": "1.0.2", "@samebase/convex-auth-tanstack-start": "^0.1.1", - "@samebase/convex-hosting": "^0.14.0", + "@samebase/convex-hosting": "^0.15.0", "@samebase/convex-hosting-tanstack-start": "^0.11.0", "@samebase/sidebars": "^0.1.2", "@shadcn/react": "^0.3.1", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 9de3201..9910065 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -278,11 +278,11 @@ importers: specifier: ^0.1.1 version: 0.1.1(@convex-dev/auth@2.0.0-beta.0(patch_hash=c2e6d018b2b58e882811ec97a38cb9c5d1e2c2e3bfb9ea735e7639b0decbf613)(@standard-schema/spec@1.1.0)(convex@1.48.0(react@19.3.1))(hono@4.13.16)(react@19.3.1)(typescript@7.0.2)(zod@4.6.7))(@convex-dev/react-query@0.1.0(@tanstack/react-query@5.104.5(@types/react@19.3.0)(react@19.3.1))(convex@1.48.0(react@19.3.1)))(@tanstack/react-router@1.170.45(react-dom@19.3.1(react@19.3.1))(react@19.3.1))(@tanstack/react-start@1.169.3(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(esbuild@0.27.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(rolldown@1.2.16))(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(convex@1.48.0(react@19.3.1))(react-dom@19.3.1(react@19.3.1))(react@19.3.1) '@samebase/convex-hosting': - specifier: ^0.14.0 - version: 0.14.0(convex@1.48.0(react@19.3.1)) + specifier: ^0.15.0 + version: 0.15.0(convex@1.48.0(react@19.3.1)) '@samebase/convex-hosting-tanstack-start': specifier: ^0.11.0 - version: 0.11.0(@samebase/convex-hosting@0.14.0(convex@1.48.0(react@19.3.1)))(@tanstack/react-start@1.169.3(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(esbuild@0.27.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(rolldown@1.2.16))(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(react-dom@19.3.1(react@19.3.1))(react@19.3.1) + version: 0.11.0(@samebase/convex-hosting@0.15.0(convex@1.48.0(react@19.3.1)))(@tanstack/react-start@1.169.3(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(esbuild@0.27.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(rolldown@1.2.16))(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(react-dom@19.3.1(react@19.3.1))(react@19.3.1) '@samebase/sidebars': specifier: ^0.1.2 version: 0.1.2(react-dom@19.3.1(react@19.3.1))(react@19.3.1) @@ -2674,8 +2674,8 @@ packages: '@samebase/convex-hosting': optional: true - '@samebase/convex-hosting@0.14.0': - resolution: {integrity: sha512-1tD9684ieAC8wAMrW4pZz5JGJ+PtY+/plYEIsraAX1CR1PAUqA7H94iC+YVKjCdHBLk+h4bjCWDXqwO7MPuvHQ==} + '@samebase/convex-hosting@0.15.0': + resolution: {integrity: sha512-sX+sxID16r56ZnTl6QiRa111VF5xoDW8/RryHh7Eerwx6unymsJx/1nW5fEjKAUrOm+k+ccV3UE3SpYXwNAZOQ==} engines: {node: '>=22'} hasBin: true peerDependencies: @@ -8267,16 +8267,16 @@ snapshots: optionalDependencies: '@convex-dev/react-query': 0.1.0(@tanstack/react-query@5.104.5(@types/react@19.3.0)(react@19.3.1))(convex@1.48.0(react@19.3.1)) - '@samebase/convex-hosting-tanstack-start@0.11.0(@samebase/convex-hosting@0.14.0(convex@1.48.0(react@19.3.1)))(@tanstack/react-start@1.169.3(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(esbuild@0.27.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(rolldown@1.2.16))(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': + '@samebase/convex-hosting-tanstack-start@0.11.0(@samebase/convex-hosting@0.15.0(convex@1.48.0(react@19.3.1)))(@tanstack/react-start@1.169.3(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(esbuild@0.27.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(rolldown@1.2.16))(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(react-dom@19.3.1(react@19.3.1))(react@19.3.1)': dependencies: '@tanstack/react-start': 1.169.3(@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1))(esbuild@0.27.0)(react-dom@19.3.1(react@19.3.1))(react@19.3.1)(rolldown@1.2.16) react: 19.3.1 react-dom: 19.3.1(react@19.3.1) vite: '@voidzero-dev/vite-plus-core@1.3.0(@types/node@24.19.2)(esbuild@0.27.0)(jiti@2.7.0)(typescript@7.0.2)(yaml@2.9.1)' optionalDependencies: - '@samebase/convex-hosting': 0.14.0(convex@1.48.0(react@19.3.1)) + '@samebase/convex-hosting': 0.15.0(convex@1.48.0(react@19.3.1)) - '@samebase/convex-hosting@0.14.0(convex@1.48.0(react@19.3.1))': + '@samebase/convex-hosting@0.15.0(convex@1.48.0(react@19.3.1))': dependencies: convex: 1.48.0(react@19.3.1) ignore: 7.0.12