Skip to content

Commit 20b33d0

Browse files
committed
Move from elm mentions to guida
1 parent a2213c3 commit 20b33d0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

96 files changed

+3405
-1707
lines changed

src/Browser/Format.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
module Browser.Format exposing (run)
22

33
import Common.Format
4-
import Compiler.Elm.Package as Pkg
4+
import Compiler.Guida.Package as Pkg
55
import Compiler.Parse.Module as M
66
import Compiler.Parse.SyntaxVersion as SV
77

src/Browser/Install.elm

Lines changed: 314 additions & 147 deletions
Large diffs are not rendered by default.

src/Browser/Main.elm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import Browser.Install as Install
55
import Browser.Make as Make
66
import Browser.Uninstall as Uninstall
77
import Builder.Reporting.Exit as Exit
8-
import Compiler.Elm.Package as Pkg
8+
import Compiler.Guida.Package as Pkg
99
import Compiler.Json.Encode as E
1010
import Compiler.Parse.Primitives as P
1111
import Json.Decode as Decode

src/Browser/Make.elm

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,14 @@ module Browser.Make exposing
1313

1414
import Builder.BackgroundWriter as BW
1515
import Builder.Build as Build
16-
import Builder.Elm.Details as Details
16+
import Builder.Guida.Details as Details
1717
import Builder.Generate as Generate
1818
import Builder.Reporting as Reporting
1919
import Builder.Reporting.Exit as Exit
2020
import Builder.Stuff as Stuff
2121
import Compiler.AST.Optimized as Opt
2222
import Compiler.Data.NonEmptyList as NE
23-
import Compiler.Elm.ModuleName as ModuleName
23+
import Compiler.Guida.ModuleName as ModuleName
2424
import Compiler.Generate.Html as Html
2525
import Maybe.Extra as Maybe
2626
import Task exposing (Task)
@@ -66,11 +66,11 @@ run path flags =
6666
)
6767

6868

69-
runHelp : String -> String -> Flags -> Task Never (Result Exit.Make String)
69+
runHelp : Stuff.Root -> String -> Flags -> Task Never (Result Exit.Make String)
7070
runHelp root path (Flags debug optimize withSourceMaps) =
7171
BW.withScope
7272
(\scope ->
73-
Stuff.withRootLock root <|
73+
Stuff.withRootLock (Stuff.rootPath root) <|
7474
Task.run <|
7575
(getMode debug optimize
7676
|> Task.bind
@@ -128,10 +128,10 @@ getMode debug optimize =
128128
-- BUILD PROJECTS
129129

130130

131-
buildPaths : Reporting.Style -> FilePath -> Details.Details -> NE.Nonempty FilePath -> Task Exit.Make Build.Artifacts
131+
buildPaths : Reporting.Style -> Stuff.Root -> Details.Details -> NE.Nonempty FilePath -> Task Exit.Make Build.Artifacts
132132
buildPaths style root details paths =
133133
Task.eio Exit.MakeCannotBuild <|
134-
Build.fromPaths style root details paths
134+
Build.fromPaths style (Stuff.rootPath root) details paths
135135

136136

137137

@@ -178,7 +178,7 @@ type DesiredMode
178178
| Prod
179179

180180

181-
toBuilder : Bool -> Int -> FilePath -> Details.Details -> DesiredMode -> Build.Artifacts -> Task Exit.Make String
181+
toBuilder : Bool -> Int -> Stuff.Root -> Details.Details -> DesiredMode -> Build.Artifacts -> Task Exit.Make String
182182
toBuilder withSourceMaps leadingLines root details desiredMode artifacts =
183183
Task.mapError Exit.MakeBadGenerate <|
184184
case desiredMode of
@@ -221,7 +221,7 @@ output =
221221
{ singular = "output file"
222222
, plural = "output files"
223223
, suggest = \_ -> Task.pure []
224-
, examples = \_ -> Task.pure [ "elm.js", "index.html", "/dev/null" ]
224+
, examples = \_ -> Task.pure [ "guida.js", "index.html", "/dev/null" ]
225225
}
226226

227227

src/Browser/Uninstall.elm

Lines changed: 95 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,17 @@ module Browser.Uninstall exposing (run)
22

33
import Builder.BackgroundWriter as BW
44
import Builder.Deps.Solver as Solver
5-
import Builder.Elm.Details as Details
6-
import Builder.Elm.Outline as Outline
5+
import Builder.Guida.Details as Details
6+
import Builder.Guida.Outline as Outline
77
import Builder.Reporting as Reporting
88
import Builder.Reporting.Exit as Exit
99
import Builder.Stuff as Stuff
10-
import Compiler.Elm.Constraint as C
11-
import Compiler.Elm.Package as Pkg
12-
import Compiler.Elm.Version as V
10+
import Compiler.Guida.Constraint as C
11+
import Compiler.Guida.Package as Pkg
12+
import Compiler.Guida.Version as V
1313
import Data.Map as Dict exposing (Dict)
1414
import System.IO as IO
1515
import Task exposing (Task)
16-
import Utils.Main exposing (FilePath)
1716
import Utils.Task.Extra as Task
1817

1918

@@ -63,7 +62,7 @@ type Changes vsn
6362
| Changes Outline.Outline
6463

6564

66-
attemptChanges : String -> Solver.Env -> Outline.Outline -> Changes a -> Task Exit.Uninstall ()
65+
attemptChanges : Stuff.Root -> Solver.Env -> Outline.Outline -> Changes a -> Task Exit.Uninstall ()
6766
attemptChanges root env oldOutline changes =
6867
case changes of
6968
AlreadyNotPresent ->
@@ -73,7 +72,7 @@ attemptChanges root env oldOutline changes =
7372
attemptChangesHelp root env oldOutline newOutline
7473

7574

76-
attemptChangesHelp : FilePath -> Solver.Env -> Outline.Outline -> Outline.Outline -> Task Exit.Uninstall ()
75+
attemptChangesHelp : Stuff.Root -> Solver.Env -> Outline.Outline -> Outline.Outline -> Task Exit.Uninstall ()
7776
attemptChangesHelp root env oldOutline newOutline =
7877
Task.eio Exit.UninstallBadDetails <|
7978
BW.withScope
@@ -99,53 +98,102 @@ attemptChangesHelp root env oldOutline newOutline =
9998

10099

101100
makeAppPlan : Solver.Env -> Pkg.Name -> Outline.AppOutline -> Task Exit.Uninstall (Changes V.Version)
102-
makeAppPlan (Solver.Env cache _ connection registry) pkg ((Outline.AppOutline _ _ direct _ testDirect _) as outline) =
103-
case Dict.get identity pkg (Dict.union direct testDirect) of
104-
Just _ ->
105-
Task.io (Solver.removeFromApp cache connection registry pkg outline)
106-
|> Task.bind
107-
(\result ->
108-
case result of
109-
Solver.SolverOk (Solver.AppSolution _ _ app) ->
110-
Task.pure (Changes (Outline.App app))
101+
makeAppPlan (Solver.Env cache _ connection registry) pkg outline =
102+
case outline of
103+
Outline.GuidaAppOutline _ _ direct _ testDirect _ ->
104+
case Dict.get identity pkg (Dict.union direct testDirect) of
105+
Just _ ->
106+
Task.io (Solver.removeFromApp cache connection registry pkg outline)
107+
|> Task.bind
108+
(\result ->
109+
case result of
110+
Solver.SolverOk (Solver.AppSolution _ _ app) ->
111+
Task.pure (Changes (Outline.App app))
111112

112-
Solver.NoSolution ->
113-
Task.throw (Exit.UninstallNoOnlineAppSolution pkg)
113+
Solver.NoSolution ->
114+
Task.throw (Exit.UninstallNoOnlineAppSolution pkg)
114115

115-
Solver.NoOfflineSolution ->
116-
Task.throw (Exit.UninstallNoOfflineAppSolution pkg)
116+
Solver.NoOfflineSolution ->
117+
Task.throw (Exit.UninstallNoOfflineAppSolution pkg)
117118

118-
Solver.SolverErr exit ->
119-
Task.throw (Exit.UninstallHadSolverTrouble exit)
120-
)
119+
Solver.SolverErr exit ->
120+
Task.throw (Exit.UninstallHadSolverTrouble exit)
121+
)
121122

122-
Nothing ->
123-
Task.pure AlreadyNotPresent
123+
Nothing ->
124+
Task.pure AlreadyNotPresent
125+
126+
Outline.ElmAppOutline _ _ direct _ testDirect _ ->
127+
case Dict.get identity pkg (Dict.union direct testDirect) of
128+
Just _ ->
129+
Task.io (Solver.removeFromApp cache connection registry pkg outline)
130+
|> Task.bind
131+
(\result ->
132+
case result of
133+
Solver.SolverOk (Solver.AppSolution _ _ app) ->
134+
Task.pure (Changes (Outline.App app))
135+
136+
Solver.NoSolution ->
137+
Task.throw (Exit.UninstallNoOnlineAppSolution pkg)
138+
139+
Solver.NoOfflineSolution ->
140+
Task.throw (Exit.UninstallNoOfflineAppSolution pkg)
141+
142+
Solver.SolverErr exit ->
143+
Task.throw (Exit.UninstallHadSolverTrouble exit)
144+
)
145+
146+
Nothing ->
147+
Task.pure AlreadyNotPresent
124148

125149

126150

127151
-- MAKE PACKAGE PLAN
128152

129153

130154
makePkgPlan : Pkg.Name -> Outline.PkgOutline -> Task Exit.Uninstall (Changes C.Constraint)
131-
makePkgPlan pkg (Outline.PkgOutline name summary license version exposed deps test elmVersion) =
132-
let
133-
old : Dict ( String, String ) Pkg.Name C.Constraint
134-
old =
135-
Dict.union deps test
136-
in
137-
if Dict.member identity pkg old then
138-
Task.pure <|
139-
Changes <|
140-
Outline.Pkg <|
141-
Outline.PkgOutline name
142-
summary
143-
license
144-
version
145-
exposed
146-
(Dict.remove identity pkg deps)
147-
(Dict.remove identity pkg test)
148-
elmVersion
149-
150-
else
151-
Task.pure AlreadyNotPresent
155+
makePkgPlan pkg outline =
156+
case outline of
157+
Outline.GuidaPkgOutline name summary license version exposed deps test elmVersion ->
158+
let
159+
old : Dict ( String, String ) Pkg.Name C.Constraint
160+
old =
161+
Dict.union deps test
162+
in
163+
if Dict.member identity pkg old then
164+
Task.pure <|
165+
Changes <|
166+
Outline.Pkg <|
167+
Outline.GuidaPkgOutline name
168+
summary
169+
license
170+
version
171+
exposed
172+
(Dict.remove identity pkg deps)
173+
(Dict.remove identity pkg test)
174+
elmVersion
175+
176+
else
177+
Task.pure AlreadyNotPresent
178+
179+
Outline.ElmPkgOutline name summary license version exposed deps test elmVersion ->
180+
let
181+
old : Dict ( String, String ) Pkg.Name C.Constraint
182+
old =
183+
Dict.union deps test
184+
in
185+
if Dict.member identity pkg old then
186+
Task.pure <|
187+
Changes <|
188+
Outline.Pkg <|
189+
Outline.ElmPkgOutline name
190+
summary
191+
license
192+
version
193+
exposed
194+
(Dict.remove identity pkg deps)
195+
(Dict.remove identity pkg test)
196+
elmVersion
197+
198+
else
199+
Task.pure AlreadyNotPresent

src/Builder/Build.elm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ module Builder.Build exposing
1818
)
1919

2020
import Basics.Extra exposing (flip)
21-
import Builder.Elm.Details as Details
22-
import Builder.Elm.Outline as Outline
2321
import Builder.File as File
22+
import Builder.Guida.Details as Details
23+
import Builder.Guida.Outline as Outline
2424
import Builder.Reporting as Reporting
2525
import Builder.Reporting.Exit as Exit
2626
import Builder.Stuff as Stuff
@@ -32,10 +32,10 @@ import Compiler.Data.Map.Utils as Map
3232
import Compiler.Data.Name as Name
3333
import Compiler.Data.NonEmptyList as NE
3434
import Compiler.Data.OneOrMore as OneOrMore
35-
import Compiler.Elm.Docs as Docs
36-
import Compiler.Elm.Interface as I
37-
import Compiler.Elm.ModuleName as ModuleName
38-
import Compiler.Elm.Package as Pkg
35+
import Compiler.Guida.Docs as Docs
36+
import Compiler.Guida.Interface as I
37+
import Compiler.Guida.ModuleName as ModuleName
38+
import Compiler.Guida.Package as Pkg
3939
import Compiler.Json.Encode as E
4040
import Compiler.Parse.Module as Parse
4141
import Compiler.Parse.SyntaxVersion as SV

src/Builder/Deps/Bump.elm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
module Builder.Deps.Bump exposing (getPossibilities)
22

33
import Builder.Deps.Registry exposing (KnownVersions(..))
4-
import Compiler.Elm.Magnitude as M
5-
import Compiler.Elm.Version as V
4+
import Compiler.Guida.Magnitude as M
5+
import Compiler.Guida.Version as V
66
import List.Extra
77
import Utils.Main as Utils
88

src/Builder/Deps/Diff.elm

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ import Builder.Http as Http
1515
import Builder.Reporting.Exit as Exit exposing (DocsProblem(..))
1616
import Builder.Stuff as Stuff
1717
import Compiler.Data.Name as Name
18-
import Compiler.Elm.Compiler.Type as Type
19-
import Compiler.Elm.Docs as Docs
20-
import Compiler.Elm.Magnitude as M
21-
import Compiler.Elm.ModuleName as ModuleName
22-
import Compiler.Elm.Package as Pkg
23-
import Compiler.Elm.Version as V exposing (Version)
18+
import Compiler.Guida.Compiler.Type as Type
19+
import Compiler.Guida.Docs as Docs
20+
import Compiler.Guida.Magnitude as M
21+
import Compiler.Guida.ModuleName as ModuleName
22+
import Compiler.Guida.Package as Pkg
23+
import Compiler.Guida.Version as V exposing (Version)
2424
import Compiler.Json.Decode as D
2525
import Data.Map as Dict exposing (Dict)
2626
import Data.Set as EverySet

src/Builder/Deps/Registry.elm

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,8 @@ import Builder.File as File
1717
import Builder.Http as Http
1818
import Builder.Reporting.Exit as Exit
1919
import Builder.Stuff as Stuff
20-
import Compiler.Elm.Package as Pkg
21-
import Compiler.Elm.Version as V
20+
import Compiler.Guida.Package as Pkg
21+
import Compiler.Guida.Version as V
2222
import Compiler.Json.Decode as D
2323
import Compiler.Parse.Primitives as P
2424
import Data.Map as Dict exposing (Dict)

0 commit comments

Comments
 (0)