Commit Graph

104 Commits

Author SHA1 Message Date
David Glasser
16af5c4756 Use setImmediate instead of setTimeout for yields
It's faster and still lets IO and signals through.
2014-12-11 12:40:03 -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
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
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
ad78915322 Fix meteor add cordova:* (but not add packages) 2014-11-25 09:06:21 -08:00
David Glasser
17f5cf6273 'meteor bundle' works with ProjectContext!
- the 'programs' subdirectory is no longer supported

- includeDebug is now an option to bundler.bundle, not global state

- some cordova-specific stuff has been disabled

- lots of other commands are presumably entirely broken
2014-11-25 09:06:12 -08:00
Sashko Stubailo
be644e474e Improve name of escape function for package names 2014-11-12 15:31:10 -08:00
Sashko Stubailo
d2881cfea2 Add functions for escaping and unescaping package names for FS 2014-11-12 15:28:44 -08:00
David Glasser
8793d26d43 fix checkout message if app release lacks METEOR@
Reflow a word-wrapped message to look better

All non-slow 'releases' tests pass now
2014-10-23 10:51:20 -07:00
Justin SB
e92f9b3ff9 Style fix: use _.map instead of _.each 2014-10-22 10:03:42 -07:00
ekatek
f2378ce616 some processing on how we display release name 2014-10-21 17:49:48 -07:00
Justin SB
a25173a71c Format meteor show nicely
We only do 'meteor show mypackage', not 'meteor show mypackage@1.0'
2014-10-21 17:07:45 -07:00
Justin SB
2f86bdf406 Move patience to console 2014-10-17 11:27:16 -07:00
Justin SB
e7eff3e213 Move todo to the right place 2014-10-17 11:27:16 -07:00
Justin SB
d1fdb06103 Add yield to Console.nudge(), remove old exponential nudge which didn't look right 2014-10-17 11:27:13 -07:00
Justin SB
ee5e99d406 Prettier meteor show 2014-10-17 07:15:20 -07:00
Justin SB
a3be9a0ac6 Make meteor search output prettier 2014-10-17 06:26:47 -07:00
Emily Stark
998ca6debf Move netroute require into function where it's used 2014-10-15 10:53:53 -07:00
Emily Stark
301eb65637 Put 'netroute' into dev bundle 2014-10-14 21:14:14 -07:00
Justin SB
96bccec0ac Throttle yields, so we don't slow down in case of rapid calls to yield
This restores the behavior I lost when I removed Patience
2014-10-09 15:48:40 -07:00
Slava Kim
497af45dd8 Whitespace 2014-10-06 23:27:07 -07:00
David Glasser
94ab470b2f fix test-packages and clarify utils.parseUrl docs 2014-10-06 21:18:51 -07:00
David Glasser
7890b14e4e Allow dots in pre-release tag in release versions
We started calling our releases 0.9.3.1-rc.0 to match what you need to
do in semver to get proper numeric comparisons; let's make sure to
create orderKeys that work with them.
2014-10-06 17:01:51 -07:00
Sashko Stubailo
94074d5972 Very carefully handle all of the different cases for servers and ports
1. mobile-server passed
2. running on device
3. running on simulator
2014-10-03 21:06:22 -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
Emily Stark
3069788e01 Rework --mobile-server defaults.
* --port now requires a port ('meteor run --port example.com' isn't valid).
* --mobile-server defaults to your detected IP address and the port from
    --port.
* If you provide a value for --mobile-server, we default to http:// as
  the protocol. A host is required for --mobile-server if you don't omit
  the option entirely. Similar for the --server argument to 'meteor
  build'.

This commit includes the 'netroute' npm module as a core package (which
has binary dependencies) for IP detection. It would be nice to put it in
packages/non-core, but I think it has to be a core package in order to
uniload it.
2014-10-03 12:11:44 -07:00
Justin SB
21adbca461 Check the AVD exists, create if not, launch using android-launch 2014-10-01 18:33:43 -07:00
Justin SB
90a24c9bd8 Check for meteor avd 2014-10-01 15:18:38 -07:00
Emily Stark
c5fdf45568 Rename 'parseHostPort' to 'parseUrl' and add tests 2014-09-29 17:53:00 -07:00
Emily Stark
257de8a62e WIP: '--mobile-port' to '--mobile-server', and allow https 2014-09-29 17:53:00 -07:00
Slava Kim
573f8462e5 Improve Android logs filtering 2014-09-23 15:46:58 -07:00
ekatek
18ffeafe20 start patience messages on a new line 2014-09-19 19:42:01 -07:00
ekatek
a4bc4c16e8 search should show RC packages optionally; sort alphabetically on lists 2014-09-14 19:09:37 -07:00
ekatek
7af9519dc4 bettter message about experimental package versions 2014-09-10 16:17:25 -07:00
ekatek
390b6394b5 strip out extra dependencies on semver in tool 2014-09-10 15:53:23 -07:00
Matthew Arbesfeld
75427d70ce Merge branch 'devel' into cordova-hcp
Conflicts:
	docs/client/docs.js
	examples/leaderboard/.meteor/versions
	meteor
	packages/backbone/package.js
	packages/constraint-solver/package.js
	packages/meetup/package.js
	packages/meteor-tool/package.js
	packages/showdown/package.js
	packages/stylus/package.js
	scripts/admin/meteor-release-experimental.json
	tools/commands-packages.js
	tools/commands.js
	tools/project.js
	tools/tests/old/app-with-private/.meteor/versions
	tools/tests/old/app-with-public/.meteor/versions
	tools/tests/old/empty-app/.meteor/versions
2014-08-27 13:38:57 -07:00
Slava Kim
beb5b95312 Run adb logcat -c asynchronously
so we can print out errors and timeout the operation. Should help in case of
having more than 1 device or emulator open or having an emulator from a wrong
enviornment being open and confusing the user.
2014-08-25 15:40:52 -07:00
David Glasser
e36c4184ab fix old bundler test failure 2014-08-21 17:46:51 -07:00
David Glasser
5d5d1876da De-dup package name/constraint parsing code
Now we can all any of them from even before uniload is ready in the tool

I <3 symlinks
2014-08-21 17:00:21 -07:00
David Glasser
5bc415c51a Improve package name/version parsing errors
We now throw more specific errors, consistent between both tools and
package-version-parser (copy-and-pasted code, sadly, but we really do
have to make this check before uniload-from-checkout).
2014-08-21 16:21:12 -07:00
ekatek
c89ff1fa25 check to make sure package names don't start with a dot 2014-08-21 13:49:36 -07:00
Matthew Arbesfeld
df38c100a9 Merge branch 'release-0.9.0' into cordova-hcp
Conflicts:
	tools/commands-packages.js
	tools/utils.js
2014-08-20 20:57:24 -07:00
David Glasser
0bc445e8d2 Make slow operations more bearable with Patience
Introduces a "Patience" class which lets CPU-bound operations like the
constraint solver yield every so often, and print messages if an
operation (CPU-bound or not) are taken or not.
2014-08-20 15:49:58 -07:00
Matthew Arbesfeld
88ed2422a6 Add --verbose command for 'run and 'test-packages' 2014-08-20 01:23:38 -07:00
Matthew Arbesfeld
66e8f13ea9 Merge branch 'devel' into cordova-hcp
Conflicts:
	meteor
2014-08-13 17:37:05 -07:00
Slava Kim
0abd01b7ee Check for options hash 2014-08-13 17:16:19 -07:00
Slava Kim
9e44f25cf5 Download android_bundle only on actual Android use 2014-08-13 17:15:25 -07:00
David Glasser
4ac78a3646 Move DEFAULT_TRACK to catalog module
It's a constant, so no need to have to think "hmm, I wonder if I should
be writing catalog.official.DEFAULT_TRACK or
catalog.complete.DEFAULT_TRACK?"
2014-08-13 15:39:03 -07:00
Slava Kim
8f30d7779d Extract the android_bundle download logic into a separate code.
+ Refactor parts of async/sync child process calls
2014-08-11 22:53:08 -07:00