@platformatic/node 3.14.0 → 3.15.0

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
@@ -214,6 +214,7 @@ export interface PlatformaticNodeJsConfig {
214
214
  rejectUnauthorized?: boolean;
215
215
  };
216
216
  };
217
+ reuseTcpPorts?: boolean;
217
218
  startTimeout?: number;
218
219
  restartOnError?: boolean | number;
219
220
  exitOnUnhandledErrors?: boolean;
package/lib/capability.js CHANGED
@@ -7,7 +7,6 @@ import {
7
7
  importFile,
8
8
  injectViaRequest
9
9
  } from '@platformatic/basic'
10
- import { features } from '@platformatic/foundation'
11
10
  import { Unpromise } from '@watchable/unpromise'
12
11
  import inject from 'light-my-request'
13
12
  import { once } from 'node:events'
@@ -112,6 +111,8 @@ export class NodeCapability extends BaseCapability {
112
111
  return this.url
113
112
  }
114
113
 
114
+ await super._start({ listen })
115
+
115
116
  // Listen if entrypoint
116
117
  if (this.#app && listen) {
117
118
  await this._listen()
@@ -341,10 +342,6 @@ export class NodeCapability extends BaseCapability {
341
342
  const serverOptions = this.serverConfig
342
343
  const listenOptions = { host: serverOptions?.hostname || '127.0.0.1', port: serverOptions?.port || 0 }
343
344
 
344
- if (this.isProduction && features.node.reusePort) {
345
- listenOptions.reusePort = true
346
- }
347
-
348
345
  if (this.#isFastify) {
349
346
  await this.#app.listen(listenOptions)
350
347
  this.url = getServerUrl(this.#app.server)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/node",
3
- "version": "3.14.0",
3
+ "version": "3.15.0",
4
4
  "description": "Platformatic Node.js Capability",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -18,9 +18,9 @@
18
18
  "@watchable/unpromise": "^1.0.2",
19
19
  "json5": "^2.2.3",
20
20
  "light-my-request": "^6.0.0",
21
- "@platformatic/foundation": "3.14.0",
22
- "@platformatic/basic": "3.14.0",
23
- "@platformatic/generators": "3.14.0"
21
+ "@platformatic/foundation": "3.15.0",
22
+ "@platformatic/basic": "3.15.0",
23
+ "@platformatic/generators": "3.15.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "cleaner-spec-reporter": "^0.5.0",
@@ -32,8 +32,8 @@
32
32
  "neostandard": "^0.12.0",
33
33
  "tsx": "^4.19.0",
34
34
  "typescript": "^5.5.4",
35
- "@platformatic/gateway": "3.14.0",
36
- "@platformatic/service": "3.14.0"
35
+ "@platformatic/gateway": "3.15.0",
36
+ "@platformatic/service": "3.15.0"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/node/3.14.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/node/3.15.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Node.js Config",
5
5
  "type": "object",
@@ -426,6 +426,10 @@
426
426
  "useHttp": {
427
427
  "type": "boolean"
428
428
  },
429
+ "reuseTcpPorts": {
430
+ "type": "boolean",
431
+ "default": true
432
+ },
429
433
  "workers": {
430
434
  "anyOf": [
431
435
  {
@@ -992,6 +996,10 @@
992
996
  },
993
997
  "additionalProperties": false
994
998
  },
999
+ "reuseTcpPorts": {
1000
+ "type": "boolean",
1001
+ "default": true
1002
+ },
995
1003
  "startTimeout": {
996
1004
  "default": 30000,
997
1005
  "type": "number",