tokmon 0.28.0 → 0.28.2
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/README.md +1 -1
- package/dist/{bootstrap-ink-5LQMSU4B.js → bootstrap-ink-IMT3S5HU.js} +120 -9
- package/dist/{chunk-KCY53RUE.js → chunk-44ZSQEOS.js} +2 -2
- package/dist/{chunk-JK3U54G7.js → chunk-6ZEW2M6P.js} +167 -39
- package/dist/{chunk-E2YXYU73.js → chunk-HP5UZCXP.js} +29 -0
- package/dist/{chunk-QM5E5RJZ.js → chunk-J3JW3RFP.js} +10 -7
- package/dist/{chunk-IWKSA64G.js → chunk-LCAHTRGP.js} +15 -281
- package/dist/{chunk-AMD4PXDG.js → chunk-LKYOWBD4.js} +15 -15
- package/dist/{chunk-QOA6KOJQ.js → chunk-M7XMV36F.js} +1 -1
- package/dist/chunk-WUK3MQUB.js +249 -0
- package/dist/{cli-command-HXKWB6IP.js → cli-command-DCENRCO3.js} +6 -6
- package/dist/cli.js +6 -6
- package/dist/{config-2PXUENQL.js → config-HXFJTNLM.js} +5 -1
- package/dist/{daemon-JCQF645I.js → daemon-6Y4O7NXS.js} +36 -14
- package/dist/daemon-handle-GVCYVDPO.js +10 -0
- package/dist/server-GXXOWUVZ.js +11 -0
- package/dist/web/assets/{Area-DgGVYaNT.js → Area-CMXvOw33.js} +1 -1
- package/dist/web/assets/{analytics-D5EvgF4d.js → analytics-DqdZXOJL.js} +2 -2
- package/dist/web/assets/{breakdown-CGdJkAHx.js → breakdown-kOSSJ3mI.js} +1 -1
- package/dist/web/assets/{chart-D4KHj2-J.js → chart-cZoLgpmG.js} +1 -1
- package/dist/web/assets/{explore-B2QnGzfO.js → explore-vcsM8K9I.js} +1 -1
- package/dist/web/assets/index-BErCXT7f.css +1 -0
- package/dist/web/assets/index-DH3dOnbg.js +83 -0
- package/dist/web/assets/{models-D7w7JJCX.js → models-B5ikm83_.js} +2 -2
- package/dist/web/assets/{overview-BPz0j397.js → overview-DD1kP8CP.js} +2 -2
- package/dist/web/assets/{panel-Da3rkvLu.js → panel-DTQBwExW.js} +1 -1
- package/dist/web/assets/{primitives-B8eGD8S_.js → primitives-C36qJlA2.js} +1 -1
- package/dist/web/assets/settings-sheet-_i2zTQjf.js +1 -0
- package/dist/web/assets/{share-sheet-BXrrMoLk.js → share-sheet-BLHmrFbm.js} +2 -2
- package/dist/web/assets/{timeline-CiGI4EmA.js → timeline-B4uG-Emo.js} +1 -1
- package/dist/web/assets/{use-dialog-trap-Dhs8W7s1.js → use-dialog-trap-bfaXEMz9.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/chunk-SMPY52EV.js +0 -125
- package/dist/daemon-handle-2GVZT55B.js +0 -10
- package/dist/server-BJOXAGRI.js +0 -11
- package/dist/web/assets/index-C0txIEHK.js +0 -83
- package/dist/web/assets/index-NnKaHxPO.css +0 -1
- package/dist/web/assets/settings-sheet-D6tnWqmt.js +0 -1
package/dist/chunk-SMPY52EV.js
DELETED
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// src/web/static.ts
|
|
4
|
-
import { createReadStream, existsSync, readFileSync } from "fs";
|
|
5
|
-
import { stat } from "fs/promises";
|
|
6
|
-
import { fileURLToPath } from "url";
|
|
7
|
-
import { extname, join, normalize, sep } from "path";
|
|
8
|
-
var MIME = {
|
|
9
|
-
".html": "text/html; charset=utf-8",
|
|
10
|
-
".js": "text/javascript; charset=utf-8",
|
|
11
|
-
".mjs": "text/javascript; charset=utf-8",
|
|
12
|
-
".css": "text/css; charset=utf-8",
|
|
13
|
-
".json": "application/json; charset=utf-8",
|
|
14
|
-
".svg": "image/svg+xml",
|
|
15
|
-
".png": "image/png",
|
|
16
|
-
".jpg": "image/jpeg",
|
|
17
|
-
".jpeg": "image/jpeg",
|
|
18
|
-
".gif": "image/gif",
|
|
19
|
-
".ico": "image/x-icon",
|
|
20
|
-
".woff": "font/woff",
|
|
21
|
-
".woff2": "font/woff2",
|
|
22
|
-
".ttf": "font/ttf",
|
|
23
|
-
".otf": "font/otf",
|
|
24
|
-
".map": "application/json; charset=utf-8",
|
|
25
|
-
".webmanifest": "application/manifest+json"
|
|
26
|
-
};
|
|
27
|
-
function findWebRoot() {
|
|
28
|
-
const candidates = ["./web/", "../web/", "../dist/web/", "../../dist/web/"];
|
|
29
|
-
for (const rel of candidates) {
|
|
30
|
-
try {
|
|
31
|
-
const dir = fileURLToPath(new URL(rel, import.meta.url));
|
|
32
|
-
if (existsSync(join(dir, "index.html"))) return dir.replace(/[\\/]+$/, "");
|
|
33
|
-
} catch {
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
function resolveStaticPath(webRoot, urlPath) {
|
|
39
|
-
let clean;
|
|
40
|
-
try {
|
|
41
|
-
clean = decodeURIComponent(urlPath.split("?")[0]);
|
|
42
|
-
} catch {
|
|
43
|
-
return null;
|
|
44
|
-
}
|
|
45
|
-
const rel = normalize(clean).replace(/^(\.\.[/\\])+/, "").replace(/^[/\\]+/, "");
|
|
46
|
-
const full = join(webRoot, rel);
|
|
47
|
-
if (full !== webRoot && !full.startsWith(webRoot + sep)) return null;
|
|
48
|
-
return full;
|
|
49
|
-
}
|
|
50
|
-
function send(res, status, type, body) {
|
|
51
|
-
res.writeHead(status, {
|
|
52
|
-
"Content-Type": type,
|
|
53
|
-
"Cache-Control": "no-store",
|
|
54
|
-
"Referrer-Policy": "no-referrer",
|
|
55
|
-
"X-Content-Type-Options": "nosniff"
|
|
56
|
-
});
|
|
57
|
-
res.end(body);
|
|
58
|
-
}
|
|
59
|
-
function sendJson(res, status, data) {
|
|
60
|
-
send(res, status, "application/json; charset=utf-8", JSON.stringify(data));
|
|
61
|
-
}
|
|
62
|
-
function serveStatic(webRoot, urlPath, res) {
|
|
63
|
-
const path = urlPath.split("?")[0];
|
|
64
|
-
const filePath = resolveStaticPath(webRoot, path === "/" ? "/index.html" : path);
|
|
65
|
-
if (!filePath) {
|
|
66
|
-
send(res, 403, "text/plain", "forbidden");
|
|
67
|
-
return;
|
|
68
|
-
}
|
|
69
|
-
void stat(filePath).then((st) => {
|
|
70
|
-
if (st.isFile()) {
|
|
71
|
-
const type = MIME[extname(filePath).toLowerCase()] || "application/octet-stream";
|
|
72
|
-
const immutable = filePath.includes(`${sep}assets${sep}`);
|
|
73
|
-
res.writeHead(200, {
|
|
74
|
-
"Content-Type": type,
|
|
75
|
-
"Cache-Control": immutable ? "public, max-age=31536000, immutable" : "no-cache",
|
|
76
|
-
"Referrer-Policy": "no-referrer",
|
|
77
|
-
"X-Content-Type-Options": "nosniff"
|
|
78
|
-
});
|
|
79
|
-
createReadStream(filePath).pipe(res);
|
|
80
|
-
} else {
|
|
81
|
-
throw new Error("not a file");
|
|
82
|
-
}
|
|
83
|
-
}).catch(() => {
|
|
84
|
-
if (extname(path)) {
|
|
85
|
-
send(res, 404, "text/plain", "not found");
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
const indexPath = join(webRoot, "index.html");
|
|
89
|
-
if (!existsSync(indexPath)) {
|
|
90
|
-
send(res, 404, "text/plain", "not found");
|
|
91
|
-
return;
|
|
92
|
-
}
|
|
93
|
-
res.writeHead(200, {
|
|
94
|
-
"Content-Type": MIME[".html"],
|
|
95
|
-
"Cache-Control": "no-cache",
|
|
96
|
-
"Referrer-Policy": "no-referrer",
|
|
97
|
-
"X-Content-Type-Options": "nosniff"
|
|
98
|
-
});
|
|
99
|
-
createReadStream(indexPath).on("error", () => {
|
|
100
|
-
try {
|
|
101
|
-
res.destroy();
|
|
102
|
-
} catch {
|
|
103
|
-
}
|
|
104
|
-
}).pipe(res);
|
|
105
|
-
});
|
|
106
|
-
}
|
|
107
|
-
function appVersion() {
|
|
108
|
-
for (const rel of ["../package.json", "../../package.json"]) {
|
|
109
|
-
try {
|
|
110
|
-
const p = fileURLToPath(new URL(rel, import.meta.url));
|
|
111
|
-
const pkg = JSON.parse(readFileSync(p, "utf-8"));
|
|
112
|
-
if (typeof pkg.version === "string") return pkg.version;
|
|
113
|
-
} catch {
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return "";
|
|
117
|
-
}
|
|
118
|
-
|
|
119
|
-
export {
|
|
120
|
-
findWebRoot,
|
|
121
|
-
send,
|
|
122
|
-
sendJson,
|
|
123
|
-
serveStatic,
|
|
124
|
-
appVersion
|
|
125
|
-
};
|
package/dist/server-BJOXAGRI.js
DELETED