Skip to content

Commit

Permalink
initial: initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
fatesigner committed Oct 6, 2020
0 parents commit 4039d97
Show file tree
Hide file tree
Showing 459 changed files with 48,739 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .browserslistrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
last 2 version
> 1%
not dead
24 changes: 24 additions & 0 deletions .commitlintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
const czConfig = require('./.cz-config');

const types = czConfig.types.map(x => x.value);

module.exports = {
extends: [
'@commitlint/config-conventional'
],
rules: {
'type-enum': [
2,
'always',
types
],
'subject-empty': [0],
'type-case': [0],
'type-empty': [0],
'scope-empty': [0],
'scope-case': [0],
'subject-full-stop': [0, 'never'],
'subject-case': [0, 'never'],
'header-max-length': [0, 'always', 72]
}
};
57 changes: 57 additions & 0 deletions .cz-config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
module.exports = {
allowCustomScopes: true,
allowBreakingChanges: ['feat', 'fix'],
subjectLimit: 100,
scopes: [],
messages: {},
types: [
{
value: 'feat',
name: 'A new feature.'
},
{
value: 'fix',
name: 'A bug fix.'
},
{
value: 'refactor',
name: 'A code refactoring change.'
},
{
value: 'style',
name: 'Updating the UI and style files.'
},
{
value: 'docs',
name: 'Documentation change.'
},
{
value: 'chore',
name: 'A chore change.'
},
{
value: 'impr',
name: 'Improving performance.'
},
{
value: 'assets',
name: 'Adding or updating assets.'
},
{
value: 'package',
name: 'Updating compiled files or packages.'
},
{
value: 'construction',
name: 'Work in progress.'
},
{
value: 'rewind',
name: 'Reverting changes.'
},
{
value: 'initial',
name: 'Initial commit.'
}
]
};
17 changes: 17 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# EditorConfig helps developers define and maintain consistent coding styles between different editors and IDEs
# editorconfig.org

root = true

[*]
indent_style = space
indent_size = 2

# We recommend you to keep these unchanged
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true

[*.md]
trim_trailing_whitespace = false
6 changes: 6 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# App envs
VUE_APP_KEY=antd-vue-ts
VUE_APP_NAME=antd-vue-ts
VUE_APP_TITLE=antd-vue-ts
VUE_APP_WEBHOST=https://antd-vue-ts.repo.fatesigner.com
VUE_APP_APIHOST=https://antd-vue-ts-server.repo.fatesigner.com
7 changes: 7 additions & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NODE_ENV=development
VUE_APP_MODE=development

# App envs
VUE_APP_KEY=antd-vue-ts-dev
VUE_APP_NAME=antd-vue-ts-dev
VUE_APP_TITLE=antd-vue-ts-dev
4 changes: 4 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
NODE_ENV=production
VUE_APP_MODE=development

# App envs
7 changes: 7 additions & 0 deletions .env.test
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
NODE_ENV=production
VUE_APP_MODE=test

# App envs
VUE_APP_KEY=antd-vue-ts-test
VUE_APP_NAME=antd-vue-ts-test
VUE_APP_TITLE=antd-vue-ts-test
2 changes: 2 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
dist/**/*.js
dist/**/*.ts
12 changes: 12 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
const tslint = require('@fatesigner/eslint-config/ts');
const vueJSlint = require('@fatesigner/eslint-config/vue-js');
const vueTSlint = require('@fatesigner/eslint-config/vue-ts');

module.exports = {
extends: '@fatesigner/eslint-config',
overrides: [
tslint,
vueJSlint,
vueTSlint
]
};
5 changes: 5 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Auto detect text files and perform LF normalization
* text=auto

# exclude some files when merge
/vue.config.js merge=ours
78 changes: 78 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
# See http://help.github.com/ignore-files/ for more about ignoring files.

# release
release.md
/deploykeys*

# dependencies
/node_modules

# test output
/.nyc_output
/coverage
/mochawesome-report
/test/**/dist
coverage.lcov
.npmpublish.md

