Skip to content

Commit 3a2cc26

Browse files
committed
ES2015, Travis and Syntax changes
Updates a few things to be ES2015 and removed the dependency for Babel for the gulpfile, removed ESlint and moved to XO as we already used their settings, renamed the Gulpfile back to good ol' gulpfile.js and fixed some warnings for the JS. Also updated what versions to use for Travis.
1 parent 96374df commit 3a2cc26

File tree

5 files changed

+31
-39
lines changed

5 files changed

+31
-39
lines changed

.travis.yml

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,9 @@
11
language: node_js
22
sudo: false
33
node_js:
4-
- "4"
5-
- "stable"
4+
- "6"
5+
- "5"
6+
- "4"
67
after_script:
78
- CODECLIMATE_REPO_TOKEN=7b0cbee1382c968a036868d26ec04d0ddc7b7aeef25ceead5ff9ff50a3c2ae8b codeclimate < coverage/lcov.info
89
- rm -rf ./coverage
9-
notifications:
10-
email:
11-
on_success: change
12-
on_failure: change

generators/gulp/templates/gulpfile.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
'use strict';
22

3+
<% if (amazonS3 || rsync) { -%>
4+
// 'fs' is used to read files from the system (used for uploading)
5+
const fs = require('fs');
6+
<% } -%>
37
const gulp = require('gulp');
48
// Loads the plugins without having to list all of them, but you need
59
// to call them as $.pluginname
@@ -9,10 +13,6 @@ const $ = gulpLoadPlugins();
913
const del = require('del');
1014
// Used to run shell commands
1115
const shell = require('shelljs');
12-
<% if (amazonS3 || rsync) { -%>
13-
// 'fs' is used to read files from the system (used for uploading)
14-
const fs = require('fs');
15-
<% } -%>
1616
<% if (amazonS3) { -%>
1717
// Parallelize the uploads when uploading to Amazon S3
1818
const parallelize = require('concurrent-transform');

gulpfile.babel.js renamed to gulpfile.js

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,11 @@
11
'use strict';
22

3-
import coveralls from 'gulp-coveralls';
4-
import gulp from 'gulp';
5-
import istanbul from 'gulp-istanbul';
6-
import eslint from 'gulp-eslint';
7-
import mocha from 'gulp-mocha';
8-
import path from 'path';
9-
import del from 'del';
10-
11-
gulp.task('check', () =>
12-
gulp.src([
13-
'gulpfile.babel.js',
14-
'test/*.js',
15-
'test/tmp/**/gulpfile.babel.js',
16-
'generators/**/index.js'
17-
])
18-
.pipe(eslint())
19-
.pipe(eslint.formatEach())
20-
.pipe(eslint.failOnError())
21-
);
3+
const path = require('path');
4+
const gulp = require('gulp');
5+
const coveralls = require('gulp-coveralls');
6+
const istanbul = require('gulp-istanbul');
7+
const mocha = require('gulp-mocha');
8+
const del = require('del');
229

2310
gulp.task('istanbul', done =>
2411
gulp.src([
@@ -48,4 +35,4 @@ gulp.task('coveralls', () => {
4835
});
4936

5037
gulp.task('test', gulp.series('clean', 'istanbul'));
51-
gulp.task('default', gulp.series('check', 'coveralls'));
38+
gulp.task('default', gulp.series('coveralls'));

package.json

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
"repository": "sondr3/generator-jekyllized",
1414
"license": "MIT",
1515
"scripts": {
16-
"test": "gulp test && gulp"
16+
"test": "xo && gulp test && gulp"
1717
},
1818
"files": [
1919
"index.js",
@@ -29,27 +29,35 @@
2929
"yosay": "^1.1.1"
3030
},
3131
"devDependencies": {
32-
"babel-core": "^6.7.7",
33-
"babel-eslint": "^6.0.3",
34-
"babel-preset-es2015": "^6.6.0",
3532
"codeclimate-test-reporter": "^0.3.1",
3633
"coveralls": "^2.11.6",
3734
"del": "^2.2.0",
38-
"eslint": "^2.8.0",
39-
"eslint-config-xo": "^0.13.0",
40-
"eslint-config-xo-space": "^0.12.0",
4135
"generator-mocha": "^0.3.0",
4236
"gulp": "git://github.com/gulpjs/gulp.git#4.0",
4337
"gulp-coveralls": "^0.1.4",
44-
"gulp-eslint": "^2.0.0",
4538
"gulp-istanbul": "^0.10.4",
4639
"gulp-load-plugins": "^1.2.2",
4740
"gulp-mocha": "^2.2.0",
4841
"istanbul": "^0.4.3",
4942
"mocha": "^2.4.5",
5043
"mocha-lcov-reporter": "^1.2.0",
44+
"xo": "^0.15.1",
5145
"yeoman-assert": "^2.2.1",
5246
"yeoman-test": "^1.1.0",
5347
"yo": "^1.7.0"
48+
},
49+
"xo": {
50+
"space": true,
51+
"globals": [
52+
"describe",
53+
"before",
54+
"it"
55+
],
56+
"ignores": [
57+
"generators/app/templates/**",
58+
"generators/boilerplate/templates/**",
59+
"generators/gulp/templates/**",
60+
"generators/jekyll/templates/**"
61+
]
5462
}
5563
}

test/app.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
'use strict';
22

3-
var _ = require('lodash');
43
var path = require('path');
4+
var _ = require('lodash');
55
var assert = require('yeoman-assert');
66
var helpers = require('yeoman-test');
77

0 commit comments

Comments
 (0)