Skip to content
This repository was archived by the owner on Mar 23, 2018. It is now read-only.

Commit 8b371fa

Browse files
committed
use eslint-config-1stg, upgrade (dev)Dependencies, try to fix error on CI
1 parent 2b1d8b2 commit 8b371fa

File tree

7 files changed

+1464
-1599
lines changed

7 files changed

+1464
-1599
lines changed

.eslintrc.js

+3-39
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,9 @@
11
module.exports = {
22
root: true,
3-
parser: 'babel-eslint',
43
plugins: [
5-
'babel',
6-
'flowtype',
7-
'standard',
8-
'vue'
9-
],
10-
extends: [
11-
'standard',
12-
'plugin:flowtype/recommended'
4+
'flowtype'
135
],
6+
extends: ['1stg/vue', 'plugin:flowtype/recommended'],
147
env: {
158
browser: true
169
},
@@ -34,37 +27,8 @@ module.exports = {
3427
PROMPT: false,
3528
REMIND: false
3629
},
37-
parserOptions: {
38-
ecmaVersion: 6,
39-
sourceType: 'module'
40-
},
4130
rules: {
42-
'array-bracket-spacing': 2,
43-
'babel/object-curly-spacing': 2,
44-
'computed-property-spacing': 2,
45-
'eol-last': 2,
46-
'flowtype/no-types-missing-file-annotation': 0,
47-
'generator-star-spacing': 2,
48-
'max-depth': 2,
49-
'max-len': [
50-
2,
51-
120,
52-
2
53-
],
54-
'max-nested-callbacks': 2,
55-
'max-params': [2, 5],
5631
'no-mixed-operators': 0,
57-
'object-curly-spacing': 0,
58-
'standard/no-callback-literal': 0,
59-
'prefer-const': [2, {
60-
destructuring: 'all'
61-
}],
62-
'space-before-function-paren': [
63-
2,
64-
{
65-
anonymous: 'always',
66-
named: 'never'
67-
}
68-
]
32+
'flowtype/no-types-missing-file-annotation': 0
6933
}
7034
}

.travis.yml

+9-6
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,8 @@ branches:
77
only:
88
- master
99

10+
cache: yarn
11+
1012
before_install:
1113
- openssl aes-256-cbc -K $encrypted_dcf72c291a03_key -iv $encrypted_dcf72c291a03_iv
1214
-in .travis/id_rsa.enc -out ~/.ssh/id_rsa -d
@@ -17,13 +19,14 @@ before_install:
1719
- git config --global user.name 'JounQin'
1820
- git config --global user.email '[email protected]'
1921
- sudo apt-get update
20-
- sudo apt-get install libcairo2-dev libjpeg-dev libpango1.0-dev libgif-dev build-essential g++
21-
- npm i -g npm
22+
- sudo apt-get install libcairo2-dev libjpeg8-dev libpango1.0-dev libgif-dev build-essential g++
23+
- yarn global add greenkeeper-lockfile
2224

23-
install:
24-
- npm i
25+
before_script: greenkeeper-lockfile-update
2526

2627
script:
27-
- npm run build:mock
28+
- yarn build:mock
2829
- git push --force --quiet [email protected]:Raiyee/EasyHi.git master:master
29-
- npm run sync
30+
- yarn sync
31+
32+
after_script: greenkeeper-lockfile-upload

