@@ -8,6 +8,10 @@ module Reporting.Exit
9 , diffToReport
9 , diffToReport
11 , Install(..)
15 , Install(..)
12 , installToReport
16 , installToReport
@@ -60,13 +64,8 @@ import qualified Reporting.Error as Error
65− | BumpUnexpectedVersion V.Version [V.Version]
66− | BumpMustHaveLatestRegistry RegistryProblem
67− | BumpCannotFindDocs Pkg.Name V.Version DocsProblem
68 -- publish
67 -- publish
69− | PublishMustHaveLatestRegistry RegistryProblem
68+ = PublishMustHaveLatestRegistry RegistryProblem
70 | PublishApplication
69 | PublishApplication
71 | PublishNotInitialVersion V.Version
70 | PublishNotInitialVersion V.Version
72 | PublishAlreadyPublished V.Version
71 | PublishAlreadyPublished V.Version
@@ -218,6 +217,75 @@ diffToReport diff =
225+ | BumpBadOutline Outline
227+ | BumpUnexpectedVersion V.Version [V.Version]
228+ | BumpMustHaveLatestRegistry RegistryProblem
229+ | BumpCannotFindDocs Pkg.Name V.Version DocsProblem
232+bumpToReport :: Bump -> Help.Report
236+ Help.report "CANNOT BUMP APPLICATIONS" (Just "elm.json")
237+ "Your elm.json says this is an application. That means it cannot be published\
238+ \ on <https://package.elm-lang.org> and therefore has no version to bump!"
241+ BumpUnexpectedVersion vsn versions ->
242+ Help.docReport "CANNOT BUMP" (Just "elm.json")
244+ ["Your","elm.json","says","I","should","bump","relative","to","version"
245+ ,D.red (D.fromVersion vsn) <> ","
246+ ,"but","I","cannot","find","that","version","on","<https://package.elm-lang.org>."
247+ ,"That","means","there","is","no","API","for","me","to","diff","against","and"
248+ ,"figure","out","if","these","are","MAJOR,","MINOR,","or","PATCH","changes."
252+ ["Try","bumping","again","after","changing","the",D.dullyellow "\"version\"","in","elm.json"]
253+ ++ if length versions == 1 then ["to:"] else ["to","one","of","these:"]
254+ , D.vcat $ map (D.green . D.fromVersion) versions
257+ BumpMustHaveLatestRegistry problem ->
258+ error "TODO BumpMustHaveLatestRegistry" problem
260+ BumpCannotFindDocs name version problem ->
261+ error "TODO BumpCannotFindDocs" name version problem
265+-- OVERVIEW OF VERSIONING
268+newPackageOverview :: String
271+ [ "This package has never been published before. Here's how things work:"
273+ , " - Versions all have exactly three parts: MAJOR.MINOR.PATCH"
275+ , " - All packages start with initial version " ++ V.toChars V.one
277+ , " - Versions are incremented based on how the API changes:"
279+ , " PATCH = the API is the same, no risk of breaking code"
280+ , " MINOR = values have been added, existing values are unchanged"
281+ , " MAJOR = existing values have been changed or removed"
283+ , " - I will bump versions for you, automatically enforcing these rules"
221-- INSTALL
289-- INSTALL
@@ -429,36 +497,6 @@ _toReport :: Exit -> Help.Report
429_toReport exit =
497_toReport exit =
430 case exit of
498 case exit of
435− Help.report "CANNOT BUMP APPLICATIONS" (Just "elm.json")
436− "Your elm.json says this is an application. That means it cannot be published\
437− \ on <https://package.elm-lang.org> and therefore has no version to bump!"
440− BumpUnexpectedVersion vsn versions ->
441− Help.docReport "CANNOT BUMP" (Just "elm.json")
443− ["Your","elm.json","says","I","should","bump","relative","to","version"
444− ,D.red (D.fromVersion vsn) <> ","
445− ,"but","I","cannot","find","that","version","on","<https://package.elm-lang.org>."
446− ,"That","means","there","is","no","API","for","me","to","diff","against","and"
447− ,"figure","out","if","these","are","MAJOR,","MINOR,","or","PATCH","changes."
451− ["Try","bumping","again","after","changing","the",D.dullyellow "\"version\"","in","elm.json"]
452− ++ if length versions == 1 then ["to:"] else ["to","one","of","these:"]
453− , D.vcat $ map (D.green . D.fromVersion) versions
456− BumpMustHaveLatestRegistry problem ->
457− error "TODO BumpMustHaveLatestRegistry" problem
459− BumpCannotFindDocs name version problem ->
460− error "TODO BumpCannotFindDocs" name version problem
462 -- publish
500 -- publish
464 PublishMustHaveLatestRegistry problem ->
502 PublishMustHaveLatestRegistry problem ->