Skip to content

Commit 59a8c9c

Browse files
committed
Initial commit
0 parents  commit 59a8c9c

Some content is hidden

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

97 files changed

+5166
-0
lines changed

.editorconfig

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# http://editorconfig.org
2+
root = true
3+
4+
[*]
5+
charset = utf-8
6+
indent_style = space
7+
indent_size = 2
8+
end_of_line = lf
9+
insert_final_newline = true
10+
trim_trailing_whitespace = true
11+
12+
[*.md]
13+
insert_final_newline = false
14+
trim_trailing_whitespace = false

.env.development

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# just a flag
2+
ENV = 'development'
3+
4+
# base api
5+
VUE_APP_BASE_API = '/dev-api'

.env.production

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
# just a flag
2+
ENV = 'production'
3+
4+
# base api
5+
VUE_APP_BASE_API = '/prod-api'
6+

.env.staging

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
NODE_ENV = production
2+
3+
# just a flag
4+
ENV = 'staging'
5+
6+
# base api
7+
VUE_APP_BASE_API = '/stage-api'
8+

.eslintignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
build/*.js
2+
src/assets
3+
public
4+
dist

.eslintrc.js

Lines changed: 198 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,198 @@
1+
module.exports = {
2+
root: true,
3+
parserOptions: {
4+
parser: 'babel-eslint',
5+
sourceType: 'module'
6+
},
7+
env: {
8+
browser: true,
9+
node: true,
10+
es6: true,
11+
},
12+
extends: ['plugin:vue/recommended', 'eslint:recommended'],
13+
14+
// add your custom rules here
15+
//it is base on https://github.com/vuejs/eslint-config-vue
16+
rules: {
17+
"vue/max-attributes-per-line": [2, {
18+
"singleline": 10,
19+
"multiline": {
20+
"max": 1,
21+
"allowFirstLine": false
22+
}
23+
}],
24+
"vue/singleline-html-element-content-newline": "off",
25+
"vue/multiline-html-element-content-newline":"off",
26+
"vue/name-property-casing": ["error", "PascalCase"],
27+
"vue/no-v-html": "off",
28+
'accessor-pairs': 2,
29+
'arrow-spacing': [2, {
30+
'before': true,
31+
'after': true
32+
}],
33+
'block-spacing': [2, 'always'],
34+
'brace-style': [2, '1tbs', {
35+
'allowSingleLine': true
36+
}],
37+
'camelcase': [0, {
38+
'properties': 'always'
39+
}],
40+
'comma-dangle': [2, 'never'],
41+
'comma-spacing': [2, {
42+
'before': false,
43+
'after': true
44+
}],
45+
'comma-style': [2, 'last'],
46+
'constructor-super': 2,
47+
'curly': [2, 'multi-line'],
48+
'dot-location': [2, 'property'],
49+
'eol-last': 2,
50+
'eqeqeq': ["error", "always", {"null": "ignore"}],
51+
'generator-star-spacing': [2, {
52+
'before': true,
53+
'after': true
54+
}],
55+
'handle-callback-err': [2, '^(err|error)$'],
56+
'indent': [2, 2, {
57+
'SwitchCase': 1
58+
}],
59+
'jsx-quotes': [2, 'prefer-single'],
60+
'key-spacing': [2, {
61+
'beforeColon': false,
62+
'afterColon': true
63+
}],
64+
'keyword-spacing': [2, {
65+
'before': true,
66+
'after': true
67+
}],
68+
'new-cap': [2, {
69+
'newIsCap': true,
70+
'capIsNew': false
71+
}],
72+
'new-parens': 2,
73+
'no-array-constructor': 2,
74+
'no-caller': 2,
75+
'no-console': 'off',
76+
'no-class-assign': 2,
77+
'no-cond-assign': 2,
78+
'no-const-assign': 2,
79+
'no-control-regex': 0,
80+
'no-delete-var': 2,
81+
'no-dupe-args': 2,
82+
'no-dupe-class-members': 2,
83+
'no-dupe-keys': 2,
84+
'no-duplicate-case': 2,
85+
'no-empty-character-class': 2,
86+
'no-empty-pattern': 2,
87+
'no-eval': 2,
88+
'no-ex-assign': 2,
89+
'no-extend-native': 2,
90+
'no-extra-bind': 2,
91+
'no-extra-boolean-cast': 2,
92+
'no-extra-parens': [2, 'functions'],
93+
'no-fallthrough': 2,
94+
'no-floating-decimal': 2,
95+
'no-func-assign': 2,
96+
'no-implied-eval': 2,
97+
'no-inner-declarations': [2, 'functions'],
98+
'no-invalid-regexp': 2,
99+
'no-irregular-whitespace': 2,
100+
'no-iterator': 2,
101+
'no-label-var': 2,
102+
'no-labels': [2, {
103+
'allowLoop': false,
104+
'allowSwitch': false
105+
}],
106+
'no-lone-blocks': 2,
107+
'no-mixed-spaces-and-tabs': 2,
108+
'no-multi-spaces': 2,
109+
'no-multi-str': 2,
110+
'no-multiple-empty-lines': [2, {
111+
'max': 1
112+
}],
113+
'no-native-reassign': 2,
114+
'no-negated-in-lhs': 2,
115+
'no-new-object': 2,
116+
'no-new-require': 2,
117+
'no-new-symbol': 2,
118+
'no-new-wrappers': 2,
119+
'no-obj-calls': 2,
120+
'no-octal': 2,
121+
'no-octal-escape': 2,
122+
'no-path-concat': 2,
123+
'no-proto': 2,
124+
'no-redeclare': 2,
125+
'no-regex-spaces': 2,
126+
'no-return-assign': [2, 'except-parens'],
127+
'no-self-assign': 2,
128+
'no-self-compare': 2,
129+
'no-sequences': 2,
130+
'no-shadow-restricted-names': 2,
131+
'no-spaced-func': 2,
132+
'no-sparse-arrays': 2,
133+
'no-this-before-super': 2,
134+
'no-throw-literal': 2,
135+
'no-trailing-spaces': 2,
136+
'no-undef': 2,
137+
'no-undef-init': 2,
138+
'no-unexpected-multiline': 2,
139+
'no-unmodified-loop-condition': 2,
140+
'no-unneeded-ternary': [2, {
141+
'defaultAssignment': false
142+
}],
143+
'no-unreachable': 2,
144+
'no-unsafe-finally': 2,
145+
'no-unused-vars': [2, {
146+
'vars': 'all',
147+
'args': 'none'
148+
}],
149+
'no-useless-call': 2,
150+
'no-useless-computed-key': 2,
151+
'no-useless-constructor': 2,
152+
'no-useless-escape': 0,
153+
'no-whitespace-before-property': 2,
154+
'no-with': 2,
155+
'one-var': [2, {
156+
'initialized': 'never'
157+
}],
158+
'operator-linebreak': [2, 'after', {
159+
'overrides': {
160+
'?': 'before',
161+
':': 'before'
162+
}
163+
}],
164+
'padded-blocks': [2, 'never'],
165+
'quotes': [2, 'single', {
166+
'avoidEscape': true,
167+
'allowTemplateLiterals': true
168+
}],
169+
'semi': [2, 'never'],
170+
'semi-spacing': [2, {
171+
'before': false,
172+
'after': true
173+
}],
174+
'space-before-blocks': [2, 'always'],
175+
'space-before-function-paren': [2, 'never'],
176+
'space-in-parens': [2, 'never'],
177+
'space-infix-ops': 2,
178+
'space-unary-ops': [2, {
179+
'words': true,
180+
'nonwords': false
181+
}],
182+
'spaced-comment': [2, 'always', {
183+
'markers': ['global', 'globals', 'eslint', 'eslint-disable', '*package', '!', ',']
184+
}],
185+
'template-curly-spacing': [2, 'never'],
186+
'use-isnan': 2,
187+
'valid-typeof': 2,
188+
'wrap-iife': [2, 'any'],
189+
'yield-star-spacing': [2, 'both'],
190+
'yoda': [2, 'never'],
191+
'prefer-const': 2,
192+
'no-debugger': process.env.NODE_ENV === 'production' ? 2 : 0,
193+
'object-curly-spacing': [2, 'always', {
194+
objectsInObjects: false
195+
}],
196+
'array-bracket-spacing': [2, 'never']
197+
}
198+
}

.gitignore

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
.DS_Store
2+
node_modules/
3+
dist/
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
package-lock.json
8+
tests/**/coverage/
9+
10+
# Editor directories and files
11+
.idea
12+
.vscode
13+
*.suo
14+
*.ntvs*
15+
*.njsproj
16+
*.sln

