@platformatic/runtime 1.52.0 → 1.52.2

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.
@@ -0,0 +1,33 @@
1
+ {
2
+ "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
3
+ "entrypoint": "serviceApp",
4
+ "allowCycles": true,
5
+ "hotReload": false,
6
+ "managementApi": false,
7
+ "autoload": {
8
+ "path": "../monorepo",
9
+ "exclude": [
10
+ "docs",
11
+ "composerApp"
12
+ ],
13
+ "mappings": {
14
+ "serviceAppWithLogger": {
15
+ "id": "with-logger",
16
+ "config": "platformatic.service.json"
17
+ },
18
+ "serviceAppWithMultiplePlugins": {
19
+ "id": "multi-plugin-service",
20
+ "config": "platformatic.service.json"
21
+ },
22
+ "dbApp": {
23
+ "id": "db-app",
24
+ "config": "platformatic.db.json"
25
+ }
26
+ }
27
+ },
28
+ "metrics": {
29
+ "labels": {
30
+ "app": "serviceApp"
31
+ }
32
+ }
33
+ }
package/lib/app.js CHANGED
@@ -275,16 +275,17 @@ class PlatformaticApp extends EventEmitter {
275
275
  configManager.current.metrics
276
276
  ) {
277
277
  const labels = configManager.current.metrics?.labels || {}
278
+ const serviceId = this.appConfig.id
278
279
  configManager.update({
279
280
  ...configManager.current,
280
281
  metrics: {
281
282
  server: 'hide',
282
283
  defaultMetrics: { enabled: this.appConfig.entrypoint },
284
+ ...configManager.current.metrics,
283
285
  labels: {
284
- serviceId: this.appConfig.id,
286
+ serviceId,
285
287
  ...labels
286
- },
287
- ...configManager.current.metrics
288
+ }
288
289
  }
289
290
  })
290
291
  }
@@ -442,7 +442,6 @@ class RuntimeGenerator extends BaseGenerator {
442
442
  envTool.addKey(key, value)
443
443
  })
444
444
  }
445
-
446
445
  // update runtime package.json dependencies
447
446
  currrentPackageJson.dependencies = {
448
447
  ...currrentPackageJson.dependencies,
@@ -454,6 +453,20 @@ class RuntimeGenerator extends BaseGenerator {
454
453
  contents: JSON.stringify(currrentPackageJson, null, 2)
455
454
  })
456
455
 
456
+ // set new entrypoint if specified
457
+ const newEntrypoint = newConfig.entrypoint
458
+ if (newEntrypoint) {
459
+ // load platformatic.json runtime config
460
+ const runtimePkgConfigFileData = JSON.parse(await readFile(join(this.targetDirectory, 'platformatic.json'), 'utf-8'))
461
+
462
+ this.setEntryPoint(newEntrypoint)
463
+ runtimePkgConfigFileData.entrypoint = newEntrypoint
464
+ this.addFile({
465
+ path: '',
466
+ file: 'platformatic.json',
467
+ contents: JSON.stringify(runtimePkgConfigFileData, null, 2)
468
+ })
469
+ }
457
470
  await this.writeFiles()
458
471
  // save new env
459
472
  await envTool.save()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "1.52.0",
3
+ "version": "1.52.2",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -34,8 +34,8 @@
34
34
  "typescript": "^5.4.2",
35
35
  "undici-oidc-interceptor": "^0.5.0",
36
36
  "why-is-node-running": "^2.2.2",
37
- "@platformatic/sql-graphql": "1.52.0",
38
- "@platformatic/sql-mapper": "1.52.0"
37
+ "@platformatic/sql-graphql": "1.52.2",
38
+ "@platformatic/sql-mapper": "1.52.2"
39
39
  },
40
40
  "dependencies": {
41
41
  "@fastify/error": "^3.4.1",
@@ -63,14 +63,14 @@
63
63
  "undici": "^6.9.0",
64
64
  "why-is-node-running": "^2.2.2",
65
65
  "ws": "^8.16.0",
66
- "@platformatic/bus": "1.52.0",
67
- "@platformatic/config": "1.52.0",
68
- "@platformatic/db": "1.52.0",
69
- "@platformatic/generators": "1.52.0",
70
- "@platformatic/telemetry": "1.52.0",
71
- "@platformatic/service": "1.52.0",
72
- "@platformatic/composer": "1.52.0",
73
- "@platformatic/utils": "1.52.0"
66
+ "@platformatic/composer": "1.52.2",
67
+ "@platformatic/config": "1.52.2",
68
+ "@platformatic/db": "1.52.2",
69
+ "@platformatic/generators": "1.52.2",
70
+ "@platformatic/service": "1.52.2",
71
+ "@platformatic/telemetry": "1.52.2",
72
+ "@platformatic/bus": "1.52.2",
73
+ "@platformatic/utils": "1.52.2"
74
74
  },
75
75
  "standard": {
76
76
  "ignore": [