A better fix involves improving http-proxy itself but they're in the middle of a
giant Node 0.10 compatibility rewrite. This addresses the bug reported by Tim
Haines in a hacky but useful way.
argumentParser is now required, and it takes in an optimist object instead of
needing to create one.
The name of the command is automatically removed from argv._ between
argumentParser and func, instead of having to deal with it in func.
We no longer are able to cleverly show the "-f" in the help for logs -f only if
talking to Galaxy. The logic there is too complex.
(The motivation for this commit is that "meteor help logs" and "meteor logs
--help" were both broken, in different ways.)
Commands that don't use galaxyCommand (logs and configure, for now) have to call
qualifySitename themselves, but I think this is okay for now because we're
mainly concerned with preventing deploys to non-fully-qualified domains.
Allow packages to specify that files are assets, overriding any handler defined
for them. (May be useful for web workers!)
Let Assets.getBinary work before global-imports.js is executed.
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.
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).