@platformatic/basic 2.2.0 → 2.2.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/lib/base.js +3 -1
- package/lib/worker/child-process.js +4 -0
- package/lib/worker/listeners.js +7 -1
- package/package.json +7 -7
- package/schema.json +1 -1
package/lib/base.js
CHANGED
|
@@ -141,7 +141,8 @@ export class BaseStackable {
|
|
|
141
141
|
root: pathToFileURL(this.root).toString(),
|
|
142
142
|
basePath,
|
|
143
143
|
logLevel: this.logger.level,
|
|
144
|
-
port: (this.isEntrypoint ? this.serverConfig?.port || 0 : undefined) ?? true
|
|
144
|
+
port: (this.isEntrypoint ? this.serverConfig?.port || 0 : undefined) ?? true,
|
|
145
|
+
host: (this.isEntrypoint ? this.serverConfig?.hostname : undefined) ?? true
|
|
145
146
|
}
|
|
146
147
|
})
|
|
147
148
|
|
|
@@ -191,6 +192,7 @@ export class BaseStackable {
|
|
|
191
192
|
basePath,
|
|
192
193
|
logLevel: this.logger.level,
|
|
193
194
|
port: (this.isEntrypoint ? this.serverConfig?.port || 0 : undefined) ?? true,
|
|
195
|
+
host: (this.isEntrypoint ? this.serverConfig?.hostname : undefined) ?? true,
|
|
194
196
|
telemetry: this.telemetryConfig
|
|
195
197
|
}
|
|
196
198
|
})
|
|
@@ -177,10 +177,14 @@ export class ChildProcess extends ITC {
|
|
|
177
177
|
const subscribers = {
|
|
178
178
|
asyncStart ({ options }) {
|
|
179
179
|
const port = globalThis.platformatic.port
|
|
180
|
+
const host = globalThis.platformatic.host
|
|
180
181
|
|
|
181
182
|
if (port !== false) {
|
|
182
183
|
options.port = typeof port === 'number' ? port : 0
|
|
183
184
|
}
|
|
185
|
+
if (typeof host === 'string') {
|
|
186
|
+
options.host = host
|
|
187
|
+
}
|
|
184
188
|
},
|
|
185
189
|
asyncEnd: ({ server }) => {
|
|
186
190
|
tracingChannel('net.server.listen').unsubscribe(subscribers)
|
package/lib/worker/listeners.js
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { withResolvers } from '@platformatic/utils'
|
|
2
2
|
import { subscribe, tracingChannel, unsubscribe } from 'node:diagnostics_channel'
|
|
3
3
|
|
|
4
|
-
export function createServerListener (
|
|
4
|
+
export function createServerListener (
|
|
5
|
+
overridePort = true,
|
|
6
|
+
overrideHost = true
|
|
7
|
+
) {
|
|
5
8
|
const { promise, resolve, reject } = withResolvers()
|
|
6
9
|
|
|
7
10
|
const subscribers = {
|
|
@@ -9,6 +12,9 @@ export function createServerListener (overridePort = true) {
|
|
|
9
12
|
if (overridePort !== false) {
|
|
10
13
|
options.port = typeof overridePort === 'number' ? overridePort : 0
|
|
11
14
|
}
|
|
15
|
+
if (typeof overrideHost === 'string') {
|
|
16
|
+
options.host = overrideHost
|
|
17
|
+
}
|
|
12
18
|
},
|
|
13
19
|
asyncEnd ({ server }) {
|
|
14
20
|
resolve(server)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/basic",
|
|
3
|
-
"version": "2.2.
|
|
3
|
+
"version": "2.2.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -23,10 +23,10 @@
|
|
|
23
23
|
"split2": "^4.2.0",
|
|
24
24
|
"undici": "^6.19.5",
|
|
25
25
|
"ws": "^8.18.0",
|
|
26
|
-
"@platformatic/
|
|
27
|
-
"@platformatic/telemetry": "2.2.
|
|
28
|
-
"@platformatic/utils": "2.2.
|
|
29
|
-
"@platformatic/
|
|
26
|
+
"@platformatic/itc": "2.2.1",
|
|
27
|
+
"@platformatic/telemetry": "2.2.1",
|
|
28
|
+
"@platformatic/utils": "2.2.1",
|
|
29
|
+
"@platformatic/config": "2.2.1"
|
|
30
30
|
},
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"borp": "^0.17.0",
|
|
@@ -40,8 +40,8 @@
|
|
|
40
40
|
"react-dom": "^18.3.1",
|
|
41
41
|
"typescript": "^5.5.4",
|
|
42
42
|
"vite": "^5.4.0",
|
|
43
|
-
"@platformatic/composer": "2.2.
|
|
44
|
-
"@platformatic/service": "2.2.
|
|
43
|
+
"@platformatic/composer": "2.2.1",
|
|
44
|
+
"@platformatic/service": "2.2.1"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|
|
47
47
|
"gen-schema": "node lib/schema.js > schema.json",
|
package/schema.json
CHANGED