import foo = require('foo'); results in an identifier foo: any. How should we represent this in Famix? A NamedEntity doesn't have a type. A Module is not quite the same as a CommonJS module (which is like a black box to some degree).
A solution could be to create CommonJSModule someplace (under StructuralEntity or under NamedEntity?) which allows for a Type definition, and when the parser encounters import x = require('blah') we just make an instance of this CommonJSModule with a type any.
CommonJSModule would not have a lot of info in Famix, but perhaps we can see the dependencies through ImportClauses.
I am thinking with AMD modules we could also do a similar thing. However, AMD doesn't always use import syntax, so I'm not sure it's easy to support.
See #35 (CommonJS lazy-loading case)
import foo = require('foo');
results in an identifierfoo: any
. How should we represent this in Famix? ANamedEntity
doesn't have a type. AModule
is not quite the same as a CommonJS module (which is like a black box to some degree).A solution could be to create
CommonJSModule
someplace (underStructuralEntity
or underNamedEntity
?) which allows for aType
definition, and when the parser encountersimport x = require('blah')
we just make an instance of this CommonJSModule with a typeany
.CommonJSModule would not have a lot of info in Famix, but perhaps we can see the dependencies through ImportClauses.
I am thinking with AMD modules we could also do a similar thing. However, AMD doesn't always use
import
syntax, so I'm not sure it's easy to support.