Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support gitHead property in package.json #2978

Open
felixfbecker opened this issue Mar 23, 2017 · 1 comment
Open

support gitHead property in package.json #2978

felixfbecker opened this issue Mar 23, 2017 · 1 comment

Comments

@felixfbecker
Copy link

felixfbecker commented Mar 23, 2017

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: npm/read-package-json#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

@bestander bestander changed the title gitHead property missing in package.json support gitHead property in package.json Jun 22, 2017
@bestander
Copy link
Member

Sounds like a great opportunity for a PR

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants