Skip to content

fix: deserialize package reqs as normalized#49

Merged
dsherret merged 10 commits into
denoland:mainfrom
dsherret:fix_deserialize_package_req_strict
Nov 15, 2025
Merged

fix: deserialize package reqs as normalized#49
dsherret merged 10 commits into
denoland:mainfrom
dsherret:fix_deserialize_package_req_strict

Conversation

@dsherret

@dsherret dsherret commented Nov 15, 2025

Copy link
Copy Markdown
Contributor

We were normalizing package reqs and then deserializing them "loosely". This mean that tags like v1.2 would accidentally get parsed as a version range instead of a tag as it should be leading to bad comparisons between the lockfile and config files.

@dsherret dsherret marked this pull request as draft November 15, 2025 02:10
@dsherret dsherret marked this pull request as ready for review November 15, 2025 17:13
@dsherret dsherret changed the title fix: deserialize package reqs strictly fix: deserialize normalized package reqs Nov 15, 2025
@dsherret dsherret changed the title fix: deserialize normalized package reqs fix: deserialize package reqs as normalized Nov 15, 2025
Comment thread src/common.rs

@dsherret dsherret Nov 15, 2025

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This file is extracting out functions from npm.rs

Comment thread src/common.rs
@@ -0,0 +1,159 @@
// Copyright 2018-2023 the Deno authors. All rights reserved. MIT license.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I'll fix the out of date copyright in a different pr.

Comment thread src/lib.rs
pub use self::range::VersionRangeSet;
pub use self::range::XRange;
pub use self::range_set_or_tag::PackageTag;
pub use self::range_set_or_tag::RangeSetOrTag;

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Extracted from here, so exporting them now.

@dsherret dsherret merged commit af3e183 into denoland:main Nov 15, 2025
1 check passed
@dsherret dsherret deleted the fix_deserialize_package_req_strict branch November 15, 2025 20:24
dsherret added a commit to denoland/deno that referenced this pull request Nov 15, 2025
There was a bug that was causing npm resolution to occur due to:

* denoland/deno_semver#49

Also includes:

* denoland/deno_semver#45
bartlomieju pushed a commit to bartlomieju/deno that referenced this pull request Nov 17, 2025
There was a bug that was causing npm resolution to occur due to:

* denoland/deno_semver#49

Also includes:

* denoland/deno_semver#45
bartlomieju pushed a commit to denoland/deno that referenced this pull request Jan 22, 2026
There was a bug that was causing npm resolution to occur due to:

* denoland/deno_semver#49

Also includes:

* denoland/deno_semver#45
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