Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.
Sign upRepository names with `.` generate invalid JS #1406
Comments
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jun 6, 2016
Member
That would be ambiguous though. tom/this.that would be the same as tom/this-that. Is there a better way to avoid this?
|
That would be ambiguous though. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zsiciarz
Jul 11, 2016
Ran into a similar problem in my project (https://github.com/zsiciarz/variablestars.net/tree/elm-0.17). The generated JS file contains names like these:
_zsiciarz$variablestars.net$Astronomy$dateToJd
_zsiciarz$variablestars.net$Astronomy$jdToTime
and so on. The actual console error is SyntaxError: missing ; before statement pointing to the first occurence of a variable name like above.
Here's my elm-package.json. Not sure how to fix this though, perhaps there could be a way to set some sort of alias for the project, so that generated identifiers use that instead of the name of the repo?
zsiciarz
commented
Jul 11, 2016
|
Ran into a similar problem in my project (https://github.com/zsiciarz/variablestars.net/tree/elm-0.17). The generated JS file contains names like these:
and so on. The actual console error is Here's my elm-package.json. Not sure how to fix this though, perhaps there could be a way to set some sort of alias for the project, so that generated identifiers use that instead of the name of the repo? |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
|
Tracking in #1377, thanks for the report! |
evancz
closed this
Jul 15, 2016
added a commit
to zsiciarz/variablestars.net
that referenced
this issue
Jan 2, 2017
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
evancz
Jul 14, 2017
Member
In 0.19 it will not be possible to give packages names like this, thereby avoiding the code gen issues and making package names more uniform across the ecosystem.
|
In 0.19 it will not be possible to give packages names like this, thereby avoiding the code gen issues and making package names more uniform across the ecosystem. |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mfeineis
Nov 25, 2017
I ran into an issue with the no dots in project names approach: I'm currently building a myname.github.io page and this repo has to have the dots in the name for github to use that repo when you're using the simplest approach. See githubs docs on configuring a publishing source on that. Just wanted that to sit in a place other than Slack :-). Thanks for the good work, it's making my life so much more fun.
mfeineis
commented
Nov 25, 2017
|
I ran into an issue with the |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
zwilias
Nov 25, 2017
Member
@mfeineis It's recommended to leave the repository set to the default http://github.com/user/project.git for applications. There is no value to changing it, other than possibly breaking the compiled result
There is a bunch of metadata in elm-package.json that only makes sense to change for packages published to the package repository (like version, repo, description, license). If I'm not mistaken, these fields will no longer longer be available in the application descriptor file in Elm 0.19; to prevent this type of confusion.
|
@mfeineis It's recommended to leave the repository set to the default There is a bunch of metadata in |
This comment has been minimized.
Show comment
Hide comment
This comment has been minimized.
mfeineis
Nov 25, 2017
@zwilias Thank your for the clarification, that's exactly what I did :-). As you guessed the result won't be published on package.elm-lang.org but is for my blog that is currently in migration-to-elm-static-html-lib mode.
mfeineis
commented
Nov 25, 2017
|
@zwilias Thank your for the clarification, that's exactly what I did :-). As you guessed the result won't be published on |
neoeinstein commentedJun 3, 2016
Given an
elm-package.jsonfile like the following:{ "version": "1.0.0", "summary": "Error reproduction Elm 0.17", "repository": "https://github.com/example/error.repro.git", "license": "BSD3", "source-directories": [ "src" ], "exposed-modules": [], "dependencies": { "elm-lang/core": "4.0.0 <= v < 5.0.0", "elm-lang/html": "1.0.0 <= v < 2.0.0" }, "elm-version": "0.17.0 <= v < 0.18.0" }Elm generates invalid JavaScript:


In the event of a
.in a repository name, Elm should convert it to an underscore as it does in other cases of-in a repository name.