Commit Graph

3742 Commits

Author SHA1 Message Date
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
44563f13b4 Allow prerelease parts with digits and nondigits
Previously the constraint solver crashed on such things.

Fixes #3147.
2014-12-09 20:33:06 -08:00
David Glasser
6ea8443f30 Update calls to addFiles, onUse, and onTest 2014-12-09 20:18:31 -08:00
David Glasser
e7bfa5202e Update packages to use Package.registerBuildPlugin 2014-12-09 20:09:34 -08:00
David Glasser
21a34a98b3 Show mongod exit message if it started up OK
Fixes "run with mongo crash" test
2014-12-09 19:52:03 -08:00
David Glasser
118e330cba fix deadlock in mongod startup failure
AppRunner.stop needs to be able to cause any Future which the AppRunner
is waiting on to return, so that it can get back to the top level of its
loop and return. (This is because for some reason it is important that
AppRunner.stop does not return until the app is guaranteed to be
stopped.)  This had not been the place for the injected "wait for mongo
to start up before running the AppProcess" future.

This also means we can't use f.future() any more, because that code
assumes that it is the only code allowed to resolve its future (it
unconditionally resolves the future when the wrapped function returns,
which is an error if it is already resolved).

This is tested by 'run errors' which was failing.  Also, the test should
only expect 2 unexpected exit code messages, not 3, since we don't print
the message the first time which didn't have a kill before it.
2014-12-09 19:38:09 -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
31a43fc019 prune dead code 2014-12-09 18:30:22 -08:00
ekatek
a79e69130f Merge pull request #3232 from meteor/word-wrap-final
Automatically line-wrap output
2014-12-09 12:23:30 -08:00
Ben Newman
ba89b7db60 Automatically attach to and continue debugger when server restarts. 2014-12-09 13:38:28 -05:00
David Glasser
70f257c0e4 Memoize calls to js-analyze 2014-12-08 23:18:15 -08:00
David Glasser
4920ad1724 Use current previousSolution on runner rebuild 2014-12-08 22:02:50 -08:00
ekatek
c8e2c9f9d9 change to the right slash 2014-12-08 18:44:28 -08:00
ekatek
07ff83f2c9 rename Console.directory to Console.path, do not escape spaces
Rename Console.directory to Console.path.

Do not attempt to automatically escape spaces in file paths -- it is
hard to define a function that does this only sometimes, rather than all
the time. This is something that we could change later, once we have a better
idea of when we use it.
2014-12-08 18:37:49 -08:00
ekatek
8d213d0cb0 fix some newline breaks 2014-12-08 18:34:38 -08:00
ekatek
42b0d9247d remove the extra Warning sign 2014-12-08 18:30:52 -08:00
ekatek
9085975913 automatically escape spaces when printing directories
Directories should not wrap, but, also, we should make sure to automatically
escape spaces ("/ab/a\ b.js" vs "/ab/a b.js"). Because we might need to deal with
user input, we don't know if the user has already escaped the spaces before getting
the string. As such, we should only escape spaces that haven't already been escaped.
2014-12-08 14:54:36 -08:00
ekatek
f3e3dc7bca rename doNotWrap to noWrap in console.js' 2014-12-08 14:44:36 -08:00
ekatek
bcf6b200e1 introducing and using Console.directory
I think that this makes the API too complicated, but we might want to treat
directories the same way that we do commands (use some chalk when needed,
do not wrap, etc). This introduces the Console.directory function.

Of course, it is not really clear to me what happens if a directory is inside a command.
(ex: 'cd <directory>'). Right now, there is no difference. It makes sense to me that
we might want to keep the entire command the same style, so I am not wrapping those
in additional Console.directory units for now.
2014-12-08 14:15:54 -08:00
ekatek
f4d9e5bff1 adding extra line breaks to some cordova output
Glasser thinks it looks better with more newlines. I am not sure that's true --
but it looks kind of stern either way, so might as well add them in.
2014-12-08 13:57:24 -08:00
ekatek
714ed749e7 for URLs replace spaces with %20 instead of just taking care to not wrap them 2014-12-08 11:57:36 -08:00
ekatek
6bf699d5d9 Fixed some mistypes 2014-12-06 19:13:51 -08:00
ekatek
0b4cdc6e12 minor cleanup
- renamed an argument from 'opts' to 'options' in the comments as well.
- fixed some forgotten quotes.
2014-12-06 18:42:36 -08:00
ekatek
c9928d9c3a responding to minor fixes on 3232
- Wrapping URLs in Console.url. Making Console.url not word-wrap URLs,
on the off-chance that a URL could be wrapped.

