説明
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.jsondoes not containgitHead
What is the expected behavior?
- See
node_modules/<package>/package.jsoncontainsgitHead
Please mention your node.js, yarn and operating system version. yarn v0.21.3 node v7.7.0 macOS