Commit Graph

163 Commits

Author SHA1 Message Date
David Glasser
31bd507b11 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-16 23:46:26 -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
Sashko Stubailo
a3860bb115 Make isopack backwards- and forwards-compatible 2014-09-29 17:12:00 -07:00
David Greenspan
98eff9059e Capitalize buildmessages 2014-09-29 16:18:38 -07:00
Sashko Stubailo
7cd12072ea Rename unipackage to isopack in almost all cases 2014-09-29 16:01:08 -07:00
Sashko Stubailo
9460dcf9f8 Merge branch 'registerBuildPlugin' into devel
Conflicts:
	docs/client/data.js
2014-09-25 11:47:04 -07:00
Sashko Stubailo
0a9cacaccf Fix small documentation issues 2014-09-25 11:38:48 -07:00
Sashko Stubailo
b312c1f6e6 Rename Unipackage to Isopack 2014-09-23 19:19:58 -07:00
Sashko Stubailo
4bf93172b6 Rename unipackage.js to isopack.js 2014-09-23 19:17:03 -07:00
Sashko Stubailo
e0b452b5c8 Add link to Wiki, add warning that comments aren't used 2014-09-23 10:22:11 -07:00
Sashko Stubailo
cf68cd755f Pass through 'bare' option to compiled js source files 2014-09-22 23:27:08 -07:00
Sashko Stubailo
abb6ffa66a Fix incorrect packageName docs 2014-09-22 21:56:21 -07:00
Sashko Stubailo
7cb0f847a5 Fix a big typo 2014-09-22 21:54:40 -07:00
Sashko Stubailo
a8982664c1 Rename back pathForSourceMap 2014-09-22 21:52:47 -07:00
Sashko Stubailo
8f0f924e15 Rename appendDocument to addHtml 2014-09-22 21:43:40 -07:00
Sashko Stubailo
6f81041090 Document arch
Fix documentation typo
2014-09-22 21:38:06 -07:00
Sashko Stubailo
c97b0b91cf Add fullInputPath to public API 2014-09-22 21:37:18 -07:00