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

feat(node-workspace): Allow to specify version prefix in config #1580

Closed
wants to merge 1 commit into from
Closed

Conversation

danez
Copy link
Contributor

@danez danez commented Aug 16, 2022

This allows a versionPrefix config option that can be set to a string (like ~, ^, , >=) that will be used when updating linked local dependencies in a package.

  • Make sure to open an issue as a bug/issue before writing your code! That way we can discuss the change, evaluate designs, and agree on the general idea
  • Ensure the tests and linter pass
  • Code coverage does not decrease (if any source code was changed)
  • Appropriate docs were updated (if necessary)

This allows a `versionPrefix` config option that can be set to a string (like `~`, `^`, ` `, `>=`) that will be used when updating dependencies in this package
@danez danez requested a review from a team as a code owner August 16, 2022 20:28
@danez danez requested a review from a team August 16, 2022 20:28
@product-auto-label product-auto-label bot added the size: m Pull request size is medium. label Aug 16, 2022
Copy link
Contributor

@chingor13 chingor13 left a comment

Choose a reason for hiding this comment

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

Thanks for this pull request and sorry for the delay in the review.

I'm torn on whether this option should be global (like it's implemented here) or should be localized to the node-workspace plugin (and potentially other workspace plugins). The reason being that these version prefixes only really apply to dependency declarations (which are handled by workspace plugins).

If localized to the node-workspace plugin, we would add a config like:

{
  "plugins": [
    {
      "type": "node-workspace",
      "versionPrefix": "~"
    }
  ]
}

and then have the version prefix as a constructor argument to the workspace plugins.

What do you think?

@@ -172,6 +172,10 @@ defaults (those are documented in comments)
// absence defaults to false
"bump-patch-for-minor-pre-major": true,

// prefix linked package version updates with this string
// absence defaults to `^`
"version-prefix": true,
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"version-prefix": true,
"version-prefix": "^",

@chingor13
Copy link
Contributor

Another option too, is to have the workspace plugins be smarter when updating the dependencies and preserve whatever prefix is currently being used.

@danez
Copy link
Contributor Author

danez commented Oct 6, 2022

Another option too, is to have the workspace plugins be smarter when updating the dependencies and preserve whatever prefix is currently being used.

I actually like this the best, will try to find some time to look into this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size: m Pull request size is medium.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants