Skip to content

Commit

Permalink
Replace aurora.js + mp3.js submodules with bower entries
Browse files Browse the repository at this point in the history
Also replace Importer references with Browserify, as both dependencies
switched build tools.
  • Loading branch information
malept committed Jun 29, 2014
1 parent d505b7c commit b56febc
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 20 deletions.
6 changes: 0 additions & 6 deletions .gitmodules

This file was deleted.

2 changes: 1 addition & 1 deletion INSTALL.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Frontend
* Bower (``npm install -g bower``)
* CoffeeScript (``npm install -g coffee-script``)
* UglifyJS2 (``npm install -g uglify-js``)
* importer (``npm install -g importer``)
* Browserify and related dependencies (``npm install -g browserify coffeeify browserify-shim``)

.. _libsass-python: http://dahlia.kr/libsass-python/
.. _Sass: http://sass-lang.com/
Expand Down
4 changes: 3 additions & 1 deletion bower.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@
"normalize-css": "~3.0.1",
"lodash": "~2.4.1",
"backbone.localstorage": "~1.1.7",
"html5-desktop-notifications": "malept/HTML5-Desktop-Notifications#firefox-mobile"
"html5-desktop-notifications": "malept/HTML5-Desktop-Notifications#firefox-mobile",
"aurora.js": "malept/aurora.js#global-browserify",
"mp3.js": "audiocogs/mp3.js#~0.1.0"
}
}
30 changes: 19 additions & 11 deletions gmusicprocurator/assets.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,33 +52,38 @@ def input(self, _in, out, **kw):
register_filter(LibSassFilter)


class ImporterFilter(ExternalTool):
class BrowserifyFilter(ExternalTool):

"""
webassets_ filter for Importer_.
webassets_ filter for Browserify_.
.. _webassets: https://webassets.readthedocs.org/
.. _Importer: https://github.com/devongovett/importer
.. _Browserify: http://browserify.org
"""

name = 'importer_js'
name = 'browserify'
method = 'open'
options = {
'binary': 'IMPORTERJS_BIN',
'extra_args': 'IMPORTERJS_EXTRA_ARGS',
'binary': 'BROWSERIFY_BIN',
'coffeescript': 'BROWSERIFY_COFFEESCRIPT',
'extra_args': 'BROWSERIFY_EXTRA_ARGS',
}

def setup(self):
"""Set up Importer CLI args."""
"""Set up Browserify CLI args."""
self.argv = [
self.binary or 'importer',
self.binary or 'browserify',
'{1}', # source_path
'-o',
'{{output}}',
]
if self.coffeescript:
self.argv.extend(['--transform', 'coffeeify',
'--extension', '.coffee'])
if self.extra_args:
self.argv.extend(self.extra_args)

register_filter(ImporterFilter)
register_filter(BrowserifyFilter)


def bundlify(fmt, modules, **kwargs):
Expand All @@ -105,9 +110,12 @@ def bundlify(fmt, modules, **kwargs):
output='all.min.css')
assets.register('css', css)

aurora = Bundle('vendor/aurora.js/browser_slim.coffee', filters='importer_js',
aurora_b_ify = BrowserifyFilter(coffeescript=True,
extra_args=['--standalone', 'AV'])
aurora = Bundle('vendor/aurora.js/browser_slim.coffee', filters=aurora_b_ify,
output='vendor/aurora.built.js')
mp3 = Bundle('vendor/mp3.js/mp3.js', filters='importer_js',
mp3_b_ify = BrowserifyFilter(extra_args=['--transform', 'browserify-shim'])
mp3 = Bundle('vendor/mp3.js/index.js', filters=mp3_b_ify,
output='vendor/mp3.built.js')
aurora_mp3 = Bundle(aurora, mp3, filters='uglifyjs', output='auroramp3.min.js')
assets.register('aurora_mp3', aurora_mp3)
Expand Down
4 changes: 3 additions & 1 deletion salt/roots/assets.sls
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ assets-deps:
npm.installed:
- names:
- bower
- browserify
- browserify-shim
- coffeeify
- coffee-script
- importer
- uglify-js
gem.installed:
- names:
Expand Down

0 comments on commit b56febc

Please sign in to comment.