Skip to content

Do not generate links for private NPM modules in blob view

What does this MR do?

It adds a distinction between private and public NPM modules, detected via a "private": true entry in package.json, in order to avoid a 404 when attempting to link to the module in the blob viewer, as it should not exist on npmjs.com. Instead it attempts to link to the homepage attribute if present.

Are there points in the code the reviewer needs to double check?

  • Since I had to use the JSON-parsed blob data in more than one area I added a memoized json_data method to BlobViewer::DependencyManager

Why was this MR needed?

See #36020 (closed)

Screenshots (if relevant)

A private module now looks like this when viewing its package.json:

Does this MR meet the acceptance criteria?

What are the relevant issue numbers?

Closes #36020 (closed)

Edited by Mario de la Ossa

Merge request reports