Skip to content

Commit

Permalink
Merge branch 'master' of github.com:kitlangton/zio-app
Browse files Browse the repository at this point in the history
  • Loading branch information
kitlangton committed Jun 17, 2021
2 parents 2abd33e + b6f13cf commit 63b6486
Show file tree
Hide file tree
Showing 10 changed files with 34 additions and 32 deletions.
1 change: 0 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@ lazy val cli = (project in file("cli"))
"--allow-incomplete-classpath",
"--no-fallback",
"--install-exit-handlers",
"--libc=musl",
"-H:+ReportExceptionStackTraces",
"-H:+RemoveSaturatedTypeFlows",
"-H:+TraceClassInitialization",
Expand Down
10 changes: 7 additions & 3 deletions cli-frontend/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<!doctype html>

<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>zio-app</title>
</head>

<body>
<div id="app"></div>
<%- script %>
</body>
</body>
</html>
12 changes: 0 additions & 12 deletions cli/src/main/g8/application.conf.yaml

This file was deleted.

3 changes: 3 additions & 0 deletions cli/src/main/g8/backend/application.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# This file is in HOCON format, a superset of JSON

usernames = [ "Moose" , "Squirrel" , "Flapjack" , "Banana" , "Quetzalcoatal" , "Dungaree" , "Bumpy" , "Snickers" , "Brobostigan"]
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,9 @@ object Backend extends App {
} yield ()

override def run(args: List[String]): URIO[zio.ZEnv, ExitCode] = {
program.injectCustom(ExampleServiceLive.layer).exitCode
program
.injectCustom(Config.live, ExampleServiceLive.layer)
.exitCode
}
}

Expand All @@ -26,4 +28,4 @@ case class ExampleServiceLive(random: zio.random.Random.Service) extends Example

object ExampleServiceLive {
val layer = (ExampleServiceLive.apply _).toLayer[ExampleService]
}
}
4 changes: 2 additions & 2 deletions cli/src/main/g8/backend/src/main/scala/$package$/Config.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ package $package$

import zio._
import zio.config._
import zio.config.yaml._
import zio.config.magnolia._
import zio.config.typesafe._

import java.io.File

Expand All @@ -14,7 +14,7 @@ object Config {
DeriveConfigDescriptor.descriptor[Config]

val live: ZLayer[system.System, Nothing, Has[Config]] =
YamlConfig.fromFile(new File("../application.conf.yaml"), descriptor).orDie
TypesafeConfig.fromHoconFile(new File("application.conf"), descriptor).orDie

val service: URIO[Has[Config], Config] = ZIO.service[Config]
}
4 changes: 2 additions & 2 deletions cli/src/main/g8/build.sbt
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
name := "$name$"
description := "$description$"
version := "0.1"
version := "0.0.1"

val animusVersion = "0.1.9"
val laminarVersion = "0.13.0"
val quillZioVersion = "3.7.1"
val sttpVersion = "3.3.6"
val zioAppVersion = "0.2.5"
val zioConfigVersion = "1.0.5"
val zioConfigVersion = "1.0.6"
val zioHttpVersion = "1.0.0.0-RC17"
val zioJsonVersion = "0.1.5"
val zioMagicVersion = "0.3.3"
Expand Down
14 changes: 9 additions & 5 deletions cli/src/main/g8/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<!doctype html>

<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>$name$</title>
</head>

<body>
<div id="app"></div>
<%- script %>
</body>
<div id="app"></div>
<%- script %>
</body>
</html>
2 changes: 0 additions & 2 deletions cli/src/main/resources/resource-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,5 @@
{"pattern":"\\Qdist/index.html\\E"}
],
"bundles":[
{"name":"sun.awt.resources.awt"},
{"name":"sun.awt.resources.awtosx"}
]
}
10 changes: 7 additions & 3 deletions examples/index.html
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
<!doctype html>

<html>
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<title>ZIO App Example</title>
</head>

<body>
<div id="app"></div>
<%- script %>
</body>
</body>
</html>

0 comments on commit 63b6486

Please sign in to comment.