diff --git a/.gitignore b/.gitignore index 470a1ab7..4fd6ab50 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ node_modules/ +bower_components/ tmp/ docs/ dist/ diff --git a/Gruntfile.js b/Gruntfile.js index 2a94d8bb..6f071280 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -26,7 +26,7 @@ module.exports = function(grunt) { }, jasmine_node: { specNameMatcher: '.*Spec', - projectRoot: 'test/spec/model', + projectRoot: 'test/spec/node', jUnit: { report: true, savePath : 'tmp/reports/jasmine', @@ -56,16 +56,17 @@ module.exports = function(grunt) { browserify: { options: { alias: [ - '<%= config.sources %>/main.js:Bpmn', - '<%= config.sources %>/model/BpmnModel.js:BpmnModel' + '<%= config.sources %>/main.js:bpmn', + '<%= config.sources %>/Model.js:bpmn/Model' ] }, - src: { + sources: { files: { '<%= config.dist %>/bpmn.js': [ '<%= config.sources %>/**/*.js' ] }, options: { - debug: true + debug: true, + transform: [ 'debowerify' ] } }, dist: { @@ -74,7 +75,7 @@ module.exports = function(grunt) { }, options: { debug: false, - transform: [ 'uglifyify' ] + transform: [ 'debowerify', 'uglifyify' ] } } }, @@ -93,12 +94,16 @@ module.exports = function(grunt) { }, watch: { sources: { - files: [ '<%= config.sources %>/**/*.js'], - tasks: [ 'browserify:src'] + files: [ '<%= config.sources %>/**/*.js', '<%= config.samples %>/**/*.*' ], + tasks: [ 'browserify:sources', 'copy:samples' ] + }, + samples: { + files: [ '<%= config.samples %>/**/*.*' ], + tasks: [ 'copy:samples' ] }, jasmine_node: { - files: [ '<%= config.sources %>/**/*.js', '<%= config.tests %>/spec/model/**/*.js'], - tasks: [ 'jasmine_node'] + files: [ '<%= config.sources %>/**/*.js', '<%= config.tests %>/spec/node/**/*.js' ], + tasks: [ 'jasmine_node' ] } }, jsdoc: { @@ -111,7 +116,7 @@ module.exports = function(grunt) { } }, concurrent: { - 'sources': [ 'browserify:src', 'jshint' ], + 'sources': [ 'browserify:sources', 'jshint' ], 'build': [ 'jshint', 'build', 'jsdoc' ] }, connect: { @@ -128,20 +133,21 @@ module.exports = function(grunt) { ] } } - }, + } }); // tasks grunt.registerTask('test', [ 'jasmine_node', 'karma:single' ]); - grunt.registerTask('build', [ 'browserify', 'copy:samples' ]); + grunt.registerTask('build', [ 'browserify:dist', 'copy:samples' ]); + grunt.registerTask('auto-build', [ - 'concurrent:build', + 'concurrent:sources', 'connect:livereload', 'watch' ]); - grunt.registerTask('auto-test', [ 'jasmine_node', 'watch:test' ]); + grunt.registerTask('auto-test', [ 'jasmine_node', 'watch:jasmine_node' ]); grunt.registerTask('default', [ 'jshint', 'test', 'build', 'jsdoc' ]); }; \ No newline at end of file diff --git a/example/index.html b/example/index.html index b850fe90..c9093419 100644 --- a/example/index.html +++ b/example/index.html @@ -6,11 +6,16 @@
Drop files here
+
+ + +