on master help sign in
add messages for new bump errors / make related messages nicer
6797260Evan Czaplicki
builder/src/Reporting/Exit.hs+25−3
@@ -137,7 +137,7 @@ data Diff
137 = DiffNoOutline
137 = DiffNoOutline
138 | DiffBadOutline Outline
138 | DiffBadOutline Outline
139 | DiffApplication
139 | DiffApplication
140− | DiffNoExposed Pkg.Name
140+ | DiffNoExposed
141 | DiffUnpublished
141 | DiffUnpublished
142 | DiffUnknownPackage Pkg.Name [Pkg.Name]
142 | DiffUnknownPackage Pkg.Name [Pkg.Name]
143 | DiffUnknownVersion Pkg.Name V.Version [V.Version]
143 | DiffUnknownVersion Pkg.Name V.Version [V.Version]
@@ -170,7 +170,7 @@ diffToReport diff =
170 , D.indent 4 $ D.dullyellow $ "elm diff elm/http 1.0.0 2.0.0"
170 , D.indent 4 $ D.dullyellow $ "elm diff elm/http 1.0.0 2.0.0"
171 ]
171 ]
172
172
173− DiffNoExposed _ ->
173+ DiffNoExposed ->
174 Help.report "NO EXPOSED MODULES" (Just "elm.json")
174 Help.report "NO EXPOSED MODULES" (Just "elm.json")
175 "Your elm.json has no \"exposed-modules\" which means there is no public API at\
175 "Your elm.json has no \"exposed-modules\" which means there is no public API at\
176 \ all right now! What am I supposed to diff?"
176 \ all right now! What am I supposed to diff?"
@@ -237,6 +237,9 @@ data Bump
237 | BumpUnexpectedVersion V.Version [V.Version]
237 | BumpUnexpectedVersion V.Version [V.Version]
238 | BumpMustHaveLatestRegistry RegistryProblem
238 | BumpMustHaveLatestRegistry RegistryProblem
239 | BumpCannotFindDocs Pkg.Name V.Version DocsProblem
239 | BumpCannotFindDocs Pkg.Name V.Version DocsProblem
240+ | BumpBadDetails Details
241+ | BumpNoExposed
242+ | BumpBadBuild BuildProblem
240
243
241
244
242bumpToReport :: Bump -> Help.Report
245bumpToReport :: Bump -> Help.Report
@@ -284,6 +287,24 @@ bumpToReport bump =
284 toDocsProblemReport problem $
287 toDocsProblemReport problem $
285 "I need the docs for " ++ V.toChars version ++ " to compute the next version number"
288 "I need the docs for " ++ V.toChars version ++ " to compute the next version number"
286
289
290+ BumpBadDetails details ->
291+ toDetailsReport details
292+
293+ BumpNoExposed ->
294+ Help.docReport "NO EXPOSED MODULES" (Just "elm.json")
295+ ( D.fillSep $
296+ [ "To", "bump", "a", "package,", "the"
297+ , D.dullyellow "\"exposed-modules\"", "field", "of", "your"
298+ , "elm.json", "must", "list", "at", "least", "one", "module."
299+ ]
300+ )
301+ [ D.reflow $
302+ "Try adding some modules back to the \"exposed-modules\" field."
303+ ]
304+
305+ BumpBadBuild problem ->
306+ toBuildProblemReport problem
307+
287
308
288
309
289-- OVERVIEW OF VERSIONING
310-- OVERVIEW OF VERSIONING
@@ -469,7 +490,8 @@ publishToReport publish =
469 ]
490 ]
470 )
491 )
471 [ D.reflow $
492 [ D.reflow $
472− "What is the point of a package that has no modules?!"
493+ "Which modules do you want users of the package to have access to? Add their\
494+ \ names to the \"exposed-modules\" list."
473 ]
495 ]
474
496
475 PublishNoReadme ->
497 PublishNoReadme ->