jspm / generator

JSPM Import Map Generator
Apache License 2.0
166 stars 21 forks source link

staticDeps and dynamicDeps as full graph #91

Closed guybedford closed 2 years ago

guybedford commented 2 years ago

Currently staticDeps and dynamicDeps are just arrays of modules, without further graph information.

It could be useful to actually expose the entire graph for these in the generation to be able to lookup arbitrary dependency information.

We currently have a getAnalysis method which returns the analysis per module. It could be useful to effectively get the whole graph in one:

generator.getGraph() = () => ({
  [url: string]: {
      staticDeps: { specifier: string }[],
      dynamicDeps: { specifier: string }[]
  }
})

The current getAnalysis could be extended to support this form relatively easily.

guybedford commented 2 years ago

The current primitive we have with getAnalysis is enough I think to do this, closing for now.