next-leak 0.5.0 → 0.5.1
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/{chunk-IDSNTUKC.js → chunk-KJFYTJCF.js} +13 -4
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -92203,6 +92203,7 @@ var LaunchError = class extends Error {
|
|
|
92203
92203
|
}
|
|
92204
92204
|
};
|
|
92205
92205
|
var activeChildren = /* @__PURE__ */ new Set();
|
|
92206
|
+
var STDERR_WINDOW = 4096;
|
|
92206
92207
|
function killActiveChildren() {
|
|
92207
92208
|
for (const child of activeChildren) {
|
|
92208
92209
|
child.kill("SIGKILL");
|
|
@@ -92267,17 +92268,25 @@ async function launchInstrumented(options) {
|
|
|
92267
92268
|
stdio: ["ignore", "ignore", "pipe"]
|
|
92268
92269
|
}
|
|
92269
92270
|
);
|
|
92270
|
-
let
|
|
92271
|
+
let stderrHead = "";
|
|
92272
|
+
let stderrTailBuffer = "";
|
|
92271
92273
|
child.stderr?.on("data", (chunk) => {
|
|
92272
|
-
|
|
92274
|
+
const text = chunk.toString();
|
|
92275
|
+
if (stderrHead.length < STDERR_WINDOW) {
|
|
92276
|
+
stderrHead = (stderrHead + text).slice(0, STDERR_WINDOW);
|
|
92277
|
+
}
|
|
92278
|
+
stderrTailBuffer = (stderrTailBuffer + text).slice(-STDERR_WINDOW);
|
|
92273
92279
|
});
|
|
92280
|
+
const stderrWindow = () => stderrHead === stderrTailBuffer || stderrTailBuffer === "" ? stderrHead : `${stderrHead}
|
|
92281
|
+
[...]
|
|
92282
|
+
${stderrTailBuffer}`;
|
|
92274
92283
|
let exited = false;
|
|
92275
92284
|
activeChildren.add(child);
|
|
92276
92285
|
child.once("exit", () => {
|
|
92277
92286
|
exited = true;
|
|
92278
92287
|
activeChildren.delete(child);
|
|
92279
92288
|
});
|
|
92280
|
-
const failed = () => exited ? `server exited before becoming ready. ${explainStartupFailure(
|
|
92289
|
+
const failed = () => exited ? `server exited before becoming ready. ${explainStartupFailure(stderrWindow())}` : void 0;
|
|
92281
92290
|
try {
|
|
92282
92291
|
const controlPort = await pollUntil(
|
|
92283
92292
|
deadline,
|
|
@@ -92327,7 +92336,7 @@ async function launchInstrumented(options) {
|
|
|
92327
92336
|
pid: child.pid ?? -1,
|
|
92328
92337
|
appPort: options.appPort,
|
|
92329
92338
|
controlPort,
|
|
92330
|
-
explainExit: () => exited ? explainRuntimeFailure(
|
|
92339
|
+
explainExit: () => exited ? explainRuntimeFailure(stderrWindow(), options.maxOldSpaceMb ?? DEFAULT_MAX_OLD_SPACE_MB) : null,
|
|
92331
92340
|
close: async () => {
|
|
92332
92341
|
if (exited) {
|
|
92333
92342
|
return;
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED