Skip to content

Commit 4fabf00

Browse files
committed
Use released version of compiler-node package.
1 parent d87a0de commit 4fabf00

File tree

2 files changed

+46
-46
lines changed

2 files changed

+46
-46
lines changed

gren.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"direct": {
1010
"gren-lang/core": "5.1.1",
1111
"gren-lang/node": "4.2.1",
12-
"gren-lang/compiler-node": "local:../compiler-node"
12+
"gren-lang/compiler-node": "1.0.0"
1313
},
1414
"indirect": {
1515
"gren-lang/url": "4.0.0"

src/Main.gren

+45-45
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ port module Main exposing (main)
22

33
import Node
44
import ChildProcess
5-
import Compiler
5+
import CompilerBlob
66
import Init
77
import Stream exposing (Stream)
88
import Task exposing (Task)
@@ -75,11 +75,11 @@ init env =
7575
}
7676

7777
_ ->
78-
Compiler.binaryDownloadUrl env.platform env.cpuArchitecture
78+
CompilerBlob.downloadUrl env.platform env.cpuArchitecture
7979
|> Result.map
8080
(\url ->
8181
{ remotePath = Just url
82-
, localPath = Compiler.binaryCachePath env.platform envVars homeDir
82+
, localPath = CompilerBlob.cachePath env.platform envVars homeDir
8383
}
8484
)
8585
|> Result.toMaybe
@@ -147,7 +147,7 @@ update msg model =
147147
case maybeRemotePath of
148148
Just remotePath ->
149149
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)
151151
|> Task.attempt (\result -> CompilerDownloaded { localPath = localPath, downloadResult = result })
152152

153153
Nothing ->
@@ -161,7 +161,7 @@ update msg model =
161161
if res.statusCode == 302 then
162162
case Dict.get "location" res.headers of
163163
Just [ location ] ->
164-
Compiler.downloadBinary model.httpPermission location
164+
CompilerBlob.download model.httpPermission location
165165
|> Task.attempt (\result -> CompilerDownloaded { localPath = localPath, downloadResult = result })
166166

