Commit Graph

178 Commits

Author SHA1 Message Date
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
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
a7eeda6be3 Rename metadata-colon-converter and remove adaptLegacyPath 2015-01-21 14:04:09 -08:00
Sashko Stubailo
d8dbd854cc Bump compiler version since we are making big changes 2015-01-20 22:34:22 -08:00
Sashko Stubailo
aa8d701f76 Catch undefined 2015-01-20 22:34:15 -08:00
Sashko Stubailo
b08b8e219a Add files. 2015-01-20 22:34:15 -08:00
Slava Kim
5b60ea0d18 Post-process sourcemaps from build plugins
and convert the paths to Unixy style no matter where they are built.
2015-01-20 22:34:15 -08:00
Slava Kim
934dd240c0 Convert EOL symbols in sources we got from build plugins 2015-01-20 22:34:14 -08:00
Slava Kim
3c8834ca8c Some paths don't have to be absolute 2015-01-20 22:04:23 -08:00
Slava Kim
afb27037bd Convert paths back and forth when passing them to plugins
Because plugins should not suffer from our "genius" scheme of handling Windows
and Unix paths in the same codebase.
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
bb032e7e1e Never use url.resolve as a substitute for files.pathJoin
even if it makes more sense semantically, url.resolve has a very different
behavior
2015-01-20 22:04:23 -08:00
Slava Kim
27066a6ecf serveRoot is always a url path, treat it as such
Don't use path.join or files.pathJoin to join url paths
2015-01-20 22:03:23 -08:00
ekatek
5bba62e1f2 display exports for packages in ‘meteor show’
Contains:
- method to aggregate exports for a package in packageSource (exports are per-architecture).

- get this data from packageSource in PackageQuery for ‘meteor show’. Don’t store it in the
local catalog — while it is not a particularly expensive operation, it is still more expensive
than a simple lookup. We really do care about minimizing any sort of computation when we
are initializing packages, since we want the tool to be fast.

- display the data in ‘meteor show’. It makes sense to line wrap this with the ‘Exports:’ label as a
bulletPoint (just look at the test to see an example where this improves user experience). Since we
are doing that, we might as well use that bulletPoint functionality on the other labels as well.

- There is also a test. Run ‘meteor self-test show’ to test, or run ‘meteor show’ on a local package
with exports.

The Troposphere counterpoint to this is: meteor/troposphere#5
2015-01-13 13:53:21 -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
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
Utkarsh Upadhyay
51b2c7b997 Do not crash when source plugins conflict
Fixes #3015 and #3180.
2014-12-11 14:20:13 -08:00
David Glasser
576ad32eb2 Nudge console for every compiled source file
This will refresh the status bar more often and make the build tool more
responsive to signals.

Now that yield uses setImmediate, this has minimal effect on
performance.
2014-12-11 12:48:57 -08:00
David Glasser
6ea8443f30 Update calls to addFiles, onUse, and onTest 2014-12-09 20:18:31 -08:00
David Glasser
70f257c0e4 Memoize calls to js-analyze 2014-12-08 23:18:15 -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
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
cd625a3795 drop noSources field
This was a workaround a while ago for back when the uniload build
process was less principled. It's fine now.
2014-11-25 09:06:25 -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
12851424d4 remove completed XXX #3006 comments 2014-11-25 09:06:21 -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
e313b8e3d8 Remove getTransitiveClosureOfPackages 2014-11-25 09:06:15 -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
a3e5e1b40d drop support code for "build identifiers" 2014-11-25 09:06:11 -08:00
David Glasser
0166cef1f0 eliminate compiler.getBuildOrderConstraints
This gets rid of a call to determineBuildTimeDependencies, which calls
the constraint solver. This is step one of getting rid of
determineBuildTimeDependencies.

Note that this changes the build order logic a little.

In 0.8.3 and earlier we always built *all* the packages we *directly*
depended on before building ourselves. And this led to building the
transitive closure, or at least up until we hit pre-built (release)
packages, which couldn't depend on non-release packages anyway.

In 0.9.0 we only built packages we depend on that have plugins, and the
complete transitive closure of plugins within ourself.  This required
the heavierweight constraint solver call, or at least futzing with the
catalog. I think the "don't build direct dependencies without plugins"
isn't a necessary optimization and it's canceled out by requiring you to
run the constraint solver.  The transitive closure issue is real, but
before merging this branch we'll move the _build logic out of
LocalCatalog.
2014-11-25 09:06:08 -08:00
David Glasser
1f31c22435 simplify compiler.getBuildOrderConstraints
We no longer include versions in the interface. The version was only
used to do some error checking, and the error message in question hasn't
shown up in any bugs from users.

Notably, we were NOT using the version to trigger downloads (that
happens in a different place), so it's not super useful to talk about
multiple versions at all.
2014-11-25 09:06:08 -08:00
David Glasser
3444b9a6d3 Remove support for earliestCompatibleVersion
This was an undocumented and entirely unused feature (only two dummy
packages on the package server have this set to a non-default value).

