@platformatic/next 3.13.1 → 3.15.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
@@ -117,7 +117,20 @@ export interface PlatformaticNextJsConfig {
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: (
@@ -201,6 +214,7 @@ export interface PlatformaticNextJsConfig {
201
214
  rejectUnauthorized?: boolean;
202
215
  };
203
216
  };
217
+ reuseTcpPorts?: boolean;
204
218
  startTimeout?: number;
205
219
  restartOnError?: boolean | number;
206
220
  exitOnUnhandledErrors?: boolean;
@@ -325,6 +339,37 @@ export interface PlatformaticNextJsConfig {
325
339
  };
326
340
  plugins?: string[];
327
341
  timeout?: number | string;
342
+ /**
343
+ * Configuration for exporting metrics to an OTLP endpoint
344
+ */
345
+ otlpExporter?: {
346
+ /**
347
+ * Enable or disable OTLP metrics export
348
+ */
349
+ enabled?: boolean | string;
350
+ /**
351
+ * OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)
352
+ */
353
+ endpoint: string;
354
+ /**
355
+ * Interval in milliseconds between metric pushes
356
+ */
357
+ interval?: number | string;
358
+ /**
359
+ * Additional HTTP headers for authentication
360
+ */
361
+ headers?: {
362
+ [k: string]: string;
363
+ };
364
+ /**
365
+ * Service name for OTLP resource attributes
366
+ */
367
+ serviceName?: string;
368
+ /**
369
+ * Service version for OTLP resource attributes
370
+ */
371
+ serviceVersion?: string;
372
+ };
328
373
  };
329
374
  telemetry?: {
330
375
  enabled?: boolean | string;
@@ -408,13 +453,28 @@ export interface PlatformaticNextJsConfig {
408
453
  maxTotalMemory?: number;
409
454
  minWorkers?: number;
410
455
  maxWorkers?: number;
456
+ cooldownSec?: number;
457
+ gracePeriod?: number;
458
+ /**
459
+ * @deprecated
460
+ */
411
461
  scaleUpELU?: number;
462
+ /**
463
+ * @deprecated
464
+ */
412
465
  scaleDownELU?: number;
466
+ /**
467
+ * @deprecated
468
+ */
413
469
  timeWindowSec?: number;
470
+ /**
471
+ * @deprecated
472
+ */
414
473
  scaleDownTimeWindowSec?: number;
415
- cooldownSec?: number;
474
+ /**
475
+ * @deprecated
476
+ */
416
477
  scaleIntervalSec?: number;
417
- gracePeriod?: number;
418
478
  };
419
479
  inspectorOptions?: {
420
480
  host?: string;
package/lib/capability.js CHANGED
@@ -63,6 +63,8 @@ export class NextCapability extends BaseCapability {
63
63
  return this.url
64
64
  }
65
65
 
66
+ await super._start({ listen })
67
+
66
68
  this.on('config', config => {
67
69
  this.#basePath = config.basePath
68
70
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/next",
3
- "version": "3.13.1",
3
+ "version": "3.15.0",
4
4
  "description": "Platformatic Next.js Capability",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -23,8 +23,8 @@
23
23
  "iovalkey": "^0.3.0",
24
24
  "msgpackr": "^1.11.2",
25
25
  "semver": "^7.6.3",
26
- "@platformatic/foundation": "3.13.1",
27
- "@platformatic/basic": "3.13.1"
26
+ "@platformatic/foundation": "3.15.0",
27
+ "@platformatic/basic": "3.15.0"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@fastify/reply-from": "^12.0.0",
@@ -40,8 +40,8 @@
40
40
  "next": "^15.0.0",
41
41
  "typescript": "^5.5.4",
42
42
  "ws": "^8.18.0",
43
- "@platformatic/gateway": "3.13.1",
44
- "@platformatic/service": "3.13.1"
43
+ "@platformatic/gateway": "3.15.0",
44
+ "@platformatic/service": "3.15.0"
45
45
  },
46
46
  "engines": {
47
47
  "node": ">=22.19.0"
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/next/3.13.1.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/next/3.15.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Next.js Config",
5
5
  "type": "object",
@@ -426,14 +426,34 @@
426
426
  "useHttp": {
427
427
  "type": "boolean"
428
428
  },
429
+ "reuseTcpPorts": {
430
+ "type": "boolean",
431
+ "default": true
432
+ },
429
433
  "workers": {
430
434
  "anyOf": [
431
435
  {
432
- "type": "number",
433
- "minimum": 1
436
+ "type": "number"
434
437
  },
435
438
  {
436
439
  "type": "string"
440
+ },
441
+ {
442
+ "type": "object",
443
+ "properties": {
444
+ "static": {
445
+ "type": "number",
446
+ "minimum": 1
447
+ },
448
+ "minimum": {
449
+ "type": "number",
450
+ "minimum": 1
451
+ },
452
+ "maximum": {
453
+ "type": "number",
454
+ "minimum": 0
455
+ }
456
+ }
437
457
  }
438
458
  ]
439
459
  },
@@ -654,6 +674,43 @@
654
674
  },
655
675
  {
656
676
  "type": "string"
677
+ },
678
+ {
679
+ "type": "object",
680
+ "properties": {
681
+ "static": {
682
+ "type": "number",
683
+ "minimum": 1
684
+ },
685
+ "dynamic": {
686
+ "type": "boolean",
687
+ "default": false
688
+ },
689
+ "minimum": {
690
+ "type": "number",
691
+ "minimum": 1
692
+ },
693
+ "maximum": {
694
+ "type": "number",
695
+ "minimum": 0
696
+ },
697
+ "total": {
698
+ "type": "number",
699
+ "minimum": 1
700
+ },
701
+ "maxMemory": {
702
+ "type": "number",
703
+ "minimum": 0
704
+ },
705
+ "cooldown": {
706
+ "type": "number",
707
+ "minimum": 0
708
+ },
709
+ "gracePeriod": {
710
+ "type": "number",
711
+ "minimum": 0
712
+ }
713
+ }
657
714
  }
658
715
  ]
659
716
  },
@@ -939,6 +996,10 @@
939
996
  },
