Commit Graph

74 Commits

Author SHA1 Message Date
David Greenspan
45752e3203 parseConstraint -> parsePackageConstraint
In the return value, `name` has been changed to `package`,
and `vConstraint` is now `versionConstraint`.

`constraint.package` is better than `constraint.name`, where
`constraint` is a PackageConstraint.  It's also more consistent
with functions like parsePackageAtVersion which return an object
like `{package, version}`.

`vConstraint` was too cryptic.

Changes were discussed with Glasser in a code review.

Troposphere does not call parseConstraint or work with constraint
objects, so it doesn't need to change.

This is a breaking change to the package-version-parser API (or one
method of it, at least), but it is considered an internal API so we
are not worrying too much about it.
2015-02-02 13:13:31 -08:00
David Greenspan
e7ee6184a6 Change return value of utils.parsePackageAtVersion
name -> package, as per code review
2015-02-01 12:53:03 -08:00
David Glasser
0e0dfed6a8 Remove "control program" support
This was support code for a now unused system.
2015-01-29 14:03:10 -08:00
David Glasser
3d5e81bf23 Test the right packages with --test-app-path
Usually the project used for test-packages is a brand-new temporary
project. But you can also use --test-app-path, either for performance
reasons (to share the .meteor/local/isopacks cache between executions)
or because Cordova has issues with /tmp.  Previous to this change,
though, test-packages would leave packages in .meteor/packages from a
previous execution, even if they were packages that we are no longer
testing.

Fixes #3446.
2015-01-26 14:57:42 -08:00
Ben Newman
1aba3a8e7a Eliminate the need for getAppDir in tools/server/shell.js.
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
2015-01-20 13:56:57 -05:00
David Glasser
f61ada859d Refresh catalog if release's tool has no build
This fixes a corner case where if you synced the catalog between the
creation of a release and the creation of its tool's build for your
platform, running `meteor --release R` would fail.

Fixes #3317.
2015-01-08 12:28:25 -08:00
David Greenspan
e885e78348 Change the format returned by PVP.parseConstraint
This is a breaking change to package-version-parser.

A PackageConstraint used to look like this:

```
{ name: String,
  constraintString: String,
  constraints: [{version: String|null,
                 type: String}]}
```

Now it looks like this:
```
{ name: String,
  constraintString: String,
  vConstraint: {
    raw: String,
    alternatives: [{versionString: String|null,
                    type: String}]}}
```

Where (vConstraint instanceof VersionConstraint) and
(vConstraint.raw === constraintString).

This achieves several desirable changes at once.

* `constraint.constraints` for the disjuncts in “1.0.0||2.0.0”
  was confusing.  `alternatives` is better.
* Having a class for VersionConstraint will come in handy because
  we can add methods to it, and we can use it in the constraint
  solver to represent the problem statement.
* The names “vConstraint” and “versionString” are a little verbose,
  but there really shouldn’t be a lot of code that dives into this
  structure, and I really wanted to avoid anyone ever writing:
  `constraint.constraint.alternatives[0].version`, and then wondering
  what sort of object that was (not a parsed PackageVersion! we could
  parse eagerly but that might be slow).
2015-01-07 20:10:44 -08:00
David Greenspan
ed5fd8e6cf Don’t use parseConstraint for “package@version”
At least, not directly.  When the tool wants to parse a string of the
form “package@version,” it now uses utils.parsePackageAtVersion.

This way, if I make a breaking change to PV.parseConstraint, I only have
to change a few call sites.
2015-01-07 19:04:55 -08:00
David Glasser
253ec1a9d0 Don't add all packages with --get-ready! 2015-01-05 09:51:38 -08:00
Sashko Stubailo
e7167e5257 Factor out almost all fs. and path. calls in the tool
This will be useful when we want to be smart with windows file paths later
Also, all of the file calls are asynchronous with fibers now, which comes with
many benefits.

This is a combination of 23 commits. Original messages:
Wrap a large number of fs calls inside files.*

Convert a few more fs calls to files.*

More moving fs.* to files

Implement read/write streams and open/read/close

Get rid of fs from auth.js

Remove fs and unused imports from catalog-local and catalog-remote

Remove unused imports from catalog.js

Replace a whole lot of fs calls

Fix error

Migrate a lot more fs. calls to files.

Add a temporary symlink method

