This way, plugins can easily re-use the Trac operating mode (compile before install). If they need to localize .js files, they should do something like:
{{{#!python
from trac.util.dist import get_l10n_js_cmdclass
extra['cmdclass'] = get_l10n_js_cmdclass()
}}}
If they don't need the new `*_js` related commands, they should do:
{{{#!python
from trac.util.dist import get_l10n_cmdclass
extra['cmdclass'] = get_l10n_cmdclass()
}}}
Also, don't modify the standard `build` command in place, but rather subclass it (http://www.mail-archive.com/distutils-sig@.../msg11760.html).