Skip to content

Commit

Permalink
removed 3-rd party library (Foundation, fonts) from source
Browse files Browse the repository at this point in the history
    Now 3-rd party library download and build by bower and gulp.
  • Loading branch information
Arkadiusz Adamski committed Jun 18, 2015
1 parent 258d4b1 commit e56d92c
Show file tree
Hide file tree
Showing 41 changed files with 954 additions and 24,358 deletions.
8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ vagrant/.vagrant
# mkdocs
site/

# Javascript
# Static files
bower_components/
node_modules/
src/ralph/admin/static/css/normalize.css
src/ralph/admin/static/js/vendor/
src/ralph/dc_view/static/js/vendor/
src/ralph/static/css/
src/ralph/static/vendor/
src/ralph/var/
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ clean:
find . -name '*.py[cod]' -exec rm -rf {} \;

coverage: clean
coverage run '$(VIRTUAL_ENV)/bin/test_ralph' test ralph
coverage run '$(VIRTUAL_ENV)/bin/test_ralph' test ralph --settings="ralph.settings.test"
coverage report

docs:
Expand Down
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@
],
"dependencies": {
"fontawesome": "~4.3.0",
"normalize.css": "~3.0.3",
"fastclick": "~1.0.6",
"jquery.cookie": "~1.4.1",
"jquery": "~2.1.4",
"jquery-placeholder": "~2.1.1",
"modernizr": "~2.8.3",
"angular-cookies": "~1.4.0",
"angular-latest": "~1.4.0",
"angular-resource": "~1.4.0",
"angular-route": "~1.4.0",
"angular-ui-router": "~0.2.15",
"angular-breadcrumb": "~0.4.0"
"angular-breadcrumb": "~0.4.0",
"foundation": "~5.5.2",
"foundation-datepicker": "~1.3.0"
}
}
58 changes: 36 additions & 22 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,42 +1,65 @@
var gulp = require('gulp');
less = require('gulp-less'),
watch = require('gulp-watch'),
runSequence = require('run-sequence'),
rename = require('gulp-rename'),
bower = require('gulp-bower');
bower = require('gulp-bower'),
prefixer = require('gulp-autoprefixer'),
sass = require('gulp-sass');

var config = {
bowerDir: './bower_components',
dstRoot: 'src/ralph/admin/static/'
bowerDir: './bower_components/',
srcRoot: 'src/ralph/static/src/',
staticRoot: 'src/ralph/static/',
vendorRoot: 'src/ralph/static/vendor/'
}

var sass_config = {
includePaths: [
config.bowerDir + 'foundation/scss',
config.bowerDir + 'fontawesome/scss',
]
}

gulp.task('bower', function() {
return bower()
.pipe(gulp.dest(config.bowerDir))
});

gulp.task('scss', function() {
gulp.src(config.srcRoot + 'scss/*.scss')
.pipe(sass(sass_config).on('error', sass.logError))
.pipe(prefixer())
.pipe(gulp.dest(config.staticRoot + 'css/'))
});

gulp.task('css', function() {
return gulp.src('bower_components/normalize.css/normalize.css')
.pipe(gulp.dest(config.dstRoot + '/css'));
var vendorFiles = [
'bower_components/normalize.css/normalize.css',
'bower_components/foundation-datepicker/stylesheets/foundation-datepicker.css'
];
return gulp.src(vendorFiles)
.pipe(gulp.dest(config.vendorRoot + 'css/'));
});

gulp.task('fonts', function() {
return gulp.src('bower_components/fontawesome/fonts/*.*')
.pipe(gulp.dest(config.dstRoot + '/fonts'));
.pipe(gulp.dest(config.vendorRoot + 'fonts/'));
});

gulp.task('vendors', function(){
gulp.task('js', function(){
var vendorFiles = [
'./bower_components/fastclick/lib/fastclick.js',
'./bower_components/jquery.cookie/jquery.cookie.js',
'./bower_components/jquery/dist/jquery.js',
'./bower_components/modernizr/modernizr.js',
'./bower_components/foundation/js/foundation.min.js',
'./bower_components/foundation-datepicker/js/foundation-datepicker.js',
];
gulp.src(vendorFiles)
.pipe(gulp.dest(config.dstRoot + 'js/vendor'));
.pipe(gulp.dest(config.vendorRoot + 'js/'));
gulp.src('./bower_components/jquery-placeholder/jquery.placeholder.js')
.pipe(rename('placeholder.js'))
.pipe(gulp.dest(config.dstRoot + 'js/vendor'));
.pipe(gulp.dest(config.vendorRoot + 'js'));

var angularFiles = [
'./bower_components/angular-breadcrumb/dist/angular-breadcrumb.min.js',
Expand All @@ -47,24 +70,15 @@ gulp.task('vendors', function(){
'./bower_components/angular-ui-router/release/angular-ui-router.min.js',
]
gulp.src(angularFiles)
.pipe(gulp.dest('src/ralph/dc_view/static/js/vendor'));
});

var lessDir = './src/ralph/dc_view/static/css/'
gulp.task('less', function() {
var lessFilesButNoUnderscoreAtBeginning = '[!_]*.less';
return gulp.src(lessDir + lessFilesButNoUnderscoreAtBeginning)
.pipe(less())
.on('error', console.error.bind(console))
.pipe(gulp.dest(lessDir));
.pipe(gulp.dest(config.vendorRoot + 'js'));
});

gulp.task('watch', function() {
gulp.watch(lessDir + '*.less', ['less']);
gulp.watch(config.srcRoot + 'scss/**/*.scss', ['scss']);
});

gulp.task('dev', function(callback) {
runSequence('bower', 'css', 'fonts', 'vendors', 'less', callback);
runSequence('bower', 'css', 'fonts', 'js', 'scss', callback);
});

gulp.task('default', ['dev']);
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
"gulp-rename": "~1.2.2",
"gulp-watch": "~4.2.4",
"gulp-less": "~3.0.3",
"run-sequence": "~1.1.0"
"run-sequence": "~1.1.0",
"gulp-sass": "~2.0.1",
"gulp-autoprefixer": "~2.3.1"
}
}
20 changes: 0 additions & 20 deletions src/ralph/admin/static/css/foundation-datepicker.css

This file was deleted.

Loading

0 comments on commit e56d92c

Please sign in to comment.