Commit Graph

19 Commits

Author SHA1 Message Date
Ben Newman
e3387599a2 Test lazy main modules and stray imports in modules test app. 2016-11-14 13:35:50 -05:00
Ben Newman
8f07a87bd5 Give package test modules access to Npm.depends dependencies.
Similar in spirit to bbac272530.

Fixes #7999.
2016-11-08 15:36:36 -05:00
Ben Newman
9810562403 Test that one package can have both node_modules and Npm.depends. 2016-09-22 14:34:32 -04:00
Ben Newman
5ae53de46b Warn but do not crash when .babelrc dependencies unmet. 2016-06-06 19:55:22 -04:00
Ben Newman
bfc59dd3e3 Test that relative module identifiers work for .babelrc plugins. 2016-06-01 01:39:24 -04:00
Ben Newman
eb18d43024 Test that unprefixed .babelrc package names work too. 2016-06-01 01:39:23 -04:00
Ben Newman
398c2717e7 Use .babelrc instead of package.json in modules-test-plugin. 2016-05-20 13:09:41 -04:00
Ben Newman
1ef013f6ad Use regenerator-runtime in modules test app.
Apparently regenerator/runtime is now deprecated. I say "apparently," but
of course is my own doing.
2016-05-19 17:04:07 -04:00
Ben Newman
7c63a8e704 Allow custom Babel presets and plugins via package.json.
When the babel-compiler package is processing files, it will now read
their package.json files looking for a "babel" section with "presets" or
"plugins" fields. If found, these presets or plugins will be appended to
the existing babelOptions.presets or babelOptions.plugins arrays.

Note that no other Babel options are currently supported, and the
"babel-preset-meteor" preset cannot be removed, though additional presets
and/or plugins can be added to it. This is by design: Meteor cannot
support your configuration it uses babel-preset-meteor, at least.

The preset and/or plugin modules listed in package.json must be installed
locally somewhere such that the given file can import them. If they are
top-level identifiers, they will be prefixed with "babel-plugin-" or
"babel-preset-", the same as Babel does it. Otherwise they will be
required as-is, so that you can implement your own Babel plugins locally,
rather than always using plugins installed from npm.

See the included tests for a concrete example.

Fixes #6351.
2016-05-18 16:37:38 -04:00
Ben Newman
b16e8d5019 Implement inputFile.{getPackageJson,resolve,require} for use by plugins.
These changes allow Package.registerCompiler-style compiler plugins to
extract package.json and npm package information at compile time from the
files that the plugin processes.

This information was accessible before, but it certainly wasn't easy to
obtain it. These convenience methods should satisfy the motivation behind
2016-05-18 16:37:37 -04:00
Ben Newman
f6b75305b3 Pay attention to unibuild.arch when determining usesModules.
Fixes #6877.
2016-05-17 14:27:56 -04:00
Ben Newman
f56940b314 Fix CSS computed property tests broken by app-hiding logic. 2016-03-10 16:04:04 -05:00
Ben Newman
5c47891489 Allow custom stubs to override meteor-node-stubs.
Part of #6056.
2016-02-29 19:45:52 -05:00
Ben Newman
868c249c15 Add a test to verify #6240 has been fixed.
Closes #6240.
2016-02-16 20:58:12 -05:00
Ben Newman
5d0a8f8f0e Allow apps and packages to import "meteor/<package>/..." modules. 2016-02-11 11:45:58 -05:00
Ben Newman
ce4fda3783 Tolerate compilation errors for lazy files.
Fixes #5998.
2016-02-11 11:41:39 -05:00
Ben Newman
524970a20e Add tests of importing lazy CSS files in apps and packages. 2016-01-19 21:00:48 -05:00
Ben Newman
c631d3ac35 Bundle global npm dependencies into the modules bundle.
This allows packages to import npm packages they have not installed, with
the expectation that the app developer will provide those dependencies by
installing them into the top-level node_modules directory in the app.

For example, an app can now `npm install react` and that npm package can
be used by any package as well as by the app.
2016-01-18 19:05:43 -05:00
Ben Newman
988b8b3d0c Commit an app that tests many aspects of the module system.
Partially satisfies #5782.
2016-01-11 15:31:32 -05:00