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

Workspace protocol with any semver range specifier #7578

Open
1 task done
EWhite613 opened this issue Jan 26, 2024 · 1 comment · May be fixed by #7633
Open
1 task done

Workspace protocol with any semver range specifier #7578

EWhite613 opened this issue Jan 26, 2024 · 1 comment · May be fixed by #7633

Comments

@EWhite613
Copy link

Contribution

Describe the user story

Would like to use the workspace protocol with any range specifier.

Currently there are only workspace:*, workspace:~, or workspace:^. But I would like to use >= specifically in my

Describe the solution you'd like

  "peerDependencies": {
    "vue": "3.2.36",
    "@monotest/composables": "workspace:>="
  },

or

  "peerDependencies": {
    "vue": "3.2.36",
    "@monotest/composables": ">=workspace:*"
  },

then published as (assume version is 1.0.0)

  "peerDependencies": {
    "vue": "3.2.36",
    "@monotest/composables": ">=1.0.0"
  },

Describe the drawbacks of your solution

Clearly this could be pandora's box where you need to handle crazy things like:

 "@monotest/composables": "workspace:^ | ^3.0.0"

which may be easy if you parse versions for workspace:* and replace that with the version.

It does seem like something like this is happening though in my tests with pnpm pack but simply just strips workspace rather than trying to put version in as well:

  • "@monotest/composables": "workspace:^ | ^3.0.0" -> "@monotest/composables": "^ | ^3.0.0"
  • "@monotest/composables": "workspace:>=" -> "@monotest/composables": ">="

Can see dummy repo here: https://github.com/EWhite613/vue3-pnpm-workspace/blob/main/monotest-components-0.1.0-packed/package.json#L30

Describe alternatives you've considered

Thought about creating a script and running on postpack to do the replacement myself. But I think it could belong in core package, if it made sense, as I think others would use it.

@zkochan
Copy link
Member

zkochan commented Jan 26, 2024

I don't have objections. In peer deps it makes sense to support this.

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

Successfully merging a pull request may close this issue.

2 participants