Skip to content

Commit

Permalink
Merge pull request #16801 from scala-steward/update/macros-2.6.5
Browse files Browse the repository at this point in the history
Update macros, util to 2.6.5
  • Loading branch information
ornicar authored Jan 20, 2025
2 parents 8461162 + 99508b1 commit 11a1dfa
Show file tree
Hide file tree
Showing 13 changed files with 45 additions and 40 deletions.
36 changes: 20 additions & 16 deletions app/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,33 +11,36 @@ final class Env(
val config: Configuration,
val controllerComponents: ControllerComponents,
environment: Environment,
shutdown: akka.actor.CoordinatedShutdown
shutdown: akka.actor.CoordinatedShutdown,
cookieBaker: SessionCookieBaker
)(using val system: akka.actor.ActorSystem, val executor: Executor)(using
StandaloneWSClient,
akka.stream.Materializer,
SessionCookieBaker
akka.stream.Materializer
):
val net: NetConfig = config.get[NetConfig]("net")

export net.{ domain, baseUrl, assetBaseUrlInternal }
export net.{ baseUrl, assetBaseUrlInternal }

given mode: Mode = environment.mode
given translator: lila.core.i18n.Translator = lila.i18n.Translator
given scheduler: Scheduler = system.scheduler
given lila.core.config.RateLimit = net.rateLimit
given RateLimit = net.rateLimit
given NetDomain = net.domain

// wire all the lila modules in the right order
val i18n: lila.i18n.Env.type = lila.i18n.Env
val mongo: lila.db.Env = wire[lila.db.Env]
val memo: lila.memo.Env = wire[lila.memo.Env]
val socket: lila.socket.Env = wire[lila.socket.Env]
val user: lila.user.Env = wire[lila.user.Env]
val mailer: lila.mailer.Env = wire[lila.mailer.Env]
val oAuth: lila.oauth.Env = wire[lila.oauth.Env]
val security: lila.security.Env = wire[lila.security.Env]
val pref: lila.pref.Env = wire[lila.pref.Env]
val relation: lila.relation.Env = wire[lila.relation.Env]
val game: lila.game.Env = wire[lila.game.Env]
val i18n: lila.i18n.Env.type = lila.i18n.Env
val mongo: lila.db.Env = wire[lila.db.Env]
val memo: lila.memo.Env = wire[lila.memo.Env]
val socket: lila.socket.Env = wire[lila.socket.Env]
val user: lila.user.Env = wire[lila.user.Env]
import user.flairApi.given
val mailer: lila.mailer.Env = wire[lila.mailer.Env]
val oAuth: lila.oauth.Env = wire[lila.oauth.Env]
val security: lila.security.Env = wire[lila.security.Env]
val pref: lila.pref.Env = wire[lila.pref.Env]
val relation: lila.relation.Env = wire[lila.relation.Env]
val game: lila.game.Env = wire[lila.game.Env]
import game.given
val notifyM: lila.notify.Env = wire[lila.notify.Env]
val irc: lila.irc.Env = wire[lila.irc.Env]
val report: lila.report.Env = wire[lila.report.Env]
Expand All @@ -62,6 +65,7 @@ final class Env(
val forum: lila.forum.Env = wire[lila.forum.Env]
val forumSearch: lila.forumSearch.Env = wire[lila.forumSearch.Env]
val pool: lila.pool.Env = wire[lila.pool.Env]
import pool.isClockCompatible
val lobby: lila.lobby.Env = wire[lila.lobby.Env]
val setup: lila.setup.Env = wire[lila.setup.Env]
val simul: lila.simul.Env = wire[lila.simul.Env]
Expand Down
4 changes: 2 additions & 2 deletions modules/game/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ final class Env(

val gameRepo = GameRepo(db(config.gameColl))

val idGenerator = wire[IdGenerator]
given idGenerator: IdGenerator = wire[IdGenerator]

val divider = wire[Divider]

Expand Down Expand Up @@ -82,7 +82,7 @@ final class Env(
export AnonCookie.json as anonCookieJson
export AnonCookie.name as anonCookieName

lazy val newPlayer: lila.core.game.NewPlayer = new:
given newPlayer: lila.core.game.NewPlayer = new:
export Player.make as apply
export Player.makeAnon as anon

Expand Down
4 changes: 2 additions & 2 deletions modules/irc/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ import lila.core.misc.plan.ChargeEvent
@Module
final class Env(
appConfig: Configuration,
getLightUser: lila.core.LightUser.Getter,
noteApi: lila.core.user.NoteApi,
ws: StandaloneWSClient,
shutdown: akka.actor.CoordinatedShutdown,
mode: Mode
mode: Mode,
getLightUser: lila.core.LightUser.Getter
)(using Executor):

import ZulipClient.given
Expand Down
5 changes: 3 additions & 2 deletions modules/irc/src/main/IrcApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import lila.core.study.data.StudyChapterName

final class IrcApi(
zulip: ZulipClient,
noteApi: lila.core.user.NoteApi
)(using lightUser: LightUser.Getter, ec: Executor)
noteApi: lila.core.user.NoteApi,
lightUser: LightUser.Getter
)(using Executor)
extends lila.core.irc.IrcApi:

import IrcApi.*
Expand Down
2 changes: 1 addition & 1 deletion modules/pool/src/main/PoolList.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ object PoolList:

val clockStringSet: Set[String] = all.view.map(_.clock.show) to Set

val isClockCompatible: IsClockCompatible = IsClockCompatible: clock =>
given isClockCompatible: IsClockCompatible = IsClockCompatible: clock =>
clockStringSet contains clock.show

def json(using lila.core.i18n.Translator) = Json.toJson(all)
4 changes: 2 additions & 2 deletions modules/push/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ final class Env(
appConfig: Configuration,
ws: StandaloneWSClient,
db: lila.db.Db,
getLightUser: lila.core.LightUser.GetterFallback,
gameProxy: lila.core.game.GameProxy,
roundJson: lila.core.round.RoundJson,
gameRepo: lila.core.game.GameRepo,
namer: lila.core.game.Namer,
notifyAllows: lila.core.notify.GetNotifyAllows,
postApi: lila.core.forum.ForumPostApi
postApi: lila.core.forum.ForumPostApi,
getLightUser: lila.core.LightUser.GetterFallback
)(using Executor, Scheduler):

private val config = appConfig.get[PushConfig]("push")(AutoConfig.loader)
Expand Down
5 changes: 3 additions & 2 deletions modules/push/src/main/PushApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,9 @@ final private class PushApi(
gameRepo: lila.core.game.GameRepo,
namer: lila.core.game.Namer,
notifyAllows: lila.core.notify.GetNotifyAllows,
postApi: lila.core.forum.ForumPostApi
)(using Executor, Scheduler)(using lightUser: LightUser.GetterFallback):
postApi: lila.core.forum.ForumPostApi,
lightUser: lila.core.LightUser.GetterFallback
)(using Executor, Scheduler):

import PushApi.*
import PushApi.Data.payload
Expand Down
5 changes: 2 additions & 3 deletions modules/report/src/main/ReportApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ final class ReportApi(
isOnline: lila.core.socket.IsOnline,
cacheApi: lila.memo.CacheApi,
snoozer: lila.memo.Snoozer[Report.SnoozeKey],
thresholds: Thresholds,
domain: lila.core.config.NetDomain
)(using Executor, Scheduler)
thresholds: Thresholds
)(using Executor, Scheduler, lila.core.config.NetDomain)
extends lila.core.report.ReportApi:

