elm-lang / elm-package

Command line tool to share Elm libraries
BSD 3-Clause "New" or "Revised" License
214 stars 66 forks source link

Repository name with dots in elm-package.json causes runtime exception in generated js #262

Closed rundis closed 7 years ago

rundis commented 7 years ago

Context:

Github allows dots in repository names so something like product.dufus is valid. However if you specify https://github.com/user/project.dufus.git in the repository field of elm-package.json you will get a runtime error from the generated js.

Steps to reproduce

mkdir project.dufus && cd project.dufus && elm-package install --yes && sed -ie s/project.git/project.dufus.git/g elm-package.json && echo import Html\\nmain=Html.text \"Hello world\" > Main.elm && elm-make Main.elm && open index.html

Workarounds

Don't use dot's in repository names in elm-package.json

Discussion

For packages it's probably not a great idea to have dots in the name, but for end-user projects I don't see why this shouldn't be supported. If the decision is not support, an error message at an earlier stage would be nice.

process-bot commented 7 years ago

Thanks for the issue! Make sure it satisfies this checklist. My human colleagues will appreciate it!

Here is what to expect next, and if anyone wants to comment, keep these things in mind.

jvoigtlaender commented 7 years ago

Isn't this just a duplicate of https://github.com/elm-lang/elm-make/issues/106 ?

evancz commented 7 years ago

This is disallowed in the upcoming version of things.

https://github.com/elm-lang/elm-compiler/blob/dev/src/Elm/Package.hs#L128-L129