@soundworks/core
Advanced tools
Comparing version 3.2.2 to 3.3.0
{ | ||
"name": "@soundworks/core", | ||
"version": "3.2.2", | ||
"version": "3.3.0", | ||
"description": "full-stack javascript framework for distributed audio visual experiences on the web", | ||
@@ -32,3 +32,4 @@ "authors": [ | ||
"dev:common": "chokidar src/common/ -c \"npm run build:common\"", | ||
"dev": "npm run build && (npm run dev:client & npm run dev:server & npm run dev:common)" | ||
"dev": "npm run build && (npm run dev:client & npm run dev:server & npm run dev:common)", | ||
"test": "mocha" | ||
}, | ||
@@ -42,2 +43,3 @@ "dependencies": { | ||
"fast-text-encoding": "^1.0.0", | ||
"http-terminator": "^3.2.0", | ||
"isomorphic-ws": "^4.0.1", | ||
@@ -44,0 +46,0 @@ "keyv": "^4.2.2", |
@@ -23,3 +23,3 @@ "use strict"; | ||
class AbstractExperience { | ||
constructor(server, clientTypes = null) { | ||
constructor(server, clientTypes = []) { | ||
// @todo - check that it's a soundworks instance | ||
@@ -26,0 +26,0 @@ if (!server) { |
@@ -44,2 +44,4 @@ "use strict"; | ||
var _httpTerminator = require("http-terminator"); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
@@ -430,4 +432,6 @@ | ||
if (clientType !== defaultClientType) { | ||
const path = this._openClientRoute(clientType, this.router); | ||
const clientTarget = this.config.app.clients[clientType].target; | ||
const path = this._openClientRoute(clientType, target, this.router); | ||
routes.push({ | ||
@@ -443,4 +447,6 @@ clientType, | ||
if (clientType === defaultClientType) { | ||
const path = this._openClientRoute(clientType, this.router, true); | ||
const clientTarget = this.config.app.clients[clientType].target; | ||
const path = this._openClientRoute(clientType, target, this.router, true); | ||
routes.unshift({ | ||
@@ -498,2 +504,9 @@ clientType, | ||
} | ||
async stop() { | ||
const httpTerminator = (0, _httpTerminator.createHttpTerminator)({ | ||
server: this.httpServer | ||
}); | ||
await httpTerminator.terminate(); | ||
} | ||
/** | ||
@@ -505,3 +518,8 @@ * Open the route for the given client. | ||
_openClientRoute(clientType, router, isDefault = false) { | ||
_openClientRoute(clientType, target, router, isDefault = false) { | ||
// only browser targets need a route | ||
if (target === 'node') { | ||
return; | ||
} | ||
let route = '/'; | ||
@@ -511,4 +529,5 @@ | ||
route += `${clientType}`; | ||
} | ||
} // @todo - define what is this... looks completely not used and not usable... | ||
if (this._routes[clientType]) { | ||
@@ -515,0 +534,0 @@ route += this._routes[clientType]; |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169506
4179
20
4
+ Addedhttp-terminator@^3.2.0
+ Addedboolean@3.2.0(transitive)
+ Addeddelay@5.0.0(transitive)
+ Addedfast-printf@1.6.9(transitive)
+ Addedhttp-terminator@3.2.0(transitive)
+ Addedp-finally@1.0.0(transitive)
+ Addedp-timeout@3.2.0(transitive)
+ Addedp-wait-for@3.2.0(transitive)
+ Addedroarr@7.21.1(transitive)
+ Addedsafe-stable-stringify@2.5.0(transitive)
+ Addedsemver-compare@1.0.0(transitive)
+ Addedtype-fest@2.19.0(transitive)