Skip to content

Commit

Permalink
Various bugfixes and style improvements
Browse files Browse the repository at this point in the history
Fixed a few errors when generating the tests so that JSCS didn't
properly catch styling errors. Fixed that and updated the various files
to comply with the changes.
  • Loading branch information
sondr3 committed Jul 2, 2015
1 parent 6b5f70c commit f945311
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 26 deletions.
11 changes: 4 additions & 7 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,9 @@ module.exports = generators.Base.extend({
type: Boolean
});

this.composeWith('generator-mocha' + ':app', {
options: {
'skip-install': this.options['skip-install']
}
}, {
local: require.resolve('generator-mocha/generators/app/index.js')
this.option('skip-install', {
desc: 'Skip installing dependencies',
type: Boolean
});
},

Expand Down Expand Up @@ -162,7 +159,7 @@ module.exports = generators.Base.extend({
},

installing: function() {
if(!this.options['skip-install']) {
if (!this.options['skip-install']) {
this.npmInstall();
this.spawnCommand('bundle', ['install']);
}
Expand Down
3 changes: 2 additions & 1 deletion generators/boilerplate/templates/jscsrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
{
"preset": "google"
"preset": "google",
"esnext": true
}
26 changes: 16 additions & 10 deletions generators/gulp/templates/gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,19 @@ const wiredep = wiredeps.stream;
import bowerFiles from 'main-bower-files';

// Deletes the directory that the optimized site is output to
gulp.task('clean:dist', done => { trash(['dist']); done(); });
gulp.task('clean:assets', done => { trash(['.tmp']); done(); });
gulp.task('clean:metadata', done => { trash(['src/.jekyll-metadata']); done(); });
gulp.task('clean:dist', cb => { trash(['dist']); cb(); });
gulp.task('clean:assets', cb => { trash(['.tmp']); cb(); });
gulp.task('clean:metadata', cb => { trash(['src/.jekyll-metadata']); cb(); });

// Tasks for building Jekyll, either with development settings (drafts etc) or
// with production settings
gulp.task('jekyll:dev', done => { shell.exec('jekyll build --quiet'); done(); });
gulp.task('jekyll:prod', done => {
gulp.task('jekyll:dev', cb => {
shell.exec('jekyll build --quiet');
cb();
});
gulp.task('jekyll:prod', cb => {
shell.exec('jekyll build --quiet --config _config.yml,_config.build.yml');
done();
cb();
});

// Compiles the SASS files and moves them into the 'assets/stylesheets' directory
Expand Down Expand Up @@ -123,10 +126,12 @@ gulp.task('bower', () => {
html: {
replace: {
js: filePath => {
return '<script src="' + '/assets/vendor/' + filePath.split('/').pop() + '"></script>';
return '<script src="' + '/assets/vendor/' +
filePath.split('/').pop() + '"></script>';
},
css: filePath => {
return '<link rel="stylesheet" href="' + '/assets/vendor/' + filePath.split('/').pop() + '"/>';
return '<link rel="stylesheet" href="' + '/assets/vendor/' +
filePath.split('/').pop() + '"/>';
}
}
}
Expand Down Expand Up @@ -281,7 +286,7 @@ gulp.task('jslint', () => {

// Runs 'jekyll doctor' on your site to check for errors with your configuration
// and will check for URL errors a well
gulp.task('doctor', done => { shell.exec('jekyll doctor'); done(); });
gulp.task('doctor', cb => { shell.exec('jekyll doctor'); cb(); });

// BrowserSync will serve our site on a local server for us and other devices to use
// It will also autoreload across all devices as well as keep the viewport synchronized
Expand Down Expand Up @@ -328,7 +333,8 @@ gulp.task('build', gulp.series(
));

// Clean out your dist and .tmp folder and delete .jekyll-metadata
gulp.task('rebuild', gulp.series('clean:dist', 'clean:assets', 'clean:metadata'));
gulp.task('rebuild', gulp.series('clean:dist', 'clean:assets',
'clean:metadata'));

// Checks your CSS, JS and Jekyll for errors
gulp.task('check', gulp.series('doctor', 'jslint'));
7 changes: 2 additions & 5 deletions gulpfile.babel.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,11 @@ const handleErr = err => {
gulp.task('check', () => {
return gulp.src([
'test/*.js',
'test/tmp/**/*.js',
'test/tmp/**/gulpfile.babel.js',
'generators/**/index.js',
'gulpfile.babel.js'
])
.pipe(jscs({
esnext: true,
excludeFiles: ['app/test/*', 'build/test/*']
}))
.pipe(jscs())
.pipe(jshint('.jshintrc'))
.pipe(jshint.reporter('jshint-stylish'))
.pipe(jshint.reporter('fail'))
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"repository": "sondr3/generator-jekyllized",
"license": "MIT",
"scripts": {
"test": "gulp istanbul && gulp"
"test": "gulp test && gulp"
},
"files": [
"index.js",
Expand All @@ -23,7 +23,7 @@
"dependencies": {
"chalk": "^1.1.0",
"globule": "^0.2.0",
"lodash": "^3.9.3",
"lodash": "^3.10.0",
"shelljs": "^0.5.1",
"yeoman-generator": "^0.20.1",
"yosay": "^1.0.4"
Expand All @@ -44,7 +44,6 @@
"istanbul": "^0.3.17",
"jshint": "^2.8.0",
"jshint-stylish": "^2.0.1",
"lodash": "^3.10.0",
"mocha": "^2.2.5",
"mocha-lcov-reporter": "^0.0.2",
"trash": "^1.4.1",
Expand Down

0 comments on commit f945311

Please sign in to comment.