Skip to content

Provide release commit when publishing to NPM #36960

Closed

Description

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.

Activity

  1. orta commented on Feb 22, 2020

    @orta
    Contributor

    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?

  2. RyanCavanaugh commented on Feb 24, 2020

    @RyanCavanaugh
    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 Wesley Wigham (@weswigham) for npm opinions

  3. weswigham commented on Feb 24, 2020

    @weswigham
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    In DiscussionNot yet reached consensusSuggestionAn idea for TypeScript

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions