Skip to content

Commit

Permalink
🎉 init(project): init project
Browse files Browse the repository at this point in the history
  • Loading branch information
ishareme committed Jan 4, 2023
0 parents commit 28cce27
Show file tree
Hide file tree
Showing 28 changed files with 11,163 additions and 0 deletions.
37 changes: 37 additions & 0 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
module.exports = {
// 可选类型
types: [
{ value: ':sparkles: feat', name: '✨ feat: 新功能' },
{ value: ':bug: fix', name: '🐛 fix: 修复' },
{ value: ':zap: perf', name: '⚡ perf: 性能优化' },
{
value: ':rocket: chore',
name: '🚀 chore: 构建过程或辅助工具的变动'
},
{ value: ':tada: init', name: '🎉 init: 初始化' },
{ value: ':memo: docs', name: '📝 docs: 文档变更' },
{
value: ':lipstick: style',
name: '💄 style: 代码格式(不影响代码运行的变动)'
},
{
value: ':recycle: refactor',
name: '♻️ refactor: 重构(既不是增加feature,也不是修复bug)'
},
{ value: ':white_check_mark: test', name: '✅ test: 增加测试' },
{ value: ':rewind: revert', name: '⏪️ revert: 回退' },
{ value: ':package: build', name: '📦️ build: 打包' }
],
messages: {
type: '请选择提交类型:',
customScope: '请输入修改范围(可选):',
subject: '请简要描述提交(必填):',
body: '请输入详细描述(可选):',
footer: '请输入要关闭的issue(可选):',
confirmCommit: '确认使用以上信息提交?(y/n/e/h)'
},
// 跳过问题
skipQuestions: ['body', 'footer'],
// subject文字长度默认是72
subjectLimit: 72
};
5 changes: 5 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[*.{js,jsx,ts,tsx,vue,cjs}]
indent_style = space
indent_size = 4
trim_trailing_whitespace = true
insert_final_newline = true
41 changes: 41 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
module.exports = {
// 表示当前目录即为根目录,ESLint 规则将被限制到该目录下
root: true,
env: {
// 在 node 环境下启动 ESLint 检测
node: true,
browser: true
},
extends: ['eslint:recommended', 'plugin:vue/vue3-essential'],
overrides: [],
parserOptions: {
parser: '@babel/eslint-parser',
requireConfigFile: false, // <== ADD THIS
ecmaVersion: 6,
sourceType: 'module'
},
plugins: ['vue'],
// 需要修改的启用规则及其各自的错误级别
/**
* 错误级别分为三种:
* "off" 或 0 - 关闭规则
* "warn" 或 1 - 开启规则,使用警告级别的错误:warn (不会导致程序退出)
* "error" 或 2 - 开启规则,使用错误级别的错误:error (当被触发的时候,程序会退出)
*/
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'space-before-function-paren': 'off',
'vue/multi-word-component-names': 'off',
'vue/valid-v-slot': [
'off',
{
allowModifiers: false
}
],
'comma-dangle': 'off',
semi: ['error', 'always'],
indent: ['error', 4],
quotes: 'off'
}
};
24 changes: 24 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
4 changes: 4 additions & 0 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

npx --no-install commitlint --edit "$1"
4 changes: 4 additions & 0 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"
# 代码 自动配合eslint修复
npx lint-staged
5 changes: 5 additions & 0 deletions .prettierrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"semi": true,
"singleQuote": true,
"trailingComma": "none"
}
3 changes: 3 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
}
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Vue3 前台+中台通用开发解决方案
32 changes: 32 additions & 0 deletions commitlint.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
module.exports = {
// 继承的规则
extends: ['git-commit-emoji', 'cz']
// 定义规则类型
// 定义规则类型
// rules: {
// // type 类型定义,表示 git 提交的 type 必须在以下类型范围内
// // 'type-enum': [
// // // 当前验证的错误级别
// // 2,
// // // 在什么情况下进行验证
// // 'always',
// // // 泛型内容
// // [
// // ':sparkles: feat', // 新功能 feature
// // ':bug: fix', // 修复 bug
// // ':memo: docs', // 文档注释
// // ':lipstick: style', // 代码格式(不影响代码运行的变动)
// // ':recycle: refactor', // 重构(既不增加新功能,也不是修复bug)
// // ':zap: perf', // 性能优化
// // ':white_check_mark: test', // 增加测试
// // ':rocket: chore', // 构建过程或辅助工具的变动
// // ':rewind: revert', // 回退
// // ':package: build', // 打包
// // ':tada: init' // 打包
// // ]
// // ],
// // subject 大小写不做校验
// // 'subject-case': [0]
// // 'subject-exclamation-mark': [0]
// }
};
13 changes: 13 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!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>Vite + Vue</title>
</head>
<body>
<div id="app"></div>
<script type="module" src="/src/main.js"></script>
</body>
</html>
Loading

0 comments on commit 28cce27

Please sign in to comment.