Skip to content

Commit 7f84e5c

Browse files
authored
Merge pull request #550 from hyperweb-io/feat/upgrade-react-19
feat: upgrade react 19
2 parents 128db0a + dc9bd3d commit 7f84e5c

File tree

129 files changed

+7329
-3597
lines changed

Some content is hidden

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

129 files changed

+7329
-3597
lines changed

packages/example-nextjs-app-router/.gitignore renamed to examples/cosmos-kit-nextjs-app-router-example/.gitignore

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,12 @@
33
# dependencies
44
/node_modules
55
/.pnp
6-
.pnp.js
7-
.yarn/install-state.gz
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
812

913
# testing
1014
/coverage
@@ -24,9 +28,10 @@
2428
npm-debug.log*
2529
yarn-debug.log*
2630
yarn-error.log*
31+
.pnpm-debug.log*
2732

28-
# local env files
29-
.env*.local
33+
# env files (can opt-in for committing if needed)
34+
.env*
3035

3136
# vercel
3237
.vercel
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"$schema": "https://ui.shadcn.com/schema.json",
3+
"style": "new-york",
4+
"rsc": true,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "",
8+
"css": "src/app/globals.css",
9+
"baseColor": "neutral",
10+
"cssVariables": true,
11+
"prefix": ""
12+
},
13+
"aliases": {
14+
"components": "@/components",
15+
"utils": "@/lib/utils",
16+
"ui": "@/components/ui",
17+
"lib": "@/lib",
18+
"hooks": "@/hooks"
19+
},
20+
"iconLibrary": "lucide"
21+
}
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { dirname } from "path";
2+
import { fileURLToPath } from "url";
3+
import { FlatCompat } from "@eslint/eslintrc";
4+
5+
const __filename = fileURLToPath(import.meta.url);
6+
const __dirname = dirname(__filename);
7+
8+
const compat = new FlatCompat({
9+
baseDirectory: __dirname,
10+
});
11+
12+
const eslintConfig = [
13+
...compat.extends("next/core-web-vitals", "next/typescript"),
14+
];
15+
16+
export default eslintConfig;
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
experimental: {
5+
externalDir: true,
6+
},
7+
// transpilePackages: ["@cosmos-kit/keplr", "@cosmos-kit/react"],
8+
};
9+
10+
export default nextConfig;
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "cosmos-kit-nextjs-app-router-example",
3+
"version": "0.1.0",
4+
"private": true,
5+
"scripts": {
6+
"dev": "next dev --turbopack",
7+
"build": "next build",
8+
"start": "next start",
9+
"lint": "next lint"
10+
},
11+
"dependencies": {
12+
"@cosmos-kit/keplr": "*",
13+
"@cosmos-kit/react": "*",
14+
"@interchain-ui/react": "latest",
15+
"@radix-ui/react-slot": "^1.1.2",
16+
"chain-registry": "*",
17+
"class-variance-authority": "^0.7.1",
18+
"clsx": "^2.1.1",
19+
"lucide-react": "^0.483.0",
20+
"next": "15.2.3",
21+
"react": "^19.0.0",
22+
"react-dom": "^19.0.0",
23+
"tailwind-merge": "^3.0.2",
24+
"tw-animate-css": "^1.2.4"
25+
},
26+
"devDependencies": {
27+
"@eslint/eslintrc": "^3",
28+
"@tailwindcss/postcss": "^4",
29+
"@types/node": "^20",
30+
"@types/react": "^19",
31+
"@types/react-dom": "^19",
32+
"eslint": "^9",
33+
"eslint-config-next": "15.2.3",
34+
"tailwindcss": "^4",
35+
"typescript": "^5"
36+
},
37+
"resolutions": {
38+
"@cosmos-kit/keplr": "file:../../wallets/keplr",
39+
"@cosmos-kit/react": "file:../../packages/react"
40+
}
41+
}
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
const config = {
2+
plugins: ["@tailwindcss/postcss"],
3+
};
4+
5+
export default config;
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 1 addition & 0 deletions
Loading
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
@import "tailwindcss";
2+
@import "tw-animate-css";
3+
4+
@custom-variant dark (&:is(.dark *));
5+
6+
@theme inline {
7+
--color-background: var(--background);
8+
--color-foreground: var(--foreground);
9+
--font-sans: var(--font-geist-sans);
10+
--font-mono: var(--font-geist-mono);
11+
--color-sidebar-ring: var(--sidebar-ring);
12+
--color-sidebar-border: var(--sidebar-border);
13+
--color-sidebar-accent-foreground: var(--sidebar-accent-foreground);
14+
--color-sidebar-accent: var(--sidebar-accent);
15+
--color-sidebar-primary-foreground: var(--sidebar-primary-foreground);
16+
--color-sidebar-primary: var(--sidebar-primary);
17+
--color-sidebar-foreground: var(--sidebar-foreground);
18+
--color-sidebar: var(--sidebar);
19+
--color-chart-5: var(--chart-5);
20+
--color-chart-4: var(--chart-4);
21+
--color-chart-3: var(--chart-3);
22+
--color-chart-2: var(--chart-2);
23+
--color-chart-1: var(--chart-1);
24+
--color-ring: var(--ring);
25+
--color-input: var(--input);
26+
--color-border: var(--border);
27+
--color-destructive: var(--destructive);
28+
--color-accent-foreground: var(--accent-foreground);
29+
--color-accent: var(--accent);
30+
--color-muted-foreground: var(--muted-foreground);
31+
--color-muted: var(--muted);
32+
--color-secondary-foreground: var(--secondary-foreground);
33+
--color-secondary: var(--secondary);
34+
--color-primary-foreground: var(--primary-foreground);
35+
--color-primary: var(--primary);
36+
--color-popover-foreground: var(--popover-foreground);
37+
--color-popover: var(--popover);
38+
--color-card-foreground: var(--card-foreground);
39+
--color-card: var(--card);
40+
--radius-sm: calc(var(--radius) - 4px);
41+
--radius-md: calc(var(--radius) - 2px);
42+
--radius-lg: var(--radius);
43+
--radius-xl: calc(var(--radius) + 4px);
44+
}
45+
46+
:root {
47+
--radius: 0.625rem;
48+
--background: oklch(1 0 0);
49+
--foreground: oklch(0.145 0 0);
50+
--card: oklch(1 0 0);
51+
--card-foreground: oklch(0.145 0 0);
52+
--popover: oklch(1 0 0);
53+
--popover-foreground: oklch(0.145 0 0);
54+
--primary: oklch(0.205 0 0);
55+
--primary-foreground: oklch(0.985 0 0);
56+
--secondary: oklch(0.97 0 0);
57+
--secondary-foreground: oklch(0.205 0 0);
58+
--muted: oklch(0.97 0 0);
59+
--muted-foreground: oklch(0.556 0 0);
60+
--accent: oklch(0.97 0 0);
61+
--accent-foreground: oklch(0.205 0 0);
62+
--destructive: oklch(0.577 0.245 27.325);
63+
--border: oklch(0.922 0 0);
64+
--input: oklch(0.922 0 0);
65+
--ring: oklch(0.708 0 0);
66+
--chart-1: oklch(0.646 0.222 41.116);
67+
--chart-2: oklch(0.6 0.118 184.704);
68+
--chart-3: oklch(0.398 0.07 227.392);
69+
--chart-4: oklch(0.828 0.189 84.429);
70+
--chart-5: oklch(0.769 0.188 70.08);
71+
--sidebar: oklch(0.985 0 0);
72+
--sidebar-foreground: oklch(0.145 0 0);
73+
--sidebar-primary: oklch(0.205 0 0);
74+
--sidebar-primary-foreground: oklch(0.985 0 0);
75+
--sidebar-accent: oklch(0.97 0 0);
76+
--sidebar-accent-foreground: oklch(0.205 0 0);
77+
--sidebar-border: oklch(0.922 0 0);
78+
--sidebar-ring: oklch(0.708 0 0);
79+
}
80+
81+
.dark {
82+
--background: oklch(0.145 0 0);
83+
--foreground: oklch(0.985 0 0);
84+
--card: oklch(0.205 0 0);
85+
--card-foreground: oklch(0.985 0 0);
86+
--popover: oklch(0.205 0 0);
87+
--popover-foreground: oklch(0.985 0 0);
88+
--primary: oklch(0.922 0 0);
89+
--primary-foreground: oklch(0.205 0 0);
90+
--secondary: oklch(0.269 0 0);
91+
--secondary-foreground: oklch(0.985 0 0);
92+
--muted: oklch(0.269 0 0);
93+
--muted-foreground: oklch(0.708 0 0);
94+
--accent: oklch(0.269 0 0);
95+
--accent-foreground: oklch(0.985 0 0);
96+
--destructive: oklch(0.704 0.191 22.216);
97+
--border: oklch(1 0 0 / 10%);
98+
--input: oklch(1 0 0 / 15%);
99+
--ring: oklch(0.556 0 0);
100+
--chart-1: oklch(0.488 0.243 264.376);
101+
--chart-2: oklch(0.696 0.17 162.48);
102+
--chart-3: oklch(0.769 0.188 70.08);
103+
--chart-4: oklch(0.627 0.265 303.9);
104+
--chart-5: oklch(0.645 0.246 16.439);
105+
--sidebar: oklch(0.205 0 0);
106+
--sidebar-foreground: oklch(0.985 0 0);
107+
--sidebar-primary: oklch(0.488 0.243 264.376);
108+
--sidebar-primary-foreground: oklch(0.985 0 0);
109+
--sidebar-accent: oklch(0.269 0 0);
110+
--sidebar-accent-foreground: oklch(0.985 0 0);
111+
--sidebar-border: oklch(1 0 0 / 10%);
112+
--sidebar-ring: oklch(0.556 0 0);
113+
}
114+
115+
@layer base {
116+
* {
117+
@apply border-border outline-ring/50;
118+
}
119+
body {
120+
@apply bg-background text-foreground;
121+
}
122+
}

