Skip to content

Commit

Permalink
Merge pull request #353 from ZJUEarthData/feature/init-frontend
Browse files Browse the repository at this point in the history
feat: added front-end initialization settings
  • Loading branch information
SanyHe authored Jun 10, 2024
2 parents 82c25be + 9c18a56 commit d26a78d
Show file tree
Hide file tree
Showing 55 changed files with 531 additions and 1,013 deletions.
21 changes: 0 additions & 21 deletions geochemistrypi/frontend/.babelrc

This file was deleted.

36 changes: 0 additions & 36 deletions geochemistrypi/frontend/.eslintrc.js

This file was deleted.

31 changes: 31 additions & 0 deletions geochemistrypi/frontend/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
.vscode
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?

*.tsbuildinfo
8 changes: 0 additions & 8 deletions geochemistrypi/frontend/.prettierrc.js

This file was deleted.

8 changes: 8 additions & 0 deletions geochemistrypi/frontend/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"tabWidth": 2,
"singleQuote": true,
"printWidth": 100,
"trailingComma": "none"
}
1 change: 1 addition & 0 deletions geochemistrypi/frontend/.stylelintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{ "extends": ["stylelint-config-standard"] }
23 changes: 23 additions & 0 deletions geochemistrypi/frontend/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
## Project Setup

```sh
npm install
```

### Compile and Hot-Reload for Development

```sh
npm run start
```

### Compile and Minify for Production

```sh
npm run build
```

### Lint with [ESLint](https://eslint.org/)

```sh
npm run lint
```
9 changes: 9 additions & 0 deletions geochemistrypi/frontend/auto-imports.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
/* eslint-disable */
/* prettier-ignore */
// @ts-nocheck
// noinspection JSUnusedGlobalSymbols
// Generated by unplugin-auto-import
export {}
declare global {

}
14 changes: 14 additions & 0 deletions geochemistrypi/frontend/components.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
/* eslint-disable */
// @ts-nocheck
// Generated by unplugin-vue-components
// Read more: https://github.com/vuejs/core/pull/3399
export {}

/* prettier-ignore */
declare module 'vue' {
export interface GlobalComponents {
NavBar: typeof import('./src/components/nav-bar.vue')['default']
RouterLink: typeof import('vue-router')['RouterLink']
RouterView: typeof import('vue-router')['RouterView']
}
}
1 change: 1 addition & 0 deletions geochemistrypi/frontend/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/// <reference types="vite/client" />
22 changes: 22 additions & 0 deletions geochemistrypi/frontend/eslint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import globals from 'globals'
import pluginJs from '@eslint/js'
// import tseslint from "typescript-eslint";
import pluginVue from 'eslint-plugin-vue'

