Commit Graph

101 Commits

Author SHA1 Message Date
Slava Kim
d28d3902c1 Add profiling information to clearly outline slow legacy-style compilers 2015-12-21 15:44:16 -05:00
Ben Newman
b36f8178de Eliminate Future from tools/meteor-npm.js. 2015-12-09 12:06:49 -05:00
Ben Newman
d1b9fb1674 Eliminate Future from tools/bundler.js. 2015-12-09 12:06:49 -05:00
Ben Newman
61f819b89a Forbid user-provided npm configuration files in meteor-npm.js.
Follow up to #5710.
2015-12-08 20:08:13 -05:00
Mitar
47cfd25bd8 Unnecessary variable. 2015-12-02 22:43:24 -08:00
Tom Coleman
60e378f8f6 It turns out file:// paths *do not* currently work with NPM 2015-11-25 17:39:52 +11:00
Tom Coleman
0a9866ed76 Added some documentation and history about git change. 2015-11-25 17:21:44 +11:00
Tom Coleman
705a7eda1a Switch the semantics - forNpm -> forCordova
Cordova uses npm but is *more* specific so this is less potentially confusing.
2015-11-25 16:27:36 +11:00
Tom Coleman
54396f78b7 Switch semantics to isValidVersion 2015-11-25 16:27:36 +11:00
Tom Coleman
222115665b Refactored isExactVersionto handle npm/cordova
See https://github.com/meteor/meteor/pull/5562/files for a discussion. Basically Cordova doesn't really support

a) Urls with @'s in them
b) Urls that don't point to fixed commits.

As this branch allows both of the above (and our NPM support does reasonably handle a+b), we split the way we handle cordova + npm URLs a little.
2015-11-25 16:27:35 +11:00
Ben Newman
ed17924940 Add braces to every if/for(-in)/while statement in tools directory. 2015-11-13 12:25:19 -05:00
Ben Newman
739d0d9676 Spot fixes for tricky add-braces cases. 2015-11-13 12:24:32 -05:00
Ben Newman
cf942a9359 Convert CompilerPluginProcessor to an ES2015 class. 2015-11-11 19:14:34 -05:00
Ben Newman
3345a2f9f4 Convert PackageSourceBatch to an ES2015 class. 2015-11-11 19:02:42 -05:00
ekatek
25f4859f54 change webapp interface to allow a function hook instead of a prefix
Add a bundledJsCssUrlRewriteHook function, which takes in a function and applies it
to the URL. Do not allow this on Cordova (handle that by just not calling it on Cordova).
Reimplement the bundledJsCssPrefix as a call to this function.
2015-11-04 17:35:22 -08:00
Ben Newman
440de7e92c Convert ResourceSlot to an ES2015 class. 2015-11-03 20:03:29 -05:00
Sashko Stubailo
38c4be2bd1 Fix typo in docs
Fixes #5554
2015-11-03 13:55:02 -08:00
Tom Freudenberg
8a24a1b2ba Make Script More Portable With #!/usr/bin/env 2015-11-01 22:04:10 +01:00
Ben Newman
a9fde48ca8 Treat api.files[arch].{sources,assets} as arrays, not objects.
We only got away with this because we later use _.values to iterate over
the elements of the array, which just happens to do the right thing when
the array is overloaded with object properties. The order of iteration was
even the same because object keys are enumerated in order of assignment,
but when you're working with an ordered list of files it's better to use
an array the normal way (for its elements rather than its properties).
2015-10-29 23:57:31 -04:00
Sashko Stubailo
dd2f166fe9 Don't throw an error when using deprecated package asset API
Fixes #5458
2015-10-21 14:34:20 -07:00
Ben Weissmann
f68cf5c79f Fix documentation for Cordova.depends
* Fix broken link to Github cordova documentation.
* Fix invalid Github tarball URL example
2015-10-19 19:38:22 -04:00
David Glasser
38fbeaaa91 Make package.json deterministic again
Now that we include it in published packages (as
node_modules/.package.json) we don't want it to change on every npm
update, or else we'll have to spuriously update package versions.

(The next release with this fix will spuriously update package versions,
though!)
2015-10-06 17:43:47 -07:00
David Glasser
7191dfcf3e Fix to METEOR_BINARY_DEP_WORKAROUND change
Avoids crash on mostCompatibleArch
2015-09-24 18:30:27 -07:00
David Glasser
c929703790 One way of cross-compiling local binary packages
If $METEOR_BINARY_DEP_WORKAROUND is set, then when bundling for a
non-host platform (build/bundle/deploy commands only), if a package has
no server unibuild for the target architecture, use the host
architecture and replace the npm modules with a package.json and
npm-shrinkwrap.json.  Also write out a top-level setup.sh script (inside
programs/server) which runs npm install in all such directories.

To support this, we make sure to save the package.json and
npm-shrinkwrap.json files in various intermediate directories in case we
need them later.  (We put them inside node_modules because that is what
gets copied from source tree to isopack.)
2015-09-22 15:11:04 -07:00
David Glasser
2b0e8ddfbf Include exports in codeless legacy builds
Fixes #5228.
2015-09-21 23:16:17 -07:00
Martijn Walraven
657c45977b Add isobuild:cordova feature package
This allows packages to depend on specific versions of Cordova.
2015-09-21 19:57:01 +02:00
David Glasser
f31f0747c2 Put npm dependency info into isopacks
The code to read this data will come later, but getting this in 1.2
means that packages published with 1.2 will contain the dependency info.
2015-09-18 22:48:01 -07:00
Ben Newman
fb1d9598e6 Avoid returning an empty client watch set from bundler.bundle.
Fixes #5080.
2015-09-17 18:40:12 -04:00
Ben Newman
4c8af86daa Include package names in build plugin error paths.
With this change, when reporting compiler errors in files in packages, we
now prepend "packages/<package name>/" to the path of the offending file.

