diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2ccbe46 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +/node_modules/ diff --git a/Gruntfile.js b/Gruntfile.js new file mode 100644 index 0000000..f6f7cc5 --- /dev/null +++ b/Gruntfile.js @@ -0,0 +1,41 @@ +/* + Build environment + ---------------------------------------- + 1) Install NodeJS: + http://nodejs.org/ + 2) Install dev dependencies + npm install + 3) Install Grunt CLI globally + npm install grunt-cli -g +*/ + +module.exports = function (grunt) { + grunt.initConfig({ + concat: { + 'build/MIDI.js': [ + 'js/MIDI/AudioDetect.js', + 'js/MIDI/LoadPlugin.js', + 'js/MIDI/Plugin.js', + 'js/MIDI/Player.js', + 'js/Window/DOMLoader.XMLHttp.js', // req when using XHR + 'js/Window/DOMLoader.script.js', // req otherwise +// 'js/Color/SpaceW3.js', // optional +// 'js/MusicTheory/Synesthesia.js', // optional +// 'js/Widgets/Loader.js', // optional +// 'js/Window/Event.js' // optional + ] + }, + uglify: { + 'build/MIDI.min.js': [ + 'build/MIDI.js' + ] + } + }); + + grunt.loadNpmTasks('grunt-contrib-concat'); + grunt.loadNpmTasks('grunt-contrib-uglify'); + + /// + grunt.registerTask('default', ['concat', 'uglify']); + /// +}; \ No newline at end of file diff --git a/grunt.js b/grunt.js deleted file mode 100644 index 604db65..0000000 --- a/grunt.js +++ /dev/null @@ -1,35 +0,0 @@ -/* - Build environment - ---------------------------------------- - 1) Install NodeJS: - http://nodejs.org/ - 2) Install Grunt - npm install grunt -*/ - -module.exports = function (grunt) { - grunt.initConfig({ - concat: { - 'build/MIDI.js': [ - "./js/MIDI/AudioDetect.js", - "./js/MIDI/LoadPlugin.js", - "./js/MIDI/Plugin.js", - "./js/MIDI/Player.js", - "./js/Window/DOMLoader.XMLHttp.js", // req when using XHR - "./js/Window/DOMLoader.script.js", // req otherwise -// "./js/Color/SpaceW3.js", // optional -// "./js/MusicTheory/Synesthesia.js", // optional -// "./js/Widgets/Loader.js", // optional -// "./js/Window/Event.js" // optional - ] - }, - min: { - 'build/MIDI.min.js': [ - 'build/MIDI.js' - ] - } - }); - /// - grunt.registerTask('default', 'concat min'); - /// -}; \ No newline at end of file diff --git a/package.json b/package.json index ba0c5ea..f106be1 100644 --- a/package.json +++ b/package.json @@ -3,14 +3,21 @@ "version": "0.3.0", "description": "Library to assist in creating HTML5 MIDI apps.", "author": "Michael Deal", - "contributors" : [ "Sergi Mansilla", "Daniel van der Meer", "Mohit Muthanna", "Pete Otaqui" ], - "scripts": { - "preinstall": "grunt" - }, + "contributors": [ + "Sergi Mansilla", + "Daniel van der Meer", + "Mohit Muthanna", + "Pete Otaqui" + ], "repository": { - "type": "git", - "url": "git://github.com/mudcube/MIDI.js.git" + "type": "git", + "url": "git://github.com/mudcube/MIDI.js.git" }, "main": "./build/MIDI.min.js", - "license": "MIT" -} \ No newline at end of file + "license": "MIT", + "devDependencies": { + "grunt": "~0.4.0", + "grunt-contrib-concat": "~0.1.3", + "grunt-contrib-uglify": "~0.1.2" + } +}