@platformatic/basic 2.2.2-alpha.1 → 2.3.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.
@@ -176,6 +176,11 @@ export class ChildProcess extends ITC {
176
176
  #setupServer () {
177
177
  const subscribers = {
178
178
  asyncStart ({ options }) {
179
+ // Unix socket, do nothing
180
+ if (options.path) {
181
+ return
182
+ }
183
+
179
184
  const port = globalThis.platformatic.port
180
185
  const host = globalThis.platformatic.host
181
186
 
@@ -189,8 +194,15 @@ export class ChildProcess extends ITC {
189
194
  asyncEnd: ({ server }) => {
190
195
  tracingChannel('net.server.listen').unsubscribe(subscribers)
191
196
 
192
- const { family, address, port } = server.address()
193
- const url = new URL(family === 'IPv6' ? `http://[${address}]:${port}` : `http://${address}:${port}`).origin
197
+ const address = server.address()
198
+
199
+ // Unix socket, do nothing
200
+ if (typeof address === 'string') {
201
+ return
202
+ }
203
+
204
+ const { family, address: host, port } = address
205
+ const url = new URL(family === 'IPv6' ? `http://[${host}]:${port}` : `http://${host}:${port}`).origin
194
206
 
195
207
  this.notify('url', url)
196
208
  },
@@ -1,14 +1,16 @@
1
1
  import { withResolvers } from '@platformatic/utils'
2
2
  import { subscribe, tracingChannel, unsubscribe } from 'node:diagnostics_channel'
3
3
 
4
- export function createServerListener (
5
- overridePort = true,
6
- overrideHost = true
7
- ) {
4
+ export function createServerListener (overridePort = true, overrideHost = true) {
8
5
  const { promise, resolve, reject } = withResolvers()
9
6
 
10
7
  const subscribers = {
11
8
  asyncStart ({ options }) {
9
+ // Unix socket, do nothing
10
+ if (options.path) {
11
+ return
12
+ }
13
+
12
14
  if (overridePort !== false) {
13
15
  options.port = typeof overridePort === 'number' ? overridePort : 0
14
16
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/basic",
3
- "version": "2.2.2-alpha.1",
3
+ "version": "2.3.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/telemetry": "2.2.2-alpha.1",
27
- "@platformatic/config": "2.2.2-alpha.1",
28
- "@platformatic/itc": "2.2.2-alpha.1",
29
- "@platformatic/utils": "2.2.2-alpha.1"
26
+ "@platformatic/itc": "2.3.1",
27
+ "@platformatic/config": "2.3.1",
28
+ "@platformatic/utils": "2.3.1",
29
+ "@platformatic/telemetry": "2.3.1"
30
30
  },
31
31
  "devDependencies": {
32
32
  "borp": "^0.17.0",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.2.2-alpha.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.3.1.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Stackable",
5
5
  "type": "object",