- * @param length the length
- * @return undefined.
- * @example fs.truncateSync(path, length)
- */
- def truncateSync(path: Buffer | FileDescriptor | String, length: Int): Unit = js.native
-
- /**
- * Asynchronous unlink(2). No arguments other than a possible exception are given to the completion callback.
- * @example fs.unlink(path, callback)
- */
- def unlink(path: Buffer | String, callback: FsCallback0): Unit = js.native
-
- /**
- * Synchronous unlink(2).
- * @return undefined.
- * @example fs.unlinkSync(path)
- */
- def unlinkSync(path: Buffer | String): Unit = js.native
-
- /**
- * Stop watching for changes on filename. If listener is specified, only that particular listener is removed.
- * Otherwise, all listeners are removed and you have effectively stopped watching filename.
- *
- * Calling fs.unwatchFile() with a filename that is not being watched is a no-op, not an error.
- *
- * Note: fs.watch() is more efficient than fs.watchFile() and fs.unwatchFile(). fs.watch() should be used instead of
- * fs.watchFile() and fs.unwatchFile() when possible.
- * @example fs.unwatchFile(filename[, listener])
- */
- def unwatchFile(filename: Buffer | String, listener: FsCallback0 = js.native): Unit = js.native
-
- /**
- * Change file timestamps of the file referenced by the supplied path.
- *
- * Note: the arguments atime and mtime of the following related functions does follow the below rules:
- *
- * If the value is a numberable string like '123456789', the value would get converted to corresponding number.
- * If the value is NaN or Infinity, the value would get converted to Date.now().
- * @example fs.utimes(path, atime, mtime, callback)
- */
- def utimes(path: Buffer | String, atime: Int, mtime: Int, callback: FsCallback0): Unit = js.native
-
- /**
- * Synchronous version of fs.utimes().
- * @return undefined.
- * @example fs.utimesSync(path, atime, mtime)
- */
- def utimesSync(path: Buffer | String, atime: Int, mtime: Int): Unit = js.native
-
- /**
- * Watch for changes on filename, where filename is either a file or a directory.
- * The returned object is a [[fs.FSWatcher]].
- *
- * The second argument is optional. If options is provided as a string, it specifies the encoding.
- * Otherwise options should be passed as an object.
- *
- * The listener callback gets two arguments (event, filename). event is either 'rename' or 'change', and filename
- * is the name of the file which triggered the event.
- * @param filename the filename (Buffer | String)
- * @param options the [[FSWatcherOptions optional settings]]
- * @param listener the callback function
- * @return a [[FSWatcher]]
- * @example fs.watch(filename[, options][, listener])
- */
- def watch(filename: Buffer | String,
- options: FSWatcherOptions | RawOptions,
- listener: js.Function2[EventType, String, Any]): FSWatcher = js.native
-
- /**
- * Watch for changes on filename, where filename is either a file or a directory.
- * The returned object is a [[fs.FSWatcher]].
- *
- * The second argument is optional. If options is provided as a string, it specifies the encoding.
- * Otherwise options should be passed as an object.
- *
- * The listener callback gets two arguments (event, filename). event is either 'rename' or 'change', and filename
- * is the name of the file which triggered the event.
- * @param filename the filename (Buffer | String)
- * @param listener the listener callback gets two arguments (eventType, filename).
- * eventType is either 'rename' or 'change',
- * and filename is the name of the file which triggered the event.
- * @return a [[FSWatcher]]
- * @example fs.watch(filename[, options][, listener])
- */
- def watch(filename: Buffer | String, listener: js.Function2[EventType, String, Any]): FSWatcher = js.native
-
- /**
- * Watch for changes on filename, where filename is either a file or a directory.
- * The returned object is a [[fs.FSWatcher]].
- *
- * The second argument is optional. If options is provided as a string, it specifies the encoding.
- * Otherwise options should be passed as an object.
- *
- * The listener callback gets two arguments (event, filename). event is either 'rename' or 'change', and filename
- * is the name of the file which triggered the event.
- * @param filename the filename (Buffer | String)
- * @param options the [[FSWatcherOptions optional settings]]
- * @return a [[FSWatcher]]
- * @example fs.watch(filename[, options][, listener])
- */
- def watch(filename: Buffer | String, options: FSWatcherOptions | RawOptions = js.native): FSWatcher = js.native
-
- /**
- * Watch for changes on filename. The callback listener will be called each time the file is accessed.
- *
- * The options argument may be omitted. If provided, it should be an object. The options object may contain
- * a boolean named persistent that indicates whether the process should continue to run as long as files are
- * being watched. The options object may specify an interval property indicating how often the target should
- * be polled in milliseconds. The default is { persistent: true, interval: 5007 }.
- * @param filename the filename (Buffer | String)
- * @param options the [[FSWatcherOptions optional settings]]
- * @param listener the callback
- */
- def watchFile(filename: Buffer | String,
- options: FileWatcherOptions | RawOptions,
- listener: FsCallback2[Stats, Stats]): Unit = js.native
-
- /**
- * Watch for changes on filename. The callback listener will be called each time the file is accessed.
- *
- * The options argument may be omitted. If provided, it should be an object. The options object may contain
- * a boolean named persistent that indicates whether the process should continue to run as long as files are
- * being watched. The options object may specify an interval property indicating how often the target should
- * be polled in milliseconds. The default is { persistent: true, interval: 5007 }.
- * @param filename the filename (Buffer | String)
- * @param listener the callback
- */
- def watchFile(filename: Buffer | String, listener: FsCallback2[Stats, Stats]): Unit = js.native
-
- /**
- * Write buffer to the file specified by fd.
- * Note: that it is unsafe to use fs.write multiple times on the same file without waiting for the callback.
- * For this scenario, fs.createWriteStream is strongly recommended.
- * On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the
- * position argument and always appends the data to the end of the file.
- * @param fd the file descriptor
- * @param buffer the buffer containing the data to write
- * @param offset determines the part of the buffer to be written, and length is an integer specifying
- * the number of bytes to write.
- * @param length the optional length of the data to write
- * @param position refers to the offset from the beginning of the file where this data should be written.
- * If typeof position !== 'number', the data will be written at the current position. See pwrite(2).
- * @param callback will be given three arguments (err, written, buffer) where written specifies how many
- * bytes were written from buffer.
- * @example {{{ fs.write(fd, buffer[, offset[, length[, position]]], callback) }}}
- **/
- def write(fd: FileDescriptor,
- buffer: Buffer | Uint8Array,
- offset: Integer = js.native,
- length: Integer = js.native,
- position: Integer = js.native,
- callback: FsCallback2[Int, Buffer]): Unit = js.native
-
- /**
- * Write buffer to the file specified by fd.
- * Note: that it is unsafe to use fs.write multiple times on the same file without waiting for the callback.
- * For this scenario, fs.createWriteStream is strongly recommended.
- * On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the
- * position argument and always appends the data to the end of the file.
- * @param fd the file descriptor
- * @param buffer the buffer containing the data to write
- * If typeof position !== 'number', the data will be written at the current position. See pwrite(2).
- * @param callback will be given three arguments (err, written, buffer) where written specifies how many
- * bytes were written from buffer.
- * @example {{{ fs.write(fd, buffer[, offset[, length[, position]]], callback) }}}
- **/
- def write(fd: FileDescriptor, buffer: Buffer | Uint8Array, callback: FsCallback2[Int, Buffer]): Unit = js.native
-
- /**
- * Write string to the file specified by fd. If string is not a string, then the value will be coerced to one.
- * Unlike when writing buffer, the entire string must be written. No substring may be specified.
- * This is because the byte offset of the resulting data may not be the same as the string offset.
- * Note that it is unsafe to use fs.write multiple times on the same file without waiting for the callback.
- * For this scenario, fs.createWriteStream is strongly recommended.
- * On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the
- * position argument and always appends the data to the end of the file.
- * @param fd the file descriptor
- * @param string the data to write
- * @param position refers to the offset from the beginning of the file where this data should be written.
- * If typeof position !== 'number' the data will be written at the current position. See pwrite(2).
- * @param encoding is the expected string encoding.
- * @param callback will receive the arguments (err, written, string) where written specifies how many bytes
- * the passed string required to be written. Note that bytes written is not the same as
- * string characters. See Buffer.byteLength.
- * @example {{{ fs.write(fd, string[, position[, encoding]], callback) }}}
- */
- def write(fd: FileDescriptor,
- string: String,
- position: Int,
- encoding: String,
- callback: FsCallback2[Int, String]): Unit = js.native
-
- /**
- * Write string to the file specified by fd. If string is not a string, then the value will be coerced to one.
- * Unlike when writing buffer, the entire string must be written. No substring may be specified.
- * This is because the byte offset of the resulting data may not be the same as the string offset.
- * Note that it is unsafe to use fs.write multiple times on the same file without waiting for the callback.
- * For this scenario, fs.createWriteStream is strongly recommended.
- * On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the
- * position argument and always appends the data to the end of the file.
- * @param fd the file descriptor
- * @param string the data to write
- * @param encoding is the expected string encoding.
- * @param callback will receive the arguments (err, written, string) where written specifies how many bytes
- * the passed string required to be written. Note that bytes written is not the same as
- * string characters. See Buffer.byteLength.
- * @example {{{ fs.write(fd, string[, position[, encoding]], callback) }}}
- */
- def write(fd: FileDescriptor, string: String, encoding: String, callback: FsCallback2[Int, String]): Unit = js.native
-
- /**
- * Write string to the file specified by fd. If string is not a string, then the value will be coerced to one.
- * Unlike when writing buffer, the entire string must be written. No substring may be specified.
- * This is because the byte offset of the resulting data may not be the same as the string offset.
- * Note that it is unsafe to use fs.write multiple times on the same file without waiting for the callback.
- * For this scenario, fs.createWriteStream is strongly recommended.
- * On Linux, positional writes don't work when the file is opened in append mode. The kernel ignores the
- * position argument and always appends the data to the end of the file.
- * @param fd the file descriptor
- * @param string the data to write
- * @param callback will receive the arguments (err, written, string) where written specifies how many bytes
- * the passed string required to be written. Note that bytes written is not the same as
- * string characters. See Buffer.byteLength.
- * @example {{{ fs.write(fd, string[, position[, encoding]], callback) }}}
- */
- def write(fd: FileDescriptor, string: String, callback: FsCallback2[Int, String]): Unit = js.native
-
- /**
- * Asynchronously writes data to a file, replacing the file if it already exists. data can be a string or a buffer.
- * The encoding option is ignored if data is a buffer. It defaults to 'utf8'
- * @example fs.writeFile(file, data[, options], callback)
- */
- def writeFile(file: String,
- data: Buffer | String,
- options: FileOutputOptions | RawOptions,
- callback: FsCallback0): Unit = js.native
-
- /**
- * Asynchronously writes data to a file, replacing the file if it already exists. data can be a string or a buffer.
- * The encoding option is ignored if data is a buffer. It defaults to 'utf8'
- * @example fs.writeFile(file, data[, options], callback)
- */
- def writeFile(file: String, data: Buffer | String, callback: FsCallback0): Unit = js.native
-
- /**
- * The synchronous version of fs.writeFile().
- * @return undefined.
- * @example fs.writeFileSync(file, data[, options])
- */
- def writeFileSync(file: String, data: Buffer | String, options: FileOutputOptions | RawOptions = js.native): Unit =
- js.native
-
- /**
- * Write buffer to the file specified by fd.
- * @param fd the given file descriptor
- * @param buffer the given [[Buffer buffer]]
- * @param offset determines the part of the buffer to be written, and length is an integer specifying
- * the number of bytes to write.
- * @param length the optional length of the data to write
- * @param position refers to the offset from the beginning of the file where this data should be written.
- * @example {{{ fs.writeSync(fd, buffer[, offset[, length[, position]]]) }}}
- */
- def writeSync(fd: FileDescriptor,
- buffer: Buffer | Uint8Array,
- offset: Int = js.native,
- length: Int = js.native,
- position: Int = js.native): Unit = js.native
-
- /**
- * Write buffer to the file specified by fd.
- * @param fd the given file descriptor
- * @param buffer the given [[Buffer buffer]]
- * @example {{{ fs.writeSync(fd, buffer[, offset[, length[, position]]]) }}}
- */
- def writeSync(fd: FileDescriptor, buffer: Buffer | Uint8Array): Unit = js.native
-
- /**
- * Write string to the file specified by fd.
- * @param fd the given file descriptor
- * @param data the given string
- * @param position refers to the offset from the beginning of the file where this data should be written.
- * @param encoding is the expected string encoding.
- * @example {{{ fs.writeSync(fd, string[, position[, encoding]]) }}}
- */
- def writeSync(fd: FileDescriptor, data: String, position: Int, encoding: String): Unit = js.native
-
- /**
- * Write string to the file specified by fd.
- * @param fd the given file descriptor
- * @param data the given string
- * @param position refers to the offset from the beginning of the file where this data should be written.
- * @example {{{ fs.writeSync(fd, string[, position[, encoding]]) }}}
- */
- def writeSync(fd: FileDescriptor, data: String, position: Int): Unit = js.native
-
- /**
- * Write string to the file specified by fd.
- * @param fd the given file descriptor
- * @param data the given string
- * @param encoding is the expected string encoding.
- * @example {{{ fs.writeSync(fd, string[, position[, encoding]]) }}}
- */
- def writeSync(fd: FileDescriptor, data: String, encoding: String): Unit = js.native
-
- /**
- * Write string to the file specified by fd.
- * @param fd the given file descriptor
- * @param data the given string
- * @example {{{ fs.writeSync(fd, string[, position[, encoding]]) }}}
- */
- def writeSync(fd: FileDescriptor, data: String): Unit = js.native
-
-}
-
-/**
- * File System Singleton
- * @author lawrence.daniels@gmail.com
- */
-@js.native
-@JSImport("fs", JSImport.Namespace)
-object Fs extends Fs
-
-/**
- * File Append Options
- * @author lawrence.daniels@gmail.com
- */
-class FileAppendOptions(val encoding: js.UndefOr[String] = js.undefined,
- val mode: js.UndefOr[FileMode] = js.undefined,
- val flag: js.UndefOr[String] = js.undefined)
- extends js.Object
-
-/**
- * File Encoding Options
- * @author lawrence.daniels@gmail.com
- */
-class FileEncodingOptions(val encoding: js.UndefOr[String] = js.undefined) extends js.Object
-
-/**
- * File Input Options
- * @author lawrence.daniels@gmail.com
- */
-class FileInputOptions(val flags: js.UndefOr[String] = js.undefined,
- val encoding: js.UndefOr[String] = js.undefined,
- val fd: js.UndefOr[FileDescriptor] = js.undefined,
- val mode: js.UndefOr[Int] = js.undefined,
- val autoClose: js.UndefOr[Boolean] = js.undefined,
- val start: js.UndefOr[Int] = js.undefined,
- val end: js.UndefOr[Int] = js.undefined)
- extends js.Object
-
-/**
- * File Input Options
- * @author lawrence.daniels@gmail.com
- */
-class FileOutputOptions(val flags: js.UndefOr[String] = js.undefined,
- val defaultEncoding: js.UndefOr[String] = js.undefined,
- val fd: js.UndefOr[FileDescriptor] = js.undefined,
- val mode: js.UndefOr[Int] = js.undefined,
- val autoClose: js.UndefOr[Boolean] = js.undefined,
- val start: js.UndefOr[Int] = js.undefined)
- extends js.Object
-
-/**
- * File Watcher Options
- * @param persistent
- * @param interval
- */
-class FileWatcherOptions(val persistent: js.UndefOr[Boolean] = js.undefined,
- val interval: js.UndefOr[Int] = js.undefined)
- extends js.Object
diff --git a/app/lts/src/main/scala/io/scalajs/nodejs/fs/package.scala b/app/lts/src/main/scala/io/scalajs/nodejs/fs/package.scala
deleted file mode 100644
index 37ea73115..000000000
--- a/app/lts/src/main/scala/io/scalajs/nodejs/fs/package.scala
+++ /dev/null
@@ -1,172 +0,0 @@
-package io.scalajs.nodejs
-
-import io.scalajs.RawOptions
-import io.scalajs.nodejs.buffer.Buffer
-import io.scalajs.util.PromiseHelper._
-
-import scala.concurrent.Future
-import scala.scalajs.js
-import scala.scalajs.js.typedarray.Uint8Array
-import scala.scalajs.js.|
-
-/**
- * fs package object
- * @author lawrence.daniels@gmail.com
- */
-package object fs {
-
- /////////////////////////////////////////////////////////////////////////////////
- // Implicit conversions and classes
- /////////////////////////////////////////////////////////////////////////////////
-
- /**
- * File System Extensions
- * @param fs the given [[Fs file system]] instance
- */
- final implicit class FsExtensions(val fs: Fs) extends AnyVal {
-
- @inline
- def accessFuture(path: Buffer | String, mode: FileMode = null): Future[Unit] = {
- promiseWithError0[FileIOError](fs.access(path, mode, _))
- }
-
- @inline
- def appendFileFuture(file: Buffer | FileDescriptor | String,
- data: Buffer | String,
- options: FileAppendOptions = null): Future[Unit] = {
- promiseWithError0[FileIOError](fs.appendFile(file, data, options, _))
- }
-
- @inline
- def chmodFuture(path: Buffer | String, mode: FileMode, callback: js.Function1[FileIOError, Any]): Future[Unit] = {
- promiseWithError0[FileIOError](fs.chmod(path, mode, _))
- }
-
- @inline
- def closeFuture(fd: FileDescriptor): Future[Unit] = promiseWithError0[FileIOError](fs.close(fd, _))
-
- @inline
- def existsFuture(path: String): Future[Boolean] = promiseWithErrorAsBoolean[FileIOError](fs.access(path, _))
-
- @inline
- def fdatasyncFuture(fd: FileDescriptor): Future[Unit] = promiseWithError0[FileIOError](fs.fdatasync(fd, _))
-
- @inline
- def futimesFuture(fd: FileDescriptor, atime: Integer, mtime: Integer): Future[Unit] = {
- promiseWithError0[FileIOError](fs.futimes(fd, atime, mtime, _))
- }
-
- @inline
- def lchmodFuture(path: Buffer | String, mode: FileMode): Future[Unit] = {
- promiseWithError0[FileIOError](fs.lchmod(path, mode, _))
- }
-
- @inline
- def lchownFuture(path: Buffer | String, uid: UID, gid: GID): Future[Unit] = {
- promiseWithError0[FileIOError](fs.lchown(path, uid, gid, _))
- }
-
- @inline
- def linkFuture(srcpath: Buffer | String, dstpath: Buffer | String): Future[Unit] = {
- promiseWithError0[FileIOError](fs.link(srcpath, dstpath, _))
- }
-
- @inline
- def mkdirFuture(path: Buffer | String, mode: FileMode = null): Future[Unit] = {
- promiseWithError0[FileIOError](fs.mkdir(path, mode, _))
- }
-
- @inline
- def openFuture(path: Buffer | String, flags: Flags, mode: FileMode = null): Future[FileDescriptor] = {
- promiseWithError1[FileIOError, FileDescriptor](fs.open(path, flags, mode, _))
- }
-
- @inline
- def readFuture(fd: FileDescriptor,
- buffer: Buffer,
- offset: Int,
- length: Int,
- position: Int): Future[(Int, Buffer)] = {
- promiseWithError2[FileIOError, Int, Buffer](Fs.read(fd, buffer, offset, length, position, _))
- }
-
- @inline
- def readdirFuture(path: Buffer | String,
- options: String | FileEncodingOptions | RawOptions = null): Future[js.Array[String]] = {
- promiseWithError1[FileIOError, js.Array[String]](fs.readdir(path, options, _))
- }
-
- @inline
- def readFileFuture(file: String, options: FileInputOptions = null): Future[js.Any] = {
- promiseWithError1[FileIOError, js.Any](fs.readFile(file, options, _))
- }
-
- @inline
- def renameFuture(oldPath: String, newPath: String): Future[Unit] = {
- promiseWithError0[FileIOError](fs.rename(oldPath, newPath, _))
- }
-
- @inline
- def realpathFuture(path: String, options: FileEncodingOptions = null): Future[String] = {
- promiseWithError1[FileIOError, String](fs.realpath(path, options, _))
- }
-
- @inline
- def rmdirFuture(path: Buffer | String): Future[Unit] = promiseWithError0[FileIOError](fs.rmdir(path, _))
-
- @inline
- def statFuture(path: String): Future[Stats] = promiseWithError1[FileIOError, Stats](fs.stat(path, _))
-
- @inline
- def symlinkFuture(target: Buffer | String, path: Buffer | String, `type`: String = null): Future[Unit] = {
- promiseWithError0[FileIOError](fs.symlink(target, path, `type`, _))
- }
-
- @inline
- def unlinkFuture(path: Buffer | String): Future[Unit] = promiseWithError0[FileIOError](fs.unlink(path, _))
-
- @inline
- def unwatchFileFuture(filename: Buffer | String): Future[Unit] =
- promiseWithError0[FileIOError](fs.unwatchFile(filename, _))
-
- @inline
- def utimesFuture(path: Buffer | String, atime: Int, mtime: Int): Future[Unit] =
- promiseWithError0[FileIOError](fs.utimes(path, atime, mtime, _))
-
- @inline
- def watchFuture(filename: String, options: FSWatcherOptions = null): Future[(String, String)] = {
- promiseCallback2[String, String](fs.watch(filename, options, _))
- }
-
- @inline
- def writeFuture(fd: FileDescriptor,
- buffer: Buffer | Uint8Array,
- offset: Integer = null,
- length: Integer = null,
- position: Integer = null): Future[(FileType, Buffer)] = {
- promiseWithError2[FileIOError, Int, Buffer](fs.write(fd, buffer, offset, length, position, _))
- }
-
- @inline
- def writeFuture(fd: FileDescriptor, string: String, position: Int, encoding: String): Future[(FileType, String)] = {
- promiseWithError2[FileIOError, Int, String](fs.write(fd, string, position, encoding, _))
- }
-
- @inline
- def writeFuture(fd: FileDescriptor, string: String, position: Int): Future[(FileType, String)] = {
- promiseWithError2[FileIOError, Int, String](fs.write(fd, string, position, null, _))
- }
-
- @inline
- def writeFuture(fd: FileDescriptor, string: String): Future[(FileType, String)] = {
- promiseWithError2[FileIOError, Int, String](fs.write(fd, string, _))
- }
-
- @inline
- def writeFileFuture(file: String, data: Buffer | String, options: FileOutputOptions = null): Future[Unit] = {
- promiseWithError0[FileIOError](fs.writeFile(file, data, options, _))
- }
-
- }
-
-}
diff --git a/app/lts/src/main/scala/io/scalajs/nodejs/url/URL.scala b/app/lts/src/main/scala/io/scalajs/nodejs/url/URL.scala
deleted file mode 100644
index 341a028cf..000000000
--- a/app/lts/src/main/scala/io/scalajs/nodejs/url/URL.scala
+++ /dev/null
@@ -1,95 +0,0 @@
-package io.scalajs.nodejs.url
-
-import io.scalajs.nodejs.events.IEventEmitter
-
-import scala.scalajs.js
-import scala.scalajs.js.annotation.JSImport
-
-/**
- * This module has utilities for URL resolution and parsing. Call require('url') to use it.
- * @see https://nodejs.org/api/url.html
- * @author lawrence.daniels@gmail.com
- */
-@js.native
-trait URL extends IEventEmitter {
-
- /**
- * Take a parsed URL object, and return a formatted URL string.
- * @example url.format(urlObj)
- * @since v0.1.25
- */
- def format(urlObj: URLObject): String = js.native
-
- /**
- * Take a URL string, and return an object.
- *
- * Pass true as the second argument to also parse the query string using the querystring module. If true then the
- * query property will always be assigned an object, and the search property will always be a (possibly empty)
- * string. If false then the query property will not be parsed or decoded. Defaults to false.
- *
- * Pass true as the third argument to treat //foo/bar as { host: 'foo', pathname: '/bar' } rather
- * than { pathname: '//foo/bar' }. Defaults to false.
- * @example url.parse(urlStr[, parseQueryString][, slashesDenoteHost])
- * @since v0.1.25
- */
- def parse(urlStr: String, parseQueryString: String, slashesDenoteHost: Boolean): URLObject = js.native
-
- /**
- * Take a URL string, and return an object.
- *
- * Pass true as the second argument to also parse the query string using the querystring module. If true then the
- * query property will always be assigned an object, and the search property will always be a (possibly empty)
- * string. If false then the query property will not be parsed or decoded. Defaults to false.
- *
- * Pass true as the third argument to treat //foo/bar as { host: 'foo', pathname: '/bar' } rather
- * than { pathname: '//foo/bar' }. Defaults to false.
- * @example url.parse(urlStr[, parseQueryString][, slashesDenoteHost])
- * @since v0.1.25
- */
- def parse(urlStr: String, parseQueryString: String): URLObject = js.native
-
- /**
- * Take a URL string, and return an object.
- *
- * Pass true as the second argument to also parse the query string using the querystring module. If true then the
- * query property will always be assigned an object, and the search property will always be a (possibly empty)
- * string. If false then the query property will not be parsed or decoded. Defaults to false.
- *
- * Pass true as the third argument to treat //foo/bar as { host: 'foo', pathname: '/bar' } rather
- * than { pathname: '//foo/bar' }. Defaults to false.
- * @example url.parse(urlStr[, parseQueryString][, slashesDenoteHost])
- */
- def parse(urlStr: String, slashesDenoteHost: Boolean): URLObject = js.native
-
- /**
- * Take a URL string, and return an object.
- *
- * Pass true as the second argument to also parse the query string using the querystring module. If true then the
- * query property will always be assigned an object, and the search property will always be a (possibly empty)
- * string. If false then the query property will not be parsed or decoded. Defaults to false.
- *
- * Pass true as the third argument to treat //foo/bar as { host: 'foo', pathname: '/bar' } rather
- * than { pathname: '//foo/bar' }. Defaults to false.
- * @example url.parse(urlStr[, parseQueryString][, slashesDenoteHost])
- */
- def parse(urlStr: String): URLObject = js.native
-
- /**
- * Take a base URL, and a href URL, and resolve them as a browser would for an anchor tag.
- * Examples:
- * url.resolve('/one/two/three', 'four') // '/one/two/four'
- * url.resolve('http://example.com/', '/one') // 'http://example.com/one'
- * url.resolve('http://example.com/one', '/two') // 'http://example.com/two'
- * @example url.resolve(from, to)
- */
- def resolve(from: String, to: String): String = js.native
-
-}
-
-/**
- * URL Singleton
- * @author lawrence.daniels@gmail.com
- */
-@js.native
-@JSImport("url", JSImport.Namespace)
-object URL extends URL
diff --git a/app/lts/src/main/scala/io/scalajs/nodejs/url/URLObject.scala b/app/lts/src/main/scala/io/scalajs/nodejs/url/URLObject.scala
deleted file mode 100644
index 20a454e63..000000000
--- a/app/lts/src/main/scala/io/scalajs/nodejs/url/URLObject.scala
+++ /dev/null
@@ -1,96 +0,0 @@
-package io.scalajs.nodejs.url
-
-import scala.scalajs.js
-
-/**
- * Parsed URL Object
- * @author lawrence.daniels@gmail.com
- */
-@js.native
-trait URLObject extends js.Object {
-
- /**
- * The auth property is the username and password portion of the URL, also referred to as "userinfo".
- * This string subset follows the protocol and double slashes (if present) and precedes the host component,
- * delimited by an ASCII "at sign" (@). The format of the string is {username}[:{password}], with
- * the [:{password}] portion being optional.
- * @example 'user:pass'
- */
- var auth: js.UndefOr[String] = js.native
-
- /**
- * The hash property consists of the "fragment" portion of the URL including the leading ASCII hash (#) character.
- * @example '#hash'
- */
- var hash: js.UndefOr[String] = js.native
-
- /**
- * The host property is the full lower-cased host portion of the URL, including the port if specified.
- * @example 'host.com:8080'
- */
- var host: js.UndefOr[String] = js.native
-
- /**
- * The hostname property is the lower-cased host name portion of the host component without the port included.
- * @example 'host.com'
- */
- var hostname: js.UndefOr[String] = js.native
-
- /**
- * The href property is the full URL string that was parsed with both the protocol and host components
- * converted to lower-case.
- * @example {{{ http://user:pass@host.com:8080/p/a/t/h?query=string#hash }}}
- */
- var href: js.UndefOr[String] = js.native
-
- /**
- * The path property is a concatenation of the pathname and search components.
- * @example '/p/a/t/h?query=string'
- */
- var path: js.UndefOr[String] = js.native
-
- /**
- * The pathname property consists of the entire path section of the URL. This is everything following the host
- * (including the port) and before the start of the query or hash components, delimited by either the ASCII
- * question mark (?) or hash (#) characters.
- * @example '/p/a/t/h'
- */
- var pathname: js.UndefOr[String] = js.native
-
- /**
- * The port property is the numeric port portion of the host component.
- * @example '8080'
- */
- var port: js.UndefOr[String] = js.native
-
- /**
- * The protocol property identifies the URL's lower-cased protocol scheme.
- * @example 'http:'
- */
- var protocol: js.UndefOr[String] = js.native
-
- /**
- * The query property is either the query string without the leading ASCII question mark (?), or an object returned
- * by the querystring module's parse() method. Whether the query property is a string or object is determined by the
- * parseQueryString argument passed to url.parse().
- *
- * If returned as a string, no decoding of the query string is performed. If returned as an object, both keys and
- * values are decoded.
- * @example 'query=string' or {'query': 'string'}
- */
- var query: js.UndefOr[String] = js.native
-
- /**
- * The search property consists of the entire "query string" portion of the URL, including the leading ASCII
- * question mark (?) character.
- * @example '?query=string'
- */
- var search: js.UndefOr[String] = js.native
-
- /**
- * The slashes property is a boolean with a value of true if two ASCII forward-slash characters (/) are required
- * following the colon in the protocol.
- */
- var slashes: js.UndefOr[Boolean] = js.native
-
-}
diff --git a/app/lts/src/test/resources/1.txt b/app/lts/src/test/resources/1.txt
deleted file mode 100644
index 5ab2f8a43..000000000
--- a/app/lts/src/test/resources/1.txt
+++ /dev/null
@@ -1 +0,0 @@
-Hello
\ No newline at end of file
diff --git a/app/lts/src/test/resources/fileA1.txt b/app/lts/src/test/resources/fileA1.txt
deleted file mode 100644
index 5e1c309da..000000000
--- a/app/lts/src/test/resources/fileA1.txt
+++ /dev/null
@@ -1 +0,0 @@
-Hello World
\ No newline at end of file
diff --git a/app/lts/src/test/resources/fileA2.txt b/app/lts/src/test/resources/fileA2.txt
deleted file mode 100644
index 5e1c309da..000000000
--- a/app/lts/src/test/resources/fileA2.txt
+++ /dev/null
@@ -1 +0,0 @@
-Hello World
\ No newline at end of file
diff --git a/app/lts/src/test/resources/fileB1.txt b/app/lts/src/test/resources/fileB1.txt
deleted file mode 100644
index 972263ed9..000000000
--- a/app/lts/src/test/resources/fileB1.txt
+++ /dev/null
@@ -1 +0,0 @@
-Goodbye Cruel World
\ No newline at end of file
diff --git a/app/lts/src/test/resources/fileB2.txt b/app/lts/src/test/resources/fileB2.txt
deleted file mode 100644
index 972263ed9..000000000
--- a/app/lts/src/test/resources/fileB2.txt
+++ /dev/null
@@ -1 +0,0 @@
-Goodbye Cruel World
\ No newline at end of file
diff --git a/app/lts/src/test/resources/watchfile.json b/app/lts/src/test/resources/watchfile.json
deleted file mode 100644
index 62b27ec83..000000000
--- a/app/lts/src/test/resources/watchfile.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "name": "scalajs-io",
- "version": "0.4.2",
- "private": true,
- "dependencies": {
- "async": "^2.0.1",
- "bcrypt": "^1.0.2",
- "bignum": "^0.12.5",
- "body-parser": "^1.15.0",
- "buffermaker": "^1.2.0",
- "cassandra-driver": "^3.0.2",
- "cheerio": "^0.22.0",
- "colors": "^1.1.2",
- "cookie": "^0.3.1",
- "cookie-parser": "^1.4.3",
- "csv-parse": "^1.1.3",
- "drama": "^0.1.3",
- "express": "^4.13.4",
- "express-csv": "^0.6.0",
- "express-ws": "^2.0.0-beta",
- "feedparser-promised": "^1.1.1",
- "gridfs-stream": "^1.1.1",
- "html": "^0.0.10",
- "html-to-json": "^0.6.0",
- "htmlparser2": "^3.9.2",
- "jquery": "^3.1.1",
- "jsdom": "^9.9.1",
- "jwt-simple": "^0.5.0",
- "kafka-node": "^1.3.0",
- "kafka-rest": "0.0.4",
- "md5": "^2.2.1",
- "memory-fs": "^0.3.0",
- "moment": "^2.17.1",
- "moment-timezone": "^0.5.11",
- "mongodb": "^2.1.18",
- "mysql": "^2.10.2",
- "node-embedded-mongodb": "^0.0.3",
- "node-zookeeper-client": "^0.2.2",
- "numeral": "^2.0.4",
- "oppressor": "0.0.1",
- "readline": "^1.3.0",
- "rx": "^4.1.0",
- "should": "^11.1.2",
- "socket.io": "^1.7.2",
- "source-map-support": "^0.4.14",
- "splitargs": "0.0.7",
- "tingodb": "^0.5.1",
- "transducers-js": "^0.4.174",
- "watch": "^0.18.0",
- "xml2js": "^0.4.17"
- }
-}
diff --git a/app/lts/src/test/scala/io/scalajs/nodejs/fs/FsAsyncTest.scala b/app/lts/src/test/scala/io/scalajs/nodejs/fs/FsAsyncTest.scala
deleted file mode 100644
index 4ef9a6522..000000000
--- a/app/lts/src/test/scala/io/scalajs/nodejs/fs/FsAsyncTest.scala
+++ /dev/null
@@ -1,44 +0,0 @@
-package io.scalajs.nodejs.fs
-
-import io.scalajs.nodejs.buffer.Buffer
-import org.scalatest.{AsyncFunSpec, BeforeAndAfterEach}
-
-import scala.concurrent.{ExecutionContext, Future}
-
-class FsAsyncTest extends AsyncFunSpec with BeforeAndAfterEach {
-
- private val file = "x.File.txt"
-
- override def afterEach(): Unit = {
- if (Fs.existsSync(file)) Fs.unlinkSync(file)
- }
-
- override implicit val executionContext = ExecutionContext.Implicits.global
-
- describe("Fs") {
- it("support basic operations") {
- for {
- _ <- Future.successful("")
- _ <- Fs.writeFileFuture(file, "content")
- exists <- Fs.existsFuture(file)
- readBuffer <- Fs.readFileFuture(file)
- _ <- Fs.unlinkFuture(file)
- existsAfterUnlink <- Fs.existsFuture(file)
- } yield {
- assert(exists)
- assert(readBuffer.asInstanceOf[Buffer].toString() == "content")
- assert(!existsAfterUnlink)
- }
- }
-
- describe("existsFuture") {
- it("should return false if not exist") {
- for {
- exists <- Fs.existsFuture(file)
- } yield {
- assert(!exists)
- }
- }
- }
- }
-}
diff --git a/app/lts/src/test/scala/io/scalajs/nodejs/fs/FsTest.scala b/app/lts/src/test/scala/io/scalajs/nodejs/fs/FsTest.scala
deleted file mode 100644
index e839d079c..000000000
--- a/app/lts/src/test/scala/io/scalajs/nodejs/fs/FsTest.scala
+++ /dev/null
@@ -1,77 +0,0 @@
-package io.scalajs.nodejs.fs
-
-import io.scalajs.JSON
-import io.scalajs.nodejs.setImmediate
-import io.scalajs.nodejs.util.Util
-import io.scalajs.util.ScalaJsHelper._
-import org.scalatest.FunSpec
-
-/**
- * File System (Fs) Tests
- * @author lawrence.daniels@gmail.com
- */
-class FsTest extends FunSpec {
-
- describe("Fs") {
-
- it("supports watching files") {
- val watcher = Fs.watch("./app/lts/src/test/resources/", (eventType, file) => {
- info(s"watcher: eventType = '$eventType' file = '$file'")
- })
- info(s"watcher: ${Util.inspect(watcher)}")
-
- setImmediate(
- () =>
- Fs.writeFile("./app/lts/src/test/resources/1.txt", "Hello", error => {
- if (isDefined(error)) {
- alert(s"error: ${JSON.stringify(error)}")
- }
- })
- )
- }
-
- it("should stream data") {
- val file1 = "./app/lts/src/test/resources/fileA1.txt"
- val file2 = "./app/lts/src/test/resources/fileA2.txt"
- val file3 = "./app/lts/src/test/resources/fileC2.txt"
-
- val readable = Fs.createReadStream(file1)
- val writable = Fs.createWriteStream(file2)
- readable.setEncoding("utf8")
- readable.onData[String](chunk => writable.write(chunk))
- writable.onFinish { () =>
- info("Comparing file sizes:")
- info(s"$file1 is ${Fs.statSync(file1).size} bytes")
- info(s"$file2 is ${Fs.statSync(file2).size} bytes")
- assert(Fs.statSync(file1).size == Fs.statSync(file2).size)
-
- info("should rename the file")
- Fs.renameSync(file2, file3)
- assert(Fs.statSync(file2).isFile())
-
- info("should delete the file")
- Fs.unlinkSync(file3)
- val deleted = !Fs.existsSync(file3)
- info(s"deleted? $deleted")
- assert(deleted)
- }
- }
-
- it("should pipe data from a Readable to a Writable") {
- val file1 = "./app/lts/src/test/resources/fileB1.txt"
- val file2 = "./app/lts/src/test/resources/fileB2.txt"
-
- val readable = Fs.createReadStream(file1)
- val writable = Fs.createWriteStream(file2)
- readable.pipe(writable)
- writable.onFinish { () =>
- info("Comparing file sizes:")
- info(s"$file1 is ${Fs.statSync(file1).size} bytes")
- info(s"$file2 is ${Fs.statSync(file2).size} bytes")
- assert(Fs.statSync(file1).size == Fs.statSync(file2).size)
- }
- }
-
- }
-
-}
diff --git a/app/lts/src/test/scala/io/scalajs/nodejs/url/URLObjectTest.scala b/app/lts/src/test/scala/io/scalajs/nodejs/url/URLObjectTest.scala
deleted file mode 100644
index a50d4ec74..000000000
--- a/app/lts/src/test/scala/io/scalajs/nodejs/url/URLObjectTest.scala
+++ /dev/null
@@ -1,38 +0,0 @@
-package io.scalajs.nodejs.url
-
-import io.scalajs.util.JSONHelper._
-import io.scalajs.util.JsUnderOrHelper._
-import org.scalatest.FunSpec
-
-/**
- * URLObject Tests
- * @author lawrence.daniels@gmail.com
- */
-class URLObjectTest extends FunSpec {
-
- describe("URLObject") {
-
- val originalUrl = "https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=node"
- val urlObject = URL.parse(originalUrl)
-
- it("should break down URLs into components") {
- assert(
- urlObject.toJson == """{"protocol":"https:","slashes":true,"auth":null,"host":"www.google.com","port":null,"hostname":"www.google.com","hash":"#q=node","search":"?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8","query":"sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8","pathname":"/webhp","path":"/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8","href":"https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=node"}"""
- )
- }
-
- it("should be properly extracted") {
- assert(urlObject.query ?== "sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8")
- }
-
- it("should properly extract the search query") {
- assert(urlObject.search ?== "?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8")
- }
-
- it("should reconstituted the URL to match the original") {
- assert(URL.format(urlObject) == originalUrl)
- }
-
- }
-
-}
diff --git a/app/lts/src/test/scala/io/scalajs/nodejs/url/URLTest.scala b/app/lts/src/test/scala/io/scalajs/nodejs/url/URLTest.scala
deleted file mode 100644
index e0706883d..000000000
--- a/app/lts/src/test/scala/io/scalajs/nodejs/url/URLTest.scala
+++ /dev/null
@@ -1,39 +0,0 @@
-package io.scalajs.nodejs
-package url
-
-import io.scalajs.util.JSONHelper._
-import io.scalajs.util.JsUnderOrHelper._
-import org.scalatest._
-
-/**
- * URL Tests
- * @author lawrence.daniels@gmail.com
- */
-class URLTest extends FunSpec {
-
- describe("URL") {
-
- val originalUrl = "https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=node"
- val parsedUrl = URL.parse(originalUrl)
-
- it("should break down URLs into components") {
- assert(
- parsedUrl.toJson == """{"protocol":"https:","slashes":true,"auth":null,"host":"www.google.com","port":null,"hostname":"www.google.com","hash":"#q=node","search":"?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8","query":"sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8","pathname":"/webhp","path":"/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8","href":"https://www.google.com/webhp?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8#q=node"}"""
- )
- }
-
- it("should be properly extracted") {
- assert(parsedUrl.query ?== "sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8")
- }
-
- it("should properly extract the search query") {
- assert(parsedUrl.search ?== "?sourceid=chrome-instant&ion=1&espv=2&ie=UTF-8")
- }
-
- it("should reconstituted the URL to match the original") {
- assert(URL.format(parsedUrl) == originalUrl)
- }
-
- }
-
-}
diff --git a/build.sbt b/build.sbt
index 54c4a4c8c..e4a5c12e2 100644
--- a/build.sbt
+++ b/build.sbt
@@ -56,8 +56,8 @@ lazy val core = (project in file("./core"))
)
lazy val root = (project in file("."))
- .aggregate(core, common, current, lts)
- .dependsOn(core, common, current, lts)
+ .aggregate(core, common, current)
+ .dependsOn(core, common, current)
.enablePlugins(ScalaJSPlugin)
.settings(commonSettings)
.settings(commonScalaJsSettings)
@@ -117,26 +117,6 @@ lazy val current = (project in file("./app/current"))
.settings(commonMacroParadiseSetting)
.dependsOn(core)
-lazy val lts = (project in file("./app/lts"))
- .dependsOn(common)
- .enablePlugins(ScalaJSPlugin)
- .settings(commonSettings)
- .settings(commonScalaJsSettings)
- .settings(
- name := "nodejs-lts",
- version := apiVersion,
- organization := "io.scalajs",
- description := "NodeJS LTS v6.11.4 API for Scala.js",
- homepage := Some(url("https://github.com/scalajs-io/nodejs")),
- libraryDependencies ++= Seq(
- "org.scala-lang" % "scala-reflect" % scalaVersion.value,
- "org.scalactic" %% "scalactic" % scalacticVersion,
- "org.scalatest" %%% "scalatest" % scalatestVersion % "test"
- )
- )
- .settings(commonMacroParadiseSetting)
- .dependsOn(core)
-
lazy val publishingSettings = Seq(
sonatypeProfileName := "org.xerial",
publishMavenStyle := true,