Skip to content

Commit 878f321

Browse files
committed
Merge branch 'main' into nk-nebula-cached-chains
2 parents dcef936 + 6911102 commit 878f321

File tree

268 files changed

+7979
-6383
lines changed

Some content is hidden

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

268 files changed

+7979
-6383
lines changed

apps/dashboard/.storybook/preview.tsx

Lines changed: 32 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Inter as interFont } from "next/font/google";
77
// biome-ignore lint/style/useImportType: <explanation>
88
import React from "react";
99
import { useEffect } from "react";
10+
import { Toaster } from "sonner";
1011
import { Button } from "../src/@/components/ui/button";
1112

1213
const queryClient = new QueryClient();
@@ -16,8 +17,30 @@ const fontSans = interFont({
1617
variable: "--font-sans",
1718
});
1819

20+
const customViewports = {
21+
xs: {
22+
// Regular sized phones (iphone 15 / 15 pro)
23+
name: "iPhone",
24+
styles: {
25+
width: "390px",
26+
height: "844px",
27+
},
28+
},
29+
sm: {
30+
// Larger phones (iphone 15 plus / 15 pro max)
31+
name: "iPhone Plus",
32+
styles: {
33+
width: "430px",
34+
height: "932px",
35+
},
36+
},
37+
};
38+
1939
const preview: Preview = {
2040
parameters: {
41+
viewport: {
42+
viewports: customViewports,
43+
},
2144
controls: {
2245
matchers: {
2346
color: /(background|color)$/i,
@@ -57,13 +80,13 @@ function StoryLayout(props: {
5780

5881
return (
5982
<QueryClientProvider client={queryClient}>
60-
<div className="flex min-h-screen min-w-0 flex-col bg-background text-foreground">
83+
<div className="flex min-h-dvh min-w-0 flex-col bg-background text-foreground">
6184
<div className="flex justify-end gap-2 border-b p-4">
6285
<Button
6386
onClick={() => setTheme("dark")}
6487
size="sm"
6588
variant={theme === "dark" ? "default" : "outline"}
66-
className="h-auto w-auto rounded-full p-2"
89+
className="h-auto w-auto shrink-0 rounded-full p-2"
6790
>
6891
<MoonIcon className="size-4" />
6992
</Button>
@@ -72,14 +95,20 @@ function StoryLayout(props: {
7295
onClick={() => setTheme("light")}
7396
size="sm"
7497
variant={theme === "light" ? "default" : "outline"}
75-
className="h-auto w-auto rounded-full p-2"
98+
className="h-auto w-auto shrink-0 rounded-full p-2"
7699
>
77100
<SunIcon className="size-4" />
78101
</Button>
79102
</div>
80103

81104
<div className="flex min-w-0 grow flex-col">{props.children}</div>
105+
<ToasterSetup />
82106
</div>
83107
</QueryClientProvider>
84108
);
85109
}
110+
111+
function ToasterSetup() {
112+
const { theme } = useTheme();
113+
return <Toaster richColors theme={theme === "light" ? "light" : "dark"} />;
114+
}

apps/dashboard/framer-rewrites.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,4 +55,6 @@ module.exports = [
5555
"/learn/guides/:guide_slug",
5656
"/learn/courses",
5757
"/learn/glossary",
58+
// -- faucets --
59+
"/faucets",
5860
];

apps/dashboard/package.json

Lines changed: 21 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -45,9 +45,9 @@
4545
"@radix-ui/react-slot": "^1.1.2",
4646
"@radix-ui/react-switch": "^1.1.3",
4747
"@radix-ui/react-tooltip": "1.1.8",
48-
"@sentry/nextjs": "9.2.0",
49-
"@shazow/whatsabi": "^0.19.0",
50-
"@tanstack/react-query": "5.66.9",
48+
"@sentry/nextjs": "9.3.0",
49+
"@shazow/whatsabi": "0.20.0",
50+
"@tanstack/react-query": "5.67.1",
5151
"@tanstack/react-table": "^8.21.2",
5252
"@thirdweb-dev/service-utils": "workspace:*",
5353
"@vercel/functions": "2.0.0",
@@ -61,13 +61,13 @@
6161
"date-fns": "4.1.0",
6262
"fetch-event-stream": "0.1.5",
6363
"flat": "^6.0.1",
64-
"framer-motion": "12.4.7",
64+
"framer-motion": "12.4.10",
6565
"fuse.js": "7.1.0",
6666
"idb-keyval": "^6.2.1",
6767
"input-otp": "^1.4.1",
6868
"ioredis": "^5.5.0",
6969
"ipaddr.js": "^2.2.0",
70-
"lucide-react": "0.476.0",
70+
"lucide-react": "0.477.0",
7171
"next": "15.2.0",
7272
"next-plausible": "^3.12.4",
7373
"next-themes": "^0.4.4",
@@ -94,7 +94,7 @@
9494
"shiki": "1.27.0",
9595
"sonner": "2.0.1",
9696
"spdx-correct": "^3.2.0",
97-
"swagger-ui-react": "^5.19.0",
97+
"swagger-ui-react": "^5.20.0",
9898
"tailwind-merge": "^2.6.0",
9999
"tailwindcss-animate": "^1.0.7",
100100
"thirdweb": "workspace:*",
@@ -104,21 +104,21 @@
104104
},
105105
"devDependencies": {
106106
"@chakra-ui/cli": "^2.4.1",
107-
"@chromatic-com/storybook": "3.2.4",
107+
"@chromatic-com/storybook": "3.2.5",
108108
"@next/bundle-analyzer": "15.2.0",
109109
"@next/eslint-plugin-next": "15.2.0",
110110
"@playwright/test": "1.50.1",
111-
"@storybook/addon-essentials": "8.6.0",
112-
"@storybook/addon-interactions": "8.6.0",
113-
"@storybook/addon-links": "8.6.0",
114-
"@storybook/addon-onboarding": "8.6.0",
115-
"@storybook/addon-viewport": "8.6.0",
116-
"@storybook/blocks": "8.6.0",
117-
"@storybook/nextjs": "8.6.0",
118-
"@storybook/react": "8.6.0",
119-
"@storybook/test": "8.6.0",
111+
"@storybook/addon-essentials": "8.6.3",
112+
"@storybook/addon-interactions": "8.6.3",
113+
"@storybook/addon-links": "8.6.3",
114+
"@storybook/addon-onboarding": "8.6.3",
115+
"@storybook/addon-viewport": "8.6.3",
116+
"@storybook/blocks": "8.6.3",
117+
"@storybook/nextjs": "8.6.3",
118+
"@storybook/react": "8.6.3",
119+
"@storybook/test": "8.6.3",
120120
"@types/color": "4.2.0",
121-
"@types/node": "22.13.5",
121+
"@types/node": "22.13.9",
122122
"@types/papaparse": "^5.3.15",
123123
"@types/pluralize": "^0.0.33",
124124
"@types/qrcode": "^1.5.5",
@@ -130,16 +130,16 @@
130130
"@typescript-eslint/eslint-plugin": "7.14.1",
131131
"@typescript-eslint/parser": "7.14.1",
132132
"autoprefixer": "^10.4.19",
133-
"checkly": "^4.19.1",
133+
"checkly": "5.0.1",
134134
"eslint": "8.57.0",
135135
"eslint-config-biome": "1.9.4",
136-
"eslint-plugin-react-compiler": "19.0.0-beta-e1e972c-20250221",
136+
"eslint-plugin-react-compiler": "19.0.0-beta-40c6c23-20250301",
137137
"eslint-plugin-storybook": "0.11.3",
138138
"knip": "5.45.0",
139139
"next-sitemap": "^4.2.3",
140140
"postcss": "8.5.3",
141-
"storybook": "8.6.0",
141+
"storybook": "8.6.3",
142142
"tailwindcss": "3.4.17",
143-
"typescript": "5.7.3"
143+
"typescript": "5.8.2"
144144
}
145145
}

apps/dashboard/redirects.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,13 @@ async function redirects() {
354354
destination: "/",
355355
permanent: false,
356356
},
357+
// pay > universal-bridge redirect
358+
{
359+
source: "/team/:team_slug/:project_slug/connect/pay/:path*",
360+
destination:
361+
"/team/:team_slug/:project_slug/connect/universal-bridge/:path*",
362+
permanent: false,
363+
},
357364
...legacyDashboardToTeamRedirects,
358365
];
359366
}

apps/dashboard/src/@/actions/billing.ts

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,19 @@
22

33
import "server-only";
44
import { API_SERVER_URL } from "@/constants/env";
5-
import { redirect } from "next/navigation";
65
import { getAuthToken } from "../../app/api/lib/getAuthToken";
76
import type { ProductSKU } from "../lib/billing";
87

9-
export type RedirectCheckoutOptions = {
8+
export type GetBillingCheckoutUrlOptions = {
109
teamSlug: string;
1110
sku: ProductSKU;
1211
redirectUrl: string;
1312
metadata?: Record<string, string>;
1413
};
1514

16-
export async function redirectToCheckout(
17-
options: RedirectCheckoutOptions,
18-
): Promise<{ status: number }> {
15+
export async function getBillingCheckoutUrl(
16+
options: GetBillingCheckoutUrlOptions,
17+
): Promise<{ status: number; url?: string }> {
1918
if (!options.teamSlug) {
2019
return {
2120
status: 400,
@@ -49,27 +48,30 @@ export async function redirectToCheckout(
4948
status: res.status,
5049
};
5150
}
51+
5252
const json = await res.json();
5353
if (!json.result) {
5454
return {
5555
status: 500,
5656
};
5757
}
5858

59-
// redirect to the stripe checkout session
60-
redirect(json.result);
59+
return {
60+
status: 200,
61+
url: json.result as string,
62+
};
6163
}
6264

63-
export type RedirectBillingCheckoutAction = typeof redirectToCheckout;
65+
export type GetBillingCheckoutUrlAction = typeof getBillingCheckoutUrl;
6466

65-
export type BillingPortalOptions = {
67+
export type GetBillingPortalUrlOptions = {
6668
teamSlug: string | undefined;
6769
redirectUrl: string;
6870
};
6971

70-
export async function redirectToBillingPortal(
71-
options: BillingPortalOptions,
72-
): Promise<{ status: number }> {
72+
export async function getBillingPortalUrl(
73+
options: GetBillingPortalUrlOptions,
74+
): Promise<{ status: number; url?: string }> {
7375
if (!options.teamSlug) {
7476
return {
7577
status: 400,
@@ -110,8 +112,10 @@ export async function redirectToBillingPortal(
110112
};
111113
}
112114

113-
// redirect to the stripe billing portal
114-
redirect(json.result);
115+
return {
116+
status: 200,
117+
url: json.result as string,
118+
};
115119
}
116120

117-
export type BillingBillingPortalAction = typeof redirectToBillingPortal;
121+
export type GetBillingPortalUrlAction = typeof getBillingPortalUrl;

apps/dashboard/src/@/actions/proxies.ts

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,14 @@ import { API_SERVER_URL } from "../constants/env";
55

66
type ProxyActionParams = {
77
pathname: string;
8-
searchParams?: Record<string, string>;
8+
searchParams?: Record<string, string | undefined>;
99
method: "GET" | "POST" | "PUT" | "DELETE";
1010
body?: string;
1111
headers?: Record<string, string>;
12+
parseAsText?: boolean;
1213
};
1314

14-
type ProxyActionResult<T extends object> =
15+
type ProxyActionResult<T> =
1516
| {
1617
status: number;
1718
ok: true;
@@ -23,7 +24,7 @@ type ProxyActionResult<T extends object> =
2324
error: string;
2425
};
2526

26-
async function proxy<T extends object>(
27+
async function proxy<T>(
2728
baseUrl: string,
2829
params: ProxyActionParams,
2930
): Promise<ProxyActionResult<T>> {
@@ -34,7 +35,10 @@ async function proxy<T extends object>(
3435
url.pathname = params.pathname;
3536
if (params.searchParams) {
3637
for (const key in params.searchParams) {
37-
url.searchParams.append(key, params.searchParams[key] as string);
38+
const value = params.searchParams[key];
39+
if (value) {
40+
url.searchParams.append(key, value);
41+
}
3842
}
3943
}
4044

@@ -67,23 +71,23 @@ async function proxy<T extends object>(
6771
return {
6872
status: res.status,
6973
ok: true,
70-
data: await res.json(),
74+
data: params.parseAsText ? await res.text() : await res.json(),
7175
};
7276
}
7377

74-
export async function apiServerProxy<T extends object = object>(
75-
params: ProxyActionParams,
76-
) {
78+
export async function apiServerProxy<T>(params: ProxyActionParams) {
7779
return proxy<T>(API_SERVER_URL, params);
7880
}
7981

80-
export async function payServerProxy<T extends object = object>(
81-
params: ProxyActionParams,
82-
) {
82+
export async function payServerProxy<T>(params: ProxyActionParams) {
8383
return proxy<T>(
8484
process.env.NEXT_PUBLIC_PAY_URL
8585
? `https://${process.env.NEXT_PUBLIC_PAY_URL}`
8686
: "https://pay.thirdweb-dev.com",
8787
params,
8888
);
8989
}
90+
91+
export async function analyticsServerProxy<T>(params: ProxyActionParams) {
92+
return proxy<T>(process.env.ANALYTICS_SERVICE_URL || "", params);
93+
}

apps/dashboard/src/@/components/TextDivider.tsx

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)