@platformatic/vite 3.13.1 → 3.14.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.
Files changed (3) hide show
  1. package/config.d.ts +62 -3
  2. package/package.json +6 -6
  3. package/schema.json +126 -16
package/config.d.ts CHANGED
@@ -117,7 +117,20 @@ export interface PlatformaticViteConfig {
117
117
  services?: {
118
118
  [k: string]: unknown;
119
119
  }[];
120
- workers?: number | string;
120
+ workers?:
121
+ | number
122
+ | string
123
+ | {
124
+ static?: number;
125
+ dynamic?: boolean;
126
+ minimum?: number;
127
+ maximum?: number;
128
+ total?: number;
129
+ maxMemory?: number;
130
+ cooldown?: number;
131
+ gracePeriod?: number;
132
+ [k: string]: unknown;
133
+ };
121
134
  workersRestartDelay?: number | string;
122
135
  logger?: {
123
136
  level: (
@@ -325,6 +338,37 @@ export interface PlatformaticViteConfig {
325
338
  };
326
339
  plugins?: string[];
327
340
  timeout?: number | string;
341
+ /**
342
+ * Configuration for exporting metrics to an OTLP endpoint
343
+ */
344
+ otlpExporter?: {
345
+ /**
346
+ * Enable or disable OTLP metrics export
347
+ */
348
+ enabled?: boolean | string;
349
+ /**
350
+ * OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)
351
+ */
352
+ endpoint: string;
353
+ /**
354
+ * Interval in milliseconds between metric pushes
355
+ */
356
+ interval?: number | string;
357
+ /**
358
+ * Additional HTTP headers for authentication
359
+ */
360
+ headers?: {
361
+ [k: string]: string;
362
+ };
363
+ /**
364
+ * Service name for OTLP resource attributes
365
+ */
366
+ serviceName?: string;
367
+ /**
368
+ * Service version for OTLP resource attributes
369
+ */
370
+ serviceVersion?: string;
371
+ };
328
372
  };
329
373
  telemetry?: {
330
374
  enabled?: boolean | string;
@@ -408,13 +452,28 @@ export interface PlatformaticViteConfig {
408
452
  maxTotalMemory?: number;
409
453
  minWorkers?: number;
410
454
  maxWorkers?: number;
455
+ cooldownSec?: number;
456
+ gracePeriod?: number;
457
+ /**
458
+ * @deprecated
459
+ */
411
460
  scaleUpELU?: number;
461
+ /**
462
+ * @deprecated
463
+ */
412
464
  scaleDownELU?: number;
465
+ /**
466
+ * @deprecated
467
+ */
413
468
  timeWindowSec?: number;
469
+ /**
470
+ * @deprecated
471
+ */
414
472
  scaleDownTimeWindowSec?: number;
415
- cooldownSec?: number;
473
+ /**
474
+ * @deprecated
475
+ */
416
476
  scaleIntervalSec?: number;
417
- gracePeriod?: number;
418
477
  };
419
478
  inspectorOptions?: {
420
479
  host?: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/vite",
3
- "version": "3.13.1",
3
+ "version": "3.14.0",
4
4
  "description": "Platformatic Vite Capability",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -18,9 +18,9 @@
18
18
  "@fastify/static": "^8.0.0",
19
19
  "fastify": "^5.0.0",
20
20
  "semver": "^7.6.3",
21
- "@platformatic/basic": "3.13.1",
22
- "@platformatic/node": "3.13.1",
23
- "@platformatic/foundation": "3.13.1"
21
+ "@platformatic/basic": "3.14.0",
22
+ "@platformatic/foundation": "3.14.0",
23
+ "@platformatic/node": "3.14.0"
24
24
  },
25
25
  "devDependencies": {
26
26
  "cleaner-spec-reporter": "^0.5.0",
@@ -32,8 +32,8 @@
32
32
  "typescript": "^5.5.4",
33
33
  "vite": "^7.1.4",
34
34
  "ws": "^8.18.0",
35
- "@platformatic/gateway": "3.13.1",
36
- "@platformatic/service": "3.13.1"
35
+ "@platformatic/gateway": "3.14.0",
36
+ "@platformatic/service": "3.14.0"
37
37
  },
38
38
  "engines": {
39
39
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/vite/3.13.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/vite/3.14.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Vite Config",
5
5
  "type": "object",
@@ -429,11 +429,27 @@
429
429
  "workers": {
430
430
  "anyOf": [
431
431
  {
432
- "type": "number",
433
- "minimum": 1
432
+ "type": "number"
434
433
  },
435
434
  {
436
435
  "type": "string"
436
+ },
437
+ {
438
+ "type": "object",
439
+ "properties": {
440
+ "static": {
441
+ "type": "number",
442
+ "minimum": 1
443
+ },
444
+ "minimum": {
445
+ "type": "number",
446
+ "minimum": 1
447
+ },
448
+ "maximum": {
449
+ "type": "number",
450
+ "minimum": 0
451
+ }
452
+ }
437
453
  }
438
454
  ]
439
455
  },
@@ -654,6 +670,43 @@
654
670
  },
655
671
  {
656
672
  "type": "string"
673
+ },
674
+ {
675
+ "type": "object",
676
+ "properties": {
677
+ "static": {
678
+ "type": "number",
679
+ "minimum": 1
680
+ },
681
+ "dynamic": {
682
+ "type": "boolean",
683
+ "default": false
684
+ },
685
+ "minimum": {
686
+ "type": "number",
687
+ "minimum": 1
688
+ },
689
+ "maximum": {
690
+ "type": "number",
691
+ "minimum": 0
692
+ },
693
+ "total": {
694
+ "type": "number",
695
+ "minimum": 1
696
+ },
697
+ "maxMemory": {
698
+ "type": "number",
699
+ "minimum": 0
700
+ },
701
+ "cooldown": {
702
+ "type": "number",
703
+ "minimum": 0
704
+ },
705
+ "gracePeriod": {
706
+ "type": "number",
707
+ "minimum": 0
708
+ }
709
+ }
657
710
  }
658
711
  ]
659
712
  },
@@ -1430,6 +1483,58 @@
1430
1483
  }
