@platformatic/runtime 3.0.5 → 3.1.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
@@ -249,8 +249,7 @@ export type PlatformaticRuntimeConfig = {
249
249
  body?: string;
250
250
  };
251
251
  };
252
- additionalProperties?: never;
253
- [k: string]: unknown;
252
+ plugins?: string[];
254
253
  };
255
254
  telemetry?: {
256
255
  enabled?: boolean | string;
package/lib/generator.js CHANGED
@@ -30,7 +30,7 @@ const wrappableProperties = {
30
30
  }
31
31
 
32
32
  const engines = {
33
- node: '>=22.18.0'
33
+ node: '>=22.19.0'
34
34
  }
35
35
 
36
36
  export const ERROR_PREFIX = 'PLT_RUNTIME_GEN'
@@ -1,6 +1,9 @@
1
1
  import fastifyAccepts from '@fastify/accepts'
2
2
  import fastifyBasicAuth from '@fastify/basic-auth'
3
+ import { loadModule } from '@platformatic/foundation'
3
4
  import fastify from 'fastify'
5
+ import { createRequire } from 'node:module'
6
+ import { resolve } from 'node:path'
4
7
 
5
8
  const DEFAULT_HOSTNAME = '0.0.0.0'
6
9
  const DEFAULT_PORT = 9090
@@ -218,6 +221,12 @@ export async function startPrometheusServer (runtime, opts) {
218
221
  })
219
222
  }
220
223
 
224
+ const require = createRequire(resolve(import.meta.filename))
225
+ for (const pluginPath of opts.plugins ?? []) {
226
+ const plugin = await loadModule(require, pluginPath)
227
+ await promServer.register(plugin)
228
+ }
229
+
221
230
  await promServer.listen({ port, host })
222
231
  return promServer
223
232
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "3.0.5",
3
+ "version": "3.1.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -34,14 +34,14 @@
34
34
  "typescript": "^5.5.4",
35
35
  "undici-oidc-interceptor": "^0.5.0",
36
36
  "why-is-node-running": "^2.2.2",
37
- "@platformatic/composer": "3.0.5",
38
- "@platformatic/gateway": "3.0.5",
39
- "@platformatic/db": "3.0.5",
40
- "@platformatic/node": "3.0.5",
41
- "@platformatic/service": "3.0.5",
42
- "@platformatic/sql-graphql": "3.0.5",
43
- "@platformatic/sql-mapper": "3.0.5",
44
- "@platformatic/wattpm-pprof-capture": "3.0.5"
37
+ "@platformatic/composer": "3.1.0",
38
+ "@platformatic/db": "3.1.0",
39
+ "@platformatic/node": "3.1.0",
40
+ "@platformatic/gateway": "3.1.0",
41
+ "@platformatic/service": "3.1.0",
42
+ "@platformatic/wattpm-pprof-capture": "3.1.0",
43
+ "@platformatic/sql-graphql": "3.1.0",
44
+ "@platformatic/sql-mapper": "3.1.0"
45
45
  },
46
46
  "dependencies": {
47
47
  "@fastify/accepts": "^5.0.0",
@@ -71,15 +71,15 @@
71
71
  "undici": "^7.0.0",
72
72
  "undici-thread-interceptor": "^0.14.0",
73
73
  "ws": "^8.16.0",
74
- "@platformatic/basic": "3.0.5",
75
- "@platformatic/foundation": "3.0.5",
76
- "@platformatic/generators": "3.0.5",
77
- "@platformatic/itc": "3.0.5",
78
- "@platformatic/metrics": "3.0.5",
79
- "@platformatic/telemetry": "3.0.5"
74
+ "@platformatic/basic": "3.1.0",
75
+ "@platformatic/foundation": "3.1.0",
76
+ "@platformatic/generators": "3.1.0",
77
+ "@platformatic/itc": "3.1.0",
78
+ "@platformatic/metrics": "3.1.0",
79
+ "@platformatic/telemetry": "3.1.0"
80
80
  },
81
81
  "engines": {
82
- "node": ">=22.18.0"
82
+ "node": ">=22.19.0"
83
83
  },
84
84
  "scripts": {
85
85
  "test": "npm run test:main && npm run test:api && npm run test:cli && npm run test:start && npm run test:multiple-workers",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.0.5.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/3.1.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Runtime Config",
5
5
  "type": "object",
@@ -1665,8 +1665,19 @@
1665
1665
  }
1666
1666
  ]
1667
1667
  },
1668
- "additionalProperties": false
1669
- }
1668
+ "plugins": {
1669
+ "type": "array",
1670
+ "items": {
1671
+ "anyOf": [
1672
+ {
1673
+ "type": "string",
1674
+ "resolvePath": true
1675
+ }
1676
+ ]
1677
+ }
1678
+ }
1679
+ },
1680
+ "additionalProperties": false
1670
1681
  }
1671
1682
  ]
1672
1683
  },