elm-lang / elm-package

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

Github username is repository string restricted to 13 characters #295

Closed marceloomens closed 6 years ago

marceloomens commented 6 years ago

There some discussion on other issues about restrictions on the repository field in elm-package.json. It's not ideal that this field is restricted to Github repos, but that's workable for now. The restriction on lower case letters is also workable, as Github usernames and repos and non-case sensitive.

I have a problem with the restriction on the length of Github username though. Usernames of 13 or less work fine, for example:

"repository": "https://github.com/freepressunlt/elm-rivescript.git"

But when I change this to a (correct) username of more than 13 characters, the generated javascript throws an error. For example:

"repository": "https://github.com/freepressunlimited/elm-rivescript.git"

The error that is thrown at runtime, is the following:

TypeError: Elm.Example.embed is not a function

Are there any workarounds? Are there any fixes in sight? While all lower case usernames are acceptable in a Github URL, even if the orginal username contains upper case characters, truncated usernames are not accepted by Github 😞

I'm using Firefox 58.0.2 on Mac OS 10.13.3 with Elm 0.18.

process-bot commented 6 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.

evancz commented 6 years ago

Thanks for the report!

I looked for authors on http://package.elm-lang.org/ with names longer than 13 chars and found a few:

So I am not convinced the name length is the underlying cause. Do you mind digging around more in the compiled code to see why embed is not defined? Sometimes the root issue can get masked in how the error is output by JS if it is a code generation issue. If you find anything, please open an issue at https://github.com/elm-lang/elm-compiler/issues outlining it!

Thank you for looking into this!

evancz commented 6 years ago

Oh, it may just be that you gotta delete elm-stuff/ after you change the repo name! I can imagine the compiler could get confused if names changed and it had some old compiled artifacts around!