Commit Graph

585 Commits

Author SHA1 Message Date
Slava Kim
cbff527131 Add a spinner option to the admin progressbar-test command 2015-03-02 16:01:31 -08:00
Slava Kim
4af325b222 Add a dummy progress-bar test command for testing 2015-03-02 15:12:21 -08:00
Josh Owens
cc93674277 Set testing to automatically be run once. 2015-02-24 21:50:05 -08:00
Ben Newman
4ad860ca47 Move tools/shell/server.js to tools/server/shell-server.js.
Since this file ends up getting copied into the server bundle, along with
files like boot.js, it makes sense to keep it with those files.

Renamed tools/shell/client.js to tools/shell-client.js for symmetry.
2015-02-09 11:42:49 -05:00
Ben Newman
19080bd53d Split server/shell.js into shell/server.js and shell/client.js.
Note that shell/server.js is copied into the bundle as shell-server.js,
like before, however now it contains none of the extraneous code that
belongs in shell/client.js.

The original reason server and client code were combined in a single file
was to share helper functions and configuration variables (e.g.
getInfoFile and EXITING_MESSAGE). Now, shell/client.js requires
shell/server.js to access those shared exports.
2015-02-06 14:33:19 -05:00
Sashko Stubailo
3cd883bda4 Merge branch 'windows-r' into devel
Conflicts:
	meteor
	tools/tropohouse.js
2015-02-05 20:28:09 -08:00
Slava Kim
599f6b4f37 Convert __dirname 2015-02-05 17:02:19 -08:00
Slava Kim
cbac505a12 Move the mobile check on Windows earlier: before the ip/port parsing 2015-02-05 15:19:53 -08:00
Slava Kim
d3bf1c2cac Improve failing on Cordova on Windows 2015-02-05 01:27:30 -08:00
Slava Kim
d4e90d5008 Don't try to build mobile things on Windows 2015-02-05 01:27:30 -08:00
Ben Newman
5b6f4de2f4 Enforce that meteor shell is run from an app directory. 2015-02-04 19:39:41 -05:00
Sashko Stubailo
b3cb7a49f7 Merge branch 'devel' into windows-cr
Conflicts:
	packages/application-configuration/package.js
	packages/ctl-helper/package.js
	packages/ctl/package.js
	packages/dev-bundle-fetcher/package.js
	packages/follower-livedata/package.js
	packages/jquery/package.js
	packages/star-translate/package.js
	packages/test-in-browser/package.js
	tools/bundler.js
	tools/compiler.js
	tools/package-client.js
	tools/package-source.js
	tools/package-version-parser.js
	tools/server/boot.js
2015-02-04 13:56:54 -08:00
Sashko Stubailo
1bd73d2cb3 Print a better message on package creation 2015-02-04 13:07:57 -08:00
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 Glasser
df37fe5a9d Remove legacy login support
This includes `meteor login --galaxy`.

We still should be capable of cleaning up legacy tokens when we find
them.
2015-01-29 14:03:11 -08:00
David Glasser
5cc93cea1a Remove legacy support from deploy-style commands
This includes removing the options `deploy --star`, `deploy --admin`,
and `logs -f`
2015-01-29 14:03:11 -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
074087be8a meteor login --email was supposed to be boolean!
See #3532.

We honestly should probably just drop the option and allow you to type
either a username or a password, just like in accounts-ui.

Because options have to be consistently bool or not across commands (so
that you can put them before the command name), change the testing-only
dummy command's string option to a different nonsense name.
2015-01-27 14:17:41 -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
Sashko Stubailo
3059961704 Make meteor shell work on Windows
We just need to convert paths before passing them to shell.js
2015-01-22 12:31:44 -08:00
Sashko Stubailo
a7eeda6be3 Rename metadata-colon-converter and remove adaptLegacyPath 2015-01-21 14:04:09 -08:00
Sashko Stubailo
ffe1353c55 Remove os.windows.x86_64 from list of valid archs 2015-01-21 14:04:08 -08:00
Slava Kim
ee7d0eda58 meteor create --package never creates paths with colons 2015-01-21 14:01:09 -08:00
Slava Kim
0dfecf2f37 meteor create --packages never creates files w colons 2015-01-21 13:56:53 -08:00
Sashko Stubailo
45e8f40ece Don't make paths with colons in create --package 2015-01-20 22:34:21 -08:00
Sashko Stubailo
06d6126e7e Use named pipes on Windows instead of socket files 2015-01-20 22:34:06 -08:00
Slava Kim
c91bf26f70 New 'get-machine' architecture: os.windows.x86_32 2015-01-20 22:03:23 -08:00
Slava Kim
82ae2e3feb Add windows x64 arch to the list of accepted args
for meteor admin get-machine.
2015-01-20 22:03:22 -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
2aba1dce35 style cleanup 2015-01-13 16:35:39 -08:00
rissem
bfdad18487 support velocity when using test-packages command 2015-01-13 16:33:56 -08:00
Tom Freudenberg
6dc8d5a0a8 Add git info for 'meteor --version' 2015-01-09 15:18:46 -08:00
David Glasser
4381bb86ef add XXX about #3446 2015-01-08 17:25:41 -08:00
David Glasser
ddd2fe8e91 Make 'pretty: true' to the default for commands
It was already set for most common commands, and was unnecessarily not
set for others.

The following commands are remaining "pretty: false":

- Commands that just print machine-parseable text: --version, --arch,
  admin members (without --add or --remove), mongo --url,
  authorized (without --add or --remove), whoami, list-organizations, list-sites
- Commands that just switch over to another codebase's interactive
  command: mongo without --url, admin get-machine, shell

The following commands used to be implicitly "pretty: false" and now
will be pretty:

- A bunch of troposphere admin commands: set-banners, recommend-release,
  change-homepage, set-unmigrated, set-latest-readme
- A few accounts/deploy related commands: logs, claim, login, logout
- remove-platform, reset, self-test
- admin maintainers (which unlike admin members and authorized prints an
  English header before the user list; maybe this is a mistake)

It might make sense in the future to further separate "pretty means can
show progress bars if the output is a TTY" from "pretty means can use
chalk styling and unicode bullets".

Fixes #3162.
2015-01-05 13:56:47 -08:00
David Glasser
00a7da3dd0 Fix test-packages * if some packages lack tests
Fixes #3334.

This was an intentional but poorly thought through change in
1.0.2 (1a9536baa).
2014-12-20 20:38:25 -08:00
David Glasser
74bf18809c Drop browserstack support from built tool
We haven't really been trying to keep 'meteor self-test' passing from
built tool in a while, so why waste the bandwidth?
2014-12-16 21:09:29 -08:00
Ben Newman
f9b7fa19a6 Avoid unnecessary dynamic requires.
CommonJS module identifiers are specified always to use forward slashes,
even on Windows, so there's no value in using path.join or files.pathJoin
to construct module identifiers.
2014-12-16 19:24:58 -05: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
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
ekatek
a79e69130f Merge pull request #3232 from meteor/word-wrap-final
Automatically line-wrap output
2014-12-09 12:23:30 -08:00
ekatek
42b0d9247d remove the extra Warning sign 2014-12-08 18:30:52 -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
25dfd39ef1 Everywhere that we call a raw function, add a new line 2014-12-06 17:38:41 -08:00
David Glasser
8c30bfbef4 Remove unused require
Fixes #3144.
2014-12-04 19:40:05 -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 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
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