feat: add support for pnpm catalogs #185
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
π Linked issue / Discussion
No issue opened. Change was small enough to PR directly.
β Type of change
π Description
Currently, Nuxtr errors when using pnpm catalogs to manage
nuxt
's version.This PR introduces a way for this extension to get the version number from
pnpm-workspace.yaml
using a regex to avoid adding any extra dependencies to the project.This regex is extremely naive and doesn't check for the specific catalog where
nuxt
is supposed to be defined. Despite this it supports configs using simple, double or no quotes for the dependency name and version number (mix and match too). It also allows you to use anchors and aliases as long as a version number is specified in thenuxt
line.This is what my current config looks like and what I tested these changes with:
Might be a good idea to add tests to ensure the regex works as expected in the future but since they're not set up in the project, we might tackle this in a separate PR if you want.
π Checklist
Not sure if this is something we would need to document since it is a change to an internal function.