940
997
  "additionalProperties": false
941
998
  },
999
+ "reuseTcpPorts": {
1000
+ "type": "boolean",
1001
+ "default": true
1002
+ },
942
1003
  "startTimeout": {
943
1004
  "default": 30000,
944
1005
  "type": "number",
@@ -1430,6 +1491,58 @@
1430
1491
  }
1431
1492
  ],
1432
1493
  "default": 10000
1494
+ },
1495
+ "otlpExporter": {
1496
+ "type": "object",
1497
+ "description": "Configuration for exporting metrics to an OTLP endpoint",
1498
+ "properties": {
1499
+ "enabled": {
1500
+ "anyOf": [
1501
+ {
1502
+ "type": "boolean"
1503
+ },
1504
+ {
1505
+ "type": "string"
1506
+ }
1507
+ ],
1508
+ "description": "Enable or disable OTLP metrics export"
1509
+ },
1510
+ "endpoint": {
1511
+ "type": "string",
1512
+ "description": "OTLP endpoint URL (e.g., http://collector:4318/v1/metrics)"
1513
+ },
1514
+ "interval": {
1515
+ "anyOf": [
1516
+ {
1517
+ "type": "integer"
1518
+ },
1519
+ {
1520
+ "type": "string"
1521
+ }
1522
+ ],
1523
+ "default": 60000,
1524
+ "description": "Interval in milliseconds between metric pushes"
1525
+ },
1526
+ "headers": {
1527
+ "type": "object",
1528
+ "additionalProperties": {
1529
+ "type": "string"
1530
+ },
1531
+ "description": "Additional HTTP headers for authentication"
1532
+ },
1533
+ "serviceName": {
1534
+ "type": "string",
1535
+ "description": "Service name for OTLP resource attributes"
1536
+ },
1537
+ "serviceVersion": {
1538
+ "type": "string",
1539
+ "description": "Service version for OTLP resource attributes"
1540
+ }
1541
+ },
1542
+ "required": [
1543
+ "endpoint"
1544
+ ],
1545
+ "additionalProperties": false
1433
1546
  }
1434
1547
  },
1435
1548
  "additionalProperties": false
@@ -1589,35 +1702,40 @@
1589
1702
  "type": "number",
1590
1703
  "minimum": 1
1591
1704
  },
1705
+ "cooldownSec": {
1706
+ "type": "number",
1707
+ "minimum": 0
1708
+ },
1709
+ "gracePeriod": {
1710
+ "type": "number",
1711
+ "minimum": 0
1712
+ },
1592
1713
  "scaleUpELU": {
1593
1714
  "type": "number",
1594
1715
  "minimum": 0,
1595
- "maximum": 1
1716
+ "maximum": 1,
1717
+ "deprecated": true
1596
1718
  },
1597
1719
  "scaleDownELU": {
1598
1720
  "type": "number",
1599
1721
  "minimum": 0,
1600
- "maximum": 1
1722
+ "maximum": 1,
1723
+ "deprecated": true
1601
1724
  },
1602
1725
  "timeWindowSec": {
1603
1726
  "type": "number",
1604
- "minimum": 0
1727
+ "minimum": 0,
1728
+ "deprecated": true
1605
1729
  },
1606
1730
  "scaleDownTimeWindowSec": {
1607
1731
  "type": "number",
1608
- "minimum": 0
1609
- },
1610
- "cooldownSec": {
1611
- "type": "number",
1612
- "minimum": 0
1732
+ "minimum": 0,
1733
+ "deprecated": true
1613
1734
  },
1614
1735
  "scaleIntervalSec": {
1615
1736
  "type": "number",
1616
- "minimum": 0
1617
- },
1618
- "gracePeriod": {
1619
- "type": "number",
1620
- "minimum": 0
1737
+ "minimum": 0,
1738
+ "deprecated": true
1621
1739
  }
1622
1740
  },
1623
1741
  "additionalProperties": false