Skip to content

Commit

Permalink
🧱 update deps & optimization engineering
Browse files Browse the repository at this point in the history
  • Loading branch information
ileostar committed May 30, 2024
1 parent 2bd0d83 commit 49774fc
Show file tree
Hide file tree
Showing 16 changed files with 7,110 additions and 6,862 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

9 changes: 0 additions & 9 deletions .eslintrc.json

This file was deleted.

33 changes: 17 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
- 👀使用 Onu UI,一个基于UnoCSS的UI组件库
- 🍀集成 Vitest,用于项目的单元测试
- 🧰使用 VueUse 函数库辅助开发
- 💀使用 v3-directives 指令库辅助开发
- 🙈使用 Alova 实现网络请求
- 🍍使用 Pinia 进行状态管理
- 📌使用 husky、lint-staged 规范git commit
Expand Down Expand Up @@ -58,6 +59,7 @@
### 工具函数

- [VueUse中文文档 | VueUse中文文档 (vueusejs.com)](http://www.vueusejs.com/)
- [v3-directives 自定义指令库](https://github.com/ileostar/v3-directives)

### 规范相关

Expand All @@ -80,25 +82,25 @@

克隆项目到本地:

``` bash
```bash
npx degit ileostar/vitesse-star 你的项目名称 # If there is no npx, npm i -g npx first
```

进入项目目录:

``` bash
```bash
cd 你的项目名称
```

安装依赖:

``` bash
```bash
pnpm install # If there is no pnpm, npm i -g pnpm first
```

启动开发服务器:

``` bash
```bash
pnpm dev
```

Expand Down Expand Up @@ -126,18 +128,17 @@ pnpm dev
│ ├── App.vue // 根组件
│ └── main.ts // 项目入口文件
├── test // 单元测试
├── types // 类型文件
├── .editorconfig // IDE配置文件
├── .gitignore // git忽略文件
├── .npmrc // npm管理配置
├── .stylelintrc.json // stylelintrc文件
├── .env // 配置环境
├── .env.pro // 生产配置环境
├── .env.dev // 开发配置环境
├── .env.production // 生产配置环境
├── .env.development // 开发配置环境
├── index.html // 项目页面入口
├── myenv.d.ts // 环境声明文件
├── netlify.toml // netlify部署配置
├── .eslintignore // ESLint忽略文件
├── .eslintrc.json // ESLint配置文件
├── eslint.config.mjs // ESLint配置文件
├── package.json // 项目依赖配置文件
├── shims.d.ts // 声明文件
├── README.md // 项目说明文件
Expand All @@ -151,19 +152,19 @@ pnpm dev

### 读取配置

默认读取顺序`.env.dev/.env.pro > .env`
默认读取顺序`.env.development/.env.production > .env`

开发环境下可以在`.env.dev`修改需要配置
开发环境下可以在`.env.development`修改需要配置

生成环境下可以在`.env.pro`修改需要配置
生成环境下可以在`.env.production`修改需要配置

### 添加配置项

需要以VITE开头,如果在src中用可以使用`import.meta.env.<配置项>`,在`vite.config.ts`中用,这里用的是`dotenv`读取文件,需要在`./myenv.d.ts`文件下添加TS接口,才会有提示。
需要以VITE开头,如果在src中用可以使用`import.meta.env.<配置项>`

## 🤖代码规范

该项目使用 ESLint 来保证代码规范一致性。你可以在 .eslintrc.json 文件中查看相关配置。在提交代码时,将会自动进行代码规范检查。
该项目使用 ESLint 来保证代码规范一致性。你可以在 eslint.config.mjs 文件中查看相关配置。在提交代码时,将会自动进行代码规范检查。

## 🌐网络请求Alova

Expand All @@ -173,7 +174,7 @@ pnpm dev

## 🎇配置路由

该项目使用 unplugin-vue-router 插件来自动生成路由配置。详细的使用方法请参考插件文档。
该项目使用 unplugin-vue-router 插件来自动生成路由配置。详细的使用方法请参考插件文档。

## 🐹自动引入

Expand All @@ -183,7 +184,7 @@ pnpm dev

### 自动引入组件

该项目使用 vite-plugin-components 插件来实现组件的自动引入,**即定义组件直接使用即可,无需手动引入**,你可以在 vite.config.ts 中修改自动引入的规则和配置。
该项目使用 unplugin-vue-components 插件来实现组件的自动引入,**即定义组件直接使用即可,无需手动引入**,你可以在 vite.config.ts 中修改自动引入的规则和配置。

## 🍍状态管理

Expand Down
12 changes: 12 additions & 0 deletions eslint.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import antfu from '@antfu/eslint-config'

export default antfu(
{
unocss: true,
formatters: true,
ignores: [
'eslint.config.mjs',
'src/helper/pinia-auto-refs.ts'
]
},
)
44 changes: 23 additions & 21 deletions index.html
Original file line number Diff line number Diff line change
@@ -1,21 +1,23 @@
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>vue3-vite-alova-ts-vitest</title>
</head>
<body>
<div id="app"></div>
<script>
(function() {
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches
const setting = localStorage.getItem('color-schema') || 'auto'
if (setting === 'dark' || (prefersDark && setting !== 'light'))
document.documentElement.classList.toggle('dark', true)
})()
</script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>vitesse-star</title>
</head>
<body>
<div id="app"></div>
<script>
;(function () {
const prefersDark =
window.matchMedia &&
window.matchMedia('(prefers-color-scheme: dark)').matches
const setting = localStorage.getItem('color-schema') || 'auto'
if (setting === 'dark' || (prefersDark && setting !== 'light'))
document.documentElement.classList.toggle('dark', true)
})()
</script>
<script type="module" src="/src/main.ts"></script>
</body>
</html>
16 changes: 8 additions & 8 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
[build.environment]
NODE_VERSION = "20"

[build]
publish = "dist"
command = "pnpm run build"
publish = "dist"
command = "pnpm run build"

[build.environment]
NODE_VERSION = "20"

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
from = "/*"
to = "/index.html"
status = 200
66 changes: 34 additions & 32 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"type": "module",
"version": "0.0.1",
"private": true,
"packageManager": "pnpm@8.15.5",
"packageManager": "pnpm@9.1.2",
"keywords": [
"template-vue",
"vite",
Expand All @@ -29,56 +29,58 @@
}
},
"dependencies": {
"@vueuse/core": "^10.9.0",
"alova": "^2.18.0",
"vue": "^3.4.21",
"vue-router": "^4.3.0"
"@vueuse/core": "^10.10.0",
"alova": "^2.20.5",
"vue": "^3.4.27",
"vue-router": "^4.3.2"
},
"devDependencies": {
"@alova/adapter-axios": "^1.2.3",
"@iconify-json/carbon": "^1.1.31",
"@iconify-json/mdi": "^1.1.64",
"@alova/adapter-axios": "^1.2.6",
"@antfu/eslint-config": "^2.19.1",
"@iconify-json/carbon": "^1.1.34",
"@iconify-json/mdi": "^1.1.66",
"@iconify-json/streamline-emojis": "^1.1.8",
"@ileostar/eslint-config": "^0.3.0",
"@types/node": "^20.11.30",
"@typescript-eslint/eslint-plugin": "^7.3.1",
"@typescript-eslint/parser": "^7.3.1",
"@unocss/eslint-config": "^0.58.6",
"@unocss/eslint-plugin": "^0.58.6",
"@unocss/preset-icons": "^0.58.6",
"@types/node": "^20.12.13",
"@typescript-eslint/eslint-plugin": "^7.11.0",
"@typescript-eslint/parser": "^7.11.0",
"@unocss/eslint-config": "^0.60.3",
"@unocss/eslint-plugin": "^0.60.3",
"@unocss/preset-icons": "^0.60.3",
"@vitejs/plugin-vue": "^5.0.4",
"@vue-macros/volar": "^0.18.13",
"@vue/test-utils": "^2.4.5",
"@vue-macros/volar": "^0.21.1",
"@vue/test-utils": "^2.4.6",
"commitizen": "^4.3.0",
"cz-emoji": "1.3.2-canary.2",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"eslint": "^9.3.0",
"eslint-define-config": "^2.1.0",
"eslint-plugin-format": "^0.1.1",
"husky": "^9.0.11",
"jsdom": "^24.0.0",
"jsdom": "^24.1.0",
"lint": "^0.8.19",
"lint-staged": "^15.2.2",
"lint-staged": "^15.2.5",
"onu-ui": "1.0.14-beta.2",
"pinia": "^2.1.7",
"pinia-auto-refs": "^0.0.10",
"pinia-plugin-persistedstate": "^3.2.1",
"postcss-html": "^1.6.0",
"stylelint": "^16.2.1",
"postcss-html": "^1.7.0",
"stylelint": "^16.6.1",
"stylelint-config-standard-vue": "^1.0.0",
"stylelint-order": "^6.0.4",
"taze": "^0.13.3",
"typescript": "^5.4.3",
"unocss": "^0.58.6",
"unplugin-auto-import": "^0.17.5",
"unplugin-icons": "^0.18.5",
"unplugin-vue-components": "^0.26.0",
"unplugin-vue-macros": "^2.7.11",
"unplugin-vue-router": "^0.8.5",
"vite": "^5.2.2",
"taze": "^0.13.8",
"typescript": "^5.4.5",
"unocss": "^0.60.3",
"unplugin-auto-import": "^0.17.6",
"unplugin-icons": "^0.19.0",
"unplugin-vue-components": "^0.27.0",
"unplugin-vue-macros": "^2.9.3",
"unplugin-vue-router": "^0.9.0",
"vite": "^5.2.12",
"vite-plugin-restart": "^0.4.0",
"vite-plugin-vue-devtools": "1.0.0-rc.5",
"vitest": "^1.4.0",
"vue-tsc": "^2.0.7"
"vitest": "^1.6.0",
"vue-tsc": "^2.0.19"
},
"lint-staged": {
"src/**/*.{js,vue,ts}": [
Expand Down
Loading

0 comments on commit 49774fc

Please sign in to comment.