def _bundle_app_coffee(env, debug=False): """Compile the apps coffeescript and bundle it into appname.js""" COFFEE_PATH = 'coffee' APP_PATH = path.join(COFFEE_PATH, 'appname') scripts = ( path.join(COFFEE_PATH, 'nested.coffee'), path.join(COFFEE_PATH, 'app.coffee'), path.join(APP_PATH, 'app.coffee'), path.join(APP_PATH, 'menu.coffee'), path.join(APP_PATH, 'channel.coffee'), path.join(APP_PATH, 'contact.coffee'), path.join(APP_PATH, 'tag.coffee'), path.join(APP_PATH, 'person.coffee'), path.join(APP_PATH, 'vendor.coffee'), path.join(APP_PATH, 'activity.coffee'), path.join(APP_PATH, 'transaction.coffee'), path.join(APP_PATH, 'summary.coffee'), path.join(APP_PATH, 'router.coffee'), ) all_js = Bundle(*scripts, filters='coffeescript', output=path.join('..', 'static', 'script', 'appname.js')) env.add(all_js) if not debug: all_js.filters = 'closure_js'
def _bundle_app_coffee(env, debug=False): """Compile the apps coffeescript and bundle it into appname.js""" COFFEE_PATH = 'coffee' APP_PATH = path.join(COFFEE_PATH, 'appname') scripts = ( path.join(COFFEE_PATH, 'nested.coffee'), path.join(COFFEE_PATH, 'app.coffee'), path.join(APP_PATH, 'app.coffee'), path.join(APP_PATH, 'menu.coffee'), path.join(APP_PATH, 'channel.coffee'), path.join(APP_PATH, 'contact.coffee'), path.join(APP_PATH, 'tag.coffee'), path.join(APP_PATH, 'person.coffee'), path.join(APP_PATH, 'vendor.coffee'), path.join(APP_PATH, 'activity.coffee'), path.join(APP_PATH, 'transaction.coffee'), path.join(APP_PATH, 'summary.coffee'), path.join(APP_PATH, 'router.coffee'), ) all_js = Bundle( *scripts, filters='coffeescript', output=path.join('..', 'static', 'script', 'appname.js') ) env.add(all_js) if not debug: all_js.filters = 'closure_js'
def _bundle_app_less(env, debug): """Compile and minify appname's less files into appname.css.""" bundle = Bundle(Bundle(path.join('less', 'appname.less'), filters='less'), output=path.join('..', 'static', 'css', 'appname.css')) if not debug: bundle.filters = 'cssmin' env.add(bundle)
def _bundle_app_jsts(app, env, debug=False): """Compile and bundle JSTs into template.js""" all_js = Bundle( path.join('templates', '**', '*.jst'), debug=False, filters='jst', output=path.join('..', '..', app, 'static', 'script', 'template.js') ) env.add(all_js) if not debug: all_js.filters = 'closure_js'
def _bundle_app_jsts(env, debug=False): """Compile and bundle JSTs into template.js""" all_js = Bundle(path.join('jst', '*.jst'), path.join('jst', '*', '*.jst'), filters='jst', output=path.join('..', 'static', 'script', 'template.js')) env.add(all_js) if not debug: all_js.filters = 'closure_js'
def _bundle_app_less(env, debug): """Compile and minify appname's less files into appname.css.""" bundle = Bundle( Bundle(path.join('less', 'appname.less'), filters='less'), output=path.join('..', 'static', 'css', 'appname.css') ) if not debug: bundle.filters = 'cssmin' env.add(bundle)
def _bundle_app_less(app, env, debug): """Compile and minify demo's less files into demo.css.""" bundle = Bundle( Bundle(path.join('less', '%s.less' % (app.lower(),)), filters='less'), output=path.join('..', '..', app, 'static', 'css', '%s.css' % (app.lower(),)) ) if not debug: bundle.filters = 'cssmin' env.add(bundle)
def _bundle_app_less(app, env, debug): """Compile and minify demo's less files into demo.css.""" bundle = Bundle(Bundle(path.join('less', '%s.less' % (app.lower(), )), filters='less'), output=path.join('..', '..', app, 'static', 'css', '%s.css' % (app.lower(), ))) if not debug: bundle.filters = 'cssmin' env.add(bundle)
def _bundle_skel(app_path, env, debug=False): """Combine thrid party js libs into libs.js. For debug, they are left uncompressed. For production the minified versions are used. We suggest using the vendor supplied minified version of each library. """ JS_LIB_PATH = path.join('js', 'lib') third_js = Bundle( path.join(JS_LIB_PATH, 'json2.js'), path.join(JS_LIB_PATH, 'jquery.js'), path.join(JS_LIB_PATH, 'underscore.js'), path.join(JS_LIB_PATH, 'backbone.js'), path.join(JS_LIB_PATH, 'backbone.paginator.js'), path.join(JS_LIB_PATH, 'bootstrap.js'), path.join(JS_LIB_PATH, 'bootstrap-typeahead-improved.js'), path.join(JS_LIB_PATH, 'date.js'), ) #TOOD: add require so we can simplify this COFFEE_PATH = 'coffee' coffee_js = Bundle( path.join(COFFEE_PATH, 'nested.coffee'), path.join(COFFEE_PATH, 'app.coffee'), path.join(COFFEE_PATH, 'datagrid.coffee'), path.join(COFFEE_PATH, 'skel.coffee'), path.join(COFFEE_PATH, 'channel.coffee'), path.join(COFFEE_PATH, 'utils.coffee'), path.join(COFFEE_PATH, 'smartbox.coffee'), filters='coffeescript' ) all_js = Bundle( third_js, Bundle( path.join('templates', '**', '*.jst'), filters='jst', debug=False), coffee_js, output=path.join(app_path, 'script', 'skel.js')) env.add(all_js) if not debug: all_js.filters = 'closure_js'
def _bundle_app_coffee(app_path, env, debug=False): """Compile the apps coffeescript and bundle it into demo.js""" COFFEE_PATH = 'coffee' scripts = ( path.join(COFFEE_PATH, 'nested.coffee'), path.join(COFFEE_PATH, 'app.coffee'), path.join(COFFEE_PATH, 'skel.coffee'), path.join(COFFEE_PATH, 'channel.coffee'), path.join(COFFEE_PATH, 'utils.coffee'), ) all_js = Bundle( *scripts, filters='coffeescript', output=path.join(app_path, 'script', 'skel.js') ) env.add(all_js) if not debug: all_js.filters = 'closure_js'
def _bundle_skel(app_path, env, debug=False): """Combine thrid party js libs into libs.js. For debug, they are left uncompressed. For production the minified versions are used. We suggest using the vendor supplied minified version of each library. """ JS_LIB_PATH = path.join('js', 'lib') third_js = Bundle( path.join(JS_LIB_PATH, 'json2.js'), path.join(JS_LIB_PATH, 'jquery.js'), path.join(JS_LIB_PATH, 'underscore.js'), path.join(JS_LIB_PATH, 'backbone.js'), path.join(JS_LIB_PATH, 'backbone.paginator.js'), path.join(JS_LIB_PATH, 'bootstrap.js'), path.join(JS_LIB_PATH, 'bootstrap-typeahead-improved.js'), path.join(JS_LIB_PATH, 'date.js'), ) #TOOD: add require so we can simplify this COFFEE_PATH = 'coffee' coffee_js = Bundle(path.join(COFFEE_PATH, 'nested.coffee'), path.join(COFFEE_PATH, 'app.coffee'), path.join(COFFEE_PATH, 'datagrid.coffee'), path.join(COFFEE_PATH, 'skel.coffee'), path.join(COFFEE_PATH, 'channel.coffee'), path.join(COFFEE_PATH, 'utils.coffee'), path.join(COFFEE_PATH, 'smartbox.coffee'), filters='coffeescript') all_js = Bundle(third_js, Bundle(path.join('templates', '**', '*.jst'), filters='jst', debug=False), coffee_js, output=path.join(app_path, 'script', 'skel.js')) env.add(all_js) if not debug: all_js.filters = 'closure_js'
def _bundle_app_coffee(app, env, debug=False): """Compile the apps coffeescript and bundle it into demo.js""" COFFEE_PATH = 'coffee' scripts = ( path.join(COFFEE_PATH, 'app.coffee'), path.join(COFFEE_PATH, 'menu.coffee'), path.join(COFFEE_PATH, 'router.coffee'), ) if not scripts: return all_js = Bundle(*scripts, filters='coffeescript', output=path.join('..', '..', app, 'static', 'script', '%s.js' % (app.lower(), ))) env.add(all_js) if not debug: all_js.filters = 'closure_js'
def _bundle_app_coffee(app, env, debug=False): """Compile the apps coffeescript and bundle it into demo.js""" COFFEE_PATH = 'coffee' scripts = ( path.join(COFFEE_PATH, 'app.coffee'), path.join(COFFEE_PATH, 'menu.coffee'), path.join(COFFEE_PATH, 'router.coffee'), ) if not scripts: return all_js = Bundle( *scripts, filters='coffeescript', output=path.join('..', '..', app, 'static', 'script', '%s.js' % (app.lower(),)) ) env.add(all_js) if not debug: all_js.filters = 'closure_js'
def _bundle_admin_js(env, debug=False): """Combine all js libs into sosadmin.js. For debug, they are left uncompressed. For production the minified versions are used. We suggest using the vendor supplied minified version of each library. """ all_js = Bundle( _bundle_3rd_party_js(debug), #this needs to be debug false to handle recurisve templates Bundle( path.join('templates', '**', '*.jst'), filters='jst', debug=False), _bundle_admin_coffee(debug), output=path.join( '..', '..', APP_NAME, 'static', 'script', 'sosadmin.js') ) env.add(all_js) if not debug: all_js.filters = 'closure_js'
def _bundle_admin_js(env, debug=False): """Combine all js libs into sosadmin.js. For debug, they are left uncompressed. For production the minified versions are used. We suggest using the vendor supplied minified version of each library. """ all_js = Bundle( _bundle_3rd_party_js(debug), #this needs to be debug false to handle recurisve templates Bundle(path.join('templates', '**', '*.jst'), filters='jst', debug=False), _bundle_admin_coffee(debug), output=path.join('..', '..', APP_NAME, 'static', 'script', 'sosadmin.js')) env.add(all_js) if not debug: all_js.filters = 'closure_js'