@platformatic/runtime 2.18.0 → 2.19.0-alpha.2
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 +1 -1
- package/lib/runtime.js +1 -1
- package/lib/worker/main.js +12 -6
- package/package.json +14 -14
- package/schema.json +1 -1
package/config.d.ts
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* and run json-schema-to-typescript to regenerate this file.
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type HttpsSchemasPlatformaticDevPlatformaticRuntime2190Alpha2Json = {
|
|
9
9
|
[k: string]: unknown;
|
|
10
10
|
} & {
|
|
11
11
|
$schema?: string;
|
package/lib/runtime.js
CHANGED
|
@@ -45,7 +45,7 @@ const COLLECT_METRICS_TIMEOUT = 1000
|
|
|
45
45
|
const MAX_BOOTSTRAP_ATTEMPTS = 5
|
|
46
46
|
|
|
47
47
|
const telemetryPath = require.resolve('@platformatic/telemetry')
|
|
48
|
-
const openTelemetrySetupPath = join(telemetryPath, '..', 'lib', 'node-telemetry.js')
|
|
48
|
+
const openTelemetrySetupPath = join(telemetryPath, '..', 'lib', 'node-http-telemetry.js')
|
|
49
49
|
|
|
50
50
|
class Runtime extends EventEmitter {
|
|
51
51
|
#configManager
|
package/lib/worker/main.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
+
const { EventEmitter } = require('node:events')
|
|
3
4
|
const { createRequire } = require('node:module')
|
|
4
5
|
const { hostname } = require('node:os')
|
|
5
6
|
const { join } = require('node:path')
|
|
@@ -35,7 +36,10 @@ globalThis[kId] = threadId
|
|
|
35
36
|
let app
|
|
36
37
|
|
|
37
38
|
const config = workerData.config
|
|
38
|
-
globalThis.platformatic = Object.assign(globalThis.platformatic ?? {}, {
|
|
39
|
+
globalThis.platformatic = Object.assign(globalThis.platformatic ?? {}, {
|
|
40
|
+
logger: createLogger(),
|
|
41
|
+
events: new EventEmitter()
|
|
42
|
+
})
|
|
39
43
|
|
|
40
44
|
function handleUnhandled (type, err) {
|
|
41
45
|
const label =
|
|
@@ -102,7 +106,12 @@ async function main () {
|
|
|
102
106
|
const { telemetry } = service
|
|
103
107
|
const hooks = telemetry ? createTelemetryThreadInterceptorHooks() : {}
|
|
104
108
|
// Setup mesh networker
|
|
105
|
-
const threadDispatcher = wire({
|
|
109
|
+
const threadDispatcher = wire({
|
|
110
|
+
port: parentPort,
|
|
111
|
+
useNetwork: service.useHttp,
|
|
112
|
+
timeout: config.serviceTimeout,
|
|
113
|
+
...hooks
|
|
114
|
+
})
|
|
106
115
|
|
|
107
116
|
// If the service is an entrypoint and runtime server config is defined, use it.
|
|
108
117
|
let serverConfig = null
|
|
@@ -191,10 +200,7 @@ function stripBasePath (basePath) {
|
|
|
191
200
|
|
|
192
201
|
if (headers) {
|
|
193
202
|
for (const key in headers) {
|
|
194
|
-
if (
|
|
195
|
-
key.toLowerCase() === 'location' &&
|
|
196
|
-
!headers[key].startsWith(basePath)
|
|
197
|
-
) {
|
|
203
|
+
if (key.toLowerCase() === 'location' && !headers[key].startsWith(basePath)) {
|
|
198
204
|
headers[key] = basePath + headers[key]
|
|
199
205
|
}
|
|
200
206
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/runtime",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.19.0-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -35,12 +35,12 @@
|
|
|
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": "2.
|
|
39
|
-
"@platformatic/
|
|
40
|
-
"@platformatic/
|
|
41
|
-
"@platformatic/service": "2.
|
|
42
|
-
"@platformatic/sql-graphql": "2.
|
|
43
|
-
"@platformatic/sql-mapper": "2.
|
|
38
|
+
"@platformatic/composer": "2.19.0-alpha.2",
|
|
39
|
+
"@platformatic/db": "2.19.0-alpha.2",
|
|
40
|
+
"@platformatic/node": "2.19.0-alpha.2",
|
|
41
|
+
"@platformatic/service": "2.19.0-alpha.2",
|
|
42
|
+
"@platformatic/sql-graphql": "2.19.0-alpha.2",
|
|
43
|
+
"@platformatic/sql-mapper": "2.19.0-alpha.2"
|
|
44
44
|
},
|
|
45
45
|
"dependencies": {
|
|
46
46
|
"@fastify/error": "^4.0.0",
|
|
@@ -70,13 +70,13 @@
|
|
|
70
70
|
"undici": "^6.9.0",
|
|
71
71
|
"undici-thread-interceptor": "^0.9.0",
|
|
72
72
|
"ws": "^8.16.0",
|
|
73
|
-
"@platformatic/basic": "2.
|
|
74
|
-
"@platformatic/config": "2.
|
|
75
|
-
"@platformatic/
|
|
76
|
-
"@platformatic/
|
|
77
|
-
"@platformatic/
|
|
78
|
-
"@platformatic/
|
|
79
|
-
"@platformatic/utils": "2.
|
|
73
|
+
"@platformatic/basic": "2.19.0-alpha.2",
|
|
74
|
+
"@platformatic/config": "2.19.0-alpha.2",
|
|
75
|
+
"@platformatic/generators": "2.19.0-alpha.2",
|
|
76
|
+
"@platformatic/itc": "2.19.0-alpha.2",
|
|
77
|
+
"@platformatic/ts-compiler": "2.19.0-alpha.2",
|
|
78
|
+
"@platformatic/telemetry": "2.19.0-alpha.2",
|
|
79
|
+
"@platformatic/utils": "2.19.0-alpha.2"
|
|
80
80
|
},
|
|
81
81
|
"scripts": {
|
|
82
82
|
"test": "npm run lint && borp --concurrency=1 --timeout=300000 && tsd",
|
package/schema.json
CHANGED