@platformatic/runtime 3.28.0-alpha.1 → 3.28.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
@@ -48,6 +48,7 @@ export type PlatformaticRuntimeConfig = {
48
48
  };
49
49
  envfile?: string;
50
50
  sourceMaps?: boolean;
51
+ nodeModulesSourceMaps?: string[];
51
52
  packageManager?: "npm" | "pnpm" | "yarn";
52
53
  preload?: string | string[];
53
54
  nodeOptions?: string;
@@ -473,6 +474,7 @@ export type PlatformaticRuntimeConfig = {
473
474
  [k: string]: string;
474
475
  };
475
476
  sourceMaps?: boolean;
477
+ nodeModulesSourceMaps?: string[];
476
478
  scheduler?: {
477
479
  enabled?: boolean | string;
478
480
  name: string;
package/lib/runtime.js CHANGED
@@ -898,6 +898,10 @@ export class Runtime extends EventEmitter {
898
898
  this.#concurrency = concurrency
899
899
  }
900
900
 
901
+ getRoot () {
902
+ return this.#root
903
+ }
904
+
901
905
  getUrl () {
902
906
  return this.#url
903
907
  }
@@ -2094,6 +2098,14 @@ export class Runtime extends EventEmitter {
2094
2098
  const label = this.#workerExtendedLabel(applicationId, index, workersCount)
2095
2099
  let newWorker
2096
2100
 
2101
+ const stopBeforeStart =
2102
+ applicationConfig.entrypoint &&
2103
+ (config.reuseTcpPorts === false || applicationConfig.reuseTcpPorts === false || !features.node.reusePort)
2104
+
2105
+ if (stopBeforeStart) {
2106
+ await this.#removeWorker(workersCount, applicationId, index, worker, silent, label)
2107
+ }
2108
+
2097
2109
  try {
2098
2110
  if (!silent) {
2099
2111
  this.logger.debug(`Preparing to start a replacement for ${label} ...`)
@@ -2117,17 +2129,25 @@ export class Runtime extends EventEmitter {
2117
2129
 
2118
2130
  this.#workers.set(workerId, newWorker)
2119
2131
  this.#meshInterceptor.route(applicationId, newWorker)
2120
-
2121
- // Remove the old worker and then kill it
2122
- await sendViaITC(worker, 'removeFromMesh')
2123
2132
  } catch (e) {
2124
2133
  newWorker?.terminate?.()
2125
2134
  throw e
2126
2135
  }
2127
2136
 
2137
+ if (!stopBeforeStart) {
2138
+ await this.#removeWorker(workersCount, applicationId, index, worker, silent, label)
2139
+ }
2140
+ }
2141
+
2142
+ async #removeWorker (workersCount, applicationId, index, worker, silent, label) {
2128
2143
  if (!silent) {
2129
2144
  this.logger.debug(`Preparing to stop the old version of ${label} ...`)
2130
2145
  }
2146
+
2147
+ // Remove the old worker and then kill it
2148
+ await sendViaITC(worker, 'removeFromMesh')
2149
+
2150
+ // Stop the old worker to free the port
2131
2151
  await this.#stopWorker(workersCount, applicationId, index, false, worker, [])
2132
2152
  }
2133
2153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "3.28.0-alpha.1",
3
+ "version": "3.28.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -35,14 +35,14 @@
35
35
  "typescript": "^5.5.4",
36
36
  "undici-oidc-interceptor": "^0.5.0",
37
37
  "why-is-node-running": "^2.2.2",
38
- "@platformatic/composer": "3.28.0-alpha.1",
39
- "@platformatic/db": "3.28.0-alpha.1",
40
- "@platformatic/gateway": "3.28.0-alpha.1",
41
- "@platformatic/node": "3.28.0-alpha.1",
42
- "@platformatic/service": "3.28.0-alpha.1",
43
- "@platformatic/sql-graphql": "3.28.0-alpha.1",
44
- "@platformatic/sql-mapper": "3.28.0-alpha.1",
45
- "@platformatic/wattpm-pprof-capture": "3.28.0-alpha.1"
38
+ "@platformatic/composer": "3.28.1",
39
+ "@platformatic/db": "3.28.1",
40
+ "@platformatic/gateway": "3.28.1",
41
+ "@platformatic/node": "3.28.1",
42
+ "@platformatic/service": "3.28.1",
43
+ "@platformatic/sql-graphql": "3.28.1",
44
+ "@platformatic/sql-mapper": "3.28.1",
45
+ "@platformatic/wattpm-pprof-capture": "3.28.1"
46
46
  },
47
47
  "dependencies": {
48
48
  "@fastify/accepts": "^5.0.0",
@@ -71,12 +71,12 @@
71
71
  "undici": "^7.0.0",
72
72
  "undici-thread-interceptor": "^0.15.0",
73
73
  "ws": "^8.16.0",
74
- "@platformatic/basic": "3.28.0-alpha.1",
75
- "@platformatic/foundation": "3.28.0-alpha.1",
76
- "@platformatic/itc": "3.28.0-alpha.1",
77
- "@platformatic/generators": "3.28.0-alpha.1",
78
- "@platformatic/telemetry": "3.28.0-alpha.1",
79
- "@platformatic/metrics": "3.28.0-alpha.1"
74
+ "@platformatic/basic": "3.28.1",
75
+ "@platformatic/foundation": "3.28.1",
76
+ "@platformatic/itc": "3.28.1",
77
+ "@platformatic/generators": "3.28.1",
78
+ "@platformatic/metrics": "3.28.1",
79
+ "@platformatic/telemetry": "3.28.1"
80
80
  },
81
81
  "engines": {
82
82
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.28.0-alpha.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.28.1.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Runtime Config",
5
5
  "type": "object",
@@ -227,6 +227,12 @@
227
227
  "sourceMaps": {
228
228
  "type": "boolean"
229
229
  },
230
+ "nodeModulesSourceMaps": {
231
+ "type": "array",
232
+ "items": {
233
+ "type": "string"
234
+ }
235
+ },
230
236
  "packageManager": {
231
237
  "type": "string",
232
238
  "enum": [
@@ -525,6 +531,12 @@
525
531
  "sourceMaps": {
526
532
  "type": "boolean"
527
533
  },
534
+ "nodeModulesSourceMaps": {
535
+ "type": "array",
536
+ "items": {
537
+ "type": "string"
538
+ }
539
+ },
528
540
  "packageManager": {
529
541
  "type": "string",
530
542
  "enum": [
@@ -821,6 +833,12 @@
821
833
  "sourceMaps": {
822
834
  "type": "boolean"
823
835
  },
836
+ "nodeModulesSourceMaps": {
837
+ "type": "array",
838
+ "items": {
839
+ "type": "string"
840
+ }
841
+ },
824
842
  "packageManager": {
825
843
  "type": "string",
826
844
  "enum": [
@@ -1117,6 +1135,12 @@
1117
1135
  "sourceMaps": {
1118
1136
  "type": "boolean"
1119
1137
  },
1138
+ "nodeModulesSourceMaps": {
1139
+ "type": "array",
1140
+ "items": {
1141
+ "type": "string"
1142
+ }
1143
+ },
1120
1144
  "packageManager": {
1121
1145
  "type": "string",
1122
1146
  "enum": [
@@ -2388,6 +2412,13 @@
2388
2412
  "type": "boolean",
2389
2413
  "default": false
2390
2414
  },
2415
+ "nodeModulesSourceMaps": {
2416
+ "type": "array",
2417
+ "items": {
2418
+ "type": "string"
2419
+ },
2420
+ "default": []
2421
+ },
2391
2422
  "scheduler": {
2392
2423
  "type": "array",
2393
2424
  "items": {