build/config/_base.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ const config = {
4646
compiler_alias: {
4747
vue: 'vue/dist/vue.common'
4848
},
49-
compiler_vendor: [
49+
compiler_vendors: [
5050
'axios',
5151
'moment',
5252
'qs',
@@ -95,7 +95,7 @@ config.globals = {
9595
// ------------------------------------
9696
// Validate Vendor Dependencies
9797
// ------------------------------------
98-
config.compiler_vendor = config.compiler_vendor
98+
config.compiler_vendors = config.compiler_vendors
9999
.filter(dep => ({...config.pkg.dependencies, ...config.compiler_alias}.hasOwnProperty(dep) ? true : debug(
100100
'Package "' + dep + '" was not found as an npm dependency in package.json; ' +
101101
'it won\'t be included in the webpack vendor bundle.\n' +

build/webpack/index.js

+6-2
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ webpackConfig.entry = {
5454
app: __DEV__
5555
? [...APP_ENTRY_PATH, 'webpack-hot-middleware/client']
5656
: APP_ENTRY_PATH,
57-
vendor: config.compiler_vendor
57+
vendors: config.compiler_vendors
5858
}
5959

6060
// ------------------------------------
@@ -182,7 +182,10 @@ webpackConfig.plugins = [
182182

183183
// Don't split bundles during testing, since we only want import one bundle
184184
if (!__TESTING__) {
185-
webpackConfig.plugins.push(new webpack.optimize.CommonsChunkPlugin('vendor'))
185+
webpackConfig.plugins.push(
186+
new webpack.optimize.CommonsChunkPlugin('vendors'),
187+
new webpack.optimize.CommonsChunkPlugin('manifest')
188+
)
186189
}
187190

188191
if (__DEV__) {
@@ -195,6 +198,7 @@ if (__DEV__) {
195198
debug(`Enable plugins for ${NODE_ENV} (OccurenceOrder, Dedupe & UglifyJS).`)
196199
debug(`Extract styles of app and bootstrap for ${NODE_ENV}.`)
197200
webpackConfig.plugins.push(
201+
new webpack.optimize.ModuleConcatenationPlugin(),
198202
new webpack.optimize.UglifyJsPlugin({
199203
mangle: !sourceMap,
200204
compress: {

package.json

+35-41
Original file line numberDiff line numberDiff line change
@@ -55,53 +55,47 @@
5555
"echarts": "^3.6.2",
5656
"fonts.css": "^1.5.0",
5757
"moment": "^2.18.1",
58-
"qs": "^6.4.0",
59-
"v-touch": "^1.4.0",
60-
"vue": "^2.3.4",
58+
"qs": "^6.5.0",
59+
"v-touch": "^1.5.0",
60+
"vue": "^2.4.2",
6161
"vue-qrious": "^1.1.0",
62-
"vue-router": "^2.6.0",
62+
"vue-router": "^2.7.0",
6363
"vuex": "^2.3.1",
6464
"weixin-js-sdk": "^1.2.0"
6565
},
6666
"devDependencies": {
67-
"babel-core": "^6.25.0",
67+
"babel-core": "^6.26.0",
6868
"babel-eslint": "^7.2.3",
6969
"babel-helper-vue-jsx-merge-props": "^2.0.2",
70-
"babel-loader": "^7.1.0",
70+
"babel-loader": "^7.1.2",
7171
"babel-plugin-__coverage__": "^11.0.0",
7272
"babel-plugin-add-module-exports": "^0.2.1",
7373
"babel-plugin-dynamic-import-webpack": "^1.0.1",
74-
"babel-plugin-flow-runtime": "^0.11.0",
74+
"babel-plugin-flow-runtime": "^0.11.1",
7575
"babel-plugin-syntax-flow": "^6.18.0",
7676
"babel-plugin-syntax-jsx": "^6.18.0",
7777
"babel-plugin-transform-flow-strip-types": "^6.22.0",
78-
"babel-plugin-transform-vue-jsx": "^3.4.3",
79-
"babel-polyfill": "^6.23.0",
80-
"babel-preset-env": "^1.5.2",
78+
"babel-plugin-transform-vue-jsx": "^3.5.0",
79+
"babel-polyfill": "^6.26.0",
80+
"babel-preset-env": "^1.6.0",
8181
"babel-preset-stage-0": "^6.24.1",
82-
"babel-register": "^6.24.1",
83-
"chai": "^4.0.2",
82+
"babel-register": "^6.26.0",
83+
"chai": "^4.1.1",
8484
"connect-history-api-fallback": "^1.3.0",
8585
"copy-webpack-plugin": "^4.0.1",
86-
"cross-env": "^5.0.1",
87-
"css-loader": "^0.28.4",
86+
"cross-env": "^5.0.5",
87+
"css-loader": "^0.28.5",
8888
"debug": "^3.0.0",
8989
"del": "^3.0.0",
90-
"eslint": "^4.0.0",
91-
"eslint-config-standard": "^10.2.1",
90+
"eslint": "^4.5.0",
91+
"eslint-config-1stg": "^1.0.1",
9292
"eslint-friendly-formatter": "^3.0.0",
93-
"eslint-plugin-babel": "^4.1.1",
94-
"eslint-plugin-flowtype": "^2.34.0",
95-
"eslint-plugin-import": "2.7.0",
96-
"eslint-plugin-node": "5.1.1",
97-
"eslint-plugin-promise": "^3.5.0",
98-
"eslint-plugin-standard": "^3.0.1",
99-
"eslint-plugin-vue": "^2.1.0",
93+
"eslint-plugin-flowtype": "^2.35.0",
10094
"extract-text-webpack-plugin": "^3.0.0",
101-
"file-loader": "^1.0.0-rc.0",
95+
"file-loader": "^0.11.2",
10296
"flow-runtime": "^0.14.0",
10397
"html-rewrite-webpack-plugin": "^0.0.1",
104-
"html-webpack-plugin": "^2.28.0",
98+
"html-webpack-plugin": "^2.30.1",
10599
"img-loader": "^2.0.0",
106100
"karma": "^1.7.0",
107101
"karma-coverage": "^1.1.1",
@@ -110,26 +104,26 @@
110104
"karma-mocha-reporter": "^2.2.3",
111105
"karma-phantomjs-launcher": "^1.0.4",
112106
"karma-sourcemap-loader": "^0.3.7",
113-
"karma-webpack": "^2.0.3",
107+
"karma-webpack": "^2.0.4",
114108
"koa": "^2.3.0",
115109
"koa-compress": "^2.0.0",
116-
"koa-logger": "^3.0.0",
117-
"koa-static": "^4.0.0",
118-
"mocha": "^3.4.2",
110+
"koa-logger": "^3.0.1",
111+
"koa-static": "^4.0.1",
112+
"mocha": "^3.5.0",
119113
"mockjs": "^1.0.1-beta3",
120114
"nib": "^1.1.2",
121115
"nightwatch": "^0.9.16",
122116
"nodemon": "^1.11.0",
123117
"phantomjs-polyfill": "^0.0.2",
124-
"phantomjs-prebuilt": "^2.1.14",
118+
"phantomjs-prebuilt": "^2.1.15",
125119
"postcss-loader": "^2.0.6",
126120
"postcss-reporter": "^5.0.0",
127121
"pre-commit": "^1.2.2",
128-
"pug": "^2.0.0-rc.2",
122+
"pug": "^2.0.0-rc.3",
129123
"pug-lint": "^2.4.0",
130-
"selenium-server": "^3.4.0",
131-
"sinon": "^3.0.0",
132-
"sinon-chai": "^2.11.0",
124+
"selenium-server": "^3.5.0",
125+
"sinon": "^3.2.1",
126+
"sinon-chai": "^2.13.0",
133127
"style-loader": "^0.18.2",
134128
"stylelint": "^8.0.0",
135129
"stylelint-config-standard": "^17.0.0",
@@ -138,19 +132,19 @@
138132
"stylus": "^0.54.5",
139133
"stylus-loader": "^3.0.1",
140134
"stylus-pxtorem": "^1.0.14",
141-
"sw-precache-webpack-plugin": "^0.11.3",
135+
"sw-precache-webpack-plugin": "^0.11.4",
142136
"template-file-loader": "^0.0.2",
143137
"url-loader": "^0.5.9",
144138
"vconsole": "^2.5.2",
145139
"vue-hot-reload-api": "^2.1.0",
146-
"vue-loader": "^13.0.0",
140+
"vue-loader": "^13.0.4",
147141
"vue-style-loader": "^3.0.1",
148-
"vue-template-compiler": "^2.3.4",
142+
"vue-template-compiler": "^2.4.2",
149143
"vue-template-es2015-loader": "^2.1.2",
150-
"webpack": "^3.0.0",
151-
"webpack-dev-middleware": "^1.11.0",
152-
"webpack-dev-server": "^2.5.0",
153-
"webpack-hot-middleware": "^2.18.0",
144+
"webpack": "^3.5.5",
145+
"webpack-dev-middleware": "^1.12.0",
146+
"webpack-dev-server": "^2.7.1",
147+
"webpack-hot-middleware": "^2.18.2",
154148
"yargs": "^8.0.2"
155149
}
156150
}

src/utils/moment.js

+6-6
Original file line numberDiff line numberDiff line change
@@ -79,12 +79,12 @@ export const commonMonths = date => [{
7979
monthIndex: 0,
8080
monthText: '本月'
8181
}, ...emptyArr(3).map((val, index) => {
82-
const monthIndex = -index - 1
83-
return {
84-
monthIndex,
85-
monthText: monthText(date, monthIndex)
86-
}
87-
}), {
82+
const monthIndex = -index - 1
83+
return {
84+
monthIndex,
85+
monthText: monthText(date, monthIndex)
86+
}
87+
}), {
8888
monthIndex: -4,
8989
monthText: '三个月前'
9090
}]

0 commit comments

Comments
 (0)