Skip to content

Commit

Permalink
发布v1版本
Browse files Browse the repository at this point in the history
  • Loading branch information
phpjavac committed Jan 8, 2021
1 parent ded15f7 commit cf004b9
Show file tree
Hide file tree
Showing 86 changed files with 29,063 additions and 36 deletions.
3 changes: 3 additions & 0 deletions build/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
rm -rf generator/template/src

cp -r example/src generator/template/src
2 changes: 1 addition & 1 deletion example/.eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module.exports = {
ecmaVersion: 2020,
},
rules: {
'linebreak-style': ["error", "windows"], /**windows开发 */
'linebreak-style': 'off', /**windows开发 */
'max-len':'off',
'no-param-reassign':'off',
"max-classes-per-file": 'off', /**允许一个文件存在多个类 */
Expand Down
59 changes: 31 additions & 28 deletions example/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,31 +1,34 @@
{
"stylusSupremacy.insertColons": false,
"stylusSupremacy.insertSemicolons": false,
"stylusSupremacy.insertBraces": false,
"stylusSupremacy.insertNewLineAroundBlocks": false,
"stylusSupremacy.insertNewLineAroundImports": false,
"workbench.activityBar.visible": true,
"breadcrumbs.enabled": true,
"terminal.integrated.rendererType": "dom", //制表符符号eslint
"vetur.format.defaultFormatterOptions": {
"prettier": {
"semi": true,
"singleQuote": true
},
"js-beautify-html": {
"wrap_attributes": "force-aligned" //属性强制折行对齐
}
},
// 添加vue支持
"eslint.validate": [
"javascript",
"typescript",
"javascriptreact",
"vue",
],
"editor.formatOnSave": false, //每次保存自动格式化
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
"stylusSupremacy.insertColons": false,
"stylusSupremacy.insertSemicolons": false,
"stylusSupremacy.insertBraces": false,
"stylusSupremacy.insertNewLineAroundBlocks": false,
"stylusSupremacy.insertNewLineAroundImports": false,
"workbench.activityBar.visible": true,
"breadcrumbs.enabled": true,
"terminal.integrated.rendererType": "dom", //制表符符号eslint
"vetur.format.defaultFormatterOptions": {
"prettier": {
"semi": true,
"singleQuote": true
},
"js-beautify-html": {
"wrap_attributes": "force-aligned" //属性强制折行对齐
}
},
// 添加vue支持
"eslint.validate": [
"javascript",
"typescript",
"javascriptreact",
"vue",
],
"editor.formatOnSave": false, //每次保存自动格式化
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[shellscript]": {
"files.eol": "\r\n"
},
"typescript.validate.enable": true,
}
}
17,147 changes: 17,147 additions & 0 deletions example/package-lock.json

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions example/public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="./static/css/normalize.css">
<link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title><%= htmlWebpackPlugin.options.title %></title>
<link rel="icon" href="./static/logo/ZXlogo.ico">
<title></title>
</head>
<body>
<noscript>
<strong>We're sorry but <%= htmlWebpackPlugin.options.title %> doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
<strong>We're sorry but doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>