Convert old test to files.*

Use files.pathX instead of path.x everywhere

Replace path.x to files.pathX in tests

Small fixes to files.js and one rename

Make cleanup run in a fiber

Make wrapping functions take function name in case we need it

Add some timeouts and stuff to HCP tests

wrapFsFunc also makes a sync version of the function

Sometimes you just don't want to yield!

Make sure JsImage readFromDisk doesn't yield

Remove unused imports from npm test

Change order of test now that some things don't yield

Fix missing files import, and add a debug error printout
2014-12-15 15:32:06 -08:00
David Glasser
89a441eede publish in app: don't write, display versions
Typically, there is a delta due to adding the test slice of the
published package, but there's no reason to tell the user about this or
save it in .meteor/versions.
2014-12-11 22:36:45 -08:00
David Glasser
809b2b69f5 Don't compile web.cordova unibuilds unless needed
Specifically, we only compile them if there's a cordova platform in the
current project, or if we are publishing the package.

(Ideally, we wouldn't require every published package to have
web.browser and web.cordova unibuilds --- we'd just publish a 'web'
unibuild unless there's actually a difference between the two. But we
are not there yet.)

This adds an extra flag to isopack-buildinfo.json, so that we know to
rebuild all the isopacks when we add the first cordova platform (or
remove the last cordova platform).

The implementation around publish is a little clunky; if you're in a
non-Cordova app and run meteor publish, it will rebuild all the packages
with web.cordova, and the next time you prepare the app it will rebuild
them again without it. It does work though.

Fixes #3274.
2014-12-11 22:26:29 -08:00
David Glasser
1e5b7437a5 Refresh catalog only on relevant errors
Fixes #2846.  Fixes #2847. Fixes #2979.

Errors in the build process that could be fixed by refreshing the
catalog now cause the catalog to refresh, assuming we have not already
refreshed it recently and that we are not offline.

These commands now don't need to refresh at startup: remove, run, debug,
create, build, bundle, deploy, test-packages, rebuild, and self-test

It should be OK for create to throw SpringboardToLatestRelease even
without refreshing, since release.latestKnown is still something we know
about.
2014-12-10 19:03:05 -08:00
David Glasser
d7d51f9dac All downloads use downloadPackagesMissingFromMap
We now can make PackageMaps without a localCatalog, for cases like this
where we really want everything in the map to be downloaded.
2014-12-10 14:42:18 -08:00
David Glasser
d3ff3954bf PackageMap only has a local (not layered) catalog
No need to introduce the LayeredCatalog anywhere it's not needed.

Simplify some more things about LayeredCatalog:

- remove unused containingCatalog link from localCatalog to
  layeredCatalog

- because of that, simplify LayeredCatalog initialization to occur after
  localCatalog (no more circular references required)

- drop some other dead LayeredCatalog methods
2014-12-09 18:43:25 -08:00
David Glasser
4920ad1724 Use current previousSolution on runner rebuild 2014-12-08 22:02:50 -08:00
David Glasser
a937aa606d Soft refresh, versioned packages only
First half of #3213.
2014-12-01 19:48:06 -08:00
David Glasser
ab3d6c5bfb Clean up some #3006 comments 2014-12-01 18:29:20 -08:00
David Glasser
06fbe35d46 Support deploying to legacy Galaxy prototype 2014-12-01 17:42:13 -08:00
David Glasser
7d4757b3ac Show package changes and prerelease warnings
This reimplements functionality that had been removed as part of the
`isopack-cache` branch refactoring.

Information about package changes is encapsulated inside a
PackageMapDelta object on the ProjectContext.  It is the responsibility
of the command that prepares the ProjectContext to choose to call
projectContext.packageMapDelta.displayOnConsole at the appropriate time
if it wishes to display changes.

Part of #3006.
2014-12-01 01:26:35 -08:00
David Glasser
de9536172e Fix anticipated pre-release calculation
This commit fixes a 0.9.3 regression where the calculation of the
topLevelPrereleases object was not updated with the introduction of
disjunction constraints (||) and would always be empty.

topLevelPrereleases and useRCsOK are merged into a single
anticipatedPrereleases option which is now passed in to the
constraint-solver package rather than constructed inside it. (This
object will also be used in ProjectContext as part of PackageDelta
calculation.)

