Merge branch 'develop' of http://git.dev.yoho.cn/web/yohobuy-node into develop
Showing
13 changed files
with
170 additions
and
14 deletions
.eslintignore
0 → 100644
1 | -node_modules/ | 1 | + |
2 | +# Created by https://www.gitignore.io/api/node,webstorm,netbeans,sublimetext,vim | ||
3 | + | ||
4 | +### Node ### | ||
5 | +# Logs | ||
6 | +logs | ||
7 | +*.log | ||
8 | +npm-debug.log* | ||
9 | + | ||
10 | +# Runtime data | ||
11 | +pids | ||
12 | +*.pid | ||
13 | +*.seed | ||
14 | + | ||
15 | +# Directory for instrumented libs generated by jscoverage/JSCover | ||
16 | +lib-cov | ||
17 | + | ||
18 | +# Coverage directory used by tools like istanbul | ||
19 | +coverage | ||
20 | + | ||
21 | +# nyc test coverage | ||
22 | +.nyc_output | ||
23 | + | ||
24 | +# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files) | ||
25 | +.grunt | ||
26 | + | ||
27 | +# node-waf configuration | ||
28 | +.lock-wscript | ||
29 | + | ||
30 | +# Compiled binary addons (http://nodejs.org/api/addons.html) | ||
31 | +build/Release | ||
32 | + | ||
33 | +# Dependency directories | ||
34 | +node_modules | ||
35 | +jspm_packages | ||
36 | + | ||
37 | +# Optional npm cache directory | ||
38 | +.npm | ||
39 | + | ||
40 | +# Optional REPL history | ||
41 | +.node_repl_history | ||
42 | + | ||
43 | + | ||
44 | +### WebStorm ### | ||
45 | +# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm | ||
46 | +# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 | ||
47 | + | ||
48 | +# User-specific stuff: | ||
49 | +.idea/workspace.xml | ||
50 | +.idea/tasks.xml | ||
51 | +.idea/dictionaries | ||
52 | +.idea/vcs.xml | ||
53 | +.idea/jsLibraryMappings.xml | ||
54 | + | ||
55 | +# Sensitive or high-churn files: | ||
56 | +.idea/dataSources.ids | ||
57 | +.idea/dataSources.xml | ||
58 | +.idea/dataSources.local.xml | ||
59 | +.idea/sqlDataSources.xml | ||
60 | +.idea/dynamic.xml | ||
61 | +.idea/uiDesigner.xml | ||
62 | + | ||
63 | +# Gradle: | ||
64 | +.idea/gradle.xml | ||
65 | +.idea/libraries | ||
66 | + | ||
67 | +# Mongo Explorer plugin: | ||
68 | +.idea/mongoSettings.xml | ||
69 | + | ||
70 | +## File-based project format: | ||
71 | +*.iws | ||
72 | + | ||
73 | +## Plugin-specific files: | ||
74 | + | ||
75 | +# IntelliJ | ||
76 | +/out/ | ||
77 | + | ||
78 | +# mpeltonen/sbt-idea plugin | ||
79 | +.idea_modules/ | ||
80 | + | ||
81 | +# JIRA plugin | ||
82 | +atlassian-ide-plugin.xml | ||
83 | + | ||
84 | +# Crashlytics plugin (for Android Studio and IntelliJ) | ||
85 | +com_crashlytics_export_strings.xml | ||
86 | +crashlytics.properties | ||
87 | +crashlytics-build.properties | ||
88 | +fabric.properties | ||
89 | + | ||
90 | +### WebStorm Patch ### | ||
91 | +# Comment Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-215987721 | ||
92 | + | ||
93 | +# *.iml | ||
94 | +# modules.xml | ||
95 | + | ||
96 | + | ||
97 | +### NetBeans ### | ||
98 | +nbproject/private/ | ||
99 | +build/ | ||
100 | +nbbuild/ | ||
2 | dist/ | 101 | dist/ |
3 | -npm-debug.log | 102 | +nbdist/ |
103 | +nbactions.xml | ||
104 | +.nb-gradle/ | ||
105 | + | ||
106 | + | ||
107 | +### SublimeText ### | ||
108 | +# cache files for sublime text | ||
109 | +*.tmlanguage.cache | ||
110 | +*.tmPreferences.cache | ||
111 | +*.stTheme.cache | ||
112 | + | ||
113 | +# workspace files are user-specific | ||
114 | +*.sublime-workspace | ||
115 | + | ||
116 | +# project files should be checked into the repository, unless a significant | ||
117 | +# proportion of contributors will probably not be using SublimeText | ||
118 | +# *.sublime-project | ||
119 | + | ||
120 | +# sftp configuration file | ||
121 | +sftp-config.json | ||
122 | + | ||
123 | + | ||
124 | +### Vim ### | ||
125 | +# swap | ||
126 | +[._]*.s[a-w][a-z] | ||
127 | +[._]s[a-w][a-z] | ||
128 | +# session | ||
129 | +Session.vim | ||
130 | +# temporary | ||
131 | +.netrwhist | ||
132 | +*~ | ||
133 | +# auto-generated tag files | ||
134 | +tags | ||
135 | + | ||
136 | +### YOHO ### | ||
137 | +dist | ||
4 | public/css/* | 138 | public/css/* |
5 | public/bundle/* | 139 | public/bundle/* |
140 | +.eslintcache |
.stylelintignore
0 → 100644
.stylelintrc
0 → 100644
1 | { | 1 | { |
2 | "name": "m-yohobuy-node", | 2 | "name": "m-yohobuy-node", |
3 | "version": "0.0.1", | 3 | "version": "0.0.1", |
4 | + "private": true, | ||
4 | "description": "A New Yohobuy Project With Express", | 5 | "description": "A New Yohobuy Project With Express", |
5 | "repository": { | 6 | "repository": { |
6 | "type": "git", | 7 | "type": "git", |
7 | "url": "http://git.dev.yoho.cn/web/yohobuy-node.git" | 8 | "url": "http://git.dev.yoho.cn/web/yohobuy-node.git" |
8 | }, | 9 | }, |
10 | + "scripts": { | ||
11 | + "start": "node app.js", | ||
12 | + "dev": "node_modules/.bin/nodemon -e js,hbs -i public/ app.js", | ||
13 | + "online": "NODE_ENV=\"production\" node app.js", | ||
14 | + "debug": "DEBUG=\"express:*\" node app.js", | ||
15 | + "lint-js": "node_modules/.bin/eslint -c .eslintrc --cache --fix `git diff --cached --name-only --diff-filter=ACM | grep .js$` app.js", | ||
16 | + "lint-css": "node_modules/.bin/stylelint --config .stylelintrc `git diff --cached --name-only --diff-filter=ACM | grep .css$`", | ||
17 | + "precommit": "npm run lint-js && npm run lint-css" | ||
18 | + }, | ||
9 | "license": "MIT", | 19 | "license": "MIT", |
10 | "dependencies": { | 20 | "dependencies": { |
11 | "body-parser": "^1.15.0", | 21 | "body-parser": "^1.15.0", |
@@ -15,17 +25,19 @@ | @@ -15,17 +25,19 @@ | ||
15 | "lodash": "^4.8.2", | 25 | "lodash": "^4.8.2", |
16 | "morgan": "^1.7.0", | 26 | "morgan": "^1.7.0", |
17 | "request-promise": "^2.0.1", | 27 | "request-promise": "^2.0.1", |
18 | - "serve-favicon": "^2.3.0", | ||
19 | - "shelljs": "^0.7.0" | 28 | + "serve-favicon": "^2.3.0" |
20 | }, | 29 | }, |
21 | "devDependencies": { | 30 | "devDependencies": { |
22 | "autoprefixer": "^6.3.6", | 31 | "autoprefixer": "^6.3.6", |
32 | + "eslint": "^2.9.0", | ||
33 | + "eslint-config-yoho": "^1.0.1", | ||
23 | "gulp": "^3.9.1", | 34 | "gulp": "^3.9.1", |
24 | "gulp-cssnano": "^2.1.2", | 35 | "gulp-cssnano": "^2.1.2", |
25 | "gulp-ftp": "^1.1.0", | 36 | "gulp-ftp": "^1.1.0", |
26 | "gulp-postcss": "^6.1.0", | 37 | "gulp-postcss": "^6.1.0", |
27 | "gulp-sourcemaps": "^2.0.0-alpha", | 38 | "gulp-sourcemaps": "^2.0.0-alpha", |
28 | "gulp-util": "^3.0.7", | 39 | "gulp-util": "^3.0.7", |
40 | + "husky": "^0.11.4", | ||
29 | "postcss-assets": "^4.0.1", | 41 | "postcss-assets": "^4.0.1", |
30 | "postcss-cachebuster": "^0.1.2", | 42 | "postcss-cachebuster": "^0.1.2", |
31 | "postcss-calc": "^5.2.1", | 43 | "postcss-calc": "^5.2.1", |
@@ -38,8 +50,11 @@ | @@ -38,8 +50,11 @@ | ||
38 | "postcss-sprites": "^3.1.2", | 50 | "postcss-sprites": "^3.1.2", |
39 | "postcss-use": "^2.0.2", | 51 | "postcss-use": "^2.0.2", |
40 | "precss": "^1.4.0", | 52 | "precss": "^1.4.0", |
53 | + "stylelint": "^6.2.2", | ||
54 | + "stylelint-config-yoho": "^1.2.0", | ||
41 | "webpack": "^1.13.0", | 55 | "webpack": "^1.13.0", |
42 | "webpack-dev-server": "^1.14.1", | 56 | "webpack-dev-server": "^1.14.1", |
43 | - "webpack-stream": "^3.1.0" | 57 | + "webpack-stream": "^3.1.0", |
58 | + "shelljs": "^0.7.0" | ||
44 | } | 59 | } |
45 | } | 60 | } |
@@ -61,7 +61,7 @@ const postcssPlugin = (et) => { | @@ -61,7 +61,7 @@ const postcssPlugin = (et) => { | ||
61 | // assets & sprites config in both dev and pro | 61 | // assets & sprites config in both dev and pro |
62 | if (et === env.pro) { | 62 | if (et === env.pro) { |
63 | assets = { | 63 | assets = { |
64 | - loadPaths: [dist.img, dist.font], | 64 | + loadPaths: [dist.img, dist.font] |
65 | }; | 65 | }; |
66 | 66 | ||
67 | Object.assign(sprites, { | 67 | Object.assign(sprites, { |
@@ -80,7 +80,7 @@ const postcssPlugin = (et) => { | @@ -80,7 +80,7 @@ const postcssPlugin = (et) => { | ||
80 | stylesheetPath: 'css/', | 80 | stylesheetPath: 'css/', |
81 | spritePath: 'img/' | 81 | spritePath: 'img/' |
82 | }); | 82 | }); |
83 | - }; | 83 | + } |
84 | 84 | ||
85 | plugins = [ | 85 | plugins = [ |
86 | require('autoprefixer')({ | 86 | require('autoprefixer')({ |
@@ -92,7 +92,7 @@ const postcssPlugin = (et) => { | @@ -92,7 +92,7 @@ const postcssPlugin = (et) => { | ||
92 | require('postcss-calc'), | 92 | require('postcss-calc'), |
93 | require('postcss-opacity'), | 93 | require('postcss-opacity'), |
94 | 94 | ||
95 | - //可选 | 95 | + // 可选 |
96 | require('postcss-use')({ | 96 | require('postcss-use')({ |
97 | modules: ['postcss-clearfix', 'postcss-crip', 'postcss-short', 'postcss-center', 'postcss-position'] | 97 | modules: ['postcss-clearfix', 'postcss-crip', 'postcss-short', 'postcss-center', 'postcss-position'] |
98 | }) | 98 | }) |
@@ -145,7 +145,7 @@ gulp.task('img', () => { | @@ -145,7 +145,7 @@ gulp.task('img', () => { | ||
145 | .pipe(gulp.dest(dist.img)); | 145 | .pipe(gulp.dest(dist.img)); |
146 | }); | 146 | }); |
147 | 147 | ||
148 | -//copy font | 148 | +// copy font |
149 | gulp.task('font', () => { | 149 | gulp.task('font', () => { |
150 | return gulp.src('font/*') | 150 | return gulp.src('font/*') |
151 | .pipe(gulp.dest(dist.font)); | 151 | .pipe(gulp.dest(dist.font)); |
@@ -15,9 +15,9 @@ require('shelljs/global'); | @@ -15,9 +15,9 @@ require('shelljs/global'); | ||
15 | 15 | ||
16 | var entries = {}; | 16 | var entries = {}; |
17 | 17 | ||
18 | -//构建各模块子页面JS。生成规则module.page.js | 18 | +// 构建各模块子页面JS。生成规则module.page.js |
19 | ls(__dirname + '/js/**/*.page.js').forEach((f) => { | 19 | ls(__dirname + '/js/**/*.page.js').forEach((f) => { |
20 | - var dir = _.slice(f.split('/'), -2); //[modulename, xx.page.js] | 20 | + var dir = _.slice(f.split('/'), -2); // [modulename, xx.page.js] |
21 | 21 | ||
22 | // Important | 22 | // Important |
23 | // 生成规则:module.page: './js/module/xx.page.js' | 23 | // 生成规则:module.page: './js/module/xx.page.js' |
@@ -27,7 +27,7 @@ ls(__dirname + '/js/**/*.page.js').forEach((f) => { | @@ -27,7 +27,7 @@ ls(__dirname + '/js/**/*.page.js').forEach((f) => { | ||
27 | module.exports = { | 27 | module.exports = { |
28 | entry: entries, | 28 | entry: entries, |
29 | output: { | 29 | output: { |
30 | - path: path.join(__dirname, 'bundle'), //absolute path | 30 | + path: path.join(__dirname, 'bundle'), // absolute path |
31 | filename: '[name].js' | 31 | filename: '[name].js' |
32 | } | 32 | } |
33 | }; | 33 | }; |
-
Please register or login to post a comment