Skip to content

Commit b50e9e1

Browse files
authored
Merge pull request #1655 from cprussin/add-api-reference
feat(api-reference): initialize api reference app
2 parents 5560f07 + 7ce7f61 commit b50e9e1

Some content is hidden

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

86 files changed

+8256
-32
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,4 @@ __pycache__
2121
.DS_Store
2222
.vercel
2323
.direnv
24+
.next

.prettierignore

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,15 @@
11
pnpm-lock.yaml
22
patches/
3+
4+
# This app has it's own prettier config that uses a later version of prettier
5+
#
6+
# TODO(cprussin): eventually I'll figure out how to upgrade prettier everywhere
7+
# 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+
# later versions of prettier directly.
10+
#
11+
# Ideally, we should probably hook up a pre-commit script to run auto-fixes in a
12+
# generic way that packages can hook into by defining lifecycle scripts, or by
13+
# using the nx task graph. Then, packages can use their own formatters /
14+
# formatter versions and can also hook up other auto-fixes like eslint, etc.
15+
apps/api-reference

apps/api-reference/.prettierignore

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

apps/api-reference/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/api-reference/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/api-reference/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/api-reference/next.config.js

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

apps/api-reference/package.json

Lines changed: 66 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
{
2+
"name": "@pythnetwork/api-reference",
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:format && pnpm fix:lint",
12+
"fix:format": "prettier --write .",
13+
"fix:lint": "eslint --fix .",
14+
"start:dev": "next dev",
15+
"start:prod": "next start",
16+
"test": "tsc && jest",
17+
"test:format": "jest --selectProjects format",
18+
"test:lint": "jest --selectProjects lint",
19+
"test:types": "tsc",
20+
"test:unit": "jest --selectProjects unit --passWithNoTests"
21+
},
22+
"dependencies": {
23+
"@amplitude/analytics-browser": "^2.8.1",
24+
"@floating-ui/react": "^0.26.16",
25+
"@headlessui/react": "^2.0.4",
26+
"@heroicons/react": "^2.1.3",
27+
"@mdx-js/loader": "^3.0.1",
28+
"@mdx-js/mdx": "^3.0.1",
29+
"@mdx-js/react": "^3.0.1",
30+
"@next/mdx": "^14.2.3",
31+
"@next/third-parties": "^14.2.3",
32+
"@pythnetwork/pyth-sdk-solidity": "^3.1.0",
33+
"@wagmi/core": "^2.10.5",
34+
"clsx": "^2.1.1",
35+
"next": "^14.2.3",
36+
"next-themes": "^0.3.0",
37+
"pino": "^9.1.0",
38+
"react": "^18.3.1",
39+
"react-dom": "^18.3.1",
40+
"shiki": "^1.6.2",
41+
"viem": "^2.13.3",
42+
"zod": "^3.23.8"
43+
},
44+
"devDependencies": {
45+
"@axe-core/react": "^4.9.1",
46+
"@cprussin/eslint-config": "^3.0.0",
47+
"@cprussin/jest-config": "^1.4.1",
48+
"@cprussin/prettier-config": "^2.1.1",
49+
"@cprussin/tsconfig": "^3.0.1",
50+
"@svgr/webpack": "^8.1.0",
51+
"@tailwindcss/forms": "^0.5.7",
52+
"@types/jest": "^29.5.12",
53+
"@types/mdx": "^2.0.13",
54+
"@types/node": "^20.14.0",
55+
"@types/react": "^18.3.3",
56+
"@types/react-dom": "^18.3.0",
57+
"autoprefixer": "^10.4.19",
58+
"eslint": "^9.4.0",
59+
"jest": "^29.7.0",
60+
"postcss": "^8.4.38",
61+
"prettier": "^3.3.0",
62+
"tailwindcss": "^3.4.3",
63+
"typescript": "^5.4.5",
64+
"vercel": "^34.2.4"
65+
}
66+
}

apps/api-reference/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/api-reference/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)