Skip to content

Commit d2946b2

Browse files
committed
first commit
0 parents  commit d2946b2

File tree

108 files changed

+10422
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

108 files changed

+10422
-0
lines changed

.cz-config.js

+92
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
module.exports = {
2+
// type 类型(定义之后,可通过上下键选择)
3+
types: [
4+
{ value: 'feat', name: 'feat: 新增功能' },
5+
{ value: 'fix', name: 'fix: 修复 bug' },
6+
{ value: 'docs', name: 'docs: 文档变更' },
7+
{
8+
value: 'style',
9+
name: 'style: 代码格式(不影响功能,例如空格、分号等格式修正)'
10+
},
11+
{
12+
value: 'refactor',
13+
name: 'refactor: 代码重构(不包括 bug 修复、功能新增)'
14+
},
15+
{ value: 'perf', name: 'perf: 性能优化' },
16+
{ value: 'test', name: 'test: 添加、修改测试用例' },
17+
{
18+
value: 'build',
19+
name:
20+
'build: 构建流程、外部依赖变更(如升级 npm 包、修改 webpack 配置等)'
21+
},
22+
{ value: 'ci', name: 'ci: 修改 CI 配置、脚本' },
23+
{
24+
value: 'chore',
25+
name: 'chore: 对构建过程或辅助工具和库的更改(不影响源文件、测试用例)'
26+
},
27+
{ value: 'revert', name: 'revert: 回滚 commit' }
28+
],
29+
30+
// scope 类型(定义之后,可通过上下键选择)
31+
scopes: [
32+
['components', '组件相关'],
33+
['hooks', 'hook 相关'],
34+
['utils', 'utils 相关'],
35+
['element-ui', '对 element-ui 的调整'],
36+
['styles', '样式相关'],
37+
['deps', '项目依赖'],
38+
['auth', '对 auth 修改'],
39+
['other', '其他修改'],
40+
// 如果选择 custom,后面会让你再输入一个自定义的 scope。也可以不设置此项,把后面的 allowCustomScopes 设置为 true
41+
['custom', '以上都不是?我要自定义']
42+
].map(([value, description]) => {
43+
return {
44+
value,
45+
name: `${value.padEnd(30)} (${description})`
46+
}
47+
}),
48+
49+
// 是否允许自定义填写 scope,在 scope 选择的时候,会有 empty 和 custom 可以选择。
50+
// allowCustomScopes: true,
51+
52+
// allowTicketNumber: false,
53+
// isTicketNumberRequired: false,
54+
// ticketNumberPrefix: 'TICKET-',
55+
// ticketNumberRegExp: '\\d{1,5}',
56+
57+
// 针对每一个 type 去定义对应的 scopes,例如 fix
58+
/*
59+
scopeOverrides: {
60+
fix: [
61+
{ name: 'merge' },
62+
{ name: 'style' },
63+
{ name: 'e2eTest' },
64+
{ name: 'unitTest' }
65+
]
66+
},
67+
*/
68+
69+
// 交互提示信息
70+
messages: {
71+
type: '确保本次提交遵循 Angular 规范!\n选择你要提交的类型:',
72+
scope: '\n选择一个 scope(可选):',
73+
// 选择 scope: custom 时会出下面的提示
74+
customScope: '请输入自定义的 scope:',
75+
subject: '填写简短精炼的变更描述:\n',
76+
body: '填写更加详细的变更描述(可选)。使用 "|" 换行:\n',
77+
breaking: '列举非兼容性重大的变更(可选):\n',
78+
footer: '列举出所有变更的 ISSUES CLOSED(可选)。 例如: #31, #34:\n',
79+
confirmCommit: '确认提交?'
80+
},
81+
82+
// 设置只有 type 选择了 feat 或 fix,才询问 breaking message
83+
allowBreakingChanges: ['feat', 'fix'],
84+
85+
// 跳过要询问的步骤
86+
// skipQuestions: ['body', 'footer'],
87+
88+
subjectLimit: 100, // subject 限制长度
89+
breaklineChar: '|' // 换行符,支持 body 和 footer
90+
// footerPrefix : 'ISSUES CLOSED:'
91+
// askForBreakingChangeFirst : true,
92+
}

