⚠ This page is served via a proxy. Original site: https://github.com
This service does not collect credentials or authentication data.
Skip to content

Conversation

@dreyfus92
Copy link
Contributor

adds a new core/trust module with pure functions for computing npm package trust levels based on provenance attestations. This is the foundation for sharing logic between the CLI and the GitHub Action.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Dec 20, 2025

Open in StackBlitz

npm i https://pkg.pr.new/e18e/cli/@e18e/cli@138

commit: 974ca36

@laurathackray21
Copy link
Collaborator

Looks good!

* Core modules containing pure, reusable logic that can be imported
* by external tools like the e18e GitHub Action.
*/
export * from './trust.js';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i wonder if we should drop this barrel file as we export them in the root anyway

instead of this re-exporting everything, and the root re-exporting them again. we can just put this in the root

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the reasoning behind having this barrel file was the aim of expanding core modules, if you think this won't be the case, then yes this would be unnecessary.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it will be the case. But things like the GitHub action will import them from the root. So we will just be exporting them twice internally if we keep this as it is.

Internally I think we should be avoiding barrel files. The only place we should really have one is the root entry point.

So everywhere that imports these should get them directly or from the root

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sounds good, will drop this as well

* Metadata about an npm package version, containing provenance information.
* This is a subset of the full npm registry metadata.
*/
export interface PackageProvenanceMetadata {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

presumably there's a util which fetches the metadata and uses this type too?

do we want to include that in here? where does the action have it today?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i can't recall why i added that type tbh, i think i wanted to implement the type cause i was thinking of adding an utility in core. but it has passed a month already since i worked on this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

its basically the response type of the npm API by the looks of it

so we should either drop it for now, or introduce the helper function that hits the npm api and uses it

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i'll drop this for now so we can discuss and refine the details together during Friday's meeting.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants