Skip to content

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

@feelepxyz feelepxyz force-pushed the feelepxyz/add-time branch 2 times, most recently from f487565 to f382d1d Compare July 4, 2023 15:48
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 <[email protected]>
@feelepxyz feelepxyz force-pushed the feelepxyz/add-time branch from f382d1d to 75b319a Compare July 4, 2023 15:49
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 [email protected] 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

@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