Skip to content

Commit 38db172

Browse files
committed
Continued development:
1. Moved $cookies, $cookieStore, $sce and $sceDelegate into AngularJS sub-projects 2. Implemented Azure Node module 3. Updated the body-parser Node module 4. Updated examples 5. Updated README.md with Node module version information
1 parent eba465c commit 38db172

File tree

113 files changed

+2612
-190
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

113 files changed

+2612
-190
lines changed

README.md

Lines changed: 46 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -63,36 +63,38 @@ modules implemented for most web applications.
6363

6464
The following NodeJS modules have been implemented thus far:
6565

66-
| Module | Artifact ID | Description |
67-
|-------------------|-----------------------|----------------------------------|
68-
| async | means-node-async | Higher-order functions and common patterns for asynchronous code. |
69-
| bcrypt | means-node-bcrypt | A native JS bcrypt library for NodeJS. |
70-
| body-parser | means-node-express | Body parsing middleware. |
71-
| buffer | means-node-core | Node.js Core (Global) |
72-
| events | means-node-core | Node.js Core |
73-
| express | means-node-express | Fast, unopinionated, minimalist web framework for Node.js |
74-
| express-ws | means-node-express | WebSocket endpoints for Express applications |
75-
| filed | means-node-filed | Simplified file library. |
76-
| fs | means-node-core | Node.js Core |
77-
| http | means-node-core | Node.js Core |
78-
| https | means-node-core | Node.js Core |
79-
| jwt-simple | means-node-jwt-simple | JWT(JSON Web Token) encode and decode module |
80-
| kafka-node | means-node-kafkanode | A node binding for librdkafka |
81-
| mongodb | means-node-mongodb | Node.js MongoDB Driver |
82-
| net | means-node-core | Node.js Core |
83-
| oppressor | means-node-oppressor | Streaming http compression response negotiator. |
84-
| os | means-node-os | Node.js Core |
85-
| node-zookeeper-client | means-node-zookeeper-client | A higher-level ZooKeeper client based on node-zookeeper with support for locking and master election. |
86-
| readline | means-node-core | Node.js Core |
87-
| repl | means-node-repl | Node.js Core |
88-
| request | means-node-request | Simplified HTTP request client. |
89-
| splitargs | means-node-elgs-splitargs | Splits strings into tokens by given separator except treating quoted part as a single token. |
90-
| stream | means-node-core | Node.js Core |
91-
| string-decoder | means-node-string-decoder | Node.js Core |
92-
| url | means-node-core | Node.js Core |
93-
| util | means-node-core | Node.js Core |
94-
| xml2js | means-node-xml2js | Simple XML to JavaScript object converter. |
95-
| zlib | means-node-zlib | This provides bindings to Gzip/Gunzip, Deflate/Inflate, and DeflateRaw/InflateRaw classes. |
66+
| Node Module | Version | Artifact ID | Description |
67+
|-------------------|---------|-----------------------|---------------------------------------------------------|
68+
| adal-node | 0.1.19 | means-node-adal-node | Windows Azure Active Directory Client Library for node. |
69+
| async | 1.5.2 | means-node-async | Higher-order functions and common patterns for asynchronous code. |
70+
| azure | 0.10.6 | means-node-azure | Microsoft Azure Client Library for node. |
71+
| bcrypt | 0.0.3 | means-node-bcrypt | A native JS bcrypt library for NodeJS. |
72+
| body-parser | 1.15.1 | means-node-body-parser| Body parsing middleware. |
73+
| buffer | 6.1.0 | means-node-core | Node.js Core (Global) |
74+
| events | 6.1.0 | means-node-core | Node.js Core |
75+
| express | 4.13.4 | means-node-express | Fast, unopinionated, minimalist web framework for Node.js |
76+
| express-ws |2.0.0-rc1| means-node-express-ws | WebSocket endpoints for Express applications |
77+
| filed | 0.1.0 | means-node-filed | Simplified file library. |
78+
| fs | 6.1.0 | means-node-core | Node.js Core |
79+
| http | 6.1.0 | means-node-core | Node.js Core |
80+
| https | 6.1.0 | means-node-core | Node.js Core |
81+
| jwt-simple | 0.5.0 | means-node-jwt-simple | JWT(JSON Web Token) encode and decode module |
82+
| kafka-node | 0.0.11 | means-node-kafkanode | A node binding for librdkafka |
83+
| mongodb | 2.1 | means-node-mongodb | Node.js MongoDB Driver |
84+
| net | 6.1.0 | means-node-core | Node.js Core |
85+
| oppressor | 0.0.1 | means-node-oppressor | Streaming http compression response negotiator. |
86+
| os | 6.1.0 | means-node-os | Node.js Core |
87+
| node-zookeeper-client | 0.2.2 | means-node-zookeeper-client | A higher-level ZooKeeper client based on node-zookeeper with support for locking and master election. |
88+
| readline | 6.1.0 | means-node-core | Node.js Core |
89+
| repl | 6.1.0 | means-node-repl | Node.js Core |
90+
| request | 2.72.1 | means-node-request | Simplified HTTP request client. |
91+
| splitargs | 0.0.7 | means-node-elgs-splitargs | Splits strings into tokens by given separator except treating quoted part as a single token. |
92+
| stream | 6.1.0 | means-node-core | Node.js Core |
93+
| string-decoder | 6.1.0 | means-node-string-decoder | Node.js Core |
94+
| url | 6.1.0 | means-node-core | Node.js Core |
95+
| util | 6.1.0 | means-node-core | Node.js Core |
96+
| xml2js | 0.4.16 | means-node-xml2js | Simple XML to JavaScript object converter. |
97+
| zlib | 6.1.0 | means-node-zlib | This provides bindings to Gzip/Gunzip, Deflate/Inflate, and DeflateRaw/InflateRaw classes. |
9698

9799
*NOTE*: The full SBT artifact expression is: "com.github.ldaniels528" %%% "means-node-xxxx" % version
98100
(e.g. "com.github.ldaniels528" %%% "means-node-core" % "0.1.5")
@@ -128,21 +130,29 @@ Here's the same example using MEANS.js + Scala.js:
128130
<a name="NodeJS_Integration">
129131
#### Integration Guidance
130132

131-
Currently, the "require" function must be passed to the Scala.js application because of an issue
132-
with getting a reference to it. This can be accomplished inside a bootstrap JavaScript file as follows:
133+
Currently, the "require" function (along with a few others) must be passed to the Scala.js application because of an issue
134+
with getting a reference to them. This can be accomplished inside a bootstrap JavaScript file as follows:
133135

134136
```javascript
135137

136138
require("./target/scala-2.11/means-examples-fastopt.js");
137139
var facade = examples.Examples();
138-
facade.start(require);
140+
facade.start({
141+
"__dirname": __dirname,
142+
"__filename": __filename,
143+
"exports": exports,
144+
"module": module,
145+
"require": require
146+
});
139147
```
140148

141149
Then with the Scala.js application:
142150

143151
```scala
144152

145-
def start(require: Require) = {
153+
def start(bootstrap: Bootstrap) = {
154+
import bootstrap._
155+
146156
val express = require[Express]("express")
147157
.
148158
.
@@ -253,8 +263,8 @@ The following AngularJS services have been implemented thus far:
253263
| FileUploader | means-angular-nergvh-fileupload | AngularJS File Uploader |
254264
| toaster | means-angular-toaster | AngularJS Toaster is a customized version of "toastr" non-blocking notification javascript library. |
255265

256-
*NOTE*: The full SBT artifact expression is: "com.github.ldaniels528" %%% "means-node-xxxx" % version
257-
(e.g. "com.github.ldaniels528" %%% "means-node-core" % "0.1.5")
266+
*NOTE*: The full SBT artifact expression is: "com.github.ldaniels528" %%% "means-angular-xxxx" % version
267+
(e.g. "com.github.ldaniels528" %%% "means-angular-core" % "0.1.5")
258268

259269

260270
#### Defining a Module

angularjs/core/src/main/scala/com/github/ldaniels528/meansjs/angularjs/extensions/CookieStore.scala renamed to angularjs/cookies/src/main/scala/com/github/ldaniels528/meansjs/angularjs/cookies/CookieStore.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.ldaniels528.meansjs.angularjs.extensions
1+
package com.github.ldaniels528.meansjs.angularjs.cookies
22

33
import scala.scalajs.js
44

angularjs/core/src/main/scala/com/github/ldaniels528/meansjs/angularjs/extensions/Cookies.scala renamed to angularjs/cookies/src/main/scala/com/github/ldaniels528/meansjs/angularjs/cookies/Cookies.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.ldaniels528.meansjs.angularjs.extensions
1+
package com.github.ldaniels528.meansjs.angularjs.cookies
22

33
import scala.scalajs.js
44

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
package com.github.ldaniels528.meansjs.angularjs.extensions
2-
3-
import com.github.ldaniels528.meansjs.angularjs.Provider
1+
package com.github.ldaniels528.meansjs.angularjs
42

53
import scala.scalajs.js
64

angularjs/core/src/main/scala/com/github/ldaniels528/meansjs/angularjs/extensions/Sce.scala renamed to angularjs/sanitize/src/main/scala/com/github/ldaniels528/meansjs/angularjs/sanitize/Sce.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.ldaniels528.meansjs.angularjs.extensions
1+
package com.github.ldaniels528.meansjs.angularjs.sanitize
22

33
import com.github.ldaniels528.meansjs.angularjs.Provider
44

angularjs/core/src/main/scala/com/github/ldaniels528/meansjs/angularjs/extensions/SceDelegate.scala renamed to angularjs/sanitize/src/main/scala/com/github/ldaniels528/meansjs/angularjs/sanitize/SceDelegate.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
package com.github.ldaniels528.meansjs.angularjs.extensions
1+
package com.github.ldaniels528.meansjs.angularjs.sanitize
22

33
import com.github.ldaniels528.meansjs.angularjs.Provider
44

build.sbt

Lines changed: 81 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import sbt.Keys._
44
import sbt.Project.projectToRef
55
import sbt._
66

7-
val apiVersion = "0.1.5"
7+
val apiVersion = "0.1.6"
88
val paradisePluginVersion = "2.1.0"
99
val _scalaVersion = "2.11.8"
1010
val scalaJsDomVersion = "0.9.0"
@@ -35,11 +35,11 @@ val commonSettings = Seq(
3535
lazy val root = (project in file(".")).
3636
aggregate(
3737
core, facebook, linkedin,
38-
angular_core, angular_animate, angular_facebook, angular_nervgh_fileupload, angular_toaster,
39-
angular_ui_bootstrap, angular_ui_router,
40-
node_core, node_async, node_bcrypt, node_crypto, node_elgs_splitargs, node_express, node_filed, node_jwt_simple,
41-
node_kafka, node_mongodb, node_oppressor, node_os, node_repl, node_request, node_string_decoder,
42-
node_xml2js, node_zlib, node_zookeeper
38+
angular_core, angular_animate, angular_cookies, angular_facebook, angular_nervgh_fileupload,
39+
angular_sanitize, angular_toaster, angular_ui_bootstrap, angular_ui_router,
40+
node_core, node_adal, node_async, node_azure, node_bcrypt, node_body_parser, node_crypto, node_elgs_splitargs,
41+
node_express, node_express_ws, node_filed, node_jwt_simple, node_kafka, node_mongodb, node_oppressor, node_os,
42+
node_repl, node_request, node_string_decoder, node_xml2js, node_zlib, node_zookeeper
4343
)
4444

4545
lazy val core = (project in file("core")).
@@ -50,13 +50,17 @@ lazy val core = (project in file("core")).
5050
description := "MEANS.js core utilities"
5151
)
5252

53+
/////////////////////////////////////////////////////////////////////////////////
54+
// AngularJS sub-projects
55+
/////////////////////////////////////////////////////////////////////////////////
56+
5357
lazy val angular_core = (project in file("angularjs/core")).
5458
dependsOn(core).
5559
enablePlugins(ScalaJSPlugin).
5660
settings(commonSettings: _*).
5761
settings(
5862
name := "means-angularjs-core",
59-
description := "AngularJS facade for Scala.js"
63+
description := "AngularJS/core facade for Scala.js"
6064
)
6165

6266
lazy val angular_animate = (project in file("angularjs/animate")).
@@ -65,7 +69,16 @@ lazy val angular_animate = (project in file("angularjs/animate")).
6569
settings(commonSettings: _*).
6670
settings(
6771
name := "means-angularjs-animate",
68-
description := "AngularJS facade for Scala.js"
72+
description := "AngularJS/animate facade for Scala.js"
73+
)
74+
75+
lazy val angular_cookies = (project in file("angularjs/cookies")).
76+
dependsOn(core, angular_core).
77+
enablePlugins(ScalaJSPlugin).
78+
settings(commonSettings: _*).
79+
settings(
80+
name := "means-angularjs-cookies",
81+
description := "AngularJS/cookies facade for Scala.js"
6982
)
7083

7184
lazy val angular_facebook = (project in file("angularjs/facebook")).
@@ -74,7 +87,7 @@ lazy val angular_facebook = (project in file("angularjs/facebook")).
7487
settings(commonSettings: _*).
7588
settings(
7689
name := "means-angularjs-facebook",
77-
description := "AngularJS facebook facade for Scala.js"
90+
description := "AngularJS/facebook facade for Scala.js"
7891
)
7992

8093
lazy val angular_nervgh_fileupload = (project in file("angularjs/nervgh-fileupload")).
@@ -86,6 +99,15 @@ lazy val angular_nervgh_fileupload = (project in file("angularjs/nervgh-fileuplo
8699
description := "AngularJS/nervgh-fileupload facade for Scala.js"
87100
)
88101

102+
lazy val angular_sanitize = (project in file("angularjs/sanitize")).
103+
dependsOn(core, angular_core).
104+
enablePlugins(ScalaJSPlugin).
105+
settings(commonSettings: _*).
106+
settings(
107+
name := "means-angularjs-sanitize",
108+
description := "AngularJS/sanitize facade for Scala.js"
109+
)
110+
89111
lazy val angular_toaster = (project in file("angularjs/toaster")).
90112
dependsOn(core, angular_core).
91113
enablePlugins(ScalaJSPlugin).
@@ -113,6 +135,10 @@ lazy val angular_ui_router = (project in file("angularjs/ui-router")).
113135
description := "AngularJS/ui-router facade for Scala.js"
114136
)
115137

138+
/////////////////////////////////////////////////////////////////////////////////
139+
// Social sub-projects
140+
/////////////////////////////////////////////////////////////////////////////////
141+
116142
lazy val facebook = (project in file("social/facebook")).
117143
dependsOn(core, angular_core).
118144
enablePlugins(ScalaJSPlugin).
@@ -131,6 +157,10 @@ lazy val linkedin = (project in file("social/linkedin")).
131157
description := "Social/LinkedIn facade for Scala.js"
132158
)
133159

160+
/////////////////////////////////////////////////////////////////////////////////
161+
// NodeJS sub-projects
162+
/////////////////////////////////////////////////////////////////////////////////
163+
134164
lazy val node_core = (project in file("node/core")).
135165
dependsOn(core).
136166
enablePlugins(ScalaJSPlugin).
@@ -140,6 +170,15 @@ lazy val node_core = (project in file("node/core")).
140170
description := "NodeJS/Core facade for Scala.js"
141171
)
142172

173+
lazy val node_adal = (project in file("node/adal")).
174+
dependsOn(core, node_core).
175+
enablePlugins(ScalaJSPlugin).
176+
settings(commonSettings: _*).
177+
settings(
178+
name := "means-node-adal-node",
179+
description := "NodeJS/adal-node facade for Scala.js"
180+
)
181+
143182
lazy val node_async = (project in file("node/async")).
144183
dependsOn(core, node_core).
145184
enablePlugins(ScalaJSPlugin).
@@ -149,6 +188,15 @@ lazy val node_async = (project in file("node/async")).
149188
description := "NodeJS/async facade for Scala.js"
150189
)
151190

191+
lazy val node_azure = (project in file("node/azure")).
192+
dependsOn(core, node_core).
193+
enablePlugins(ScalaJSPlugin).
194+
settings(commonSettings: _*).
195+
settings(
196+
name := "means-node-azure",
197+
description := "NodeJS/azure facade for Scala.js"
198+
)
199+
152200
lazy val node_bcrypt = (project in file("node/bcrypt")).
153201
dependsOn(core, node_core).
154202
enablePlugins(ScalaJSPlugin).
@@ -158,6 +206,15 @@ lazy val node_bcrypt = (project in file("node/bcrypt")).
158206
description := "NodeJS/bcrypt facade for Scala.js"
159207
)
160208

209+
lazy val node_body_parser = (project in file("node/body-parser")).
210+
dependsOn(core, node_express).
211+
enablePlugins(ScalaJSPlugin).
212+
settings(commonSettings: _*).
213+
settings(
214+
name := "means-node-body-parser",
215+
description := "NodeJS/body-parser facade for Scala.js"
216+
)
217+
161218
lazy val node_crypto = (project in file("node/crypto")).
162219
dependsOn(core, node_core).
163220
enablePlugins(ScalaJSPlugin).
@@ -185,6 +242,15 @@ lazy val node_express = (project in file("node/express")).
185242
description := "NodeJS/express facade for Scala.js"
186243
)
187244

245+
lazy val node_express_ws = (project in file("node/express-ws")).
246+
dependsOn(core, node_express).
247+
enablePlugins(ScalaJSPlugin).
248+
settings(commonSettings: _*).
249+
settings(
250+
name := "means-node-express-ws",
251+
description := "NodeJS/express-ws facade for Scala.js"
252+
)
253+
188254
lazy val node_filed = (project in file("node/filed")).
189255
dependsOn(core, node_core).
190256
enablePlugins(ScalaJSPlugin).
@@ -295,11 +361,13 @@ lazy val node_zookeeper = (project in file("node/zookeeper-client")).
295361

296362
lazy val examples = (project in file("examples")).
297363
aggregate(
298-
core, node_core, node_async, node_bcrypt, node_crypto, node_elgs_splitargs, node_express, node_filed, node_jwt_simple, node_kafka,
299-
node_mongodb, node_oppressor, node_os, node_repl, node_request, node_string_decoder, node_xml2js, node_zlib, node_zookeeper).
364+
core, node_core, node_adal, node_async, node_azure, node_bcrypt, node_body_parser, node_crypto, node_elgs_splitargs,
365+
node_express, node_express_ws, node_filed, node_jwt_simple, node_kafka, node_mongodb, node_oppressor, node_os,
366+
node_repl, node_request, node_string_decoder, node_xml2js, node_zlib, node_zookeeper).
300367
dependsOn(
301-
core, node_core, node_async, node_bcrypt, node_crypto, node_elgs_splitargs, node_express, node_filed, node_jwt_simple, node_kafka,
302-
node_mongodb, node_oppressor, node_os, node_repl, node_request, node_string_decoder, node_xml2js, node_zlib, node_zookeeper).
368+
core, node_core, node_adal, node_async, node_azure, node_bcrypt, node_body_parser, node_crypto, node_elgs_splitargs,
369+
node_express, node_express_ws, node_filed, node_jwt_simple, node_kafka, node_mongodb, node_oppressor, node_os,
370+
node_repl, node_request, node_string_decoder, node_xml2js, node_zlib, node_zookeeper).
303371
enablePlugins(ScalaJSPlugin).
304372
settings(commonSettings: _*).
305373
settings(

examples/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
"private": true,
55
"dependencies": {
66
"azure": "^0.10.6",
7+
"azure-storage": "^0.10.0",
78
"body-parser": "^1.15.0",
89
"engine.io": "^1.6.8",
910
"express": "4.13.4",

0 commit comments

Comments
 (0)