@@ -66,6 +66,65 @@ fromString string =
66 Left "There should be a slash separating the user and project name (user/project)"
66 Left "There should be a slash separating the user and project name (user/project)"
69+whitelistedUppercaseName :: String -> Bool
70+whitelistedUppercaseName name =
71+ -- These packages were uploaded to package.elm-lang.org before version 0.16,
72+ -- when uppercase letters were disallowed in package names.
73+ -- They should be considered deprecated and removed from this list once users
74+ -- migrate to using the lowercase versions of the names.
76+ [ "Apanatshka/elm-list-ndet"
77+ , "Apanatshka/elm-signal-extra"
78+ , "Bogdanp/elm-combine"
81+ , "JoeyEremondi/LoadAssets"
82+ , "JoeyEremondi/elm-MultiDimArray"
83+ , "JoeyEremondi/elm-SafeLists"
84+ , "JoeyEremondi/elm-typenats"
85+ , "JustusAdam/elm-path"
86+ , "NoRedInk/elm-check"
87+ , "NoRedInk/elm-lazy-list"
88+ , "NoRedInk/elm-rails"
89+ , "NoRedInk/elm-random-extra"
90+ , "NoRedInk/elm-shrink"
91+ , "NoRedInk/elm-string-extra"
92+ , "NoRedInk/elm-task-extra"
93+ , "TheSeamau5/GraphicsEngine"
94+ , "TheSeamau5/elm-check"
95+ , "TheSeamau5/elm-history"
96+ , "TheSeamau5/elm-html-decoder"
97+ , "TheSeamau5/elm-lazy-list"
98+ , "TheSeamau5/elm-material-icons"
99+ , "TheSeamau5/elm-quadtree"
100+ , "TheSeamau5/elm-random-extra"
101+ , "TheSeamau5/elm-rosetree"
102+ , "TheSeamau5/elm-router"
103+ , "TheSeamau5/elm-shrink"
104+ , "TheSeamau5/elm-spring"
105+ , "TheSeamau5/elm-task-extra"
106+ , "TheSeamau5/elm-undo-redo"
107+ , "TheSeamau5/flex-html"
108+ , "TheSeamau5/selection-list"
109+ , "TheSeamau5/typographic-scale"
110+ , "ThomasWeiser/elmfire"
111+ , "ThomasWeiser/elmfire-extra"
112+ , "adam-r-kowalski/Elm-Css"
113+ , "deadfoxygrandpa/Elm-Test"
114+ , "heyLu/elm-format-date"
115+ , "jterbraak/DateOp"
117+ , "mgold/Elm-Align-Distribute"
118+ , "mgold/Elm-Format-String"
119+ , "mgold/Elm-Multiset"
120+ , "mgold/Elm-Random-Sampling"
122+ , "thSoft/ExternalStorage"
126+ List.any (\x -> x == name) whitelist
69validate :: String -> Either String String
128validate :: String -> Either String String
70validate str =
129validate str =
71 if elem ('-','-') (zip str (tail str)) then
130 if elem ('-','-') (zip str (tail str)) then
@@ -74,6 +133,9 @@ validate str =
74 else if elem '_' str then
133 else if elem '_' str then
75 Left "Underscores are not allowed in package names."
134 Left "Underscores are not allowed in package names."
136+ else if any Char.isUpper str && not (whitelistedUppercaseName str) then
137+ Left "Upper case characters are not allowed in package names."
77 else if not (Char.isLetter (head str)) then
139 else if not (Char.isLetter (head str)) then
78 Left "Package names must start with a letter."
140 Left "Package names must start with a letter."