Skip to content

Commit

Permalink
Fixes in gulpfile and readme
Browse files Browse the repository at this point in the history
  • Loading branch information
Evgeniy Negometyanov committed Nov 12, 2015
1 parent 3bd58c7 commit bf2947c
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 22 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 10 additions & 7 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand Down
30 changes: 16 additions & 14 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,32 +10,32 @@ 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'
]
};

// #############################################################################
// 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'))
.pipe(sourcemaps.write('/maps'))
.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']);
});

// #############################################################################
Expand All @@ -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']);

0 comments on commit bf2947c

Please sign in to comment.