Allow dots in package names.
Change the internal representation of "package specs" inside Slice to be a
{package,slice} object instead of a "spec" string.
library.getSlices now can take EITHER a "spec" string or a {package,slice}
object.
Linker-created slice files also separate the slice name with a colon (so eg, you
get URLs like "/packages/livedata:tests.js" when running package tests). (Maybe
this should use a subdirectory instead?)
Specifically, don't watch until after serverHandle points to the NEW
process. This way, if the watcher files, we are sure to kill the new process,
not fail to kill it because serverHandle is still pointing at the old process or
no process. The old behavior led to sometimes failing to kill the server; while
it would eventually die due to failed keepalive, the new servers would also fail
due to EADDRINUSE.
This change is possible because unlike the only dependencyInfo, WatchSets are
completely self-contained (there's no "... and it should look like it did the
first time" involved).
While we're at it, make restartServer always stops the watcher, and clear some
variables after they're used.
Fixes#1247.
We call these the pluginProviderPackages because these are the packages that, if
they change, could affect the set of plugins available to this package (and thus
require it to be rebuilt).
In fact, each slice's dependencies already contains pluginDependencies (see
after the linker.prelink call in Slice.build, and recall that a package's
plugins are always active in itself).
This makes saveAsUnipackage -> initFromUnipackage less lossy. Also means that,
eg, plugins don't end up dependent on tests in packages they use.
Use of the json file path as the key in sliceDependencies is kind of hacky, but
I'm viewing buildinfo.json as less of a standardized format as unipackage.json.
That's because this change could introduce or remove a plugin, which affects how
the dependent package is built (eg, could change an extension between being
handled vs static).
Does not affect transitive dependencies.