Permalink
Browse files

v2.0 initial release

  • Loading branch information...
1 parent 6e8d6e9 commit b46456d92e046f3b76dfe0c782bd910a845df9bc Maarten Baijs committed Jan 22, 2014
View
@@ -0,0 +1,6 @@
+.DS_Store
+.ftppass
+dist/
+node_modules/
+*.sublime-project
+*.sublime-workspace
View
@@ -0,0 +1,4 @@
+{
+ "laxcomma" : true
+, "laxbreak" : false
+}
View
@@ -0,0 +1,5 @@
+language: node_js
+node_js:
+ - 0.8
+before_script:
+ - npm install -g grunt-cli
View
@@ -0,0 +1,169 @@
+module.exports = ( grunt ) ->
+
+ grunt.initConfig
+
+ pkg : grunt.file.readJSON "package.json"
+
+ meta :
+
+ banner : '/*! <%= pkg.title || pkg.name %> - v<%= pkg.version %> - ' +
+ '<%= grunt.template.today("yyyy-mm-dd") %>\n ' +
+ '<%= pkg.homepage ? "* " + pkg.homepage + "\\n *\\n " : "" %>' +
+ '* Copyright (c) <%= grunt.template.today("yyyy") %> <%= pkg.author.name %> <<%= pkg.author.email %>>;\n' +
+ ' * Licensed under the <%= _.pluck(pkg.licenses, "type").join(", ") %> license */\n\n'
+
+ # Remove old build.
+ #
+ clean :
+
+ dist :
+
+ src : [ "dist" ]
+
+ # Copy the images and the index to the dist location.
+ #
+ copy :
+
+ dist :
+
+ files : [
+ { expand: true, cwd: "src", src: "images/**/*", dest: "dist/src" }
+ , { expand: true, cwd: "src", src: "css/**/*", dest: "dist/src" }
+ , { expand: true, cwd: "node_modules/baijs", src: "css/**/*", dest: "dist/src" }
+ , { expand: true, cwd: "node_modules/baijs", src: "js/**/*", dest: "dist/src" }
+ , { expand: true, cwd: "src", src: "js/**/*", dest: "dist/src" }
+ , { expand: true, cwd: "src", src: "index.html", dest: "dist/src" }
+ ]
+
+ example :
+
+ files : [
+ { expand: true, cwd: "src", src: "example/**/*", dest: "dist/src/" }
+ , { expand: true, cwd: "dist/src/js", src: "jquery.<%= pkg.name %>*", dest: "dist/src/example/js" }
+ ]
+
+
+ # Validate javascript files with jsHint.
+ #
+ jshint :
+
+ options :
+
+ jshintrc : ".jshintrc"
+
+ all : [
+ "src/js/jquery.<%= pkg.name %>.js"
+ ]
+
+ # Minify the javascript.
+ #
+ uglify :
+
+ dist :
+
+ options :
+
+ banner : "<%= meta.banner %>"
+ beautify : false
+
+ files :
+
+ "dist/src/js/jquery.<%= pkg.name %>.min.js" : ["dist/src/js/jquery.<%= pkg.name %>.js"]
+
+
+ # Replace image file paths in css and correct css path in the index.
+ #
+ replace :
+
+ dist :
+ src : [
+ "dist/src/index.html"
+ ]
+ overwrite : true
+ replacements : [
+ {
+ from : /@@bnr@@/ig
+ , to : "<%= pkg.version %>"
+ }
+ , {
+ from : /..\/node_modules\/baijs\//ig
+ , to : ""
+ }
+ ]
+
+ # Make a zipfile.
+ #
+ compress :
+
+ dist :
+
+ options :
+
+ archive: "dist/dist-<%= pkg.version %>.zip"
+
+ expand : true
+ cwd : "dist/src"
+ src : ["**/*"]
+ dest : "."
+
+ example :
+
+ options :
+
+ archive: "dist/src/<%= pkg.name %>-<%= pkg.version %>.zip"
+
+ expand : true
+ cwd : "dist/src/example"
+ src : ["**/*"]
+ dest : "."
+
+ "ftp-deploy":
+
+ dist:
+
+ auth:
+
+ host : "ftp.baijs.nl"
+ port : 21
+ authKey : "<%= pkg.name %>"
+
+ src: "dist/src"
+ dest: "/"
+
+ # Load all the task modules we need.
+ #
+ grunt.loadNpmTasks "grunt-contrib-copy"
+ grunt.loadNpmTasks "grunt-contrib-clean"
+ grunt.loadNpmTasks "grunt-contrib-uglify"
+ grunt.loadNpmTasks "grunt-text-replace"
+ grunt.loadNpmTasks "grunt-contrib-compress"
+ grunt.loadNpmTasks "grunt-ftp-deploy"
+ grunt.loadNpmTasks "grunt-contrib-jshint"
+
+ # Distribution build
+ #
+ grunt.registerTask(
+
+ "default"
+ , [
+ "jshint"
+ "clean:dist"
+ "copy:dist"
+ "uglify:dist"
+ "compress:dist"
+ "replace:dist"
+ "copy:example"
+ "compress:example"
+ ]
+ )
+
+ # Upload dist to baijs.nl
+ #
+ grunt.registerTask(
+
+ "ftp"
+ , [
+ "default"
+ "ftp-deploy:dist"
+ ]
+ )
View
@@ -0,0 +1,21 @@
+Copyright 2013 Maarten Baijs
+http://www.baijs.com
+
+Permission is hereby granted, free of charge, to any person obtaining
+a copy of this software and associated documentation files (the
+"Software"), to deal in the Software without restriction, including
+without limitation the rights to use, copy, modify, merge, publish,
+distribute, sublicense, and/or sell copies of the Software, and to
+permit persons to whom the Software is furnished to do so, subject to
+the following conditions:
+
+The above copyright notice and this permission notice shall be
+included in all copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Oops, something went wrong.

0 comments on commit b46456d

Please sign in to comment.