package.elm-lang.org icon indicating copy to clipboard operation
package.elm-lang.org copied to clipboard

Single endpoint for all packages with dependency constraints

Open rundis opened this issue 9 years ago • 2 comments

I'm currently using http://package.elm-lang.org/all-packages to provide a package manager ui for the elm Light Table plugin.

However I believe I could make it a lot more powerful if the all-packages json output could be extended (or alternatively as a separate url). It would be awesome if the versions field for each package could be extended to be a list of maps. Each map entry containing vital information from the versions elm-package.json

Something like

"versions": [
  {"version": "1.0.0",
   "elm-version": ""0.16.0 <= v < 0.17.0",
   "dependencies": [
      {"name": "rundis/awesome", "version": "3.0.0 <= v < 4.0.0"},
      {"name": "rundis/awesome-extended", "version": "3.0.0 <= v < 4.0.0"}
   ]
]

With something like this I can do cool stuff like:

  • filter out packages that are not applicable for the given elm-version of the users project
  • Display a simplified dependency graph (perhaps, the ranges complicates things)
  • Display potential problems due to elm-version conflicts when the user has manually entered something that doesn't make sense in his/her elm-package.json file)
  • etc

I did some quick trials on trying to implement a cache that retrieves the all-packages.json file and then retrieve each individual elm-package.json file. But quickly concluded that it's way to slow even on my 100mb/s connection to be usable.

rundis avatar Nov 28 '15 14:11 rundis

This would also greatly help to use packages in Nix (as we already have Haskell).

domenkozar avatar May 13 '16 15:05 domenkozar

@rundis the way haskell solves this is to store all cabal files in a git repository. That way you can always have all infromation at one place: https://github.com/commercialhaskell/all-cabal-hashes/tree/hackage

So you'd only have to copy it once for a new package release.

domenkozar avatar May 13 '16 15:05 domenkozar