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

View File

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