Skip to content

fix(npm_registry): add missing `hasInstallScript` field on abbreviated package metadata

  • Please check this box if this contribution uses AI-generated content (including content generated by GitLab Duo features) as outlined in the GitLab DCO & CLA

What does this MR do and why?

Adds the missing hasInstallScript field on the abbreviated package metadata returned by the NPM package registry. This is not required for the full metadata endpoint in #344107.

All we're doing is allowing the field to either be uploaded by the package manager OR having it generated based on if the package.json includes preinstall, install, or postinstall scripts.

Credit to @christiand.aspedia for the initial implementation in !83807, all I did was resolve conflicts and remove the performance concern with _hasShrinkwrap generation. 😄

Addresses NPM metadata endpoint: add `scripts` / `hasInst... (#346772 - closed)

Edited by 🤖 GitLab Bot 🤖

Merge request reports

Loading