Skip to content

Commit 6b7745f

Browse files
authored
Merge pull request #1820 from cprussin/new-staking-app
feat: initial implementation of new staking app
2 parents aa9509c + d3e44e3 commit 6b7745f

Some content is hidden

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

55 files changed

+4099
-42
lines changed

.prettierignore

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,20 @@
11
pnpm-lock.yaml
22
patches/
33

4-
# This app has it's own prettier config that uses a later version of prettier
4+
# These apps have their own prettier config that uses a later version of
5+
# prettier
56
#
67
# TODO(cprussin): eventually I'll figure out how to upgrade prettier everywhere
78
# and hook it in to pre-commit. For now, I don't want to downgrade prettier in
8-
# the pcakage that's using the later version, and pre-commit doesn't support
9+
# the packages that are using the later version, and pre-commit doesn't support
910
# later versions of prettier directly.
1011
#
1112
# Ideally, we should probably hook up a pre-commit script to run auto-fixes in a
1213
# generic way that packages can hook into by defining lifecycle scripts, or by
1314
# using the nx task graph. Then, packages can use their own formatters /
1415
# formatter versions and can also hook up other auto-fixes like eslint, etc.
16+
#
17+
# I'll explore doing this when I get around to spending some time on our nx
18+
# build graph config.
1519
apps/api-reference
20+
apps/staking

apps/staking/.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env*.local

apps/staking/.prettierignore

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.next/
2+
coverage/
3+
node_modules/
4+
*.tsbuildinfo
5+
.env*.local
6+
.env
7+
.DS_Store

apps/staking/eslint.config.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { fileURLToPath } from "node:url";
2+
3+
import { nextjs, tailwind, storybook } from "@cprussin/eslint-config";
4+
5+
const tailwindConfig = fileURLToPath(
6+
import.meta.resolve(`./tailwind.config.ts`),
7+
);
8+
9+
export default [
10+
...nextjs,
11+
...tailwind(tailwindConfig),
12+
...storybook,
13+
{
14+
rules: {
15+
"turbo/no-undeclared-env-vars": "off",
16+
},
17+
},
18+
];

apps/staking/jest.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { nextjs as default } from "@cprussin/jest-config";

apps/staking/next-env.d.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
/// <reference types="next" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

apps/staking/next.config.js

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
export default {
2+
reactStrictMode: true,
3+
4+
pageExtensions: ["ts", "tsx", "mdx"],
5+
6+
logging: {
7+
fetches: {
8+
fullUrl: true,
9+
},
10+
},
11+
12+
webpack(config) {
13+
config.module.rules.push({
14+
test: /\.svg$/i,
15+
use: ["@svgr/webpack"],
16+
});
17+
18+
config.resolve.extensionAlias = {
19+
".js": [".js", ".ts", ".tsx"],
20+
};
21+
22+
return config;
23+
},
24+
25+
transpilePackages: ["@pythnetwork/*"],
26+
27+
headers: () => [
28+
{
29+
source: "/:path*",
30+
headers: [
31+
{
32+
key: "X-XSS-Protection",
33+
value: "1; mode=block",
34+
},
35+
{
36+
key: "Referrer-Policy",
37+
value: "strict-origin-when-cross-origin",
38+
},
39+
{
40+
key: "Strict-Transport-Security",
41+
value: "max-age=2592000",
42+
},
43+
{
44+
key: "X-Content-Type-Options",
45+
value: "nosniff",
46+
},
47+
{
48+
key: "Permissions-Policy",
49+
value:
50+
"vibrate=(), geolocation=(), midi=(), notifications=(), push=(), sync-xhr=(), microphone=(), camera=(), magnetometer=(), gyroscope=(), speaker=(), vibrate=(), fullscreen=self",
51+
},
52+
],
53+
},
54+
],
55+
};

apps/staking/package.json

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
{
2+
"name": "@pythnetwork/staking",
3+
"version": "0.0.0",
4+
"private": true,
5+
"type": "module",
6+
"engines": {
7+
"node": "18"
8+
},
9+
"scripts": {
10+
"build": "next build",
11+
"fix": "pnpm fix:lint && pnpm fix:format",
12+
"fix:format": "prettier --write .",
13+
"fix:lint": "eslint --fix .",
14+
"pull:env": "VERCEL_ORG_ID=team_BKQrg3JJFLxZyTqpuYtIY0rj VERCEL_PROJECT_ID= vercel env pull",
15+
"start:dev": "next dev",
16+
"start:prod": "next start",
17+
"test": "tsc && jest",
18+
"test:format": "jest --selectProjects format",
19+
"test:lint": "jest --selectProjects lint",
20+
"test:types": "tsc",
21+
"test:unit": "jest --selectProjects unit"
22+
},
23+
"dependencies": {
24+
"@amplitude/analytics-browser": "^2.9.3",
25+
"@amplitude/plugin-autocapture-browser": "^0.9.0",
26+
"@bonfida/spl-name-service": "^3.0.0",
27+
"@headlessui/react": "^2.1.2",
28+
"@heroicons/react": "^2.1.4",
29+
"@next/third-parties": "^14.2.5",
30+
"@solana/wallet-adapter-base": "^0.9.20",
31+
"@solana/wallet-adapter-react": "^0.15.28",
32+
"@solana/wallet-adapter-react-ui": "^0.9.27",
33+
"@solana/wallet-adapter-wallets": "0.19.10",
34+
"@solana/web3.js": "^1.95.2",
35+
"clsx": "^2.1.1",
36+
"next": "^14.2.5",
37+
"pino": "^9.3.2",
38+
"react": "^18.3.1",
39+
"react-dom": "^18.3.1",
40+
"zod": "^3.23.8"
41+
},
42+
"devDependencies": {
43+
"@axe-core/react": "^4.9.1",
44+
"@cprussin/eslint-config": "^3.0.0",
45+
"@cprussin/jest-config": "^1.4.1",
46+
"@cprussin/prettier-config": "^2.1.1",
47+
"@cprussin/tsconfig": "^3.0.1",
48+
"@svgr/webpack": "^8.1.0",
49+
"@tailwindcss/forms": "^0.5.7",
50+
"@types/jest": "^29.5.12",
51+
"@types/node": "^22.0.0",
52+
"@types/react": "^18.3.3",
53+
"@types/react-dom": "^18.3.0",
54+
"autoprefixer": "^10.4.19",
55+
"eslint": "^9.8.0",
56+
"jest": "^29.7.0",
57+
"postcss": "^8.4.40",
58+
"prettier": "^3.3.2",
59+
"tailwindcss": "^3.4.7",
60+
"typescript": "^5.5.4",
61+
"vercel": "^35.2.2"
62+
}
63+
}

apps/staking/postcss.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
export default {
2+
plugins: {
3+
autoprefixer: {},
4+
tailwindcss: {},
5+
},
6+
};

apps/staking/prettier.config.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
import { fileURLToPath } from "node:url";
2+
3+
import { base, tailwind, mergeConfigs } from "@cprussin/prettier-config";
4+
5+
const tailwindConfig = fileURLToPath(
6+
import.meta.resolve(`./tailwind.config.ts`),
7+
);
8+
9+
export default mergeConfigs([base, tailwind(tailwindConfig)]);

0 commit comments

Comments
 (0)