Skip to content

Commit b498e81

Browse files
merge
2 parents f2ba262 + 6aa630d commit b498e81

Some content is hidden

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

64 files changed

+2437
-4864
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,4 +31,5 @@ node_modules
3131

3232
# Other
3333
npm-debug.log
34-
.idea
34+
.idea
35+
generators/app/templates/gulp_old/

generators/app/index.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,10 @@ module.exports = class extends Generator {
4141

4242
install () {
4343
if (this.props.install) {
44-
this.installDependencies();
44+
this.installDependencies({
45+
bower: false,
46+
npm: true
47+
});
4548
} else {
4649
this.log('Run ' + chalk.blue('npm install') + ' to install dependencies later');
4750
}

generators/app/prompts.js

Lines changed: 49 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -16,18 +16,22 @@ module.exports = [
1616
name: 'Nunjucks',
1717
value: 'nunjucks'
1818
},
19+
// {
20+
// name: 'Swig',
21+
// value: 'swig'
22+
// },
23+
// {
24+
// name: 'Jade',
25+
// value: 'jade'
26+
// },
1927
{
20-
name: 'Swig',
21-
value: 'swig'
28+
name: 'Pug',
29+
value: 'pug'
2230
},
23-
{
24-
name: 'Jade',
25-
value: 'jade'
26-
},
27-
{
28-
name: 'No templates, just pure html',
29-
value: 'html'
30-
}
31+
// {
32+
// name: 'No templates, just pure html',
33+
// value: 'html'
34+
// }
3135
],
3236
default: 0
3337
},
@@ -40,28 +44,28 @@ module.exports = [
4044
name: 'Sass + PostCSS',
4145
value: 'sass'
4246
},
43-
{
44-
name: 'PostCSS (with SugarSS and Stylelint)',
45-
value: 'postcss'
46-
}
47+
// {
48+
// name: 'PostCSS (with SugarSS and Stylelint)',
49+
// value: 'postcss'
50+
// }
4751
],
4852
default: 0
4953
},
50-
{
51-
type: 'list',
52-
name: 'bundler',
53-
message: 'Choose js modules bundler',
54-
choices: [
55-
{
56-
name: 'Webpack',
57-
value: 'webpack'
58-
},
59-
{
60-
name: 'I will merge files manually.',
61-
value: 'manually'
62-
}
63-
]
64-
},
54+
// {
55+
// type: 'list',
56+
// name: 'bundler',
57+
// message: 'Choose js modules bundler',
58+
// choices: [
59+
// {
60+
// name: 'Webpack',
61+
// value: 'webpack'
62+
// },
63+
// {
64+
// name: 'I will merge files manually.',
65+
// value: 'manually'
66+
// }
67+
// ]
68+
// },
6569
{
6670
type: 'checkbox',
6771
name: 'sprites',
@@ -72,16 +76,16 @@ module.exports = [
7276
value: 'svg',
7377
checked: true
7478
},
75-
{
76-
name: 'Iconfonts',
77-
value: 'iconfont',
78-
checked: false
79-
},
80-
{
81-
name: 'PNG sprites',
82-
value: 'png',
83-
checked: false
84-
}
79+
// {
80+
// name: 'Iconfonts',
81+
// value: 'iconfont',
82+
// checked: false
83+
// },
84+
// {
85+
// name: 'PNG sprites',
86+
// value: 'png',
87+
// checked: false
88+
// }
8589
]
8690
},
8791
{
@@ -90,6 +94,12 @@ module.exports = [
9094
message: 'Use SVGO for svg optimization?',
9195
default: true
9296
},
97+
{
98+
type: 'confirm',
99+
name: 'preview',
100+
message: 'Make preview page with all htmls',
101+
default: true
102+
},
93103
{
94104
type: 'confirm',
95105
name: 'install',

generators/app/templates/eslintrc

Lines changed: 8 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -2,31 +2,15 @@
22
"parser": "babel-eslint",
33
"env": {
44
"browser": true,
5-
"node": true
5+
"node": true,
6+
"jquery": true
67
},
8+
"plugins": [
9+
"dollar-sign"
10+
],
11+
"extends": ["airbnb-base", "prettier"],
712
"rules": {
8-
"no-undef": 1,
9-
"no-unused-vars": 1,
10-
"eqeqeq": [2, "smart"],
11-
"no-floating-decimal": 2,
12-
"no-multi-spaces": [2, {
13-
"exceptions": {
14-
"ImportDeclaration": true,
15-
"VariableDeclarator": true
16-
}
17-
}],
18-
"no-multi-str": 2,
19-
"camelcase": 1,
20-
"eol-last": 1,
21-
"indent": [2, 2, {
22-
"SwitchCase": 1,
23-
"VariableDeclarator": 1
24-
}],
25-
"quotes": [2, "single", "avoid-escape"],
26-
"semi": [2, "always"],
27-
"space-before-blocks": 2,
28-
"space-before-function-paren": [2, "never"],
29-
"constructor-super": 2,
30-
"arrow-spacing": 2
13+
"dollar-sign/dollar-sign": [2, "ignoreProperties"],
14+
"no-plusplus": ["error", { "allowForLoopAfterthoughts": true }]
3115
}
3216
}

generators/app/templates/gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
*.swp
99
*.zip
1010
*.vi
11+
*.map
1112
*~
1213

1314
# OS or Editor folders

generators/app/templates/gulp/config.js

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
var util = require('gulp-util');
1+
import util from 'gulp-util';
22

3-
var production = util.env.production || util.env.prod || false;
4-
var destPath = 'build';
3+
const production = util.env.production || util.env.prod || false;
4+
const destPath = 'build';
55

6-
var config = {
6+
const config = {
77
env : 'development',
88
production: production,
99

@@ -41,16 +41,16 @@ var config = {
4141
},
4242

4343
setEnv: function(env) {
44-
if (typeof env !== 'string') return;
45-
this.env = env;
46-
this.production = env === 'production';
47-
process.env.NODE_ENV = env;
44+
if (typeof env !== 'string') return;
45+
this.env = env;
46+
this.production = env === 'production';
47+
process.env.NODE_ENV = env;
4848
},
4949

5050
logEnv: function() {
5151
util.log(
52-
'Environment:',
53-
util.colors.white.bgRed(' ' + process.env.NODE_ENV + ' ')
52+
'Environment:',
53+
util.colors.white.bgRed(' ' + process.env.NODE_ENV + ' ')
5454
);
5555
},
5656

generators/app/templates/gulp/tasks/browserify.js

Lines changed: 0 additions & 57 deletions
This file was deleted.

generators/app/templates/gulp/tasks/build.js

Lines changed: 0 additions & 36 deletions
This file was deleted.
Lines changed: 12 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
var gulp = require('gulp');
2-
var del = require('del');
3-
var util = require('gulp-util');
4-
var config = require('../config');
1+
import del from 'del';
2+
import util from 'gulp-util';
3+
import config from '../config';
54

6-
gulp.task('clean', function(cb) {
5+
const build = () => {
6+
return function () {
77
return del([
8-
config.dest.root
9-
]).then(function(paths) {
10-
util.log('Deleted:', util.colors.magenta(paths.join('\n')));
11-
});
12-
});
8+
config.dest.root
9+
])
10+
.then(paths => util.log('Deleted:', util.colors.magenta(paths.join('\n'))))
11+
};
12+
};
13+
14+
module.exports.build = build;

0 commit comments

Comments
 (0)