@@ -2,7 +2,7 @@ port module Main exposing (main)
2
2
3
3
import Node
4
4
import ChildProcess
5
- import Compiler
5
+ import CompilerBlob
6
6
import Init
7
7
import Stream exposing (Stream)
8
8
import Task exposing (Task)
@@ -75,11 +75,11 @@ init env =
75
75
}
76
76
77
77
_ ->
78
- Compiler.binaryDownloadUrl env.platform env.cpuArchitecture
78
+ CompilerBlob.downloadUrl env.platform env.cpuArchitecture
79
79
|> Result.map
80
80
(\url ->
81
81
{ remotePath = Just url
82
- , localPath = Compiler.binaryCachePath env.platform envVars homeDir
82
+ , localPath = CompilerBlob.cachePath env.platform envVars homeDir
83
83
}
84
84
)
85
85
|> Result.toMaybe
@@ -147,7 +147,7 @@ update msg model =
147
147
case maybeRemotePath of
148
148
Just remotePath ->
149
149
Stream.sendLine model.stdout ("Compiler not found at " ++ model.pathToString localPath ++ ". Downloading...")
150
- |> Task.andThen (\{} -> Compiler.downloadBinary model.httpPermission remotePath)
150
+ |> Task.andThen (\{} -> CompilerBlob.download model.httpPermission remotePath)
151
151
|> Task.attempt (\result -> CompilerDownloaded { localPath = localPath, downloadResult = result })
152
152
153
153
Nothing ->
@@ -161,7 +161,7 @@ update msg model =
161
161
if res.statusCode == 302 then
162
162
case Dict.get "location" res.headers of
163
163
Just [ location ] ->
164
- Compiler.downloadBinary model.httpPermission location
164
+ CompilerBlob.download model.httpPermission location
165
165
|> Task.attempt (\result -> CompilerDownloaded { localPath = localPath, downloadResult = result })
166
166
167
167
_ ->
@@ -266,10 +266,10 @@ parseUserArgs model compilerPath =
266
266
actualCommand =
267
267
case parsedCommand of
268
268
MakeStatic opts ->
269
- Compiler .Make
269
+ CompilerBlob .Make
270
270
{ optimize = True
271
271
, sourcemaps = False
272
- , output = Just (Compiler .Exe <| model.pathToString opts.output)
272
+ , output = Just (CompilerBlob .Exe <| model.pathToString opts.output)
273
273
, report = Nothing
274
274
}
275
275
[ opts.source ]
@@ -285,7 +285,7 @@ parseUserArgs model compilerPath =
285
285
_ ->
286
286
CompilerRan
287
287
in
288
- Compiler .run
288
+ CompilerBlob .run
289
289
model.cpPermission
290
290
{ command = actualCommand
291
291
, interactiveSession = model.interactive
@@ -301,7 +301,7 @@ parseUserArgs model compilerPath =
301
301
302
302
type ParsedCommand
303
303
= MakeStatic MakeStaticOpts
304
- | CompilerCommand Compiler .Command
304
+ | CompilerCommand CompilerBlob .Command
305
305
306
306
307
307
type alias MakeStaticOpts =
@@ -313,12 +313,12 @@ type alias MakeStaticOpts =
313
313
cliParser : CLI.Parser.App ParsedCommand
314
314
cliParser =
315
315
{ name = "gren"
316
- , version = Compiler .version
316
+ , version = CompilerBlob .version
317
317
, intro =
318
318
PP.verticalBlock
319
319
[ PP.block
320
320
[ PP.text "Hi, thank you for trying out "
321
- , PP.intenseColor PP.Green <| PP.text ("Gren " ++ Compiler .version)
321
+ , PP.intenseColor PP.Green <| PP.text ("Gren " ++ CompilerBlob .version)
322
322
, PP.text ". I hope you like it!"
323
323
]
324
324
, PP.empty
@@ -350,10 +350,10 @@ cliParser =
350
350
{ package = package
351
351
, platform =
352
352
if package then
353
- Maybe.withDefault Compiler .Common maybePlatform
353
+ Maybe.withDefault CompilerBlob .Common maybePlatform
354
354
355
355
else
356
- Maybe.withDefault Compiler .Browser maybePlatform
356
+ Maybe.withDefault CompilerBlob .Browser maybePlatform
357
357
}
358
358
)
359
359
|> CLI.Parser.toggle "package" "Create a package (as opposed to an application)"
@@ -369,7 +369,7 @@ cliParser =
369
369
common to all Gren project.
370
370
"""
371
371
, builder =
372
- \_args flags -> CompilerCommand <| Compiler .Init flags
372
+ \_args flags -> CompilerCommand <| CompilerBlob .Init flags
373
373
}
374
374
|> CLI.Parser.withCommand
375
375
{ word = "repl"
@@ -398,7 +398,7 @@ cliParser =
398
398
the quickest way to get started.
399
399
"""
400
400
, builder =
401
- \_args flags -> CompilerCommand <| Compiler .Repl flags
401
+ \_args flags -> CompilerCommand <| CompilerBlob .Repl flags
402
402
}
403
403
|> CLI.Parser.withCommand
404
404
{ word = "make"
@@ -436,7 +436,7 @@ cliParser =
436
436
"""
437
437
]
438
438
, builder =
439
- \args flags -> CompilerCommand <| Compiler .Make flags args
439
+ \args flags -> CompilerCommand <| CompilerBlob .Make flags args
440
440
}
441
441
|> CLI.Parser.withCommand
442
442
{ word = "make-static"
@@ -503,7 +503,7 @@ cliParser =
503
503
"""
504
504
]
505
505
, builder =
506
- \_args flags -> CompilerCommand <| Compiler .Docs flags
506
+ \_args flags -> CompilerCommand <| CompilerBlob .Docs flags
507
507
}
508
508
|> CLI.Parser.withPrefix "package" packageCommands
509
509
}
@@ -553,7 +553,7 @@ packageCommands =
553
553
"""
554
554
]
555
555
, builder =
556
- \arg _flags -> CompilerCommand <| Compiler .PackageInstall arg
556
+ \arg _flags -> CompilerCommand <| CompilerBlob .PackageInstall arg
557
557
}
558
558
|> CLI.Parser.withCommand
559
559
{ word = "uninstall"
@@ -589,7 +589,7 @@ packageCommands =
589
589
"""
590
590
]
591
591
, builder =
592
- \arg _flags -> CompilerCommand <| Compiler .PackageUninstall arg
592
+ \arg _flags -> CompilerCommand <| CompilerBlob .PackageUninstall arg
593
593
}
594
594
|> CLI.Parser.withCommand
595
595
{ word = "outdated"
@@ -607,7 +607,7 @@ packageCommands =
607
607
|> PP.indent
608
608
|> PP.color PP.Green
609
609
, builder =
610
- \_args _flags -> CompilerCommand Compiler .PackageOutdated
610
+ \_args _flags -> CompilerCommand CompilerBlob .PackageOutdated
611
611
}
612
612
|> CLI.Parser.withCommand
613
613
{ word = "validate"
@@ -652,7 +652,7 @@ packageCommands =
652
652
"""
653
653
]
654
654
, builder =
655
- \_args _flags -> CompilerCommand Compiler .PackageValidate
655
+ \_args _flags -> CompilerCommand CompilerBlob .PackageValidate
656
656
}
657
657
|> CLI.Parser.withCommand
658
658
{ word = "bump"
@@ -673,18 +673,18 @@ packageCommands =
673
673
all packages, so there cannot be MAJOR changes hiding in PATCH releases in Gren!
674
674
"""
675
675
, builder =
676
- \_args _flags -> CompilerCommand Compiler .PackageBump
676
+ \_args _flags -> CompilerCommand CompilerBlob .PackageBump
677
677
}
678
678
|> CLI.Parser.withCommand
679
679
{ word = "diff"
680
680
, arguments =
681
681
CLI.Parser.oneOfArgs
682
682
[ CLI.Parser.noArgs
683
- |> CLI.Parser.mapArgs (\{} -> Compiler .DiffLatest)
683
+ |> CLI.Parser.mapArgs (\{} -> CompilerBlob .DiffLatest)
684
684
, CLI.Parser.oneArg SemanticVersion.cliParser
685
- |> CLI.Parser.mapArgs Compiler .DiffVersion
686
- , CLI.Parser.twoArgs Compiler .DiffRange SemanticVersion.cliParser SemanticVersion.cliParser
687
- , CLI.Parser.threeArgs Compiler .DiffGlobal Package.cliParser SemanticVersion.cliParser SemanticVersion.cliParser
685
+ |> CLI.Parser.mapArgs CompilerBlob .DiffVersion
686
+ , CLI.Parser.twoArgs CompilerBlob .DiffRange SemanticVersion.cliParser SemanticVersion.cliParser
687
+ , CLI.Parser.threeArgs CompilerBlob .DiffGlobal Package.cliParser SemanticVersion.cliParser SemanticVersion.cliParser
688
688
]
689
689
, flags =
690
690
CLI.Parser.noFlags
@@ -711,19 +711,19 @@ packageCommands =
711
711
"""
712
712
]
713
713
, builder =
714
- \args _flags -> CompilerCommand <| Compiler .PackageDiff args
714
+ \args _flags -> CompilerCommand <| CompilerBlob .PackageDiff args
715
715
}
716
716
717
717
718
- initPlatformParser : CLI.Parser.ValueParser Compiler .Platform
718
+ initPlatformParser : CLI.Parser.ValueParser CompilerBlob .Platform
719
719
initPlatformParser =
720
720
{ singular = "platform"
721
721
, plural = "platforms"
722
722
, fn = \str ->
723
723
case str of
724
- "common" -> Just Compiler .Common
725
- "browser" -> Just Compiler .Browser
726
- "node" -> Just Compiler .Node
724
+ "common" -> Just CompilerBlob .Common
725
+ "browser" -> Just CompilerBlob .Browser
726
+ "node" -> Just CompilerBlob .Node
727
727
_ -> Nothing
728
728
, examples =
729
729
[ "common"
@@ -761,25 +761,25 @@ interpreterParser =
761
761
}
762
762
763
763
764
- outputParser : CLI.Parser.ValueParser Compiler .MakeOutput
764
+ outputParser : CLI.Parser.ValueParser CompilerBlob .MakeOutput
765
765
outputParser =
766
766
{ singular = "output-file"
767
767
, plural = "output-files"
768
768
, fn = \str ->
769
769
case str of
770
- "/dev/stdout" -> Just Compiler .StdOut
771
- "/dev/null" -> Just Compiler .DevNull
772
- "NUL" -> Just Compiler .DevNull
773
- "$null" -> Just Compiler .DevNull
770
+ "/dev/stdout" -> Just CompilerBlob .StdOut
771
+ "/dev/null" -> Just CompilerBlob .DevNull
772
+ "NUL" -> Just CompilerBlob .DevNull
773
+ "$null" -> Just CompilerBlob .DevNull
774
774
_ ->
775
775
if String.endsWith ".html" str then
776
- Just <| Compiler .Html str
776
+ Just <| CompilerBlob .Html str
777
777
778
778
else if String.endsWith ".js" str then
779
- Just <| Compiler .Js str
779
+ Just <| CompilerBlob .Js str
780
780
781
781
else if not <| String.contains "." str then
782
- Just <| Compiler .Exe str
782
+ Just <| CompilerBlob .Exe str
783
783
784
784
else
785
785
Nothing
@@ -793,19 +793,19 @@ outputParser =
793
793
}
794
794
795
795
796
- docsOutputParser : CLI.Parser.ValueParser Compiler .DocsOutput
796
+ docsOutputParser : CLI.Parser.ValueParser CompilerBlob .DocsOutput
797
797
docsOutputParser =
798
798
{ singular = "output-file"
799
799
, plural = "output-files"
800
800
, fn = \str ->
801
801
case str of
802
- "/dev/stdout" -> Just Compiler .DocsStdOut
803
- "/dev/null" -> Just Compiler .DocsDevNull
804
- "NUL" -> Just Compiler .DocsDevNull
805
- "$null" -> Just Compiler .DocsDevNull
802
+ "/dev/stdout" -> Just CompilerBlob .DocsStdOut
803
+ "/dev/null" -> Just CompilerBlob .DocsDevNull
804
+ "NUL" -> Just CompilerBlob .DocsDevNull
805
+ "$null" -> Just CompilerBlob .DocsDevNull
806
806
_ ->
807
807
if String.endsWith ".json" str then
808
- Just <| Compiler .DocsJson str
808
+ Just <| CompilerBlob .DocsJson str
809
809
810
810
else
811
811
Nothing
0 commit comments