@platformatic/node 2.70.0 → 2.71.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 CHANGED
@@ -401,6 +401,7 @@ export interface PlatformaticNodeJsStackable {
401
401
  [k: string]: unknown;
402
402
  };
403
403
  serviceTimeout?: number | string;
404
+ messagingTimeout?: number | string;
404
405
  env?: {
405
406
  [k: string]: string;
406
407
  };
package/index.js CHANGED
@@ -115,32 +115,34 @@ export class NodeStackable extends BaseStackable {
115
115
  // Deal with application
116
116
  const factory = ['build', 'create'].find(f => typeof this.#module[f] === 'function')
117
117
 
118
- if (factory) {
119
- // We have build function, this Stackable will not use HTTP unless it is the entrypoint
120
- serverPromise.cancel()
121
-
122
- this.#app = await this.#module[factory]()
123
- this.#isFastify = isFastify(this.#app)
124
- this.#isKoa = isKoa(this.#app)
118
+ if (this.#module.hasServer !== false) {
119
+ if (factory) {
120
+ // We have build function, this Stackable will not use HTTP unless it is the entrypoint
121
+ serverPromise.cancel()
122
+
123
+ this.#app = await this.#module[factory]()
124
+ this.#isFastify = isFastify(this.#app)
125
+ this.#isKoa = isKoa(this.#app)
126
+
127
+ if (this.#isFastify) {
128
+ await this.#app.ready()
129
+ } else if (this.#isKoa) {
130
+ this.#dispatcher = this.#app.callback()
131
+ } else if (this.#app instanceof Server) {
132
+ this.#server = this.#app
133
+ this.#dispatcher = this.#server.listeners('request')[0]
134
+ }
125
135
 
126
- if (this.#isFastify) {
127
- await this.#app.ready()
128
- } else if (this.#isKoa) {
129
- this.#dispatcher = this.#app.callback()
130
- } else if (this.#app instanceof Server) {
131
- this.#server = this.#app
136
+ if (listen) {
137
+ await this._listen()
138
+ }
139
+ } else {
140
+ // User blackbox function, we wait for it to listen on a port
141
+ this.#server = await serverPromise
132
142
  this.#dispatcher = this.#server.listeners('request')[0]
133
- }
134
143
 
135
- if (listen) {
136
- await this._listen()
144
+ this.url = getServerUrl(this.#server)
137
145
  }
138
- } else {
139
- // User blackbox function, we wait for it to listen on a port
140
- this.#server = await serverPromise
141
- this.#dispatcher = this.#server.listeners('request')[0]
142
-
143
- this.url = getServerUrl(this.#server)
144
146
  }
145
147
 
146
148
  await this._collectMetrics()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/node",
3
- "version": "2.70.0",
3
+ "version": "2.71.0-alpha.1",
4
4
  "description": "Platformatic Node.js Stackable",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -21,10 +21,10 @@
21
21
  "dependencies": {
22
22
  "json5": "^2.2.3",
23
23
  "light-my-request": "^6.0.0",
24
- "@platformatic/basic": "2.70.0",
25
- "@platformatic/config": "2.70.0",
26
- "@platformatic/generators": "2.70.0",
27
- "@platformatic/utils": "2.70.0"
24
+ "@platformatic/basic": "2.71.0-alpha.1",
25
+ "@platformatic/config": "2.71.0-alpha.1",
26
+ "@platformatic/utils": "2.71.0-alpha.1",
27
+ "@platformatic/generators": "2.71.0-alpha.1"
28
28
  },
29
29
  "devDependencies": {
30
30
  "borp": "^0.20.0",
@@ -36,8 +36,8 @@
36
36
  "neostandard": "^0.12.0",
37
37
  "tsx": "^4.19.0",
38
38
  "typescript": "^5.5.4",
39
- "@platformatic/composer": "2.70.0",
40
- "@platformatic/service": "2.70.0"
39
+ "@platformatic/composer": "2.71.0-alpha.1",
40
+ "@platformatic/service": "2.71.0-alpha.1"
41
41
  },
42
42
  "scripts": {
43
43
  "test": "pnpm 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.70.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/node/2.71.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",
@@ -1292,6 +1292,18 @@
1292
1292
  ],
1293
1293
  "default": 300000
1294
1294
  },
1295
+ "messagingTimeout": {
1296
+ "anyOf": [
1297
+ {
1298
+ "type": "number",
1299
+ "minimum": 1
1300
+ },
1301
+ {
1302
+ "type": "string"
1303
+ }
1304
+ ],
1305
+ "default": 30000
1306
+ },
1295
1307
  "env": {
1296
1308
  "type": "object",
1297
1309
  "additionalProperties": {