Skip to content
This repository was archived by the owner on Jul 30, 2024. It is now read-only.

Drop Node.js v8 support #144

Merged
merged 4 commits into from
Jan 2, 2020
Merged
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
8 changes: 2 additions & 6 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,22 +13,18 @@ env:
- TRAVIS_NODE_VERSION="12.10.0" JOB_NAME="test"

script:
- sbt ++$TRAVIS_SCALA_VERSION nodejs_v8/test nodejs_v10/test current/test
- sbt ++$TRAVIS_SCALA_VERSION test

matrix:
include:
- scala: 2.13.1
jdk: openjdk11
env: TRAVIS_NODE_VERSION="12.14.0" JOB_NAME="format and doc"
script: sbt ++$TRAVIS_SCALA_VERSION scalafmtSbtCheck scalafmtCheck test:scalafmtCheck current/doc core/doc
- scala: 2.13.1
jdk: openjdk11
env: TRAVIS_NODE_VERSION="8.17.0" JOB_NAME="test"
script: sbt ++$TRAVIS_SCALA_VERSION nodejs_v8/test
- scala: 2.13.1
jdk: openjdk11
env: TRAVIS_NODE_VERSION="10.18.0" JOB_NAME="test"
script: sbt ++$TRAVIS_SCALA_VERSION nodejs_v8/test nodejs_v10/test
script: sbt ++$TRAVIS_SCALA_VERSION nodejs_v10/test

install:
- rm -rf ~/.nvm &&
Expand Down
4 changes: 0 additions & 4 deletions app/current/src/main/scala/io/scalajs/nodejs/Assert.scala
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.scalajs.nodejs

import com.thoughtworks.enableIf
import io.scalajs.nodejs.events.IEventEmitter

