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

Commit 4983187

Browse files
author
TATSUNO Yasuhiro
authored
Merge pull request #9 from exoego/publish
Publish for Scala 2.12 and 2.13
2 parents f8adeeb + 41e2874 commit 4983187

File tree

7 files changed

+134
-144
lines changed

7 files changed

+134
-144
lines changed

.jvmopts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
-Xss4M
2+
-Xmx2G
3+
-XX:MaxMetaspaceSize=1G
4+
-XX:+CMSClassUnloadingEnabled

README.md

Lines changed: 44 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,53 +1,60 @@
11
This is a complete Scala.js facade for Node.js for Scala 2.12 and 2.13.
2-
A fork of https://github.com/scalajs-io/nodejs to sustain the project.
3-
4-
## Build Requirements
5-
6-
* [SBT 1.3.x] (http://www.scala-sbt.org/download.html)
7-
* JDK 8 or JDK 11
82

93
## Features
104

115
The Node.js integration is nearly complete (feature for feature), and should be more than sufficient for most web-based
126
and CLI applications.
137

14-
### Supported Modules
8+
## How to use
159

16-
The following core Node.js modules (v8.7.0) have been implemented:
10+
Add below line to your SBT project.
1711

18-
| Node Module | Description |
19-
|-----------------------|---------------------------------------------------------------------------------|
20-
| assert | Provides a simple set of assertion tests that can be used to test invariants. |
21-
| buffer | The Buffer class was introduced as part of the Node.js API to make it possible to interact with octet streams in the context of things like TCP streams and file system operations. |
22-
| child_process | The child_process module provides the ability to spawn child processes. |
23-
| cluster | The cluster module allows you to easily create child processes that all share server ports. |
24-
| crypto | The crypto module provides cryptographic functionality that includes a set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign and verify functions.|
25-
| dns | Support for DNS queries. |
26-
| events | Node.js Events Interface |
27-
| fs | File I/O is provided by simple wrappers around standard POSIX functions. |
28-
| http | Node.js HTTP Interface |
29-
| https | Node.js HTTPS Interface |
30-
| net | The net module provides you with an asynchronous network wrapper. |
31-
| os | Provides a few basic operating-system related utility functions. |
32-
| path | This module contains utilities for handling and transforming file paths. |
33-
| querystring | The querystring module provides utilities for parsing and formatting URL query strings. |
34-
| readline | Readline allows reading of a stream on a line-by-line basis. |
35-
| repl | The REPL provides a way to interactively run JavaScript and see the results. |
36-
| stream | A stream is an abstract interface implemented by various objects in Node.js. |
37-
| string-decoder | The string_decoder module provides an API for decoding Buffer objects into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 characters. |
38-
| timers | The timer module exposes a global API for scheduling functions to be called at some future period of time. |
39-
| tty | The tty module provides the tty.ReadStream and tty.WriteStream classes. |
40-
| url | The url module provides utilities for URL resolution and parsing. |
41-
| util | The util module is primarily designed to support the needs of Node.js's internal APIs.|
42-
| vm | The vm module provides APIs for compiling and running code within V8 Virtual Machine contexts.|
43-
| zlib | This provides bindings to Gzip/Gunzip, Deflate/Inflate, and DeflateRaw/InflateRaw classes. |
12+
```sbt
13+
libraryDependencies += "net.exoego" %%% "scala-js-nodejs-v8" % "0.8.0"
14+
```
4415

45-
## How to use
16+
## Support matrix
17+
18+
| | ScalaJS 0.6.28+ | ScalaJS 1.x |
19+
| ---------- | :----------------: | :------------: |
20+
| Scala 2.13 | :heavy_check_mark: | :construction: |
21+
| Scala 2.12 | :heavy_check_mark: | :construction: |
22+
| Scala 2.11 | N/A | N/A |
23+
| Scala 2.10 | N/A | N/A |
4624

47-
**TBD**: Not published yet.
25+
- :heavy_check_mark: Supported
26+
- :construction: Not supported but planned
4827

49-
See https://github.com/exoego/scala-js-nodejs/issues/3
28+
### Supported Modules
29+
30+
The following core Node.js modules (v8.7.0) have been implemented:
5031

32+
| Node Module | Description |
33+
| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
34+
| assert | Provides a simple set of assertion tests that can be used to test invariants. |
35+
| buffer | The Buffer class was introduced as part of the Node.js API to make it possible to interact with octet streams in the context of things like TCP streams and file system operations. |
36+
| child_process | The child_process module provides the ability to spawn child processes. |
37+
| cluster | The cluster module allows you to easily create child processes that all share server ports. |
38+
| crypto | The crypto module provides cryptographic functionality that includes a set of wrappers for OpenSSL's hash, HMAC, cipher, decipher, sign and verify functions. |
39+
| dns | Support for DNS queries. |
40+
| events | Node.js Events Interface |
41+
| fs | File I/O is provided by simple wrappers around standard POSIX functions. |
42+
| http | Node.js HTTP Interface |
43+
| https | Node.js HTTPS Interface |
44+
| net | The net module provides you with an asynchronous network wrapper. |
45+
| os | Provides a few basic operating-system related utility functions. |
46+
| path | This module contains utilities for handling and transforming file paths. |
47+
| querystring | The querystring module provides utilities for parsing and formatting URL query strings. |
48+
| readline | Readline allows reading of a stream on a line-by-line basis. |
49+
| repl | The REPL provides a way to interactively run JavaScript and see the results. |
50+
| stream | A stream is an abstract interface implemented by various objects in Node.js. |
51+
| string-decoder | The string_decoder module provides an API for decoding Buffer objects into strings in a manner that preserves encoded multi-byte UTF-8 and UTF-16 characters. |
52+
| timers | The timer module exposes a global API for scheduling functions to be called at some future period of time. |
53+
| tty | The tty module provides the tty.ReadStream and tty.WriteStream classes. |
54+
| url | The url module provides utilities for URL resolution and parsing. |
55+
| util | The util module is primarily designed to support the needs of Node.js's internal APIs. |
56+
| vm | The vm module provides APIs for compiling and running code within V8 Virtual Machine contexts. |
57+
| zlib | This provides bindings to Gzip/Gunzip, Deflate/Inflate, and DeflateRaw/InflateRaw classes. |
5158

5259
## Example of code
5360

build.sbt

Lines changed: 69 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,15 @@
1-
val scalaJsIOVersion = "0.4.3"
2-
val apiVersion = scalaJsIOVersion
1+
import sbt.url
2+
import sbtrelease.ReleaseStateTransformations._
3+
34
val scala212Version = "2.12.8"
45
val scala213Version = "2.13.0"
56
val supportedScalaVersion = Seq(scala212Version, scala213Version)
67

78
val scalatestVersion = "3.0.8"
89
val scalacticVersion = "3.0.8"
910

11+
organization in ThisBuild := "net.exoego"
12+
1013
lazy val commonSettings = Seq(
1114
autoCompilerPlugins := true,
1215
crossScalaVersions := supportedScalaVersion,
@@ -39,19 +42,28 @@ lazy val commonMacroParadiseSetting = Seq(
3942
}
4043
}
4144
)
45+
val nonPublishingSetting = Seq(
46+
publishArtifact := false,
47+
publish := {},
48+
publishLocal := {}
49+
)
4250

