Commit Graph

18 Commits

Author SHA1 Message Date
Ben Newman
911f25bbf4 Allow lazy api.mainModule modules.
If you call api.mainModule(path, where, { lazy: true }), that main
module will not be evaluated until other code imports it at runtime, and
won't even be bundled if no other code imports it.

Closes #6132.
2016-11-14 12:51:00 -05:00
Tom Coleman
04f401c711 JSdoc refactoring to make API boxes work again. 2016-10-27 14:55:56 -07:00
Ben Newman
14ee8775c3 Decompose PackageNamespace, PackageNpm, and PackageCordova classes.
Similar to the treatment given to PackageAPI in my commit
af50b4cc5b.

This clear separation of concerns will be helpful for optimizing
PackageSource#initFromPackageDir.
2016-10-06 17:39:23 -04:00
Ben Newman
7d5b3c05a1 Normalize relative paths passed to api.addFiles.
Fixes #6527.
2016-03-18 19:11:28 -04:00
Avital Oliver
6682972c3a Implement "testOnly" packages
These packages are only bundled with the app when running
`meteor test-app`.
2016-02-01 22:18:00 -08:00
Ben Newman
699f4e8c83 Implement api.mainModule for defining package entry points.
The main module serves the crucial purpose of combining all the exports of
other modules in the package, which eliminates the need for api.export in
principle, though the module.exports of the main module (also defined as
Package[packageName]) will still be populated with any api.export-ed
properties.
2015-12-09 14:37:22 -05: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
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
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
Sashko Stubailo
a96e0e1009 Correctly format doc comment about options 2015-08-28 10:52:49 -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
Slava Kim
6b1bb038d8 Move files into tools/fs 2015-08-03 22:09:28 -07:00
Slava Kim
8a8db83d29 Move files into tools/utils 2015-08-03 20:32:38 -07:00
Slava Kim
3ddd281d8c Move catalog files into tools/catalog/ 2015-07-30 12:12:07 -07:00
David Glasser
2ccaf6a51e Move some files into isobuild subdirectory
The exact borderline between "Isobuild" and "the tool" is a little hazy,
but the idea is that "Isobuild" is the part that you could imagine being
embedded in a non-command-line build tool. It's not about commands or
UI, but just about building packages and apps.

A next step could be moving things that are strictly "the command-line
tool" into their own subdir, and leaving the top directory mostly just
for shared utilities like buildmessage.  (Which could even go in a utils
subdir?)
2015-07-16 15:12:36 -07:00