From b2a90eff51ee3cd2e8c9d919d0d94ecfadaf9d6a Mon Sep 17 00:00:00 2001 From: vutuanlinh2k2 <69841784+vutuanlinh2k2@users.noreply.github.com> Date: Fri, 23 Jun 2023 01:06:06 +0700 Subject: [PATCH] Initialize hubble-stats (#1366) --- .gitignore | 2 +- apps/hubble-stats/.eslintrc.json | 34 +++++++++ apps/hubble-stats/.vscode/settings.json | 4 + apps/hubble-stats/app/api/hello/route.ts | 3 + apps/hubble-stats/app/layout.tsx | 36 +++++++++ apps/hubble-stats/app/page.tsx | 3 + apps/hubble-stats/index.d.ts | 6 ++ apps/hubble-stats/jest.config.ts | 11 +++ apps/hubble-stats/next-env.d.ts | 5 ++ apps/hubble-stats/next.config.js | 26 +++++++ apps/hubble-stats/postcss.config.js | 17 +++++ apps/hubble-stats/project.json | 69 ++++++++++++++++++ apps/hubble-stats/public/.gitkeep | 0 apps/hubble-stats/public/favicon.ico | Bin 0 -> 15086 bytes apps/hubble-stats/tailwind.config.js | 25 +++++++ apps/hubble-stats/tsconfig.json | 38 ++++++++++ apps/hubble-stats/tsconfig.spec.json | 21 ++++++ .../src/css/layer-components.css | 3 +- nx.json | 1 + package.json | 4 + yarn.lock | 27 +++++-- 21 files changed, 328 insertions(+), 7 deletions(-) create mode 100644 apps/hubble-stats/.eslintrc.json create mode 100644 apps/hubble-stats/.vscode/settings.json create mode 100644 apps/hubble-stats/app/api/hello/route.ts create mode 100644 apps/hubble-stats/app/layout.tsx create mode 100644 apps/hubble-stats/app/page.tsx create mode 100644 apps/hubble-stats/index.d.ts create mode 100644 apps/hubble-stats/jest.config.ts create mode 100644 apps/hubble-stats/next-env.d.ts create mode 100644 apps/hubble-stats/next.config.js create mode 100644 apps/hubble-stats/postcss.config.js create mode 100644 apps/hubble-stats/project.json create mode 100644 apps/hubble-stats/public/.gitkeep create mode 100644 apps/hubble-stats/public/favicon.ico create mode 100644 apps/hubble-stats/tailwind.config.js create mode 100644 apps/hubble-stats/tsconfig.json create mode 100644 apps/hubble-stats/tsconfig.spec.json diff --git a/.gitignore b/.gitignore index 440f7ecbbc..c3f3e38c93 100644 --- a/.gitignore +++ b/.gitignore @@ -94,4 +94,4 @@ apps/stats-dapp/graphql.schema.json .direnv # Generated by json files -/**/generated/**/*.json +/**/generated/**/*.json \ No newline at end of file diff --git a/apps/hubble-stats/.eslintrc.json b/apps/hubble-stats/.eslintrc.json new file mode 100644 index 0000000000..af23ce730f --- /dev/null +++ b/apps/hubble-stats/.eslintrc.json @@ -0,0 +1,34 @@ +{ + "extends": [ + "plugin:@nx/react-typescript", + "next", + "next/core-web-vitals", + "../../.eslintrc.json" + ], + "ignorePatterns": ["!**/*", ".next/**/*"], + "overrides": [ + { + "files": ["*.ts", "*.tsx", "*.js", "*.jsx"], + "rules": { + "@next/next/no-html-link-for-pages": [ + "error", + "apps/hubble-stats/pages" + ] + } + }, + { + "files": ["*.ts", "*.tsx"], + "rules": {} + }, + { + "files": ["*.js", "*.jsx"], + "rules": {} + } + ], + "rules": { + "@next/next/no-html-link-for-pages": "off" + }, + "env": { + "jest": true + } +} diff --git a/apps/hubble-stats/.vscode/settings.json b/apps/hubble-stats/.vscode/settings.json new file mode 100644 index 0000000000..d3fdae9a69 --- /dev/null +++ b/apps/hubble-stats/.vscode/settings.json @@ -0,0 +1,4 @@ +{ + "typescript.tsdk": "../../node_modules/typescript/lib", + "typescript.enablePromptUseWorkspaceTsdk": true +} \ No newline at end of file diff --git a/apps/hubble-stats/app/api/hello/route.ts b/apps/hubble-stats/app/api/hello/route.ts new file mode 100644 index 0000000000..de70bac64e --- /dev/null +++ b/apps/hubble-stats/app/api/hello/route.ts @@ -0,0 +1,3 @@ +export async function GET(request: Request) { + return new Response('Hello, from API!'); +} diff --git a/apps/hubble-stats/app/layout.tsx b/apps/hubble-stats/app/layout.tsx new file mode 100644 index 0000000000..d1918a032c --- /dev/null +++ b/apps/hubble-stats/app/layout.tsx @@ -0,0 +1,36 @@ +'use client'; + +import { useEffect } from 'react'; +import Head from 'next/head'; +import { + WebbUIProvider, + useDarkMode, + Footer, +} from '@webb-tools/webb-ui-components'; +import '@webb-tools/webb-ui-components/tailwind.css'; + +export default function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + const [, setIsDarkMode] = useDarkMode(); + + useEffect(() => { + setIsDarkMode('light'); + }, [setIsDarkMode]); + + return ( + + + + Welcome to Hubble Stats! + + + {children} +