elm / package.elm-lang.org

website for browsing packages and exploring documentation
https://package.elm-lang.org/
BSD 3-Clause "New" or "Revised" License
293 stars 114 forks source link

Single endpoint for all packages with dependency constraints #137

Open rundis opened 8 years ago

rundis commented 8 years ago

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:

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.

domenkozar commented 8 years ago

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

domenkozar commented 8 years ago

@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.