@platformatic/runtime 3.35.0 → 3.36.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
@@ -301,6 +301,10 @@ export type PlatformaticRuntimeConfig = {
301
301
  logs?: {
302
302
  maxSize?: number;
303
303
  };
304
+ /**
305
+ * Custom path for the control socket. If not specified, uses the default platform-specific location.
306
+ */
307
+ socket?: string;
304
308
  };
305
309
  metrics?:
306
310
  | boolean
@@ -328,16 +328,19 @@ export async function managementApiPlugin (app, opts) {
328
328
  })
329
329
  }
330
330
 
331
- export async function startManagementApi (runtime) {
331
+ export async function startManagementApi (runtime, config) {
332
332
  const runtimePID = process.pid
333
+ const customSocket = typeof config === 'object' ? config?.socket : null
333
334
 
334
335
  const runtimePIDDir = join(PLATFORMATIC_TMP_DIR, runtimePID.toString())
335
- if (platform() !== 'win32') {
336
+ if (platform() !== 'win32' && !customSocket) {
336
337
  await createDirectory(runtimePIDDir, true)
337
338
  }
338
339
 
339
340
  let socketPath = null
340
- if (platform() === 'win32') {
341
+ if (customSocket) {
342
+ socketPath = customSocket
343
+ } else if (platform() === 'win32') {
341
344
  socketPath = '\\\\.\\pipe\\platformatic-' + runtimePID.toString()
342
345
  } else {
343
346
  socketPath = join(runtimePIDDir, 'socket')
@@ -348,7 +351,7 @@ export async function startManagementApi (runtime) {
348
351
  managementApi.register(managementApiPlugin, { runtime, prefix: '/api/v1' })
349
352
 
350
353
  managementApi.addHook('onClose', async () => {
351
- if (platform() !== 'win32') {
354
+ if (platform() !== 'win32' && !customSocket) {
352
355
  await safeRemove(runtimePIDDir)
353
356
  }
354
357
  })
package/lib/runtime.js CHANGED
@@ -210,7 +210,7 @@ export class Runtime extends EventEmitter {
210
210
  const config = this.#config
211
211
 
212
212
  if (config.managementApi) {
213
- this.#managementApi = await startManagementApi(this, this.#root)
213
+ this.#managementApi = await startManagementApi(this, config.managementApi)
214
214
  }
215
215
 
216
216
  if (config.metrics) {
package/lib/worker/itc.js CHANGED
@@ -213,7 +213,7 @@ export function setupITC (controller, application, dispatcher, sharedContext) {
213
213
  },
214
214
 
215
215
  async getDependencies () {
216
- return controller.capability.getDependencies()
216
+ return controller.capability.getDependencies?.() ?? []
217
217
  },
218
218
 
219
219
  async build () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "3.35.0",
3
+ "version": "3.36.0",
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.35.0",
39
- "@platformatic/db": "3.35.0",
40
- "@platformatic/gateway": "3.35.0",
41
- "@platformatic/node": "3.35.0",
42
- "@platformatic/service": "3.35.0",
43
- "@platformatic/sql-graphql": "3.35.0",
44
- "@platformatic/sql-mapper": "3.35.0",
45
- "@platformatic/wattpm-pprof-capture": "3.35.0"
38
+ "@platformatic/composer": "3.36.0",
39
+ "@platformatic/db": "3.36.0",
40
+ "@platformatic/node": "3.36.0",
41
+ "@platformatic/service": "3.36.0",
42
+ "@platformatic/sql-graphql": "3.36.0",
43
+ "@platformatic/sql-mapper": "3.36.0",
44
+ "@platformatic/wattpm-pprof-capture": "3.36.0",
45
+ "@platformatic/gateway": "3.36.0"
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": "^1.3.0",
73
73
  "ws": "^8.16.0",
74
- "@platformatic/basic": "3.35.0",
75
- "@platformatic/foundation": "3.35.0",
76
- "@platformatic/generators": "3.35.0",
77
- "@platformatic/itc": "3.35.0",
78
- "@platformatic/telemetry": "3.35.0",
79
- "@platformatic/metrics": "3.35.0"
74
+ "@platformatic/basic": "3.36.0",
75
+ "@platformatic/foundation": "3.36.0",
76
+ "@platformatic/itc": "3.36.0",
77
+ "@platformatic/generators": "3.36.0",
78
+ "@platformatic/metrics": "3.36.0",
79
+ "@platformatic/telemetry": "3.36.0"
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.35.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.36.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Runtime Config",
5
5
  "type": "object",
@@ -2070,6 +2070,10 @@
2070
2070
  }
2071
2071
  },
2072
2072
  "additionalProperties": false
2073
+ },
2074
+ "socket": {
2075
+ "type": "string",
2076
+ "description": "Custom path for the control socket. If not specified, uses the default platform-specific location."
2073
2077
  }
2074
2078
  },
2075
2079
  "additionalProperties": false