The point of the other catalogs is to allow local packages to override
server packages. This has nothing to do with releases. So rather than
keep release metadata in memory multiple times and force developers to
wonder "what's the different between catalog.complete.getReleaseTrack
and catalog.official.getReleaseTrack?", now it really just only exists
on catalog.official.
This should be a performance win (no need to load constraint-solver
unless you actually need to use it!), and it's what I wanted to do
initially instead of lazily loading mori, but it wasn't feasible with
the old super-recursive catalog.
This fixes an issue where running 'curmeteor rebuild' twice (!) died the
second time with a "Can't load npm module 'mori'" error. This is because
uniload (when run from a checkout) sets up Npm.require to read directly
from PACKAGE/.build.PACKAGE/npm/node_modules, which might get deleted
later in the process! There are some complex and maybe slow ways to
resolve this general issue (copy the node_modules somewhere else?) but
for now, the easiest way to avoid the issue is just to load Npm modules
immediately inside packages which need to be uniloaded.
- The checkout catalog.uniload now does not uniload a resolver, and
instead just has a trivial implementation of resolveConstraints.
(The 'built' catalog.uniload already didn't use the resolver.)
- catalog.complete.resolveConstraints now throws an error if there's
no resolver; this is OK, because creating the resolver now only
uses the distinct catalog.uniload, so there's no recursion issue.
- don't record version dependencies in packages during uniload (this
protects against using release.current before it is initialized)
- PackageLoader should never download packages during uniload (this
protects against using catalog.uniload.isLocalPackage before it is
initialized)
Actually verify that uniloaded packages are in the list. Add missing
'ejson'. Remove (ah well) test that relies on ability to uniload an app
package (which shouldn't work anyway, but it would be nice to test
uniload Assets...)
We're going to make uniload use a different flavor of "complete" catalog
soon. So we need to reduce the number of singleton-ish references to
it.
Also, we need one PackageCache per catalog, so stop it from being a
singleton too.
Also eliminated arguments that weren't used anywhere,
and removed an XXX comment that was false (recordPackages
doesn't use buildmessage to report connection failures)
Many of these (mostly in top level commands in commands-packages.js) are
not super well thought out: they use a new "doOrDie" helper to run some
function in a capture and exit if there are any messages. We really
need to get a little more thoughtful about the big picture of error
handling (combining "build" errors, network errors, catalog errors,
etc). But this at least allows the addition of more buildmessage
assertions.
At the very least, this ensures that if you edit a package.js in a local
package while "meteor run" is running, that instead of crashing the tool
it properly shows the buildmessage and lets you fix the issue.
If Autoupdate.autoupdateVersion is set outside of the Autoupdate
package, we wouldn't notify the client of the new version. This
patch simplifies the updating logic by only having one document
per version type.
If we ever load javascript (uniload load or package.js parse) outside of
a buildmessage job and there's a syntax error, FancySyntaxError gets
thrown instead of properly processed. Now, we shouldn't do that (we
should only load JS inside a buildmessage job!) but our codebase isn't
currently up to that standard, so at least ensure that there's some
level of useful syntax error (albeit with an ugly internal stack trace
attached) in this case.