@platformatic/basic 2.19.0-alpha.4 → 2.19.0-alpha.6

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 CHANGED
@@ -13,11 +13,9 @@ import { NonZeroExitCode } from './errors.js'
13
13
  import { cleanBasePath } from './utils.js'
14
14
  import { ChildManager } from './worker/child-manager.js'
15
15
 
16
- const kITC = Symbol.for('plt.runtime.itc')
17
-
18
16
  export class BaseStackable {
19
17
  childManager
20
- #subprocess
18
+ subprocess
21
19
  #subprocessStarted
22
20
 
23
21
  constructor (type, version, options, root, configManager) {
@@ -70,8 +68,7 @@ export class BaseStackable {
70
68
  setGraphqlSchema: this.setGraphqlSchema.bind(this),
71
69
  setConnectionString: this.setConnectionString.bind(this),
72
70
  setBasePath: this.setBasePath.bind(this),
73
- runtimeBasePath: this.runtimeConfig?.basePath ?? null,
74
- invalidateHttpCache: this.#invalidateHttpCache.bind(this)
71
+ runtimeBasePath: this.runtimeConfig?.basePath ?? null
75
72
  })
76
73
  }
77
74
 
@@ -362,10 +359,6 @@ export class BaseStackable {
362
359
  return format === 'json' ? await this.metricsRegistry.getMetricsAsJSON() : await this.metricsRegistry.metrics()
363
360
  }
364
361
 
365
- async #invalidateHttpCache (opts = {}) {
366
- await globalThis[kITC].send('invalidateHttpCache', opts)
367
- }
368
-
369
362
  getMeta () {
370
363
  return {
371
364
  composer: {
@@ -379,6 +372,7 @@ export class BaseStackable {
379
372
 
380
373
  return {
381
374
  id: this.id,
375
+ config: this.configManager.current,
382
376
  serviceId: this.serviceId,
383
377
  workerId: this.workerId,
384
378
  // Always use URL to avoid serialization problem in Windows
@@ -3,16 +3,15 @@ import { createDirectory, ensureLoggableError } from '@platformatic/utils'
3
3
  import { once } from 'node:events'
4
4
  import { rm, writeFile } from 'node:fs/promises'
5
5
  import { createServer } from 'node:http'
6
- import { pathToFileURL } from 'node:url'
7
- import { register } from 'node:module'
6
+ import { createRequire, register } from 'node:module'
8
7
  import { platform, tmpdir } from 'node:os'
9
- import { dirname, resolve, join } from 'node:path'
8
+ import { dirname, join, resolve } from 'node:path'
9
+ import { pathToFileURL } from 'node:url'
10
10
  import { workerData } from 'node:worker_threads'
11
11
  import { request } from 'undici'
12
12
  import { WebSocketServer } from 'ws'
13
13
  import { exitCodes } from '../errors.js'
14
14
  import { ensureFileUrl } from '../utils.js'
15
- import { createRequire } from 'node:module'
16
15
 
17
16
  export const isWindows = platform() === 'win32'
18
17
 
@@ -11,7 +11,7 @@ import { basename, resolve } from 'node:path'
11
11
  import { fileURLToPath } from 'node:url'
12
12
  import { isMainThread } from 'node:worker_threads'
13
13
  import pino from 'pino'
14
- import { Agent, setGlobalDispatcher } from 'undici'
14
+ import { getGlobalDispatcher, setGlobalDispatcher } from 'undici'
15
15
  import { WebSocket } from 'ws'
16
16
  import { exitCodes } from '../errors.js'
17
17
  import { importFile } from '../utils.js'
@@ -269,8 +269,7 @@ export class ChildProcess extends ITC {
269
269
  }
270
270
 
271
271
  #setupInterceptors () {
272
- const globalDispatcher = new Agent().compose(createInterceptor(this))
273
- setGlobalDispatcher(globalDispatcher)
272
+ setGlobalDispatcher(getGlobalDispatcher().compose(createInterceptor(this)))
274
273
  }
275
274
 
276
275
  #setupHandlers () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/basic",
3
- "version": "2.19.0-alpha.4",
3
+ "version": "2.19.0-alpha.6",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -21,13 +21,13 @@
21
21
  "pino-abstract-transport": "^2.0.0",
22
22
  "semver": "^7.6.3",
23
23
  "split2": "^4.2.0",
24
- "undici": "7.0.0",
24
+ "undici": "^6.19.5",
25
25
  "ws": "^8.18.0",
26
- "@platformatic/itc": "2.19.0-alpha.4",
27
- "@platformatic/metrics": "2.19.0-alpha.4",
28
- "@platformatic/utils": "2.19.0-alpha.4",
29
- "@platformatic/telemetry": "2.19.0-alpha.4",
30
- "@platformatic/config": "2.19.0-alpha.4"
26
+ "@platformatic/config": "2.19.0-alpha.6",
27
+ "@platformatic/metrics": "2.19.0-alpha.6",
28
+ "@platformatic/utils": "2.19.0-alpha.6",
29
+ "@platformatic/telemetry": "2.19.0-alpha.6",
30
+ "@platformatic/itc": "2.19.0-alpha.6"
31
31
  },
32
32
  "devDependencies": {
33
33
  "borp": "^0.19.0",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.19.0-alpha.4.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.19.0-alpha.6.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Stackable",
5
5
  "type": "object",