From bf2947c8674c6ec4f3d0795030e357d02995ca6e Mon Sep 17 00:00:00 2001 From: Evgeniy Negometyanov Date: Thu, 12 Nov 2015 15:44:46 +0200 Subject: [PATCH] Fixes in gulpfile and readme --- .travis.yml | 2 +- README.rst | 17 ++++++++++------- gulpfile.js | 30 ++++++++++++++++-------------- 3 files changed, 27 insertions(+), 22 deletions(-) diff --git a/.travis.yml b/.travis.yml index a1e9b3f56..31fb8af0c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -29,7 +29,7 @@ env: - DJANGO="https://github.com/django/django/archive/master.zip" EASY_THUMBNAILS="easy-thumbnails>2.0" script: - - if [[ $TRAVIS_PYTHON_VERSION = "2.6" && $FRONTEND = "true" ]]; then gulp ci; else coverage run --rcfile=coverage.rc test_settings.py; fi; + - if [[ $TRAVIS_PYTHON_VERSION = "2.6" && $FRONTEND = "true" ]]; then gulp lint; else coverage run --rcfile=coverage.rc test_settings.py; fi; after_success: - coveralls --config_file=coverage.rc diff --git a/README.rst b/README.rst index 47f8332ee..80110ff65 100644 --- a/README.rst +++ b/README.rst @@ -79,29 +79,32 @@ To started development fron-end part of ``django-filer`` simply install all the ``npm install`` +To compile and watch scss and run jshint and jscs watchers: +``gulp`` + To compile scss to css: -``gulp scss`` or ``gulp compile`` +``gulp sass`` -To run scss watcher: +To run sass watcher: -``gulp scss:watch`` +``gulp sass:watch`` To run javascript linting and code styling analysis: -``gulp ci`` +``gulp lint`` To run javascript linting and code styling analysis watcher: -``gulp js:watch`` +``gulp lint:watch`` To run javascript linting: -``gulp lint`` +``gulp jshint`` To run javascript linter watcher: -``gulp lint:watch`` +``gulp jshint:watch`` To run javascript code style analysis: diff --git a/gulpfile.js b/gulpfile.js index 2a8299923..97edd23c6 100755 --- a/gulpfile.js +++ b/gulpfile.js @@ -10,13 +10,13 @@ var stylish = require('jshint-stylish'); var PROJECT_ROOT = __dirname; var PROJECT_PATH = { - 'scss': PROJECT_ROOT + '/filer/private/sass/', + 'sass': PROJECT_ROOT + '/filer/private/sass/', 'css': PROJECT_ROOT + '/filer/static/filer/css/', 'js': PROJECT_ROOT + '/filer/static/filer/js/' }; var PROJECT_PATTERNS = { - 'scss': PROJECT_PATH.scss + '**/*.scss', + 'sass': PROJECT_PATH.sass + '**/*.scss', 'lint': [ PROJECT_PATH.js + '**/*.js', PROJECT_ROOT + '/gulpfile.js' @@ -24,9 +24,9 @@ var PROJECT_PATTERNS = { }; // ############################################################################# -// SCSS -gulp.task('scss', function () { - gulp.src(PROJECT_PATTERNS.scss) +// sass +gulp.task('sass', function () { + gulp.src(PROJECT_PATTERNS.sass) .pipe(sourcemaps.init()) .pipe(sass({outputStyle: 'compressed'}).on('error', sass.logError)) .pipe(autoprefixer('last 2 version', 'safari 5', 'ie 8', 'ie 9', 'opera 12.1', 'ios 6', 'android 4')) @@ -34,8 +34,8 @@ gulp.task('scss', function () { .pipe(gulp.dest(PROJECT_PATH.css)); }); -gulp.task('scss:watch', function () { - gulp.watch(PROJECT_PATTERNS.scss, ['scss']); +gulp.task('sass:watch', function () { + gulp.watch(PROJECT_PATTERNS.sass, ['sass']); }); // ############################################################################# @@ -57,21 +57,23 @@ gulp.task('jscs:watch', function () { gulp.watch(PROJECT_PATTERNS.lint, ['jscs']); }); -gulp.task('lint', function () { +gulp.task('jshint', function () { return gulp.src(PROJECT_PATTERNS.lint) .pipe(jshint('.jshintrc')) .pipe(jshint.reporter(stylish)) .pipe(jshint.reporter('fail')); }); -gulp.task('lint:watch', function () { - gulp.watch(PROJECT_PATTERNS.lint, ['lint']); +gulp.task('jshint:watch', function () { + gulp.watch(PROJECT_PATTERNS.lint, ['jshint']); }); +gulp.task('js', ['jshint', 'jscs']); + gulp.task('js:watch', function () { - gulp.watch(PROJECT_PATTERNS.lint, ['lint', 'jscs']); + gulp.watch(PROJECT_PATTERNS.lint, ['js']); }); -gulp.task('compile', ['scss']); -gulp.task('watch', ['scss:watch', 'lint:watch']); -gulp.task('ci', ['lint', 'jscs']); +gulp.task('watch', ['sass:watch', 'js:watch']); +gulp.task('lint', ['js']); +gulp.task('default', ['js', 'sass', 'js:watch', 'sass:watch']);