meteor-typescript
Advanced tools
Comparing version
{ | ||
"name": "meteor-typescript", | ||
"author": "@barbatus", | ||
"version": "0.8.3-beta2", | ||
"version": "0.8.3-beta3", | ||
"license": "MIT", | ||
@@ -6,0 +6,0 @@ "description": "TypeScript wrapper package for use with Meteor", |
@@ -57,3 +57,3 @@ var assert = require("assert"); | ||
var module = checker.getSymbolAtLocation(importName); | ||
if (module && module.flags & 1536) { | ||
if (module && (module.flags & 1536)) { | ||
var path = getModulePath(module); | ||
@@ -63,25 +63,30 @@ if (path) { | ||
} | ||
var nodes = checker.getExportsOfModule(module); | ||
_.each(nodes, function(node) { | ||
if (node.parent && node.parent !== module) { | ||
var path = getModulePath(node.parent); | ||
if (path) { | ||
paths.add(path); | ||
} | ||
return; | ||
} | ||
// If directly imported module re-uses and exports of a type | ||
// from another module, add this module to the dependency as well. | ||
var type = checker.getTypeAtLocation(node.declarations[0]); | ||
if (type && type.symbol) { | ||
var typeModule = type.symbol.parent; | ||
if (typeModule !== module) { | ||
var path = getModulePath(typeModule); | ||
try { | ||
var nodes = checker.getExportsOfModule(module); | ||
_.each(nodes, function(node) { | ||
if (node.parent && node.parent !== module) { | ||
var path = getModulePath(node.parent); | ||
if (path) { | ||
paths.add(path); | ||
} | ||
return; | ||
} | ||
} | ||
}); | ||
// If directly imported module re-uses and exports of a type | ||
// from another module, add this module to the dependency as well. | ||
var type = checker.getTypeAtLocation(node.declarations[0]); | ||
if (type && type.symbol) { | ||
var typeModule = type.symbol.parent; | ||
if (typeModule !== module) { | ||
var path = getModulePath(typeModule); | ||
if (path) { | ||
paths.add(path); | ||
} | ||
} | ||
} | ||
}); | ||
} catch(ex) { | ||
console.log(importName); | ||
console.log(module); | ||
} | ||
} | ||
@@ -88,0 +93,0 @@ }); |
60741
0.26%1712
0.29%