.travis.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
language: node_js
2+
node_js: 10
3+
script: npm run test
4+
notifications:
5+
email: false

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2017-present PanJiaChen
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.

babel.config.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
module.exports = {
2+
presets: [
3+
// https://github.com/vuejs/vue-cli/tree/master/packages/@vue/babel-preset-app
4+
'@vue/cli-plugin-babel/preset'
5+
],
6+
'env': {
7+
'development': {
8+
// babel-plugin-dynamic-import-node plugin only does one thing by converting all import() to require().
9+
// This plugin can significantly increase the speed of hot updates, when you have a large number of pages.
10+
// https://panjiachen.github.io/vue-element-admin-site/guide/advanced/lazy-loading.html
11+
'plugins': ['dynamic-import-node']
12+
}
13+
}
14+
}

build/index.js

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
const { run } = require('runjs')
2+
const chalk = require('chalk')
3+
const config = require('../vue.config.js')
4+
const rawArgv = process.argv.slice(2)
5+
const args = rawArgv.join(' ')
6+
7+
if (process.env.npm_config_preview || rawArgv.includes('--preview')) {
8+
const report = rawArgv.includes('--report')
9+
10+
run(`vue-cli-service build ${args}`)
11+
12+
const port = 9526
13+
const publicPath = config.publicPath
14+
15+
var connect = require('connect')
16+
var serveStatic = require('serve-static')
17+
const app = connect()
18+
19+
app.use(
20+
publicPath,
21+
serveStatic('./dist', {
22+
index: ['index.html', '/']
23+
})
24+
)
25+
26+
app.listen(port, function () {
27+
console.log(chalk.green(`> Preview at http://localhost:${port}${publicPath}`))
28+
if (report) {
29+
console.log(chalk.green(`> Report at http://localhost:${port}${publicPath}report.html`))
30+
}
31+
32+
})
33+
} else {
34+
run(`vue-cli-service build ${args}`)
35+
}

