Skip to content
Browse files

Upgrade to grunt 0.4

  • Loading branch information...
1 parent c16988e commit 2e9e32ae59b18a72b9275cf10d00d69df7cc675a @axemclion axemclion committed Feb 24, 2013
Showing with 62 additions and 27 deletions.
  1. +4 −1 .travis.yml
  2. +29 −14 grunt.js → Gruntfile.js
  3. +29 −12 package.json
View
5 .travis.yml
@@ -6,4 +6,7 @@ services:
branches:
only:
- - master
+ - master
+
+before_script:
+ - npm install -g grunt-cli
View
43 grunt.js → Gruntfile.js
@@ -54,30 +54,36 @@ module.exports = function(grunt) {
bottom : " return Pouch });"
}
},
+
+ clean: {
+ build : ["./dist"],
+ "node-qunit": ["./testdb_*"]
+ },
+
concat: {
amd: {
- src: grunt.utils._.flatten([
+ src: grunt.util._.flatten([
"<banner:meta.amd.top>", srcFiles,"<banner:meta.amd.bottom>"
]),
dest: 'dist/pouchdb.amd-<%= pkg.release %>.js'
},
all: {
- src: grunt.utils._.flatten([
+ src: grunt.util._.flatten([
"<banner>","<banner:meta.top>","src/deps/uuid.js",
"src/deps/polyfill.js", srcFiles, "<banner:meta.bottom>"
]),
dest: 'dist/pouchdb-<%= pkg.release %>.js'
},
spatial: {
- src: grunt.utils._.flatten([
+ src: grunt.util._.flatten([
"<banner>","<banner:meta.top>","src/deps/uuid.js",
"src/deps/polyfill.js", srcFiles,"src/plugins/pouchdb.spatial.js", "<banner:meta.bottom>"
]),
dest: 'dist/pouchdb.spatial-<%= pkg.release %>.js'
}
},
- min: {
+ uglify: {
dist: {
src: "./dist/pouchdb-<%= pkg.release %>.js",
dest: 'dist/pouchdb-<%= pkg.release %>.min.js'
@@ -89,17 +95,19 @@ module.exports = function(grunt) {
},
// Servers
- server: {
- base: '.',
- port: 8000
+ connect : {
+ server: {
+ base: '.',
+ port: 8000
+ }
},
'cors-server': {
base: 'http://127.0.0.1:5984',
port: 2020
},
- lint: {
+ jshint: {
files: ["src/adapter/*.js", "tests/*.js", "src/*.js"]
},
@@ -191,7 +199,7 @@ module.exports = function(grunt) {
// Custom tasks
grunt.registerTask("cors-server", "Runs a CORS proxy", function(){
var corsPort = arguments[0] || grunt.config("cors-server.port");
- var couchUrl = grunt.utils._.toArray(arguments).slice(1).join(":") ||
+ var couchUrl = grunt.util._.toArray(arguments).slice(1).join(":") ||
grunt.config("cors-server.base");
grunt.log.writeln("Starting CORS server " + corsPort + " => " + couchUrl);
@@ -236,11 +244,18 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-node-qunit');
+ grunt.loadNpmTasks('grunt-contrib-connect');
+ grunt.loadNpmTasks('grunt-contrib-concat');
+ grunt.loadNpmTasks('grunt-contrib-uglify');
+ grunt.loadNpmTasks('grunt-contrib-jshint');
+ grunt.loadNpmTasks('grunt-contrib-connect');
+ grunt.loadNpmTasks('grunt-contrib-clean');
- grunt.registerTask("build", "concat:amd concat:all min:dist");
- grunt.registerTask("test", "lint build server cors-server node-qunit " +
- "saucelabs-qunit publish-results");
- grunt.registerTask("full", "concat min");
- grunt.registerTask("spatial", "concat:spatial min:spatial");
+ grunt.registerTask("build", ["concat:amd", "concat:all" , "uglify:dist"]);
+
+ grunt.registerTask("testSetup", ["jshint", "build", "connect", "cors-server"]);
+ grunt.registerTask("test", ["testSetup", "node-qunit" ,"saucelabs-qunit", "publish-results"]);
+ grunt.registerTask("full", ["concat", "uglify"]);
+ grunt.registerTask("spatial", ["concat:spatial", "uglify:spatial"]);
grunt.registerTask('default', 'build');
};
View
41 package.json
@@ -6,16 +6,28 @@
"version": "0.0.0",
"main": "./src/pouch.js",
"homepage": "https://github.com/daleharvey/pouchdb",
- "keywords": [ "db", "couchdb", "pouchdb" ],
- "tags": [ "db", "couchdb", "pouchdb" ],
+ "keywords": [
+ "db",
+ "couchdb",
+ "pouchdb"
+ ],
+ "tags": [
+ "db",
+ "couchdb",
+ "pouchdb"
+ ],
"dependencies": {
"levelup": "*",
"request": "*",
"underscore": "*"
},
"jam": {
"main": "dist/pouch.amd-nightly.js",
- "include": ["dist/pouch.amd-nightly.js", "README.md", "LICENSE"],
+ "include": [
+ "dist/pouch.amd-nightly.js",
+ "README.md",
+ "LICENSE"
+ ],
"dependencies": {
"simple-uuid": null,
"md5": null
@@ -28,26 +40,31 @@
"assert": "*",
"nano": "*",
"send": "*",
- "grunt": "0.3",
- "grunt-saucelabs": "*",
- "grunt-node-qunit": "*",
+ "grunt": "~0.4",
+ "grunt-saucelabs": "~3.0",
+ "grunt-node-qunit": "~2.0",
"corsproxy": "*",
- "http-proxy": "*"
+ "http-proxy": "*",
+ "grunt-contrib-connect": "~0.1.2",
+ "grunt-contrib-concat": "~0.1.3",
+ "grunt-contrib-uglify": "~0.1.1",
+ "grunt-contrib-jshint": "~0.1.1",
+ "grunt-contrib-clean": "~0.4.0"
},
"maintainers": [
{
"name": "Dale Harvey",
- "web" : "https://github.com/daleharvey"
+ "web": "https://github.com/daleharvey"
},
{
- "name":"Ryan Ramage",
- "web":"https://github.com/ryanramage"
+ "name": "Ryan Ramage",
+ "web": "https://github.com/ryanramage"
}
],
"repositories": [
{
- "type":"git",
- "url":"https://github.com/daleharvey/pouchdb"
+ "type": "git",
+ "url": "https://github.com/daleharvey/pouchdb"
}
],
"scripts": {

0 comments on commit 2e9e32a

Please sign in to comment.
Something went wrong with that request. Please try again.