@@ -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