Skip to content

Commit d398be4

Browse files
committed
init: Initial commit
0 parents  commit d398be4

38 files changed

+7956
-0
lines changed

.commitlintrc.js

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
module.exports = {
2+
extends: ["@commitlint/config-conventional"],
3+
rules: {
4+
"type-enum": [
5+
2,
6+
"always",
7+
[
8+
"init",
9+
"build",
10+
"ci",
11+
"chore",
12+
"docs",
13+
"feat",
14+
"fix",
15+
"perf",
16+
"refactor",
17+
"revert",
18+
"style",
19+
"test",
20+
],
21+
],
22+
},
23+
};
24+
/**
25+
* build : 改变了build工具 如 webpack
26+
* ci : 持续集成新增
27+
* chore : 构建过程或辅助工具的变动
28+
* feat : 新功能
29+
* docs : 文档改变
30+
* fix : 修复bug
31+
* perf : 性能优化
32+
* refactor : 某个已有功能重构
33+
* revert : 撤销上一次的 commit
34+
* style : 代码格式改变
35+
* test : 增加测试
36+
*/

.eslintignore

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
dist
3+
.vscode

.eslintrc.js

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true,
6+
es2021: true,
7+
},
8+
parser: "vue-eslint-parser",
9+
extends: [
10+
"eslint:recommended",
11+
"plugin:vue/vue3-recommended",
12+
"plugin:@typescript-eslint/recommended",
13+
"plugin:prettier/recommended",
14+
// eslint-config-prettier 的缩写
15+
"prettier",
16+
],
17+
parserOptions: {
18+
ecmaVersion: 12,
19+
parser: "@typescript-eslint/parser",
20+
sourceType: "module",
21+
ecmaFeatures: {
22+
jsx: true,
23+
},
24+
},
25+
// eslint-plugin-vue @typescript-eslint/eslint-plugin eslint-plugin-prettier的缩写
26+
plugins: ["vue", "@typescript-eslint", "prettier"],
27+
rules: {
28+
"@typescript-eslint/ban-ts-ignore": "off",
29+
"@typescript-eslint/no-unused-vars": "off",
30+
"@typescript-eslint/explicit-function-return-type": "off",
31+
"@typescript-eslint/no-explicit-any": "off",
32+
"@typescript-eslint/no-var-requires": "off",
33+
"@typescript-eslint/no-empty-function": "off",
34+
"@typescript-eslint/no-use-before-define": "off",
35+
"@typescript-eslint/ban-ts-comment": "off",
36+
"@typescript-eslint/ban-types": "off",
37+
"@typescript-eslint/no-non-null-assertion": "off",
38+
"@typescript-eslint/explicit-module-boundary-types": "off",
39+
"vue/multi-word-component-names": 0,
40+
"no-var": "error",
41+
"prettier/prettier": "error",
42+
// 禁止出现console
43+
"no-console": "warn",
44+
// 禁用debugger
45+
"no-debugger": "warn",
46+
// 禁止出现重复的 case 标签
47+
"no-duplicate-case": "warn",
48+
// 禁止出现空语句块
49+
"no-empty": "warn",
50+
// 禁止不必要的括号
51+
"no-extra-parens": "off",
52+
// 禁止对 function 声明重新赋值
53+
"no-func-assign": "warn",
54+
// 禁止在 return、throw、continue 和 break 语句之后出现不可达代码
55+
"no-unreachable": "warn",
56+
// 强制所有控制语句使用一致的括号风格
57+
curly: "warn",
58+
// 要求 switch 语句中有 default 分支
59+
"default-case": "warn",
60+
// 强制尽可能地使用点号
61+
"dot-notation": "warn",
62+
// 要求使用 === 和 !==
63+
eqeqeq: "warn",
64+
// 禁止 if 语句中 return 语句之后有 else 块
65+
"no-else-return": "warn",
66+
// 禁止出现空函数
67+
"no-empty-function": "warn",
68+
// 禁用不必要的嵌套块
69+
"no-lone-blocks": "warn",
70+
// 禁止使用多个空格
71+
"no-multi-spaces": "warn",
72+
// 禁止多次声明同一变量
73+
"no-redeclare": "warn",
74+
// 禁止在 return 语句中使用赋值语句
75+
"no-return-assign": "warn",
76+
// 禁用不必要的 return await
77+
"no-return-await": "warn",
78+
// 禁止自我赋值
79+
"no-self-assign": "warn",
80+
// 禁止自身比较
81+
"no-self-compare": "warn",
82+
// 禁止不必要的 catch 子句
83+
"no-useless-catch": "warn",
84+
// 禁止多余的 return 语句
85+
"no-useless-return": "warn",
86+
// 禁止变量声明与外层作用域的变量同名
87+
"no-shadow": "off",
88+
// 允许delete变量
89+
"no-delete-var": "off",
90+
// 强制数组方括号中使用一致的空格
91+
"array-bracket-spacing": "warn",
92+
// 强制在代码块中使用一致的大括号风格
93+
"brace-style": "warn",
94+
// 强制使用骆驼拼写法命名约定
95+
// camelcase: 'warn',
96+
// 强制使用一致的缩进
97+
indent: "off",
98+
// 强制在 JSX 属性中一致地使用双引号或单引号
99+
// 'jsx-quotes': 'warn',
100+
// 强制可嵌套的块的最大深度4
101+
// 'max-depth': 'warn',
102+
// 强制最大行数 300
103+
// "max-lines": ["warn", { "max": 1200 }],
104+
// 强制函数最大代码行数 50
105+
// 'max-lines-per-function': ['warn', { max: 70 }],
106+
// 强制函数块最多允许的的语句数量20
107+
"max-statements": ["warn", 100],
108+
// 强制回调函数最大嵌套深度
109+
"max-nested-callbacks": ["warn", 3],
110+
// 强制函数定义中最多允许的参数数量
111+
"max-params": ["warn", 3],
112+
// 强制每一行中所允许的最大语句数量
113+
"max-statements-per-line": ["warn", { max: 1 }],
114+
// 要求方法链中每个调用都有一个换行符
115+
"newline-per-chained-call": ["warn", { ignoreChainWithDepth: 3 }],
116+
// 禁止 if 作为唯一的语句出现在 else 语句中
117+
"no-lonely-if": "warn",
118+
// 禁止空格和 tab 的混合缩进
119+
"no-mixed-spaces-and-tabs": "warn",
120+
// 禁止出现多行空行
121+
"no-multiple-empty-lines": "warn",
122+
// 强制使用分号;
123+
semi: ["warn", "always"],
124+
// 强制使用双引号
125+
singleQuote: [0],
126+
// 强制在块之前使用一致的空格
127+
"space-before-blocks": "warn",
128+
// 强制在 function的左括号之前使用一致的空格
129+
// 'space-before-function-paren': ['warn', 'never'],
130+
// 强制在圆括号内使用一致的空格
131+
"space-in-parens": "warn",
132+
// 要求操作符周围有空格
133+
"space-infix-ops": "warn",
134+
// 强制在一元操作符前后使用一致的空格
135+
"space-unary-ops": "warn",
136+
// 强制在注释中 // 或 /* 使用一致的空格
137+
// "spaced-comment": "warn",
138+
// 强制在 switch 的冒号左右有空格
139+
"switch-colon-spacing": "warn",
140+
// 强制箭头函数的箭头前后使用一致的空格
141+
"arrow-spacing": "warn",
142+
"prefer-const": "warn",
143+
"prefer-rest-params": "warn",
144+
"no-useless-escape": "warn",
145+
"no-irregular-whitespace": "warn",
146+
"no-prototype-builtins": "warn",
147+
"no-fallthrough": "warn",
148+
"no-extra-boolean-cast": "warn",
149+
"no-case-declarations": "warn",
150+
"no-async-promise-executor": "warn",
151+
},
152+
globals: {
153+
defineProps: "readonly",
154+
defineEmits: "readonly",
155+
defineExpose: "readonly",
156+
withDefaults: "readonly",
157+
},
158+
};

