packager: get rid of type any in ResolutionRequest

Summary:
One of my changeset broke the "ModuleGraph" code without warning earlier because we are using `any`, that equivalent to having no typing at all. This changeset fixes the types so that `ResolutionRequest` is exactly what it actually is: a class usable for any `Module`-looking class, including the normal one, and the "ModuleGraph" one used for Buck builds. That way, the ModuleGraph's `Module` is typechecked against `Moduleish`.

Concretely this change mostly migrates the `Module` to its generic parameter counterpart `TModule` inside `ResolutionRequest`.

Reviewed By: kentaromiura

Differential Revision: D4826256

fbshipit-source-id: fcd7ca08ac6c35e4e9ca983e2aab260e352bcb4e
This commit is contained in:
Jean Lauliac
2017-04-04 07:06:25 -07:00
committed by Facebook Github Bot
parent 03892d1036
commit 8755338728
11 changed files with 67 additions and 43 deletions

View File

@@ -44,6 +44,10 @@ module.exports = class Module {
isHaste() {
return this.hasteID.then(Boolean);
}
hash() {
throw new Error('not implemented');
}
};
function getName(path) {