commit/galaxy-central: carlfeberhard: Client build: add webpack and bower-install-simple to dev dependencies, add bower.json listing our external libraries (in most cases with most current version), add grunt task 'install-libs' which will fetch external libraries and move the files we use into scripts/libs

1 new commit in galaxy-central: https://bitbucket.org/galaxy/galaxy-central/commits/17a9bf94a120/ Changeset: 17a9bf94a120 User: carlfeberhard Date: 2015-01-21 20:23:44+00:00 Summary: Client build: add webpack and bower-install-simple to dev dependencies, add bower.json listing our external libraries (in most cases with most current version), add grunt task 'install-libs' which will fetch external libraries and move the files we use into scripts/libs Affected #: 4 files diff -r 474e6beec218c4041b87834915ee916f10a2a27e -r 17a9bf94a120ae6fc3249d29c077625a928a2e55 .hgignore --- a/.hgignore +++ b/.hgignore @@ -108,12 +108,9 @@ # CSS build artifacts. sprite-*.less -# Local node_modules directories +# Local node_modules and bower_components directories node_modules - -# Testing -selenium-server.jar -selenium_results.html +bower_components # Documentation build files. doc/build diff -r 474e6beec218c4041b87834915ee916f10a2a27e -r 17a9bf94a120ae6fc3249d29c077625a928a2e55 client/GruntFile.js --- a/client/GruntFile.js +++ b/client/GruntFile.js @@ -47,15 +47,77 @@ options: { spawn: false } + }, + + // call bower to install libraries and other external resources + "bower-install-simple" : { + options: { + color: true + }, + "prod": { + options: { + production: true + } + }, + "dev": { + options: { + production: false + } + } + }, + // where to move fetched bower components into the build structure (libName: [ bower-location, libs-location ]) + libraryLocations : { + //"jquery": [ "dist/jquery.js", "jquery/jquery.js" ], + //"jquery-migrate-official": [ "index.js", "jquery/jquery.migrate.js" ], + + // these need to be updated and tested + //"traceKit": [ "tracekit.js", "tracekit.js" ], + //"ravenjs": [ "dist/raven.js", "raven.js" ], + //"require": [ "build/require.js", "require.js" ], + //"underscore": [ "underscore.js", "underscore.js" ], + //"backbone": [ "backbone.js", "backbone/backbone.js" ], + //"d3": [ "d3.js", "d3.js" ], + //"farbtastic": [ "src/farbtastic.js", "farbtastic.js" ], + //"jQTouch": [ "src/reference/jqtouch.js", "jquery/jqtouch.js" ], + //"bib2json": [ "Parser.js", "bibtex.js" ], + //"jquery-form": [ "jquery.form.js", "jquery/jquery.form.js" ], + //"jquery-autocomplete": [ "src/jquery.autocomplete.js", "jquery/jquery.autocomplete.js" ], + //"select2": [ "select2.js", "jquery/select2.js" ], + //"jStorage": [ "jstorage.js", "jquery/jstorage.js" ], + //"jquery.cookie": [ "", "jquery/jquery.cookie.js" ], + //"dynatree": [ "dist/jquery.dynatree.js", "jquery/jquery.dynatree.js" ], + //"jquery-mousewheel": [ "jquery.mousewheel.js", "jquery/jquery.mousewheel.js" ], + //"jquery.event.drag-drop": [ + // [ "event.drag/jquery.event.drag.js", "jquery/jquery.event.drag.js" ], + // [ "event.drag/jquery.event.drop.js", "jquery/jquery.event.drop.js" ] + //], + + // these are complicated by additional css/less + //"toastr": [ "toastr.js", "toastr.js" ], + //"wymeditor": [ "dist/wymeditor/jquery.wymeditor.js", "jquery/jquery.wymeditor.js" ], + //"jstree": [ "jstree.js", "jquery/jstree.js" ], + + // these have been customized by Galaxy + //"bootstrap": [ "dist/js/bootstrap.js", "bootstrap.js" ], + //"jquery-ui": [ + // // multiple components now + // [ "", "jquery/jquery-ui.js" ] + //], + + // building the runtime library is not so simple + //"handlebars.js": [ "", "handlebars.runtime.js" ] } + }); grunt.loadNpmTasks( 'grunt-contrib-watch' ); grunt.loadNpmTasks( 'grunt-contrib-copy'); - grunt.loadNpmTasks('grunt-exec'); + grunt.loadNpmTasks( 'grunt-bower-install-simple'); + grunt.loadNpmTasks( 'grunt-exec' ); grunt.registerTask( 'pack', [ 'exec' ] ); - grunt.registerTask( 'default', [ 'copy', 'pack' ] ); + grunt.registerTask( 'default', [ 'copy:main', 'pack' ] ); + // -------------------------------------------------------------------------- copy,pack only those changed // adapted from grunt-contrib-watch jslint example @@ -85,4 +147,25 @@ onChange(); }); + // -------------------------------------------------------------------------- fetch/update external libraries + /** copy external libraries from bower components to scripts/libs */ + function copyLibs(){ + var libraryLocations = grunt.config( 'libraryLocations' ); + for( var libName in libraryLocations ){ + if( libraryLocations.hasOwnProperty( libName ) ){ + + var BOWER_DIR = 'bower_components', + location = libraryLocations[ libName ], + source = [ BOWER_DIR, libName, location[0] ].join( '/' ), + destination = 'galaxy/scripts/libs/' + location[1]; + grunt.log.writeln( source + ' -> ' + destination ); + grunt.file.copy( source, destination ); + } + } + } + + grunt.registerTask( 'copy-libs', 'copy external libraries to src', copyLibs ); + grunt.registerTask( 'install-libs', 'fetch external libraries and copy to src', + [ 'bower-install-simple:prod', 'copy-libs' ] ); + }; diff -r 474e6beec218c4041b87834915ee916f10a2a27e -r 17a9bf94a120ae6fc3249d29c077625a928a2e55 client/bower.json --- /dev/null +++ b/client/bower.json @@ -0,0 +1,40 @@ +{ + "name": "galaxy-client-libs", + "version": "0.0.0", + "description": "External client-side libraries used by Galaxy", + "keywords": [ + "galaxy", + "galaxyproject" + ], + "homepage": "usegalaxy.org", + "dependencies": { + "jquery": "~1.11.1", + "jquery-migrate-official": "http://code.jquery.com/jquery-migrate-1.2.1.js", + "traceKit": "*", + "ravenjs": "~1.1.16", + "require": "*", + "underscore": "~1.7.0", + "backbone": "~1.1.2", + "bootstrap": "~3.3.2", + "d3": "~3.5.3", + "farbtastic": "~2.0.0-alpha.1", + "toastr": "~2.1.0", + "jQTouch": "git://github.com/senchalabs/jQTouch#~1.0.0", + "bib2json": "git://github.com/mayanklahiri/bib2json", + "jquery-form": "~3.46.0", + "jquery-autocomplete": "git://github.com/dyve/jquery-autocomplete", + "select2": "~3.5.2", + "jStorage": "~0.4.12", + "jquery.cookie": "~1.4.1", + "dynatree": "~1.2.5", + "jquery-mousewheel": "~3.1.12", + "wymeditor": "~1.0.0-rc.1", + "jstree": "~3.0.9", + "jquery-ui": "git://github.com/jquery/jquery-ui.git#~1.11.2", + "jquery.event.drag-drop": "~2.2.1", + "handlebars.js": "~2.0.0" + }, + "resolutions": { + "jquery": "~1.11.1" + } +} diff -r 474e6beec218c4041b87834915ee916f10a2a27e -r 17a9bf94a120ae6fc3249d29c077625a928a2e55 client/package.json --- a/client/package.json +++ b/client/package.json @@ -7,8 +7,13 @@ ], "devDependencies": { "grunt": "^0.4.5", + "grunt-bower-install-simple": "^1.1.0", "grunt-contrib-copy": "^0.5.0", "grunt-contrib-watch": "^0.6.1", - "grunt-exec": "^0.4.6" + "grunt-exec": "^0.4.6", + "grunt-webpack": "^1.0.8", + "i18n-webpack-plugin": "^0.2.7", + "webpack": "^1.5.1", + "webpack-dev-server": "^1.7.0" } } Repository URL: https://bitbucket.org/galaxy/galaxy-central/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email.
participants (1)
-
commits-noreply@bitbucket.org