.github/FUNDING.yml

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
github: kirklin

.github/ISSUE_TEMPLATE/general.md

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: General
3+
about: General issue
4+
title: ""
5+
labels: ""
6+
assignees: ""
7+
---
8+
9+
PLEASE READ: I originally made this template for myself to mocking up apps quicker. I am glad to see you are willing to give it a try! Before your open the issue, please make sure you are reporting bugs in the template itself. **I am NOT creating this template to solve the problems you faced in your project, please use Vue or Vite's discord server to ask questions.** Thank you.
10+
11+
**Describe the bug/issue**

.gitignore

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dist
12+
dist-ssr
13+
*.local
14+
15+
# Editor directories and files
16+
.vscode/*
17+
!.vscode/extensions.json
18+
.idea
19+
.DS_Store
20+
*.suo
21+
*.ntvs*
22+
*.njsproj
23+
*.sln
24+
*.sw?

.husky/.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
_

.husky/pre-commit

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
pnpx lint-staged
5+
npx lint-staged

.prettierignore

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# 忽略格式化文件 (根据项目需要自行添加)
2+
3+
/node_modules
4+
package-lock.json
5+
6+
/dist
7+
/types
8+
9+
**/*.svg
10+
**/*.sh
11+
12+
13+
# eslint
14+
.eslintcache
15+
16+
/docs

.prettierrc.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
module.exports = {
2+
tabWidth: 2,
3+
printWidth: 100,
4+
//使用双引号
5+
singleQuote: false,
6+
//句末加分号
7+
semi: true,
8+
bracketSpacing: true,
9+
overrides: [
10+
{
11+
files: "*.json",
12+
options: {
13+
printWidth: 200,
14+
},
15+
},
16+
],
17+
arrowParens: "always",
18+
plugins: [require("prettier-plugin-tailwindcss")],
19+
};

.vscode/extensions.json

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
{
2+
"recommendations": ["johnsoncodehk.volar", "dbaeumer.vscode-eslint"]
3+
}

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2022 Kirk Lin
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.assets/vite-vue-tailwind.png

40.1 KB
Loading

README.md

+77
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
<div align='center'>
2+
<h1>Vite-Boot </h1>
3+
<img src='README.assets/vite-vue-tailwind.png' alt='Vitesse - Opinionated Vite Starter Template' width='600'/>
4+
</div>
5+
6+
<p align='center'>
7+
Mocking up web app with <b>Vite-Boot </b><sup><em>(speed)</em></sup><br>
8+
</p>
9+
10+
<div align='center'>
11+
<b>English</b> | <a href="README.zh-CN.md">简体中文</a>
12+
</div>
13+
14+
15+
## Features
16+
17+
- ⚡️ [Vue 3](https://github.com/vuejs/vue-next), [Vite 2](https://github.com/vitejs/vite), [pnpm](https://pnpm.js.org/) - born with fastness
18+
- 💪 [Typescript](https://www.typescriptlang.org/) - of course! necessary
19+
- 🔥 Use the [new `<script setup>` syntax](https://github.com/vuejs/rfcs/pull/227)
20+
- 💡 [Vue Router v4](https://router.vuejs.org/zh/) - The official router for Vue.js
21+
- 🎨 [Tailwind CSS v3](https://tailwindcss.com/docs/configuration) - Rapidly build modern websites without ever leaving your HTML.
22+
- 🎉 [NProgress](https://github.com/rstacruz/nprogress) - Page loading progress feedback
23+
- 🍍 [State Management via Pinia](https://pinia.esm.dev/) - The Vue Store that you will enjoy using
24+
25+
26+
### First-party plugins needed for Tailwind UI:
27+
28+
- [tailwindcss/forms](https://github.com/tailwindlabs/tailwindcss-forms)
29+
- [tailwindcss/typography](https://tailwindcss.com/docs/typography-plugin)
30+
- [tailwindcss/line-clamp](https://github.com/tailwindlabs/tailwindcss-line-clamp)
31+
- [tailwindcss/aspect-ratio](https://github.com/tailwindlabs/tailwindcss-aspect-ratio)
32+
33+
### Coding Style
34+
35+
- [Eslint](https://eslint.org/docs/user-guide/getting-started)
36+
- [Prettier](https://prettier.io/docs/en/install.html)
37+
- [prettier-plugin-tailwindcss](https://tailwindcss.com/blog/automatic-class-sorting-with-prettier) - Automatic Class Sorting with Prettier
38+
39+
### Recommended IDE Setup
40+
41+
- [VSCode](https://code.visualstudio.com/)
42+
- [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)
43+
44+
45+
## Try it now!
46+
47+
### GitHub Template
48+
49+
[Create a repo from this template on GitHub](https://github.com/kirklin/vite-boot/generate).
50+
51+
### Clone to local
52+
53+
```bash
54+
git clone https://github.com/kirklin/vite-boot.git my-vite-app
55+
cd my-vite-app
56+
pnpm i
57+
```
58+
59+
## Usage
60+
61+
### Development
62+
63+
Just run and visit http://localhost:8888
64+
65+
```bash
66+
pnpm run dev
67+
```
68+
69+
### Build
70+
71+
To build the App, run
72+
73+
```bash
74+
pnpm run build
75+
```
76+
77+
And you will see the generated file in `dist` that ready to be served.

0 commit comments

Comments
 (0)