@platformatic/next 3.56.0 → 3.58.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 +45 -1
- package/lib/caching/valkey-components.js +6 -2
- package/lib/caching/valkey-isr.js +5 -1
- package/lib/capability.js +37 -3
- package/package.json +7 -7
- package/schema.json +145 -2
package/config.d.ts
CHANGED
|
@@ -240,7 +240,7 @@ export interface PlatformaticNextJsConfig {
|
|
|
240
240
|
reuseTcpPorts?: boolean;
|
|
241
241
|
startTimeout?: number;
|
|
242
242
|
restartOnError?: boolean | number;
|
|
243
|
-
exitOnUnhandledErrors?: boolean;
|
|
243
|
+
exitOnUnhandledErrors?: boolean | number;
|
|
244
244
|
gracefulShutdown?: {
|
|
245
245
|
runtime: number | string;
|
|
246
246
|
application: number | string;
|
|
@@ -262,6 +262,7 @@ export interface PlatformaticNextJsConfig {
|
|
|
262
262
|
bufferPoolSize?: number | string;
|
|
263
263
|
defaultHighWaterMark?: number | string;
|
|
264
264
|
};
|
|
265
|
+
healthProbes?: boolean | string;
|
|
265
266
|
undici?: {
|
|
266
267
|
agentOptions?: {
|
|
267
268
|
[k: string]: unknown;
|
|
@@ -352,6 +353,33 @@ export interface PlatformaticNextJsConfig {
|
|
|
352
353
|
enabled?: boolean | string;
|
|
353
354
|
hostname?: string;
|
|
354
355
|
endpoint?: string;
|
|
356
|
+
https?: {
|
|
357
|
+
allowHTTP1?: boolean;
|
|
358
|
+
key:
|
|
359
|
+
| string
|
|
360
|
+
| {
|
|
361
|
+
path?: string;
|
|
362
|
+
}
|
|
363
|
+
| (
|
|
364
|
+
| string
|
|
365
|
+
| {
|
|
366
|
+
path?: string;
|
|
367
|
+
}
|
|
368
|
+
)[];
|
|
369
|
+
cert:
|
|
370
|
+
| string
|
|
371
|
+
| {
|
|
372
|
+
path?: string;
|
|
373
|
+
}
|
|
374
|
+
| (
|
|
375
|
+
| string
|
|
376
|
+
| {
|
|
377
|
+
path?: string;
|
|
378
|
+
}
|
|
379
|
+
)[];
|
|
380
|
+
requestCert?: boolean;
|
|
381
|
+
rejectUnauthorized?: boolean;
|
|
382
|
+
};
|
|
355
383
|
auth?: {
|
|
356
384
|
username: string;
|
|
357
385
|
password: string;
|
|
@@ -490,6 +518,14 @@ export interface PlatformaticNextJsConfig {
|
|
|
490
518
|
* The path to write the traces to. Only for file exporter.
|
|
491
519
|
*/
|
|
492
520
|
path?: string;
|
|
521
|
+
/**
|
|
522
|
+
* The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http.
|
|
523
|
+
*/
|
|
524
|
+
protocol?: "http" | "grpc";
|
|
525
|
+
/**
|
|
526
|
+
* Alias for protocol. Only for the otlp exporter. Defaults to http.
|
|
527
|
+
*/
|
|
528
|
+
transport?: "http" | "grpc";
|
|
493
529
|
[k: string]: unknown;
|
|
494
530
|
};
|
|
495
531
|
additionalProperties?: never;
|
|
@@ -515,6 +551,14 @@ export interface PlatformaticNextJsConfig {
|
|
|
515
551
|
* The path to write the traces to. Only for file exporter.
|
|
516
552
|
*/
|
|
517
553
|
path?: string;
|
|
554
|
+
/**
|
|
555
|
+
* The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http.
|
|
556
|
+
*/
|
|
557
|
+
protocol?: "http" | "grpc";
|
|
558
|
+
/**
|
|
559
|
+
* Alias for protocol. Only for the otlp exporter. Defaults to http.
|
|
560
|
+
*/
|
|
561
|
+
transport?: "http" | "grpc";
|
|
518
562
|
[k: string]: unknown;
|
|
519
563
|
};
|
|
520
564
|
additionalProperties?: never;
|
|
@@ -215,14 +215,18 @@ export class CacheHandler {
|
|
|
215
215
|
toDelete.add(key)
|
|
216
216
|
|
|
217
217
|
// Batch full, execute it
|
|
218
|
-
if (toDelete.
|
|
218
|
+
if (toDelete.size >= MAX_BATCH_SIZE) {
|
|
219
219
|
await this.#store.del(...toDelete)
|
|
220
220
|
toDelete.clear()
|
|
221
221
|
}
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
224
|
|
|
225
|
-
|
|
225
|
+
// Spreading an empty Set would issue a DEL with no keys, which Valkey
|
|
226
|
+
// rejects. Only delete when there is something to delete.
|
|
227
|
+
if (toDelete.size) {
|
|
228
|
+
await this.#store.del(...toDelete)
|
|
229
|
+
}
|
|
226
230
|
await this.#store.del(tagsKey)
|
|
227
231
|
}
|
|
228
232
|
} catch (e) {
|
|
@@ -254,7 +254,11 @@ export class CacheHandler {
|
|
|
254
254
|
}
|
|
255
255
|
}
|
|
256
256
|
|
|
257
|
-
|
|
257
|
+
// Spreading an empty Set would issue a DEL with no keys, which Valkey
|
|
258
|
+
// rejects. Only delete when there is something to delete.
|
|
259
|
+
if (toDelete.size) {
|
|
260
|
+
await this.#store.del(...toDelete)
|
|
261
|
+
}
|
|
258
262
|
await this.#store.del(tagsKey)
|
|
259
263
|
}
|
|
260
264
|
} catch (e) {
|
package/lib/capability.js
CHANGED
|
@@ -245,7 +245,7 @@ export class NextCapability extends BaseCapability {
|
|
|
245
245
|
_: [this.root]
|
|
246
246
|
}
|
|
247
247
|
|
|
248
|
-
const httpsOptions = this
|
|
248
|
+
const httpsOptions = this.#getDevelopmentHTTPSOptions()
|
|
249
249
|
|
|
250
250
|
if (httpsOptions.enabled) {
|
|
251
251
|
devOptions['--experimental-https-key'] = true
|
|
@@ -265,8 +265,7 @@ export class NextCapability extends BaseCapability {
|
|
|
265
265
|
|
|
266
266
|
await nextDev(devOptions)
|
|
267
267
|
} else {
|
|
268
|
-
const
|
|
269
|
-
const httpsOptions = nextConfig.https ?? {}
|
|
268
|
+
const httpsOptions = this.#getDevelopmentHTTPSOptions()
|
|
270
269
|
|
|
271
270
|
if (httpsOptions.enabled) {
|
|
272
271
|
serverOptions.experimentalHttps = true
|
|
@@ -452,6 +451,41 @@ export class NextCapability extends BaseCapability {
|
|
|
452
451
|
return scripts
|
|
453
452
|
}
|
|
454
453
|
|
|
454
|
+
#getDevelopmentHTTPSOptions () {
|
|
455
|
+
const nextHTTPSOptions = this.config.next?.https
|
|
456
|
+
if (nextHTTPSOptions?.enabled) {
|
|
457
|
+
return nextHTTPSOptions
|
|
458
|
+
}
|
|
459
|
+
|
|
460
|
+
const serverHTTPSOptions = this.serverConfig?.https
|
|
461
|
+
if (!serverHTTPSOptions) {
|
|
462
|
+
return {}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
return {
|
|
466
|
+
enabled: true,
|
|
467
|
+
key: this.#getHTTPSPath(serverHTTPSOptions.key),
|
|
468
|
+
cert: this.#getHTTPSPath(serverHTTPSOptions.cert),
|
|
469
|
+
ca: this.#getHTTPSPath(serverHTTPSOptions.ca)
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
#getHTTPSPath (value) {
|
|
474
|
+
if (!value) {
|
|
475
|
+
return undefined
|
|
476
|
+
}
|
|
477
|
+
|
|
478
|
+
if (typeof value === 'string') {
|
|
479
|
+
return value
|
|
480
|
+
}
|
|
481
|
+
|
|
482
|
+
if (Array.isArray(value)) {
|
|
483
|
+
return this.#getHTTPSPath(value[0])
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
return value.path
|
|
487
|
+
}
|
|
488
|
+
|
|
455
489
|
// In development mode, Next.js starts the dev server using child_process.fork with stdio set to 'inherit'.
|
|
456
490
|
// In order to capture the output, we need to ensure that the streams are pipeable and thus we perform a one-time
|
|
457
491
|
// monkey-patch of the ChildProcess.prototype.spawn method to override stdio[1] and stdio[2] to 'pipe'.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/next",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.58.0",
|
|
4
4
|
"description": "Platformatic Next.js Capability",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -20,14 +20,14 @@
|
|
|
20
20
|
"@babel/traverse": "^7.25.3",
|
|
21
21
|
"@babel/types": "^7.25.2",
|
|
22
22
|
"@platformatic/image-optimizer": "^0.2.1",
|
|
23
|
-
"amaro": "^0.
|
|
23
|
+
"amaro": "^1.0.0",
|
|
24
24
|
"iovalkey": "^0.3.0",
|
|
25
25
|
"light-my-request": "^6.0.0",
|
|
26
26
|
"msgpackr": "^1.11.2",
|
|
27
27
|
"semver": "^7.6.3",
|
|
28
|
-
"@platformatic/basic": "3.
|
|
29
|
-
"@platformatic/
|
|
30
|
-
"@platformatic/
|
|
28
|
+
"@platformatic/basic": "3.58.0",
|
|
29
|
+
"@platformatic/globals": "3.58.0",
|
|
30
|
+
"@platformatic/foundation": "3.58.0"
|
|
31
31
|
},
|
|
32
32
|
"devDependencies": {
|
|
33
33
|
"@fastify/reply-from": "^12.0.0",
|
|
@@ -44,8 +44,8 @@
|
|
|
44
44
|
"next": "^16.1.0",
|
|
45
45
|
"typescript": "^5.5.4",
|
|
46
46
|
"ws": "^8.18.0",
|
|
47
|
-
"@platformatic/
|
|
48
|
-
"@platformatic/
|
|
47
|
+
"@platformatic/service": "3.58.0",
|
|
48
|
+
"@platformatic/gateway": "3.58.0"
|
|
49
49
|
},
|
|
50
50
|
"engines": {
|
|
51
51
|
"node": ">=22.19.0"
|
package/schema.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://schemas.platformatic.dev/@platformatic/next/3.
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/next/3.58.0.json",
|
|
3
3
|
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
4
|
"title": "Platformatic Next.js Config",
|
|
5
5
|
"type": "object",
|
|
@@ -1183,7 +1183,14 @@
|
|
|
1183
1183
|
},
|
|
1184
1184
|
"exitOnUnhandledErrors": {
|
|
1185
1185
|
"default": true,
|
|
1186
|
-
"
|
|
1186
|
+
"anyOf": [
|
|
1187
|
+
{
|
|
1188
|
+
"type": "boolean"
|
|
1189
|
+
},
|
|
1190
|
+
{
|
|
1191
|
+
"type": "number"
|
|
1192
|
+
}
|
|
1193
|
+
]
|
|
1187
1194
|
},
|
|
1188
1195
|
"gracefulShutdown": {
|
|
1189
1196
|
"type": "object",
|
|
@@ -1365,6 +1372,17 @@
|
|
|
1365
1372
|
},
|
|
1366
1373
|
"additionalProperties": false
|
|
1367
1374
|
},
|
|
1375
|
+
"healthProbes": {
|
|
1376
|
+
"anyOf": [
|
|
1377
|
+
{
|
|
1378
|
+
"type": "boolean"
|
|
1379
|
+
},
|
|
1380
|
+
{
|
|
1381
|
+
"type": "string"
|
|
1382
|
+
}
|
|
1383
|
+
],
|
|
1384
|
+
"default": true
|
|
1385
|
+
},
|
|
1368
1386
|
"undici": {
|
|
1369
1387
|
"type": "object",
|
|
1370
1388
|
"properties": {
|
|
@@ -1616,6 +1634,99 @@
|
|
|
1616
1634
|
"endpoint": {
|
|
1617
1635
|
"type": "string"
|
|
1618
1636
|
},
|
|
1637
|
+
"https": {
|
|
1638
|
+
"type": "object",
|
|
1639
|
+
"properties": {
|
|
1640
|
+
"allowHTTP1": {
|
|
1641
|
+
"type": "boolean"
|
|
1642
|
+
},
|
|
1643
|
+
"key": {
|
|
1644
|
+
"anyOf": [
|
|
1645
|
+
{
|
|
1646
|
+
"type": "string"
|
|
1647
|
+
},
|
|
1648
|
+
{
|
|
1649
|
+
"type": "object",
|
|
1650
|
+
"properties": {
|
|
1651
|
+
"path": {
|
|
1652
|
+
"type": "string",
|
|
1653
|
+
"resolvePath": true
|
|
1654
|
+
}
|
|
1655
|
+
},
|
|
1656
|
+
"additionalProperties": false
|
|
1657
|
+
},
|
|
1658
|
+
{
|
|
1659
|
+
"type": "array",
|
|
1660
|
+
"items": {
|
|
1661
|
+
"anyOf": [
|
|
1662
|
+
{
|
|
1663
|
+
"type": "string"
|
|
1664
|
+
},
|
|
1665
|
+
{
|
|
1666
|
+
"type": "object",
|
|
1667
|
+
"properties": {
|
|
1668
|
+
"path": {
|
|
1669
|
+
"type": "string",
|
|
1670
|
+
"resolvePath": true
|
|
1671
|
+
}
|
|
1672
|
+
},
|
|
1673
|
+
"additionalProperties": false
|
|
1674
|
+
}
|
|
1675
|
+
]
|
|
1676
|
+
}
|
|
1677
|
+
}
|
|
1678
|
+
]
|
|
1679
|
+
},
|
|
1680
|
+
"cert": {
|
|
1681
|
+
"anyOf": [
|
|
1682
|
+
{
|
|
1683
|
+
"type": "string"
|
|
1684
|
+
},
|
|
1685
|
+
{
|
|
1686
|
+
"type": "object",
|
|
1687
|
+
"properties": {
|
|
1688
|
+
"path": {
|
|
1689
|
+
"type": "string",
|
|
1690
|
+
"resolvePath": true
|
|
1691
|
+
}
|
|
1692
|
+
},
|
|
1693
|
+
"additionalProperties": false
|
|
1694
|
+
},
|
|
1695
|
+
{
|
|
1696
|
+
"type": "array",
|
|
1697
|
+
"items": {
|
|
1698
|
+
"anyOf": [
|
|
1699
|
+
{
|
|
1700
|
+
"type": "string"
|
|
1701
|
+
},
|
|
1702
|
+
{
|
|
1703
|
+
"type": "object",
|
|
1704
|
+
"properties": {
|
|
1705
|
+
"path": {
|
|
1706
|
+
"type": "string",
|
|
1707
|
+
"resolvePath": true
|
|
1708
|
+
}
|
|
1709
|
+
},
|
|
1710
|
+
"additionalProperties": false
|
|
1711
|
+
}
|
|
1712
|
+
]
|
|
1713
|
+
}
|
|
1714
|
+
}
|
|
1715
|
+
]
|
|
1716
|
+
},
|
|
1717
|
+
"requestCert": {
|
|
1718
|
+
"type": "boolean"
|
|
1719
|
+
},
|
|
1720
|
+
"rejectUnauthorized": {
|
|
1721
|
+
"type": "boolean"
|
|
1722
|
+
}
|
|
1723
|
+
},
|
|
1724
|
+
"additionalProperties": false,
|
|
1725
|
+
"required": [
|
|
1726
|
+
"key",
|
|
1727
|
+
"cert"
|
|
1728
|
+
]
|
|
1729
|
+
},
|
|
1619
1730
|
"auth": {
|
|
1620
1731
|
"type": "object",
|
|
1621
1732
|
"properties": {
|
|
@@ -1931,6 +2042,22 @@
|
|
|
1931
2042
|
"path": {
|
|
1932
2043
|
"type": "string",
|
|
1933
2044
|
"description": "The path to write the traces to. Only for file exporter."
|
|
2045
|
+
},
|
|
2046
|
+
"protocol": {
|
|
2047
|
+
"type": "string",
|
|
2048
|
+
"enum": [
|
|
2049
|
+
"http",
|
|
2050
|
+
"grpc"
|
|
2051
|
+
],
|
|
2052
|
+
"description": "The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http."
|
|
2053
|
+
},
|
|
2054
|
+
"transport": {
|
|
2055
|
+
"type": "string",
|
|
2056
|
+
"enum": [
|
|
2057
|
+
"http",
|
|
2058
|
+
"grpc"
|
|
2059
|
+
],
|
|
2060
|
+
"description": "Alias for protocol. Only for the otlp exporter. Defaults to http."
|
|
1934
2061
|
}
|
|
1935
2062
|
}
|
|
1936
2063
|
},
|
|
@@ -1967,6 +2094,22 @@
|
|
|
1967
2094
|
"path": {
|
|
1968
2095
|
"type": "string",
|
|
1969
2096
|
"description": "The path to write the traces to. Only for file exporter."
|
|
2097
|
+
},
|
|
2098
|
+
"protocol": {
|
|
2099
|
+
"type": "string",
|
|
2100
|
+
"enum": [
|
|
2101
|
+
"http",
|
|
2102
|
+
"grpc"
|
|
2103
|
+
],
|
|
2104
|
+
"description": "The OTLP transport protocol to use. Only for the otlp exporter. Defaults to http."
|
|
2105
|
+
},
|
|
2106
|
+
"transport": {
|
|
2107
|
+
"type": "string",
|
|
2108
|
+
"enum": [
|
|
2109
|
+
"http",
|
|
2110
|
+
"grpc"
|
|
2111
|
+
],
|
|
2112
|
+
"description": "Alias for protocol. Only for the otlp exporter. Defaults to http."
|
|
1970
2113
|
}
|
|
1971
2114
|
}
|
|
1972
2115
|
},
|