diff --git a/bower.json b/bower.json index 4232ef7..f6d5152 100644 --- a/bower.json +++ b/bower.json @@ -1,12 +1,12 @@ { "name": "pjax", - "main": "pjax.js", "version": "0.1.1", + "description": "Boost browsing experience using Ajax navigation (+ Push state)", + "main": "src/pjax.js", "homepage": "https://github.com/MoOx/pjax", "authors": [ "Maxime Thirouin " ], - "description": "Boost browsing experience using Ajax navigation (+ Push state)", "moduleType": [ "amd", "globals", diff --git a/gulpfile.js b/gulpfile.js index 8770389..196b0ea 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -1,31 +1,56 @@ -/// var pkg = require("./package.json") , gulp = require("gulp") , plumber = require("gulp-plumber") /// -// Lint JS +// JS Lint /// var jshint = require("gulp-jshint") - , jsFiles = [".jshintrc", "*.json", "*.js"] + , jsonFiles = [".jshintrc", "*.json"] + , jsFiles = ["*.js", "src/**/*.js"] gulp.task("scripts.lint", function() { - gulp.src(jsFiles) + gulp.src([].concat(jsonFiles).concat(jsFiles)) .pipe(plumber()) .pipe(jshint(".jshintrc")) .pipe(jshint.reporter("jshint-stylish")) }) +/// +// JS Code Sniffing +/// var jscs = require("gulp-jscs") gulp.task("scripts.cs", function() { - gulp.src("*.js") + gulp.src(jsFiles) .pipe(plumber()) .pipe(jscs()) }) +// JS Alias gulp.task("scripts", ["scripts.lint", "scripts.cs"]) +/// +// Watch +/// gulp.task("watch", function() { - gulp.watch([jsFiles], ["scripts"]) + gulp.watch(jsFiles, ["scripts"]) }) -gulp.task("default", ["scripts", "watch"]) +/// +// Publish gh-branch +/// +var buildBranch = require("buildbranch") +gulp.task("publish", ["test"], function(cb) { + buildBranch({folder: "src"} + , function(err) { + if (err) { + throw err + } + console.log(pkg.name + " published.") + cb() + }) +}) + +// Aliases +gulp.task("build", ["scripts"]) +gulp.task("test", ["build"]) +gulp.task("default", ["test", "watch"]) diff --git a/package.json b/package.json index a6ebbcb..558508f 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "pjax", "version": "0.1.1", "description": "Boost browsing experience using Ajax navigation (+ Push state)", - "main": "pjax.js", + "main": "src/pjax.js", "scripts": { "test": "echo \"Error: no test specified\" && exit 1" }, @@ -30,6 +30,7 @@ "gulp-jscs": "^0.3.2", "gulp-plumber": "^0.5.6", "gulp": "^3.5.6", - "gulp-jshint": "^1.5.1" + "gulp-jshint": "^1.5.1", + "buildbranch": "0.0.1" } } diff --git a/pjax.js b/src/pjax.js similarity index 100% rename from pjax.js rename to src/pjax.js