@platformatic/node 2.15.0 → 2.16.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/config.d.ts +0 -1
- package/index.js +1 -15
- package/lib/schema.js +2 -6
- package/package.json +6 -6
- package/schema.json +1 -5
package/config.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -50,7 +50,6 @@ export class NodeStackable extends BaseStackable {
|
|
|
50
50
|
#dispatcher
|
|
51
51
|
#isFastify
|
|
52
52
|
#isKoa
|
|
53
|
-
#useHttpForDispatch
|
|
54
53
|
|
|
55
54
|
constructor (options, root, configManager) {
|
|
56
55
|
super('nodejs', packageJson.version, options, root, configManager)
|
|
@@ -123,8 +122,6 @@ export class NodeStackable extends BaseStackable {
|
|
|
123
122
|
} else {
|
|
124
123
|
// User blackbox function, we wait for it to listen on a port
|
|
125
124
|
this.#server = await serverPromise
|
|
126
|
-
this.#dispatcher = this.#server.listeners('request')[0]
|
|
127
|
-
|
|
128
125
|
this.url = getServerUrl(this.#server)
|
|
129
126
|
}
|
|
130
127
|
|
|
@@ -180,7 +177,7 @@ export class NodeStackable extends BaseStackable {
|
|
|
180
177
|
async inject (injectParams, onInject) {
|
|
181
178
|
let res
|
|
182
179
|
|
|
183
|
-
if (this
|
|
180
|
+
if (this.url) {
|
|
184
181
|
this.logger.trace({ injectParams, url: this.url }, 'injecting via request')
|
|
185
182
|
res = await injectViaRequest(this.url, injectParams, onInject)
|
|
186
183
|
} else {
|
|
@@ -237,17 +234,6 @@ export class NodeStackable extends BaseStackable {
|
|
|
237
234
|
}
|
|
238
235
|
}
|
|
239
236
|
|
|
240
|
-
async getDispatchTarget () {
|
|
241
|
-
this.#useHttpForDispatch =
|
|
242
|
-
this.childManager || (this.url && this.configManager.current.node?.dispatchViaHttp === true)
|
|
243
|
-
|
|
244
|
-
if (this.#useHttpForDispatch) {
|
|
245
|
-
return this.getUrl()
|
|
246
|
-
}
|
|
247
|
-
|
|
248
|
-
return this.getDispatchFunc()
|
|
249
|
-
}
|
|
250
|
-
|
|
251
237
|
async _listen () {
|
|
252
238
|
const serverOptions = this.serverConfig
|
|
253
239
|
|
package/lib/schema.js
CHANGED
|
@@ -8,16 +8,12 @@ const node = {
|
|
|
8
8
|
type: 'object',
|
|
9
9
|
properties: {
|
|
10
10
|
main: {
|
|
11
|
-
type: 'string'
|
|
11
|
+
type: 'string',
|
|
12
12
|
},
|
|
13
13
|
absoluteUrl: {
|
|
14
14
|
description: 'This Node.js application requires the Absolute URL from the Composer',
|
|
15
15
|
type: 'boolean',
|
|
16
|
-
default: false
|
|
17
|
-
},
|
|
18
|
-
dispatchViaHttp: {
|
|
19
|
-
type: 'boolean',
|
|
20
|
-
default: false
|
|
16
|
+
default: false,
|
|
21
17
|
}
|
|
22
18
|
},
|
|
23
19
|
default: {},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/node",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.16.0-alpha.1",
|
|
4
4
|
"description": "Platformatic Node.js Stackable",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -16,9 +16,9 @@
|
|
|
16
16
|
"homepage": "https://github.com/platformatic/platformatic#readme",
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"light-my-request": "^6.0.0",
|
|
19
|
-
"@platformatic/basic": "2.
|
|
20
|
-
"@platformatic/utils": "2.
|
|
21
|
-
"@platformatic/config": "2.
|
|
19
|
+
"@platformatic/basic": "2.16.0-alpha.1",
|
|
20
|
+
"@platformatic/utils": "2.16.0-alpha.1",
|
|
21
|
+
"@platformatic/config": "2.16.0-alpha.1"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"borp": "^0.18.0",
|
|
@@ -30,8 +30,8 @@
|
|
|
30
30
|
"neostandard": "^0.11.1",
|
|
31
31
|
"tsx": "^4.19.0",
|
|
32
32
|
"typescript": "^5.5.4",
|
|
33
|
-
"@platformatic/composer": "2.
|
|
34
|
-
"@platformatic/service": "2.
|
|
33
|
+
"@platformatic/composer": "2.16.0-alpha.1",
|
|
34
|
+
"@platformatic/service": "2.16.0-alpha.1"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"test": "npm run lint && borp --concurrency=1 --no-timeout",
|
package/schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://schemas.platformatic.dev/@platformatic/node/2.
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/node/2.16.0-alpha.1.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "Platformatic Node.js Stackable",
|
|
5
5
|
"type": "object",
|
|
@@ -307,10 +307,6 @@
|
|
|
307
307
|
"description": "This Node.js application requires the Absolute URL from the Composer",
|
|
308
308
|
"type": "boolean",
|
|
309
309
|
"default": false
|
|
310
|
-
},
|
|
311
|
-
"dispatchViaHttp": {
|
|
312
|
-
"type": "boolean",
|
|
313
|
-
"default": false
|
|
314
310
|
}
|
|
315
311
|
},
|
|
316
312
|
"default": {},
|