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

feat: decorate picked manifest with publish time #87

Closed
wants to merge 2 commits into from

Conversation

feelepxyz
Copy link

Decorate the manifest with the publish time from the packument if this exists for the picked version.

This is used in pacote to pick a valid signing key when verifying registry signatures and attestations:
npm/pacote#284

Decorate the manifest with the publish time from the packument if this
exists for the picked version.

This is used in pacote to pick a valid signing key when verifying
registry signatures and attestations:
npm/pacote#284

Signed-off-by: Philip Harrison <philip@mailharrison.com>
test/index.js Outdated
Copy link
Author

Choose a reason for hiding this comment

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

Looked into these test failures and can reproduce the issue with semver@7.5.2 and this commit specifically: npm/node-semver@717534e

This now returns true: semver.satisfies('2.0.0', '== 1.0.0 || foo', { loose: true })) whereas it did not previously

cc @lukekarrys

lib/index.js Outdated Show resolved Hide resolved
Co-authored-by: Gar <wraithgar@github.com>
@wraithgar wraithgar changed the title Decorate manifest with publish time feat: decorate picked manifest with publish time Jul 5, 2023
@@ -185,6 +185,11 @@ const pickManifest = (packument, wanted, opts) => {

module.exports = (packument, wanted, opts = {}) => {
const mani = pickManifest(packument, wanted, opts)
// Decorate with publish time if available
const _time = packument.time.?[mani?.version]]
Copy link
Member

Choose a reason for hiding this comment

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

looks like we got the . and ? swapped after time.

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.

2 participants