# compiled output
/dist
/static
/tmp
/temp
.tmp
*.tmp
*.tmp.*
*.sourcemaps
.cache-loader

# compiled cache
.sass-cache
.eslintcache
.stylelintcache

# IDEs and editors
/.idea
.project
.classpath
.c9/
*.launch
.settings/
*.sublime-workspace

# IDE - Webstorm
*.idea

# IDE - VSCode
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.vs/
[Bb]in/
[Oo]bj/
[Ll]og/
[Pp]ackages/
*.user
*.pch
*.tlh
*.tli
*.pdb
*.suo
*.lastbuildstate
*.Build.CppClean.log
*.ipch
*.history

# Python:
*.py[cod]
*.so
*.egg
*.egg-info

# Windows:
[Tt]humbs.db
Desktop.ini
.DS_Store
$RECYCLE.BIN/
6 changes: 6 additions & 0 deletions .huskyrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"hooks": {
"pre-commit": "lint-staged",
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS"
}
}
1 change: 1 addition & 0 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.idea/
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
access=restricted
package-lock=false
20 changes: 20 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
The MIT License (MIT)

Copyright (c) 2013 Larry Davis

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.
125 changes: 125 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
<h1 align="center">Ant design + Vue + Typescript</h1>

<p align="center">
<a href="https://ant.design" target="_blank"><img width="100" src="docs/assets/antd.svg" alt="antd logo"></a>
<img width="50" src="docs/assets/transparency.png" alt="transparency">
<a href="https://vuejs.org" target="_blank"><img width="100" src="docs/assets/vue.png" alt="vue logo"></a>
<img width="60" src="docs/assets/transparency.png" alt="transparency">
<a href="https://www.typescriptlang.org/" target="_blank"><img width="100" src="docs/assets/ts.png" alt="ts logo"></a>
</p>

使用 Ant design + Vue + Typescript + SASS 构建后台管理类型的 Web 应用.

