Open lucacasonato opened 1 year ago
For this, we'll do the current output by default, but print a warning to provide --format=json.1
flag. Then we'll upgrade --format=json.2
to do this output. We should move this out of deno graph and do serialization from a ModuleGraph
that doesn't just call graph.serialize(...)
so the format can be more stable.
Right now the representation of
npm:
specifiers indeno info --json
are inconsistent. For example,npm:
specifiers are currently added as an entry to the"modules"
array if they are a root module, but are not added if they are a dependency of a "standard" (https:
orfile:
module). There are entries in theredirects
for NPM modules, but they point to specifiers that are only visible through thedeps
array on modules. Long story short, dealing with NPM specifiers indeno info --json
is a royal PITA right now and requires many special cases. It also breaks backwards compat with the expectation that all RHS of theredirects
map have entries in themodules
array.I propose we fix this as follows:
modules
arraymodule
-> package info innpmPackages
is per module in the modules array, not per import in thedeps
arraydeps
array is identical regardless of what kind of module the import points toesm
,npm
ornode
specifier
fielderror
fieldnpmPackage
field, and additionally a seperate field for subpathnode:fs/promises
would havefs/promises
in this field)npm:preact
tonpm:preact@10.13.0