Upgrade grunt to latest.

Also adds (experimental) dox documentation generator. Run with `grunt dox`. Documentation will be placed under build/docs/.
This commit is contained in:
Stefan Thomas
2013-05-06 21:10:53 +02:00
parent 8073fc7979
commit bad52779e3
2 changed files with 42 additions and 27 deletions

View File

@@ -1,8 +1,11 @@
module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-webpack');
grunt.loadNpmTasks('grunt-dox');
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.initConfig({
pkg: '<json:package.json>',
pkg: grunt.file.readJSON('package.json'),
meta: {
banner: '/*! <%= pkg.name %> - v<%= pkg.version %> - ' +
'<%= grunt.template.today("yyyy-mm-dd") %>\n' +
@@ -43,39 +46,53 @@ module.exports = function(grunt) {
}
},
webpack: {
lib: {
src: "src/js/index.js",
dest: "build/ripple-<%= pkg.version %>.js",
libary: "ripple", // misspelling fixed in later versions of webpack
options: {
entry: "./src/js/index.js",
library: "ripple"
},
lib: {
output: {
filename: "build/ripple-<%= pkg.version %>.js"
}
},
lib_debug: {
src: "src/js/index.js",
dest: "build/ripple-<%= pkg.version %>-debug.js",
libary: "ripple", // misspelling fixed in later versions of webpack
library: "ripple",
debug: true
output: {
filename: "build/ripple-<%= pkg.version %>-debug.js"
},
debug: true,
devtool: 'eval'
},
lib_min: {
src: "src/js/index.js",
dest: "build/ripple-<%= pkg.version %>-min.js",
libary: "ripple", // misspelling fixed in later versions of webpack
library: "ripple",
minimize: true
output: {
filename: "build/ripple-<%= pkg.version %>-min.js"
},
optimize: {
minimize: true
}
}
},
watch: {
sjcl: {
files: ['<config:concat.sjcl.src>'],
files: ['<%= concat.sjcl.src %>'],
tasks: 'concat:sjcl'
},
lib: {
files: 'src/js/*.js',
tasks: 'webpack'
}
},
dox: {
libdocs: {
options: {
title: "Test"
},
src: ['src/js/'],
dest: 'build/docs'
}
}
});
// Tasks
grunt.registerTask('default', 'concat:sjcl webpack');
grunt.registerTask('default', ['concat:sjcl', 'webpack']);
};

View File

@@ -2,7 +2,6 @@
"name": "ripple-lib",
"version": "0.7.11",
"description": "Ripple JavaScript client library",
"files": [
"src/js/*.js",
"build/sjcl.js",
@@ -12,7 +11,6 @@
"directories": {
"test": "test"
},
"dependencies": {
"async": "~0.1.22",
"ws": "~0.4.22",
@@ -20,19 +18,19 @@
"simple-jsonrpc": "~0.0.1"
},
"devDependencies": {
"grunt": "~0.3.17",
"buster": "~0.6.2",
"grunt-webpack": "~0.4.0"
"grunt": "~0.4.1",
"grunt-contrib-concat": "~0.3.0",
"grunt-contrib-watch": "~0.4.0",
"grunt-webpack": "~0.10.2",
"grunt-dox": "~0.4.1",
"buster": "~0.6.2"
},
"scripts": {
"test": "buster test"
"test": "node_modules/buster/bin/buster test"
},
"repository": {
"type": "git",
"url": "git://github.com/jedmccaleb/NewCoin.git"
"url": "git://github.com/rippleFoundation/ripple-lib.git"
},
"readmeFilename": "README.md"
}