Commit Graph

205 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 Greenspan
45752e3203 parseConstraint -> parsePackageConstraint
In the return value, `name` has been changed to `package`,
and `vConstraint` is now `versionConstraint`.

`constraint.package` is better than `constraint.name`, where
`constraint` is a PackageConstraint.  It's also more consistent
with functions like parsePackageAtVersion which return an object
like `{package, version}`.

`vConstraint` was too cryptic.

Changes were discussed with Glasser in a code review.

Troposphere does not call parseConstraint or work with constraint
objects, so it doesn't need to change.

This is a breaking change to the package-version-parser API (or one
method of it, at least), but it is considered an internal API so we
are not worrying too much about it.
2015-02-02 13:13:31 -08:00
David Glasser
10173c0ca5 Stop semi-supporting Npm.require in package.js
It can be used to get things like `path` (though you can just use '/'),
but trying to require the packages whose list is determined by running
the file while running the file just doesn't make any sense.
2015-01-23 16:58:33 -08:00
Slava Kim
50c50b4e50 Comment on serveRoot and sourceRoot differences 2015-01-20 22:34:21 -08:00
Slava Kim
296d765cca Package.js:api.addFiles and Assets.get* accept both type of paths 2015-01-20 22:04:24 -08:00
Slava Kim
d165837bd9 Convert the path to the OS style on Npm.require 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
0f6c31cab7 upload README.md files to the server and view the excerpt in meteor show
This commit is based on the following design document:
https://mdg.hackpad.com/Creating-and-Updating-Docs-0ZyyDcSZDxp,
and some other stuff from here: https://mdg.hackpad.com/Meteor-Long-Description-wGZ1vIOwVlF
and was code reviewed here: https://github.com/meteor/meteor/pull/3375

It does the following:

- Allow the user to specify package documentation in Package.Describe.
  We will take the README.md file by default, to make the transition easier.
  Users can specify ‘documentation: null’ to not submit a README.md

- From that documentation, extract the section between the first and second header
  to use as the long form description for the package.

- Upload the documentation to the server at publish-time. Allow metadata changes with ‘publish —update’.

- Change the default package skeleton to include the README.md file.
  Also, changes the skeleton to have fewer useless placeholders in Package.describe values.

- Fix a minor bug where Git did not show up when running ‘meteor show’ on local packages.

A note on ‘documentation: null’ and blank documentation — we don’t let maintainers upload
blank README.md files, because we want to encourage people to fill them out. (Instead,
we allow a ‘documentation: null’ as an override) This is a UX issue! It is not a technical thing.

There is more discussion and code review in: https://github.com/meteor/meteor/pull/3375
2015-01-13 13:53:21 -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
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
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