Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions apps/scout/convex/http.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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"]) {
Expand Down
4 changes: 3 additions & 1 deletion apps/scout/convex/polar.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down
4 changes: 2 additions & 2 deletions apps/scout/convex/siteVersion.ts
Original file line number Diff line number Diff line change
@@ -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,
});
2 changes: 1 addition & 1 deletion apps/scout/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
16 changes: 8 additions & 8 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading