Skip to content

Commit

Permalink
feature(airdrops): Foundational setup (#15545)
Browse files Browse the repository at this point in the history
* add package.json

* add .gitignore

* set up eslint

* set up providers

* set up next config

* set up public resources

* set up nextjs

* clean up

* set up tailwind

* update monorepo

* update yarn.lock

* update yarn.lock
  • Loading branch information
0xTxbi authored Feb 19, 2025
1 parent bdb2648 commit 36c0849
Show file tree
Hide file tree
Showing 18 changed files with 271 additions and 1 deletion.
37 changes: 37 additions & 0 deletions airdrops/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
# dependencies
/node_modules

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

npm-debug.log*
yarn-debug.log*
yarn-error.log*

# next builds
/src/.next
.next
/out
.next/cache/**
next-env.d.ts
scripts/paywallURL.ts
scripts/index.html

# Sentry
.sentryclirc
.vercel

certificates

# tsbuild logs
tsconfig.tsbuildinfo
7 changes: 7 additions & 0 deletions airdrops/app/globals.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
@tailwind base;
@tailwind components;
@tailwind utilities;

body {
@apply bg-ui-secondary-200;
}
35 changes: 35 additions & 0 deletions airdrops/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
import { Inter } from 'next/font/google'
import './globals.css'
import { Metadata } from 'next'
import Providers from '../components/providers'

const inter = Inter({
subsets: ['latin'],
style: ['normal'],
display: 'swap',
weight: ['400', '500', '600', '700'],
})

export const metadata: Metadata = {
icons: {
icon: '/favicon.ico',
},
}

export default function RootLayout({
children,
}: {
children: React.ReactNode
}) {
return (
<html lang="en" className={inter.className}>
<Providers>
<body>
<div className="overflow-hidden bg-ui-secondary-200 px-4 mx-auto lg:container">
<div className="flex flex-col gap-10 min-h-screen">{children}</div>
</div>
</body>
</Providers>
</html>
)
}
3 changes: 3 additions & 0 deletions airdrops/app/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
export default function Home() {
return <div className="flex flex-col gap-10 h-full">Unlock Airdrops</div>
}
18 changes: 18 additions & 0 deletions airdrops/components/providers.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
'use client'

import { PrivyProvider } from '@privy-io/react-auth'

const Providers = ({ children }) => {
return (
<PrivyProvider
config={{
loginMethods: ['wallet'],
}}
appId="cm2oqudm203nny8z9ho6chvyv"
>
{children}
</PrivyProvider>
)
}

export default Providers
13 changes: 13 additions & 0 deletions airdrops/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
const unlockConfig = require('@unlock-protocol/eslint-config/next')
module.exports = [
...unlockConfig,
{
ignores: ['src/**/*.typegen.ts', 'tsconfig.json'],
},
{
rules: {
'react/no-children-prop': 'off',
'no-constant-binary-expression': 'warn',
},
},
]
9 changes: 9 additions & 0 deletions airdrops/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/** @type {import('next').NextConfig} */
const config = {
images: {
unoptimized: true,
},
output: 'standalone',
}

