@platformatic/runtime 2.0.0-alpha.2 → 2.0.0-alpha.21

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 (177) hide show
  1. package/config.d.ts +218 -0
  2. package/eslint.config.js +8 -0
  3. package/fixtures/botched-start/platformatic.runtime.json +1 -1
  4. package/fixtures/botched-start/services/a/platformatic.service.json +1 -1
  5. package/fixtures/composerApp/platformatic.composer.json +1 -1
  6. package/fixtures/configs/invalid-entrypoint.json +1 -1
  7. package/fixtures/configs/invalid-schema-type.config.json +1 -1
  8. package/fixtures/configs/{invalid-autoload-with-services.json → invalid-web-with-services.json} +9 -5
  9. package/fixtures/configs/missing-property.config.json +1 -1
  10. package/fixtures/configs/missing-service-config.json +1 -1
  11. package/fixtures/configs/monorepo-composer-no-autoload.json +2 -2
  12. package/fixtures/configs/monorepo-composer.json +2 -2
  13. package/fixtures/configs/monorepo-create-cycle.json +2 -2
  14. package/fixtures/configs/monorepo-missing-dependencies.json +2 -2
  15. package/fixtures/configs/monorepo-no-cycles.json +2 -2
  16. package/fixtures/configs/monorepo-openapi.json +2 -2
  17. package/fixtures/configs/{monorepo-hotreload-env.json → monorepo-watch-env.json} +2 -2
  18. package/fixtures/configs/monorepo-watch-single.json +12 -0
  19. package/fixtures/configs/monorepo-watch.json +24 -9
  20. package/fixtures/configs/monorepo-with-dependencies.json +2 -2
  21. package/fixtures/configs/monorepo-with-management-api-without-metrics.json +21 -0
  22. package/fixtures/configs/monorepo-with-management-api.json +2 -2
  23. package/fixtures/configs/{monorepo-hotreload.json → monorepo-with-metrics.json} +5 -4
  24. package/fixtures/configs/monorepo.json +2 -2
  25. package/fixtures/configs/no-services.config.json +1 -1
  26. package/fixtures/configs/no-sources.config.json +1 -1
  27. package/fixtures/configs/service-throws-on-start.json +1 -1
  28. package/fixtures/configs/service-with-env-port.json +2 -2
  29. package/fixtures/configs/service-with-stdio.json +12 -0
  30. package/fixtures/configs/{hotreload.json → watch.json} +2 -2
  31. package/fixtures/crash-on-bootstrap/platformatic.runtime.json +15 -0
  32. package/fixtures/crash-on-bootstrap/services/service-1/platformatic.service.json +14 -0
  33. package/fixtures/crash-on-bootstrap/services/service-1/plugin.js +5 -0
  34. package/fixtures/crash-on-bootstrap/services/service-2/platformatic.service.json +14 -0
  35. package/fixtures/crash-on-bootstrap/services/service-2/plugin.js +5 -0
  36. package/fixtures/dbApp/platformatic.db.json +1 -1
  37. package/fixtures/dbAppNoName/platformatic.db.json +1 -1
  38. package/fixtures/dbAppNoPackageJson/platformatic.db.json +1 -1
  39. package/fixtures/dbAppWithMigrationError/platformatic.db.json +1 -1
  40. package/fixtures/do-not-reload-dependencies/platformatic.service.json +1 -1
  41. package/fixtures/do-not-restart-on-crash/platformatic.runtime.json +3 -2
  42. package/fixtures/do-not-restart-on-crash/services/a/platformatic.service.json +8 -6
  43. package/fixtures/express/platformatic.runtime.json +1 -1
  44. package/fixtures/express/services/a/platformatic.service.json +1 -1
  45. package/fixtures/express/services/b/platformatic.service.json +1 -1
  46. package/fixtures/external-client/platformatic.service.json +1 -1
  47. package/fixtures/interceptors/idp.js +2 -2
  48. package/fixtures/interceptors/platformatic.runtime.json +1 -1
  49. package/fixtures/interceptors/services/a/platformatic.service.json +1 -1
  50. package/fixtures/interceptors-2/platformatic.runtime.json +1 -1
  51. package/fixtures/interceptors-2/services/a/platformatic.service.json +1 -1
  52. package/fixtures/leven/platformatic.runtime.json +2 -2
  53. package/fixtures/leven/services/deeply-spittle/platformatic.service.json +1 -1
  54. package/fixtures/leven/services/rainy-empire/platformatic.composer.json +1 -1
  55. package/fixtures/management-api/platformatic.json +8 -3
  56. package/fixtures/management-api/services/service-1/platformatic.json +8 -5
  57. package/fixtures/management-api/services/service-1/plugin.js +4 -3
  58. package/fixtures/management-api/services/service-2/platformatic.json +1 -1
  59. package/fixtures/management-api/services/service-db/platformatic.db.json +1 -1
  60. package/fixtures/management-api-custom-labels/platformatic.json +2 -2
  61. package/fixtures/management-api-custom-labels/services/service-1/platformatic.json +1 -1
  62. package/fixtures/management-api-custom-labels/services/service-1/plugin.js +4 -3
  63. package/fixtures/management-api-custom-labels/services/service-2/platformatic.json +1 -1
  64. package/fixtures/management-api-custom-labels/services/service-db/platformatic.db.json +1 -1
  65. package/fixtures/management-api-without-metrics/platformatic.json +3 -2
  66. package/fixtures/management-api-without-metrics/services/service-1/platformatic.json +1 -1
  67. package/fixtures/monorepo/composerApp/platformatic.composer.json +1 -1
  68. package/fixtures/monorepo/dbApp/platformatic.db.json +1 -1
  69. package/fixtures/monorepo/serviceApp/platformatic.service.json +3 -2
  70. package/fixtures/monorepo/serviceApp/with-logger/with-logger.cjs +2 -2
  71. package/fixtures/monorepo/serviceApp/with-logger/with-logger.d.ts +7 -7
  72. package/fixtures/monorepo/serviceAppWithLogger/platformatic.service.json +1 -1
  73. package/fixtures/monorepo/serviceAppWithLogger/plugin.js +12 -0
  74. package/fixtures/monorepo/serviceAppWithMultiplePlugins/platformatic.service.json +3 -2
  75. package/fixtures/monorepo-missing-dependencies/composer/platformatic.json +1 -1
  76. package/fixtures/monorepo-openapi/serviceAppWithoutOpenapi/platformatic.service.json +1 -1
  77. package/fixtures/monorepo-watch/service1/platformatic.service.json +1 -1
  78. package/fixtures/monorepo-with-dependencies/main/platformatic.json +1 -1
  79. package/fixtures/monorepo-with-dependencies/service-1/platformatic.json +1 -1
  80. package/fixtures/monorepo-with-dependencies/service-2/platformatic.json +1 -1
  81. package/fixtures/no-env.service.json +1 -1
  82. package/fixtures/preload/platformatic.runtime.json +1 -1
  83. package/fixtures/preload/services/a/platformatic.service.json +1 -1
  84. package/fixtures/prom-server/platformatic.json +2 -2
  85. package/fixtures/prom-server/services/service-1/platformatic.json +1 -1
  86. package/fixtures/prom-server/services/service-2/platformatic.json +1 -1
  87. package/fixtures/restart-on-crash/platformatic.runtime.json +1 -1
  88. package/fixtures/restart-on-crash/services/a/platformatic.service.json +8 -6
  89. package/fixtures/sample-runtime/package.json +3 -3
  90. package/fixtures/sample-runtime/platformatic.json +2 -2
  91. package/fixtures/sample-runtime/services/rival/package.json +2 -2
  92. package/fixtures/sample-runtime/services/rival/platformatic.json +1 -1
  93. package/fixtures/sample-runtime-with-2-services/package.json +3 -3
  94. package/fixtures/sample-runtime-with-2-services/platformatic.json +2 -2
  95. package/fixtures/sample-runtime-with-2-services/services/foobar/package.json +2 -2
  96. package/fixtures/sample-runtime-with-2-services/services/foobar/platformatic.json +1 -1
  97. package/fixtures/sample-runtime-with-2-services/services/rival/package.json +2 -2
  98. package/fixtures/sample-runtime-with-2-services/services/rival/platformatic.json +1 -1
  99. package/fixtures/server/logger-transport/platformatic.runtime.json +2 -2
  100. package/fixtures/server/logger-transport/services/echo/platformatic.service.json +1 -1
  101. package/fixtures/server/overrides-service/platformatic.runtime.json +2 -2
  102. package/fixtures/server/overrides-service/services/echo/platformatic.service.json +1 -1
  103. package/fixtures/server/runtime-server/platformatic.runtime.json +2 -2
  104. package/fixtures/server/runtime-server/services/echo/platformatic.service.json +1 -1
  105. package/fixtures/serviceAppThrowsOnStart/platformatic.service.json +1 -1
  106. package/fixtures/stackables/node_modules/foo/foo.js +2 -1
  107. package/fixtures/start-command-in-runtime.js +1 -1
  108. package/fixtures/stdio/platformatic.service.json +6 -0
  109. package/fixtures/stdio/plugin.js +24 -0
  110. package/fixtures/telemetry/platformatic.runtime.json +2 -2
  111. package/fixtures/telemetry/services/echo/platformatic.service.json +1 -1
  112. package/fixtures/telemetry/services/echo/routes/span.js +16 -2
  113. package/fixtures/telemetry/services/service-1/platformatic.service.json +19 -0
  114. package/fixtures/telemetry/services/service-1/routes/echo.js +7 -0
  115. package/fixtures/typescript/platformatic.runtime.json +2 -2
  116. package/fixtures/typescript/services/composer/platformatic.composer.json +1 -1
  117. package/fixtures/typescript/services/movies/global.d.ts +2 -3
  118. package/fixtures/typescript/services/movies/platformatic.db.json +1 -1
  119. package/fixtures/typescript/services/movies/types/Movie.d.ts +3 -3
  120. package/fixtures/typescript/services/movies/types/index.d.ts +6 -6
  121. package/fixtures/typescript/services/titles/client/client.d.ts +35 -35
  122. package/fixtures/typescript/services/titles/platformatic.service.json +1 -1
  123. package/fixtures/typescript-custom-flags/platformatic.runtime.json +2 -2
  124. package/fixtures/typescript-custom-flags/services/composer/platformatic.composer.json +1 -1
  125. package/fixtures/typescript-custom-flags/services/movies/global.d.ts +2 -3
  126. package/fixtures/typescript-custom-flags/services/movies/platformatic.db.json +1 -1
  127. package/fixtures/typescript-custom-flags/services/movies/types/Movie.d.ts +3 -3
  128. package/fixtures/typescript-custom-flags/services/movies/types/index.d.ts +6 -6
  129. package/fixtures/typescript-custom-flags/services/titles/client/client.d.ts +35 -35
  130. package/fixtures/typescript-custom-flags/services/titles/platformatic.service.json +1 -1
  131. package/fixtures/typescript-no-env/platformatic.runtime.json +2 -2
  132. package/fixtures/typescript-no-env/services/composer/platformatic.composer.json +1 -1
  133. package/fixtures/typescript-no-env/services/movies/global.d.ts +2 -3
  134. package/fixtures/typescript-no-env/services/movies/platformatic.db.json +1 -1
  135. package/fixtures/typescript-no-env/services/movies/types/Movie.d.ts +3 -3
  136. package/fixtures/typescript-no-env/services/movies/types/index.d.ts +6 -6
  137. package/fixtures/typescript-no-env/services/titles/client/client.d.ts +35 -35
  138. package/fixtures/typescript-no-env/services/titles/platformatic.service.json +1 -1
  139. package/index.d.ts +7 -8
  140. package/index.js +18 -10
  141. package/index.test-d.ts +10 -12
  142. package/lib/build-server.js +11 -13
  143. package/lib/compile.js +11 -10
  144. package/lib/config.js +32 -19
  145. package/lib/dependencies.js +2 -1
  146. package/lib/errors.js +6 -3
  147. package/lib/generator/errors.js +1 -1
  148. package/lib/generator/runtime-generator.d.ts +15 -15
  149. package/lib/generator/runtime-generator.js +95 -66
  150. package/lib/logger.js +55 -0
  151. package/lib/management-api.js +40 -46
  152. package/lib/prom-server.js +5 -9
  153. package/lib/runtime.js +1012 -0
  154. package/lib/schema.js +109 -91
  155. package/lib/start.js +51 -108
  156. package/lib/upgrade.js +2 -5
  157. package/lib/utils.js +65 -1
  158. package/lib/versions/v1.36.0.js +1 -1
  159. package/lib/versions/v1.5.0.js +1 -1
  160. package/lib/versions/v2.0.0.js +26 -0
  161. package/lib/worker/app.js +266 -0
  162. package/lib/worker/default-stackable.js +33 -0
  163. package/lib/worker/itc.js +162 -0
  164. package/lib/worker/main.js +135 -0
  165. package/lib/worker/metrics.js +106 -0
  166. package/lib/worker/symbols.js +7 -0
  167. package/package.json +36 -34
  168. package/runtime.mjs +5 -5
  169. package/schema.json +639 -0
  170. package/lib/api-client.js +0 -500
  171. package/lib/api.js +0 -420
  172. package/lib/app.js +0 -397
  173. package/lib/load-config.js +0 -12
  174. package/lib/loader.mjs +0 -103
  175. package/lib/message-port-writable.js +0 -50
  176. package/lib/worker.js +0 -182
  177. /package/lib/{interceptors.js → worker/interceptors.js} +0 -0
