on master help sign in
Stop making elm.json files behind the scenes

I really do not like any of the designs that came out of variations on 0.18 of creating an elm.json for you (with and without asking)

commit8873a7371a80d77e1750889a6bb2eee101817141 authorEvan Czaplicki <evancz@users.noreply.github.com> dateMon 21 May 2018, 15:57 (8 years ago) parent787034e
3 files changed+1−51
builder/src/Elm/Project/Root.hs−34 builder/src/Reporting/Progress.hs+1−4 builder/src/Reporting/Progress/Terminal.hs−13
builder/src/Elm/Project/Root.hs−34
@@ -59,43 +59,9 @@ moveToRoot =
5959 do liftIO $ Dir.setCurrentDirectory root
6060 return root
6161
62− Nothing ->
63− do addElmJson
64− Task.report Progress.ElmJsonAdded
65− liftIO $ Dir.getCurrentDirectory
66−
67−
68−addElmJson :: Task.Task ()
69−addElmJson =
70− do registry <- Cache.optionalUpdate
71− maybeSolution <- Explorer.run registry $ Solver.run $
72− msum $ map Solver.solve $
73− [ defaultDependencies
74− , Map.singleton Pkg.core Con.anything
75− ]
76− case maybeSolution of
7762 Nothing ->
7863 Task.throw Exit.NoElmJson
7964
80− Just solution ->
81− liftIO $ Encode.write "elm.json" $ Project.encode $ Project.App $
82− Project.AppInfo
83− Elm.version
84− ["src"]
85− (Map.intersection solution defaultDependencies)
86− Map.empty
87− (Map.difference solution defaultDependencies)
88−
89−
90−defaultDependencies :: Map.Map Pkg.Name Con.Constraint
91−defaultDependencies =
92− Map.fromList
93− [ (Pkg.browser, Con.anything)
94− , (Pkg.core, Con.anything)
95− , (Pkg.html, Con.anything)
96− , (Pkg.json, Con.anything)
97− ]
98−
9965
10066
10167-- GET WITH FALLBACK
builder/src/Reporting/Progress.hs+1−4
@@ -70,11 +70,8 @@ data Msg
7070
7171
7272data Progress
73− -- elm.json
74− = ElmJsonAdded
75−
7673 -- download packages
77− | DownloadSkip
74+ = DownloadSkip
7875 | DownloadStart [(Name, Version)]
7976 | DownloadPkgStart Name Version
8077 | DownloadPkgEnd Name Version Outcome
builder/src/Reporting/Progress/Terminal.hs−13
@@ -90,19 +90,6 @@ loopHelp chan progress state@(State total good bad) =
9090 case progress of
9191
9292
93− -- ELM.JSON
94−
95− ElmJsonAdded ->
96− do Help.toStdout $ D.black $ D.vcat $ map D.fromString $
97− [ "--------------------------------------------------------------------------------"
98− , " Looks like you are starting a new Elm project, so I added an elm.json file."
99− , " Read " ++ D.makeLink "get-started" ++ " for tips on what to do next!"
100− , "--------------------------------------------------------------------------------"
101− ]
102− putStrLn ""
103− loop chan state
104−
105−
10693 -- DOWNLOADS
10794
10895 DownloadSkip ->