The usedRCs return flag is now called
neededToUseUnanticipatedPrereleases.
2014-12-01 01:26:34 -08:00
David Glasser
1d4c3e7387 comment tweaks 2014-11-25 09:35:34 -08:00
David Glasser
46d31e1ce7 Fix update-related bugs
- don't crash when listing upgraders (2 bugs, introduced on this branch)

- successfully write banners-shown file so that we sometimes print
  shorter banners (introduced with sqlite)

- in self-test tropohouse, keep the sadly necessary symlinks

autoupdate test file now passes!
2014-11-25 09:06:28 -08:00
David Glasser
3d8d5ce88c Fix runner restart on package.js scan failure
cordova-plugins now passes
2014-11-25 09:06:27 -08:00
David Glasser
1ad981ee10 hopefully implemented --from-checkout 2014-11-25 09:06:26 -08:00
David Glasser
aba516de9c maintain a .versions file in package source tree
for standalone packages only (packages in an app just use
.meteor/versions from the app)
2014-11-25 09:06:26 -08:00
David Glasser
602e6f5539 Include .versions file in source for publish 2014-11-25 09:06:25 -08:00
David Glasser
c55c76280b save pluginProviderPackageMap when compiling
move PackageMap to IsopackCache constructor
2014-11-25 09:06:24 -08:00
David Glasser
06114d6983 Fix 'meteor publish'
only works from inside an app! does not include a version lock file!
2014-11-25 09:06:24 -08:00
David Glasser
275456054f Drop test-runner-app from repo
ProjectContext now makes sure to turn the given directory into a project
directory if it isn't one yet.

Add --show-test-app-path to test-packages.
2014-11-25 09:06:23 -08:00
David Glasser
b07c3578ac package update works now 2014-11-25 09:06:23 -08:00
David Glasser
e88f588cfc Fix updating releases (not package update though)
Move run-upgrader command under 'admin'
2014-11-25 09:06:23 -08:00
David Glasser
e1572801d5 Revert "releaseFile.setRelease should be in-memory only"
This reverts commit 3735ff62d51af6c7e537d5c3fe35e79cebb68735.
2014-11-25 09:06:23 -08:00
David Glasser
11ab8edaa9 releaseFile.setRelease should be in-memory only
This will let us try several times for 'meteor update' and not write
until success.
2014-11-25 09:06:23 -08:00
David Glasser
d9ff79cd9c CHECKPOINT mid meteor update 2014-11-25 09:06:23 -08:00
David Glasser
4767b830d0 comment on ProjectContext 2014-11-25 09:06:23 -08:00
David Glasser
1a4dcef219 drop utils.splitConstraint 2014-11-25 09:06:22 -08:00
David Glasser
61b1493ee9 Fix meteor add 2014-11-25 09:06:22 -08:00
David Glasser
a553048fe6 don't write .meteor/packages changes until ready
ie, don't update .meteor/packages unless we know the new constraints can
be resolved!

The current calls are from remove and test-packages, which should
generally succeed.  But add is different.
2014-11-25 09:06:22 -08:00
David Glasser
20200f7130 Fix meteor remove 2014-11-25 09:06:21 -08:00
David Glasser
12851424d4 remove completed XXX #3006 comments 2014-11-25 09:06:21 -08:00
David Glasser
5fcab5c42d fix 'meteor rebuild' 2014-11-25 09:06:20 -08:00
David Glasser
1a9536baa2 Fix test-packages
See #3012, though.
2014-11-25 09:06:20 -08:00
David Glasser
2410cec49d preserve spaces and comments from .meteor/packages 2014-11-25 09:06:20 -08:00
David Glasser
7b256e58c2 allow you to progress ProjectContext to any step 2014-11-25 09:06:19 -08:00
David Glasser
f7f77b44cd Fix add-platform 2014-11-25 09:06:19 -08:00
David Glasser
637a3ec37b Fix remove-platform 2014-11-25 09:06:19 -08:00
David Glasser
2b818092ce 'meteor run ARGS' (cordova) works now 2014-11-25 09:06:19 -08:00
David Glasser
c344278b96 Fix up stats.
Satisfyingly delete a long comment explaining how somehow it is annoying
to work with a codebase that's full of singletons.
2014-11-25 09:06:18 -08:00
David Glasser
f0ff76a24b watch local package search dirs 2014-11-25 09:06:18 -08:00