yarnpkg/yarn

support gitHead property in package.json

Open

#2978 aperta il 23 mar 2017

Vedi su GitHub
 (1 commento) (6 reazioni) (0 assegnatari)JavaScript (2731 fork)batch import
cat-compatibilitycat-featurehelp wantedtriaged

Metriche repository

Star
 (41.514 star)
Metriche merge PR
 (Nessuna PR mergiata in 30 g)

Descrizione

Do you want to request a feature or report a bug? Bug

What is the current behavior? When you run yarn/npm info <package>, the returned package metadata has a gitHead field which points to the git HEAD SHA1 at the time npm publish was run. When you run npm install <package>, you will also find that field in the package.json of the installed package. When you run yarn add <package>, that field is missing from the package.json.

This is a very useful field (see reasoning here: https://github.com/npm/read-package-json/issues/7) and the absence means that yarn users instead need to do an expensive API call with yarn info for every single package if they want to find this information out.

This is not one of npm's underscore-prefixed fields that only get added locally on installation. It gets added to the package data on publish.

If the current behavior is a bug, please provide the steps to reproduce.

  • Run yarn add <package>
  • See node_modules/<package>/package.json does not contain gitHead

What is the expected behavior?

  • See node_modules/<package>/package.json contains gitHead

Please mention your node.js, yarn and operating system version. yarn v0.21.3 node v7.7.0 macOS

Guida contributor