@platformatic/basic 3.9.0 → 3.11.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 +4 -1
- package/index.d.ts +0 -1
- package/lib/worker/child-manager.js +6 -2
- package/package.json +11 -6
- package/schema.json +47 -5
package/config.d.ts
CHANGED
|
@@ -220,6 +220,7 @@ export interface PlatformaticBasicConfig {
|
|
|
220
220
|
};
|
|
221
221
|
};
|
|
222
222
|
plugins?: string[];
|
|
223
|
+
timeout?: number | string;
|
|
223
224
|
};
|
|
224
225
|
telemetry?: {
|
|
225
226
|
enabled?: boolean | string;
|
|
@@ -300,14 +301,16 @@ export interface PlatformaticBasicConfig {
|
|
|
300
301
|
verticalScaler?: {
|
|
301
302
|
enabled?: boolean;
|
|
302
303
|
maxTotalWorkers?: number;
|
|
304
|
+
maxTotalMemory?: number;
|
|
303
305
|
minWorkers?: number;
|
|
304
306
|
maxWorkers?: number;
|
|
305
307
|
scaleUpELU?: number;
|
|
306
308
|
scaleDownELU?: number;
|
|
307
|
-
minELUDiff?: number;
|
|
308
309
|
timeWindowSec?: number;
|
|
310
|
+
scaleDownTimeWindowSec?: number;
|
|
309
311
|
cooldownSec?: number;
|
|
310
312
|
scaleIntervalSec?: number;
|
|
313
|
+
gracePeriod?: number;
|
|
311
314
|
};
|
|
312
315
|
inspectorOptions?: {
|
|
313
316
|
host?: string;
|
package/index.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { pathToFileURL } from 'node:url'
|
|
|
10
10
|
import { request } from 'undici'
|
|
11
11
|
import { WebSocketServer } from 'ws'
|
|
12
12
|
import { exitCodes } from '../errors.js'
|
|
13
|
-
import { ensureFileUrl } from '../utils.js'
|
|
13
|
+
import { ensureFileUrl, importFile } from '../utils.js'
|
|
14
14
|
|
|
15
15
|
export const isWindows = platform() === 'win32'
|
|
16
16
|
|
|
@@ -185,9 +185,13 @@ export class ChildManager extends ITC {
|
|
|
185
185
|
return this.#clients
|
|
186
186
|
}
|
|
187
187
|
|
|
188
|
-
register () {
|
|
188
|
+
async register () {
|
|
189
189
|
Object.assign(globalThis.platformatic, this.#context)
|
|
190
190
|
register(this.#loader, { data: this.#context })
|
|
191
|
+
|
|
192
|
+
for (const script of this.#scripts) {
|
|
193
|
+
await importFile(script)
|
|
194
|
+
}
|
|
191
195
|
}
|
|
192
196
|
|
|
193
197
|
emit (...args) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/basic",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.11.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -25,10 +25,10 @@
|
|
|
25
25
|
"split2": "^4.2.0",
|
|
26
26
|
"undici": "^7.0.0",
|
|
27
27
|
"ws": "^8.18.0",
|
|
28
|
-
"@platformatic/foundation": "3.
|
|
29
|
-
"@platformatic/itc": "3.
|
|
30
|
-
"@platformatic/
|
|
31
|
-
"@platformatic/
|
|
28
|
+
"@platformatic/foundation": "3.11.0",
|
|
29
|
+
"@platformatic/itc": "3.11.0",
|
|
30
|
+
"@platformatic/metrics": "3.11.0",
|
|
31
|
+
"@platformatic/telemetry": "3.11.0"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"cleaner-spec-reporter": "^0.5.0",
|
|
@@ -38,13 +38,18 @@
|
|
|
38
38
|
"get-port": "^7.1.0",
|
|
39
39
|
"json-schema-to-typescript": "^15.0.0",
|
|
40
40
|
"neostandard": "^0.12.0",
|
|
41
|
+
"tsd": "^0.33.0",
|
|
41
42
|
"typescript": "^5.5.4"
|
|
42
43
|
},
|
|
44
|
+
"tsd": {
|
|
45
|
+
"directory": "test/types"
|
|
46
|
+
},
|
|
43
47
|
"engines": {
|
|
44
48
|
"node": ">=22.19.0"
|
|
45
49
|
},
|
|
46
50
|
"scripts": {
|
|
47
|
-
"test": "
|
|
51
|
+
"test:typescript": "tsd",
|
|
52
|
+
"test": "npm run test:typescript && node --test --test-reporter=cleaner-spec-reporter --test-concurrency=1 --test-timeout=2000000 test/*.test.js test/**/*.test.js",
|
|
48
53
|
"gen-schema": "node lib/schema.js > schema.json",
|
|
49
54
|
"gen-types": "json2ts > config.d.ts < schema.json",
|
|
50
55
|
"build": "npm run gen-schema && npm run gen-types",
|
package/schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://schemas.platformatic.dev/@platformatic/basic/3.
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/basic/3.11.0.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "Platformatic Basic Config",
|
|
5
5
|
"type": "object",
|
|
@@ -227,6 +227,30 @@
|
|
|
227
227
|
"nodeOptions": {
|
|
228
228
|
"type": "string"
|
|
229
229
|
},
|
|
230
|
+
"permissions": {
|
|
231
|
+
"type": "object",
|
|
232
|
+
"properties": {
|
|
233
|
+
"fs": {
|
|
234
|
+
"type": "object",
|
|
235
|
+
"properties": {
|
|
236
|
+
"read": {
|
|
237
|
+
"type": "array",
|
|
238
|
+
"items": {
|
|
239
|
+
"type": "string"
|
|
240
|
+
}
|
|
241
|
+
},
|
|
242
|
+
"write": {
|
|
243
|
+
"type": "array",
|
|
244
|
+
"items": {
|
|
245
|
+
"type": "string"
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
},
|
|
249
|
+
"additionalProperties": false
|
|
250
|
+
}
|
|
251
|
+
},
|
|
252
|
+
"additionalProperties": false
|
|
253
|
+
},
|
|
230
254
|
"telemetry": {
|
|
231
255
|
"type": "object",
|
|
232
256
|
"properties": {
|
|
@@ -1037,6 +1061,17 @@
|
|
|
1037
1061
|
}
|
|
1038
1062
|
]
|
|
1039
1063
|
}
|
|
1064
|
+
},
|
|
1065
|
+
"timeout": {
|
|
1066
|
+
"anyOf": [
|
|
1067
|
+
{
|
|
1068
|
+
"type": "integer"
|
|
1069
|
+
},
|
|
1070
|
+
{
|
|
1071
|
+
"type": "string"
|
|
1072
|
+
}
|
|
1073
|
+
],
|
|
1074
|
+
"default": 10000
|
|
1040
1075
|
}
|
|
1041
1076
|
},
|
|
1042
1077
|
"additionalProperties": false
|
|
@@ -1184,6 +1219,10 @@
|
|
|
1184
1219
|
"type": "number",
|
|
1185
1220
|
"minimum": 1
|
|
1186
1221
|
},
|
|
1222
|
+
"maxTotalMemory": {
|
|
1223
|
+
"type": "number",
|
|
1224
|
+
"minimum": 0
|
|
1225
|
+
},
|
|
1187
1226
|
"minWorkers": {
|
|
1188
1227
|
"type": "number",
|
|
1189
1228
|
"minimum": 1
|
|
@@ -1202,12 +1241,11 @@
|
|
|
1202
1241
|
"minimum": 0,
|
|
1203
1242
|
"maximum": 1
|
|
1204
1243
|
},
|
|
1205
|
-
"
|
|
1244
|
+
"timeWindowSec": {
|
|
1206
1245
|
"type": "number",
|
|
1207
|
-
"minimum": 0
|
|
1208
|
-
"maximum": 1
|
|
1246
|
+
"minimum": 0
|
|
1209
1247
|
},
|
|
1210
|
-
"
|
|
1248
|
+
"scaleDownTimeWindowSec": {
|
|
1211
1249
|
"type": "number",
|
|
1212
1250
|
"minimum": 0
|
|
1213
1251
|
},
|
|
@@ -1218,6 +1256,10 @@
|
|
|
1218
1256
|
"scaleIntervalSec": {
|
|
1219
1257
|
"type": "number",
|
|
1220
1258
|
"minimum": 0
|
|
1259
|
+
},
|
|
1260
|
+
"gracePeriod": {
|
|
1261
|
+
"type": "number",
|
|
1262
|
+
"minimum": 0
|
|
1221
1263
|
}
|
|
1222
1264
|
},
|
|
1223
1265
|
"additionalProperties": false
|