Commit Graph

194 Commits

Author SHA1 Message Date
David Glasser
92dd5e1e71 Don't make unnecessary cordova unibuild for app
Start on #3274.  Since we don't cache app isopacks to disk, we don't
have to worry about invalidating this.
2014-12-11 14:12:51 -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
David Glasser
6ea8443f30 Update calls to addFiles, onUse, and onTest 2014-12-09 20:18:31 -08:00
David Glasser
062fbefa35 clean up formatting 2014-12-03 14:58:54 -08:00
Uri Goldshtein
d7396ffb1e docs: add web.browser and web.cordova as architecture possibilities in package.js 's api.use, api.addFiles and api.export 2014-12-03 14:56:55 -08:00
David Glasser
ab3d6c5bfb Clean up some #3006 comments 2014-12-01 18:29: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
fe40ee08e4 Simpler PackageSource.initFromPackageDir interface
There's only one call site which always passed {requireVersion: true,
defaultVersion: "0.0.0"}, so just inline those values.

Also, move some validation of the version string into the place where it
is set instead of some other random place.
2014-12-01 01:26:35 -08:00
David Glasser
7b3f03f152 fix typo, thanks @dgreensp 2014-11-26 08:58:11 -08:00
David Glasser
4a5636b8fd remove more remnants of 'programs' directory 2014-11-25 09:06:28 -08:00
David Glasser
3b7459e62a start on self-test. file 'run' passes 2014-11-25 09:06:27 -08:00
David Glasser
2f7412573c remove some support for old versions.json files 2014-11-25 09:06:26 -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
dddf0b246e another note about stuff to drop 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
1a4dcef219 drop utils.splitConstraint 2014-11-25 09:06:22 -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
055575a80c Support .meteor/cordova-plugins 2014-11-25 09:06:17 -08:00
David Glasser
0d36f83f90 Combine metadata watchsets lazily
This makes it easy to replace sub-WatchSets when we write a file
2014-11-25 09:06:16 -08:00
David Glasser
7998389287 Read .meteor/release in ProjectContext 2014-11-25 09:06:16 -08:00
David Glasser
ee649d3bda Move isopack-compiler back to compiler 2014-11-25 09:06:15 -08:00
David Glasser
8076eb2d7b .meteor/platforms is already in projectWatchSet 2014-11-25 09:06:13 -08:00
David Glasser
83c7f57896 Read and write .meteor/versions 2014-11-25 09:06:13 -08:00
David Glasser
a1268b8d6b Just build all dependencies before a package
The old code failed because versioned packages (with or without plugins)
weren't loaded before compileUnibuild, and the eachUsedUnibuild call
inside it threw. We could load plugin'd versioned packages, but I also
realized that the old getPackagesToBuildFirst didn't find you plugins
that were pulled in via implies. This way is simpler.
2014-11-25 09:06:12 -08:00
David Glasser
17f5cf6273 'meteor bundle' works with ProjectContext!
- the 'programs' subdirectory is no longer supported

- includeDebug is now an option to bundler.bundle, not global state

- some cordova-specific stuff has been disabled

- lots of other commands are presumably entirely broken
2014-11-25 09:06:12 -08:00
David Glasser
8aefc5b46f Use IsopackCache to build isopackets 2014-11-25 09:06:11 -08:00
David Glasser
d6cca3a89e First steps towards an IsopackCache.
It comes up with the right order to build and load packages, and loads
prebuilt packages. It does not yet build packages.
2014-11-25 09:06:09 -08:00
David Glasser
8d7139e624 Start on a new lightweight ProjectContext
This one won't be a singleton.  Eventually project.js will be moved into
here.

Add a 'meteor prep' command which exercises new codepaths. It will be
deleted eventually.

So far, it converts .meteor/packages directly into the format that the
constraint solver wants.  (Unlike the existing code which has several
intermediate formats.)
2014-11-25 09:06:09 -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
db90bd6944 os was later changed to plugin 2014-11-22 14:20:10 -08:00
David Glasser
7d1cb122fe constraint solver should know about plugin deps 2014-11-22 14:19:47 -08:00
David Glasser
399681e04f move sha1 from Builder to watch
since watch actually uses it and Builder doesn't
2014-11-12 17:13:41 -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
170c0acad7 Rename unibuild everywhere to isopackets 2014-11-07 16:45:58 -08:00
David Glasser
97f6a0236e get rid of catalog.uniload
There is no longer a uniload catalog when running from a release, since
the release contains whole isopackets (programs) not
isopacks (packages).

We only need a uniload-specific catalog when we're actually rebuilding
isopackets (not in order to load them), so we now have it as a local
variable in the two places that build isopackets.

The deleted code in package-loader.js was specific to the prebuilt
uniload package which no longer exists.
2014-11-07 16:45:58 -08:00
David Glasser
6f9d9475cd uniload from isopackets! 2014-11-07 16:45:58 -08:00
Emily Stark
97c85bc3da Exit 'meteor run' when cordova plugins or platforms change.
We don't have a way to HCP a changed set of plugins or platforms, so
just exit and ask the user to re-run. There are probably some cases
where we don't have to exit (e.g. if you add the android platform, we
probably don't need to exit out of 'meteor run ios'), but we exit in all
cases for simplicity.
2014-10-21 15:59:40 -07:00
ekatek
68406388a6 the .meteor/versions file is part of the app control files 2014-10-21 15:39:07 -07:00
Ben Newman
e20572a8a7 Disallow passing nested objects to Npm.strip.
As you can see, this simplifies the implementation considerably.
2014-10-21 12:07:32 -04: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
f78184c497 Disallow plugins and imply in debugOnly packages 2014-10-07 18:26:21 -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
a1f9d36836 Merge branch 'devel' of github.com:meteor/meteor into devel
Conflicts:
	docs/client/data.js
2014-10-07 13:46:27 -07:00
Sashko Stubailo
b9db774834 Fix broken links and release headline 2014-10-07 13:46:00 -07:00
David Glasser
f0155d2b3d Delete docs about wrap numbers and ECV
This sentence is about ECV but nothing else in the docs discusses ECV
and it doesn't use that term. So it's actually kind of confusing; to me,
it suggested that asking for `1.2.3_1` might give you `1.2.3`, which is
not true.
2014-10-07 11:45:52 -07:00
David Glasser
1779d62281 some packaging-related docs cleanups
also, add instructions to the top of docs.js
2014-10-06 21:50:00 -07:00
ekatek
d3880241f5 fixing error message, we do not allow 0 wrap numbers 2014-10-02 17:34:53 -07:00
ekatek
7d77456509 fix the error message in package source 2014-10-02 17:31:03 -07:00
ekatek
c67de0830a merging from sqllite 2014-09-30 16:29:41 -07:00
Slava Kim
b4a063c53c Don't compile the mobile-config.js control file into an app 2014-09-30 12:28:59 -07:00