### 当前支持的版本
- [Ant design vue](https://github.com/vueComponent/ant-design-vue) (v1.6.2)
- [Vue](https://github.com/vuejs/vue) (v2.6.11)
- [Typescript](https://github.com/microsoft/TypeScript) (v3.9.4)

### [online demo](https://antd-vue-ts.repo.fatesigner.com/)

### download
``` bash
git clone https://github.com/fatesigner/antd-vue-ts.git
```

### install
``` bash
npm install
```

### 开发模式(Hot Reload)
``` bash
npm run serve
```

### 打包编译,用于生产环境
``` bash
npm run build
```

### 目录结构
``` bash
├─ build // build 目录,放置打包、编译的脚本
│ ├─ env.js // 定义用于 build 的全局变量,包含当前应用的一些信息
│ ├─ utils.js // 工具函数
│ ├─ webpack-html-embed-source-plugin.js // webpack 插件:将指定的 html、js、css文件内嵌至 index.html
│ ├─ webpack-ignorenotfoundexport-plugin.js // webpack 插件:忽略关于 "imports was not found in..." 的警告信息
│ ├─ webpack.config.js // webpack 配置:包含覆盖 Vue CLI 默认选型的一些配置
│ └─ webpack.loaders.js // webpack loders:定义一些 loaders 的默认配置
├─ src
│ ├─ app
│ │ ├─first-screen // 首屏渲染动画模板,将会内嵌至 index.html
│ │ ├─i18n // 国际化(使用 vue-i18n)
│ │ │ ├─ lang // 语言包
│ │ │ │ ├─ en-US.ts // 英文包
│ │ │ │ └─ zh-CN.ts // 中文包
│ │ │ ├─ i18n // i18n 核心(初始化i18n配置、并添加一些勾子)
│ │ │ └─ keys // 定义 i18n key 接口(用于 typescript 语法检查)
│ │ ├─interfaces // 通用接口
│ │ ├─layout // 母版页和通用布局(页头、页脚、侧边栏等)
│ │ ├─pipes // 过滤器
│ │ ├─providers // 放置一些第三方插件初始化代码和默认配置
│ │ ├─routes
│ │ │ ├─dashboard // dashboard(首页)
│ │ │ │ ├─Dashboard.vue // dashboard 组件
│ │ │ │ └─ router.ts // dashboard 路由
│ │ │ ├─config.ts // 定义基础路由(Login或者其他可匿名访问的路由)和业务路由(需授权访问的路由),并将其导出
│ │ │ └─ routes.ts // 路由初始化(导入当前目录下其他业务组件,并定义拦截、跳转逻辑)
│ │ ├─services
│ │ │ ├─api.service // Api 服务(访问后端接口)
│ │ │ ├─auth.service // 授权认证服务(定义授权、认证逻辑)
│ │ │ ├─common.service // 通用服务
│ │ │ └─ session.service // 用户信息持久化服务(用户信息的本地化存储)
│ │ ├─shared // 通用组件
│ │ ├─styles // 样式库
│ │ │ └─ reset.scss // 样式重置
│ │ ├─theme // 主题库
│ │ │ ├─antdv-theme.js // 定制 Antd ui 主题
│ │ │ └─ default.theme.scss // 当前应用默认主题
│ │ ├─app.ts // 导入 App.vue,并导出 CreateApp 函数
│ │ ├─App.vue // App 组件
│ │ ├─event.ts // 事件总线(用于组件、服务间通信)
│ │ ├─global.ts // 全局变量
│ │ └─ store.ts // App store(导入并整合其他组件的 store)
│ ├─ assets // 放置一些静态资源
│ ├─ index.ejs // 入口 html 模板(使用 ejs)
│ ├─ lib // 第三方插件、组件库
│ │ ├─antdv-ui // antdv-ui(包含部分已二次封装的组件和图标)
│ │ ├─fetch // http 模块(使用 axios)
│ │ ├─qiniu // 七牛云插件
│ │ ├─quick-layout // 通用样式库(用于快速布局)
│ │ └─ vue-helper // Vue 辅助工具库
│ ├─ main.ts // App 初始化
│ └─ typings // 定义一些用于 Typescipt 的类型文件
│ ├─ vue-shims // 支持 Vue 工作于 Typescript 环境
│ ├─ globals.d.ts // 拓展 NodeJS.Global 和 NodeJS.Process 类型
│ └─ window.d.ts // 拓展 Window 类型
├─ test // 测试脚本
│ └─ index.spec.ts
├─ .browserslistrc // 配置目标浏览器
├─ .commitlintrc.js // 定制代码提交规范
├─ .cz-config.js // 定制代码提交类型
├─ .editorconfig // 配置编码风格
├─ .env // 环境变量(所有环境均会加载)
├─ .env.development // 开发环境变量
├─ .env.production // 生产环境变量
├─ .env.test // 测试环境变量
├─ .eslintignore // 配置 eslint 可忽略的特定的文件和目录(一般忽略 dist 目录)
├─ .eslintrc.js // 配置 eslint
├─ .gitattributes // 指定 git 使用的文件和路径的属性
├─ .gitignore // 指定不需要添加到 git 管理的文件和目录
├─ .huskyrc.json // 配置 git 勾子(提交前进行 lint 检查或者自动化测试)
├─ .npmignore // 指定 npm publish 时忽略的文件和目录
├─ .npmrc // npm 配置(可禁用 package-lock)
├─ babel.config.js // babel 配置
├─ jest.config.js // jest 配置
├─ LICENSE // 许可证
├─ lint-staged.config.js // 代码风格化配置
├─ package.json // 模块描述文件
├─ postcss.config.js // postcss 配置
├─ README.md
├─ stylelint.config.js // stylelint 配置
├─ tsconfig.json // tsconfig 用于项目打包、编译
├─ tsconfig.test.json // tsconfig 用于测试脚本
└─ vue.config.js // Vue CLI 配置
```
Loading

0 comments on commit 4039d97

Please sign in to comment.