import scala.scalajs.js
Expand Down Expand Up @@ -32,7 +31,6 @@ trait Assert extends IEventEmitter {
*/
def deepStrictEqual(actual: js.Any, expected: js.Any, message: String = js.native): Unit = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def doesNotReject(asyncFn: js.Function | js.Promise[_],
error: js.RegExp | js.Function = js.native,
message: String = js.native): Unit = js.native
Expand Down Expand Up @@ -100,7 +98,6 @@ trait Assert extends IEventEmitter {
error: js.RegExp | js.Function | js.Object | Error,
message: String = js.native): Unit = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def rejects(asyncFn: js.Function | js.Promise[_],
error: js.RegExp | js.Function | js.Object | Error = js.native,
message: String = js.native): Unit = js.native
Expand All @@ -112,6 +109,5 @@ trait Assert extends IEventEmitter {
@js.native
@JSImport("assert", JSImport.Namespace)
object Assert extends Assert {
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
val strict: Assert = js.native
}
1 change: 0 additions & 1 deletion app/current/src/main/scala/io/scalajs/nodejs/Module.scala
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ trait Module extends js.Object {
@js.native
@JSImport("module", JSImport.Namespace)
object Module extends Module {
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
var builtinModules: js.Array[String] = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.scalajs.nodejs.cluster

import com.thoughtworks.enableIf
import io.scalajs.nodejs.{GID, UID}

import scala.scalajs.js
Expand Down Expand Up @@ -34,10 +33,8 @@ trait ClusterSettings extends js.Object {

var inspectPort: Int | js.Function = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
var cwd: String = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
var windowsHide: Boolean = js.native
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.scalajs.nodejs.console_module

import com.thoughtworks.enableIf
import io.scalajs.nodejs.stream.IWritable

import scala.scalajs.js
Expand Down Expand Up @@ -144,7 +143,6 @@ class Console protected () extends js.Object {
* @param tabularData
* @param properties Alternate properties for constructing the table.
*/
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def table(tabularData: js.Any, properties: js.Array[String] = js.native): Unit = js.native

/**
Expand All @@ -164,7 +162,6 @@ class Console protected () extends js.Object {
/**
* Stops a timer that was previously started by calling [[time()]] and prints the result to `.stdout`.`
*/
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def timeLog(label: String, data: js.Any*): Unit = js.native

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.scalajs.nodejs.crypto

import com.thoughtworks.enableIf
import io.scalajs.nodejs.buffer.Buffer

import scala.scalajs.js
Expand All @@ -18,12 +17,9 @@ class Certificate extends js.Object {
@js.native
@JSImport("crypto", "Certificate")
object Certificate extends js.Object {
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def exportChallenge(spkac: String | BufferLike): Buffer = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def exportPublicKey(spkac: String | BufferLike, encoding: String = js.native): Buffer = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def verifySpkac(spkac: BufferLike): Boolean = js.native
}
22 changes: 2 additions & 20 deletions app/current/src/main/scala/io/scalajs/nodejs/crypto/Crypto.scala
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ trait Crypto extends js.Object {
@deprecated("Use crypto.createCipheriv() instead.", "Node.js v10.0")
def createCipher(algorithm: String, password: Buffer | String): Cipher = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def createCipheriv(algorithm: String,
key: String | BufferLike,
iv: String | BufferLike,
Expand All @@ -76,17 +75,15 @@ trait Crypto extends js.Object {
*/
@deprecated("Use crypto.createDecipheriv() instead.", "Node.js v10.0")
def createDecipher(algorithm: String, password: Buffer | String): Decipher = js.native
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)

def createDecipheriv(algorithm: String,
key: String | BufferLike,
iv: String | BufferLike,
options: TransformOptions = js.native): Decipher = js.native
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12)
def createDecipheriv(algorithm: String,
key: KeyObject,
iv: String | BufferLike,
options: TransformOptions): Decipher = js.native
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12)
options: TransformOptions): Decipher = js.native
def createDecipheriv(algorithm: String, key: KeyObject, iv: String | BufferLike): Decipher = js.native

def createDiffieHellman(prime: String, primeEncoding: String, generator: Int | BufferLike): DiffieHellman = js.native
Expand Down Expand Up @@ -151,14 +148,12 @@ trait Crypto extends js.Object {
*/
def createVerify(algorithm: String, options: WritableOptions = js.native): Verify = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def generateKeyPair(
`type`: String,
options: GenerateKeyPairOptions,
callback: Callback2[String | Buffer | KeyObject, String | Buffer | KeyObject]
): Unit = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def generateKeyPairSync(`type`: String, options: GenerateKeyPairOptions): KeyPair = js.native

/**
Expand All @@ -171,7 +166,6 @@ trait Crypto extends js.Object {

def getDiffieHellman(groupName: String): DiffieHellmanGroup = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def getFips(): Boolean = js.native

def getHashes(): js.Array[String] = js.native
Expand Down Expand Up @@ -227,16 +221,12 @@ trait Crypto extends js.Object {
def randomFillSync(buffer: Buffer, offset: Int): Buffer = js.native
def randomFillSync(buffer: Buffer): Buffer = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def randomFillSync(buffer: scala.scalajs.js.typedarray.DataView,
offset: Int,
size: Int): scala.scalajs.js.typedarray.DataView = js.native
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def randomFillSync(buffer: scala.scalajs.js.typedarray.DataView, offset: Int): scala.scalajs.js.typedarray.DataView =
js.native
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def randomFillSync(buffer: scala.scalajs.js.typedarray.DataView): scala.scalajs.js.typedarray.DataView = js.native
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def randomFillSync[T <: scala.scalajs.js.typedarray.TypedArray[_, T]](buffer: T,
offset: Int = js.native,
size: Int = js.native): T = js.native
Expand All @@ -245,44 +235,36 @@ trait Crypto extends js.Object {
def randomFill(buffer: Buffer, offset: Int, callback: Callback1[Buffer]): Buffer = js.native
def randomFill(buffer: Buffer, callback: Callback1[Buffer]): Buffer = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def randomFill(buffer: scala.scalajs.js.typedarray.DataView,
offset: Int,
size: Int,
callback: Callback1[scala.scalajs.js.typedarray.DataView]): scala.scalajs.js.typedarray.DataView =
js.native
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def randomFill(buffer: scala.scalajs.js.typedarray.DataView,
offset: Int,
callback: Callback1[scala.scalajs.js.typedarray.DataView]): scala.scalajs.js.typedarray.DataView =
js.native
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def randomFill(buffer: scala.scalajs.js.typedarray.DataView,
callback: Callback1[scala.scalajs.js.typedarray.DataView]): scala.scalajs.js.typedarray.DataView =
js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def randomFill[T <: scala.scalajs.js.typedarray.TypedArray[_, T]](buffer: T,
offset: Int = js.native,
size: Int = js.native,
callback: Callback1[T]): T = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def scrypt(password: String | BufferLike,
salt: String | BufferLike,
keylen: Int,
options: ScryptOptions = js.native,
callback: Callback1[Buffer]): Unit = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def scryptSync(password: String | BufferLike,
salt: String | BufferLike,
keylen: Int,
options: ScryptOptions = js.native): Buffer = js.native

def setEngine(engine: String, fips: Int = js.native): Unit = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def setFips(enable: Boolean): Unit = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs12)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.scalajs.nodejs.crypto

import com.thoughtworks.enableMembersIf
import io.scalajs.nodejs.buffer.Buffer

import scala.scalajs.js
Expand Down Expand Up @@ -31,7 +30,6 @@ trait ECDH extends js.Object {
}

@js.native
@enableMembersIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
@JSImport("crypto", "ECDH")
object ECDH extends js.Object {
def convertKey(key: String, curve: String, inputEncoding: String, outputEncoding: String, format: String): String =
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,9 @@
package io.scalajs.nodejs.dns

import com.thoughtworks.enableMembersIf

import scala.scalajs.js
import scala.scalajs.js.annotation.JSImport

@js.native
@enableMembersIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
@JSImport("dns", "promises.Resolver")
class PromisesResolver extends js.Object {
def getServers(): js.Array[String] = js.native
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,6 @@ trait IEventEmitter extends js.Object {
*/
def listeners(eventName: String): js.Array[js.Function] = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def off(eventName: String, listner: js.Function): this.type = js.native

/**
Expand Down Expand Up @@ -131,7 +130,6 @@ trait IEventEmitter extends js.Object {
*/
def setMaxListeners(n: Int): this.type = js.native

@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
def rawListeners(eventName: String): js.Array[js.Function] = js.native
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package io.scalajs.nodejs
package fs

import com.thoughtworks.enableIf

import scala.scalajs.js

/**
Expand Down Expand Up @@ -194,9 +192,7 @@ trait FSConstants extends js.Object {
/////////////////////////////////////////////////////////////////////////////////
// File Copy Constants
/////////////////////////////////////////////////////////////////////////////////
val COPYFILE_EXCL: Int = js.native
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
val COPYFILE_FICLONE: Int = js.native
@enableIf(io.scalajs.nodejs.internal.CompilerSwitches.gteNodeJs10)
val COPYFILE_EXCL: Int = js.native
val COPYFILE_FICLONE: Int = js.native
val COPYFILE_FICLONE_FORCE: Int = js.native
}
Loading