package/config.d.ts ADDED
@@ -0,0 +1,218 @@
1
+ /* eslint-disable */
2
+ /**
3
+ * This file was automatically generated by json-schema-to-typescript.
4
+ * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,
5
+ * and run json-schema-to-typescript to regenerate this file.
6
+ */
7
+
8
+ export type HttpsSchemasPlatformaticDevPlatformaticRuntime200Alpha21Json = {
9
+ [k: string]: unknown;
10
+ } & {
11
+ $schema?: string;
12
+ preload?: string;
13
+ entrypoint?: string;
14
+ autoload?: {
15
+ path: string;
16
+ exclude?: string[];
17
+ mappings?: {
18
+ [k: string]: {
19
+ id: string;
20
+ config?: string;
21
+ useHttp?: boolean;
22
+ };
23
+ };
24
+ };
25
+ services?: {
26
+ [k: string]: unknown;
27
+ }[];
28
+ web?: {
29
+ [k: string]: unknown;
30
+ }[];
31
+ logger?: {
32
+ level: (
33
+ | ("fatal" | "error" | "warn" | "info" | "debug" | "trace" | "silent")
34
+ | {
35
+ [k: string]: unknown;
36
+ }
37
+ ) &
38
+ string;
39
+ transport?:
40
+ | {
41
+ target?: string;
42
+ options?: {
43
+ [k: string]: unknown;
44
+ };
45
+ }
46
+ | {
47
+ targets?: {
48
+ target?: string;
49
+ options?: {
50
+ [k: string]: unknown;
51
+ };
52
+ level?: string;
53
+ additionalProperties?: never;
54
+ [k: string]: unknown;
55
+ }[];
56
+ options?: {
57
+ [k: string]: unknown;
58
+ };
59
+ };
60
+ pipeline?: {
61
+ target?: string;
62
+ options?: {
63
+ [k: string]: unknown;
64
+ };
65
+ };
66
+ [k: string]: unknown;
67
+ };
68
+ server?: {
69
+ hostname?: string;
70
+ port?: number | string;
71
+ http2?: boolean;
72
+ https?: {
73
+ key:
74
+ | string
75
+ | {
76
+ path?: string;
77
+ }
78
+ | (
79
+ | string
80
+ | {
81
+ path?: string;
82
+ }
83
+ )[];
84
+ cert:
85
+ | string
86
+ | {
87
+ path?: string;
88
+ }
89
+ | (
90
+ | string
91
+ | {
92
+ path?: string;
93
+ }
94
+ )[];
95
+ };
96
+ };
97
+ restartOnError?: boolean | number;
98
+ undici?: {
99
+ agentOptions?: {
100
+ [k: string]: unknown;
101
+ };
102
+ interceptors?:
103
+ | UndiciInterceptor[]
104
+ | {
105
+ Client?: UndiciInterceptor[];
106
+ Pool?: UndiciInterceptor[];
107
+ Agent?: UndiciInterceptor[];
108
+ [k: string]: unknown;
109
+ };
110
+ [k: string]: unknown;
111
+ };
112
+ watch?: boolean | string;
113
+ managementApi?:
114
+ | boolean
115
+ | string
116
+ | {
117
+ logs?: {
118
+ maxSize?: number;
119
+ };
120
+ };
121
+ metrics?:
122
+ | boolean
123
+ | {
124
+ port?: number | string;
125
+ hostname?: string;
126
+ endpoint?: string;
127
+ auth?: {
128
+ username: string;
129
+ password: string;
130
+ };
131
+ labels?: {
132
+ [k: string]: string;
133
+ };
134
+ };
135
+ telemetry?: OpenTelemetry;
136
+ inspectorOptions?: {
137
+ host?: string;
138
+ port?: number;
139
+ breakFirstLine?: boolean;
140
+ watchDisabled?: boolean;
141
+ [k: string]: unknown;
142
+ };
143
+ };
144
+
145
+ export interface UndiciInterceptor {
146
+ module: string;
147
+ options: {
148
+ [k: string]: unknown;
149
+ };
150
+ [k: string]: unknown;
151
+ }
152
+ export interface OpenTelemetry {
153
+ /**
154
+ * The name of the service. Defaults to the folder name if not specified.
155
+ */
156
+ serviceName: string;
157
+ /**
158
+ * The version of the service (optional)
159
+ */
160
+ version?: string;
161
+ /**
162
+ * An array of paths to skip when creating spans. Useful for health checks and other endpoints that do not need to be traced.
163
+ */
164
+ skip?: {
165
+ /**
166
+ * The path to skip. Can be a string or a regex.
167
+ */
168
+ path?: string;
169
+ /**
170
+ * HTTP method to skip
171
+ */
172
+ method?: "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS";
173
+ [k: string]: unknown;
174
+ }[];
175
+ exporter?:
176
+ | {
177
+ type?: "console" | "otlp" | "zipkin" | "memory";
178
+ /**
179
+ * Options for the exporter. These are passed directly to the exporter.
180
+ */
181
+ options?: {
182
+ /**
183
+ * The URL to send the traces to. Not used for console or memory exporters.
184
+ */
185
+ url?: string;
186
+ /**
187
+ * Headers to send to the exporter. Not used for console or memory exporters.
188
+ */
189
+ headers?: {
190
+ [k: string]: unknown;
191
+ };
192
+ [k: string]: unknown;
193
+ };
194
+ additionalProperties?: never;
195
+ [k: string]: unknown;
196
+ }[]
197
+ | {
198
+ type?: "console" | "otlp" | "zipkin" | "memory";
199
+ /**
200
+ * Options for the exporter. These are passed directly to the exporter.
201
+ */
202
+ options?: {
203
+ /**
204
+ * The URL to send the traces to. Not used for console or memory exporters.
205
+ */
206
+ url?: string;
207
+ /**
208
+ * Headers to send to the exporter. Not used for console or memory exporters.
209
+ */
210
+ headers?: {
211
+ [k: string]: unknown;
212
+ };
213
+ [k: string]: unknown;
214
+ };
215
+ additionalProperties?: never;
216
+ [k: string]: unknown;
217
+ };
218
+ }
@@ -0,0 +1,8 @@
1
+ 'use strict'
2
+
3
+ const neostandard = require('neostandard')
4
+
5
+ module.exports = neostandard({
6
+ ts: true,
7
+ ignores: [...neostandard.resolveIgnoresFromGitignore(), 'test/tmp/**/*', 'dist/**/*'],
8
+ })
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v1.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "a",
4
4
  "autoload": {
5
5
  "path": "./services"
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v1.3.0/service",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/service/1.52.0.json",
3
3
  "server": {
4
4
  "logger": {
5
5
  "level": "warn"
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.23.2/composer",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/composer/1.52.0.json",
3
3
  "server": {
4
4
  "hostname": "127.0.0.1",
5
5
  "port": 0,
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "invalid",
4
4
  "autoload": {
5
5
  "path": "../monorepo",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.22.0/trickortreat",
2
+ "$schema": "https://schemas.platformatic.dev/trickortreat/0.22.0.json",
3
3
  "server": {
4
4
  "hostname": "127.0.0.1",
5
5
  "port": 0,
@@ -1,12 +1,9 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "db-app",
4
4
  "autoload": {
5
5
  "path": "../monorepo",
6
- "exclude": [
7
- "docs",
8
- "composerApp"
9
- ],
6
+ "exclude": ["docs", "composerApp"],
10
7
  "mappings": {
11
8
  "serviceAppWithLogger": {
12
9
  "id": "with-logger",
@@ -28,5 +25,12 @@
28
25
  "path": "../monorepo/serviceAppWithLogger",
29
26
  "config": "platformatic.service.json"
30
27
  }
28
+ ],
29
+ "web": [
30
+ {
31
+ "id": "with-logger",
32
+ "path": "../monorepo/serviceAppWithLogger",
33
+ "config": "platformatic.service.json"
34
+ }
31
35
  ]
32
36
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "serviceApp",
4
4
  "autoload": {
5
5
  "exclude": ["docs", "composerApp"],
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "serviceApp",
4
4
  "autoload": {
5
5
  "path": "../monorepo"
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "composerApp",
4
- "hotReload": false,
4
+ "watch": false,
5
5
  "services": [
6
6
  {
7
7
  "id": "with-logger",
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "composerApp",
4
- "hotReload": false,
4
+ "watch": false,
5
5
  "autoload": {
6
6
  "path": "../monorepo",
7
7
  "exclude": ["docs"],
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "with-logger",
4
- "hotReload": false,
4
+ "watch": false,
5
5
  "autoload": {
6
6
  "path": "../monorepo",
7
7
  "exclude": [
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "composer",
4
- "hotReload": false,
4
+ "watch": false,
5
5
  "managementApi": false,
6
6
  "autoload": {
7
7
  "path": "../monorepo-missing-dependencies"
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "serviceApp",
4
- "hotReload": false,
4
+ "watch": false,
5
5
  "autoload": {
6
6
  "path": "../monorepo",
7
7
  "exclude": ["docs", "composerApp"],
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.35.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "without-openapi",
4
- "hotReload": false,
4
+ "watch": false,
5
5
  "services": [
6
6
  {
7
7
  "id": "without-openapi",
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.33.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "serviceApp",
4
- "hotReload": "{PLT_HOT_RELOAD}",
4
+ "watch": "{PLT_WATCH}",
5
5
  "autoload": {
6
6
  "path": "../monorepo",
7
7
  "exclude": ["docs", "composerApp"],
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://platformatic.dev/schemas/v0.35.0/runtime",
3
+ "entrypoint": "service1",
4
+ "watch": true,
5
+ "services": [
6
+ {
7
+ "id": "service1",
8
+ "path": "../monorepo-watch/service1",
9
+ "config": "platformatic.service.json"
10
+ }
11
+ ]
12
+ }
@@ -1,12 +1,27 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.35.0/runtime",
3
- "entrypoint": "service1",
4
- "hotReload": true,
5
- "services": [
6
- {
7
- "id": "service1",
8
- "path": "../monorepo-watch/service1",
9
- "config": "platformatic.service.json"
2
+ "$schema": "https://platformatic.dev/schemas/v2.0.0/runtime",
3
+ "entrypoint": "serviceApp",
4
+ "watch": true,
5
+ "autoload": {
6
+ "path": "../monorepo",
7
+ "exclude": ["docs", "composerApp"],
8
+ "mappings": {
9
+ "serviceAppWithLogger": {
10
+ "id": "with-logger",
11
+ "config": "platformatic.service.json"
12
+ },
13
+ "serviceAppWithMultiplePlugins": {
14
+ "id": "multi-plugin-service",
15
+ "config": "platformatic.service.json"
16
+ },
17
+ "dbApp": {
18
+ "id": "db-app",
19
+ "config": "platformatic.db.json"
20
+ }
10
21
  }
11
- ]
22
+ },
23
+ "logger": {
24
+ "level": "trace"
25
+ },
26
+ "restartOnError": 1000
12
27
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v1.44.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "main",
4
- "hotReload": true,
4
+ "watch": true,
5
5
  "autoload": {
6
6
  "path": "../monorepo-with-dependencies"
7
7
  }
@@ -0,0 +1,21 @@
1
+ {
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.22.0.json",
3
+ "entrypoint": "serviceApp",
4
+ "watch": true,
5
+ "autoload": {
6
+ "path": "../monorepo",
7
+ "exclude": ["docs", "composerApp"],
8
+ "mappings": {
9
+ "serviceAppWithLogger": {
10
+ "id": "with-logger",
11
+ "config": "platformatic.service.json"
12
+ },
13
+ "serviceAppWithMultiplePlugins": {
14
+ "id": "multi-plugin-service",
15
+ "config": "platformatic.service.json"
16
+ }
17
+ }
18
+ },
19
+ "managementApi": {},
20
+ "metrics": false
21
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v1.21.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "serviceApp",
4
- "hotReload": false,
4
+ "watch": false,
5
5
  "autoload": {
6
6
  "path": "../monorepo",
7
7
  "exclude": ["docs", "composerApp"],
@@ -1,7 +1,8 @@
1
1
  {
2
2
  "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
3
3
  "entrypoint": "serviceApp",
4
- "hotReload": true,
4
+ "watch": false,
5
+ "managementApi": false,
5
6
  "autoload": {
6
7
  "path": "../monorepo",
7
8
  "exclude": [
@@ -23,9 +24,9 @@
23
24
  }
24
25
  }
25
26
  },
26
- "server": {
27
- "logger": {
28
- "level": "trace"
27
+ "metrics": {
28
+ "labels": {
29
+ "app": "serviceApp"
29
30
  }
30
31
  }
31
32
  }
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "serviceApp",
4
- "hotReload": false,
4
+ "watch": false,
5
5
  "managementApi": false,
6
6
  "autoload": {
7
7
  "path": "../monorepo",
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "doesNotExist",
4
4
  "services": []
5
5
  }
@@ -1,4 +1,4 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": ""
4
4
  }
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "serviceThrowsOnStart",
4
4
  "services": [
5
5
  {
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.20.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "serviceApp",
4
- "hotReload": false,
4
+ "watch": false,
5
5
  "managementApi": false,
6
6
  "autoload": {
7
7
  "path": "../monorepo",
@@ -0,0 +1,12 @@
1
+ {
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
+ "entrypoint": "stdio",
4
+ "managementApi": {},
5
+ "services": [
6
+ {
7
+ "id": "stdio",
8
+ "path": "../stdio",
9
+ "config": "platformatic.service.json"
10
+ }
11
+ ]
12
+ }
@@ -1,7 +1,7 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.32.0/runtime",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
3
  "entrypoint": "serviceApp",
4
- "hotReload": true,
4
+ "watch": true,
5
5
  "autoload": {
6
6
  "path": "../monorepo",
7
7
  "exclude": ["docs", "composerApp"],
@@ -0,0 +1,15 @@
1
+ {
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/runtime/1.52.0.json",
3
+ "entrypoint": "service-1",
4
+ "autoload": {
5
+ "path": "./services"
6
+ },
7
+ "restartOnError": 100,
8
+ "server": {
9
+ "hostname": "127.0.0.1",
10
+ "port": "0",
11
+ "logger": {
12
+ "level": "info"
13
+ }
14
+ }
15
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/service/1.52.0.json",
3
+ "server": {
4
+ "logger": {
5
+ "level": "warn"
6
+ }
7
+ },
8
+ "plugins": {
9
+ "paths": [{
10
+ "path": "plugin.js",
11
+ "encapsulate": false
12
+ }]
13
+ }
14
+ }
@@ -0,0 +1,5 @@
1
+ 'use strict'
2
+
3
+ module.exports = async function (app) {
4
+ app.log.info('Service 1 plugin')
5
+ }
@@ -0,0 +1,14 @@
1
+ {
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/service/1.52.0.json",
3
+ "server": {
4
+ "logger": {
5
+ "level": "warn"
6
+ }
7
+ },
8
+ "plugins": {
9
+ "paths": [{
10
+ "path": "plugin.js",
11
+ "encapsulate": false
12
+ }]
13
+ }
14
+ }
@@ -0,0 +1,5 @@
1
+ 'use strict'
2
+
3
+ module.exports = async function () {
4
+ throw new Error('Crash!')
5
+ }
@@ -1,5 +1,5 @@
1
1
  {
2
- "$schema": "https://platformatic.dev/schemas/v0.22.0/db",
2
+ "$schema": "https://schemas.platformatic.dev/@platformatic/db/1.52.0.json",
3
3
  "server": {
4
4
  "hostname": "127.0.0.1",
5
5
  "port": 0