Summary:
Invoking `meteor shell` starts an interactive REPL for evaluating server-side code.
Shell commands are evaluated in the server process, so the shell's input and output have to be piped through a socket from/to the parent process that runs the `meteor shell` command. This separation accounts for most of the complexity of this diff, but the end result is pretty seamless: tab completion, history, ctlr-c and ctrl-d, etc. all work as expected.
Task: https://app.asana.com/0/15750483766338/16576093991355
Test Plan: Run `meteor run` in one terminal and `meteor shell` in another, evaluate some commands, and verify that the commands seem to be running the context of the server process. Also check tab completion and history, and ensure that the server is running simultaneously with the shell.
Reviewers: dgreenspan, avital, slava, emily, nim, sashko
CC: sashko
Differential Revision: https://phabricator.meteor.com/D837
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.
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.
Server assets can be included in a bundle by putting them in the private/
directory of an application, or by registering a build plugin that calls
compileStep.addAsset with a server file. The Assets API (Assets.getText and
Assets.getBinary) allows an application or package to retrieve the contents of
its own server assets.
Set $NODE_ENV appropriately (to 'development' in 'meteor run' and 'production'
otherwise) so that connect doesn't send stack traces over the network in
production.