Skip to content

Commit

Permalink
Add support for laminext
Browse files Browse the repository at this point in the history
  • Loading branch information
reidspencer committed Jan 14, 2025
1 parent 8faf269 commit 7a6963e
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 7 deletions.
5 changes: 3 additions & 2 deletions src/main/scala/com/ossuminc/sbt/OssumIncPlugin.scala
Original file line number Diff line number Diff line change
Expand Up @@ -89,9 +89,10 @@ object OssumIncPlugin extends AutoPlugin {
def laminar(
version: String = "17.2.0",
domVersion: String = "2.8.0",
waypointVersion: Option[String] = Some("9.0.0")
waypointVersion: Option[String] = Some("9.0.0"),
laminextVersion: Option[Seq[(String, String)]] = None
)(project: Project): Project =
helpers.Laminar.configure(version, domVersion, waypointVersion)(project)
helpers.Laminar.configure(version, domVersion, waypointVersion, laminextVersion)(project)

/** Use this to configure your project to compile to native code The defaults are usually
* sufficient but the arguments to this function make it easy to specify the options that
Expand Down
29 changes: 24 additions & 5 deletions src/main/scala/com/ossuminc/sbt/helpers/Laminar.scala
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,31 @@ object Laminar extends AutoPluginHelper {
def configure(
version: String = "17.2.0",
dom_version: String = "2.8.0",
waypoint_version: Option[String] = Some("9.0.0")
waypoint_version: Option[String] = Some("9.0.0"),
laminext_version: Option[Seq[(String, String)]] = None
)(project: Project): Project =
project.settings(
libraryDependencies ++= Seq(
"org.scala-js" %%% "scalajs-dom" % dom_version,
"com.raquo" %%% "laminar" % version
) ++ waypoint_version.map(v => "com.raquo" %%% "waypoint" % v)
libraryDependencies ++= {
val waypoint: Seq[ModuleID] =
waypoint_version.map(v => "com.raquo" %%% "waypoint" % v).toSeq
val laminext: Seq[ModuleID] = {
val modver: Seq[(String, String)] =
laminext_version.getOrElse(Seq.empty[(String, String)])
modver.map { case (module, version) =>
module match {
case "core" => "dev.laminext" %%% "core" % version
case "fetch" => "dev.laminext" %%% "fetch" % version
case "websocket" => "dev.laminext" %%% "websocket" % version
case "ui" => "dev.laminext" %%% "ui" % version
case "validation" => "dev.laminext" %%% "validation" % version
case "util" => "dev.laminext" %%% "util" % version
}
}
}
Seq(
"org.scala-js" %%% "scalajs-dom" % dom_version,
"com.raquo" %%% "laminar" % version
) ++ waypoint ++ laminext
}
)
}

0 comments on commit 7a6963e

Please sign in to comment.