@platformatic/node 3.38.1 → 3.39.0

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 CHANGED
@@ -55,6 +55,10 @@ export interface PlatformaticNodeJsConfig {
55
55
  customLevels?: {
56
56
  [k: string]: unknown;
57
57
  };
58
+ openTelemetryExporter?: {
59
+ protocol: "grpc" | "http";
60
+ url: string;
61
+ };
58
62
  [k: string]: unknown;
59
63
  };
60
64
  server?: {
@@ -186,6 +190,10 @@ export interface PlatformaticNodeJsConfig {
186
190
  customLevels?: {
187
191
  [k: string]: unknown;
188
192
  };
193
+ openTelemetryExporter?: {
194
+ protocol: "grpc" | "http";
195
+ url: string;
196
+ };
189
197
  [k: string]: unknown;
190
198
  };
191
199
  server?: {
package/lib/capability.js CHANGED
@@ -259,7 +259,7 @@ export class NodeCapability extends BaseCapability {
259
259
  // Emit the close event so that an application can handle it
260
260
  const closeHandled = globalThis.platformatic.events.emit('close')
261
261
 
262
- if (!this.#isFastify && !this.#appClose && !closeHandled) {
262
+ if (!this.#isFastify && !this.#appClose && !closeHandled && !this.#app?.[Symbol.asyncDispose]) {
263
263
  this.logger.warn(
264
264
  `Please export a "close" function or register a "close" event handler in globalThis.platformatic.events for application "${this.applicationId}" to make sure resources have been closed properly and avoid exit timeouts.`
265
265
  )
@@ -292,6 +292,10 @@ export class NodeCapability extends BaseCapability {
292
292
  return this.#app.close()
293
293
  }
294
294
 
295
+ if (this.#app?.[Symbol.asyncDispose]) {
296
+ return this.#app[Symbol.asyncDispose]()
297
+ }
298
+
295
299
  /* c8 ignore next 3 */
296
300
  if (!this.#server?.listening) {
297
301
  return
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/node",
3
- "version": "3.38.1",
3
+ "version": "3.39.0",
4
4
  "description": "Platformatic Node.js Capability",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -18,9 +18,9 @@
18
18
  "@watchable/unpromise": "^1.0.2",
19
19
  "json5": "^2.2.3",
20
20
  "light-my-request": "^6.0.0",
21
- "@platformatic/basic": "3.38.1",
22
- "@platformatic/foundation": "3.38.1",
23
- "@platformatic/generators": "3.38.1"
21
+ "@platformatic/basic": "3.39.0",
22
+ "@platformatic/foundation": "3.39.0",
23
+ "@platformatic/generators": "3.39.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "cleaner-spec-reporter": "^0.5.0",
@@ -32,8 +32,8 @@
32
32
  "neostandard": "^0.12.0",
33
33
  "tsx": "^4.19.0",
34
34
  "typescript": "^5.5.4",
35
- "@platformatic/gateway": "3.38.1",
36
- "@platformatic/service": "3.38.1"
35
+ "@platformatic/service": "3.39.0",
36
+ "@platformatic/gateway": "3.39.0"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/node/3.38.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/node/3.39.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Node.js Config",
5
5
  "type": "object",
@@ -152,6 +152,26 @@
152
152
  "customLevels": {
153
153
  "type": "object",
154
154
  "additionalProperties": true
155
+ },
156
+ "openTelemetryExporter": {
157
+ "type": "object",
158
+ "properties": {
159
+ "protocol": {
160
+ "type": "string",
161
+ "enum": [
162
+ "grpc",
163
+ "http"
164
+ ]
165
+ },
166
+ "url": {
167
+ "type": "string"
168
+ }
169
+ },
170
+ "required": [
171
+ "protocol",
172
+ "url"
173
+ ],
174
+ "additionalProperties": false
155
175
  }
156
176
  },
157
177
  "default": {},
@@ -935,6 +955,26 @@
935
955
  "customLevels": {
936
956
  "type": "object",
937
957
  "additionalProperties": true
958
+ },
959
+ "openTelemetryExporter": {
960
+ "type": "object",
961
+ "properties": {
962
+ "protocol": {
963
+ "type": "string",
964
+ "enum": [
965
+ "grpc",
966
+ "http"
967
+ ]
968
+ },
969
+ "url": {
970
+ "type": "string"
971
+ }
972
+ },
973
+ "required": [
974
+ "protocol",
975
+ "url"
976
+ ],
977
+ "additionalProperties": false
938
978
  }
939
979
  },
940
980
  "default": {},