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

Proposal: Allow installing the latest package of a major version #2250

Open
jfmengels opened this issue Apr 1, 2022 · 1 comment
Open

Proposal: Allow installing the latest package of a major version #2250

jfmengels opened this issue Apr 1, 2022 · 1 comment

Comments

@jfmengels
Copy link
Contributor

Quick Summary: I want a way to install a package knowing only its major version like elm install author/package@2.

This is a proposal that is an addition to the proposals to install specific versions of a package (that I'm sure exists somewhere).

This is a feature request for when the package installer becomes the next focus. I imagine that when that is released elm-json would become obsolete and that elm becomes the only tool that users will have to use. This proposal aims to indicate some use-cases that elm-json currently fills for tooling purposes, so that they also be included and that batch of work.

Use-case

While this could potentially be useful for Elm developers when they want to use the latest version of an outdated major version of a package, this would mostly be for tooling.

This behavior currently exists in elm-json, and elm-review depends on it. I'll explain the process for the latter.

elm-review takes the user's configuration, which is an Elm application with configuration as Elm code, and a list of elm-review packages as dependencies (and maybe other Elm packages if they wrote custom rules).

It then

  • creates a temporary application folder
  • copies the elm.json
  • changes the source-directories from the original elm.json to point to the correct location
  • adds the source-directory for the elm-review that contains the main application logic to the source-directories
  • Changes the dependencies to include the ones that the main application logic requires

The last step is done using elm-json install stil4m/elm-syntax@7 <and a couple more...>.

The dependencies are added so that users don't have to do so themselves and get a hard to understand error when they forget to do so.

The reason for indicating the major version is that if one of these packages releases a new major version incompatible with the previous major version, we don't force the latest major version and cause all current elm-review configuration to become un-compilable and un-runnable.

In practice, elm-review doesn't run elm-json install stil4m/elm-syntax@7 ... (at least for this), but instead elm-json solve stil4m/elm-syntax@7 ... <path-to-original-elm.json> which allows getting (and caching) the list of dependencies so that we don't have to write the elm.json file and then run elm-json install ... in a second step.

elm-review still uses install with the major version constraint when initializing a new configuration. To avoid asking the user to confirm the install prompt, elm-json install supports a --yes flag.

Summary of requests

  • Support a way to constrain a package to a major version
  • Add a --yes option to the install command (or similar)
  • (Potentially?) Support a way to compute dependencies without installing them directly like elm-json solve.
@github-actions
Copy link

github-actions bot commented Apr 1, 2022

Thanks for reporting this! To set expectations:

  • Issues are reviewed in batches, so it can take some time to get a response.
  • Ask questions in a community forum. You will get an answer quicker that way!
  • If you experience something similar, open a new issue. We like duplicates.

Finally, please be patient with the core team. They are trying their best with limited resources.

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

No branches or pull requests

1 participant