From bad52779e3b1142c28452d02662c57ab54dfa092 Mon Sep 17 00:00:00 2001 From: Stefan Thomas Date: Mon, 6 May 2013 21:10:53 +0200 Subject: [PATCH] Upgrade grunt to latest. Also adds (experimental) dox documentation generator. Run with `grunt dox`. Documentation will be placed under build/docs/. --- grunt.js => Gruntfile.js | 51 ++++++++++++++++++++++++++-------------- package.json | 18 +++++++------- 2 files changed, 42 insertions(+), 27 deletions(-) rename grunt.js => Gruntfile.js (68%) diff --git a/grunt.js b/Gruntfile.js similarity index 68% rename from grunt.js rename to Gruntfile.js index a306fab6..656ce278 100644 --- a/grunt.js +++ b/Gruntfile.js @@ -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: '', + 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: [''], + 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']); + }; diff --git a/package.json b/package.json index 5ff84711..353bbba4 100644 --- a/package.json +++ b/package.json @@ -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" }