diff --git a/.travis.yml b/.travis.yml index 632188e..92b85a2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -23,5 +23,5 @@ before_script: script: - sbt ++$TRAVIS_SCALA_VERSION test - - sbt ++$TRAVIS_SCALA_VERSION +publishLocal + - sbt ++$TRAVIS_SCALA_VERSION publishLocal - cd example && sbt ++$TRAVIS_SCALA_VERSION compile fullOptJS \ No newline at end of file diff --git a/README.md b/README.md index 9918489..c62da25 100644 --- a/README.md +++ b/README.md @@ -4,10 +4,10 @@ Static types for the jQuery API for [Scala.js](http://www.scala-js.org/) program ## Usage -Add the following to your SBT build: +Add the following dependency to your SBT build: ```scala -libraryDependencies += "io.udash" %%% "udash-jquery" % "1.1.0" +libraryDependencies += "io.udash" %%% "udash-jquery" % "2.0.0" ``` then import the jQuery package: @@ -16,6 +16,21 @@ then import the jQuery package: import io.udash.wrappers.jquery._ ``` +Since version `2.0.0` the wrapper does not force JS dependency on jQuery. You have to +add it manually by: + * explicit link in your `index.html`. + ```html + + ``` + * or a [Scala.js dependency](http://www.scala-js.org/doc/project/dependencies.html). + ```scala + jsDependencies += + "org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js" + ``` + + ## Examples ```scala diff --git a/build.sbt b/build.sbt index 090b491..9cde657 100644 --- a/build.sbt +++ b/build.sbt @@ -5,7 +5,7 @@ import org.scalajs.jsenv.selenium.SeleniumJSEnv name := "udash-jquery" inThisBuild(Seq( - version := "1.2.0", + version := "2.0.0", organization := "io.udash", scalaVersion := "2.12.6", crossScalaVersions := Seq("2.11.12", "2.12.6"), @@ -58,13 +58,13 @@ val commonJSSettings = Seq( ) libraryDependencies ++= Seq( - "org.scala-js" %%% "scalajs-dom" % "0.9.5", + "org.scala-js" %%% "scalajs-dom" % "0.9.6", "org.scalatest" %%% "scalatest" % "3.0.5" % Test, "com.lihaoyi" %%% "scalatags" % "0.6.7" % Test ) jsDependencies += - "org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js" + "org.webjars" % "jquery" % "3.3.1" % Test / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js" lazy val root = project.in(file(".")) .enablePlugins(ScalaJSPlugin) diff --git a/example/build.sbt b/example/build.sbt index a6221fe..66c5314 100644 --- a/example/build.sbt +++ b/example/build.sbt @@ -1,9 +1,10 @@ name := "jquery-demo" inThisBuild(Seq( - version := "1.2.0", + version := "2.0.0", organization := "io.udash", scalaVersion := "2.12.6", + crossScalaVersions := Seq("2.11.12", "2.12.6"), scalacOptions ++= Seq( "-feature", "-deprecation", @@ -31,6 +32,7 @@ val copyAssets = taskKey[Unit]("Copies all assets to the target directory.") val `jquery-demo` = project.in(file(".")).enablePlugins(ScalaJSPlugin) .settings( libraryDependencies ++= Dependencies.deps.value, + jsDependencies ++= Dependencies.jsDeps.value, /* move these files out of target/. */ Compile / fullOptJS / crossTarget := generatedDir, diff --git a/example/project/Dependencies.scala b/example/project/Dependencies.scala index 48bac51..44cffc7 100644 --- a/example/project/Dependencies.scala +++ b/example/project/Dependencies.scala @@ -1,12 +1,17 @@ import org.scalajs.sbtplugin.ScalaJSPlugin.autoImport._ +import org.portablescala.sbtplatformdeps.PlatformDepsPlugin.autoImport._ import sbt._ object Dependencies { val udashCoreVersion = "0.6.1" - val udashJQueryVersion = "1.2.0" + val udashJQueryVersion = "2.0.0" val deps = Def.setting(Seq[ModuleID]( "io.udash" %%% "udash-core-frontend" % udashCoreVersion, "io.udash" %%% "udash-jquery" % udashJQueryVersion )) + + val jsDeps = Def.setting(Seq[org.scalajs.sbtplugin.JSModuleID]( + "org.webjars" % "jquery" % "3.3.1" / "3.3.1/jquery.js" minified "3.3.1/jquery.min.js" + )) } \ No newline at end of file diff --git a/example/project/build.properties b/example/project/build.properties index c3e3abc..84d4f68 100644 --- a/example/project/build.properties +++ b/example/project/build.properties @@ -1 +1 @@ -sbt.version = 1.1.4 \ No newline at end of file +sbt.version = 1.2.0 \ No newline at end of file diff --git a/example/project/plugins.sbt b/example/project/plugins.sbt index 293d135..a6a5fe1 100644 --- a/example/project/plugins.sbt +++ b/example/project/plugins.sbt @@ -1,3 +1,3 @@ logLevel := Level.Warn -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22") \ No newline at end of file +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.24") \ No newline at end of file diff --git a/project/build.properties b/project/build.properties index c3e3abc..84d4f68 100755 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version = 1.1.4 \ No newline at end of file +sbt.version = 1.2.0 \ No newline at end of file diff --git a/project/plugins.sbt b/project/plugins.sbt index 953c2a1..9ffbb26 100755 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -2,4 +2,4 @@ logLevel := Level.Warn libraryDependencies += "org.scala-js" %% "scalajs-env-selenium" % "0.2.0" -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.22") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.24")