jest.config.js

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
module.exports = {
2+
moduleFileExtensions: ['js', 'jsx', 'json', 'vue'],
3+
transform: {
4+
'^.+\\.vue$': 'vue-jest',
5+
'.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$':
6+
'jest-transform-stub',
7+
'^.+\\.jsx?$': 'babel-jest'
8+
},
9+
moduleNameMapper: {
10+
'^@/(.*)$': '<rootDir>/src/$1'
11+
},
12+
snapshotSerializers: ['jest-serializer-vue'],
13+
testMatch: [
14+
'**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)'
15+
],
16+
collectCoverageFrom: ['src/utils/**/*.{js,vue}', '!src/utils/auth.js', '!src/utils/request.js', 'src/components/**/*.{js,vue}'],
17+
coverageDirectory: '<rootDir>/tests/unit/coverage',
18+
// 'collectCoverage': true,
19+
'coverageReporters': [
20+
'lcov',
21+
'text-summary'
22+
],
23+
testURL: 'http://localhost/'
24+
}

jsconfig.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
{
2+
"compilerOptions": {
3+
"baseUrl": "./",
4+
"paths": {
5+
"@/*": ["src/*"]
6+
}
7+
},
8+
"exclude": ["node_modules", "dist"]
9+
}

0 commit comments

Comments
 (0)