167167
_ ->
@@ -266,10 +266,10 @@ parseUserArgs model compilerPath =
266266
actualCommand =
267267
case parsedCommand of
268268
MakeStatic opts ->
269-
Compiler.Make
269+
CompilerBlob.Make
270270
{ optimize = True
271271
, sourcemaps = False
272-
, output = Just (Compiler.Exe <| model.pathToString opts.output)
272+
, output = Just (CompilerBlob.Exe <| model.pathToString opts.output)
273273
, report = Nothing
274274
}
275275
[ opts.source ]
@@ -285,7 +285,7 @@ parseUserArgs model compilerPath =
285285
_ ->
286286
CompilerRan
287287
in
288-
Compiler.run
288+
CompilerBlob.run
289289
model.cpPermission
290290
{ command = actualCommand
291291
, interactiveSession = model.interactive
@@ -301,7 +301,7 @@ parseUserArgs model compilerPath =
301301

302302
type ParsedCommand
303303
= MakeStatic MakeStaticOpts
304-
| CompilerCommand Compiler.Command
304+
| CompilerCommand CompilerBlob.Command
305305

306306

307307
type alias MakeStaticOpts =
@@ -313,12 +313,12 @@ type alias MakeStaticOpts =
313313
cliParser : CLI.Parser.App ParsedCommand
314314
cliParser =
315315
{ name = "gren"
316-
, version = Compiler.version
316+
, version = CompilerBlob.version
317317
, intro =
318318
PP.verticalBlock
319319
[ PP.block
320320
[ 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)
322322
, PP.text ". I hope you like it!"
323323
]
324324
, PP.empty
@@ -350,10 +350,10 @@ cliParser =
350350
{ package = package
351351
, platform =
352352
if package then
353-
Maybe.withDefault Compiler.Common maybePlatform
353+
Maybe.withDefault CompilerBlob.Common maybePlatform
354354

355355
else
356-
Maybe.withDefault Compiler.Browser maybePlatform
356+
Maybe.withDefault CompilerBlob.Browser maybePlatform
357357
}
358358
)
359359
|> CLI.Parser.toggle "package" "Create a package (as opposed to an application)"
@@ -369,7 +369,7 @@ cliParser =
369369
common to all Gren project.
370370
"""
371371
, builder =
372-
\_args flags -> CompilerCommand <| Compiler.Init flags
372+
\_args flags -> CompilerCommand <| CompilerBlob.Init flags
373373
}
374374
|> CLI.Parser.withCommand
375375
{ word = "repl"
@@ -398,7 +398,7 @@ cliParser =
398398
the quickest way to get started.
399399
"""
400400
, builder =
401-
\_args flags -> CompilerCommand <| Compiler.Repl flags
401+
\_args flags -> CompilerCommand <| CompilerBlob.Repl flags
402402
}
403403
|> CLI.Parser.withCommand
404404
{ word = "make"
@@ -436,7 +436,7 @@ cliParser =
436436
"""
437437
]
438438
, builder =
439-
\args flags -> CompilerCommand <| Compiler.Make flags args
439+
\args flags -> CompilerCommand <| CompilerBlob.Make flags args
440440
}
441441
|> CLI.Parser.withCommand
442442
{ word = "make-static"
@@ -503,7 +503,7 @@ cliParser =
503503
"""
504504
]
505505
, builder =
506-
\_args flags -> CompilerCommand <| Compiler.Docs flags
506+
\_args flags -> CompilerCommand <| CompilerBlob.Docs flags
507507
}
508508
|> CLI.Parser.withPrefix "package" packageCommands
509509
}
@@ -553,7 +553,7 @@ packageCommands =
553553
"""
554554
]
555555
, builder =
556-
\arg _flags -> CompilerCommand <| Compiler.PackageInstall arg
556+
\arg _flags -> CompilerCommand <| CompilerBlob.PackageInstall arg
557557
}
558558
|> CLI.Parser.withCommand
559559
{ word = "uninstall"
@@ -589,7 +589,7 @@ packageCommands =
589589
"""
590590
]
591591
, builder =
592-
\arg _flags -> CompilerCommand <| Compiler.PackageUninstall arg
592+
\arg _flags -> CompilerCommand <| CompilerBlob.PackageUninstall arg
593593
}
594594
|> CLI.Parser.withCommand
595595
{ word = "outdated"
@@ -607,7 +607,7 @@ packageCommands =
607607
|> PP.indent
608608
|> PP.color PP.Green
609609
, builder =
610-
\_args _flags -> CompilerCommand Compiler.PackageOutdated
610+
\_args _flags -> CompilerCommand CompilerBlob.PackageOutdated
611611
}
612612
|> CLI.Parser.withCommand
613613
{ word = "validate"
@@ -652,7 +652,7 @@ packageCommands =
652652
"""
653653
]
654654
, builder =
655-
\_args _flags -> CompilerCommand Compiler.PackageValidate
655+
\_args _flags -> CompilerCommand CompilerBlob.PackageValidate
656656
}
657657
|> CLI.Parser.withCommand
658658
{ word = "bump"
@@ -673,18 +673,18 @@ packageCommands =
673673
all packages, so there cannot be MAJOR changes hiding in PATCH releases in Gren!
674674
"""
675675
, builder =
676-
\_args _flags -> CompilerCommand Compiler.PackageBump
676+
\_args _flags -> CompilerCommand CompilerBlob.PackageBump
677677
}
678678
|> CLI.Parser.withCommand
679679
{ word = "diff"
680680
, arguments =
681681
CLI.Parser.oneOfArgs
682682
[ CLI.Parser.noArgs
683-
|> CLI.Parser.mapArgs (\{} -> Compiler.DiffLatest)
683+
|> CLI.Parser.mapArgs (\{} -> CompilerBlob.DiffLatest)
684684
, 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
688688
]
689689
, flags =
690690
CLI.Parser.noFlags
@@ -711,19 +711,19 @@ packageCommands =
711711
"""
712712
]
713713
, builder =
714-
\args _flags -> CompilerCommand <| Compiler.PackageDiff args
714+
\args _flags -> CompilerCommand <| CompilerBlob.PackageDiff args
715715
}
716716

717717

718-
initPlatformParser : CLI.Parser.ValueParser Compiler.Platform
718+
initPlatformParser : CLI.Parser.ValueParser CompilerBlob.Platform
719719
initPlatformParser =
720720
{ singular = "platform"
721721
, plural = "platforms"
722722
, fn = \str ->
723723
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
727727
_ -> Nothing
728728
, examples =
729729
[ "common"
@@ -761,25 +761,25 @@ interpreterParser =
761761
}
762762

763763

764-
outputParser : CLI.Parser.ValueParser Compiler.MakeOutput
764+
outputParser : CLI.Parser.ValueParser CompilerBlob.MakeOutput
765765
outputParser =
766766
{ singular = "output-file"
767767
, plural = "output-files"
768768
, fn = \str ->
769769
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
774774
_ ->
775775
if String.endsWith ".html" str then
776-
Just <| Compiler.Html str
776+
Just <| CompilerBlob.Html str
777777

778778
else if String.endsWith ".js" str then
779-
Just <| Compiler.Js str
779+
Just <| CompilerBlob.Js str
780780

781781
else if not <| String.contains "." str then
782-
Just <| Compiler.Exe str
782+
Just <| CompilerBlob.Exe str
783783

784784
else
785785
Nothing
@@ -793,19 +793,19 @@ outputParser =
793793
}
794794

795795

796-
docsOutputParser : CLI.Parser.ValueParser Compiler.DocsOutput
796+
docsOutputParser : CLI.Parser.ValueParser CompilerBlob.DocsOutput
797797
docsOutputParser =
798798
{ singular = "output-file"
799799
, plural = "output-files"
800800
, fn = \str ->
801801
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
806806
_ ->
807807
if String.endsWith ".json" str then
808-
Just <| Compiler.DocsJson str
808+
Just <| CompilerBlob.DocsJson str
809809

810810
else
811811
Nothing

0 commit comments

Comments
 (0)