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 a one-version fix command #3

Open
hamlim opened this issue May 19, 2024 · 0 comments
Open

Support a one-version fix command #3

hamlim opened this issue May 19, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@hamlim
Copy link
Owner

hamlim commented May 19, 2024

Why?

Make it really easy to fix the output from one-version check (currently both consistent versioning across workspaces and versionStrategy conformance as well).

Right now - the output of check can be a bit difficult to go through and fix. It's not necessarily always as easy as removing the loose version specifiers for example - since the desired behavior would be to check the output from the package manager and see what version is being resolved based on the lockfile.

Desired Behavior:

Add support for a one-version fix command.

Version Skew

This is a bit tricky - as a CLI, how do we know what version is the version to choose when two workspaces differ. We could try to be smart about it with some different algorithms:

  • Pick the version that we first find (basically based on the alphanumeric sort of the workspaces discovered within the repo
  • Checkout the lockfile - then determine which version is currently installed, and use that
  • Interactive select within the Terminal, allowing the developer to pick the right version of the package

Ideally - I'd lean towards the interactive flow, something like:

Workspace `site` declares dependency `react` at `17.0.1`
Workspace(s) `docs`, `pkg-a` declare `react` at `18.3.1`

What version should be used everywhere? (arrow through the options, select via space)
o 17.0.1
o 18.3.1
o <Enter custom version>

Pin Version Strategy

Pinned versions is a bit easier, I think we'd:

  • Check via the package manager what version of the dependency is currently resolved
  • Use the version that the package manager gives us back as the true version to lock in
@hamlim hamlim added the enhancement New feature or request label May 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant