Skip to content

Commit 968ab74

Browse files
committed
fix(fe): bring back ts type check
1 parent 8ef51b0 commit 968ab74

31 files changed

+871
-853
lines changed

.github/workflows/fe-pull-request.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ on:
44
pull_request:
55
paths:
66
- frontend/**
7-
- sdks/typescript/runner/**
7+
- engine/sdks/typescript/**
8+
- rivetkit-typescript/**
89

910
jobs:
1011
quality:
@@ -15,4 +16,20 @@ jobs:
1516
with:
1617
version: latest
1718
- name: Run Biome
18-
run: biome check . --reporter=github
19+
run: biome check . --reporter=github
20+
working-directory: ./frontend
21+
tsc:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- uses: actions/checkout@v4
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v3
27+
with:
28+
node-version: '20'
29+
cache: 'pnpm'
30+
- name: Install Dependencies
31+
run: pnpm install
32+
working-directory: ./frontend
33+
- name: Run TypeScript Compiler
34+
run: pnpm ts-check
35+
working-directory: ./frontend

frontend/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -86,8 +86,8 @@
8686
"@types/lodash": "^4.17.20",
8787
"@types/mdx": "^2.0.13",
8888
"@types/node": "^20.19.13",
89-
"@types/react": "^18.3.24",
90-
"@types/react-dom": "^18.3.7",
89+
"@types/react": "^19",
90+
"@types/react-dom": "^19",
9191
"@uiw/codemirror-extensions-basic-setup": "^4.25.1",
9292
"@uiw/codemirror-theme-github": "^4.25.1",
9393
"@uiw/react-codemirror": "^4.25.1",

frontend/src/app.tsx

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,18 @@ import type { Clerk } from "@clerk/clerk-js";
22
import * as Sentry from "@sentry/react";
33
import { QueryClientProvider } from "@tanstack/react-query";
44
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
5-
import { createRouter, Link, RouterProvider } from "@tanstack/react-router";
5+
import { createRouter, RouterProvider } from "@tanstack/react-router";
66
import { Suspense } from "react";
77
import {
8-
Button,
9-
Card,
10-
CardContent,
11-
CardDescription,
12-
CardHeader,
13-
CardTitle,
148
ConfigProvider,
159
FullscreenLoading,
1610
getConfig,
17-
H2,
1811
ThirdPartyProviders,
1912
Toaster,
2013
TooltipProvider,
2114
} from "@/components";
2215
import { NotFoundCard } from "./app/not-found-card";
2316
import { RouteLayout } from "./app/route-layout";
24-
import { RootLayout } from "./components/layout";
2517
import { clerk } from "./lib/auth";
2618
import { queryClient } from "./queries/global";
2719
import { routeTree } from "./routeTree.gen";

frontend/src/app/data-providers/cloud-data-provider.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Clerk } from "@clerk/clerk-js";
22
import { type Rivet, RivetClient } from "@rivet-gg/cloud";
33
import { type FetchFunction, fetcher } from "@rivetkit/engine-api-full/core";
4-
import { infiniteQueryOptions, queryOptions } from "@tanstack/react-query";
4+
import { infiniteQueryOptions, QueryKey, QueryOptions, queryOptions, UseQueryOptions } from "@tanstack/react-query";
55
import { cloudEnv } from "@/lib/env";
66
import { queryClient } from "@/queries/global";
77
import { RECORDS_PER_PAGE } from "./default-data-provider";
@@ -360,7 +360,7 @@ export const createNamespaceContext = ({
360360
currentNamespaceAccessTokenQueryOptions() {
361361
return parent.accessTokenQueryOptions({ namespace });
362362
},
363-
engineAdminTokenQueryOptions() {
363+
engineAdminTokenQueryOptions(): UseQueryOptions<string> {
364364
return queryOptions({
365365
staleTime: 5 * 60 * 1000, // 5 minutes
366366
gcTime: 5 * 60 * 1000, // 5 minutes
@@ -372,7 +372,7 @@ export const createNamespaceContext = ({
372372
},
373373
"tokens",
374374
"engine-admin",
375-
],
375+
] as QueryKey,
376376
queryFn: async () => {
377377
const f = parent.client.namespaces.createSecretToken(
378378
parent.project,

frontend/src/app/data-providers/default-data-provider.tsx

Lines changed: 16 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,10 @@
11
import {
22
infiniteQueryOptions,
3+
mutationOptions,
34
type MutationOptions,
5+
QueryKey,
46
queryOptions,
7+
UseInfiniteQueryOptions,
58
} from "@tanstack/react-query";
69
import type {
710
ActorId,
@@ -73,7 +76,7 @@ const defaultContext = {
7376
},
7477
actorsQueryOptions(opts: ActorQueryOptions) {
7578
return infiniteQueryOptions({
76-
queryKey: ["actors", opts],
79+
queryKey: ["actors", opts] as QueryKey,
7780
initialPageParam: undefined as string | undefined,
7881
enabled: false,
7982
refetchInterval: 2000,
@@ -101,7 +104,7 @@ const defaultContext = {
101104

102105
buildsQueryOptions() {
103106
return infiniteQueryOptions({
104-
queryKey: ["actors", "builds"],
107+
queryKey: ["actors", "builds"] as QueryKey,
105108
enabled: false,
106109
initialPageParam: undefined as string | undefined,
107110
refetchInterval: 2000,
@@ -159,7 +162,7 @@ const defaultContext = {
159162
queryFn: async () => {
160163
return {} as Actor;
161164
},
162-
queryKey: ["actor", actorId],
165+
queryKey: ["actor", actorId] as QueryKey,
163166
});
164167
},
165168

@@ -217,7 +220,7 @@ const defaultContext = {
217220
},
218221
actorBuildQueryOptions(actorId: ActorId) {
219222
return queryOptions({
220-
queryKey: ["actor", actorId, "build"],
223+
queryKey: ["actor", actorId, "build"] as QueryKey,
221224
queryFn: async () => {
222225
throw new Error("Not implemented");
223226
return {} as Build;
@@ -227,7 +230,7 @@ const defaultContext = {
227230
},
228231
actorMetricsQueryOptions(actorId: ActorId) {
229232
return queryOptions({
230-
queryKey: ["actor", actorId, "metrics"],
233+
queryKey: ["actor", actorId, "metrics"] as QueryKey,
231234
queryFn: async () => {
232235
throw new Error("Not implemented");
233236
return {} as ActorMetrics;
@@ -249,7 +252,7 @@ const defaultContext = {
249252
},
250253
actorDestroyMutationOptions(actorId: ActorId) {
251254
return {
252-
mutationKey: ["actor", actorId, "destroy"],
255+
mutationKey: ["actor", actorId, "destroy"] as QueryKey,
253256
mutationFn: async () => {
254257
return;
255258
},
@@ -267,7 +270,7 @@ const defaultContext = {
267270
},
268271
actorLogsQueryOptions(actorId: ActorId) {
269272
return infiniteQueryOptions({
270-
queryKey: ["actor", actorId, "logs"],
273+
queryKey: ["actor", actorId, "logs"] as QueryKey,
271274
initialPageParam: null as string | null,
272275
queryFn: async () => {
273276
throw new Error("Not implemented");
@@ -316,7 +319,7 @@ const defaultContext = {
316319
// #endregion
317320
regionsQueryOptions() {
318321
return infiniteQueryOptions({
319-
queryKey: ["actor", "regions"],
322+
queryKey: ["actor", "regions"] as QueryKey,
320323
initialPageParam: null as string | null,
321324
queryFn: async () => {
322325
throw new Error("Not implemented");
@@ -328,7 +331,7 @@ const defaultContext = {
328331
},
329332
regionQueryOptions(regionId: string | undefined) {
330333
return queryOptions({
331-
queryKey: ["actor", "region", regionId],
334+
queryKey: ["actor", "region", regionId] as QueryKey,
332335
enabled: !!regionId,
333336
queryFn: async () => {
334337
throw new Error("Not implemented");
@@ -338,7 +341,7 @@ const defaultContext = {
338341
},
339342
statusQueryOptions() {
340343
return queryOptions({
341-
queryKey: ["status"],
344+
queryKey: ["status"] as QueryKey,
342345
refetchInterval: 1000,
343346
enabled: false,
344347
retry: 0,
@@ -349,8 +352,8 @@ const defaultContext = {
349352
});
350353
},
351354
createActorMutationOptions() {
352-
return {
353-
mutationKey: ["createActor"],
355+
return mutationOptions({
356+
mutationKey: ["createActor"] as QueryKey,
354357
mutationFn: async (_: CreateActor) => {
355358
throw new Error("Not implemented");
356359
return "";
@@ -365,7 +368,7 @@ const defaultContext = {
365368
},
366369
});
367370
},
368-
};
371+
});
369372
},
370373
};
371374

0 commit comments

Comments
 (0)