export default [
{ languageOptions: { globals: globals.browser } },
pluginJs.configs.recommended,
// ...tseslint.configs.recommended,
...pluginVue.configs['flat/essential'],
{
rules: {
semi: ['warn', 'never'],
'comma-dangle': ['error', 'never'],
'no-unused-vars': 2,
'space-before-function-paren': 0,
'generator-star-spacing': 'off',
'object-curly-spacing': 0, // 强制在大括号中使用一致的空格
'array-bracket-spacing': 0 // 方括号
}
}
]
13 changes: 13 additions & 0 deletions geochemistrypi/frontend/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite App</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
84 changes: 37 additions & 47 deletions geochemistrypi/frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,55 +1,45 @@
{
"name": "geochemistrypi",
"version": "0.2.1",
"description": "a Python framework for data-driven geochemistry discovery.",
"main": "src/index.tsx",
"repository": "https://github.com/ZJUEarthData/geochemistrypi",
"author": "Can He",
"license": "MIT",
"name": "frontend-new",
"version": "0.0.0",
"private": true,
"type": "module",
"scripts": {
"start": "webpack serve --config webpack.config.js --env env=development",
"build": "webpack --config webpack.config.js --env env=production",
"lint": "eslint --fix \"./src/**/*.{js,jsx,ts,tsx,json}\""
"start": "vite",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"build-only": "vite build",
"type-check": "vue-tsc --build --force",
"lint": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
"format": "prettier --write src/"
},
"dependencies": {
"react": "^18.2.0",
"react-dom": "^18.2.0"
"element-plus": "^2.7.2",
"pinia": "^2.1.7",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
},
"devDependencies": {
"@babel/cli": "^7.21.5",
"@babel/core": "^7.21.8",
"@babel/plugin-transform-runtime": "^7.21.4",
"@babel/preset-env": "^7.21.5",
"@babel/preset-react": "^7.18.6",
"@babel/preset-typescript": "^7.21.5",
"@babel/runtime": "^7.21.5",
"@types/react": "^18.2.6",
"@types/react-dom": "^18.2.4",
"@typescript-eslint/eslint-plugin": "^5.59.6",
"@typescript-eslint/parser": "^5.59.6",
"antd": "^5.6.1",
"axios": "^1.4.0",
"babel-loader": "^9.1.2",
"clean-webpack-plugin": "^4.0.0",
"css-loader": "^6.7.3",
"dotenv": "^16.3.1",
"dotenv-webpack": "^8.0.1",
"eslint": "^8.40.0",
"eslint-config-prettier": "^8.8.0",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsx-a11y": "^6.7.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-react": "^7.32.2",
"eslint-plugin-react-hooks": "^4.6.0",
"html-webpack-plugin": "^5.5.1",
"prettier": "^2.8.8",
"react-cookie": "^4.1.1",
"react-hot-toast": "^2.4.1",
"react-router-dom": "^6.11.1",
"style-loader": "^3.3.2",
"typescript": "^5.0.4",
"webpack": "^5.82.1",
"webpack-cli": "^5.1.1",
"webpack-dev-server": "^4.15.0"
"@eslint/js": "^9.4.0",
"@tsconfig/node20": "^20.1.4",
"@types/node": "^20.12.5",
"@vitejs/plugin-vue": "^5.0.4",
"@vitejs/plugin-vue-jsx": "^3.1.0",
"@vue/compiler-sfc": "^3.4.27",
"@vue/tsconfig": "^0.5.1",
"eslint": "^9.4.0",
"eslint-plugin-vue": "^9.26.0",
"globals": "^15.3.0",
"npm-run-all2": "^6.1.2",
"prettier": "^3.2.5",
"sass": "^1.76.0",
"sass-loader": "^14.2.1",
"typescript": "~5.4.0",
"typescript-eslint": "^7.11.0",
"unplugin-auto-import": "^0.17.5",
"unplugin-vue-components": "^0.27.0",
"vite": "^5.2.8",
"vite-plugin-eslint": "^1.8.1",
"vite-plugin-vue-devtools": "^7.0.25",
"vue-tsc": "^2.0.11"
}
}
Binary file added geochemistrypi/frontend/public/favicon.ico
Binary file not shown.
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 geochemistrypi/frontend/public/imgs/xiaogou.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 0 additions & 14 deletions geochemistrypi/frontend/public/index.html

This file was deleted.

21 changes: 0 additions & 21 deletions geochemistrypi/frontend/src/App.tsx

This file was deleted.

12 changes: 12 additions & 0 deletions geochemistrypi/frontend/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<script lang="ts" setup>
import { RouterView } from 'vue-router'
import NavBar from './components/nav-bar.vue'
</script>

<template>
<header>
<NavBar />
</header>

<RouterView />
</template>
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 geochemistrypi/frontend/src/assets/imgs/bg.jpg
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 geochemistrypi/frontend/src/assets/imgs/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions geochemistrypi/frontend/src/assets/style/base.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
*,
*::before,
*::after {
box-sizing: border-box;
margin: 0;
font-weight: normal;
}
a {
text-decoration: none;
}
ul,
ol {
list-style: none;
}
body {
transition:
color 0.5s,
background-color 0.5s;
line-height: 1.6;
font-family:
Inter,
-apple-system,
BlinkMacSystemFont,
'Segoe UI',
Roboto,
Oxygen,
Ubuntu,
Cantarell,
'Fira Sans',
'Droid Sans',
'Helvetica Neue',
sans-serif;
font-size: 14px;
text-rendering: optimizeLegibility;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
}
6 changes: 6 additions & 0 deletions geochemistrypi/frontend/src/assets/style/main.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
@import './base.scss';

#app {
min-height: 100vh;
background-color: #fff;
}
9 changes: 0 additions & 9 deletions geochemistrypi/frontend/src/components/Dashboard.tsx

This file was deleted.

Loading

0 comments on commit d26a78d

Please sign in to comment.