Commit Graph

99 Commits

Author SHA1 Message Date
David Glasser
cb33da8536 Missing space in login message 2014-12-17 00:36:22 -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
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
170c0acad7 Rename unibuild everywhere to isopackets 2014-11-07 16:45:58 -08:00
David Glasser
f2bac4b7d4 Stop having a ddp-and-mongo isopacket 2014-11-07 16:45:58 -08:00
David Glasser
9cab094f18 uniload now works via named "isopackets"
You can only request a named set of packages, not a random assortment.

In future commits, we will pre-build these packages into JsImages and
load them from that. Building packages for uniload will eventually not
involve the .build.foo directories at all.  (All saved packages will be
built in app context, eventually.)
2014-11-07 16:45:57 -08:00
Emily Stark
91c6d70454 Revert "Don't automatically put ?close at the end of Meteor Developer Accounts URLs"
This reverts commit 05d2c5edd7.

We haven't worked out all the backwards-compatiblity issues of
non-?close and ?close OAuth servers and clients yet, so let's leave this
as is now, and ensure that all the services that the tool talks to
accept ?close URLs.
2014-10-11 00:17:22 -07:00
ekatek
05d2c5edd7 Don't automatically put ?close at the end of Meteor Developer Accounts URLs
MDA stuff configured with the new tool does not use ?close, and the one configured with
the old tool, does. We are not going to automatically try contacting the ?close anymore,
since that doesn't work in the future; for backwards compatibility, we went through package
server & stat server and added the close-less urls for the new tool to use.
2014-10-10 15:59:32 -07:00
David Greenspan
9922283515 Disable progress bar when prompting
Can’t tell for sure if it works, but it ought to
2014-10-03 14:51:22 -07:00
Sashko Stubailo
84f1fcace1 Fix docs and self-test 2014-08-29 11:52:33 -07:00
Sashko Stubailo
96952dda2b Rename Meteor.Collection -> Mongo.Collection 2014-08-29 10:11:21 -07:00
Sashko Stubailo
3189a364e9 Rename livedata to ddp, meteor test-packages passes 2014-08-28 12:53:34 -07:00
Sashko Stubailo
be8c503760 Rename mongo-livedata to mongo 2014-08-28 11:14:40 -07:00
Emily Stark
f7c4e8a3b4 Rename orgs commands 2014-08-27 08:54:19 -07:00
Emily Stark
922e1099a7 create-organization and list-organizations commands 2014-08-27 08:54:18 -07:00
Emily Stark
38d6525cea Do login prompt when talking to package server with expired credential 2014-08-26 17:04:42 -07:00
David Glasser
196089ae33 package-client: Help users without usernames
- If they're in deferred-registration state, give them their
  registration link and exit.

- Before running the login prompt, mention that it's a Meteor developer
  account which you can sign up for on www.meteor.com.
2014-08-18 19:13:06 -07:00
David Glasser
08a6fa99fd Don't use _.once or instanceof with uniload
_.once has the problem that if you call the once'd function while it is
still in progress (re-entrantly or in another Fiber), it returns
undefined immediately.  That's bad for uniload! uniload already has a
cache, so just use that.  (In the future, perhaps detect an attempt to
uniload something that's currently in the process of being uniloaded in
another fiber and block until the other fiber is ready.)

Using instanceof with things you've uniloaded is a little sketchy: maybe
two different uniload calls will end up with two different copies of
Package.meteor.Meteor.Error, and it seems kind of hairy to ensure you're
not mixing and matching copies.  However, Meteor.Errors are all tagged
with a string errorType, which fills me with much less fear,
uncertainty, and doubt than instanceof.
2014-08-17 23:37:38 -07:00
Emily Stark
07852ebcbe Fix galaxy login 2014-08-04 20:38:33 -07:00
David Glasser
7d05640ea0 Make buildmessage fiber-aware
Port a simplified version of Meteor.EnvironmentVariable and
Meteor.bindEnvironment to fiber-helpers.js to deal with this.

Identify uses of fiberHelpers.inFiber and switch them to either
fiberHelpers.bindEnvironment (if the callback they are wrapping is
semantically "part of" the context that creates the callback) or
fiberHelpers.inBareFiber (otherwise).

Without this, concurrency was causing the wrong buildmessage message
sets and jobs to be active when builds yielded.
2014-08-04 19:03:05 -07:00
Emily Stark
f761e898c8 Record session id on package stats 2014-06-25 11:12:12 -07:00
Emily Stark
2da8567df7 Add OAuth login to package stats reporting 2014-05-12 13:49:35 -07:00
Emily Stark
d2f27edba9 Factor out OAuth login from package-client 2014-05-12 13:04:46 -07:00
David Glasser
9d70ff64c9 springboard almost works
springboarding happens infinitely because of build ids

have to manually bootstrap a tropohouse

