Since this file ends up getting copied into the server bundle, along with
files like boot.js, it makes sense to keep it with those files.
Renamed tools/shell/client.js to tools/shell-client.js for symmetry.
Note that shell/server.js is copied into the bundle as shell-server.js,
like before, however now it contains none of the extraneous code that
belongs in shell/client.js.
The original reason server and client code were combined in a single file
was to share helper functions and configuration variables (e.g.
getInfoFile and EXITING_MESSAGE). Now, shell/client.js requires
shell/server.js to access those shared exports.
Summary:
This eliminates a whole class of problems relating to socket files (such
as the limit on the length of their names), and potentially makes it
easier to implement `meteor shell` on other platforms, such as Windows.
Fixes#3591.
Test Plan:
Use `meteor shell` and verify that it still works as before, especially
when started before/after/during server startup, and when the server is
killed while multiple shell clients are connected.
Reviewers: Slava, dgreensp, stubailo, glasser
Reviewed By: glasser
Differential Revision: https://phabricator.meteor.io/D22
Summary:
Note that an explanation will be printed to the console for clients
attempting to connect via `meteor shell`, but nothing will be printed to
the server console.
Fixes#3591.
Test Plan:
Artificially lower the limit and verify that the server starts as usual,
but that shell clients exit with a warning.
Reviewers: Slava, dgreensp, stubailo, glasser
Reviewed By: glasser
Differential Revision: https://phabricator.meteor.io/D21
Summary:
Requiring a key that is only discoverable via the file system will allow
us to safely listen for connections on a port instead of a socket file.
Test Plan:
Use `meteor shell` and verify that it still works as before, especially
when started before/after/during server startup, and when the server is
killed while multiple shell clients are connected.
Reviewers: Slava, dgreensp, stubailo, glasser
Reviewed By: glasser
Differential Revision: https://phabricator.meteor.io/D20
Summary:
Instead of expecting the child process to figure out where the
`.meteor/local` directory is, we now tell it explicitly via the
`METEOR_SHELL_DIR` environment variable.
Fixes#3437.
Test Plan:
Run `meteor shell` in a separate terminal and see that it still connects
to an app running from the same app directory.
Reviewers: glasser
Reviewed By: glasser
Differential Revision: https://phabricator.meteor.io/D11
Summary:
Before this commit you could type `Meteor.is` in a `meteor shell` session
and then tab to see a list of possible completions (e.g.
`Meteor.isClient`, `Meteor.isServer`), but typing a prefix of a global
variable name like `Mete` followed by tab has been broken ever since we
stopped using the global object as the REPL context:
https://github.com/meteor/meteor/commit/7c7e52f2d2
The reason for that commit was to prevent the REPL from overwriting the
global `_` variable (which most Meteor developers expect to be bound to
`require("underscore")`): https://github.com/meteor/meteor/3227
This commit solves #3227 by making `repl.context._` a read-only property
that is permanently "bound" to underscore. As a bonus, we now intercept
assignments to `_` and store those values as `repl.context.__`, so you
still have access to the last result in the shell via `__`.
Test Plan:
Run `meteor shell`, evaluate a few expressions, and see that (1) global
variables can be tab-completed, (2) `_` remains bound to underscore, and
(3) `__` gets bound to the result of the evaluated expressions.
Reviewers: avital, stubailo, glasser
Reviewed By: glasser
Differential Revision: https://phabricator.meteor.io/D12
This commit moves parent pid process from the webapp package to the boot
script. This means that daemonized apps without webapp will also exit
when the runner exits, if run from the runner. (For example, several
self-tests such as 'autoupdate' no longer leak node processes.) This is
controlled via the $METEOR_PARENT_PID environment variable instead of
from command line arguments, in order to make fewer assumptions about
how Meteor apps process arguments.
This also drops the old --keepalive support (which already has stopped
being used by the dev mode runner or any MDG deployment platforms).
Neither --parent-pid nor --keepalive were documented beforehand, and
--keepalive was already deprecated before 1.0.
These flags used to also incidentally trigger printing the LISTENING
line; this is now controlled by $METEOR_PRINT_ON_LISTEN.
Fixes#3315.
CommonJS module identifiers are specified always to use forward slashes,
even on Windows, so there's no value in using path.join or files.pathJoin
to construct module identifiers.
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