Commit Graph

103 Commits

Author SHA1 Message Date
David Glasser
ea3a600079 Assets added via a plugin are not source files
Fixes #2488.

Assets added via "no handler" already have their source files added to
`sources` via the `sources.push(relPath)` in the sourceItems loop, and
assets added via a handler should not appear as source files themselves
--- the file that triggered the handler should!

This fixes packages like `mizzao:build-fetcher` which add static
assets via a plugin.
2014-09-03 16:45:09 -07:00
Matthew Arbesfeld
75427d70ce Merge branch 'devel' into cordova-hcp
Conflicts:
	docs/client/docs.js
	examples/leaderboard/.meteor/versions
	meteor
	packages/backbone/package.js
	packages/constraint-solver/package.js
	packages/meetup/package.js
	packages/meteor-tool/package.js
	packages/showdown/package.js
	packages/stylus/package.js
	scripts/admin/meteor-release-experimental.json
	tools/commands-packages.js
	tools/commands.js
	tools/project.js
	tools/tests/old/app-with-private/.meteor/versions
	tools/tests/old/app-with-public/.meteor/versions
	tools/tests/old/empty-app/.meteor/versions
2014-08-27 13:38:57 -07:00
David Glasser
43e01c09eb Improve treatment of prerelease (dashed) packages
Drop the "at-least" constraint type entirely. It was not user-accessible
and was only used in the form ">=0.0.0" to represent a constraint with
no version constraint at all. This type of constraint is now called
"any-reasonable".

The definition of "any-reasonable" is:

  - Any version that is not a pre-release (has no dash)
  - Or a pre-release version that is explicitly mentioned in a TOP-LEVEL
    constraint passed to the constraint solver

For example, constraints from .meteor/packages, constraints from the
release, and constraints from the command line of "meteor add" end up
being top-level.

Why only top-level-constrained pre-release versions, and not versions we
find explicitly desired by some other desired version while walking the
graph?

The constraint solver assumes that adding a constraint to the resolver
state can't make previously impossible choices now possible.  If
pre-releases mentioned anywhere worked, then applying the constraints
"any reasonable" followed by "1.2.3-rc1" would result in "1.2.3-rc1"
ruled first impossible and then possible again. That's no good, so we
have to fix the meaning based on something at the start.  (We could try
to apply our prerelease-avoidance tactics solely in the cost functions,
but then it becomes a much less strict rule.)

At the very least, this change should allow you to run meteor on a
preview branch like cordova-hcp without getting a conflict between the
prerelease package on the branch/release and the lack of an explicit
constraint in .meteor/packages on that package, because we are
reintepreting the .meteor/packages constraint as meaning "anything
reasonable" and the in-the-release version counts as reasonable.
2014-08-26 21:54:48 -07:00
David Glasser
5b92dfd85f "better" error handling for compiler constraints
This before was just an uncaught exception. Now it's exit(1), which is
bad too.  This should just use buildmessage, but for some reason that
doesn't work here.
2014-08-25 11:17:57 -07:00
Matthew Arbesfeld
922af65765 Merge branch 'devel' into cordova-hcp
Conflicts:
	meteor
	scripts/generate-dev-bundle.sh
	tools/bundler.js
	tools/unipackage.js
2014-08-20 19:48:26 -07:00
David Glasser
cf17ef3bf4 some further catalog/uniload cleanup
- The checkout catalog.uniload now does not uniload a resolver, and
  instead just has a trivial implementation of resolveConstraints.
  (The 'built' catalog.uniload already didn't use the resolver.)

- catalog.complete.resolveConstraints now throws an error if there's
  no resolver; this is OK, because creating the resolver now only
  uses the distinct catalog.uniload, so there's no recursion issue.

- don't record version dependencies in packages during uniload (this
  protects against using release.current before it is initialized)

- PackageLoader should never download packages during uniload (this
  protects against using catalog.uniload.isLocalPackage before it is
  initialized)
2014-08-14 14:29:18 -07:00
David Glasser
f946ff9054 uniload from checkout uses separate catalog 2014-08-13 18:11:46 -07:00
David Glasser
b6955a3899 Move towards non-singleton catalog.complete
We're going to make uniload use a different flavor of "complete" catalog
soon.  So we need to reduce the number of singleton-ish references to
it.

Also, we need one PackageCache per catalog, so stop it from being a
singleton too.
2014-08-13 18:11:46 -07:00
Matthew Arbesfeld
e9b9132a04 Merge branch 'devel' into cordova-hcp
Conflicts:
	meteor
	tools/catalog.js
	tools/commands-packages.js
	tools/commands.js
