Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Added check-deps for automated dependencies updating from package.json. * Automated image minification.
- Loading branch information
Showing
24 changed files
with
301 additions
and
179 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,13 @@ | ||
[package.json] | ||
# http://editorconfig.org | ||
root = true | ||
|
||
[*] | ||
charset = utf-8 | ||
end_of_line = lf | ||
indent_size = 4 | ||
indent_style = space | ||
indent_size = 2 | ||
insert_final_newline = true | ||
trim_trailing_whitespace = true | ||
|
||
[*.md] | ||
trim_trailing_whitespace = false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
"5.11" | ||
"6.4.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,12 @@ | ||
### 2.0.0 (July 13, 2016) | ||
### 2.0.0 (July 1, 2017) | ||
|
||
* Updated normalize.scss to v4.1.1. | ||
* Added .nvmrc file for use with node version manager. Node 6.4.0 version is required. | ||
* Added .eslintrc file with eslint configuration + lodash, react plugins. | ||
* Updated Scss structure. | ||
* Added check-deps for automated dependencies updating from package.json. | ||
* Automated image minification. | ||
* Moved from scss-lint to sass-lint, fixed issues in code. | ||
* Added language tag in HTML. | ||
* Added gulp-accessibility task for automated accessibility testing. | ||
|
||
* Updated normalize.scss to v4.1.1 | ||
* Added .nvmrc file for use with node version manager. Node 5.11 version is required. | ||
* Added .eslintrc file with eslint configuration + lodash, react plugins |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
const gulp = require("gulp"); | ||
const rename = require("gulp-rename"); | ||
|
||
module.exports = function () { | ||
|
||
return gulp.src("./.pre-commit") | ||
.pipe(rename("pre-commit")) | ||
.pipe(gulp.dest("./.git/hooks")); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
module.exports = function (done) { | ||
let gulp = require("gulp"), | ||
runSequence = require("run-sequence").use(gulp); | ||
|
||
return runSequence( | ||
"check-deps", | ||
"prepare-assets", | ||
"prepare-config", | ||
"clear-image-cache", | ||
"watch-scss", | ||
"watch-svg", | ||
"watch-images-optimize", | ||
done | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
const gulp = require("gulp"); | ||
const eslint = require("gulp-eslint"); | ||
const config = require("../gulp.config.js")(); | ||
const _ = require("lodash"); | ||
const through = require("through2"); | ||
const sassLint = require("gulp-sass-lint"); | ||
const gulpif = require("gulp-if"); | ||
const es = require("event-stream"); | ||
const vinyl = require("vinyl-fs"); | ||
|
||
function replaceStreamWith() { | ||
let pass = through.obj(); | ||
return es.duplex(pass, vinyl.src.apply(vinyl.src, arguments)); | ||
} | ||
|
||
function makeEmptyStream() { | ||
return through.obj((a, b, cb) => cb(null)); | ||
} | ||
|
||
function lintCode(srcJs, srcSass) { | ||
return gulp.src(srcJs) | ||
.pipe(eslint()) | ||
.pipe(eslint.format()) | ||
.pipe(eslint.failAfterError()) | ||
.pipe(gulpif(!_.isEmpty(srcSass), replaceStreamWith(config.scss.lint), makeEmptyStream())) | ||
.pipe(sassLint()) | ||
.pipe(sassLint.format()) | ||
.pipe(sassLint.failOnError()); | ||
} | ||
|
||
function eslintCommit() { | ||
const execSync = require("child_process").execSync; | ||
const stdout = execSync("git diff --cached --name-only").toString() | ||
+ "\n" | ||
+ execSync("git diff --name-only").toString(); | ||
|
||
const resArray = stdout.split("\n"); | ||
|
||
const commitJsFiles = resArray | ||
.filter((line) => line.endsWith(".js")) | ||
.filter((line) => { | ||
return _.reduce(config.custom.foldersToLint, (res, curr) => res || line.startsWith(curr), false); | ||
}); | ||
|
||
const commitScssFiles = _(resArray).filter((line) => line.endsWith(".scss")).value(); | ||
|
||
|
||
if (commitJsFiles.length > 0 || commitScssFiles.length > 0) { | ||
return lintCode(commitJsFiles, commitScssFiles); | ||
} | ||
} | ||
|
||
module.exports = function () { | ||
return eslintCommit(); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
const gulp = require("gulp"); | ||
const eslint = require("gulp-eslint"); | ||
const config = require("../gulp.config.js")(); | ||
const _ = require("lodash"); | ||
|
||
module.exports = function () { | ||
|
||
return gulp.src(_.map(config.custom.foldersToLint, (folder) => `${folder}/**/*.js`)) | ||
.pipe(eslint()) | ||
.pipe(eslint.format()) | ||
.pipe(eslint.failAfterError()); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = function (done) { | ||
var gulp = require('gulp'), | ||
runSequence = require('run-sequence'), | ||
config = require('../gulp.config.js')(); | ||
|
||
return runSequence('image-optimization', | ||
'create-svg-sprite', | ||
'scss-linting', | ||
'compile-scss', | ||
done); | ||
}; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module.exports = function () { | ||
const gulp = require("gulp"), | ||
config = require("../gulp.config.js")(), | ||
rename = require("gulp-rename"); | ||
|
||
return gulp.src(config.environmentConfig.source) | ||
.pipe(rename("env.js")) | ||
.pipe(gulp.dest(config.path.DEST)); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
|
||
module.exports = function (done) { | ||
let gulp = require("gulp"), | ||
runSequence = require("run-sequence").use(gulp); | ||
|
||
return runSequence( | ||
"check-deps", | ||
"prepare-assets", | ||
"prepare-config", | ||
"clear-image-cache", | ||
done | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,13 @@ | ||
module.exports = function () { | ||
var scsslint = require('gulp-scss-lint'), | ||
var sassLint = require('gulp-sass-lint'), | ||
gulp = require('gulp'), | ||
gulpif = require('gulp-if'), | ||
argv = require('yargs').argv, | ||
config = require('../gulp.config.js')(); | ||
|
||
return gulp.src(['./scss/**/*.scss', '!./scss/**/*_scsslint_tmp*.scss', '!./scss/vendor/**/*.scss', '!./scss/base/_svg-sprite-map.scss', '!./scss/base/_svg-sprite-template.scss']) | ||
.pipe(gulpif(!argv.nolint, scsslint())); | ||
return gulp.src(config.scss.lint) | ||
.pipe(gulpif(!argv.nolint, sassLint())) | ||
.pipe(sassLint.format()) | ||
.pipe(sassLint.failOnError()); | ||
}; | ||
|
||
|
File renamed without changes.
2 changes: 1 addition & 1 deletion
2
gulp-tasks/watchers/watch-images-optimize.js → gulp-tasks/watch-images-optimize.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
module.exports = function () { | ||
var gulp = require('gulp'), | ||
config = require('../../gulp.config.js')(); | ||
config = require('../gulp.config.js')(); | ||
gulp.watch(config.scss.src, ['compile-scss', 'scss-linting']); | ||
|
||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.