Skip to content

Commit

Permalink
refactor(modules/web): Mirgrat to typescript; fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Xwite committed Oct 14, 2024
1 parent 3eded53 commit 30b31b9
Show file tree
Hide file tree
Showing 81 changed files with 6,407 additions and 3,177 deletions.
6 changes: 6 additions & 0 deletions modules/web/.editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[*.{js,jsx,mjs,cjs,ts,tsx,mts,cts,vue}]
charset = utf-8
indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true
96 changes: 0 additions & 96 deletions modules/web/.eslintrc-auto-import.json

This file was deleted.

20 changes: 0 additions & 20 deletions modules/web/.eslintrc.cjs

This file was deleted.

34 changes: 18 additions & 16 deletions modules/web/.gitignore
Original file line number Diff line number Diff line change
@@ -1,28 +1,30 @@
.DS_Store
node_modules
/dist
/doc


# local env files
.env.local
.env.*.local

# Log files
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
.DS_Store
dist
dist-ssr
coverage
*.local

/cypress/videos/
/cypress/screenshots/

# Editor directories and files
.vim
.vscode/*
!.vscode/extensions.json
.idea
.vscode
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
/package-lock.json
/yarn.lock
pnpm-lock.yaml

*.tsbuildinfo
7 changes: 7 additions & 0 deletions modules/web/.prettierrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@

{
"$schema": "https://json.schemastore.org/prettierrc",
"semi": false,
"singleQuote": true,
"arrowParens": "avoid"
}
2 changes: 1 addition & 1 deletion modules/web/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

| ![IE](https://cdn.jsdelivr.net/npm/@browser-logos/edge/edge_32x32.png) | ![Firefox](https://cdn.jsdelivr.net/npm/@browser-logos/firefox/firefox_32x32.png) | ![Chrome](https://cdn.jsdelivr.net/npm/@browser-logos/chrome/chrome_32x32.png) | ![Safari](https://cdn.jsdelivr.net/npm/@browser-logos/safari/safari_32x32.png) |
| ---------------------------------------------------------------------- | --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------ | ------------------------------------------------------------------------------ |
| Edge ≥ 79 | Firefox ≥ 78 | Chrome ≥ 64 | Safari ≥ 12 |
| Edge ≥ 85 | Firefox ≥ 79 | Chrome ≥ 85 | Safari ≥ 14.1 |

## 开发
> 需要阅读app提供后端服务
Expand Down
3 changes: 3 additions & 0 deletions modules/web/env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
/// <reference types="vite/client" />

declare module "vue3-virtual-scroll-list";
19 changes: 19 additions & 0 deletions modules/web/eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
import pluginVue from 'eslint-plugin-vue'
import vueTsEslintConfig from '@vue/eslint-config-typescript'
import skipFormatting from '@vue/eslint-config-prettier/skip-formatting'

export default [
{
name: 'app/files-to-lint',
files: ['**/*.{ts,mts,tsx,vue}'],
},

{
name: 'app/files-to-ignore',
ignores: ['**/dist/**', '**/dist-ssr/**', '**/coverage/**', "src/plugins/jump.js"],
},

...pluginVue.configs['flat/essential'],
...vueTsEslintConfig(),
skipFormatting,
]
24 changes: 12 additions & 12 deletions modules/web/index.html
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
<!DOCTYPE html>
<html lang="zh" class="">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
</head>

<body>
<div id="app"></div>
<script type="module" src="./src/main.js"></script>
</body>
<!DOCTYPE html>
<html lang="zh" class="">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/favicon.ico" />
<meta name="viewport" content="width=device-width,initial-scale=1.0" />
</head>

<body>
<div id="app"></div>
<script type="module" src="./src/main.ts"></script>
</body>
</html>
20 changes: 0 additions & 20 deletions modules/web/jsconfig.json

This file was deleted.

30 changes: 20 additions & 10 deletions modules/web/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,34 +9,44 @@
},
"scripts": {
"dev": "vite",
"build": "vite build && node scripts/sync.js",
"build": "run-p type-check \"build-only {@}\" --",
"preview": "vite preview",
"lint:fix": "eslint . --ext .vue,.js,.jsx,.cjs,.mjs --fix --ignore-path .gitignore"
"build-only": "vite build",
"type-check": "vue-tsc --build --force",
"lint:fix": "eslint . --fix",
"format": "prettier --write src/"
},
"dependencies": {
"@element-plus/icons-svg": "^2.3.1",
"@element-plus/icons-vue": "^2.3.1",
"@vueuse/core": "^11.1.0",
"@vueuse/shared": "^11.1.0",
"axios": "^1.7.7",
"element-plus": "^2.8.4",
"element-plus": "^2.8.5",
"hotkeys-js": "^3.13.7",
"pinia": "^2.2.4",
"vue": "^3.5.11",
"vue": "^3.5.12",
"vue-router": "^4.4.5",
"vue3-virtual-scroll-list": "^0.2.1"
},
"devDependencies": {
"@eslint/compat": "^1.2.0",
"@eslint/js": "^9.12.0",
"@tsconfig/node20": "^20.1.4",
"@types/node": "^20.16.11",
"@vitejs/plugin-vue": "^5.1.4",
"eslint": "^8.57.1",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"eslint-plugin-vue": "^9.28.0",
"@vue/eslint-config-prettier": "^10.0.0",
"@vue/eslint-config-typescript": "^14.0.1",
"@vue/tsconfig": "^0.5.1",
"eslint": "^9.12.0",
"eslint-plugin-vue": "^9.29.0",
"npm-run-all2": "^6.2.3",
"prettier": "^3.3.3",
"sass": "^1.79.4",
"typescript": "~5.5.4",
"unplugin-auto-import": "^0.18.3",
"unplugin-icons": "^0.19.3",
"unplugin-vue-components": "^0.27.4",
"vite": "^5.4.8"
"vite": "^5.4.8",
"vue-tsc": "^2.1.6"
}
}
Loading

0 comments on commit 30b31b9

Please sign in to comment.