Skip to content

Commit 90ff4a5

Browse files
committed
feat(hub): bring hub to life (#2234)
<!-- Please make sure there is an issue that this PR is correlated to. --> ## Changes <!-- If there are frontend changes, please include screenshots. -->
1 parent 5badc3f commit 90ff4a5

File tree

520 files changed

+3240
-3279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

520 files changed

+3240
-3279
lines changed

examples/system-test/package.json

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111
"devDependencies": {
1212
"@rivet-gg/actor-core": "^5.1.2",
1313
"@rivet-gg/api": "^24.6.2",
14-
"@types/deno": "^2.2.0",
1514
"@types/node": "^22.13.9",
1615
"@types/ws": "^8.18.0",
1716
"node-fetch": "^3.3.2",

frontend/apps/hub/package.json

+5-4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"type": "module",
66
"scripts": {
77
"dev": "vite",
8+
"ts-check": "tsc --noEmit",
89
"build": "vite build --mode=production --base=/",
910
"build:embedded": "vite build --mode=production --base=/ui/",
1011
"preview": "vite preview"
@@ -26,10 +27,11 @@
2627
"@tanstack/react-query": "^5.56.2",
2728
"@tanstack/react-query-devtools": "^5.58.0",
2829
"@tanstack/react-query-persist-client": "^5.56.2",
29-
"@tanstack/react-router": "^1.97.3",
30+
"@tanstack/react-router": "^1.114.25",
3031
"@tanstack/react-table": "^8.20.6",
31-
"@tanstack/router-devtools": "^1.97.3",
32-
"@tanstack/zod-adapter": "^1.97.3",
32+
"@tanstack/router-devtools": "^1.114.25",
33+
"@tanstack/router-plugin": "^1.114.25",
34+
"@tanstack/zod-adapter": "^1.114.25",
3335
"@types/bcryptjs": "^2.4.6",
3436
"actor-core": "^0.6.2",
3537
"bcryptjs": "^2.4.3",
@@ -55,7 +57,6 @@
5557
"@mdx-js/rollup": "^3.1.0",
5658
"@sentry/vite-plugin": "^2.22.2",
5759
"@shikijs/transformers": "^1.24.2",
58-
"@tanstack/router-vite-plugin": "^1.58.12",
5960
"@types/file-saver": "^2",
6061
"@types/filesize": "^5.0.2",
6162
"@types/lodash": "^4.17.14",

frontend/apps/hub/src/components/header/header-link.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ export function HeaderLink({
4646
) : undefined
4747
}
4848
>
49-
<Link>
49+
<Link to={props.to}>
5050
{children}
5151
{isCurrent && !isMobile ? (
5252
<motion.div

frontend/apps/hub/src/domains/group/components/dialogs/create-group-invite-dialog.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,7 @@ export default function CreateGroupInviteDialogContent({
7979
<GroupInviteForm.UsageCount />
8080
</Flex>
8181
<DialogFooter>
82-
<GroupInviteForm.Submit
83-
disablePristine={false}
84-
type="submit"
85-
>
82+
<GroupInviteForm.Submit allowPristine type="submit">
8683
Create
8784
</GroupInviteForm.Submit>
8885
</DialogFooter>

frontend/apps/hub/src/domains/project/components/actors/actor-logs-tab.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,10 @@ interface ActorLogsTabProps {
1515
projectNameId: string;
1616
environmentNameId: string;
1717
actorId: string;
18+
19+
createdAt: Date;
20+
startedAt?: Date;
21+
destroyedAt?: Date;
1822
}
1923

2024
export function ActorLogsTab(props: ActorLogsTabProps) {

frontend/apps/hub/src/domains/project/components/actors/actors-actor-details.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ export function ActorsActorDetails({
9090
className="min-h-0 flex-1 mt-0 h-full"
9191
>
9292
<Suspense fallback={<ActorLogsTab.Skeleton />}>
93-
<ActorLogsTab {...props} />
93+
<ActorLogsTab {...props} {...data} />
9494
</Suspense>
9595
</TabsContent>
9696
<TabsContent

frontend/apps/hub/src/domains/project/queries/actors/mutations.ts

+23-28
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,9 @@ export function usePatchActorBuildTagsMutation({
5454
environmentNameId: string;
5555
buildId: string;
5656
} & Rivet.servers.PatchBuildTagsRequest) => {
57-
console.log("mutating", request.tags);
58-
5957
// TODO: Cache this
6058
// Get original build
61-
const ogBuild = await rivetClient.actors.builds.get(buildId, {
59+
const ogBuild = await rivetClient.builds.get(buildId, {
6260
project: projectNameId,
6361
environment: environmentNameId,
6462
});
@@ -69,17 +67,17 @@ export function usePatchActorBuildTagsMutation({
6967
(request.tags as Record<string, string> | undefined)
7068
?.current === "true"
7169
) {
72-
const currentBuilds = await rivetClient.actors.builds.list({
70+
const currentBuilds = await rivetClient.builds.list({
7371
project: projectNameId,
7472
environment: environmentNameId,
7573
tagsJson: JSON.stringify({
7674
name: ogBuild.build.tags.name,
7775
current: "true",
7876
}),
7977
});
80-
console.log("updating builds", currentBuilds.builds);
78+
8179
for (const build of currentBuilds.builds) {
82-
await rivetClient.actors.builds.patchTags(build.id, {
80+
await rivetClient.builds.patchTags(build.id, {
8381
project: projectNameId,
8482
environment: environmentNameId,
8583
body: {
@@ -92,7 +90,7 @@ export function usePatchActorBuildTagsMutation({
9290
}
9391

9492
// Update tags
95-
return await rivetClient.actors.builds.patchTags(buildId, {
93+
return await rivetClient.builds.patchTags(buildId, {
9694
project: projectNameId,
9795
environment: environmentNameId,
9896
body: request,
@@ -182,27 +180,24 @@ export function useCreateActorFromSdkMutation({
182180
region: string;
183181
parameters: unknown;
184182
}) => {
185-
const managerUrl = await queryClient.fetchQuery(
186-
actorManagerUrlQueryOptions({
187-
projectNameId,
188-
environmentNameId,
189-
}),
190-
);
191-
192-
const { build } = await queryClient.fetchQuery(
193-
actorBuildQueryOptions({
194-
projectNameId,
195-
environmentNameId,
196-
buildId,
197-
}),
198-
);
199-
200-
const cl = new Client(managerUrl);
201-
202-
await cl.create({
203-
parameters,
204-
create: { tags: { name: build.tags.name || build.id }, region },
205-
});
183+
// const managerUrl = await queryClient.fetchQuery(
184+
// actorManagerUrlQueryOptions({
185+
// projectNameId,
186+
// environmentNameId,
187+
// }),
188+
// );
189+
// const { build } = await queryClient.fetchQuery(
190+
// actorBuildQueryOptions({
191+
// projectNameId,
192+
// environmentNameId,
193+
// buildId,
194+
// }),
195+
// );
196+
// const cl = new Client(managerUrl);
197+
// await cl.create({
198+
// parameters,
199+
// create: { tags: { name: build.tags.name || build.id }, region },
200+
// });
206201
},
207202
onSuccess: async () => {
208203
await queryClient.invalidateQueries({

frontend/apps/hub/src/domains/project/queries/actors/query-options.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ export const actorBuildsQueryOptions = ({
277277
],
278278
signal: abortSignal,
279279
}) =>
280-
rivetClient.actors.builds.list(
280+
rivetClient.builds.list(
281281
{ project, environment, tagsJson: JSON.stringify(tagsJson) },
282282
{
283283
abortSignal,
@@ -384,7 +384,7 @@ export const actorBuildQueryOptions = ({
384384
signal: abortSignal,
385385
queryKey: [_, project, __, environment, ___, build],
386386
}) =>
387-
rivetClient.actors.builds.get(
387+
rivetClient.builds.get(
388388
build,
389389
{ project, environment },
390390
{
@@ -411,7 +411,7 @@ export const actorRegionsQueryOptions = ({
411411
signal: abortSignal,
412412
queryKey: [_, project, __, environment],
413413
}) =>
414-
rivetClient.actors.regions.list(
414+
rivetClient.regions.list(
415415
{ project, environment },
416416
{
417417
abortSignal,

frontend/apps/hub/src/domains/project/queries/servers/query-options.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -343,7 +343,7 @@ export const regionsQueryOptions = ({
343343
signal: abortSignal,
344344
queryKey: [_, projectId, __, environmentId],
345345
}) =>
346-
rivetClient.actors.regions.list(
346+
rivetClient.regions.list(
347347
{
348348
project: projectId,
349349
environment: environmentId,

frontend/apps/hub/src/routes/_authenticated.tsx

+4
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import {
55
Navigate,
66
Outlet,
77
createFileRoute,
8+
retainSearchParams,
89
useLocation,
910
} from "@tanstack/react-router";
1011
import { zodValidator } from "@tanstack/zod-adapter";
@@ -37,6 +38,9 @@ const searchSchema = z.object({
3738
export const Route = createFileRoute("/_authenticated")({
3839
validateSearch: zodValidator(searchSchema),
3940
component: Authenticated,
41+
search: {
42+
middlewares: [retainSearchParams(["modal"])],
43+
},
4044
});
4145

4246
function Modals() {

frontend/apps/hub/src/routes/_authenticated/_layout/projects/$projectNameId/environments/$environmentNameId/builds.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -230,7 +230,7 @@ function RowSkeleton() {
230230
);
231231
}
232232

233-
interface ProjectBuildLatestButtonProps extends Rivet.actors.Build {
233+
interface ProjectBuildLatestButtonProps extends Rivet.builds.Build {
234234
projectNameId: string;
235235
environmentNameId: string;
236236
projectId: string;

frontend/apps/hub/src/routes/_authenticated/_layout/projects/$projectNameId/environments/$environmentNameId/cdn.tsx

+5-1
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,11 @@ function EnvironmentCdnRoute() {
217217
}
218218

219219
const searchSchema = z.object({
220-
modal: z.enum(["cdn-users", "cdn-domains"]).or(z.string()).optional(),
220+
modal: z
221+
.enum(["cdn-users", "cdn-domains"])
222+
.or(z.string())
223+
.optional()
224+
.catch(undefined),
221225
});
222226

223227
export const Route = createFileRoute(

frontend/apps/hub/src/routes/_authenticated/_layout/teams/$groupId.tsx

+2-1
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,8 @@ const searchSchema = z.object({
8282
modal: z
8383
.enum(["invite", "create-group-project", "leave"])
8484
.or(z.string())
85-
.optional(),
85+
.optional()
86+
.catch(undefined),
8687
});
8788

8889
export const Route = createFileRoute("/_authenticated/_layout/teams/$groupId")({
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
version https://git-lfs.github.com/spec/v1
2-
oid sha256:23a2ab648b480943271f33eef89cd321c48488427b71a26795bbcfeba4f77da6
3-
size 540516
2+
oid sha256:eb84caf0e804ca7c8b169fb07bbde6c8e808ae48240b44783b835ecc9735d45f
3+
size 508657

frontend/apps/hub/vite.config.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import * as crypto from "node:crypto";
22
import path from "node:path";
33
import mdx from "@mdx-js/rollup";
44
import { sentryVitePlugin } from "@sentry/vite-plugin";
5-
import { TanStackRouterVite } from "@tanstack/router-vite-plugin";
5+
import { TanStackRouterVite } from "@tanstack/router-plugin/vite";
66
import react from "@vitejs/plugin-react";
77
import { visualizer } from "rollup-plugin-visualizer";
88
import { defineConfig } from "vite";

frontend/packages/icons/scripts/postinstall.js

+5-2
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ const banner = dedent`
7575

7676
let indexJsSource = dedent`
7777
${banner}
78-
import {FontAwesomeIcon } from "@fortawesome/react-fontawesome";
78+
import { FontAwesomeIcon } from "@fortawesome/react-fontawesome";
7979
import { createElement } from "react";
8080
export function Icon(props) { return createElement(FontAwesomeIcon, props)}
8181
`;
@@ -120,7 +120,10 @@ for (const [pkg, { icons }] of Object.entries(manifest)) {
120120
fs.writeFileSync(join(sourceDir, "index.gen.js"), `${indexJsSource}`);
121121

122122
let indexTsSource = dedent`
123-
${indexJsSource}
123+
${banner}
124+
import {FontAwesomeIcon, FontAwesomeIconProps } from "@fortawesome/react-fontawesome";
125+
import { ComponentProps, createElement } from "react";
126+
export function Icon(props: Omit<ComponentProps<typeof FontAwesomeIcon>, 'icon'> & {icon: IconProp}) { return createElement(FontAwesomeIcon, props as FontAwesomeIconProps)}
124127
export type IconProp = string | { prefix: string; iconName: string } | [string, string];
125128
`;
126129
fs.writeFileSync(join(sourceDir, "index.gen.ts"), `${indexTsSource}`);

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
"frontend/apps/*",
77
"frontend/packages/*",
88
"site",
9-
"sdks/actor/*",
9+
"sdks/api/full/typescript",
1010
"examples/*",
1111
"tests/load"
1212
],

sdks/api/fern/generators.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ groups:
3434
location: local-file-system
3535
path: ../full/openapi
3636
- name: fernapi/fern-typescript-node-sdk
37-
version: 0.42.7
37+
version: 0.49.3
3838
ir-version: v53
3939
output:
4040
location: local-file-system

sdks/api/full/typescript/package.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)