@platformatic/watt-extra 0.1.2 → 0.1.4

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.
Files changed (2) hide show
  1. package/lib/watt.js +6 -6
  2. package/package.json +4 -4
package/lib/watt.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { readFile } from 'node:fs/promises'
2
2
  import { join, resolve } from 'node:path'
3
3
  import { createRequire } from 'node:module'
4
- import { loadConfiguration } from '@platformatic/runtime'
5
4
 
6
5
  const require = createRequire(import.meta.url)
7
6
 
@@ -125,6 +124,7 @@ class Watt {
125
124
  async #loadAppConfig () {
126
125
  this.#logger.info('Loading app config')
127
126
  try {
127
+ const { loadConfiguration } = this.#require('@platformatic/runtime')
128
128
  const config = await loadConfiguration(this.#appDir)
129
129
  return config
130
130
  } catch (err) {
@@ -198,7 +198,7 @@ class Watt {
198
198
  port: this.#env.PLT_METRICS_PORT || 9090,
199
199
  labels: {
200
200
  serviceId: 'main',
201
- applicationId: this.#instanceConfig.applicationId,
201
+ applicationId: this.#instanceConfig?.applicationId,
202
202
  instanceId: this.#instanceId,
203
203
  },
204
204
  }
@@ -258,7 +258,7 @@ class Watt {
258
258
  this.#instanceConfig.iccServices.trafficante.url
259
259
  )
260
260
  return {
261
- module: this.#require.resolve(
261
+ module: require.resolve(
262
262
  'undici-traffic-interceptor'
263
263
  ),
264
264
  options: {
@@ -340,7 +340,7 @@ class Watt {
340
340
  }
341
341
 
342
342
  return {
343
- module: this.#require.resolve('undici-slicer-interceptor'),
343
+ module: require.resolve('undici-slicer-interceptor'),
344
344
  options: cacheConfig,
345
345
  }
346
346
  }
@@ -381,7 +381,7 @@ class Watt {
381
381
  url:
382
382
  this.#instanceConfig?.iccServices?.riskEngine?.url + '/v1/traces',
383
383
  headers: {
384
- 'x-platformatic-application-id': this.#instanceConfig.applicationId,
384
+ 'x-platformatic-application-id': this.#instanceConfig?.applicationId,
385
385
  },
386
386
  keepAlive: true,
387
387
  httpAgentOptions: {
@@ -406,7 +406,7 @@ class Watt {
406
406
  config.httpCache = {
407
407
  ...config.httpCache,
408
408
  cacheTagsHeader,
409
- store: this.#require.resolve('undici-cache-redis'),
409
+ store: require.resolve('undici-cache-redis'),
410
410
  clientOpts: httpCache,
411
411
  }
412
412
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/watt-extra",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "The Platformatic runtime manager",
5
5
  "type": "module",
6
6
  "scripts": {
@@ -32,9 +32,6 @@
32
32
  "@fastify/error": "^4.2.0",
33
33
  "@platformatic/runtime": "^3.0.1",
34
34
  "@platformatic/wattpm-pprof-capture": "^3.0.1",
35
- "undici-cache-redis": "^1.0.0",
36
- "undici-slicer-interceptor": "^0.4.1",
37
- "undici-traffic-interceptor": "^0.1.4",
38
35
  "avvio": "^9.1.0",
39
36
  "chalk": "^4.1.2",
40
37
  "commist": "^3.2.0",
@@ -45,6 +42,9 @@
45
42
  "pino": "^9.7.0",
46
43
  "pino-pretty": "^13.0.0",
47
44
  "undici": "^7.11.0",
45
+ "undici-cache-redis": "^1.0.0",
46
+ "undici-slicer-interceptor": "^0.4.1",
47
+ "undici-traffic-interceptor": "^0.1.4",
48
48
  "ws": "^8.18.3"
49
49
  }
50
50
  }