-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 2552baf
Showing
31 changed files
with
8,580 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
indent_style = space | ||
indent_size = 2 | ||
end_of_line = lf | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
{ | ||
"extends": "@antfu", | ||
"rules": { | ||
"no-console": "off" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
.DS_Store | ||
.vite-ssg-dist | ||
.vite-ssg-temp | ||
*.local | ||
dist | ||
dist-ssr | ||
node_modules | ||
.idea/ | ||
*.log | ||
cypress/downloads |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
shamefully-hoist=true | ||
strict-peer-dependencies=false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
{ | ||
"cSpell.words": [ | ||
"antfu", | ||
"demi", | ||
"iconify", | ||
"intlify", | ||
"pinia", | ||
"pnpm", | ||
"unocss", | ||
"unplugin", | ||
"Vite", | ||
"vitejs", | ||
"Vitesse", | ||
"vitest", | ||
"vueuse", | ||
"yahei" | ||
], | ||
"prettier.enable": false, | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.eslint": true | ||
}, | ||
"files.associations": { | ||
"*.css": "css" | ||
}, | ||
"editor.formatOnSave": false | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
MIT License | ||
|
||
Copyright (c) 2020-2021 Soya | ||
|
||
Permission is hereby granted, free of charge, to any person obtaining a copy | ||
of this software and associated documentation files (the "Software"), to deal | ||
in the Software without restriction, including without limitation the rights | ||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | ||
copies of the Software, and to permit persons to whom the Software is | ||
furnished to do so, subject to the following conditions: | ||
|
||
The above copyright notice and this permission notice shall be included in all | ||
copies or substantial portions of the Software. | ||
|
||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR | ||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE | ||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE | ||
SOFTWARE. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,141 @@ | ||
<p align='center'> | ||
<img src='https://user-images.githubusercontent.com/11247099/154486817-f86b8f20-5463-4122-b6e9-930622e757f2.png' alt='Vitesse - Opinionated Vite Starter Template' width='600'/> | ||
</p> | ||
|
||
<p align='center'> | ||
基于<sup><em>Vitesse</em></sup> 创建的 Web 应用 | ||
<br> | ||
</p> | ||
|
||
<br> | ||
<br> | ||
|
||
<br> | ||
|
||
## 特性 | ||
|
||
- ⚡️ [Vue 3](https://github.com/vuejs/core), [Vite](https://github.com/vitejs/vite), [pnpm](https://pnpm.io/), [esbuild](https://github.com/evanw/esbuild) - 就是快! | ||
|
||
- 🗂 [基于文件的路由](./src/pages) | ||
|
||
- 📦 [组件自动化加载](./src/components) | ||
|
||
- 🍍 [使用 Pinia 的状态管理](https://pinia.vuejs.org) | ||
|
||
- 📑 [布局系统](./src/layouts) | ||
|
||
- 🎨 [UnoCSS](https://github.com/unocss/unocss) - 高性能且极具灵活性的即时原子化 CSS 引擎 | ||
|
||
- 😃 [各种图标集为你所用](https://github.com/antfu/unocss/tree/main/packages/preset-icons) | ||
|
||
- 🗒 [Markdown 支持](https://github.com/antfu/vite-plugin-vue-markdown) | ||
|
||
- 🔥 使用 [新的 `<script setup>` 语法](https://github.com/vuejs/rfcs/pull/227) | ||
|
||
- 🤙🏻 默认开启 [响应性语法糖](https://vuejs.org/guide/extras/reactivity-transform.html) | ||
|
||
- 📥 [API 自动加载](https://github.com/antfu/unplugin-auto-import) - 直接使用 Composition API 无需引入 | ||
|
||
- 🖨 使用 [vite-ssg](https://github.com/antfu/vite-ssg) 进行服务端生成 (SSG) | ||
|
||
- 🦔 使用 [critters](https://github.com/GoogleChromeLabs/critters) 的生成关键 CSS | ||
|
||
- 🦾 TypeScript, 当然 | ||
|
||
- ☁️ [Axios]() - 用于 API 请求 | ||
|
||
- 🎨 [Arco Design](https://arco.design/) - 一套开箱即用的中后台前端解决方案UI组件库s | ||
|
||
- 📦 [Dayjs](https://day.js.org/) - 一个轻量的处理时间和日期的 JavaScript 库 | ||
|
||
|
||
<br> | ||
|
||
## 预配置 | ||
|
||
### UI 框架 | ||
|
||
- [UnoCSS](https://github.com/antfu/unocss) - 高性能且极具灵活性的即时原子化 CSS 引擎 | ||
|
||
### Icons | ||
|
||
- [Iconify](https://iconify.design) - 使用任意的图标集,浏览:[🔍Icônes](https://icones.netlify.app/) | ||
- [UnoCSS 的纯 CSS 图标方案](https://github.com/antfu/unocss/tree/main/packages/preset-icons) | ||
|
||
### 插件 | ||
|
||
- [Vue Router](https://github.com/vuejs/router) | ||
- [`vite-plugin-pages`](https://github.com/hannoeru/vite-plugin-pages) - 以文件系统为基础的路由 | ||
- [`vite-plugin-vue-layouts`](https://github.com/JohnCampionJr/vite-plugin-vue-layouts) - 页面布局系统 | ||
- [Pinia](https://pinia.vuejs.org) - 直接的, 类型安全的, 使用 Composition API 的轻便灵活的 Vue 状态管理 | ||
- [`unplugin-vue-components`](https://github.com/antfu/unplugin-vue-components) - 自动加载组件 | ||
- [`unplugin-auto-import`](https://github.com/antfu/unplugin-auto-import) - 直接使用 Composition API 等,无需导入 | ||
- [VueUse](https://github.com/antfu/vueuse) - 实用的 Composition API 工具合集 | ||
- [`vite-plugin-vue-inspector`](https://github.com/webfansplz/vite-plugin-vue-inspector) - 点击页面元素自动跳转到本地IDE对应的 Vue 组件 | ||
|
||
### 编码风格 | ||
|
||
- 使用 Composition API 地 [`<script setup>` SFC 语法](https://github.com/vuejs/rfcs/pull/227) | ||
- [ESLint](https://eslint.org/) 配置为 [@antfu/eslint-config](https://github.com/antfu/eslint-config), 单引号, 无分号. | ||
|
||
### 开发工具 | ||
- [TypeScript](https://www.typescriptlang.org/) | ||
- [Vitest](https://github.com/vitest-dev/vitest) - 基于 Vite 的单元测试框架 | ||
- [Cypress](https://cypress.io/) - E2E 测试 | ||
- [pnpm](https://pnpm.js.org/) - 快, 节省磁盘空间的包管理器 | ||
- [VS Code 扩展](./.vscode/extensions.json) | ||
- [Vite](https://marketplace.visualstudio.com/items?itemName=antfu.vite) - 自动启动 Vite 服务器 | ||
- [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) - Vue 3 `<script setup>` IDE 支持 | ||
- [Iconify IntelliSense](https://marketplace.visualstudio.com/items?itemName=antfu.iconify) - 图标内联显示和自动补全 | ||
- [ESLint](https://marketplace.visualstudio.com/items?itemName=dbaeumer.vscode-eslint) | ||
|
||
## 现在可以试试! | ||
|
||
> V3TS 需要 Node 版本 >=14.18 | ||
### GitHub 模板 | ||
|
||
[使用这个模板创建仓库](https://github.com/Soya-xy/v3ts). | ||
|
||
### 克隆到本地 | ||
|
||
如果您更喜欢使用更干净的 git 历史记录手动执行此操作 | ||
|
||
```bash | ||
npx degit Soya-xy/v3ts my-v3ts-app | ||
cd my-v3ts-app | ||
pnpm i # 如果你没装过 pnpm, 可以先运行: npm install -g pnpm | ||
``` | ||
|
||
## 清单 | ||
|
||
使用此模板时,请尝试按照清单正确更新您自己的信息 | ||
|
||
- [ ] 在 `LICENSE` 中改变作者名 | ||
- [ ] 在 `App.vue` 中改变标题 | ||
- [ ] 在 `vite.config.ts` 更改主机名 | ||
- [ ] 在 `public` 目录下改变favicon | ||
- [ ] 移除 `.github` 文件夹中包含资助的信息 | ||
- [ ] 整理 README 并删除路由 | ||
|
||
紧接着, 享受吧 :) | ||
|
||
## 使用 | ||
|
||
### 开发 | ||
|
||
只需要执行以下命令就可以在 http://localhost:3333 中看到 | ||
|
||
```bash | ||
pnpm dev | ||
``` | ||
|
||
### 构建 | ||
|
||
构建该应用只需要执行以下命令 | ||
|
||
```bash | ||
pnpm build | ||
``` | ||
|
||
然后你会看到用于发布的 `dist` 文件夹被生成。 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
<!DOCTYPE html> | ||
<html lang="en"> | ||
<head> | ||
<meta charset="UTF-8"> | ||
<meta name="viewport" content="width=device-width, initial-scale=1.0"> | ||
<link rel="apple-touch-icon" href="/pwa-192x192.png"> | ||
<link rel="mask-icon" href="/safari-pinned-tab.svg" color="#00aba9"> | ||
<meta name="msapplication-TileColor" content="#00aba9"> | ||
<script> | ||
(function () { | ||
const prefersDark = window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches | ||
const setting = localStorage.getItem('vueuse-color-scheme') || 'auto' | ||
if (setting === 'dark' || (prefersDark && setting !== 'light')) | ||
document.documentElement.classList.toggle('dark', true) | ||
})() | ||
</script> | ||
</head> | ||
<body class="font-sans"> | ||
<div id="app"></div> | ||
<script type="module" src="/src/main.ts"></script> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"type": "module", | ||
"private": true, | ||
"packageManager": "pnpm@7.17.1", | ||
"scripts": { | ||
"build": "vite build", | ||
"dev": "vite --port 3333", | ||
"lint": "eslint .", | ||
"preview": "vite preview", | ||
"preview-https": "serve dist", | ||
"test": "vitest", | ||
"test:unit": "vitest", | ||
"typecheck": "vue-tsc --noEmit", | ||
"up": "taze major -I" | ||
}, | ||
"dependencies": { | ||
"@unocss/reset": "^0.49.4", | ||
"@vueuse/core": "^9.12.0", | ||
"autoprefixer": "^10.4.13", | ||
"axios": "^1.3.2", | ||
"dayjs": "^1.11.7", | ||
"less": "^4.1.3", | ||
"nprogress": "^0.2.0", | ||
"pinia": "^2.0.30", | ||
"vue": "^3.2.47", | ||
"vue-router": "^4.1.6" | ||
}, | ||
"devDependencies": { | ||
"@antfu/eslint-config": "^0.35.1", | ||
"@arco-design/web-vue": "^2.42.1", | ||
"@iconify-json/carbon": "^1.1.14", | ||
"@types/nprogress": "^0.2.0", | ||
"@vitejs/plugin-vue": "^4.0.0", | ||
"@vue-macros/volar": "^0.8.0", | ||
"cross-env": "^7.0.3", | ||
"eslint": "^8.33.0", | ||
"taze": "^0.8.5", | ||
"typescript": "^4.9.5", | ||
"unocss": "^0.49.4", | ||
"unplugin-auto-import": "^0.13.0", | ||
"unplugin-vue-components": "^0.23.0", | ||
"unplugin-vue-macros": "^1.7.2", | ||
"vite": "^4.1.1", | ||
"vite-plugin-pages": "^0.28.0", | ||
"vite-plugin-vue-inspector": "^3.3.0", | ||
"vite-plugin-vue-layouts": "^0.7.0", | ||
"vitest": "^0.28.4", | ||
"vue-tsc": "^1.0.24" | ||
} | ||
} |
Oops, something went wrong.