packages/example-nextjs-app-router/src/app/layout.tsx renamed to examples/cosmos-kit-nextjs-app-router-example/src/app/layout.tsx

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import type { Metadata } from "next";
2-
import localFont from "next/font/local";
2+
import { Geist, Geist_Mono } from "next/font/google";
33
import "./globals.css";
44
import { CosmosKitProvider } from "@/components/cosmos-kit-provider";
55

6-
const geistSans = localFont({
7-
src: "./fonts/GeistVF.woff",
6+
const geistSans = Geist({
87
variable: "--font-geist-sans",
9-
weight: "100 900",
8+
subsets: ["latin"],
109
});
11-
const geistMono = localFont({
12-
src: "./fonts/GeistMonoVF.woff",
10+
11+
const geistMono = Geist_Mono({
1312
variable: "--font-geist-mono",
14-
weight: "100 900",
13+
subsets: ["latin"],
1514
});
1615

1716
export const metadata: Metadata = {
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
import { ConnectWallet } from "@/components/connect-wallet";
2+
3+
export default function Home() {
4+
return (
5+
<div className="flex flex-col min-h-screen bg-gradient-to-b from-background to-background/80">
6+
<header className="container flex items-center justify-between py-8 mx-auto">
7+
<h1 className="text-xl font-bold">
8+
<span className="text-primary">Cosmos</span>Kit
9+
</h1>
10+
<nav className="flex gap-4">
11+
<a
12+
href="https://github.com/hyperweb-io/cosmos-kit"
13+
target="_blank"
14+
rel="noopener noreferrer"
15+
className="text-sm font-medium text-muted-foreground hover:text-foreground transition-colors"
16+
>
17+
GitHub
18+
</a>
19+
<a
20+
href="https://docs.cosmoskit.com/"
21+
target="_blank"
22+
rel="noopener noreferrer"
23+
className="text-sm font-medium text-muted-foreground hover:text-foreground transition-colors"
24+
>
25+
Docs
26+
</a>
27+
</nav>
28+
</header>
29+
30+
<main className="flex-1 container py-12">
31+
<div className="flex flex-col items-center gap-12 max-w-2xl mx-auto">
32+
<div className="space-y-6 text-center">
33+
<h2 className="text-3xl md:text-4xl lg:text-5xl font-bold tracking-tight">
34+
<span className="text-primary">Cosmos Kit</span> Next.js Demo
35+
</h2>
36+
<p className="text-muted-foreground text-lg">
37+
A powerful wallet adapter for Cosmos-based chains. Integrate
38+
blockchain functionality into your Next.js application with ease.
39+
</p>
40+
<div className="flex justify-center gap-4">
41+
<a
42+
className="inline-flex h-10 items-center justify-center rounded-md border border-input bg-background px-6 py-2 text-sm font-medium shadow-sm transition-colors hover:bg-accent hover:text-accent-foreground focus-visible:outline-none focus-visible:ring-1"
43+
href="https://docs.cosmoskit.com/"
44+
target="_blank"
45+
rel="noopener noreferrer"
46+
>
47+
Read the docs
48+
</a>
49+
</div>
50+
</div>
51+
52+
<div className="w-full max-w-md">
53+
<ConnectWallet />
54+
</div>
55+
</div>
56+
</main>
57+
58+
<footer className="border-t bg-muted/40 mt-auto">
59+
<div className="container py-8 mx-auto">
60+
<div className="flex flex-col sm:flex-row justify-between items-center gap-4">
61+
<p className="text-sm text-muted-foreground">
62+
Built with{" "}
63+
<a
64+
href="https://nextjs.org"
65+
className="underline underline-offset-4 hover:text-foreground"
66+
>
67+
Next.js
68+
</a>{" "}
69+
and{" "}
70+
<a
71+
href="https://cosmoskit.com"
72+
className="underline underline-offset-4 hover:text-foreground"
73+
>
74+
Cosmos Kit
75+
</a>
76+
</p>
77+
<div className="flex gap-6">
78+
<a
79+
className="text-sm text-muted-foreground hover:text-foreground transition-colors"
80+
href="https://nextjs.org/learn"
81+
target="_blank"
82+
rel="noopener noreferrer"
83+
>
84+
Learn Next.js
85+
</a>
86+
<a
87+
className="text-sm text-muted-foreground hover:text-foreground transition-colors"
88+
href="https://nextjs.org"
89+
target="_blank"
90+
rel="noopener noreferrer"
91+
>
92+
Next.js Docs
93+
</a>
94+
</div>
95+
</div>
96+
</div>
97+
</footer>
98+
</div>
99+
);
100+
}

0 commit comments

Comments
 (0)