Commit Graph

24 Commits

Author SHA1 Message Date
Slava Kim
312d395daa Fix comment per glasser's comments 2015-02-05 16:29:49 -08:00
Sashko Stubailo
a75cae93ed Merge branch 'devel' into windows-r
Conflicts:
	packages/package-version-parser/package.js
	tools/bundler.js
	tools/server/boot.js
2015-02-04 15:50:31 -08:00
Slava Kim
54878cc8fc Add a TL;DR comment to Isopackets 2015-02-04 12:28:32 -08:00
Slava Kim
a46d590a96 Move tiny-profile to tools to avoid circular dependencies 2015-02-02 19:10:09 -08:00
Slava Kim
9243bfad3d Profiling in Isopack.saveToPath 2015-02-02 15:53:38 -08:00
David Glasser
299f413617 Remove support code for legacy systems
Summary:
What I'm looking for here is: attention to the few parts that aren't just
deletions (eg in auth.js), and thoughts about if removing any of these things
might break systems I haven't thought about.

Test Plan: test-packages, self-test (which mostly passes)

Reviewers: ekatek

Differential Revision: https://phabricator.meteor.io/D18
2015-01-29 14:03:41 -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
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
bc53d5f1e4 Use case in buildmessage titles consistently
Job names should not be capitalized (so they look OK in "While xxx"
messages), and are capitalized by the progress bar.

Fixes #3003.
2014-12-11 14:40:16 -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
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
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
David Glasser
ff3e4439d4 PackageSource and buildJsImage don't need catalog
It wasn't really being used for anything anymore except complaining
about api.versionsFrom being used during isopacket builds, which is now
implemented in a simpler way.
2014-12-01 01:41:13 -08:00
Slava Kim
b203cc3d26 fix typo in a comment 2014-11-25 17:14:16 -08:00
David Glasser
c55c76280b save pluginProviderPackageMap when compiling
move PackageMap to IsopackCache constructor
2014-11-25 09:06:24 -08:00
David Glasser
6928c41fee Show progress during isopacket build 2014-11-25 09:06:22 -08:00
David Glasser
12851424d4 remove completed XXX #3006 comments 2014-11-25 09:06:21 -08:00
David Glasser
e921b20caa Remove catalog.resolveConstraints
Also remove the subclass of LocalCatalog used for the isopacket building
catalog... it can just use LocalCatalog and set a flag (which is only
checked in one place).
2014-11-25 09:06:15 -08:00
David Glasser
8aefc5b46f Use IsopackCache to build isopackets 2014-11-25 09:06:11 -08:00
David Glasser
4fa5ae7bcb style: space after bang 2014-11-07 16:45:59 -08:00
David Glasser
807d61c63f Clarify that we build isopackets in order 2014-11-07 16:45:59 -08:00
David Glasser
3e985a83c7 isopacket docs 2014-11-07 16:45:58 -08:00
David Glasser
170c0acad7 Rename unibuild everywhere to isopackets 2014-11-07 16:45:58 -08:00