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

Provide release commit when publishing to NPM #36960

Closed
5 tasks done
JasonRShaver opened this issue Feb 22, 2020 · 3 comments · Fixed by #58135
Closed
5 tasks done

Provide release commit when publishing to NPM #36960

JasonRShaver opened this issue Feb 22, 2020 · 3 comments · Fixed by #58135
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript

Comments

@JasonRShaver
Copy link

Search Terms

npm, commit, githead

Suggestion

In order to participate in a secure software supply chain, TypeScript should provide the release commit in the package.json's githead property for releases made to npmjs.org.

Use Cases

This field is used to establish the provenance of artifacts downloaded from NPM and can be used to validate the received artifact matches the original sources. This field also enables other ecosystem tools such as sourcegraph and clearlydefined.io.

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript/JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
  • This feature would agree with the rest of TypeScript's Design Goals.
@orta
Copy link
Contributor

orta commented Feb 22, 2020

We deploy in a separate vm from one with access to the git repo for security - is there a way to set this commit without fs git access?

@RyanCavanaugh
Copy link
Member

I think we could have the gulp LKG script modify package.json according to the current git HEAD, since the things we publish to npm are solely outputs of that process

cc @weswigham for npm opinions

@RyanCavanaugh RyanCavanaugh added In Discussion Not yet reached consensus Suggestion An idea for TypeScript labels Feb 24, 2020
@weswigham
Copy link
Member

This is one of the fields that npm generates on publish, right; if we're missing it, it's an npm bug, afaik, since npm pack is supposed to add all the generated fields to the package.json in the tarball it packs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
In Discussion Not yet reached consensus Suggestion An idea for TypeScript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants