Skip to content
Closed
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
21 changes: 19 additions & 2 deletions .github/workflows/fe-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ on:
pull_request:
paths:
- frontend/**
- sdks/typescript/runner/**
- engine/sdks/typescript/**
- rivetkit-typescript/**

jobs:
quality:
Expand All @@ -15,4 +16,20 @@ jobs:
with:
version: latest
- name: Run Biome
run: biome check . --reporter=github
run: biome check . --reporter=github
working-directory: ./frontend
tsc:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'pnpm'
- name: Install Dependencies
run: pnpm install
working-directory: ./frontend
- name: Run TypeScript Compiler
run: pnpm ts-check
working-directory: ./frontend
4 changes: 2 additions & 2 deletions frontend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@
"@types/lodash": "^4.17.20",
"@types/mdx": "^2.0.13",
"@types/node": "^20.19.13",
"@types/react": "^18.3.24",
"@types/react-dom": "^18.3.7",
"@types/react": "^19",
"@types/react-dom": "^19",
"@uiw/codemirror-extensions-basic-setup": "^4.25.1",
"@uiw/codemirror-theme-github": "^4.25.1",
"@uiw/react-codemirror": "^4.25.1",
Expand Down
10 changes: 1 addition & 9 deletions frontend/src/app.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,26 +2,18 @@ import type { Clerk } from "@clerk/clerk-js";
import * as Sentry from "@sentry/react";
import { QueryClientProvider } from "@tanstack/react-query";
import { ReactQueryDevtools } from "@tanstack/react-query-devtools";
import { createRouter, Link, RouterProvider } from "@tanstack/react-router";
import { createRouter, RouterProvider } from "@tanstack/react-router";
import { Suspense } from "react";
import {
Button,
Card,
CardContent,
CardDescription,
CardHeader,
CardTitle,
ConfigProvider,
FullscreenLoading,
getConfig,
H2,
ThirdPartyProviders,
Toaster,
TooltipProvider,
} from "@/components";
import { NotFoundCard } from "./app/not-found-card";
import { RouteLayout } from "./app/route-layout";
import { RootLayout } from "./components/layout";
import { clerk } from "./lib/auth";
import { queryClient } from "./queries/global";
import { routeTree } from "./routeTree.gen";
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/app/data-providers/cloud-data-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Clerk } from "@clerk/clerk-js";
import { type Rivet, RivetClient } from "@rivet-gg/cloud";
import { type FetchFunction, fetcher } from "@rivetkit/engine-api-full/core";
import { infiniteQueryOptions, queryOptions } from "@tanstack/react-query";
import { infiniteQueryOptions, QueryKey, QueryOptions, queryOptions, UseQueryOptions } from "@tanstack/react-query";
import { cloudEnv } from "@/lib/env";
import { queryClient } from "@/queries/global";
import { RECORDS_PER_PAGE } from "./default-data-provider";
Expand Down Expand Up @@ -360,7 +360,7 @@ export const createNamespaceContext = ({
currentNamespaceAccessTokenQueryOptions() {
return parent.accessTokenQueryOptions({ namespace });
},
engineAdminTokenQueryOptions() {
engineAdminTokenQueryOptions(): UseQueryOptions<string> {
return queryOptions({
staleTime: 5 * 60 * 1000, // 5 minutes
gcTime: 5 * 60 * 1000, // 5 minutes
Expand All @@ -372,7 +372,7 @@ export const createNamespaceContext = ({
},
"tokens",
"engine-admin",
],
] as QueryKey,
queryFn: async () => {
const f = parent.client.namespaces.createSecretToken(
parent.project,
Expand Down
29 changes: 16 additions & 13 deletions frontend/src/app/data-providers/default-data-provider.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import {
infiniteQueryOptions,
mutationOptions,
type MutationOptions,
QueryKey,
queryOptions,
UseInfiniteQueryOptions,
} from "@tanstack/react-query";
import type {
ActorId,
Expand Down Expand Up @@ -73,7 +76,7 @@ const defaultContext = {
},
actorsQueryOptions(opts: ActorQueryOptions) {
return infiniteQueryOptions({
queryKey: ["actors", opts],
queryKey: ["actors", opts] as QueryKey,
initialPageParam: undefined as string | undefined,
enabled: false,
refetchInterval: 2000,
Expand Down Expand Up @@ -101,7 +104,7 @@ const defaultContext = {

buildsQueryOptions() {
return infiniteQueryOptions({
queryKey: ["actors", "builds"],
queryKey: ["actors", "builds"] as QueryKey,
enabled: false,
initialPageParam: undefined as string | undefined,
refetchInterval: 2000,
Expand Down Expand Up @@ -159,7 +162,7 @@ const defaultContext = {
queryFn: async () => {
return {} as Actor;
},
queryKey: ["actor", actorId],
queryKey: ["actor", actorId] as QueryKey,
});
},

Expand Down Expand Up @@ -217,7 +220,7 @@ const defaultContext = {
},
actorBuildQueryOptions(actorId: ActorId) {
return queryOptions({
queryKey: ["actor", actorId, "build"],
queryKey: ["actor", actorId, "build"] as QueryKey,
queryFn: async () => {
throw new Error("Not implemented");
return {} as Build;
Expand All @@ -227,7 +230,7 @@ const defaultContext = {
},
actorMetricsQueryOptions(actorId: ActorId) {
return queryOptions({
queryKey: ["actor", actorId, "metrics"],
queryKey: ["actor", actorId, "metrics"] as QueryKey,
queryFn: async () => {
throw new Error("Not implemented");
return {} as ActorMetrics;
Expand All @@ -249,7 +252,7 @@ const defaultContext = {
},
actorDestroyMutationOptions(actorId: ActorId) {
return {
mutationKey: ["actor", actorId, "destroy"],
mutationKey: ["actor", actorId, "destroy"] as QueryKey,
mutationFn: async () => {
return;
},
Expand All @@ -267,7 +270,7 @@ const defaultContext = {
},
actorLogsQueryOptions(actorId: ActorId) {
return infiniteQueryOptions({
queryKey: ["actor", actorId, "logs"],
queryKey: ["actor", actorId, "logs"] as QueryKey,
initialPageParam: null as string | null,
queryFn: async () => {
throw new Error("Not implemented");
Expand Down Expand Up @@ -316,7 +319,7 @@ const defaultContext = {
// #endregion
regionsQueryOptions() {
return infiniteQueryOptions({
queryKey: ["actor", "regions"],
queryKey: ["actor", "regions"] as QueryKey,
initialPageParam: null as string | null,
queryFn: async () => {
throw new Error("Not implemented");
Expand All @@ -328,7 +331,7 @@ const defaultContext = {
},
regionQueryOptions(regionId: string | undefined) {
return queryOptions({
queryKey: ["actor", "region", regionId],
queryKey: ["actor", "region", regionId] as QueryKey,
enabled: !!regionId,
queryFn: async () => {
throw new Error("Not implemented");
Expand All @@ -338,7 +341,7 @@ const defaultContext = {
},
statusQueryOptions() {
return queryOptions({
queryKey: ["status"],
queryKey: ["status"] as QueryKey,
refetchInterval: 1000,
enabled: false,
retry: 0,
Expand All @@ -349,8 +352,8 @@ const defaultContext = {
});
},
createActorMutationOptions() {
return {
mutationKey: ["createActor"],
return mutationOptions({
mutationKey: ["createActor"] as QueryKey,
mutationFn: async (_: CreateActor) => {
throw new Error("Not implemented");
return "";
Expand All @@ -365,7 +368,7 @@ const defaultContext = {
},
});
},
};
});
},
};

Expand Down
Loading
Loading