Dependency graph doesn't recognize namespaced packages in package.json

While the dependency graph (and the new “used by” feature) is working wonderfully for standard npm packages i.e. linking to the repos etc. it doesn’t fully connect namespaced packages.

Example:

Having babel-core in my package.json will list babel-core and link to babel/babel in the dependencies. However, @babel/core will not link to babel/babel even though it does list the dependency. Observable in e.g. https://github.com/emotion-js/emotion/network/dependencies orhttps://github.com/mui-org/material-ui/network/dependencies

This is especially an issue because namespaced packages will not have any dependents listed and will be considered as used by zero other repositories.

6 Likes

Hey @eps1lon,

Thanks for being here and thanks for the feedback! I’ve passed it along with the team behind packages. I’m curious tho when you look up namespaced packages on https://www.npmjs.com/ does it show the dependents?

>  I’m curious tho when you look up namespaced packages on https://www.npmjs.com/ does it show the dependents?

@andreagriffiths11  Good question. For our particular case there are some listed (https://www.npmjs.com/package/@material-ui/core) though we’re mostly used at an app level which aren’t published to npm. So I would assume npmjs is properly creating dependency graphs for namespaced packages

@eps1lon, interesting! Thanks for the follow-up. I’ll be sure to pass the link along as well. 

Hey @andreagriffiths11 is there any update on this?

Many npm packages are now scoped/namespaced, which means more and more dependency links are breaking.

This seems to work now: 

https://github.com/mui-org/material-ui/network/dependents

1 Like