.editorconfig

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Editor configuration, see http://editorconfig.org
2+
3+
# 表示最顶层的 EditorConfig 配置文件
4+
root = true
5+
6+
[*] # 表示所有文件适用
7+
charset = utf-8 # 设置文件字符集为 utf-8
8+
indent_style = space # 缩进风格(tab | space)
9+
indent_size = 2 # 缩进大小
10+
end_of_line = lf # 控制换行类型(lf | cr | crlf)
11+
trim_trailing_whitespace = true # 去除行首的任意空白字符
12+
insert_final_newline = true # 始终在文件末尾插入一个新行
13+
14+
[*.md] # 表示仅 md 文件适用以下规则
15+
max_line_length = off
16+
trim_trailing_whitespace = false

.env.development

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# 只在开发模式中被载入
2+
3+
# 网站前缀
4+
VITE_BASE_URL = /
5+
6+
# 是否删除console
7+
VITE_DROP_CONSOLE = true
8+
9+
# API
10+
VITE_APP_API_URL = http://29135jo738.zicp.vip/api/v1

.env.production

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
# 只在生产模式中被载入
2+
3+
# 网站前缀
4+
VITE_BASE_URL = /test
5+
6+
# 是否删除console
7+
VITE_DROP_CONSOLE = true
8+
9+
# API
10+
VITE_APP_API_URL = http://29135jo738.zicp.vip/api/v1

.eslintignore

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
2+
*.sh
3+
node_modules
4+
*.md
5+
*.woff
6+
*.ttf
7+
.vscode
8+
.idea
9+
dist
10+
/public
11+
/docs
12+
.husky
13+
.local
14+
/bin
15+
Dockerfile

.eslintrc.js

+60
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
module.exports = {
2+
root: true,
3+
env: {
4+
browser: true,
5+
node: true,
6+
es6: true
7+
},
8+
parser: 'vue-eslint-parser',
9+
parserOptions: {
10+
parser: '@typescript-eslint/parser',
11+
ecmaVersion: 2020,
12+
sourceType: 'module',
13+
jsxPragma: 'React',
14+
ecmaFeatures: {
15+
jsx: true
16+
}
17+
},
18+
extends: [
19+
'plugin:vue/vue3-recommended',
20+
'plugin:@typescript-eslint/recommended',
21+
'prettier',
22+
'plugin:prettier/recommended'
23+
],
24+
rules: {
25+
'vue/require-default-prop': 'off',
26+
27+
'@typescript-eslint/ban-ts-comment': 'off',
28+
'@typescript-eslint/no-explicit-any': 'off',
29+
'@typescript-eslint/ban-types': 'off',
30+
'@typescript-eslint/no-non-null-assertion': 'off',
31+
'@typescript-eslint/explicit-module-boundary-types': 'off',
32+
'@typescript-eslint/no-unused-vars': [
33+
'error',
34+
{
35+
argsIgnorePattern: '^_',
36+
varsIgnorePattern: '^_'
37+
}
38+
],
39+
'no-unused-vars': [
40+
'error',
41+
{
42+
argsIgnorePattern: '^_',
43+
varsIgnorePattern: '^_'
44+
}
45+
],
46+
'vue/html-self-closing': [
47+
'error',
48+
{
49+
html: {
50+
void: 'always',
51+
normal: 'never',
52+
component: 'always'
53+
},
54+
svg: 'always',
55+
math: 'always'
56+
}
57+
]
58+
},
59+
settings: {}
60+
}

.github/workflows/deploy.yml

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
deploy:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v2
12+
13+
- name: Setup Node.js v14.x
14+
uses: actions/setup-node@v1
15+
with:
16+
node-version: "14.x"
17+
18+
- name: Install
19+
run: npm install
20+
21+
- name: Build
22+
run: npm run build
23+
24+
- name: Deploy
25+
uses: peaceiris/actions-gh-pages@v3
26+
with:
27+
publish_dir: ./dist
28+
personal_token: ${{ secrets.PERSONAL_TOKEN }}
29+
commit_message: Update ghPages

.gitignore

