bun-plugin-stx 0.2.621 → 0.2.622
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/dist/serve.d.ts +2 -0
- package/dist/serve.js +4 -3
- package/package.json +3 -3
package/dist/serve.d.ts
CHANGED
|
@@ -396,12 +396,14 @@ export declare interface ServeOptions {
|
|
|
396
396
|
}
|
|
397
397
|
export declare interface PageWarmupOptions {
|
|
398
398
|
paths?: string[]
|
|
399
|
+
holdBind?: 'replacing' | 'always'
|
|
399
400
|
budgetMs?: number
|
|
400
401
|
concurrency?: number
|
|
401
402
|
}
|
|
402
403
|
export declare interface ResolvedPageWarmup {
|
|
403
404
|
enabled: boolean
|
|
404
405
|
paths: string[]
|
|
406
|
+
holdBind: 'replacing' | 'always'
|
|
405
407
|
budgetMs: number
|
|
406
408
|
concurrency: number
|
|
407
409
|
}
|
package/dist/serve.js
CHANGED
|
@@ -9410,7 +9410,7 @@ async function portIsServed(port, timeoutMs = 500) {
|
|
|
9410
9410
|
var PAGE_WARMUP_HEADER = "x-stx-warmup";
|
|
9411
9411
|
var DEFAULT_PAGE_WARMUP_BUDGET_MS = 60000;
|
|
9412
9412
|
function resolvePageWarmup(value) {
|
|
9413
|
-
const defaults = { enabled: true, paths: [], budgetMs: DEFAULT_PAGE_WARMUP_BUDGET_MS, concurrency: 4 };
|
|
9413
|
+
const defaults = { enabled: true, paths: [], holdBind: "replacing", budgetMs: DEFAULT_PAGE_WARMUP_BUDGET_MS, concurrency: 4 };
|
|
9414
9414
|
if (value === false)
|
|
9415
9415
|
return { ...defaults, enabled: false };
|
|
9416
9416
|
if (!value || typeof value !== "object")
|
|
@@ -9419,7 +9419,8 @@ function resolvePageWarmup(value) {
|
|
|
9419
9419
|
const paths = Array.isArray(raw.paths) ? [...new Set(raw.paths.filter((p) => typeof p === "string" && p.startsWith("/") && !p.startsWith("//")))] : [];
|
|
9420
9420
|
const budgetMs = typeof raw.budgetMs === "number" && Number.isFinite(raw.budgetMs) && raw.budgetMs >= 0 ? raw.budgetMs : defaults.budgetMs;
|
|
9421
9421
|
const concurrency = typeof raw.concurrency === "number" && Number.isFinite(raw.concurrency) && raw.concurrency >= 1 ? Math.floor(raw.concurrency) : defaults.concurrency;
|
|
9422
|
-
|
|
9422
|
+
const holdBind = raw.holdBind === "always" ? "always" : defaults.holdBind;
|
|
9423
|
+
return { enabled: true, paths, holdBind, budgetMs, concurrency };
|
|
9423
9424
|
}
|
|
9424
9425
|
async function settleWithin(promise, ms) {
|
|
9425
9426
|
let timer;
|
|
@@ -11435,7 +11436,7 @@ ${trailingPageScripts.join(`
|
|
|
11435
11436
|
}
|
|
11436
11437
|
if (production && pageWarmup.enabled) {
|
|
11437
11438
|
const warmupStartedAt = performance.now();
|
|
11438
|
-
const covered = options.reusePort === true && await portIsServed(port);
|
|
11439
|
+
const covered = pageWarmup.holdBind === "always" || options.reusePort === true && await portIsServed(port);
|
|
11439
11440
|
const warming = warmPages();
|
|
11440
11441
|
const done = !covered || await settleWithin(warming, pageWarmup.budgetMs);
|
|
11441
11442
|
if (!done) {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bun-plugin-stx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.2.
|
|
4
|
+
"version": "0.2.622",
|
|
5
5
|
"description": "A Bun plugin that allows for using Laravel Blade-like syntax.",
|
|
6
6
|
"author": "Chris Breuer <chris@stacksjs.org>",
|
|
7
7
|
"license": "MIT",
|
|
@@ -74,7 +74,7 @@
|
|
|
74
74
|
"typecheck": "bun tsc --noEmit"
|
|
75
75
|
},
|
|
76
76
|
"dependencies": {
|
|
77
|
-
"@stacksjs/stx": "0.2.
|
|
78
|
-
"stx-router": "0.2.
|
|
77
|
+
"@stacksjs/stx": "0.2.622",
|
|
78
|
+
"stx-router": "0.2.622"
|
|
79
79
|
}
|
|
80
80
|
}
|