We were partway here already: the client served assets from the manifest instead
of from a static directory (since 5b8e1c1), and we already generated the list of
assets in the slice JSON file. But on the server, we ignored that list and
re-walked the asset directory at bundle time.
Now, the idea of asset directory is solely a part of initFromAppDir.
This also fixes a bug where assets that weren't associated with on-disk files
wouldn't work properly if Asset.get* is called in a package loaded with
unipackage.load. Not really sure how dev-bundle-fetcher even worked...
Also fixes a bug in builder where generated filenames didn't actually avoid
duplicate files.
This does not bump BUILT_BY because the previous commit did, and this commit
will not be pushed without the previous commit.
Uses cleanup.js to register an exit handler that cleans up the ssh tunnel,
instead of the try/finally. The galaxyCommand wrapper takes care of finding a
galaxy, opening a tunnel, and cleaning up the tunnel when the command
finishes. Commands that want to keep the tunnel open can just use
prepareForGalaxy and not galaxyCommand.
galaxyCommand required refactoring argument parsing a bit; now each command has
an optional argumentParser step that runs before the actual command, which
allows us to wrap the command function knowing that the arguments have already
been parsed (e.g. site is always in argv._[1]).
Also reverts c185b2be because that fix is no longer necessary.
Some package code is loaded in browsers, which may fail to parse code which uses
'return' or 'throw' as a method name. We used to inconsistently use fut.ret for
this purpose; instead, just consistently use fut['return'] and fut['throw']. We
don't bother to do this in tools code which is definitely never run outside of
Node.
Also remove some unused requires.
Fixes#1222.
Change the downloader to no longer expect packages to contain package.js.
This actually requires us (already!) to bump BUILD_VERSION, since I've already
published packages without the package.js!
We bump the "build version" of the tools precisely when we want to rebuild all
packages. This handles the "I ran meteor update, I may need to rebuild my
app/$PACKAGE_DIRS packages" case, as well as ensuring that warehouse package
version numbers are incremented when we need to rebuild all packages (but not on
EVERY tools directory change).
some compatibility notes about packages:
- packages now have their own namespaces (rather than needing to
use the global namespace). symbols you want to share should
be declared with an @export comment
- this also means that missing dependencies can hurt you. so don't
leave them out.
- your app's packages (in the 'packages' directory in your app) are
not automatically included in your app; you need to explicitly
run "meteor add" for them. this means that, eg, you can have test
helper packages which are not directly used in your app, but just
used by other packages' tests. (before releasing this, we may
make 'meteor update' fix current apps.)
- the bundle ("star") format has changed
- packages are now built into the "unipackage" format. if this format changes
before we release this code (and commit to the definition of the initial
versions of the formats) you may need to run "meteor rebuild-all"
- __meteor_bootstrap__ has been stripped of everything not related to
executing JS code. Some of what used to be there is now on the WebApp
object.
more detailed docs are likely to come before the 0.6.5 release.