Skip to content

Commit

Permalink
feat: upgrade to next.js 15 (#146)
Browse files Browse the repository at this point in the history
  • Loading branch information
pradel authored Nov 29, 2024
1 parent b6cfd70 commit 9fa18a4
Show file tree
Hide file tree
Showing 13 changed files with 1,358 additions and 1,252 deletions.
5 changes: 5 additions & 0 deletions .changeset/breezy-apricots-leave.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"stackspulse": patch
---

Upgrade to next.js 15.
4 changes: 2 additions & 2 deletions apps/server/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"deploy": "fly deploy --remote-only"
},
"dependencies": {
"@dotenvx/dotenvx": "1.21.0",
"@dotenvx/dotenvx": "1.25.1",
"@libsql/client": "0.8.0",
"@sentry/node": "8.35.0",
"@stacks/blockchain-api-client": "8.1.2",
Expand All @@ -20,7 +20,7 @@
"drizzle-orm": "0.33.0",
"h3": "1.13.0",
"nitro-cors": "0.7.1",
"postgres": "3.4.4",
"postgres": "3.4.5",
"twitter-api-v2": "1.17.1",
"unstorage": "1.12.0",
"zod": "3.23.8",
Expand Down
4 changes: 2 additions & 2 deletions apps/web/next.config.mjs → apps/web/next.config.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { withSentryConfig } from "@sentry/nextjs";
import type { NextConfig } from "next";

/** @type {import('next').NextConfig} */
const nextConfig = {
const nextConfig: NextConfig = {
output: "standalone",
images: {
remotePatterns: [
Expand Down
29 changes: 15 additions & 14 deletions apps/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,44 @@
"deploy": "fly deploy --remote-only"
},
"dependencies": {
"@dotenvx/dotenvx": "1.21.0",
"@dotenvx/dotenvx": "1.25.1",
"@hirosystems/token-metadata-api-client": "2.0.0",
"@radix-ui/themes": "3.0.5",
"@sentry/nextjs": "8.35.0",
"@sentry/nextjs": "8.41.0",
"@stacks/stacks-blockchain-api-types": "7.14.1",
"@stacks/transactions": "6.17.0",
"@stackspulse/protocols": "workspace:*",
"@t3-oss/env-core": "0.11.1",
"@t3-oss/env-nextjs": "0.11.1",
"@tabler/icons-react": "3.20.0",
"@tanstack/react-query": "5.59.16",
"class-variance-authority": "0.7.0",
"@tabler/icons-react": "3.23.0",
"@tanstack/react-query": "5.61.5",
"class-variance-authority": "0.7.1",
"clsx": "2.1.1",
"date-fns": "4.1.0",
"fathom-client": "3.7.2",
"javascript-time-ago": "2.5.11",
"next": "14.2.15",
"next": "15.0.3",
"react": "18.3.1",
"react-dom": "18.3.1",
"recharts": "2.13.0-alpha.4",
"react-is": "18.3.1",
"recharts": "2.13.3",
"sharp": "0.33.5",
"tailwind-merge": "2.5.4",
"tailwind-merge": "2.5.5",
"tailwindcss-animate": "1.0.7",
"unstorage": "1.12.0",
"zod": "3.23.8"
},
"devDependencies": {
"@types/node": "22.8.1",
"@types/node": "22.10.1",
"@types/react": "18.3.12",
"@types/react-dom": "18.3.1",
"autoprefixer": "10.4.20",
"eslint": "8.57.0",
"eslint-config-next": "14.2.15",
"eslint": "9.15.0",
"eslint-config-next": "15.0.3",
"eslint-plugin-tailwindcss": "3.17.5",
"postcss": "8.4.47",
"postcss": "8.4.49",
"radix-themes-tw": "0.2.3",
"tailwindcss": "3.4.14",
"typescript": "5.6.3"
"tailwindcss": "3.4.15",
"typescript": "5.7.2"
}
}
2 changes: 1 addition & 1 deletion apps/web/src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,14 @@ export default function RootLayout({
suppressHydrationWarning
className={`${font.variable} font-sans antialiased`}
>
<Fathom />
<Providers>
<Theme appearance="dark" accentColor="orange" grayColor="sand">
<Header />
{children}
<Footer />
</Theme>
</Providers>
<Fathom />
</body>
</html>
);
Expand Down
8 changes: 5 additions & 3 deletions apps/web/src/app/protocols/[protocol]/contracts/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ import { notFound } from "next/navigation";

export const dynamic = "force-dynamic";

export function generateMetadata({ params }: PageProps): Metadata {
export async function generateMetadata(props: PageProps): Promise<Metadata> {
const params = await props.params;
const protocol = params.protocol;

return {
Expand All @@ -17,10 +18,11 @@ export function generateMetadata({ params }: PageProps): Metadata {
}

interface PageProps {
params: { protocol: string };
params: Promise<{ protocol: string }>;
}

export default async function ProtocolPage({ params }: PageProps) {
export default async function ProtocolPage(props: PageProps) {
const params = await props.params;
const protocol = params.protocol;
if (!isProtocol(protocol)) {
notFound();
Expand Down
22 changes: 13 additions & 9 deletions apps/web/src/app/protocols/[protocol]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,11 @@ import type { Metadata } from "next";
import { notFound } from "next/navigation";

interface PageProps {
params: { protocol: string };
params: Promise<{ protocol: string }>;
}

export function generateMetadata({ params }: PageProps): Metadata {
export async function generateMetadata(props: PageProps): Promise<Metadata> {
const params = await props.params;
const protocol = params.protocol;
if (!isProtocol(protocol)) {
notFound();
Expand All @@ -26,13 +27,16 @@ export function generateMetadata({ params }: PageProps): Metadata {
};
}

export default function ProtocolLayout({
children,
params,
}: Readonly<{
children: React.ReactNode;
params: PageProps["params"];
}>) {
export default async function ProtocolLayout(
props: Readonly<{
children: React.ReactNode;
params: PageProps["params"];
}>,
) {
const params = await props.params;

const { children } = props;

const protocol = params.protocol;
if (!isProtocol(protocol)) {
notFound();
Expand Down
5 changes: 3 additions & 2 deletions apps/web/src/app/protocols/[protocol]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,11 @@ import { Suspense } from "react";
export const dynamic = "force-dynamic";

interface PageProps {
params: { protocol: string };
params: Promise<{ protocol: string }>;
}

export default async function ProtocolPage({ params }: PageProps) {
export default async function ProtocolPage(props: PageProps) {
const params = await props.params;
const protocol = params.protocol;
if (!isProtocol(protocol)) {
notFound();
Expand Down
10 changes: 5 additions & 5 deletions apps/web/src/app/tokens/[token]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,11 @@ import { Suspense } from "react";
export const dynamic = "force-dynamic";

interface PageProps {
params: { token: string };
params: Promise<{ token: string }>;
}

export async function generateMetadata({
params,
}: PageProps): Promise<Metadata> {
export async function generateMetadata(props: PageProps): Promise<Metadata> {
const params = await props.params;
const metadata = await tokenMetadataClient.GET(
"/metadata/v1/ft/{principal}",
{
Expand All @@ -41,7 +40,8 @@ export async function generateMetadata({
};
}

export default async function ProtocolPage({ params }: PageProps) {
export default async function ProtocolPage(props: PageProps) {
const params = await props.params;
const metadata = await tokenMetadataClient.GET(
"/metadata/v1/ft/{principal}",
{
Expand Down
5 changes: 3 additions & 2 deletions apps/web/src/app/tokens/resolve/[token]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,11 @@ import { notFound, redirect } from "next/navigation";
export const dynamic = "force-dynamic";

interface PageProps {
params: { token: string };
params: Promise<{ token: string }>;
}

export default async function ProtocolPage({ params }: PageProps) {
export default async function ProtocolPage(props: PageProps) {
const params = await props.params;
const data: TokensResolveRouteResponse = await fetch(
`${env.NEXT_PUBLIC_API_URL}/api/tokens/resolve?id=${params.token}`,
).then((res) => res.json());
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@
"prepare": "husky"
},
"dependencies": {
"husky": "9.1.6"
"husky": "9.1.7"
},
"devDependencies": {
"@biomejs/biome": "1.9.4",
"@changesets/cli": "2.27.9",
"@changesets/cli": "2.27.10",
"lint-staged": "15.2.10",
"turbo": "2.2.3"
"turbo": "2.3.3"
},
"lint-staged": {
"*": [
Expand Down
2 changes: 1 addition & 1 deletion packages/protocols/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@
},
"devDependencies": {
"@tsconfig/node22": "22.0.0",
"typescript": "5.6.3"
"typescript": "5.7.2"
}
}
Loading

0 comments on commit 9fa18a4

Please sign in to comment.