1431
1484
  ],
1432
1485
  "default": 10000
1486
+ },
1487
+ "otlpExporter": {
1488
+ "type": "object",
1489
+ "description": "Configuration for exporting metrics to an OTLP endpoint",
1490
+ "properties": {
1491
+ "enabled": {
1492
+ "anyOf": [
1493
+ {
1494
+ "type": "boolean"
1495
+ },
1496
+ {
1497
+ "type": "string"
1498
+ }
1499
+ ],
1500
+ "description": "Enable or disable OTLP metrics export"
1501
+ },
1502
+ "endpoint": {
1503
+ "type": "string",
1504
+ "description": "OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)"
1505
+ },
1506
+ "interval": {
1507
+ "anyOf": [
1508
+ {
1509
+ "type": "integer"
1510
+ },
1511
+ {
1512
+ "type": "string"
1513
+ }
1514
+ ],
1515
+ "default": 60000,
1516
+ "description": "Interval in milliseconds between metric pushes"
1517
+ },
1518
+ "headers": {
1519
+ "type": "object",
1520
+ "additionalProperties": {
1521
+ "type": "string"
1522
+ },
1523
+ "description": "Additional HTTP headers for authentication"
1524
+ },
1525
+ "serviceName": {
1526
+ "type": "string",
1527
+ "description": "Service name for OTLP resource attributes"
1528
+ },
1529
+ "serviceVersion": {
1530
+ "type": "string",
1531
+ "description": "Service version for OTLP resource attributes"
1532
+ }
1533
+ },
1534
+ "required": [
1535
+ "endpoint"
1536
+ ],
1537
+ "additionalProperties": false
1433
1538
  }
1434
1539
  },
1435
1540
  "additionalProperties": false
@@ -1589,35 +1694,40 @@
1589
1694
  "type": "number",
1590
1695
  "minimum": 1
1591
1696
  },
1697
+ "cooldownSec": {
1698
+ "type": "number",
1699
+ "minimum": 0
1700
+ },
1701
+ "gracePeriod": {
1702
+ "type": "number",
1703
+ "minimum": 0
1704
+ },
1592
1705
  "scaleUpELU": {
1593
1706
  "type": "number",
1594
1707
  "minimum": 0,
1595
- "maximum": 1
1708
+ "maximum": 1,
1709
+ "deprecated": true
1596
1710
  },
1597
1711
  "scaleDownELU": {
1598
1712
  "type": "number",
1599
1713
  "minimum": 0,
1600
- "maximum": 1
1714
+ "maximum": 1,
1715
+ "deprecated": true
1601
1716
  },
1602
1717
  "timeWindowSec": {
1603
1718
  "type": "number",
1604
- "minimum": 0
1719
+ "minimum": 0,
1720
+ "deprecated": true
1605
1721
  },
1606
1722
  "scaleDownTimeWindowSec": {
1607
1723
  "type": "number",
1608
- "minimum": 0
1609
- },
1610
- "cooldownSec": {
1611
- "type": "number",
1612
- "minimum": 0
1724
+ "minimum": 0,
1725
+ "deprecated": true
1613
1726
  },
1614
1727
  "scaleIntervalSec": {
1615
1728
  "type": "number",
1616
- "minimum": 0
1617
- },
1618
- "gracePeriod": {
1619
- "type": "number",
1620
- "minimum": 0
1729
+ "minimum": 0,
1730
+ "deprecated": true
1621
1731
  }
1622
1732
  },
1623
1733
  "additionalProperties": false