toiljs 0.0.26 → 0.0.27
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/CHANGELOG.md +9 -0
- package/build/compiler/.tsbuildinfo +1 -1
- package/build/compiler/index.js +64 -15
- package/build/devserver/.tsbuildinfo +1 -0
- package/build/devserver/envelope.d.ts +18 -0
- package/build/devserver/envelope.js +88 -0
- package/build/devserver/host.d.ts +14 -0
- package/build/devserver/host.js +71 -0
- package/build/devserver/index.d.ts +22 -0
- package/build/devserver/index.js +144 -0
- package/build/devserver/module.d.ts +21 -0
- package/build/devserver/module.js +81 -0
- package/build/devserver/proxy.d.ts +7 -0
- package/build/devserver/proxy.js +98 -0
- package/build/io/.tsbuildinfo +1 -1
- package/build/io/codec.d.ts +1 -1
- package/examples/basic/server/HelloHandler.ts +4 -1
- package/package.json +9 -3
- package/server/runtime/handlers/ToilHandler.ts +4 -3
- package/server/runtime/index.ts +1 -1
- package/server/runtime/response.ts +23 -0
- package/server/runtime/rest/RestHandler.ts +2 -2
- package/src/compiler/index.ts +96 -21
- package/src/devserver/envelope.ts +154 -0
- package/src/devserver/host.ts +137 -0
- package/src/devserver/index.ts +242 -0
- package/src/devserver/module.ts +167 -0
- package/src/devserver/proxy.ts +155 -0
- package/src/io/codec.ts +4 -2
- package/test/devserver.test.ts +199 -0
- package/tsconfig.devserver.json +13 -0
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
import { Readable } from 'node:stream';
|
|
2
|
+
const SKIP_REQUEST_HEADERS = new Set([
|
|
3
|
+
'connection',
|
|
4
|
+
'keep-alive',
|
|
5
|
+
'proxy-authenticate',
|
|
6
|
+
'proxy-authorization',
|
|
7
|
+
'te',
|
|
8
|
+
'trailer',
|
|
9
|
+
'transfer-encoding',
|
|
10
|
+
'upgrade',
|
|
11
|
+
'content-length',
|
|
12
|
+
'accept-encoding',
|
|
13
|
+
]);
|
|
14
|
+
const SKIP_RESPONSE_HEADERS = new Set([
|
|
15
|
+
'connection',
|
|
16
|
+
'keep-alive',
|
|
17
|
+
'content-length',
|
|
18
|
+
'content-encoding',
|
|
19
|
+
'transfer-encoding',
|
|
20
|
+
]);
|
|
21
|
+
export async function proxyToVite(request, response, target) {
|
|
22
|
+
const url = `http://${target.host}:${String(target.port)}${request.url}`;
|
|
23
|
+
const headers = new Headers();
|
|
24
|
+
for (const [name, value] of Object.entries(request.headers)) {
|
|
25
|
+
if (!SKIP_REQUEST_HEADERS.has(name.toLowerCase()))
|
|
26
|
+
headers.set(name, value);
|
|
27
|
+
}
|
|
28
|
+
const hasBody = request.method !== 'GET' && request.method !== 'HEAD';
|
|
29
|
+
const body = hasBody ? await request.buffer() : undefined;
|
|
30
|
+
const upstream = await fetch(url, {
|
|
31
|
+
method: request.method,
|
|
32
|
+
headers,
|
|
33
|
+
body: body && body.length > 0 ? new Uint8Array(body) : undefined,
|
|
34
|
+
redirect: 'manual',
|
|
35
|
+
});
|
|
36
|
+
response.status(upstream.status);
|
|
37
|
+
upstream.headers.forEach((value, name) => {
|
|
38
|
+
if (!SKIP_RESPONSE_HEADERS.has(name))
|
|
39
|
+
response.header(name, value);
|
|
40
|
+
});
|
|
41
|
+
if (upstream.body === null) {
|
|
42
|
+
response.send();
|
|
43
|
+
return;
|
|
44
|
+
}
|
|
45
|
+
await response.stream(Readable.fromWeb(upstream.body));
|
|
46
|
+
}
|
|
47
|
+
function toUpstreamMessage(data, binary) {
|
|
48
|
+
if (!binary)
|
|
49
|
+
return data.toString('utf8');
|
|
50
|
+
const copy = new Uint8Array(data.length);
|
|
51
|
+
copy.set(data);
|
|
52
|
+
return copy;
|
|
53
|
+
}
|
|
54
|
+
export function wireWebsocketProxy(app, target) {
|
|
55
|
+
app.upgrade('/*', (request, response) => {
|
|
56
|
+
response.upgrade({
|
|
57
|
+
url: request.url,
|
|
58
|
+
protocol: request.headers['sec-websocket-protocol'] ?? '',
|
|
59
|
+
});
|
|
60
|
+
});
|
|
61
|
+
app.ws('/*', { message_type: 'Buffer', idle_timeout: 120, max_payload_length: 16 * 1024 * 1024 }, (ws) => {
|
|
62
|
+
const { url, protocol } = ws.context;
|
|
63
|
+
const upstream = new WebSocket(`ws://${target.host}:${String(target.port)}${url}`, protocol ? protocol.split(',').map((p) => p.trim()) : []);
|
|
64
|
+
upstream.binaryType = 'arraybuffer';
|
|
65
|
+
const pending = [];
|
|
66
|
+
let open = false;
|
|
67
|
+
upstream.onopen = () => {
|
|
68
|
+
open = true;
|
|
69
|
+
for (const m of pending)
|
|
70
|
+
upstream.send(m);
|
|
71
|
+
pending.length = 0;
|
|
72
|
+
};
|
|
73
|
+
upstream.onmessage = (event) => {
|
|
74
|
+
if (typeof event.data === 'string')
|
|
75
|
+
ws.send(event.data);
|
|
76
|
+
else
|
|
77
|
+
ws.send(Buffer.from(event.data), true);
|
|
78
|
+
};
|
|
79
|
+
upstream.onclose = (event) => {
|
|
80
|
+
ws.close(event.code, event.reason);
|
|
81
|
+
};
|
|
82
|
+
upstream.onerror = () => {
|
|
83
|
+
ws.close();
|
|
84
|
+
};
|
|
85
|
+
ws.on('message', (message, isBinary) => {
|
|
86
|
+
const m = toUpstreamMessage(message, isBinary);
|
|
87
|
+
if (open)
|
|
88
|
+
upstream.send(m);
|
|
89
|
+
else
|
|
90
|
+
pending.push(m);
|
|
91
|
+
});
|
|
92
|
+
ws.on('close', () => {
|
|
93
|
+
if (upstream.readyState === WebSocket.OPEN || upstream.readyState === WebSocket.CONNECTING) {
|
|
94
|
+
upstream.close();
|
|
95
|
+
}
|
|
96
|
+
});
|
|
97
|
+
});
|
|
98
|
+
}
|
package/build/io/.tsbuildinfo
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.es2025.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../node_modules/typescript/lib/lib.webworker.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.es2025.collection.d.ts","../../node_modules/typescript/lib/lib.es2025.float16.d.ts","../../node_modules/typescript/lib/lib.es2025.intl.d.ts","../../node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../node_modules/typescript/lib/lib.es2025.promise.d.ts","../../node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.date.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.error.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/io/FastMap.ts","../../src/io/FastSet.ts","../../src/io/codec.ts","../../src/io/types.ts","../../src/io/index.ts","../../src/io/lengths.ts"],"fileIdsList":[[94],[94,95,96,97]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"d52ed68e7eb5881768a55713c9b5c7c443e6b46de15c04e348928b8efd20b110","affectsGlobalScope":true,"impliedFormat":1},{"version":"2a2de5b9459b3fc44decd9ce6100b72f1b002ef523126c1d3d8b2a4a63d74d78","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"5b2a4e30698cf563707a5180e8385abe9b66bc47527b1c367550156c461a9a50","signature":"6a4c287c863003342a42d8bf876c7df4c2e82e95f556af5ade71f05255845200"},{"version":"e343f9744a8f2af61013fe28d816e9a87e22021f229f8f38b7c536bf744f9d41","signature":"272e7bc3a3734cc9e7419625f04cff7095131e315e51a83fa992a5134763df49"},{"version":"539953abda175f867ded1966e1de51013baf1a770c9d30a890900e897253e5b2","signature":"3d3b6bfa91e694cd37db4984fc7c693856da116604cc92f56a5573d0028a3968"},{"version":"ae4c9fffb9d6bff06cc5bd31285ad95ba0c5665436338a016e8e232d1a1b994a","signature":"3952955b5e83c1164fc78d7d54377fd4d09d2c11b79763cba53a7ff4b27a0601"},{"version":"8837ae5eb915aa1eb59dc7f608e02b8bae62e0f465ad689bffdf78d68f143d4c","signature":"48d0d0bebe2ccfd875953713d746fe4adae81b1e3a91ffafae29ead23fd5c39b"},{"version":"0c4bac17cf8fa8f3d7a210ced552058c2aa9cd3304c89fefea4aa8807ee841f4","signature":"c1631eafa81ab01bbddca5005243f1d9b5110681fa30a78564ad51637a9f310e"}],"root":[[94,99]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"alwaysStrict":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"module":99,"noImplicitAny":true,"outDir":"./","preserveConstEnums":true,"removeComments":true,"rootDir":"../../src/io","skipLibCheck":true,"sourceMap":false,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"suppressImplicitAnyIndexErrors":false,"target":99,"tsBuildInfoFile":"./.tsbuildinfo"},"referencedMap":[[95,1],[98,2]],"version":"6.0.3"}
|
|
1
|
+
{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.es2024.d.ts","../../node_modules/typescript/lib/lib.es2025.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.dom.d.ts","../../node_modules/typescript/lib/lib.dom.iterable.d.ts","../../node_modules/typescript/lib/lib.dom.asynciterable.d.ts","../../node_modules/typescript/lib/lib.webworker.d.ts","../../node_modules/typescript/lib/lib.webworker.importscripts.d.ts","../../node_modules/typescript/lib/lib.webworker.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2016.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.es2023.intl.d.ts","../../node_modules/typescript/lib/lib.es2024.arraybuffer.d.ts","../../node_modules/typescript/lib/lib.es2024.collection.d.ts","../../node_modules/typescript/lib/lib.es2024.object.d.ts","../../node_modules/typescript/lib/lib.es2024.promise.d.ts","../../node_modules/typescript/lib/lib.es2024.regexp.d.ts","../../node_modules/typescript/lib/lib.es2024.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2024.string.d.ts","../../node_modules/typescript/lib/lib.es2025.collection.d.ts","../../node_modules/typescript/lib/lib.es2025.float16.d.ts","../../node_modules/typescript/lib/lib.es2025.intl.d.ts","../../node_modules/typescript/lib/lib.es2025.iterator.d.ts","../../node_modules/typescript/lib/lib.es2025.promise.d.ts","../../node_modules/typescript/lib/lib.es2025.regexp.d.ts","../../node_modules/typescript/lib/lib.esnext.array.d.ts","../../node_modules/typescript/lib/lib.esnext.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.date.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.error.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.esnext.temporal.d.ts","../../node_modules/typescript/lib/lib.esnext.typedarrays.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/io/FastMap.ts","../../src/io/FastSet.ts","../../src/io/codec.ts","../../src/io/types.ts","../../src/io/index.ts","../../src/io/lengths.ts"],"fileIdsList":[[94],[94,95,96,97]],"fileInfos":[{"version":"bcd24271a113971ba9eb71ff8cb01bc6b0f872a85c23fdbe5d93065b375933cd","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f88bedbeb09c6f5a6645cb24c7c55f1aa22d19ae96c8e6959cbd8b85a707bc6","impliedFormat":1},{"version":"7fe93b39b810eadd916be8db880dd7f0f7012a5cc6ffb62de8f62a2117fa6f1f","impliedFormat":1},{"version":"bb0074cc08b84a2374af33d8bf044b80851ccc9e719a5e202eacf40db2c31600","impliedFormat":1},{"version":"1a7daebe4f45fb03d9ec53d60008fbf9ac45a697fdc89e4ce218bc94b94f94d6","impliedFormat":1},{"version":"f94b133a3cb14a288803be545ac2683e0d0ff6661bcd37e31aaaec54fc382aed","impliedFormat":1},{"version":"f59d0650799f8782fd74cf73c19223730c6d1b9198671b1c5b3a38e1188b5953","impliedFormat":1},{"version":"8a15b4607d9a499e2dbeed9ec0d3c0d7372c850b2d5f1fb259e8f6d41d468a84","impliedFormat":1},{"version":"26e0fe14baee4e127f4365d1ae0b276f400562e45e19e35fd2d4c296684715e6","impliedFormat":1},{"version":"1e9332c23e9a907175e0ffc6a49e236f97b48838cc8aec9ce7e4cec21e544b65","impliedFormat":1},{"version":"3753fbc1113dc511214802a2342280a8b284ab9094f6420e7aa171e868679f91","impliedFormat":1},{"version":"999ca32883495a866aa5737fe1babc764a469e4cde6ee6b136a4b9ae68853e4b","impliedFormat":1},{"version":"17f13ecb98cbc39243f2eee1f16d45cd8ec4706b03ee314f1915f1a8b42f6984","impliedFormat":1},{"version":"d6b1eba8496bdd0eed6fc8a685768fe01b2da4a0388b5fe7df558290bffcf32f","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"d52ed68e7eb5881768a55713c9b5c7c443e6b46de15c04e348928b8efd20b110","affectsGlobalScope":true,"impliedFormat":1},{"version":"2a2de5b9459b3fc44decd9ce6100b72f1b002ef523126c1d3d8b2a4a63d74d78","affectsGlobalScope":true,"impliedFormat":1},{"version":"7f57fc4404ff020bc45b9c620aff2b40f700b95fe31164024c453a5e3c163c54","impliedFormat":1},{"version":"eadcffda2aa84802c73938e589b9e58248d74c59cb7fcbca6474e3435ac15504","affectsGlobalScope":true,"impliedFormat":1},{"version":"105ba8ff7ba746404fe1a2e189d1d3d2e0eb29a08c18dded791af02f29fb4711","affectsGlobalScope":true,"impliedFormat":1},{"version":"00343ca5b2e3d48fa5df1db6e32ea2a59afab09590274a6cccb1dbae82e60c7c","affectsGlobalScope":true,"impliedFormat":1},{"version":"ebd9f816d4002697cb2864bea1f0b70a103124e18a8cd9645eeccc09bdf80ab4","affectsGlobalScope":true,"impliedFormat":1},{"version":"2c1afac30a01772cd2a9a298a7ce7706b5892e447bb46bdbeef720f7b5da77ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"7b0225f483e4fa685625ebe43dd584bb7973bbd84e66a6ba7bbe175ee1048b4f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c0a4b8ac6ce74679c1da2b3795296f5896e31c38e888469a8e0f99dc3305de60","affectsGlobalScope":true,"impliedFormat":1},{"version":"3084a7b5f569088e0146533a00830e206565de65cae2239509168b11434cd84f","affectsGlobalScope":true,"impliedFormat":1},{"version":"c5079c53f0f141a0698faa903e76cb41cd664e3efb01cc17a5c46ec2eb0bef42","affectsGlobalScope":true,"impliedFormat":1},{"version":"32cafbc484dea6b0ab62cf8473182bbcb23020d70845b406f80b7526f38ae862","affectsGlobalScope":true,"impliedFormat":1},{"version":"fca4cdcb6d6c5ef18a869003d02c9f0fd95df8cfaf6eb431cd3376bc034cad36","affectsGlobalScope":true,"impliedFormat":1},{"version":"b93ec88115de9a9dc1b602291b85baf825c85666bf25985cc5f698073892b467","affectsGlobalScope":true,"impliedFormat":1},{"version":"f5c06dcc3fe849fcb297c247865a161f995cc29de7aa823afdd75aaaddc1419b","affectsGlobalScope":true,"impliedFormat":1},{"version":"b77e16112127a4b169ef0b8c3a4d730edf459c5f25fe52d5e436a6919206c4d7","affectsGlobalScope":true,"impliedFormat":1},{"version":"fbffd9337146eff822c7c00acbb78b01ea7ea23987f6c961eba689349e744f8c","affectsGlobalScope":true,"impliedFormat":1},{"version":"a995c0e49b721312f74fdfb89e4ba29bd9824c770bbb4021d74d2bf560e4c6bd","affectsGlobalScope":true,"impliedFormat":1},{"version":"c7b3542146734342e440a84b213384bfa188835537ddbda50d30766f0593aff9","affectsGlobalScope":true,"impliedFormat":1},{"version":"ce6180fa19b1cccd07ee7f7dbb9a367ac19c0ed160573e4686425060b6df7f57","affectsGlobalScope":true,"impliedFormat":1},{"version":"3f02e2476bccb9dbe21280d6090f0df17d2f66b74711489415a8aa4df73c9675","affectsGlobalScope":true,"impliedFormat":1},{"version":"45e3ab34c1c013c8ab2dc1ba4c80c780744b13b5676800ae2e3be27ae862c40c","affectsGlobalScope":true,"impliedFormat":1},{"version":"805c86f6cca8d7702a62a844856dbaa2a3fd2abef0536e65d48732441dde5b5b","affectsGlobalScope":true,"impliedFormat":1},{"version":"e42e397f1a5a77994f0185fd1466520691456c772d06bf843e5084ceb879a0ad","affectsGlobalScope":true,"impliedFormat":1},{"version":"f4c2b41f90c95b1c532ecc874bd3c111865793b23aebcc1c3cbbabcd5d76ffb0","affectsGlobalScope":true,"impliedFormat":1},{"version":"ab26191cfad5b66afa11b8bf935ef1cd88fabfcb28d30b2dfa6fad877d050332","affectsGlobalScope":true,"impliedFormat":1},{"version":"2088bc26531e38fb05eedac2951480db5309f6be3fa4a08d2221abb0f5b4200d","affectsGlobalScope":true,"impliedFormat":1},{"version":"cb9d366c425fea79716a8fb3af0d78e6b22ebbab3bd64d25063b42dc9f531c1e","affectsGlobalScope":true,"impliedFormat":1},{"version":"500934a8089c26d57ebdb688fc9757389bb6207a3c8f0674d68efa900d2abb34","affectsGlobalScope":true,"impliedFormat":1},{"version":"689da16f46e647cef0d64b0def88910e818a5877ca5379ede156ca3afb780ac3","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc21cc8b6fee4f4c2440d08035b7ea3c06b3511314c8bab6bef7a92de58a2593","affectsGlobalScope":true,"impliedFormat":1},{"version":"7ca53d13d2957003abb47922a71866ba7cb2068f8d154877c596d63c359fed25","affectsGlobalScope":true,"impliedFormat":1},{"version":"54725f8c4df3d900cb4dac84b64689ce29548da0b4e9b7c2de61d41c79293611","affectsGlobalScope":true,"impliedFormat":1},{"version":"e5594bc3076ac29e6c1ebda77939bc4c8833de72f654b6e376862c0473199323","affectsGlobalScope":true,"impliedFormat":1},{"version":"2f3eb332c2d73e729f3364fcc0c2b375e72a121e8157d25a82d67a138c83a95c","affectsGlobalScope":true,"impliedFormat":1},{"version":"6f4427f9642ce8d500970e4e69d1397f64072ab73b97e476b4002a646ac743b1","affectsGlobalScope":true,"impliedFormat":1},{"version":"48915f327cd1dea4d7bd358d9dc7732f58f9e1626a29cc0c05c8c692419d9bb7","affectsGlobalScope":true,"impliedFormat":1},{"version":"b7bf9377723203b5a6a4b920164df22d56a43f593269ba6ae1fdc97774b68855","affectsGlobalScope":true,"impliedFormat":1},{"version":"db9709688f82c9e5f65a119c64d835f906efe5f559d08b11642d56eb85b79357","affectsGlobalScope":true,"impliedFormat":1},{"version":"4b25b8c874acd1a4cf8444c3617e037d444d19080ac9f634b405583fd10ce1f7","affectsGlobalScope":true,"impliedFormat":1},{"version":"37be57d7c90cf1f8112ee2636a068d8fd181289f82b744160ec56a7dc158a9f5","affectsGlobalScope":true,"impliedFormat":1},{"version":"a917a49ac94cd26b754ab84e113369a75d1a47a710661d7cd25e961cc797065f","affectsGlobalScope":true,"impliedFormat":1},{"version":"6d3261badeb7843d157ef3e6f5d1427d0eeb0af0cf9df84a62cfd29fd47ac86e","affectsGlobalScope":true,"impliedFormat":1},{"version":"195daca651dde22f2167ac0d0a05e215308119a3100f5e6268e8317d05a92526","affectsGlobalScope":true,"impliedFormat":1},{"version":"8b11e4285cd2bb164a4dc09248bdec69e9842517db4ca47c1ba913011e44ff2f","affectsGlobalScope":true,"impliedFormat":1},{"version":"0508571a52475e245b02bc50fa1394065a0a3d05277fbf5120c3784b85651799","affectsGlobalScope":true,"impliedFormat":1},{"version":"8f9af488f510c3015af3cc8c267a9e9d96c4dd38a1fdff0e11dc5a544711415b","affectsGlobalScope":true,"impliedFormat":1},{"version":"fc611fea8d30ea72c6bbfb599c9b4d393ce22e2f5bfef2172534781e7d138104","affectsGlobalScope":true,"impliedFormat":1},{"version":"0bd714129fca875f7d4c477a1a392200b0bcd13fb2e80928cd334b63830ea047","affectsGlobalScope":true,"impliedFormat":1},{"version":"e2c9037ae6cd2c52d80ceef0b3c5ffdb488627d71529cf4f63776daf11161c9a","affectsGlobalScope":true,"impliedFormat":1},{"version":"135d5cf4d345f59f1a9caadfafcd858d3d9cc68290db616cc85797224448cccc","affectsGlobalScope":true,"impliedFormat":1},{"version":"bc238c3f81c2984751932b6aab223cd5b830e0ac6cad76389e5e9d2ffc03287d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4a07f9b76d361f572620927e5735b77d6d2101c23cdd94383eb5b706e7b36357","affectsGlobalScope":true,"impliedFormat":1},{"version":"7c4e8dc6ab834cc6baa0227e030606d29e3e8449a9f67cdf5605ea5493c4db29","affectsGlobalScope":true,"impliedFormat":1},{"version":"de7ba0fd02e06cd9a5bd4ab441ed0e122735786e67dde1e849cced1cd8b46b78","affectsGlobalScope":true,"impliedFormat":1},{"version":"6148e4e88d720a06855071c3db02069434142a8332cf9c182cda551adedf3156","affectsGlobalScope":true,"impliedFormat":1},{"version":"d63dba625b108316a40c95a4425f8d4294e0deeccfd6c7e59d819efa19e23409","affectsGlobalScope":true,"impliedFormat":1},{"version":"0568d6befee03dd435bed4fc25c4e46865b24bdcb8c563fdc21f580a2c301904","affectsGlobalScope":true,"impliedFormat":1},{"version":"30d62269b05b584741f19a5369852d5d34895aa2ac4fd948956f886d15f9cc0d","affectsGlobalScope":true,"impliedFormat":1},{"version":"f128dae7c44d8f35ee42e0a437000a57c9f06cc04f8b4fb42eebf44954d53dc8","affectsGlobalScope":true,"impliedFormat":1},{"version":"ffbe6d7b295306b2ba88030f65b74c107d8d99bdcf596ea99c62a02f606108b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"996fb27b15277369c68a4ba46ed138b4e9e839a02fb4ec756f7997629242fd9f","affectsGlobalScope":true,"impliedFormat":1},{"version":"79b712591b270d4778c89706ca2cfc56ddb8c3f895840e477388f1710dc5eda9","affectsGlobalScope":true,"impliedFormat":1},{"version":"20884846cef428b992b9bd032e70a4ef88e349263f63aeddf04dda837a7dba26","affectsGlobalScope":true,"impliedFormat":1},{"version":"5fcab789c73a97cd43828ee3cc94a61264cf24d4c44472ce64ced0e0f148bdb2","affectsGlobalScope":true,"impliedFormat":1},{"version":"db59a81f070c1880ad645b2c0275022baa6a0c4f0acdc58d29d349c6efcf0903","affectsGlobalScope":true,"impliedFormat":1},{"version":"673294292640f5722b700e7d814e17aaf7d93f83a48a2c9b38f33cbc940ad8b0","affectsGlobalScope":true,"impliedFormat":1},{"version":"d786b48f934cbca483b3c6d0a798cb43bbb4ada283e76fb22c28e53ae05b9e69","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ecb8e347cb6b2a8927c09b86263663289418df375f5e68e11a0ae683776978f","affectsGlobalScope":true,"impliedFormat":1},{"version":"142efd4ce210576f777dc34df121777be89eda476942d6d6663b03dcb53be3ff","affectsGlobalScope":true,"impliedFormat":1},{"version":"379bc41580c2d774f82e828c70308f24a005b490c25ba34d679d84bcf05c3d9d","affectsGlobalScope":true,"impliedFormat":1},{"version":"ed484fb2aa8a1a23d0277056ec3336e0a0b52f9b8d6a961f338a642faf43235d","affectsGlobalScope":true,"impliedFormat":1},{"version":"4ffedae1d1c2d53fdbca1c96d3c7dda544281f7d262f99b6880634f8fd8d9820","affectsGlobalScope":true,"impliedFormat":1},{"version":"83a730b125d477dd264df8ba479afab27a3dae7152b005c214ab94dc7ee44fd3","affectsGlobalScope":true,"impliedFormat":1},{"version":"1ce14b81c5cc821994aa8ec1d42b220dd41b27fcc06373bce3958af7421b77d4","affectsGlobalScope":true,"impliedFormat":1},{"version":"b3a048b3e9302ef9a34ef4ebb9aecfb28b66abb3bce577206a79fee559c230da","affectsGlobalScope":true,"impliedFormat":1},{"version":"5b2a4e30698cf563707a5180e8385abe9b66bc47527b1c367550156c461a9a50","signature":"6a4c287c863003342a42d8bf876c7df4c2e82e95f556af5ade71f05255845200"},{"version":"e343f9744a8f2af61013fe28d816e9a87e22021f229f8f38b7c536bf744f9d41","signature":"272e7bc3a3734cc9e7419625f04cff7095131e315e51a83fa992a5134763df49"},{"version":"2af5edb6361b480abbb5b61a36685af9126e6aab68b25bb8c7940b56bafb6fed","signature":"95d7fc009e516b8c2fc93192181dbf7858c70402d070ed85c61c34be685df103"},{"version":"ae4c9fffb9d6bff06cc5bd31285ad95ba0c5665436338a016e8e232d1a1b994a","signature":"3952955b5e83c1164fc78d7d54377fd4d09d2c11b79763cba53a7ff4b27a0601"},{"version":"8837ae5eb915aa1eb59dc7f608e02b8bae62e0f465ad689bffdf78d68f143d4c","signature":"48d0d0bebe2ccfd875953713d746fe4adae81b1e3a91ffafae29ead23fd5c39b"},{"version":"0c4bac17cf8fa8f3d7a210ced552058c2aa9cd3304c89fefea4aa8807ee841f4","signature":"c1631eafa81ab01bbddca5005243f1d9b5110681fa30a78564ad51637a9f310e"}],"root":[[94,99]],"options":{"allowJs":true,"allowSyntheticDefaultImports":true,"alwaysStrict":true,"declaration":true,"esModuleInterop":true,"experimentalDecorators":true,"module":99,"noImplicitAny":true,"outDir":"./","preserveConstEnums":true,"removeComments":true,"rootDir":"../../src/io","skipLibCheck":true,"sourceMap":false,"strict":true,"strictBindCallApply":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"suppressImplicitAnyIndexErrors":false,"target":99,"tsBuildInfoFile":"./.tsbuildinfo"},"referencedMap":[[95,1],[98,2]],"version":"6.0.3"}
|
package/build/io/codec.d.ts
CHANGED
|
@@ -23,7 +23,7 @@ export declare class DataWriter {
|
|
|
23
23
|
writeU256(v: bigint, be?: boolean): this;
|
|
24
24
|
writeI256(v: bigint, be?: boolean): this;
|
|
25
25
|
length(): number;
|
|
26
|
-
toBytes(): Uint8Array
|
|
26
|
+
toBytes(): Uint8Array<ArrayBuffer>;
|
|
27
27
|
}
|
|
28
28
|
export declare class DataReader {
|
|
29
29
|
private buf;
|
|
@@ -22,6 +22,9 @@ export class HelloHandler extends ToilHandler {
|
|
|
22
22
|
if (req.path == '/echo') {
|
|
23
23
|
return Response.text('you GET ' + req.path + '\n');
|
|
24
24
|
}
|
|
25
|
-
|
|
25
|
+
// Unhandled (not a plain notFound): tells the host this server has no
|
|
26
|
+
// answer for the path, so it may serve it itself. Under `toiljs dev`
|
|
27
|
+
// that falls through to Vite (client routes, assets).
|
|
28
|
+
return Response.unhandled();
|
|
26
29
|
}
|
|
27
30
|
}
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "toiljs",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.0.
|
|
4
|
+
"version": "0.0.27",
|
|
5
5
|
"author": "Dacely",
|
|
6
6
|
"description": "The modern React framework: a file-based React frontend and a ToilScript-compiled WebAssembly backend.",
|
|
7
7
|
"repository": {
|
|
@@ -45,6 +45,11 @@
|
|
|
45
45
|
"import": "./build/backend/index.js",
|
|
46
46
|
"default": "./build/backend/index.js"
|
|
47
47
|
},
|
|
48
|
+
"./devserver": {
|
|
49
|
+
"types": "./build/devserver/index.d.ts",
|
|
50
|
+
"import": "./build/devserver/index.js",
|
|
51
|
+
"default": "./build/devserver/index.js"
|
|
52
|
+
},
|
|
48
53
|
"./io": {
|
|
49
54
|
"types": "./build/io/index.d.ts",
|
|
50
55
|
"import": "./build/io/index.js",
|
|
@@ -90,12 +95,13 @@
|
|
|
90
95
|
},
|
|
91
96
|
"scripts": {
|
|
92
97
|
"watch": "tsc -p tsconfig.json --watch",
|
|
93
|
-
"build": "npm run build:shared && npm run build:logger && npm run build:client && npm run build:io && npm run build:backend && npm run build:compiler && npm run build:cli",
|
|
98
|
+
"build": "npm run build:shared && npm run build:logger && npm run build:client && npm run build:io && npm run build:backend && npm run build:devserver && npm run build:compiler && npm run build:cli",
|
|
94
99
|
"build:shared": "tsc -p tsconfig.shared.json",
|
|
95
100
|
"build:logger": "tsc -p tsconfig.logger.json",
|
|
96
101
|
"build:client": "tsc -p tsconfig.client.json",
|
|
97
102
|
"build:io": "tsc -p tsconfig.io.json",
|
|
98
103
|
"build:backend": "tsc -p tsconfig.backend.json",
|
|
104
|
+
"build:devserver": "tsc -p tsconfig.devserver.json",
|
|
99
105
|
"build:compiler": "tsc -p tsconfig.compiler.json",
|
|
100
106
|
"build:cli": "tsc -p tsconfig.cli.json --noEmit && esbuild src/cli/index.ts --bundle --platform=node --format=esm --outfile=build/cli/index.js --external:toiljs/*",
|
|
101
107
|
"test": "vitest run --coverage",
|
|
@@ -121,7 +127,7 @@
|
|
|
121
127
|
"eslint-plugin-react-refresh": "^0.5.2",
|
|
122
128
|
"picocolors": "^1.1.1",
|
|
123
129
|
"sharp": "^0.34.5",
|
|
124
|
-
"toilscript": "^0.1.
|
|
130
|
+
"toilscript": "^0.1.16",
|
|
125
131
|
"typescript-eslint": "^8.60.0",
|
|
126
132
|
"vite": "^8.0.14",
|
|
127
133
|
"vite-imagetools": "^10.0.0",
|
|
@@ -12,11 +12,12 @@ import { Response } from '../response';
|
|
|
12
12
|
export class ToilHandler {
|
|
13
13
|
/**
|
|
14
14
|
* Override to declare your routes. The default implementation
|
|
15
|
-
* returns
|
|
16
|
-
* still produces a valid envelope
|
|
15
|
+
* returns an unhandled-marked 404 so a handler that hasn't been
|
|
16
|
+
* wired up still produces a valid envelope, and the host knows it
|
|
17
|
+
* may serve the path itself.
|
|
17
18
|
*/
|
|
18
19
|
public handle(_req: Request): Response {
|
|
19
|
-
return Response.
|
|
20
|
+
return Response.unhandled();
|
|
20
21
|
}
|
|
21
22
|
|
|
22
23
|
/**
|
package/server/runtime/index.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
*/
|
|
16
16
|
|
|
17
17
|
export { Header, Method, Request } from './request';
|
|
18
|
-
export { Response } from './response';
|
|
18
|
+
export { Response, TOIL_UNHANDLED_HEADER } from './response';
|
|
19
19
|
export { ToilHandler } from './handlers/ToilHandler';
|
|
20
20
|
export { Server, ServerEnvironment } from './env/Server';
|
|
21
21
|
|
|
@@ -6,6 +6,16 @@
|
|
|
6
6
|
|
|
7
7
|
import { Header } from './request';
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* Marker header on the runtime's fallback 404 (no route matched, no handler
|
|
11
|
+
* wired). The host can use it to fall through to another layer, the dev
|
|
12
|
+
* server hands such requests to Vite (client routes, assets), and strips the
|
|
13
|
+
* marker before anything reaches the browser. A deliberate
|
|
14
|
+
* `Response.notFound()` does not carry it. Mirrored as `UNHANDLED_HEADER` in
|
|
15
|
+
* `src/devserver/module.ts`.
|
|
16
|
+
*/
|
|
17
|
+
export const TOIL_UNHANDLED_HEADER: string = 'x-toil-unhandled';
|
|
18
|
+
|
|
9
19
|
export class Response {
|
|
10
20
|
status: u16;
|
|
11
21
|
headers: Array<Header>;
|
|
@@ -63,6 +73,19 @@ export class Response {
|
|
|
63
73
|
return Response.text('not found\n', 404);
|
|
64
74
|
}
|
|
65
75
|
|
|
76
|
+
/**
|
|
77
|
+
* The "this server has no answer for that path" 404: a `notFound()`
|
|
78
|
+
* carrying {@link TOIL_UNHANDLED_HEADER} so the host may serve the path
|
|
79
|
+
* itself (static files, the client app). Returned by the framework when
|
|
80
|
+
* dispatch misses; handlers that mean "looked it up, does not exist"
|
|
81
|
+
* should return `notFound()` instead.
|
|
82
|
+
*/
|
|
83
|
+
public static unhandled(): Response {
|
|
84
|
+
const r = Response.notFound();
|
|
85
|
+
r.setHeader(TOIL_UNHANDLED_HEADER, '1');
|
|
86
|
+
return r;
|
|
87
|
+
}
|
|
88
|
+
|
|
66
89
|
public static badRequest(msg: string = 'bad request'): Response {
|
|
67
90
|
return Response.text(msg + '\n', 400);
|
|
68
91
|
}
|
|
@@ -11,10 +11,10 @@ import { ToilHandler } from '../handlers/ToilHandler';
|
|
|
11
11
|
import { Rest } from './Rest';
|
|
12
12
|
|
|
13
13
|
export class RestHandler extends ToilHandler {
|
|
14
|
-
/** Dispatches to the registered `@rest` controllers;
|
|
14
|
+
/** Dispatches to the registered `@rest` controllers; an unhandled-marked 404 when none match. */
|
|
15
15
|
handle(req: Request): Response {
|
|
16
16
|
const hit = Rest.dispatch(req);
|
|
17
17
|
if (hit != null) return hit;
|
|
18
|
-
return Response.
|
|
18
|
+
return Response.unhandled();
|
|
19
19
|
}
|
|
20
20
|
}
|
package/src/compiler/index.ts
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { spawn } from 'node:child_process';
|
|
2
2
|
import fs from 'node:fs';
|
|
3
3
|
import { createRequire } from 'node:module';
|
|
4
|
+
import net from 'node:net';
|
|
4
5
|
import path from 'node:path';
|
|
5
6
|
|
|
6
7
|
import pc from 'picocolors';
|
|
7
|
-
import { build as viteBuild, createServer, type ViteDevServer } from 'vite';
|
|
8
|
+
import { build as viteBuild, createServer, mergeConfig, type ViteDevServer } from 'vite';
|
|
8
9
|
import { startBackend, type RunningBackend } from 'toiljs/backend';
|
|
10
|
+
import { startDevServer } from 'toiljs/devserver';
|
|
9
11
|
|
|
10
12
|
import { loadConfig } from './config.js';
|
|
11
13
|
import { generate } from './generate.js';
|
|
@@ -140,11 +142,14 @@ async function buildServer(root: string): Promise<void> {
|
|
|
140
142
|
/**
|
|
141
143
|
* Watches the server source dirs and rebuilds the server (toilscript) on change, so editing a
|
|
142
144
|
* `@data`/`@rest` file under `toiljs dev` regenerates `shared/server.ts` - which Vite then HMRs
|
|
143
|
-
* into the client - the server-
|
|
144
|
-
*
|
|
145
|
-
*
|
|
145
|
+
* into the client - and the dev server hot-swaps the recompiled wasm: the server-side equivalent
|
|
146
|
+
* of Vite's client HMR. Client-only edits never touch these dirs, so they only trigger Vite,
|
|
147
|
+
* never a server rebuild. Rebuilds are debounced and never overlap. Rides Vite's chokidar
|
|
148
|
+
* watcher instead of a separate `fs.watch`: the native recursive watcher silently stops
|
|
149
|
+
* delivering events on Linux after editors replace files via rename, which left hot reload
|
|
150
|
+
* working exactly once. A no-op for client-only projects.
|
|
146
151
|
*/
|
|
147
|
-
function watchServer(root: string): void {
|
|
152
|
+
function watchServer(root: string, watcher: ViteDevServer['watcher']): void {
|
|
148
153
|
const dirs = serverDirs(root);
|
|
149
154
|
if (dirs.length === 0) return;
|
|
150
155
|
|
|
@@ -172,20 +177,47 @@ function watchServer(root: string): void {
|
|
|
172
177
|
};
|
|
173
178
|
|
|
174
179
|
let timer: ReturnType<typeof setTimeout> | undefined;
|
|
175
|
-
const
|
|
176
|
-
|
|
180
|
+
const isServerSource = (file: string): boolean =>
|
|
181
|
+
file.endsWith('.ts') &&
|
|
182
|
+
!file.endsWith('.d.ts') &&
|
|
183
|
+
dirs.some((dir) => file === dir || file.startsWith(dir + path.sep));
|
|
184
|
+
watcher.add(dirs);
|
|
185
|
+
watcher.on('all', (_event, file) => {
|
|
186
|
+
if (!isServerSource(file)) return;
|
|
177
187
|
if (timer) clearTimeout(timer);
|
|
178
188
|
timer = setTimeout(rebuild, 150); // debounce bursts (save-all, formatters)
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
189
|
+
});
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
/** The server wasm artifact path from the toilconfig `release` target (toilscript's output). */
|
|
193
|
+
function serverWasmFile(root: string): string {
|
|
194
|
+
let outFile = 'build/server/release.wasm';
|
|
195
|
+
try {
|
|
196
|
+
const cfg = JSON.parse(fs.readFileSync(path.join(root, 'toilconfig.json'), 'utf8')) as {
|
|
197
|
+
targets?: Record<string, { outFile?: string }>;
|
|
198
|
+
};
|
|
199
|
+
outFile = cfg.targets?.release?.outFile ?? outFile;
|
|
200
|
+
} catch {
|
|
201
|
+
// No readable toilconfig: caller already gated on its existence; keep the default.
|
|
188
202
|
}
|
|
203
|
+
return path.resolve(root, outFile);
|
|
204
|
+
}
|
|
205
|
+
|
|
206
|
+
/** An OS-assigned free loopback port (for the internal Vite server behind the dev front). */
|
|
207
|
+
async function freeLoopbackPort(): Promise<number> {
|
|
208
|
+
return new Promise((resolve, reject) => {
|
|
209
|
+
const probe = net.createServer();
|
|
210
|
+
probe.once('error', reject);
|
|
211
|
+
probe.listen(0, '127.0.0.1', () => {
|
|
212
|
+
const address = probe.address();
|
|
213
|
+
if (address === null || typeof address === 'string') {
|
|
214
|
+
probe.close();
|
|
215
|
+
reject(new Error('could not allocate a loopback port'));
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
probe.close(() => resolve(address.port));
|
|
219
|
+
});
|
|
220
|
+
});
|
|
189
221
|
}
|
|
190
222
|
|
|
191
223
|
export interface ToilCommandOptions {
|
|
@@ -197,7 +229,16 @@ export interface ToilCommandOptions {
|
|
|
197
229
|
readonly serverOnly?: boolean;
|
|
198
230
|
}
|
|
199
231
|
|
|
200
|
-
/**
|
|
232
|
+
/**
|
|
233
|
+
* Starts the dev server. Client-only projects get the plain Vite dev server on
|
|
234
|
+
* the configured port, unchanged. Projects with a server target
|
|
235
|
+
* (toilconfig.json) get the WASM dev server in front: a uWebSockets.js server
|
|
236
|
+
* on the configured port that dispatches requests into the ToilScript server
|
|
237
|
+
* wasm (same envelope ABI as the production edge) and transparently proxies
|
|
238
|
+
* everything the server does not claim, HMR websocket included, to a Vite dev
|
|
239
|
+
* server on an internal loopback port. Vite keeps 100% of its dev behavior;
|
|
240
|
+
* it just stops being the public listener. Returns the running Vite server.
|
|
241
|
+
*/
|
|
201
242
|
export async function dev(opts: ToilCommandOptions = {}): Promise<ViteDevServer> {
|
|
202
243
|
const cfg = await loadConfig(opts);
|
|
203
244
|
// Server first: build it (regenerating shared/server.ts) before the client dev server starts.
|
|
@@ -206,11 +247,45 @@ export async function dev(opts: ToilCommandOptions = {}): Promise<ViteDevServer>
|
|
|
206
247
|
await buildServer(cfg.root);
|
|
207
248
|
if (hasServer) process.stdout.write(pc.green(' ✓ ') + pc.dim('server built') + '\n');
|
|
208
249
|
generate(cfg);
|
|
209
|
-
|
|
250
|
+
|
|
251
|
+
if (!hasServer) {
|
|
252
|
+
const server = await createServer(await createViteConfig(cfg));
|
|
253
|
+
await server.listen();
|
|
254
|
+
server.printUrls();
|
|
255
|
+
return server;
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
// Vite moves to an internal loopback port; the WASM dev server takes the public one.
|
|
259
|
+
const vitePort = await freeLoopbackPort();
|
|
260
|
+
const viteConfig = mergeConfig(await createViteConfig(cfg), {
|
|
261
|
+
server: { port: vitePort, host: '127.0.0.1', strictPort: true },
|
|
262
|
+
});
|
|
263
|
+
const server = await createServer(viteConfig);
|
|
210
264
|
await server.listen();
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
265
|
+
|
|
266
|
+
const front = await startDevServer({
|
|
267
|
+
root: cfg.root,
|
|
268
|
+
port: cfg.port,
|
|
269
|
+
wasmFile: serverWasmFile(cfg.root),
|
|
270
|
+
vite: { host: '127.0.0.1', port: vitePort },
|
|
271
|
+
});
|
|
272
|
+
server.httpServer?.once('close', () => {
|
|
273
|
+
void front.close();
|
|
274
|
+
});
|
|
275
|
+
process.stdout.write(
|
|
276
|
+
'\n ' +
|
|
277
|
+
pc.green('➜') +
|
|
278
|
+
' ' +
|
|
279
|
+
pc.bold('Local') +
|
|
280
|
+
': ' +
|
|
281
|
+
pc.cyan(`http://localhost:${pc.bold(String(front.port))}/`) +
|
|
282
|
+
pc.dim(' (wasm server + vite)') +
|
|
283
|
+
'\n',
|
|
284
|
+
);
|
|
285
|
+
|
|
286
|
+
// Rebuild the server on server-file changes; Vite HMRs the regenerated shared/server.ts
|
|
287
|
+
// and the dev server hot-swaps the recompiled wasm module.
|
|
288
|
+
watchServer(cfg.root, server.watcher);
|
|
214
289
|
return server;
|
|
215
290
|
}
|
|
216
291
|
|