module.exports = config
55 changes: 55 additions & 0 deletions airdrops/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
{
"name": "@unlock-protocol/airdrops",
"version": "0.1.0",
"private": true,
"peerDependencies": {
"react": "18.3.1",
"react-dom": "18.3.1"
},
"dependencies": {
"@headlessui/react": "2.1.9",
"@privy-io/react-auth": "2.2.1",
"@sentry/nextjs": "8.54.0",
"@tanstack/react-query": "5.59.19",
"@tw-classed/react": "1.7.0",
"@unlock-protocol/core": "workspace:./packages/core",
"@unlock-protocol/crypto-icon": "workspace:./packages/crypto-icon",
"@unlock-protocol/eslint-config": "workspace:./packages/eslint-config",
"@unlock-protocol/networks": "workspace:./packages/networks",
"@unlock-protocol/ui": "workspace:./packages/ui",
"@unlock-protocol/unlock-js": "workspace:./packages/unlock-js",
"@vercel/og": "0.6.5",
"@vercel/speed-insights": "1.0.14",
"dayjs": "1.11.13",
"embla-carousel-react": "8.5.2",
"eslint": "9.11.1",
"next": "14.2.21",
"react-hot-toast": "2.4.1",
"tailwind-merge": "3.0.1",
"typescript": "5.6.3"
},
"devDependencies": {
"@types/react": "18.3.18",
"@unlock-protocol/tsconfig": "workspace:./packages/tsconfig",
"@vitejs/plugin-react": "4.3.4",
"autoprefixer": "10.4.20",
"jsdom": "26.0.0",
"postcss": "8.4.49",
"tailwindcss": "3.4.17",
"vitest": "2.1.9"
},
"scripts": {
"dev": "next dev",
"build": "next build --no-lint",
"deploy": "yarn build && next export -o out",
"start": "yarn build && NODE_ENV=production next start",
"test": "UNLOCK_ENV=test vitest run --coverage --environment=jsdom",
"lint": "eslint",
"ci": "yarn test && yarn lint && yarn build"
},
"browserslist": [
"defaults",
"not IE 11",
"maintained node versions"
]
}
6 changes: 6 additions & 0 deletions airdrops/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module.exports = {
plugins: {
tailwindcss: {},
autoprefixer: {},
},
}
Binary file added airdrops/public/favicon.ico
Binary file not shown.
Binary file added airdrops/public/fonts/inter-400.woff
Binary file not shown.
Binary file added airdrops/public/fonts/inter-700.woff
Binary file not shown.
8 changes: 8 additions & 0 deletions airdrops/public/images/svg/unlock-logo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions airdrops/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
10 changes: 10 additions & 0 deletions airdrops/tailwind.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
/** @type {import('tailwindcss').Config} */
module.exports = {
content: [
'./src/**/*.{tsx,ts,jsx,js,html,mdx}',
'./app/**/*.{tsx,ts,jsx,js,html,mdx}',
'./components/**/*.{tsx,ts,jsx,js,html,mdx}',
'./../node_modules/@unlock-protocol/ui/dist/*.{js,css}',
],
presets: [require('@unlock-protocol/ui/dist/unlock-tailwind-preset')],
}
28 changes: 28 additions & 0 deletions airdrops/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
{
"extends": "@unlock-protocol/tsconfig",
"compilerOptions": {
"allowJs": true,
"jsx": "preserve",
"skipLibCheck": true,
"strict": false,
"noEmit": true,
"incremental": true,
"lib": [
"dom"
],
"resolveJsonModule": true,
"moduleResolution": "node",
"isolatedModules": true,
"plugins": [
{
"name": "next"
}
]
},
"include": [
"next-env.d.ts",
".next/types/**/*.ts",
"**/*.ts",
"**/*.tsx"
]
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@
"wedlocks",
"provider",
"docs",
"graph-service"
"graph-service",
"airdrops"
],
"scripts": {
"test": "echo \"Error: no test specified\" && exit 1",
Expand Down
38 changes: 38 additions & 0 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -18567,6 +18567,44 @@ __metadata:
languageName: node
linkType: hard

"@unlock-protocol/airdrops@workspace:airdrops":
version: 0.0.0-use.local
resolution: "@unlock-protocol/airdrops@workspace:airdrops"
dependencies:
"@headlessui/react": "npm:2.1.9"
"@privy-io/react-auth": "npm:2.2.1"
"@sentry/nextjs": "npm:8.54.0"
"@tanstack/react-query": "npm:5.59.19"
"@tw-classed/react": "npm:1.7.0"
"@types/react": "npm:18.3.18"
"@unlock-protocol/core": "workspace:./packages/core"
"@unlock-protocol/crypto-icon": "workspace:./packages/crypto-icon"
"@unlock-protocol/eslint-config": "workspace:./packages/eslint-config"
"@unlock-protocol/networks": "workspace:./packages/networks"
"@unlock-protocol/tsconfig": "workspace:./packages/tsconfig"
"@unlock-protocol/ui": "workspace:./packages/ui"
"@unlock-protocol/unlock-js": "workspace:./packages/unlock-js"
"@vercel/og": "npm:0.6.5"
"@vercel/speed-insights": "npm:1.0.14"
"@vitejs/plugin-react": "npm:4.3.4"
autoprefixer: "npm:10.4.20"
dayjs: "npm:1.11.13"
embla-carousel-react: "npm:8.5.2"
eslint: "npm:9.11.1"
jsdom: "npm:26.0.0"
next: "npm:14.2.21"
postcss: "npm:8.4.49"
react-hot-toast: "npm:2.4.1"
tailwind-merge: "npm:3.0.1"
tailwindcss: "npm:3.4.17"
typescript: "npm:5.6.3"
vitest: "npm:2.1.9"
peerDependencies:
react: 18.3.1
react-dom: 18.3.1
languageName: unknown
linkType: soft

"@unlock-protocol/contracts@workspace:./packages/contracts, @unlock-protocol/contracts@workspace:^, @unlock-protocol/contracts@workspace:packages/contracts":
version: 0.0.0-use.local
resolution: "@unlock-protocol/contracts@workspace:packages/contracts"
Expand Down

0 comments on commit 36c0849

Please sign in to comment.