setup-purescript
setup-purescript copied to clipboard
Don't use the versions file for tools installed via NPM
The versions file exists to avoid rate limits imposed by GitHub when getting the latest release for various tools via the GitHub API. However, if a user specifies they want the latest tool and the tool is installed via NPM, then we should skip the versions file and just NPM install the latest -- we don't get rate limited on that.
This function decides whether to fetch an exact version of a tool (because the user specified an exact version) or to look up the latest version in the versions file:
https://github.com/purescript-contrib/setup-purescript/blob/915bfb653aecc5e87c39601c4c7f10e7372578fd/src/Setup/BuildPlan.purs#L54-L80
However, if the InstallMethod for a tool is NPM:
https://github.com/purescript-contrib/setup-purescript/blob/915bfb653aecc5e87c39601c4c7f10e7372578fd/src/Setup/Data/Tool.purs#L78-L80
...then we should skip the versions file altogether and just NPM install the tool at its latest version according to NPM:
https://github.com/purescript-contrib/setup-purescript/blob/915bfb653aecc5e87c39601c4c7f10e7372578fd/src/Setup/Data/Tool.purs#L94-L148
Currently that only covers psa and purs-tidy.
Does something like this (https://github.com/purescript-contrib/setup-purescript/pull/24) make sense as a possible fix?