2014-08-13 15:07:42 -07:00
David Glasser
64d939acb2 Add a lot more buildmessage captures
Many of these (mostly in top level commands in commands-packages.js) are
not super well thought out: they use a new "doOrDie" helper to run some
function in a capture and exit if there are any messages.  We really
need to get a little more thoughtful about the big picture of error
handling (combining "build" errors, network errors, catalog errors,
etc). But this at least allows the addition of more buildmessage
assertions.

At the very least, this ensures that if you edit a package.js in a local
package while "meteor run" is running, that instead of crashing the tool
it properly shows the buildmessage and lets you fix the issue.
2014-08-11 17:06:28 -04:00
David Glasser
59257989e5 Always download missing packages before compiling 2014-08-07 23:37:01 -07:00
David Glasser
4cd1ea5d1f Pass uniload's ignoreProjectDeps down farther
Fixes test-packages from a clean checkout (sigh)

Basically, uniload should never depend on your current project! It's
building separate JS images!
2014-08-07 17:07:54 -07:00
David Glasser
525471aa3d Watch static assets and missing files
Fixes regression from CSS reload change.
2014-08-07 16:39:54 -07:00
David Glasser
ed6e9be0d6 bump BUILT_BY, just in case. 2014-08-07 14:50:25 -07:00
David Glasser
3f185485a5 Watch static assets and missing files
Fixes regression from CSS reload change.
2014-08-06 14:06:43 -07:00
Matthew Arbesfeld
9f2ee36e60 Merge branch 'packaging' into cordova-hcp
Conflicts:
	packages/constraint-solver/constraint-solver-tests.js
	packages/constraint-solver/constraint-solver.js
	packages/less/plugin/compile-less.js
	packages/meteor/plugin/basic-file-types.js
	packages/star-translate/translator.js
	packages/stylus/plugin/compile-stylus.js
	packages/templating/plugin/compile-templates.js
	packages/webapp/webapp_server.js
	tools/bundler.js
	tools/commands.js
	tools/compiler.js
	tools/package-source.js
	tools/run-app.js
	tools/selftest.js
	tools/tests/old/test-bundler-assets.js
	tools/tests/old/test-bundler-options.js
	tools/unipackage.js
2014-08-06 13:43:56 -07:00
David Glasser
ddc3657e4f Watch files which fail before emitting a resource
Regression introduced by the CSS watching code (specifically, f230eba62)
by the sourceIsWatched check. We need to be able to tell the difference
between "source handler didn't do anything because there was an error"
and "source handler didn't do anything because it's web-specific and
this is an os arch".

A simple fix would have been to interpret compileStep.error as
"sourceIsWatched = true", but I didn't think of that until after doing
it the slightly more complicated but more precise way :)

Also, ensure that if the runner rebuilds the client and there's an
error, it properly kills the app process (and the watchers and the
keepalive interval, etc).
2014-08-04 21:32:22 -07:00
Matthew Arbesfeld
8bcbd65344 Separate "browser" target into web.browser/cordova
Cordova projects often have a different set of files than web targets,
so we would like to be able to target different client architectures in
our bundles. Ideally, we allow the user to use arbitrary client
architectures - but this patch is a step in the right direction by
abstracting out more of the hard coded "browser"/"os" lines.

We accomplish this separation in a backwards compatible way by allowing
api.___ commands to target a "client" architecture. For example,
api.addFiles('a.js', 'client') adds 'a.js' to both the 'client.browser'
and 'client.cordova' targets.

Effects on 0.9 packaging stuff: packages don't have to change, but the
"data.json" file in ".meteor0" has "browser" in some places. We think we
have to fix the troposphere code where this data.json is created.

Some plugins will also be backwards-incompatible with this change, since
many have a "clientArch.matches("browser")" line in the plugin
code. Ideally, we fix plugins so that this stops being an issue, but for
now package authors can just patch that line.

At the compiled (unipackage) level the new names are 'web.browser' and
'web.cordova', replacing 'browser'. In package.js, the new names are
'client.browser' and 'client.cordova', serving as an adjunct to 'client'.
2014-07-31 14:12:15 -07:00
David Glasser
06a7dc90b5 Add many buildmessage.capture/assertInCapture
Moving towards a world where all things that might invoke buildmessage.error are
encouraged to be in a buildmessage.capture.

This commit is the answer to the question "how many small changes need to be
made to add buildmessage.assertInCapture to PackageCache.loadPackageAtPath?"

