You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@eventmesh.apache.org by xi...@apache.org on 2022/06/02 04:17:25 UTC
[incubator-eventmesh] 01/01: Dashboard: Initialize the project with Next.js
This is an automated email from the ASF dual-hosted git repository.
xiaoyang pushed a commit to branch dashboard
in repository https://gitbox.apache.org/repos/asf/incubator-eventmesh.git
commit f66bc6482c55f688181bdc189eaa2aa52cf9f987
Author: Xiaoyang Liu <si...@gmail.com>
AuthorDate: Wed Jun 1 21:17:10 2022 -0700
Dashboard: Initialize the project with Next.js
Signed-off-by: Xiaoyang Liu <si...@gmail.com>
---
eventmesh-dashboard/.eslintrc.js | 34 +++++++++
eventmesh-dashboard/.gitignore | 125 ++++++++++++++++++++++++++++++++
eventmesh-dashboard/README.md | 34 +++++++++
eventmesh-dashboard/next-env.d.ts | 5 ++
eventmesh-dashboard/next.config.js | 6 ++
eventmesh-dashboard/package.json | 36 +++++++++
eventmesh-dashboard/pages/_app.tsx | 16 ++++
eventmesh-dashboard/pages/_document.tsx | 19 +++++
eventmesh-dashboard/pages/index.tsx | 7 ++
eventmesh-dashboard/public/favicon.ico | Bin 0 -> 25931 bytes
eventmesh-dashboard/tsconfig.json | 20 +++++
11 files changed, 302 insertions(+)
diff --git a/eventmesh-dashboard/.eslintrc.js b/eventmesh-dashboard/.eslintrc.js
new file mode 100644
index 00000000..f6528300
--- /dev/null
+++ b/eventmesh-dashboard/.eslintrc.js
@@ -0,0 +1,34 @@
+module.exports = {
+ env: {
+ browser: true,
+ es2021: true,
+ },
+ extends: [
+ 'plugin:react/recommended',
+ 'airbnb',
+ 'airbnb-typescript',
+ ],
+ parser: '@typescript-eslint/parser',
+ parserOptions: {
+ ecmaFeatures: {
+ jsx: true,
+ },
+ ecmaVersion: 13,
+ sourceType: 'module',
+ project: 'tsconfig.json',
+ },
+ plugins: [
+ 'react',
+ '@typescript-eslint',
+ ],
+ rules: {
+ 'react/react-in-jsx-scope': 'off',
+ 'react/function-component-definition': [
+ 'error',
+ {
+ namedComponents: 'arrow-function',
+ },
+ ],
+ 'no-param-reassign': 'off'
+ },
+};
diff --git a/eventmesh-dashboard/.gitignore b/eventmesh-dashboard/.gitignore
new file mode 100644
index 00000000..119a1e32
--- /dev/null
+++ b/eventmesh-dashboard/.gitignore
@@ -0,0 +1,125 @@
+# Logs
+logs
+*.log
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+lerna-debug.log*
+
+# Diagnostic reports (https://nodejs.org/api/report.html)
+report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
+
+# Runtime data
+pids
+*.pid
+*.seed
+*.pid.lock
+
+# Directory for instrumented libs generated by jscoverage/JSCover
+lib-cov
+
+# Coverage directory used by tools like istanbul
+coverage
+*.lcov
+
+# nyc test coverage
+.nyc_output
+
+# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
+.grunt
+
+# Bower dependency directory (https://bower.io/)
+bower_components
+
+# node-waf configuration
+.lock-wscript
+
+# Compiled binary addons (https://nodejs.org/api/addons.html)
+build/Release
+
+# Dependency directories
+node_modules/
+jspm_packages/
+
+# TypeScript v1 declaration files
+typings/
+
+# TypeScript cache
+*.tsbuildinfo
+
+# Optional npm cache directory
+.npm
+
+# Optional eslint cache
+.eslintcache
+
+# Microbundle cache
+.rpt2_cache/
+.rts2_cache_cjs/
+.rts2_cache_es/
+.rts2_cache_umd/
+
+# Optional REPL history
+.node_repl_history
+
+# Output of 'npm pack'
+*.tgz
+
+# Yarn Integrity file
+.yarn-integrity
+
+# parcel-bundler cache (https://parceljs.org/)
+.cache
+
+# Next.js build output
+.next
+
+# Nuxt.js build / generate output
+.nuxt
+dist
+
+# Gatsby files
+.cache/
+# Comment in the public line in if your project uses Gatsby and *not* Next.js
+# https://nextjs.org/blog/next-9-1#public-directory-support
+# public
+
+# vuepress build output
+.vuepress/dist
+
+# Serverless directories
+.serverless/
+
+# FuseBox cache
+.fusebox/
+
+# DynamoDB Local files
+.dynamodb/
+
+# TernJS port file
+.tern-port
+
+# next.js
+/.next/
+/out/
+
+# production
+/build
+
+# misc
+.DS_Store
+*.pem
+
+# debug
+npm-debug.log*
+yarn-debug.log*
+yarn-error.log*
+
+# local env files
+.env.local
+.env.development.local
+.env.test.local
+.env.production.local
+
+# vercel
+.vercel
diff --git a/eventmesh-dashboard/README.md b/eventmesh-dashboard/README.md
new file mode 100644
index 00000000..c87e0421
--- /dev/null
+++ b/eventmesh-dashboard/README.md
@@ -0,0 +1,34 @@
+This is a [Next.js](https://nextjs.org/) project bootstrapped with [`create-next-app`](https://github.com/vercel/next.js/tree/canary/packages/create-next-app).
+
+## Getting Started
+
+First, run the development server:
+
+```bash
+npm run dev
+# or
+yarn dev
+```
+
+Open [http://localhost:3000](http://localhost:3000) with your browser to see the result.
+
+You can start editing the page by modifying `pages/index.tsx`. The page auto-updates as you edit the file.
+
+[API routes](https://nextjs.org/docs/api-routes/introduction) can be accessed on [http://localhost:3000/api/hello](http://localhost:3000/api/hello). This endpoint can be edited in `pages/api/hello.ts`.
+
+The `pages/api` directory is mapped to `/api/*`. Files in this directory are treated as [API routes](https://nextjs.org/docs/api-routes/introduction) instead of React pages.
+
+## Learn More
+
+To learn more about Next.js, take a look at the following resources:
+
+- [Next.js Documentation](https://nextjs.org/docs) - learn about Next.js features and API.
+- [Learn Next.js](https://nextjs.org/learn) - an interactive Next.js tutorial.
+
+You can check out [the Next.js GitHub repository](https://github.com/vercel/next.js/) - your feedback and contributions are welcome!
+
+## Deploy on Vercel
+
+The easiest way to deploy your Next.js app is to use the [Vercel Platform](https://vercel.com/new?utm_medium=default-template&filter=next.js&utm_source=create-next-app&utm_campaign=create-next-app-readme) from the creators of Next.js.
+
+Check out our [Next.js deployment documentation](https://nextjs.org/docs/deployment) for more details.
diff --git a/eventmesh-dashboard/next-env.d.ts b/eventmesh-dashboard/next-env.d.ts
new file mode 100644
index 00000000..4f11a03d
--- /dev/null
+++ b/eventmesh-dashboard/next-env.d.ts
@@ -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.
diff --git a/eventmesh-dashboard/next.config.js b/eventmesh-dashboard/next.config.js
new file mode 100644
index 00000000..a843cbee
--- /dev/null
+++ b/eventmesh-dashboard/next.config.js
@@ -0,0 +1,6 @@
+/** @type {import('next').NextConfig} */
+const nextConfig = {
+ reactStrictMode: true,
+}
+
+module.exports = nextConfig
diff --git a/eventmesh-dashboard/package.json b/eventmesh-dashboard/package.json
new file mode 100644
index 00000000..c6655d86
--- /dev/null
+++ b/eventmesh-dashboard/package.json
@@ -0,0 +1,36 @@
+{
+ "name": "eventmesh-dashboard",
+ "version": "0.1.0",
+ "private": true,
+ "scripts": {
+ "dev": "next dev",
+ "build": "next build",
+ "start": "next start",
+ "lint": "eslint . --cache --fix --ext .ts,.tsx"
+ },
+ "dependencies": {
+ "@chakra-ui/react": "^2.1.2",
+ "@emotion/react": "^11.9.0",
+ "@emotion/styled": "^11.8.1",
+ "framer-motion": "^6.3.6",
+ "next": "12.1.6",
+ "react": "18.1.0",
+ "react-dom": "18.1.0",
+ "swr": "^1.3.0"
+ },
+ "devDependencies": {
+ "@types/node": "17.0.38",
+ "@types/react": "18.0.10",
+ "@types/react-dom": "18.0.5",
+ "@typescript-eslint/eslint-plugin": "^5.4.0",
+ "@typescript-eslint/parser": "^5.4.0",
+ "eslint": "8.16.0",
+ "eslint-config-airbnb": "^19.0.1",
+ "eslint-config-airbnb-typescript": "^17.0.0",
+ "eslint-plugin-import": "^2.25.3",
+ "eslint-plugin-jsx-a11y": "^6.5.1",
+ "eslint-plugin-react": "^7.27.1",
+ "eslint-plugin-react-hooks": "^4.3.0",
+ "typescript": "4.7.2"
+ }
+}
diff --git a/eventmesh-dashboard/pages/_app.tsx b/eventmesh-dashboard/pages/_app.tsx
new file mode 100644
index 00000000..24a64ff3
--- /dev/null
+++ b/eventmesh-dashboard/pages/_app.tsx
@@ -0,0 +1,16 @@
+/* eslint-disable react/jsx-props-no-spreading */
+import type { AppProps } from 'next/app';
+import { ChakraProvider, extendTheme } from '@chakra-ui/react';
+
+const theme = extendTheme({
+ initialColorMode: 'light',
+ useSystemColorMode: true,
+});
+
+const Application = ({ Component, pageProps }: AppProps) => (
+ <ChakraProvider theme={theme}>
+ <Component {...pageProps} />
+ </ChakraProvider>
+);
+
+export default Application;
diff --git a/eventmesh-dashboard/pages/_document.tsx b/eventmesh-dashboard/pages/_document.tsx
new file mode 100644
index 00000000..dd70a58f
--- /dev/null
+++ b/eventmesh-dashboard/pages/_document.tsx
@@ -0,0 +1,19 @@
+import { ColorModeScript } from '@chakra-ui/react';
+import NextDocument, {
+ Html, Head, Main, NextScript,
+} from 'next/document';
+
+export default class Document extends NextDocument {
+ render() {
+ return (
+ <Html lang="en">
+ <Head />
+ <body>
+ <ColorModeScript />
+ <Main />
+ <NextScript />
+ </body>
+ </Html>
+ );
+ }
+}
diff --git a/eventmesh-dashboard/pages/index.tsx b/eventmesh-dashboard/pages/index.tsx
new file mode 100644
index 00000000..e8f17d14
--- /dev/null
+++ b/eventmesh-dashboard/pages/index.tsx
@@ -0,0 +1,7 @@
+import type { NextPage } from 'next';
+
+const Home: NextPage = () => (
+ <>Test</>
+);
+
+export default Home;
diff --git a/eventmesh-dashboard/public/favicon.ico b/eventmesh-dashboard/public/favicon.ico
new file mode 100644
index 00000000..718d6fea
Binary files /dev/null and b/eventmesh-dashboard/public/favicon.ico differ
diff --git a/eventmesh-dashboard/tsconfig.json b/eventmesh-dashboard/tsconfig.json
new file mode 100644
index 00000000..99710e85
--- /dev/null
+++ b/eventmesh-dashboard/tsconfig.json
@@ -0,0 +1,20 @@
+{
+ "compilerOptions": {
+ "target": "es5",
+ "lib": ["dom", "dom.iterable", "esnext"],
+ "allowJs": true,
+ "skipLibCheck": true,
+ "strict": true,
+ "forceConsistentCasingInFileNames": true,
+ "noEmit": true,
+ "esModuleInterop": true,
+ "module": "esnext",
+ "moduleResolution": "node",
+ "resolveJsonModule": true,
+ "isolatedModules": true,
+ "jsx": "preserve",
+ "incremental": true
+ },
+ "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
+ "exclude": ["node_modules"]
+}
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@eventmesh.apache.org
For additional commands, e-mail: commits-help@eventmesh.apache.org