<!-- 基础icon -->
<script type="text/javascript" src="./img//base-icon/iconfont.js"></script>
<script type="text/javascript" src="./img/base-icon/iconfont.js"></script>
</html>
Empty file added example/src/axios/api.ts
Empty file.
2 changes: 0 additions & 2 deletions example/src/components/Teacher/header.vue
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,6 @@ export default defineComponent({
});
</script>
<style lang="stylus" scoped>
@import '~/../../../styles/variable.styl';
.the-header
min-width 1366px
height 60px
Expand Down
65 changes: 65 additions & 0 deletions generator/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
module.exports = (api, options) => {
api.render('./template')
api.extendPackage({
scripts: {
dev: 'vue-cli-service getTypes && vue-cli-service serve',
getTypes: 'vue-cli-service getTypes',
},
dependencies: {
"@ant-design-vue/use": "^0.0.1-alpha.8",
"ant-design-vue": "^2.0.0-rc.5",
"axios": "^0.21.1",
"mockjs": "^1.1.0",
},
devDependencies: {
"@types/mockjs": "^1.0.3",
"babel-plugin-import": "^1.13.3",
"pug": "^3.0.0",
"pug-plain-loader": "^1.0.0",
"less": "^3.13.1",
"less-loader": "^7.2.0",
"vue-cli-plugin-swagger-to-types": "~1.2.0",
"stylus": "^0.54.7",
"vue-cli-plugin-ftp": "^1.1.1",
"stylus-loader": "^3.0.2",

}
})
// 基础 vue.config.js 参数设置
api.extendPackage({
vue: {
lintOnSave: false,
// baseUrl Deprecated since Vue CLI 3.3, 使用 publicPath 替代
publicPath: `/${options.productName}`,
devServer: {
proxy: {
'/': {
target: options.serverPath,
changeOrigin: true,
ws: false,
},
},
},
pluginOptions: {
toTypes: {
host: `${options.serverPath}/${options.productName}/v2/api-docs`,
TypesPath: './types/api.ts',
},
ftp: {
host: '自行配置',
// 须自行配置路径
remoteFtpPath: 'DISK-D/findsoft_test/tomcat8/webapps/eg/',
},
},
css: {
loaderOptions: {
less: {
lessOptions: {
javascriptEnabled: true,
},
},
},
},
},
})
}
33 changes: 33 additions & 0 deletions generator/template/_eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
module.exports = {
root: true,
env: {
node: true,
},
extends: [
'plugin:vue/vue3-essential',
'@vue/airbnb',
'@vue/typescript/recommended',
],
parserOptions: {
ecmaVersion: 2020,
},
rules: {
'linebreak-style': ["error", "windows"], /**windows开发 */
'max-len':'off',
'no-param-reassign':'off',
"max-classes-per-file": 'off', /**允许一个文件存在多个类 */
'no-console': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'warn' : 'off',
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)',
],
env: {
jest: true,
},
},
],
};
34 changes: 34 additions & 0 deletions generator/template/_vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
{
"stylusSupremacy.insertColons": false,
"stylusSupremacy.insertSemicolons": false,
"stylusSupremacy.insertBraces": false,
"stylusSupremacy.insertNewLineAroundBlocks": false,
"stylusSupremacy.insertNewLineAroundImports": false,
"workbench.activityBar.visible": true,
"breadcrumbs.enabled": true,
"terminal.integrated.rendererType": "dom", //制表符符号eslint
"vetur.format.defaultFormatterOptions": {
"prettier": {
"semi": true,
"singleQuote": true
},
"js-beautify-html": {
"wrap_attributes": "force-aligned" //属性强制折行对齐
}
},
// 添加vue支持
"eslint.validate": [
"javascript",
"typescript",
"javascriptreact",
"vue",
],
"editor.formatOnSave": false, //每次保存自动格式化
"editor.codeActionsOnSave": {
"source.fixAll.eslint": true
},
"[shellscript]": {
"files.eol": "\r\n"
},
"typescript.validate.enable": true,
}
38 changes: 38 additions & 0 deletions generator/template/_vscode/vue-v3.code-snippets
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
{
// Place your trunk 工作区 snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders.
// Placeholders with the same ids are connected.
// Example:
// "Print to console": {
// "scope": "javascript,typescript",
// "prefix": "log",
// "body": [
// "console.log('$1');",
// "$2"
// ],
// "description": "Log output to console"
// }
"ts": {
"prefix": "ts",
"body": [
"<script lang=\"ts\">",
"import { defineComponent } from 'vue';",
"export default defineComponent({",
"components: {},",
"props: {},",
"setup() {",
"return {",
"};",
"},",
"});",
"</script>"
]
},
"log": {
"prefix": "log",
"body": "console.log();"
}
}
11 changes: 11 additions & 0 deletions generator/template/babel.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module.exports = {
presets: [
'@vue/cli-plugin-babel/preset',
],
plugins: [
[
'import',
{ libraryName: 'ant-design-vue', libraryDirectory: 'es', style: true },
],
],
};
Binary file added generator/template/public/favicon.ico
Binary file not shown.
1 change: 1 addition & 0 deletions generator/template/public/img/base-icon/iconfont.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 3 additions & 0 deletions generator/template/public/img/icons/safari-pinned-tab.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
21 changes: 21 additions & 0 deletions generator/template/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="stylesheet" href="./static/css/normalize.css">
<link rel="icon" href="./static/logo/ZXlogo.ico">
<title></title>
</head>
<body>
<noscript>
<strong>We're sorry but doesn't work properly without JavaScript enabled. Please enable it to continue.</strong>
</noscript>
<div id="app"></div>
<!-- built files will be auto injected -->
</body>

<!-- 基础icon -->
<script type="text/javascript" src="./img/base-icon/iconfont.js"></script>
</html>
2 changes: 2 additions & 0 deletions generator/template/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
User-agent: *
Disallow:
Binary file added generator/template/public/static/avatar.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit cf004b9

Please sign in to comment.