- Creating a doNotWrap function on the Console. Call this on things that
are not commands or URLs, but still should not be wrapped.

- fixing minor mistypes, removing a comment about the dev bundle on the
Windows branch.
2014-12-06 18:32:40 -08:00
ekatek
8bf5db2de0 eliminate legacy stdout.write and stderr.write functions from Console
Now that we no longer have an automatic newline on printing, we don't have to support
the awkward legacy functions that the Console used to provide. Eliminating.
2014-12-06 17:42:07 -08:00
ekatek
25dfd39ef1 Everywhere that we call a raw function, add a new line 2014-12-06 17:38:41 -08:00
ekatek
dd96477c51 do not automatically print a newline
Raw print functions should not actually print a new line -- that's
an example of processing that we should be doing in the non-raw functions.
As such, _print should not add a new line at the end!

This means that other functions that DID intend to end a new line should add
one manually. Also, a minor refactor to have less repetitive code in the wrapping functions.
2014-12-06 17:22:04 -08:00
Sashko Stubailo
0cdc382a72 Replace occurences of "elide" with "omit" 2014-12-05 15:32:57 -08:00
Sashko Stubailo
3e6f09f08b Fix if statement typo in error handling 2014-12-05 15:31:39 -08:00
David Glasser
76745d27b2 Document use of undocumented runInThisContext flag
Accidentally removed in 2d827e74f.

Fixes #3200.
2014-12-05 12:19:54 -08:00
Utkarsh Upadhyay
bf9b67e756 Call correct function on error in fetching assets.
Instead of trying (and failing) to call a function on underscore, call the correct `_callback`.
2014-12-04 19:49:39 -08:00
David Glasser
8c30bfbef4 Remove unused require
Fixes #3144.
2014-12-04 19:40:05 -08:00
David Glasser
a34585b4b3 default packages file: mention checking in
Fixes #3127.
2014-12-04 19:17:29 -08:00
ekatek
24a4ed9bdc Automatically line-wrap output
Includes the following changes to Console.js:

- Console.info, Console.warn, Console.debug and Console.error now automatically
  line-wrap the output to 80 characters, or the width of the terminal screen (if
  known). This is in line with our current style guide on how things should be wrapped!

- Sometimes, there are parts of text that we don't want to line-wrap. For example, if we are
  telling the user to run 'meteor long-command --with --options' we don't want to
  have a newline in the middle of that! Wrap those commands in Console.command, like
  this:
     Console.info("something and then run", Console.command(command), "and then");
  This also makes them bold if chalk is on, as a nice bonus. So, if we ever turn
  chalk back on, the bolding of commands will be more consistent.

- Sometimes, there is bulkier output that we don't want to format at all, including
  line-wrapping: log snippets, stack traces, JSON output, etc. In that case, we can use
  Console.rawInfo, Console.rawError, Console.rawWarn and Console.rawDebug. Don't use
  Console.command inside the raw* functions! It won't be processed (at all).

- There are fancier things that we can do, other than just simply wrapping things.
  We can indent:
  "  Start here and then when wrapping
     continue over here".

  We frequently do this for commands, for example. In the past, we did this manually --
  but we can't do this for long messages that might get wrapped, and anyway, it is
  good to codify this instead of counting spaces. Allows us to be better about consistency,
  for example.

- We can also add a bulletPoint, which is a small notice in the beginning that looks like
  this:
  " => Start here and then when wrapping
       continue below the bulletPoint".

  Since it is a elss intuitive option, I have wrapped most of the time that we use a
  bulletPoint into helper functions on the Console.js.

- Some common bulletpoints that we use are:
    ASCII Checkboxes (Console.success)
    ASCII X-s (Console.failWarn and Console.failInfo)
    =>  (Console.arrowError, Console.arrowWarn, Console.arrowInfo)
    WARNING (Console.labelWarn)

  The => are sometimes indented, so they take an optional indent argument, showing how
  many spaces to indent by.

