Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 4782d19

Browse files
committedMar 27, 2025·
test app
1 parent dcfd85c commit 4782d19

File tree

17 files changed

+2134
-875
lines changed

17 files changed

+2134
-875
lines changed
 

‎apps/test-app/.eslintrc.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"extends": ["next/core-web-vitals", "next/typescript"]
3+
}

‎apps/test-app/.gitignore

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
2+
3+
# dependencies
4+
/node_modules
5+
/.pnp
6+
.pnp.*
7+
.yarn/*
8+
!.yarn/patches
9+
!.yarn/plugins
10+
!.yarn/releases
11+
!.yarn/versions
12+
13+
# testing
14+
/coverage
15+
16+
# next.js
17+
/.next/
18+
/out/
19+
20+
# production
21+
/build
22+
23+
# misc
24+
.DS_Store
25+
*.pem
26+
27+
# debug
28+
npm-debug.log*
29+
yarn-debug.log*
30+
yarn-error.log*
31+
32+
# env files (can opt-in for committing if needed)
33+
.env*
34+
35+
# vercel
36+
.vercel
37+
38+
# typescript
39+
*.tsbuildinfo
40+
next-env.d.ts
41+
42+
package-lock.json

‎apps/test-app/README.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
# Starter Next.js TypeScript
2+
3+
Start a new project on Next.js. This starter template consists of a connect wallet button and wallet integration.
4+
5+
## Getting Started
6+
7+
Start project locally using CLI:
8+
9+
```bash
10+
npx meshjs app-name
11+
```
12+
13+
## Learn More
14+
15+
### [APIs](https://meshjs.dev/apis)
16+
17+
From wallet integrations to transaction builders, Mesh makes Web3 development easy with reliable, scalable, and well-engineered APIs & developer tools.
18+
19+
### [Guides](https://meshjs.dev/guides)
20+
21+
Whether you are new to web development or a seasoned blockchain full-stack developer, these guides will help you get started.
22+
23+
### [Smart Contracts](https://meshjs.dev/smart-contracts)
24+
25+
Open-source smart contracts, complete with documentation, live demos, and end-to-end source code.
26+
27+
### [React components and hooks](https://meshjs.dev/react)
28+
29+
Frontend components for wallet connections, and useful React hooks to getting wallet states - Mesh provides everything you need to bring your Web3 user interface to life.
30+
31+
## Connect with us
32+
33+
Give a star on our [GitHub](https://meshjs.dev/go/github) to stay up to date with our latest developments.
34+
35+
Follow us on [Twitter](https://meshjs.dev/go/twitter) for updates.
36+
37+
Join our [Discord](https://meshjs.dev/go/discord) for any questions and suggestions.

‎apps/test-app/components.json

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": false,
5+
"tsx": true,
6+
"tailwind": {
7+
"config": "tailwind.config.ts",
8+
"css": "src/styles/globals.css",
9+
"baseColor": "slate",
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+
}

‎apps/test-app/next.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
import type { NextConfig } from "next";
2+
3+
const nextConfig: NextConfig = {
4+
reactStrictMode: true,
5+
};
6+
7+
export default nextConfig;

‎apps/test-app/package.json

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
{
2+
"name": "test-app",
3+
"description": "A Mesh starter template for NextJS",
4+
"author": "MeshJS",
5+
"license": "Apache-2.0",
6+
"version": "0.1.0",
7+
"scripts": {
8+
"dev": "next dev -p 3002",
9+
"build": "next build",
10+
"start": "next start",
11+
"lint": "next lint"
12+
},
13+
"dependencies": {
14+
"@meshsdk/core": "*",
15+
"@meshsdk/react": "*",
16+
"@radix-ui/react-slot": "^1.1.2",
17+
"class-variance-authority": "^0.7.1",
18+
"clsx": "^2.1.1",
19+
"lucide-react": "^0.484.0",
20+
"next": "15.0.3",
21+
"react": "^18.2.0",
22+
"react-dom": "^18.2.0",
23+
"tailwind-merge": "^3.0.2",
24+
"tailwindcss-animate": "^1.0.7"
25+
},
26+
"devDependencies": {
27+
"@types/node": "^20",
28+
"@types/react": "^18",
29+
"@types/react-dom": "^18",
30+
"eslint": "^8",
31+
"eslint-config-next": "15.0.3",
32+
"postcss": "^8",
33+
"tailwindcss": "^3.4.1",
34+
"typescript": "^5"
35+
}
36+
}

‎apps/test-app/postcss.config.mjs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
/** @type {import('postcss-load-config').Config} */
2+
const config = {
3+
plugins: {
4+
tailwindcss: {},
5+
},
6+
};
7+
8+
export default config;

‎apps/test-app/public/favicon.ico

