Commit Graph

82 Commits

Author SHA1 Message Date
David Glasser
cfb21f43e5 Move third-party licenses into subdirectory
This should make them easier to update.
2015-03-17 11:18:57 -07:00
Sashko Stubailo
71b914a296 Add flushing buffers on process.exit to meteor package 2015-03-05 20:04:58 -08:00
David Glasser
9c210f8bcb Fix crash in publish
Specifically, a "no pluginProviderPackageMap on isopack?" error would be
thrown when running publish in the following circumstances:

- You are inside an app (so it uses the app's .meteor/local/isopacks as
  an IsopackCache instead of a temporary directory)
- Your package does not need to be rebuilt (so it gets read in "up to
  date" mode by the IsopackCache)
- Your app has at least one cordova platform (so that
  includeCordovaUnibuild was true on the cached isopack; it is always
  true when building for publish)

In this case, we read the Isopack from disk but didn't keep the
pluginProviderPackageMap that we read from its isopack-buildinfo.json,
which later lead to a crash.

Fixes #3676.
2015-03-03 18:54:53 -08:00
Slava Kim
4eb73b3984 Fix requires to profile.js since we replaced the wrapper with tiny-profile.js 2015-02-05 16:40:14 -08:00
Slava Kim
e6419e7cfe Make all calls to copyDirectory to explicitely state the option "symlink: false" 2015-02-05 16:17:53 -08:00
Slava Kim
24830980d2 Change includeNodeModules mode from 'NODE_PATH' to 'link-to-system-paths'
Changes:
- rename 'NODE_PATH' mode to 'link-to-system-paths'
- the mentioned mode now affects the way node_modules in isopacks are
  copied/symlinked:
  In the new mode the node_modules folders are not even created, the
  program.json for the server program would point to the system path such as
  /User/slava/.meteor/packages/iron_router/version/npm/node_modules instead of
  local 'npm/iron_router/npm/node_modules'
- make the 'symlink' option and explicit argument to builder#copyDirectory as
  the way it used to be before (a hidden state of builder instance) was hella
  confusing
2015-02-04 14:10:47 -08:00
Slava Kim
c41b111c37 Add some documentation on the relation between unibuild, isopack and isobuild 2015-02-04 12:36:39 -08:00
Slava Kim
8232db93dc Fix bugs introduced with includeNodeModules option change 2015-02-03 18:58:40 -08:00
Slava Kim
ffdb98b8f6 Add a lot of profiler frames 2015-02-02 18:06:58 -08:00
Slava Kim
ce558849d3 Revert "Delete extra field on conversion"
This reverts commit 14598f1ca6.

looks like it is causing errors?
2015-02-02 17:24:50 -08:00
Slava Kim
9243bfad3d Profiling in Isopack.saveToPath 2015-02-02 15:53:38 -08:00
Sashko Stubailo
14598f1ca6 Delete extra field on conversion 2015-01-27 16:27:53 -08:00
Sashko Stubailo
d8ac6ee1b9 Include package version parser in tool 2015-01-27 16:01:19 -08:00
Sashko Stubailo
a7eeda6be3 Rename metadata-colon-converter and remove adaptLegacyPath 2015-01-21 14:04:09 -08:00
Sashko Stubailo
8788b39b54 Convert unibuilds on download instead of on load 2015-01-20 22:34:22 -08:00
Sashko Stubailo
42fe815e0f Don't convert isopacks on load anymore 2015-01-20 22:34:22 -08:00
Sashko Stubailo
f90a7ab0d0 Convert some more colons 2015-01-20 22:34:18 -08:00
Sashko Stubailo
bb21c1750f Fix path lengths and some symlink issues 2015-01-20 22:08:14 -08:00
Sashko Stubailo
1d8491d916 Make linking to meteor tool work 2015-01-20 22:04:23 -08:00
Slava Kim
1565475894 Never generate colons in file paths or serve paths
When building isopacks
2015-01-20 22:04:23 -08:00
Slava Kim
8969d82e61 A step towards converting all formats in one place 2015-01-20 22:04:22 -08:00
Slava Kim
40f572ebb1 Refactoring of isopack formats conversions 2015-01-20 22:04:22 -08:00
Sashko Stubailo
b462b95111 Use isopack metadata to find existing builds 2015-01-20 22:03:21 -08:00
David Glasser
6a55c35837 Implement soft refresh.
Fixes #3213.

Also ameliorates the memory leak of parsedSourceMaps in
files.runJavaScript (because now we don't reload unchanged plugins).
2014-12-17 00:13:07 -08:00
David Glasser
f6f4803a9a refactor: move pluginProviderPackageMap in Isopack
This also un-breaks soft refresh for troposphere packages:
previousIsopack was accidentally being set to an
{isopack,pluginProviderPackageMap} object, and so the "can we reuse the
previous one" check was never actually passing.
2014-12-17 00:13:07 -08:00
David Glasser
542bc6455e delete dead fields 2014-12-17 00:13:06 -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
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
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
Sashko Stubailo
0cdc382a72 Replace occurences of "elide" with "omit" 2014-12-05 15:32:57 -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
14cdfa0e02 Factor out common code for building isopackets 2014-12-03 12:28:45 -08:00
David Glasser
bf00def694 clean up comments and remove dead code
Part of #3006 cleanup.
2014-12-01 01:41:14 -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
David Glasser
75f628bab4 Fix building plugins in release builds
We need to load the transitive closure of the plugin in order to compile
the package with the plugin. But we weren't following the transitive
closure when loading prebuilt packages. This fixes that.
2014-11-25 09:06:27 -08:00
David Glasser
c55c76280b save pluginProviderPackageMap when compiling
move PackageMap to IsopackCache constructor
2014-11-25 09:06:24 -08:00
David Glasser
ec6ddbd7b7 update a comment, drop unused field 2014-11-25 09:06:24 -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
c3b6ab1cf2 main/plugin/app field of unibuild is now 'kind'
It was 'name' in unibuilds, and both 'self.archName' and 'name:' option
in SourceArch. And for some reason we stopped writing it to isopack.json
at some point.  Now we'll just call it 'kind' to make it clear it is
neither a name nor an arch.  (I think this used to be how we
differentiated main from tests, but that doesn't exist any more.)

This fixes a bug introduced on this branch where weak dependencies might
get ignored if the weakly-depended package was just recompiled.
2014-11-25 09:06:18 -08:00
David Glasser
4f1da93bc4 add IsopackCache.allLoadedLocalPackagesWatchSet 2014-11-25 09:06:17 -08:00
David Glasser
ee649d3bda Move isopack-compiler back to compiler 2014-11-25 09:06:15 -08:00
David Glasser
8e484170ae Delete PackageLoader, references to it in new code
References are still sitting around in code that hasn't been
transitioned yet.
2014-11-25 09:06:14 -08:00
David Glasser
8296f7f8b7 Switch _writeTool isopacket build to new compiler 2014-11-25 09:06:14 -08:00
David Glasser
ebf881894b buildinfo file should contain all pkgs in plugin 2014-11-25 09:06:11 -08:00
David Glasser
a3e5e1b40d drop support code for "build identifiers" 2014-11-25 09:06:11 -08:00
David Glasser
8aefc5b46f Use IsopackCache to build isopackets 2014-11-25 09:06:11 -08:00
David Glasser
16d8a8e301 Read isopack-buildinfo.json; kill buildinfo.json 2014-11-25 09:06:11 -08:00