@platformatic/service 1.3.1 → 1.4.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/index.d.ts +6 -2
- package/index.js +6 -4
- package/package.json +6 -6
package/index.d.ts
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/* eslint-disable @typescript-eslint/triple-slash-reference */
|
|
2
2
|
/// <reference types="mercurius" />
|
|
3
3
|
/// <reference types="@fastify/swagger" />
|
|
4
|
-
import { FastifyInstance } from 'fastify'
|
|
4
|
+
import { FastifyInstance, FastifyBaseLogger } from 'fastify'
|
|
5
5
|
import ConfigManager from '@platformatic/config'
|
|
6
6
|
import type { IConfigManagerOptions } from '@platformatic/config'
|
|
7
7
|
import { PlatformaticService } from './config'
|
|
8
8
|
import type { JSONSchemaType } from 'ajv'
|
|
9
|
-
|
|
10
9
|
export interface PlatformaticApp<T> {
|
|
11
10
|
configManager: ConfigManager<T>
|
|
12
11
|
config: T
|
|
@@ -39,8 +38,13 @@ interface SchemaExport {
|
|
|
39
38
|
schema: JSONSchemaType<PlatformaticServiceConfig>
|
|
40
39
|
}
|
|
41
40
|
|
|
41
|
+
interface TSCompiler {
|
|
42
|
+
compile: (cwd: string, config: object, originalLogger: FastifyBaseLogger) => Promise<boolean>
|
|
43
|
+
}
|
|
42
44
|
export const schema: SchemaExport
|
|
43
45
|
|
|
44
46
|
export declare const platformaticService: Stackable<PlatformaticServiceConfig>
|
|
45
47
|
|
|
46
48
|
export default platformaticService
|
|
49
|
+
|
|
50
|
+
export const tsCompiler: TSCompiler
|
package/index.js
CHANGED
|
@@ -27,6 +27,12 @@ async function platformaticService (app, opts, toLoad = []) {
|
|
|
27
27
|
app.register(setupMetrics, config.metrics)
|
|
28
28
|
}
|
|
29
29
|
|
|
30
|
+
// This must be done before loading the plugins, so they can inspect if the
|
|
31
|
+
// openTelemetry decoretor exists and then configure accordingly.
|
|
32
|
+
if (isKeyEnabled('telemetry', config)) {
|
|
33
|
+
await app.register(telemetry, config.telemetry)
|
|
34
|
+
}
|
|
35
|
+
|
|
30
36
|
if (Array.isArray(toLoad)) {
|
|
31
37
|
for (const plugin of toLoad) {
|
|
32
38
|
await app.register(plugin)
|
|
@@ -43,10 +49,6 @@ async function platformaticService (app, opts, toLoad = []) {
|
|
|
43
49
|
await app.register(setupGraphQL, serviceConfig.graphql)
|
|
44
50
|
}
|
|
45
51
|
|
|
46
|
-
if (config.telemetry) {
|
|
47
|
-
app.register(telemetry, config.telemetry)
|
|
48
|
-
}
|
|
49
|
-
|
|
50
52
|
if (isKeyEnabled('clients', config)) {
|
|
51
53
|
app.register(setupClients, config.clients)
|
|
52
54
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/service",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -67,11 +67,11 @@
|
|
|
67
67
|
"pino-pretty": "^10.2.0",
|
|
68
68
|
"rfdc": "^1.3.0",
|
|
69
69
|
"ua-parser-js": "^1.0.36",
|
|
70
|
-
"@platformatic/client": "1.
|
|
71
|
-
"@platformatic/config": "1.
|
|
72
|
-
"@platformatic/swagger-ui-theme": "1.
|
|
73
|
-
"@platformatic/telemetry": "1.
|
|
74
|
-
"@platformatic/utils": "1.
|
|
70
|
+
"@platformatic/client": "1.4.0",
|
|
71
|
+
"@platformatic/config": "1.4.0",
|
|
72
|
+
"@platformatic/swagger-ui-theme": "1.4.0",
|
|
73
|
+
"@platformatic/telemetry": "1.4.0",
|
|
74
|
+
"@platformatic/utils": "1.4.0"
|
|
75
75
|
},
|
|
76
76
|
"standard": {
|
|
77
77
|
"ignore": [
|