Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions dist/schema-form.js
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ angular.module('schemaForm').provider('sfPath',
this.parse = ObjectPath.parse;
this.stringify = ObjectPath.stringify;
this.normalize = ObjectPath.normalize;
this.$get = function () {
this.$get = function() {
return ObjectPath;
};
}]);
Expand All @@ -55,7 +55,7 @@ angular.module('schemaForm').provider('sfPath',
* @kind function
*
*/
angular.module('schemaForm').factory('sfSelect', ['sfPath', function (sfPath) {
angular.module('schemaForm').factory('sfSelect', ['sfPath', function(sfPath) {
var numRe = /^\d+$/;

/**
Expand Down
7 changes: 7 additions & 0 deletions gulp/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var fs = require('fs'),
tasks = fs.readdirSync('./gulp/tasks'),
gulp = require('gulp');

tasks.forEach(function(task) {
require('./tasks/' + task);
});
29 changes: 29 additions & 0 deletions gulp/tasks/bootstrap-datepicker.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var gulp = require('gulp'),
streamqueue = require('streamqueue'),
minifyHtml = require('gulp-minify-html'),
templateCache = require('gulp-angular-templatecache'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');

gulp.task('bootstrap-datepicker', function() {
var stream = streamqueue({objectMode: true});
stream.queue(
gulp.src('./src/directives/decorators/bootstrap/datepicker/*.html')
.pipe(minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(templateCache({
module: 'schemaForm',
root: 'directives/decorators/bootstrap/datepicker/'
}))
);
stream.queue(gulp.src('./src/directives/decorators/bootstrap/datepicker/*.js'));

stream.done()
.pipe(concat('bootstrap-datepicker.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));

});
29 changes: 29 additions & 0 deletions gulp/tasks/bootstrap.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
var gulp = require('gulp'),
streamqueue = require('streamqueue'),
minifyHtml = require('gulp-minify-html'),
templateCache = require('gulp-angular-templatecache'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');

gulp.task('bootstrap', function() {
var stream = streamqueue({objectMode: true});
stream.queue(
gulp.src('./src/directives/decorators/bootstrap/*.html')
.pipe(minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(templateCache({
module: 'schemaForm',
root: 'directives/decorators/bootstrap/'
}))
);
stream.queue(gulp.src('./src/directives/decorators/bootstrap/*.js'));

stream.done()
.pipe(concat('bootstrap-decorator.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));

});
8 changes: 8 additions & 0 deletions gulp/tasks/default.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
var gulp = require('gulp');

gulp.task('default', [
'minify',
'bootstrap',
'bootstrap-datepicker',
'non-minified-dist'
]);
7 changes: 7 additions & 0 deletions gulp/tasks/jscs.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
var gulp = require('gulp'),
jscs = require('gulp-jscs');

gulp.task('jscs', function() {
gulp.src('./src/**/*.js')
.pipe(jscs());
});
15 changes: 15 additions & 0 deletions gulp/tasks/minify.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
var gulp = require('gulp'),
concat = require('gulp-concat'),
uglify = require('gulp-uglify');

gulp.task('minify', function() {
gulp.src([
'./src/module.js',
'./src/sfPath.js',
'./src/services/*.js',
'./src/directives/*.js'
])
.pipe(concat('schema-form.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));
});
13 changes: 13 additions & 0 deletions gulp/tasks/non-minified-dist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
var gulp = require('gulp'),
concat = require('gulp-concat');

gulp.task('non-minified-dist', function() {
gulp.src([
'./src/module.js',
'./src/sfPath.js',
'./src/services/*.js',
'./src/directives/*.js'
])
.pipe(concat('schema-form.js'))
.pipe(gulp.dest('./dist/'));
});
5 changes: 5 additions & 0 deletions gulp/tasks/watch.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
var gulp = require('gulp');

gulp.task('watch', function() {
gulp.watch('./src/**/*', ['default']);
});
99 changes: 3 additions & 96 deletions gulpfile.js
Original file line number Diff line number Diff line change
@@ -1,97 +1,4 @@
/* global require */
//all of the tasks themselves are contained in the gulp/tasks directory,
//which is accessed through gulp/index.js

var gulp = require('gulp');

var templateCache = require('gulp-angular-templatecache');
var minifyHtml = require('gulp-minify-html');
var concat = require('gulp-concat');
var uglify = require('gulp-uglify');
var streamqueue = require('streamqueue');
var jscs = require('gulp-jscs');



gulp.task('bootstrap', function() {
var stream = streamqueue({objectMode: true});
stream.queue(
gulp.src('./src/directives/decorators/bootstrap/*.html')
.pipe(minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(templateCache({
module: 'schemaForm',
root: 'directives/decorators/bootstrap/'
}))
);
stream.queue(gulp.src('./src/directives/decorators/bootstrap/*.js'));

stream.done()
.pipe(concat('bootstrap-decorator.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));

});

gulp.task('bootstrap-datepicker', function() {
var stream = streamqueue({objectMode: true});
stream.queue(
gulp.src('./src/directives/decorators/bootstrap/datepicker/*.html')
.pipe(minifyHtml({
empty: true,
spare: true,
quotes: true
}))
.pipe(templateCache({
module: 'schemaForm',
root: 'directives/decorators/bootstrap/datepicker/'
}))
);
stream.queue(gulp.src('./src/directives/decorators/bootstrap/datepicker/*.js'));

stream.done()
.pipe(concat('bootstrap-datepicker.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));

});

gulp.task('minify', function() {
gulp.src([
'./src/module.js',
'./src/sfPath.js',
'./src/services/*.js',
'./src/directives/*.js'
])
.pipe(concat('schema-form.min.js'))
.pipe(uglify())
.pipe(gulp.dest('./dist/'));
});

gulp.task('non-minified-dist', function() {
gulp.src([
'./src/module.js',
'./src/sfPath.js',
'./src/services/*.js',
'./src/directives/*.js'
])
.pipe(concat('schema-form.js'))
.pipe(gulp.dest('./dist/'));
});

gulp.task('jscs', function() {
gulp.src('./src/**/*.js')
.pipe(jscs());
});

gulp.task('default', [
'minify',
'bootstrap',
'bootstrap-datepicker',
'non-minified-dist'
]);

gulp.task('watch', function() {
gulp.watch('./src/**/*', ['default']);
});
require('./gulp');
2 changes: 1 addition & 1 deletion src/services/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
* @kind function
*
*/
angular.module('schemaForm').factory('sfSelect', ['sfPath', function (sfPath) {
angular.module('schemaForm').factory('sfSelect', ['sfPath', function(sfPath) {
var numRe = /^\d+$/;

/**
Expand Down
2 changes: 1 addition & 1 deletion src/sfPath.js
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ angular.module('schemaForm').provider('sfPath',
this.parse = ObjectPath.parse;
this.stringify = ObjectPath.stringify;
this.normalize = ObjectPath.normalize;
this.$get = function () {
this.$get = function() {
return ObjectPath;
};
}]);