Skip to content

Commit

Permalink
Merge pull request #1820 from cprussin/new-staking-app
Browse files Browse the repository at this point in the history
feat: initial implementation of new staking app
  • Loading branch information
cprussin authored Aug 23, 2024
2 parents aa9509c + d3e44e3 commit 6b7745f
Show file tree
Hide file tree
Showing 55 changed files with 4,099 additions and 42 deletions.
9 changes: 7 additions & 2 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,15 +1,20 @@
pnpm-lock.yaml
patches/

# This app has it's own prettier config that uses a later version of prettier
# These apps have their own prettier config that uses a later version of
# prettier
#
# TODO(cprussin): eventually I'll figure out how to upgrade prettier everywhere
# and hook it in to pre-commit. For now, I don't want to downgrade prettier in
# the pcakage that's using the later version, and pre-commit doesn't support
# the packages that are using the later version, and pre-commit doesn't support
# later versions of prettier directly.
#
# Ideally, we should probably hook up a pre-commit script to run auto-fixes in a
# generic way that packages can hook into by defining lifecycle scripts, or by
# using the nx task graph. Then, packages can use their own formatters /
# formatter versions and can also hook up other auto-fixes like eslint, etc.
#
# I'll explore doing this when I get around to spending some time on our nx
# build graph config.
apps/api-reference
apps/staking
1 change: 1 addition & 0 deletions apps/staking/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.env*.local
7 changes: 7 additions & 0 deletions apps/staking/.prettierignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
.next/
coverage/
node_modules/
*.tsbuildinfo
.env*.local
.env
.DS_Store
18 changes: 18 additions & 0 deletions apps/staking/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { fileURLToPath } from "node:url";

import { nextjs, tailwind, storybook } from "@cprussin/eslint-config";

const tailwindConfig = fileURLToPath(
import.meta.resolve(`./tailwind.config.ts`),
);

export default [
...nextjs,
...tailwind(tailwindConfig),
...storybook,
{
rules: {
"turbo/no-undeclared-env-vars": "off",
},
},
];
1 change: 1 addition & 0 deletions apps/staking/jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { nextjs as default } from "@cprussin/jest-config";
5 changes: 5 additions & 0 deletions apps/staking/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
55 changes: 55 additions & 0 deletions apps/staking/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
export default {
reactStrictMode: true,

pageExtensions: ["ts", "tsx", "mdx"],

logging: {
fetches: {
fullUrl: true,
},
},

webpack(config) {
config.module.rules.push({
test: /\.svg$/i,
use: ["@svgr/webpack"],
});

config.resolve.extensionAlias = {
".js": [".js", ".ts", ".tsx"],
};

return config;
},

transpilePackages: ["@pythnetwork/*"],

headers: () => [
{
source: "/:path*",
headers: [
{
key: "X-XSS-Protection",
value: "1; mode=block",
},
{
key: "Referrer-Policy",
value: "strict-origin-when-cross-origin",
},
{
key: "Strict-Transport-Security",
value: "max-age=2592000",
},
{
key: "X-Content-Type-Options",
value: "nosniff",
},
{
key: "Permissions-Policy",
value:
"vibrate=(), geolocation=(), midi=(), notifications=(), push=(), sync-xhr=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=(), vibrate=(), fullscreen=self",
},
],
},
],
};
63 changes: 63 additions & 0 deletions apps/staking/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"name": "@pythnetwork/staking",
"version": "0.0.0",
"private": true,
"type": "module",
"engines": {
"node": "18"
},
"scripts": {
"build": "next build",
"fix": "pnpm fix:lint && pnpm fix:format",
"fix:format": "prettier --write .",
"fix:lint": "eslint --fix .",
"pull:env": "VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID= vercel env pull",
"start:dev": "next dev",
"start:prod": "next start",
"test": "tsc && jest",
"test:format": "jest --selectProjects format",
"test:lint": "jest --selectProjects lint",
"test:types": "tsc",
"test:unit": "jest --selectProjects unit"
},
"dependencies": {
"@amplitude/analytics-browser": "^2.9.3",
"@amplitude/plugin-autocapture-browser": "^0.9.0",
"@bonfida/spl-name-service": "^3.0.0",
"@headlessui/react": "^2.1.2",
"@heroicons/react": "^2.1.4",
"@next/third-parties": "^14.2.5",
"@solana/wallet-adapter-base": "^0.9.20",
"@solana/wallet-adapter-react": "^0.15.28",
"@solana/wallet-adapter-react-ui": "^0.9.27",
"@solana/wallet-adapter-wallets": "0.19.10",
"@solana/web3.js": "^1.95.2",
"clsx": "^2.1.1",
"next": "^14.2.5",
"pino": "^9.3.2",
"react": "^18.3.1",
"react-dom": "^18.3.1",
"zod": "^3.23.8"
},
"devDependencies": {
"@axe-core/react": "^4.9.1",
"@cprussin/eslint-config": "^3.0.0",
"@cprussin/jest-config": "^1.4.1",
"@cprussin/prettier-config": "^2.1.1",
"@cprussin/tsconfig": "^3.0.1",
"@svgr/webpack": "^8.1.0",
"@tailwindcss/forms": "^0.5.7",
"@types/jest": "^29.5.12",
"@types/node": "^22.0.0",
"@types/react": "^18.3.3",
"@types/react-dom": "^18.3.0",
"autoprefixer": "^10.4.19",
"eslint": "^9.8.0",
"jest": "^29.7.0",
"postcss": "^8.4.40",
"prettier": "^3.3.2",
"tailwindcss": "^3.4.7",
"typescript": "^5.5.4",
"vercel": "^35.2.2"
}
}
6 changes: 6 additions & 0 deletions apps/staking/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
export default {
plugins: {
autoprefixer: {},
tailwindcss: {},
},
};
9 changes: 9 additions & 0 deletions apps/staking/prettier.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import { fileURLToPath } from "node:url";

import { base, tailwind, mergeConfigs } from "@cprussin/prettier-config";

const tailwindConfig = fileURLToPath(
import.meta.resolve(`./tailwind.config.ts`),
);

export default mergeConfigs([base, tailwind(tailwindConfig)]);
Binary file added apps/staking/public/android-chrome-192x192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/staking/public/android-chrome-512x512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/staking/public/apple-touch-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/staking/public/favicon-16x16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/staking/public/favicon-32x32.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/staking/public/favicon-light.ico
Binary file not shown.
Binary file added apps/staking/public/favicon.ico
Binary file not shown.
Loading

0 comments on commit 6b7745f

Please sign in to comment.