4351
lazy val root = (project in file("."))
4452
.aggregate(core, common, nodejs_v8)
53+
.settings(commonSettings)
54+
.settings(publishingSettings)
55+
.settings(nonPublishingSetting)
56+
.settings(
57+
name := "scala-js-nodejs-all"
58+
)
4559

4660
lazy val core = (project in file("./core"))
4761
.enablePlugins(ScalaJSPlugin)
4862
.settings(commonSettings)
4963
.settings(commonScalaJsSettings)
64+
.settings(publishingSettings)
5065
.settings(
51-
name := "core",
52-
organization := "io.scalajs",
53-
description := "Core utilities for the ScalaJs.io platform",
54-
version := apiVersion,
66+
name := "scala-js-nodejs-core",
5567
libraryDependencies ++= Seq(
5668
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
5769
"org.scalatest" %%% "scalatest" % scalatestVersion % "test"
@@ -62,78 +74,85 @@ lazy val common = (project in file("./app/common"))
6274
.enablePlugins(ScalaJSPlugin)
6375
.settings(commonSettings)
6476
.settings(commonScalaJsSettings)
77+
.settings(commonMacroParadiseSetting)
78+
.settings(publishingSettings)
6579
.settings(
66-
name := "nodejs-common",
67-
version := apiVersion,
68-
organization := "io.scalajs",
69-
description := "NodeJS common API",
70-
homepage := Some(url("https://github.com/scalajs-io/nodejs")),
80+
name := "scala-js-nodejs-common",
7181
libraryDependencies ++= Seq(
7282
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
7383
"org.scalactic" %% "scalactic" % scalacticVersion,
7484
"org.scalatest" %%% "scalatest" % scalatestVersion % "test"
7585
)
7686
)
77-
.settings(commonMacroParadiseSetting)
7887
.dependsOn(core)
7988

8089
lazy val nodejs_v8 = (project in file("./app/nodejs_v8"))
8190
.dependsOn(common)
8291
.enablePlugins(ScalaJSPlugin)
8392
.settings(commonSettings)
8493
.settings(commonScalaJsSettings)
94+
.settings(commonMacroParadiseSetting)
95+
.settings(publishingSettings)
8596
.settings(
86-
name := "nodejs",
87-
version := apiVersion,
88-
organization := "io.scalajs",
97+
name := "scala-js-nodejs-v8",
8998
description := "NodeJS v8.7.0 API for Scala.js",
90-
homepage := Some(url("https://github.com/scalajs-io/nodejs")),
99+
homepage := Some(url("https://github.com/exoego/scala-js-nodejs")),
91100
libraryDependencies ++= Seq(
92101
"org.scala-lang" % "scala-reflect" % scalaVersion.value,
93102
"org.scalactic" %% "scalactic" % scalacticVersion,
94103
"org.scalatest" %%% "scalatest" % scalatestVersion % "test"
95104
)
96105
)
97-
.settings(commonMacroParadiseSetting)
98106
.dependsOn(core)
99107

100108
lazy val publishingSettings = Seq(
101-
sonatypeProfileName := "org.xerial",
109+
licenses := Seq("APL2" -> url("http://www.apache.org/licenses/LICENSE-2.0.txt")),
110+
scmInfo := Some(
111+
ScmInfo(
112+
url("https://github.com/exoego/scala-js-nodejs"),
113+
"scm:git:[email protected]:exoego/scala-js-nodejs.git"
114+
)
115+
),
116+
homepage := scmInfo.value.map(_.browseUrl),
117+
developers := List(
118+
Developer(
119+
id = "exoego",
120+
name = "TATSUNO Yasuhiro",
121+
email = "[email protected]",
122+
url = url("https://www.exoego.net")
123+
)
124+
),
102125
publishMavenStyle := true,
103-
publishTo := {
104-
val nexus = "https://oss.sonatype.org/"
126+
publishArtifact in Test := false,
127+
publishArtifact in (Compile, packageDoc) := true,
128+
publishArtifact in (Compile, packageSrc) := true,
129+
publishArtifact in packageDoc := false,
130+
pomIncludeRepository := { _ =>
131+
false
132+
},
133+
publishTo := Some(
105134
if (isSnapshot.value)
106-
Some("snapshots" at nexus + "content/repositories/snapshots")
135+
Opts.resolver.sonatypeSnapshots
107136
else
108-
Some("releases" at nexus + "service/local/staging/deploy/maven2")
109-
},
110-
pomExtra :=
111-
<url>https://github.com/scalajs-io/nodejs</url>
112-
<licenses>
113-
<license>
114-
<name>MIT License</name>
115-
<url>http://www.opensource.org/licenses/mit-license.php</url>
116-
</license>
117-
</licenses>
118-
<scm>
119-
<connection>scm:git:github.com/scalajs-io/nodejs.git</connection>
120-
<developerConnection>scm:git:git@github.com:scalajs-io/nodejs.git</developerConnection>
121-
<url>github.com/scalajs-io/nodejs.git</url>
122-
</scm>
123-
<developers>
124-
<developer>
125-
<id>scalajs-io</id>
126-
<name>Lawrence Daniels</name>
127-
<email>lawrence.daniels@gmail.com</email>
128-
<organization>io.scalajs</organization>
129-
<organizationUrl>https://github.com/scalajs-io</organizationUrl>
130-
<roles>
131-
<role>Project-Administrator</role>
132-
<role>Developer</role>
133-
</roles>
134-
<timezone>+7</timezone>
135-
</developer>
136-
</developers>
137+
Opts.resolver.sonatypeStaging
138+
),
139+
publishConfiguration := publishConfiguration.value.withOverwrite(false),
140+
publishLocalConfiguration := publishLocalConfiguration.value.withOverwrite(true),
141+
sources in (Compile, doc) := Seq.empty,
142+
releaseIgnoreUntrackedFiles := true,
143+
releaseProcess := Seq[ReleaseStep](
144+
checkSnapshotDependencies,
145+
inquireVersions,
146+
runClean,
147+
runTest,
148+
setReleaseVersion,
149+
commitReleaseVersion,
150+
tagRelease,
151+
releaseStepCommandAndRemaining("+publishSigned"),
152+
setNextVersion,
153+
commitNextVersion,
154+
releaseStepCommand("sonatypeReleaseAll")
155+
)
137156
)
138157

139158
// loads the Scalajs-io root project at sbt startup

package.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,18 @@
22
"name": "nodejs-sfs",
33
"version": "0.4.2",
44
"private": true,
5+
"scripts": {
6+
"lint-md": "remark .",
7+
"fix-md": "remark . -o"
8+
},
9+
"remarkConfig": {
10+
"plugins": [
11+
"remark-preset-lint-recommended"
12+
]
13+
},
514
"dependencies": {
15+
"remark-cli": "^6.0.1",
16+
"remark-preset-lint-recommended": "^3.0.2",
617
"source-map-support": "^0.4.14"
718
}
819
}

project/plugins.sbt

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,5 @@
1-
// Scala.js
2-
3-
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28")
4-
5-
// Code Formatting
6-
7-
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.1")
8-
9-
// Testing
10-
11-
//addSbtPlugin("com.artima.supersafe" % "sbtplugin" % "1.1.2")
12-
13-
// Publishing
14-
15-
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5")
16-
17-
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.2-1")
18-
19-
//// Resolvers
20-
//
21-
//resolvers += "Artima Maven Repository" at "http://repo.artima.com/releases"
22-
//
23-
//resolvers += "TypeSafe repository" at "http://repo.typesafe.com/typesafe/releases/"
24-
//
25-
//resolvers += Resolver.url("scala-js-snapshots", url("http://repo.scala-js.org/repo/snapshots/"))(Resolver.ivyStylePatterns)
1+
addSbtPlugin("org.scala-js" % "sbt-scalajs" % "0.6.28")
2+
addSbtPlugin("org.scalameta" % "sbt-scalafmt" % "2.0.1")
3+
addSbtPlugin("org.xerial.sbt" % "sbt-sonatype" % "2.5")
4+
addSbtPlugin("com.github.gseitz" % "sbt-release" % "1.0.11")
5+
addSbtPlugin("com.jsuereth" % "sbt-pgp" % "1.1.1")

sonatype.sbt

Lines changed: 0 additions & 32 deletions
This file was deleted.

version.sbt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
version in ThisBuild := "0.8.1-SNAPSHOT"

0 commit comments

Comments
 (0)