Next steps include:
 - Making catalog.resolveConstraints ALWAYS buildmessage.assertInCapture
   (not just when ignoreProjectDeps isn't passed)
 - Then changing resolveConstraints to complain using buildmessage
 - Removing the process.exit(1) in _ensureDepsUpToDate
 - Adding a more structured way to ensure that most commands
   call _ensureDepsUpToDate at an unsurprising location
2014-07-30 22:16:21 -07:00
Matthew Arbesfeld
960f8907d3 Merge branch 'packaging' into cordova-hcp
Conflicts:
	packages/constraint-solver/constraint-solver.js
	packages/webapp/webapp_server.js
	tools/tests/package-tests.js
2014-07-25 13:52:34 -07:00
ekatek
1e1f4b2e8a catalogs talk to each other 2014-07-22 18:40:25 -07:00
Slava Kim
b64a644671 Merge branch 'packaging-matt-cordova' into packaging-client-archs
Contains commands for cordova (ie `meteor cordova serve`) and tests for them.
2014-07-22 13:15:26 -07:00
Matthew Arbesfeld
03c5c425f8 Hard code in client.cordova and fix 'browser' references 2014-07-18 18:59:00 -07:00
Matthew Arbesfeld
fb5cf61a8e Add multiple client arches, this is a WIP 2014-07-17 20:53:47 -07:00
Matthew Arbesfeld
50ec6b68ea wip 2014-07-17 16:11:52 -07:00
Matthew Arbesfeld
c3891fc823 wip 2014-07-16 14:24:59 -07:00
Matthew Arbesfeld
31fed52751 Remove some logs 2014-07-11 14:05:00 -07:00
Matthew Arbesfeld
0869b93392 Something basic working 2014-07-11 14:05:00 -07:00
Matthew Arbesfeld
7eb0e6c91b Builds individual client packages 2014-07-11 14:04:59 -07:00
Matthew Arbesfeld
f230eba62b Client CSS and template injection. 2014-07-09 10:31:44 -07:00
ekatek
d212a629a9 now we can have constraints yay 2014-06-24 18:24:49 -07:00
David Glasser
14aa7c4bf4 avoid terrible error
there was already a better error hidden!
2014-06-23 22:24:45 -07:00
David Glasser
e0852a5928 make references to packageloader consistent 2014-06-23 22:24:44 -07:00
David Glasser
6782711c69 fix wrong arch in plugin package search
the "We pass" comment was stolen back from devel

basically, whenever doing eachUsedBuild, you really want to pass in the
arch of the overall compilation (or for plugins, the host arch), not the
arch of the unibuild you happen to be sitting in right now.  because if
you're sitting in a generic "os" unibuild, it won't know whether to use
os.mac or os.linux or whatever if you pass in "os"!
2014-06-17 19:23:39 -07:00
David Glasser
d1f5acdb08 oops! actually use specific arch! 2014-06-17 18:41:59 -07:00
David Glasser
4f3aa0fc53 initial checkpoint for "buildArchitectures"
this is a string like "browser+os"
2014-06-17 17:48:08 -07:00
David Glasser
e6985c39f2 audit compiler.js 2014-06-17 17:33:55 -07:00
David Glasser
c5e5305a3b Merge branch 'devel' into packaging
Conflicts:
	tools/bundler.js
	tools/packages.js
2014-06-11 12:02:57 -07:00
David Glasser
6d3257909d test-bundler-assets passes 2014-06-10 19:13:48 -07:00
ekatek
614b7d8246 clean up catalog inputs, some comments 2014-05-29 17:10:25 -07:00
ekatek
b97f7c5a76 renamed some catalog variables, more cleanup around catalog 2014-05-27 16:07:43 -07:00
ekatek
f70099c992 apps run tests do not 2014-05-21 17:41:18 -07:00
ekatek
7339d0e33f minor bug cleanup to make tests pass 2014-05-21 12:38:17 -07:00
ekatek
552fc249f2 send the right versions 2014-05-12 17:21:16 -07:00
ekatek
90a5b87a00 fixing the plugin dependency handling 2014-05-09 17:21:19 -07:00
David Glasser
e0efa35763 get uniload of constraint-solver working
now we get stuck on slices
2014-05-09 16:02:01 -07:00
ekatek
f2d3972857 integration mostly works except for bizarre constraint solver output bug 2014-05-09 15:15:45 -07:00
ekatek
4de82af708 save the tool version to the versions file. Not sure about some semantics of this. 2014-05-07 23:53:35 -07:00
David Glasser
9d70ff64c9 springboard almost works
springboarding happens infinitely because of build ids

have to manually bootstrap a tropohouse

fixed some other things:

 - store package server token in correct domain
 - copy files (eg packages pre-publish) with +x flags
 - catalog.getReleaseTrack works
 - don't pass release to uniload (Meteor.release will always
   end up 'UNILOAD')
 - fix building meteor-tool again
 - stop supporting apps without .meteor/release
 - merging unipackages with tools works

springboarding to warehouse releases totally not supported
2014-05-05 19:18:34 -07:00
ekatek
2eac771902 change rebuild-all to rebuild and allow to rebuild singular packages; enforce lowercase package names; cleanup 2014-05-04 16:59:15 -07:00