gdotdesign / elm-github-install

An alternative decentralized package manager for Elm
MIT License
205 stars 24 forks source link

Package author and name are not case sensitive. #41

Open rupertlssmith opened 7 years ago

rupertlssmith commented 7 years ago

I have the following in an elm-package.json:

    "dependencies": {
        "elm-lang/core": "5.0.0 <= v < 6.0.0",
        "tsfoster/elm-heap": "2.1.0 <= v < 3.0.0"
    },

This installs fine with elm-github-install, as it seems to just use the auther/package name in building a URL to access github.

When I try to install this with elm-pakcage

Error: Your .elm/packages/ directory may be corrupted. I was led to believe that
tsfoster/elm-heap existed, but I could not find anything when I went to look up
the published versions of this package.

The actual package name is 'TSFoster/elm-heap'.

It seems that to elm-make, elm-reactor and elm-publish the case sensitivity of the author and package name is important.

This causes a problem, as I am in the habit of using elm-github-install instead of elm-package install for the extra flexibility it gives me, but if I am not careful this can lead to publishing an elm-package.json that is invalid.

It would be better if elm-github-install enforced the same behaviour as the core elm tools?

gdotdesign commented 7 years ago

Thanks for bringing this up! :+1:

It would be better if elm-github-install enforced the same behaviour as the core elm tools?

In this case yes.

There are two things here:

rupertlssmith commented 7 years ago

I think I might also raise this as an issue against elm-package - as elm-package publish lets you publish an invalid elm-package.json. However, elm-make is capableof detecting that the package name is wrong since it fails like above. It might be helpful to the consistency of the published packages if elm-package publish were to re-scan and check that all the dependencies correctly match up to already published packages, then the mistake would be caught at that time.