Commit Graph

6 Commits

Author SHA1 Message Date
Ben Newman
24865b28a0 Wrap Module.prototype.require instead of using options.wrapRequire.
a630b5c2ac
7a9abeca88
2018-06-25 16:43:46 -04:00
Michał Powaga
7b2aba09a0 Print nicer error message for missing Meteor package (#9719) 2018-03-29 09:51:18 -04:00
Ben Newman
971d2b1272 Standardize Npm.require exceptions and limit lookup paths. (#9095)
Ever since Meteor 1.3 first introduced a module system based on something
other than `Npm.require`, we've continued throwing missing module
exceptions that refer to `Npm.depends` and/or `Npm.require`, even if the
developer called `require` or used an `import` declaration. This commit
fixes that, so that all missing module exceptions look like 'Cannot find
module "module/name"'.

I also noticed recently that `Npm.require` is capable of returning modules
installed in `node_modules` directories completely outside the app, which
is bad news for development/production reproducibility. Fixed that too.

CC @hwillson who has spoken of deprecating `Npm.require` entirely, and
just using `require` everywhere, instead.
2017-09-18 11:39:45 -04:00
Ben Newman
9c7778da36 Let the install npm package implement Module.prototype.prefetch.
Now anyone can define meteorInstall.fetch however they see fit, and the
install.js implementation will handle everything else.

This separation of concerns leads to significantly less code, too.
2017-05-01 23:55:00 -04:00
Ben Newman
352f545be2 Record complete module graph, including dynamic stubs, in meteorInstall. 2017-02-07 16:17:42 -05:00
Ben Newman
960ad2266b Refactor modules-runtime into multiple files. 2017-02-07 16:17:40 -05:00