No attempt is being made to remove the field from existing isopacks or
catalog entries. To continue to support existing clients, the package
server has been modified to ignore any provided
earliestCompatibleVersion and instead always write the default ECV to
the catalog.
2014-11-10 13:33:41 -08:00
David Glasser
4fa5ae7bcb style: space after bang 2014-11-07 16:45:59 -08:00
David Glasser
170c0acad7 Rename unibuild everywhere to isopackets 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
ekatek
8bd95ffe36 spelling variable names correctly this time 2014-10-20 12:02:29 -07:00
ekatek
f757ed9258 the tool package is never up to date 2014-10-20 11:50:11 -07:00
Sashko Stubailo
627674e2ae Let build plugins override the 'bare' option for JavaScript files 2014-10-20 11:41:23 -07:00
Ben Newman
fd3b2b0296 Implement Npm.strip, for use in package.js.
Summary:
The `Npm.strip` method makes up for packages that have missing or
incomplete .npmignore files by telling the bundler to strip out certain
unnecessary files and/or directories during `meteor build`.

The `discards` parameter should be an object whose keys are NPM
package names and whose values are arrays of strings (or regular
expressions) that match paths in that package's directory that should be
stripped before installation. For example:

  Npm.strip({
    connect: [/*\.wmv$/],
    useragent: ["tests/"]
  });

This means (1) "remove any files with the `.wmv` extension from the
'connect' package directory" and (2) "remove the 'tests' directory from
the 'useragent' package directory."

The values can also be objects, in which case the keys of the nested
objects will match nested dependency names. For example,

  Npm.strip({
    connect: {
      multiparty: ["test/"]
    }
  });

will discard the "test" directory from the "multiparty" package that is
depended upon by the "connect" package.

If you need to discard files from both "connect" and "multiparty", here's
a little trick you can use:

  Npm.strip({
    connect: {
      connect: ["huge.wmv"],
      multiparty: ["test/"]
    }
  });

This makes intuitive sense because requiring the "connect" package from
the "connect" package always returns the package itself.

Test Plan:
Run `meteor rebuild <package>` for the packages whose package.js files I
modified, and verify that the `Npm.strip`ped paths are absent from the
generated bundle.

Reviewers: glasser, nim, emily

Differential Revision: https://phabricator.meteor.com/D865
2014-10-17 18:24:31 -04:00
David Glasser
5590d194c5 debug-only flag only affects bundler, not compiler 2014-10-07 18:26:21 -07:00
David Glasser
9bf291c8a0 Read and write debugOnly flag in isopack 2014-10-07 18:26:21 -07:00
ekatek
e784341cf5 clean out the forProd option which we no longer use 2014-10-07 15:55:50 -07:00
ekatek
43eace5af8 allow publication of debugOnly packages 2014-10-07 15:55:50 -07:00
ekatek
e0414f2ed5 allow user to mark packages as debugOnly and not have them bundle in production mode
(still outstanding: changes to package publication workflow)

A package marked debugOnly in the package source is not to be bundled in production.
Moreover, if a package/app depends on a debugOnly package, that entire tree should
not be bundled. (But we should take it into account when figuring out versions!)

Does the following:

- In the catalog, we have a function that takes in a set of versions and a set of original
constraints and traverses it, recursively, to build a subset of versions that we *should*
bundle, and the corresponding subset of versions that we shouldn't (because they are either
debugOnly themselves or pulled in by debugOnly packages). (We do this in the catalog because
it is an addon onto the results of the constraint solver, tied deeply into our representation
of data)

- In the packageLoader, we keep track packages & versions that we should bundle, and also,
packages that we should exclude. We do this in the package-loader because, essentially, that's the
object that we use to keep the results of the constraint-solver, and we already propagate it to all
functions that care about it. (Possibly we should subsequently rename it later).

- In the compiler, when we figure out buildTimeDependencies, we ask if we need to bundle debug
builds. If not, we filter them out (see above). Also, when we actually build together unibuilds,
we don't touch the ones that the packageloader tells us to exclude (which ensures that they don't make
it into the final product).

- In the project, we keep track of whether this project is building in debug mode. That's because the project
is where we keep the state of our curent project that we are building, and if we are ever in the state of
building multiple things, then that's the code that we would need to touch (see also that we make a similar
assumption when solving constraints).

- Adds the option to keepthe project debug-build-free and calls it in commands when approporiate.
2014-10-07 15:55:50 -07:00
Sashko Stubailo
7e4848d939 Merge branch 'isopack' into release-0.9.4
Conflicts:
	tools/uniload.js
2014-09-29 20:08:02 -07:00
Sashko Stubailo
d8ff8b626c Rename unipkg to isopk 2014-09-29 19:09:05 -07:00
Sashko Stubailo
8bd7a14993 Merge branch 'release-0.9.4' into isopack 2014-09-29 17:57:15 -07:00