Skip to content

Commit ef8f74e

Browse files
committed
fix typecheck
1 parent 0d2b3b9 commit ef8f74e

3 files changed

Lines changed: 11 additions & 7 deletions

File tree

apps/backend/scripts/db-migrations.tsup.config.ts

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ const nodeBuiltins = builtinModules.flatMap((m) => [m, `node:${m}`]);
1212

1313
// tsup config to build the self-hosting migration script so it can be
1414
// run in the Docker container with no extra dependencies.
15+
type EsbuildPlugin = NonNullable<Options["esbuildPlugins"]>[number];
16+
const basePlugin = createBasePlugin({}) as unknown as EsbuildPlugin;
17+
1518
export default defineConfig({
1619
entry: ['scripts/db-migrations.ts'],
1720
format: ['esm'],
@@ -32,7 +35,6 @@ const __filename = __fileURLToPath(import.meta.url);
3235
const __dirname = __dirname_fn(__filename);
3336
const require = __createRequire(import.meta.url);`,
3437
},
35-
esbuildPlugins: [
36-
createBasePlugin({}),
37-
],
38+
// Cast to tsup's esbuild plugin type to avoid esbuild version mismatch in typecheck.
39+
esbuildPlugins: [basePlugin],
3840
} satisfies Options);

apps/backend/scripts/run-cron-jobs.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { StackAssertionError } from "@stackframe/stack-shared/dist/utils/errors"
33
import { runAsynchronously, wait } from "@stackframe/stack-shared/dist/utils/promises";
44

55
const endpoints = [
6-
"/api/latest/internal/external-db-sync/sequencer",
7-
"/api/latest/internal/external-db-sync/poller",
6+
"/api/latest/internal/external-db-sync/sequencer",
7+
"/api/latest/internal/external-db-sync/poller",
88
];
99

1010
async function main() {
@@ -29,7 +29,7 @@ async function main() {
2929
// Vercel only guarantees minute-granularity for cron jobs, so we randomize the interval
3030
await wait(Math.random() * 120_000);
3131
}
32-
});
32+
});
3333
}
3434
}
3535

apps/backend/src/app/api/latest/internal/external-db-sync/poller/route.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { upstash } from "@/lib/upstash";
22
import { globalPrismaClient, retryTransaction } from "@/prisma-client";
33
import { createSmartRouteHandler } from "@/route-handlers/smart-route-handler";
4-
import { OutgoingRequest } from "@prisma/client";
4+
import type { OutgoingRequest } from "@/generated/prisma/client";
55
import {
66
yupBoolean,
77
yupNumber,
@@ -13,6 +13,7 @@ import { getEnvVariable, getNodeEnvironment } from "@stackframe/stack-shared/dis
1313
import { captureError, StatusError } from "@stackframe/stack-shared/dist/utils/errors";
1414
import { wait } from "@stackframe/stack-shared/dist/utils/promises";
1515

16+
1617
export const GET = createSmartRouteHandler({
1718
metadata: {
1819
summary: "Poll outgoing requests and push to QStash",
@@ -71,6 +72,7 @@ export const GET = createSmartRouteHandler({
7172

7273
for (const request of requests) {
7374
try {
75+
// Prisma JsonValue doesn't carry a precise shape for this JSON blob.
7476
const options = request.qstashOptions as any;
7577
const baseUrl = getEnvVariable("NEXT_PUBLIC_STACK_API_URL");
7678

0 commit comments

Comments
 (0)