The wrapper interface would be less complicated, if there was a more unified conceit behind our
terminal messages. If there is one, it is not documented. My hope is that, in many cases,
moving these to Console will make it easier for someone with great product sense to
clean up our terminal messages. It will also make it easier to write such messages, since
it will be easier to follow an accepted standard.

In the codebase outside of Console:

- Went through and looked at our use of Console.error/info/etc, replacing with rawError/etc
  whenever approporiate.

- Went through and modified most of 'stdout' and 'stderr' calls to use the new functions.
  I made an exception for stuff that doesn't want a new line at the end, or otherwise does
  weird things (ex: print user logs directly), on the basis that, at this juncture, it is
  better to be safe than to be sorry.

- Long messages no longer need to break the code style guide by ignoring indentation rules.
  Fixed that where approporiate.

- Fixed the tests! A number of our stock messages are actually longer than 80 chars.

- Personal favourite: The Android license agreement is now line wrapped! Much better experience.

- There is some more work to do on:
  - longform help (currently comes with built-in linebreaks, would have to change the entire
    mechanism for how that works)
  - Buildmessage sometimes has headers that start with =>, but they are short. I didn't want to
    pass wrapper options all the way to main.captureOrExit before merging the rest of this and
    making sure that we like it. Since these messages are fairly short, I don't think that's
    likely to be a serious problem.

I hope that this makes life easier for us in the future! No more counting chars, no more breaking
the style guide. Better experience for users with wider terminals (or even shorter terminals!).
Let's give this a try.
2014-12-04 17:56:04 -08:00
David Glasser
0011e00a7e rebuild now requires an app 2014-12-04 15:37:52 -08:00
David Greenspan
861fe1d502 Fix spacing in error message 2014-12-04 09:21:48 -08:00
Graeme Pyle
e63ac7c071 Prevent REPL from stomping global._ (Underscore library)
The return value of last command is stored in global._ if the REPL is set to use the global context. So Underscore is no longer available to Meteor server code as global._

See http://stackoverflow.com/questions/10973968/underscore-doesnt-work-in-coffeescripts-console
2014-12-04 16:23:58 +02:00
David Glasser
062fbefa35 clean up formatting 2014-12-03 14:58:54 -08:00
Uri Goldshtein
d7396ffb1e docs: add web.browser and web.cordova as architecture possibilities in package.js 's api.use, api.addFiles and api.export 2014-12-03 14:56:55 -08:00
David Glasser
021e9f767d Don't include line number comments in isopackets
The extra legibility is not as useful for code that is always part of
core as it is for user's packages, and it actually has a notable (25%)
effect on isopacket load time.

Fixes #3218.
2014-12-03 12:38:20 -08:00
David Glasser
14cdfa0e02 Factor out common code for building isopackets 2014-12-03 12:28:45 -08:00
Ben Newman
ff7863d3e2 Start Mongo in parallel with the build.
For freshly created apps, this commit reduces the time required to start
the development server from 4.6s to 2.5s on my machine.

Not calling findMongoAndKillItDead unless Mongo fails to start shaves off
a few hundred milliseconds, too.

Fixes #3010.
2014-12-02 18:21:36 -05:00
David Glasser
a937aa606d Soft refresh, versioned packages only
First half of #3213.
2014-12-01 19:48:06 -08:00
David Glasser
2f90467da0 Optimize constraint solver's catalog interface
We shouldn't ask sqlite for a list of rows and then go back and ask for
each row one by one!

Addresses #3043.
2014-12-01 19:20:28 -08:00
David Glasser
3c1c568530 Add indices for all sqlite queries
Addresses #3043.
2014-12-01 19:03:10 -08:00
David Glasser
701bf7872e Remove final #3006 comment 2014-12-01 18:39:40 -08:00
David Glasser
050a01dcf2 Move tryRevokeOldTokens to background fiber
And increase the timeout while we're at it.
2014-12-01 18:38:39 -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
04a65c19e4 fix make-bootstrap-tarballs 2014-12-01 17:00:06 -08:00