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

Support an ignore / reject option for the pnpm update and pnpm outdated commands #5358

Closed
1 task
nicholas-ochoa opened this issue Sep 14, 2022 · 5 comments · Fixed by #5408
Closed
1 task
Assignees
Milestone

Comments

@nicholas-ochoa
Copy link

The pnpm update and pnpm outdated commands are very useful and I would love to replace my current usage of the npm-check-updates package with these. One limitation I'm facing is that I currently have a few packages "blacklisted" when npm-check-updates does a check for updates across all workspace packages recursively. This is accomplished by adding the package name to the .ncurc.yaml file under the rejects config option either in the project root, or within a package directory.

If possible, I would love if this could be replicated within pnpm - perhaps by adding a new pnpm.update.ignore property to the package.json of the project root and/or package directories.

Something like this which would ignore all updates for the package commander, and would not attempt to update chalk version 4.x.x either - but if a package uses chalk 5.x.x that may be updated.

  "pnpm": {
    "update": {
      "ignore": {
        "commander": "*",
        "chalk": "4.x.x"
      }
    }
  }

Describe the drawbacks of your solution

I can't think of any drawbacks aside from the obvious "adding more complexity to the package.json file".

Describe alternatives you've considered

I can continue using npm-check-updates to accomplish this, but it would be great to extend the pnpm functionality to eliminate another package.

@zkochan
Copy link
Member

zkochan commented Sep 15, 2022

Good idea.

@Shinyaigeek
Copy link
Member

Hi, I am loving this feature. Can I work on implementing this?

@zkochan
Copy link
Member

zkochan commented Sep 20, 2022

@Shinyaigeek feel free to work on it and submit a PR.

zkochan added a commit that referenced this issue Oct 2, 2022
…oreDependencies` on update/outdated commands (#5408)

closes #5358

Co-authored-by: Zoltan Kochan <z@kochan.io>
@zkochan zkochan added this to the v7.13 milestone Oct 3, 2022
@nicholas-ochoa
Copy link
Author

nicholas-ochoa commented Oct 3, 2022

@zkochan @Shinyaigeek thank you both for working on this and getting it implemented! I noticed an issue where it does not seem to work when run recursively pnpm outdated -r - should I open a new issue to discuss / review?

Edit: On further testing, it would seem that it only works when added to the root package.json file and not to a package.json for a specific package in the workspace. Is it possible to restrict the ignore to just a single package or multiple packages in the workspace, or does it always need to apply to the entire workspace?

For example, I have chalk ignored for a single package in my workspace due to the Chalk update to ESM with 5.x. The effort to refactor the application is large enough that we will likely never update Chalk for this specific tool. However, there are other applications in the workspace that do utilize the latest version of Chalk.

@zkochan
Copy link
Member

zkochan commented Oct 3, 2022

Is it possible to restrict the ignore to just a single package or multiple packages in the workspace, or does it always need to apply to the entire workspace?

No, it is not possible. I guess it could be implemented but for me it is not high priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants