Commit Graph

136 Commits

Author SHA1 Message Date
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
Sashko Stubailo
a0624614d3 Fix link 2014-09-22 21:36:57 -07:00
Sashko Stubailo
7f8bd587bf Consistently name path variables 2014-09-22 21:36:22 -07:00
Sashko Stubailo
53365a45f4 Add newlines between CompileStep methods 2014-09-22 21:02:59 -07:00
Sashko Stubailo
d534efd921 Document Buffer or String argument in addAsset 2014-09-22 21:02:49 -07:00
Sashko Stubailo
07c700a178 Document packageName 2014-09-22 21:02:34 -07:00
Sashko Stubailo
72ae4a1b4c Allow CompileStep#addAsset to accept Strings for content 2014-09-22 20:58:32 -07:00
Sashko Stubailo
af3f987699 A first pass at documenting build plugins
Documentation for the CompileStep is only in the source right now
2014-09-22 17:27:00 -07:00
Justin SB
30f4fa2cbe Progress bars and output formatting 2014-09-19 15:52:23 -07:00
ekatek
bc8010514d be more consistent about using utils.parseConstraint in the tool; test for either-version 2014-09-18 23:48:21 -07:00
ekatek
d8377487dc support multiple major versions in meteor 0.9.3 and above. A little hacky in the tool around keeping old interfaces, but it works 2014-09-18 00:12:30 -07:00
David Glasser
5b8504efb2 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:19: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