Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ The following options are provided:
Option | Description
----------------------------|------------
command | The filesystem location of the command to execute. Commands such as "node" default to being known to your path. However there path can be supplied here."
engineType | The type of engine to use i.e. CommonNode, Node, PhantomJs, Rhino, Trireme, or AutoDetect. The default is AutoDetect, which uses Node if installed or otherwise falls back to Trireme.
engineType | The type of engine to use i.e. CommonNode, Node, PhantomJs, Rhino or AutoDetect. The default is AutoDetect, which uses Node if installed or otherwise falls back to Rhino.
npmPreferSystemInstalledNpm | Prefer detecting and using locally installed NPM when using a local engine that provides Node support. Defaults to true.
npmSubcommand | The subcommand that NPM should use i.e. Install, Update, Ci. Defaults to Update.

Expand Down Expand Up @@ -52,8 +52,6 @@ is found in the project's base directory then it will cause npm to run.

npm extracts its artifacts into the `node_modules` folder of a base directory and makes the contents available to sbt-web plugins as a whole. Note that sbt-js-engines loads the actual source code of npm via a WebJar and invokes an "npm update". Any external npm activity can therefore be performed interchangeably with sbt-js-engine in place.

> Note that the npm functionality requires JDK 7 when running Trireme given the additional file system support required. If JDK 6 is required then use Node as the engine.

# Releasing sbt-js-engine

1. Tag the release: `git tag -s 1.2.3`
Expand Down
5 changes: 1 addition & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,8 @@ libraryDependencies ++= Seq(
"org.specs2" %% "specs2-scalacheck" % "4.23.0" % "test",
"io.spray" %% "spray-json" % "1.3.6",

// Trireme
"io.apigee.trireme" % "trireme-core" % "0.9.4",
"io.apigee.trireme" % "trireme-node10src" % "0.9.4",

// NPM
// TODO: npm can finally be upgraded here
"org.webjars" % "npm" % "5.0.0-2", // we are currently stuck: https://github.com/webjars/webjars/issues/1926
"org.webjars" % "webjars-locator-core" % "0.59",

Expand Down
9 changes: 4 additions & 5 deletions src/main/scala/com/typesafe/sbt/jse/SbtJsEngine.scala
Original file line number Diff line number Diff line change
Expand Up @@ -18,11 +18,11 @@ object JsEngineImport {
object JsEngineKeys {

object EngineType extends Enumeration {
val CommonNode, Node, PhantomJs, Javax, Rhino, Trireme,
val CommonNode, Node, PhantomJs, Javax, Rhino,

/**
* Auto detect the best available engine to use for most common tasks - this will currently select node if
* available, otherwise it will fall back to trireme
* available, otherwise it will fall back to Rhino
*/
AutoDetect = Value
}
Expand Down Expand Up @@ -71,11 +71,10 @@ object SbtJsEngine extends AutoPlugin {
case EngineType.PhantomJs => PhantomJs(command)
case EngineType.Javax => JavaxEngine()
case EngineType.Rhino => Rhino()
case EngineType.Trireme => Trireme(stdEnvironment = env)
case EngineType.AutoDetect => if (autoDetectNode(command)) {
Node(command, stdEnvironment = env)
} else {
Trireme(stdEnvironment = env)
Rhino()
}
}
}
Expand All @@ -88,7 +87,7 @@ object SbtJsEngine extends AutoPlugin {
val nodeExists = Try(Process(s"${LocalEngine.path(command, "node")} --version").!!).isSuccess
if (!nodeExists) {
println("!!!")
println("Warning: node.js detection failed, sbt will use the Rhino based Trireme JavaScript engine instead to run JavaScript assets compilation, which in some cases may be orders of magnitude slower than using node.js.")
println("Warning: node.js detection failed, sbt will use the Rhino JavaScript engine instead to run JavaScript assets compilation, which in some cases may be orders of magnitude slower than using node.js.")
println("!!!")
}
nodeExists
Expand Down
78 changes: 0 additions & 78 deletions src/main/scala/com/typesafe/sbt/jse/engines/Trireme.scala

This file was deleted.

91 changes: 0 additions & 91 deletions src/test/scala/com/typesafe/sbt/jse/engines/TriremeSpec.scala

This file was deleted.

Loading