14.7 KB
Binary file not shown.
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import * as React from "react"
2+
import { Slot } from "@radix-ui/react-slot"
3+
import { cva, type VariantProps } from "class-variance-authority"
4+
5+
import { cn } from "@/lib/utils"
6+
7+
const buttonVariants = cva(
8+
"inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",
9+
{
10+
variants: {
11+
variant: {
12+
default:
13+
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
14+
destructive:
15+
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
16+
outline:
17+
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
18+
secondary:
19+
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
20+
ghost: "hover:bg-accent hover:text-accent-foreground",
21+
link: "text-primary underline-offset-4 hover:underline",
22+
},
23+
size: {
24+
default: "h-9 px-4 py-2",
25+
sm: "h-8 rounded-md px-3 text-xs",
26+
lg: "h-10 rounded-md px-8",
27+
icon: "h-9 w-9",
28+
},
29+
},
30+
defaultVariants: {
31+
variant: "default",
32+
size: "default",
33+
},
34+
}
35+
)
36+
37+
export interface ButtonProps
38+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
39+
VariantProps<typeof buttonVariants> {
40+
asChild?: boolean
41+
}
42+
43+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
44+
({ className, variant, size, asChild = false, ...props }, ref) => {
45+
const Comp = asChild ? Slot : "button"
46+
return (
47+
<Comp
48+
className={cn(buttonVariants({ variant, size, className }))}
49+
ref={ref}
50+
{...props}
51+
/>
52+
)
53+
}
54+
)
55+
Button.displayName = "Button"
56+
57+
export { Button, buttonVariants }

‎apps/test-app/src/lib/utils.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { clsx, type ClassValue } from "clsx"
2+
import { twMerge } from "tailwind-merge"
3+
4+
export function cn(...inputs: ClassValue[]) {
5+
return twMerge(clsx(inputs))
6+
}

‎apps/test-app/src/pages/_app.tsx

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import "@/styles/globals.css";
2+
import "@meshsdk/react/styles.css";
3+
import type { AppProps } from "next/app";
4+
import { MeshProvider } from "@meshsdk/react";
5+
6+
export default function App({ Component, pageProps }: AppProps) {
7+
return (
8+
<MeshProvider>
9+
<Component {...pageProps} />
10+
</MeshProvider>
11+
);
12+
}

‎apps/test-app/src/pages/_document.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { Html, Head, Main, NextScript } from "next/document";
2+
3+
export default function Document() {
4+
return (
5+
<Html lang="en">
6+
<Head>
7+
<link rel="icon" href="https://meshjs.dev/favicon/favicon-32x32.png" />
8+
</Head>
9+
<body>
10+
<Main />
11+
<NextScript />
12+
</body>
13+
</Html>
14+
);
15+
}

‎apps/test-app/src/pages/index.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { CardanoWallet } from "@meshsdk/react";
2+
import { Button } from "@/components/ui/button";
3+
4+
export default function Home() {
5+
return (
6+
<>
7+
<div className="mb-20">
8+
<CardanoWallet />
9+
</div>
10+
11+
<div>
12+
<Button>Button</Button>
13+
<Button variant="outline">Button outline</Button>
14+
<Button variant="destructive">Button destructive</Button>
15+
</div>
16+
</>
17+
);
18+
}

‎apps/test-app/src/styles/globals.css

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
@tailwind base;
2+
@tailwind components;
3+
@tailwind utilities;
4+
5+
@layer base {
6+
:root {
7+
--background: 0 0% 100%;
8+
--foreground: 222.2 84% 4.9%;
9+
--card: 0 0% 100%;
10+
--card-foreground: 222.2 84% 4.9%;
11+
--popover: 0 0% 100%;
12+
--popover-foreground: 222.2 84% 4.9%;
13+
--primary: 222.2 47.4% 11.2%;
14+
--primary-foreground: 210 40% 98%;
15+
--secondary: 210 40% 96.1%;
16+
--secondary-foreground: 222.2 47.4% 11.2%;
17+
--muted: 210 40% 96.1%;
18+
--muted-foreground: 215.4 16.3% 46.9%;
19+
--accent: 210 40% 96.1%;
20+
--accent-foreground: 222.2 47.4% 11.2%;
21+
--destructive: 0 84.2% 60.2%;
22+
--destructive-foreground: 210 40% 98%;
23+
--border: 214.3 31.8% 91.4%;
24+
--input: 214.3 31.8% 91.4%;
25+
--ring: 222.2 84% 4.9%;
26+
--chart-1: 12 76% 61%;
27+
--chart-2: 173 58% 39%;
28+
--chart-3: 197 37% 24%;
29+
--chart-4: 43 74% 66%;
30+
--chart-5: 27 87% 67%;
31+
--radius: 0.5rem
32+
}
33+
.dark {
34+
--background: 222.2 84% 4.9%;
35+
--foreground: 210 40% 98%;
36+
--card: 222.2 84% 4.9%;
37+
--card-foreground: 210 40% 98%;
38+
--popover: 222.2 84% 4.9%;
39+
--popover-foreground: 210 40% 98%;
40+
--primary: 210 40% 98%;
41+
--primary-foreground: 222.2 47.4% 11.2%;
42+
--secondary: 217.2 32.6% 17.5%;
43+
--secondary-foreground: 210 40% 98%;
44+
--muted: 217.2 32.6% 17.5%;
45+
--muted-foreground: 215 20.2% 65.1%;
46+
--accent: 217.2 32.6% 17.5%;
47+
--accent-foreground: 210 40% 98%;
48+
--destructive: 0 62.8% 30.6%;
49+
--destructive-foreground: 210 40% 98%;
50+
--border: 217.2 32.6% 17.5%;
51+
--input: 217.2 32.6% 17.5%;
52+
--ring: 212.7 26.8% 83.9%;
53+
--chart-1: 220 70% 50%;
54+
--chart-2: 160 60% 45%;
55+
--chart-3: 30 80% 55%;
56+
--chart-4: 280 65% 60%;
57+
--chart-5: 340 75% 55%
58+
}
59+
}
60+
61+
@layer base {
62+
* {
63+
@apply border-border;
64+
}
65+
body {
66+
@apply bg-background text-foreground;
67+
}
68+
}

0 commit comments

Comments
 (0)