That's because warehouse packages are now pre-built and have no source tree.
(The existing code didn't work anyway. It iterated over self.releaseManifest
instead of self.releaseManifest.packages, and the "name" and "version" arguments
to the each were reversed. So it was trying to delete directories named ".build"
inside "/Users/glasser/.meteor/packages/de0d7206ad/tools" and
"/Users/glasser/.meteor/packages/packages". Since those directories never
existed, it didn't manage to try to rebuild any packages anyway.)
This will make it much easier to upgrade them and test new versions.
(They are still called from the bundler, so changes to how we access them (eg
source map support) will require modifying tools, but just "upgrade to new
version" now is much easier.)
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).