@platformatic/basic 3.9.0 → 3.10.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
@@ -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;
@@ -308,6 +309,7 @@ export interface PlatformaticBasicConfig {
308
309
  timeWindowSec?: number;
309
310
  cooldownSec?: number;
310
311
  scaleIntervalSec?: number;
312
+ gracePeriod?: number;
311
313
  };
312
314
  inspectorOptions?: {
313
315
  host?: string;
package/index.d.ts CHANGED
@@ -22,7 +22,6 @@ export declare const schemaOptions: Partial<Record<string, unknown>>
22
22
 
23
23
  export class BaseCapability<Config = Record<string, any>, Options = BaseOptions> {
24
24
  basePath: string
25
- url: string
26
25
 
27
26
  constructor (
28
27
  type: string,
@@ -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.9.0",
3
+ "version": "3.10.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.9.0",
29
- "@platformatic/itc": "3.9.0",
30
- "@platformatic/telemetry": "3.9.0",
31
- "@platformatic/metrics": "3.9.0"
28
+ "@platformatic/foundation": "3.10.0",
29
+ "@platformatic/itc": "3.10.0",
30
+ "@platformatic/metrics": "3.10.0",
31
+ "@platformatic/telemetry": "3.10.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": "node --test --test-reporter=cleaner-spec-reporter --test-concurrency=1 --test-timeout=2000000 test/*.test.js test/**/*.test.js",
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.9.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/basic/3.10.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
@@ -1218,6 +1253,10 @@
1218
1253
  "scaleIntervalSec": {
1219
1254
  "type": "number",
1220
1255
  "minimum": 0
1256
+ },
1257
+ "gracePeriod": {
1258
+ "type": "number",
1259
+ "minimum": 0
1221
1260
  }
1222
1261
  },
1223
1262
  "additionalProperties": false