Skip to content

manifest: normalize legacy npm-prefixed resolution selectors#253

Open
hamidrezahanafi wants to merge 1 commit intoyarnpkg:mainfrom
hamidrezahanafi:hamid/pr2-legacy-npm-resolutions
Open

manifest: normalize legacy npm-prefixed resolution selectors#253
hamidrezahanafi wants to merge 1 commit intoyarnpkg:mainfrom
hamidrezahanafi:hamid/pr2-legacy-npm-resolutions

Conversation

@hamidrezahanafi
Copy link

Summary

  • normalize legacy selector ranges like no-deps@npm:1.0.0 while parsing resolutions
  • keep selector validation semantics by converting legacy registry-semver selectors to anonymous semver
  • add acceptance coverage for npm-prefixed descriptor selectors in features/resolutions.test.js

Test plan

  • cargo test -p zpm resolutions_accept_legacy_npm
  • Acceptance test added in tests/acceptance-tests/pkg-tests-specs/sources/features/resolutions.test.js

Made with Cursor

Accept legacy descriptor selectors such as no-deps@npm:1.0.0 by normalizing them to anonymous ranges during resolution parsing. This preserves compatibility with manifests generated by older Yarn flows.

Co-authored-by: Cursor <cursoragent@cursor.com>
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 14, 2026

Greptile Overview

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The implementation is straightforward and well-tested. It removes a validation error and replaces it with normalization logic that converts legacy formats to the expected format. The to_anonymous_range() method is already used throughout the codebase, and the acceptance test demonstrates the feature works correctly end-to-end.
  • No files require special attention

Important Files Changed

Filename Overview
packages/zpm/src/manifest/resolutions.rs Replaces error-throwing validation with normalization function that converts legacy npm:-prefixed selectors to anonymous ranges
tests/acceptance-tests/pkg-tests-specs/sources/features/resolutions.test.js Adds acceptance test verifying that no-deps@npm:1.0.0 resolution selector correctly resolves dependencies

Last reviewed commit: 3b40ade

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.

1 participant