+47
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# See http://help.github.com/ignore-files/ for more about ignoring files.
2+
3+
# compiled output
4+
/dist
5+
/dist-ssr
6+
/tmp
7+
/out-tsc
8+
9+
# dependencies
10+
/node_modules
11+
*.local
12+
# yarn.lock
13+
# package-lock.json
14+
15+
# IDEs and editors
16+
/.idea
17+
.project
18+
.classpath
19+
.c9/
20+
*.launch
21+
.settings/
22+
*.sublime-workspace
23+
24+
# IDE - VSCode
25+
.vscode/*
26+
# !.vscode/settings.json
27+
# !.vscode/tasks.json
28+
# !.vscode/launch.json
29+
# !.vscode/extensions.json
30+
31+
# misc
32+
/.sass-cache
33+
/connect.lock
34+
/coverage
35+
/libpeerconnection.log
36+
npm-debug.log
37+
testem.log
38+
/typings
39+
40+
# e2e
41+
/e2e/src/*.js
42+
/e2e/src/*.map
43+
/cypress/screenshots
44+
45+
# System Files
46+
.DS_Store
47+
Thumbs.db

.husky/.gitignore

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

.husky/commit-msg

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npx --no-install commitlint --edit

.husky/pre-commit

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

.husky/pre-push

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
#!/bin/sh
2+
. "$(dirname "$0")/_/husky.sh"
3+
4+
npm run test
5+
6+
7+
8+
9+

.prettierignore

+9
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
/dist/*
2+
.local
3+
.output.js
4+
/node_modules/**
5+
6+
**/*.svg
7+
**/*.sh
8+
9+
/public/*

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2021 buqiyuan
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.md

+41
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# Vite2.x + Vue3.x + TypeScript H5低代码平台
2+
3+
## 技术栈
4+
5+
- 编程语言:[TypeScript 4.x](https://www.typescriptlang.org/zh/) + [JavaScript](https://www.javascript.com/)
6+
- 构建工具:[Vite 2.x](https://cn.vitejs.dev/)
7+
- 前端框架:[Vue 3.x](https://v3.cn.vuejs.org/)
8+
- 路由工具:[Vue Router 4.x](https://next.router.vuejs.org/zh/index.html)
9+
- 状态管理:[Vuex 4.x](https://next.vuex.vuejs.org/)
10+
- PC端UI 框架:[Element Plus](https://element-plus.org/#/zh-CN)
11+
- H5端UI 框架:[vant](https://vant-contrib.gitee.io/vant/v3/#/zh-CN/)
12+
- CSS 预编译:[Stylus](https://stylus-lang.com/) / [Sass](https://sass.bootcss.com/documentation) / [Less](http://lesscss.cn/)
13+
- HTTP 工具:[Axios](https://axios-http.com/)
14+
- Git Hook 工具:[husky](https://typicode.github.io/husky/#/) + [lint-staged](https://github.com/okonet/lint-staged)
15+
- 代码规范:[EditorConfig](http://editorconfig.org) + [Prettier](https://prettier.io/) + [ESLint](https://eslint.org/) + [Airbnb JavaScript Style Guide](https://github.com/airbnb/javascript#translation)
16+
- 提交规范:[Commitizen](http://commitizen.github.io/cz-cli/) + [Commitlint](https://commitlint.js.org/#/)
17+
- 单元测试:[vue-test-utils](https://next.vue-test-utils.vuejs.org/) + [jest](https://jestjs.io/) + [vue-jest](https://github.com/vuejs/vue-jest) + [ts-jest](https://kulshekhar.github.io/ts-jest/)
18+
- 自动部署:[GitHub Actions](https://docs.github.com/cn/actions/learn-github-actions)
19+
20+
## 快速开始
21+
22+
### 安装依赖
23+
24+
```sh
25+
npm install
26+
# or
27+
yarn add
28+
```
29+
30+
### 启动项目
31+
32+
```sh
33+
npm run dev
34+
```
35+
36+
### 项目打包
37+
38+
```sh
39+
npm run build
40+
```
41+

commitlint.config.js

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
module.exports = { extends: ['@commitlint/config-conventional'] }

index.html

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8" />
5+
<link rel="icon" href="/favicon.ico" />
6+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
7+
<title>Vite App</title>
8+
</head>
9+
<body>
10+
<div id="app"></div>
11+
<script type="module" src="/src/main.ts"></script>
12+
</body>
13+
</html>

0 commit comments

Comments
 (0)