import BSONHandlers.given
Expand Down
4 changes: 2 additions & 2 deletions modules/round/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ final class Env(
appConfig: Configuration,
db: lila.db.Db,
gameRepo: GameRepo,
idGenerator: lila.game.IdGenerator,
userRepo: lila.user.UserRepo,
userApi: lila.user.UserApi,
chatApi: lila.chat.ChatApi,
Expand All @@ -56,7 +55,8 @@ final class Env(
Executor,
akka.stream.Materializer,
lila.core.i18n.Translator,
lila.core.config.RateLimit
lila.core.config.RateLimit,
lila.game.IdGenerator
):

private val (botSync, async) = (lightUserApi.isBotSync, lightUserApi.async)
Expand Down
8 changes: 4 additions & 4 deletions modules/title/src/main/Env.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,10 @@ import lila.core.config.CollName
import lila.core.lilaism.Lilaism.*

@Module
final class Env(db: lila.db.Db, picfitApi: lila.memo.PicfitApi)(using
Executor,
lila.core.config.BaseUrl
)(using scheduler: Scheduler):
final class Env(db: lila.db.Db, picfitApi: lila.memo.PicfitApi, baseUrl: lila.core.config.BaseUrl)(using
ec: Executor,
scheduler: Scheduler
):

private val requestColl = db(CollName("title_request"))

Expand Down
4 changes: 2 additions & 2 deletions modules/title/src/main/TitleApi.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import lila.core.perm.Granter
import lila.db.dsl.{ *, given }
import lila.memo.PicfitApi

final class TitleApi(coll: Coll, picfitApi: PicfitApi)(using Executor, BaseUrl):
final class TitleApi(coll: Coll, picfitApi: PicfitApi, baseUrl: BaseUrl)(using Executor):

import TitleRequest.*

Expand Down Expand Up @@ -94,7 +94,7 @@ Here is the feedback provided:

$feedback

${summon[BaseUrl]}/verify-title
$baseUrl/verify-title
"""
lila.common.Bus.publish(SystemMsg(to, pm), "msgSystemSend")

Expand Down
2 changes: 1 addition & 1 deletion modules/web/src/main/AssetManifest.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ case class AssetMaps(
modified: Instant
)

final class AssetManifest(environment: Environment, net: NetConfig)(using ws: StandaloneWSClient)(using
final class AssetManifest(environment: Environment, net: NetConfig, ws: StandaloneWSClient)(using
Executor
):
private var maps: AssetMaps = AssetMaps(Map.empty, Map.empty, Map.empty, java.time.Instant.MIN)
Expand Down
2 changes: 1 addition & 1 deletion project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ object Dependencies {
}

object macwire {
val version = "2.6.4"
val version = "2.6.5"
val macros = "com.softwaremill.macwire" %% "macros" % version % "provided"
val util = "com.softwaremill.macwire" %% "util" % version % "provided"
val tagging = "com.softwaremill.common" %% "tagging" % "2.3.5"
Expand Down

0 comments on commit 11a1dfa

Please sign in to comment.