https://github.com/meteor/meteor/issues/4943#issuecomment-140719042
2015-09-17 16:42:31 -04:00
Sashko Stubailo
1333a405d8 Add comment reminder to update wiki page 2015-09-02 13:24:52 -07:00
Sashko Stubailo
0bb7c7c0b2 New addAssets package.js API; same file can be source and asset
1. Add `addAssets` API to `package.js`
2. Rename `getSourcesFunc` to `getFiles` in internal code
3. Changed `PackageAPI#sources` to `PackageAPI#files` with a new structure that
   has separate objects for assets and sources
4. Added some tests for different error conditions
5. The same file can now be a source and an asset
2015-09-02 13:14:02 -07:00
Dean Brettle
bab1459c50 Doc export from debugOnly and prodOnly packages
Address lack of documentation mentioned in issue #3639.
2015-09-01 13:59:20 -07:00
David Glasser
0c0169707c Undocumented $METEOR_FORCE_PORTABLE option
If set, it assumes that all local packages are portable and can be
deployed to any platform.

If you are using this, you need to consistently use it every time you
run Meteor, not just when deploying.  The first time you use it in a
project that has been used without it, you should run `meteor rebuild`.
2015-08-31 22:45:53 -07:00
David Glasser
af567ff8a3 404 instead of boilerplate on production JS links
Make sure the 404 is not cached. Helps with CDNs (see eg 6ff0faa).
2015-08-31 15:40:36 -07:00
Sashko Stubailo
a96e0e1009 Correctly format doc comment about options 2015-08-28 10:52:49 -07:00
Sashko Stubailo
217bad7f10 Reinstate logic where bare option was taken from fileOptions 2015-08-28 10:32:59 -07:00
David Greenspan
a2a8192c35 Add tools/cordova to list of transpiled dirs 2015-08-27 10:46:22 -07:00
Ben Newman
0674fc0714 Call plugin.setDiskCacheDirectory with OS-appropriate path.
Fixes #4990.
2015-08-19 12:37:41 -04:00
David Glasser
f02cc00b5d Write node version to built bundles
Since server/.bundle_version.txt is mostly used to determine the node
version, writing it more directly can help too.

(Arguably this should be MIN_NODE_VERSION rather than process.version
but that value is not easily accessed.)
2015-08-14 19:15:09 -07:00
David Glasser
4c20f0d296 Fix failure to write legacy isopack-1 on download
When we download a package that's only isopack-1, we're supposed to
write it as a "fat" isopack-1/isopack-2 package, by using the same
includePreCompilerPluginIsopackVersions flag used for publishing
packages. However, the internal representation of the "prelink" resource
contained in legacy packages didn't have a flag set that is later used
to see if includePreCompilerPluginIsopackVersions is allowed to be
effective. This meant that we'd download packages published as
isopack-1-only and save them as isopack-2-only. And then old meteor
releases would fail to use them.

Fixes #4923.
2015-08-12 23:27:42 -07:00
David Glasser
2120669f46 Remove XXX comment 2015-08-11 19:33:06 -07:00
Slava Kim
303052be68 Update README.md 2015-08-10 14:40:43 -07:00
David Greenspan
c3c07f74a1 Don't add imports of prodOnly packages in compiler
The compiler inserts code that imports the exports of used packages.
It's important that we don't do this for the exports of used
debugOnly and prodOnly packages, because the inserted code will
fail at runtime if the packages are not linked in because we aren't
in dev mode or aren't in prod mode.
2015-08-07 09:28:37 -07:00
Sashko Stubailo
90dec37c54 Fix bundler cordova stuff 2015-08-06 17:09:26 -07:00
David Greenspan
621617d868 Document debugOnly and prodOnly 2015-08-06 16:49:27 -07:00
David Greenspan
67b9da63ad Throw error if package is prodOnly and debugOnly
With self-test.
2015-08-06 16:49:26 -07:00
David Greenspan
a34d040229 Fix wrong type in doc comment 2015-08-06 16:49:26 -07:00
David Greenspan
a63dc1f5c2 Support prodOnly in addition to debugOnly
It's very useful to be able to include code only in production.  It's
useful for React integration, but presumably also for many apps.

* Add prodOnly boolean flag alongside debugOnly in Package.describe

* Packages the set prodOnly to true auto-depend on isobuild:prod-only
  (making them error in the old tool where prodOnly isn't supported)

* The `includeDebug` boolean build option is replaced by a string
  named buildMode, which can be 'development' or 'production', just
  like minifyMode.

Tested by self-test.
2015-08-06 16:49:26 -07:00
Slava Kim
afee6b07c7 move catalog/ into packaging/ 2015-08-06 16:39:01 -07:00
Slava Kim
39d8aef3d9 move files into console/ tool-testing/ 2015-08-06 16:39:00 -07:00