@hyperframes/producer 0.9.95 → 0.9.96
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/distributed.js
CHANGED
|
@@ -387,7 +387,11 @@ import { randomUUID as randomUUID3 } from "crypto";
|
|
|
387
387
|
// src/services/fileServer.ts
|
|
388
388
|
import { Hono } from "hono";
|
|
389
389
|
import { serve } from "@hono/node-server";
|
|
390
|
-
import {
|
|
390
|
+
import {
|
|
391
|
+
answerOwnLoopbackHostOnly,
|
|
392
|
+
boundedPageText,
|
|
393
|
+
settleOnBrowserSafePort
|
|
394
|
+
} from "@hyperframes/engine";
|
|
391
395
|
import {
|
|
392
396
|
existsSync as existsSync2,
|
|
393
397
|
realpathSync,
|
|
@@ -1021,12 +1025,13 @@ function closeFileServerSafely(fileServer, label, log = defaultLogger) {
|
|
|
1021
1025
|
});
|
|
1022
1026
|
}
|
|
1023
1027
|
}
|
|
1028
|
+
var NO_FILE_AT_NAME = /* @__PURE__ */ new Set(["ENOENT", "ENOTDIR", "ENAMETOOLONG"]);
|
|
1024
1029
|
function openRegularFile(filePath) {
|
|
1025
1030
|
let fd;
|
|
1026
1031
|
try {
|
|
1027
1032
|
fd = openSync(filePath, constants.O_RDONLY | constants.O_NONBLOCK);
|
|
1028
1033
|
} catch (error) {
|
|
1029
|
-
if (error instanceof Error && "code" in error && (error.code
|
|
1034
|
+
if (error instanceof Error && "code" in error && NO_FILE_AT_NAME.has(String(error.code)))
|
|
1030
1035
|
return null;
|
|
1031
1036
|
if (!statSync2(filePath, { throwIfNoEntry: false })?.isFile()) return null;
|
|
1032
1037
|
throw error;
|
|
@@ -1089,7 +1094,7 @@ function createFileServer(options) {
|
|
|
1089
1094
|
}
|
|
1090
1095
|
if (!file) {
|
|
1091
1096
|
if (!/favicon\.ico$/i.test(requestPath)) {
|
|
1092
|
-
console.warn(`[FileServer] 404 Not Found: ${terminalText2(requestPath)}`);
|
|
1097
|
+
console.warn(`[FileServer] 404 Not Found: ${terminalText2(boundedPageText(requestPath))}`);
|
|
1093
1098
|
}
|
|
1094
1099
|
return c.text("Not found", 404);
|
|
1095
1100
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": "0.1.0",
|
|
3
3
|
"buildId": "dev",
|
|
4
|
-
"sha256": "
|
|
4
|
+
"sha256": "96c37dedbb04b1a6a1ad46cb3c586dfca48336064cb007c2ee06424d2cec3f96",
|
|
5
5
|
"artifacts": {
|
|
6
6
|
"iife": "hyperframe.runtime.iife.js",
|
|
7
7
|
"esm": "hyperframe.runtime.mjs"
|