fixed some other things:

 - store package server token in correct domain
 - copy files (eg packages pre-publish) with +x flags
 - catalog.getReleaseTrack works
 - don't pass release to uniload (Meteor.release will always
   end up 'UNILOAD')
 - fix building meteor-tool again
 - stop supporting apps without .meteor/release
 - merging unipackages with tools works

springboarding to warehouse releases totally not supported
2014-05-05 19:18:34 -07:00
Emily Stark
2e0b54e038 Attempt to handle package server errors gracefully.
Still needs some more work and tests.
2014-03-25 10:59:51 -07:00
Geoff Schmidt
688f7b3643 rename unipackage.load to uniload.load 2014-03-13 21:47:12 -07:00
Geoff Schmidt
3f8beb0935 unipackage.load no longer takes a library 2014-03-11 14:42:42 -07:00
David Glasser
6f42a3f9d0 Potential fd leak 2014-03-05 14:27:58 -08:00
David Glasser
fdc7209dff Better error handling around a method call
- Make sure not to double-resolve a future (using two different
  techniques!)

- Try/finally cleanup some resources
2014-03-05 14:01:41 -08:00
Emily Stark
e462df2e72 Refactor package server OAuth flow 2014-03-04 11:34:26 -08:00
Emily Stark
d50049777f A quick-and-dirty 'meteor publish' command.
It more or less works, but needs lots of cleanup.
2014-02-28 02:03:02 -08:00
Emily Stark
89b1a73002 Make options optional on pollForRegistrationCompletion 2014-02-19 23:43:18 -08:00
Emily Stark
857b4e0a4c Merge branch 'meteor-accounts-ux-pass' of github.com:meteor/meteor into meteor-accounts-ux-pass 2014-02-19 19:37:12 -08:00
Emily Stark
829dfdac68 Don't log out an invalid session immediately before deploy.
When we deploy:
* If we are logged in with a username, then we go straight to doing the
  actual deploy.
* If we are logged in without a username, we check if we have a username
  yet. If we have an invalid credential at this point, we do NOT want
  `pollForRegistrationComplete` to wipe our session file, because we
  already passed the point at which we handle the case of the user being
  logged out. Instead, we just want to continue with the deploy and let
  the deploy server handle the expired credential. (This case, where a
  user's credential has been expired before they set a username,
  shouldn't happen too often in real life.)
* If we deploy with an invalid credential, we get an "Expired
  credential" message.
2014-02-19 19:35:19 -08:00
Geoff Schmidt
32ad71e50e Improve email-in-use flow 2014-02-19 16:24:16 -08:00
Emily Stark
c8e75d9afc Use fut.isResolved() instead of a separate 'resolved' variable.
Add test for 'meteor whoami' after setting username but before logging
in again.
2014-02-19 14:46:28 -08:00
Geoff Schmidt
d1d714ec66 'whoami' gracefully handles revocation of a credential
on a passwordless account. with test
2014-02-18 17:25:19 -08:00
Geoff Schmidt
96e3273f28 make account setup link even more handy 2014-02-18 15:43:55 -08:00
Geoff Schmidt
97d2264a3a Fix a "Future resolved more than once" error 2014-02-18 15:38:26 -08:00
Geoff Schmidt
bee4fbbd24 Reprompt if they enter a blank username to logs or mongo. With test. 2014-02-18 14:48:29 -08:00
Emily Stark
553bf14c78 Remove duplicate getSessionFilePath() function.
METEOR_SESSION_FILE is the only environment variable for setting your
session file now, not SESSION_FILE_PATH.
2014-02-13 19:13:32 -08:00
Emily Stark
20800f4be7 Make email prompt also accept a username 2014-02-12 12:27:03 -08:00
Emily Stark
76464f647d Give login prompt when necessary on logs/mongo commands.
Add tests for authentication on logs and mongo commands.
2014-02-12 11:22:57 -08:00
Emily Stark
5306fee89d Fix missed stderr login prompt 2014-02-10 19:25:45 -08:00
Emily Stark
d7cc7142d0 Get rid of authConn().
Add some helpers like `withAccountsConnection` for running functions
that need a connection to the accounts server.
2014-02-10 19:12:52 -08:00
Emily Stark
b771f4042e Clean up some legacy app error messages 2014-02-09 17:15:26 -08:00
Emily Stark
5ecbbd65e1 Ask accounts server for a username if we don't know of one yet 2014-02-08 17:26:26 -08:00
Emily Stark
38734b94e6 Use stderr instead of stdout in login command.
This is consistent with old password prompts (see #1600), and also makes
it so that everyone who calls `doInteractivePasswordLogin` is using the
same stream as `doInteractivePasswordLogin`.
2014-02-08 16:25:29 -08:00
Emily Stark
aabed4665c Print login failed error message once instead of twice 2014-02-06 10:14:32 -08:00