Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
/pnpmPublic

fix(catalogs): preserve existing semver ranges when adding packages with--save-catalog#9762

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Draft
ryo-manba wants to merge3 commits intopnpm:main
base:main
Choose a base branch
Loading
fromryo-manba:fix-catalog-semver-preservation

Conversation

@ryo-manba
Copy link
Member

When adding a package with--save-catalog to multiple projects in a workspace, the existing catalog entry's semver range (e.g.,^1.0.1) was being replaced with a fixed version (e.g.,1.0.1).

This fix checks for existing catalog entries before updating them.

Fixes#9759

…ith --save-catalogWhen adding a package with `--save-catalog` to multiple projects in a workspace,the existing catalog entry's semver range (e.g., `^1.0.1`) was being replacedwith a fixed version (e.g., `1.0.1`).This fix checks for existing catalog entries before updating them, ensuring thatcatalog entries maintain their version flexibility across all projects in theworkspace.Fixespnpm#9759
@welcome
Copy link

welcomebot commentedJul 15, 2025

💖 Thanks for opening this pull request! 💖
Please be patient and we will get back to you as soon as we can.

@ryo-manbaryo-manba marked this pull request as draftJuly 16, 2025 12:29
@zkochanzkochan requested a review fromgluxonJuly 19, 2025 23:52
Copy link
Member

@gluxongluxon left a comment

Choose a reason for hiding this comment

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

Appreciate the help fixing this!

if(dep.catalogLookup==null)continue
updatedCatalogs??={}
updatedCatalogs[dep.catalogLookup.catalogName]??={}
updatedCatalogs[dep.catalogLookup.catalogName][dep.alias]=dep.normalizedBareSpecifier??dep.catalogLookup.userSpecifiedBareSpecifier
Copy link
Member

Choose a reason for hiding this comment

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

This might be fixing the symptom rather than the bug itself. I'd expect thenormalizedBareSpecifier to contain the existing version with a caret. 🤔

ryo-manba reacted with eyes emoji
Copy link
MemberAuthor

Choose a reason for hiding this comment

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

Appreciate the heads-up!
I'll dig into it more.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

@gluxon
I've fixednpm-resolver to preserve existing semver ranges (e.g.,^1.0.0) inbareSpecifier, ensuringnormalizedBareSpecifier reflects them correctly. Also added support to maintain semver ranges during catalog updates.

@gluxongluxon self-assigned thisJul 21, 2025
@ryo-manbaryo-manba marked this pull request as ready for reviewAugust 2, 2025 08:32
@zkochan
Copy link
Member

This solution doesn't seem correct but I don't know how to properly do it without digging into it. We should probably check how the specs are preserved during regular "pnpm install" and use the same approach.

ryo-manba reacted with thumbs up emoji

@ryo-manbaryo-manba marked this pull request as draftSeptember 26, 2025 14:02
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@gluxongluxongluxon left review comments

@zkochanzkochanAwaiting requested review from zkochanzkochan is a code owner

Copilot code reviewCopilotAwaiting requested review from CopilotCopilot will automatically review once the pull request is marked ready for review

At least 1 approving review is required to merge this pull request.

Assignees

@gluxongluxon

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

pnpm add replaces semver range of catalog dependency with fixed version when installed in multiple projects

3 participants

@ryo-manba@zkochan@gluxon

[8]ページ先頭

©2009-2025 Movatter.jp