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

Allow pinning projects to specific versions #60

Open
jmatth opened this issue Nov 21, 2023 · 4 comments
Open

Allow pinning projects to specific versions #60

jmatth opened this issue Nov 21, 2023 · 4 comments
Labels
enhancement New feature or request

Comments

@jmatth
Copy link

jmatth commented Nov 21, 2023

A major feature we use in FVM that is currently missing from Puro is the ability to commit a file to a repo that pins the projects environment to a specific version. This use case was mentioned in #35, but the current implementation doesn't fully address it. When testing Puro I observed that if an environment was specified in .puro.json that did not exist, then Puro would change the contents of .puro.json to match the current global default:

$ puro ls
[i] Environments:
    ~ stable (stable / 3.16.0 / db7ef5bf9f)
      beta   (not installed)
      master (not installed)
    
    Use `puro create <name>` to create an environment, or `puro use <name>` to switch
$ cat .puro.json
{
  "env": "3.13.9"
}
$ puro use
[✓] Switched to environment `stable`
$ cat .puro.json
{
  "env": "stable"
}

This doesn't really help with the use case of pinning a version for a project, where:

  • New contributors need an easy way to set up their environment w/ the correct version
  • Existing contributors should have their environment easily switch versions as they navigate the repo history
  • CI/CD builds always start with an empty environment and need to initialize with the pinned version

FVM handles this by automatically installing the version specified in its config file if it is missing as part of fvm use. I think it would be great if Puro offered the same functionality. Failing that, it should at least error out with a message to install the missing environment rather than quietly changing it to whatever the global default happens to be.

@pingbird pingbird added the enhancement New feature or request label Nov 21, 2023
@pingbird
Copy link
Owner

That is definitely something I overlooked when implementing the logic for puro use, thanks!

It should automatically install the desired flutter version when running the puro flutter command, but ideally it also keeps your IDE config in sync with what's specified in .puro.json

@neiljaywarner
Copy link

@pingbird what would be really cool is if it could just detect from pubspec.yaml if pubspec.yaml has a flutter: 3.19.6 or whatever instead of a range.
i have always found it sad that the max range is not respected anyway.

@neiljaywarner
Copy link

This is actually the biggest problem I'm looking to solve with a version manager.

@passsy
Copy link

passsy commented Apr 26, 2024

@pingbird What's the status here. Would you like to have external contriutions for this?

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

4 participants