@browsercore/quic 0.1.3 → 0.1.7
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 +122 -0
- package/dist/connection.d.ts +33 -13
- package/dist/connection.d.ts.map +1 -1
- package/dist/connection.js +160 -77
- package/dist/connection.js.map +1 -1
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js.map +1 -1
- package/dist/frame/frame.d.ts +1 -2
- package/dist/frame/frame.d.ts.map +1 -1
- package/dist/frame/frame.js +26 -8
- package/dist/frame/frame.js.map +1 -1
- package/dist/frame/varint.d.ts +10 -0
- package/dist/frame/varint.d.ts.map +1 -1
- package/dist/frame/varint.js +41 -14
- package/dist/frame/varint.js.map +1 -1
- package/dist/index.d.ts +5 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/packet/packet.d.ts +1 -2
- package/dist/packet/packet.d.ts.map +1 -1
- package/dist/packet/packet.js +19 -4
- package/dist/packet/packet.js.map +1 -1
- package/dist/stream/stream.d.ts +7 -1
- package/dist/stream/stream.d.ts.map +1 -1
- package/dist/stream/stream.js +127 -84
- package/dist/stream/stream.js.map +1 -1
- package/dist/transport-params.d.ts +38 -0
- package/dist/transport-params.d.ts.map +1 -0
- package/dist/transport-params.js +124 -0
- package/dist/transport-params.js.map +1 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +2 -1
- package/dist/utils.js.map +1 -1
- package/package.json +51 -40
- package/.github/workflows/ci.yml +0 -17
- package/.github/workflows/publish.yml +0 -49
- package/CODING_STANDARDS.md +0 -205
- package/src/connection.ts +0 -374
- package/src/errors.ts +0 -153
- package/src/frame/frame.ts +0 -423
- package/src/frame/varint.ts +0 -124
- package/src/index.ts +0 -70
- package/src/packet/packet.ts +0 -210
- package/src/stream/stream.ts +0 -746
- package/src/types.ts +0 -441
- package/src/utils.ts +0 -38
- package/tests/connection.test.ts +0 -106
- package/tests/fake-transport.ts +0 -107
- package/tests/stream.test.ts +0 -152
- package/tests/wire.test.ts +0 -342
- package/tsconfig.json +0 -30
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QUIC transport parameter wire encoding (RFC 9000 §18.2).
|
|
3
|
+
*
|
|
4
|
+
* Each transport parameter is encoded as a varint id, followed by a varint
|
|
5
|
+
* length, followed by that many value bytes. The full parameter set is the
|
|
6
|
+
* concatenation of every encoded parameter. This is the format the TLS
|
|
7
|
+
* handshake carries in the QUIC extension — pure wire logic, no I/O.
|
|
8
|
+
*
|
|
9
|
+
* This module also converts between the high-level `QuicTransportParameters`
|
|
10
|
+
* interface (friendly numbers/bigints) and the wire-friendly
|
|
11
|
+
* `TransportParameters` map (id → raw value bytes) that encode/decode operate
|
|
12
|
+
* on. Only the parameters `QuicTransportParameters` models are converted; any
|
|
13
|
+
* other ids preserved in a `TransportParameters` map pass through encode and
|
|
14
|
+
* decode untouched.
|
|
15
|
+
*/
|
|
16
|
+
import { TransportParameter } from "./types.js";
|
|
17
|
+
import { decodeVarint, encodeVarint } from "./frame/varint.js";
|
|
18
|
+
import { concatAll } from "./utils.js";
|
|
19
|
+
/** Encode wire-format transport parameters to the on-the-wire byte layout. */
|
|
20
|
+
export function encodeTransportParameters(params) {
|
|
21
|
+
// Sort by id for deterministic encoding (RFC 9000 §18.2 does not require
|
|
22
|
+
// order, but deterministic output makes testing + interop predictable).
|
|
23
|
+
const entries = [...params.entries()].sort((a, b) => a[0] - b[0]);
|
|
24
|
+
const parts = [];
|
|
25
|
+
for (const [id, value] of entries) {
|
|
26
|
+
parts.push(encodeVarint(BigInt(id)), encodeVarint(BigInt(value.length)), value);
|
|
27
|
+
}
|
|
28
|
+
return concatAll(parts);
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Decode on-the-wire transport parameters. Unknown ids are preserved in the
|
|
32
|
+
* returned map so a caller can inspect them; they are simply never converted
|
|
33
|
+
* by {@link fromWireParameters}.
|
|
34
|
+
*/
|
|
35
|
+
export function decodeTransportParameters(buf) {
|
|
36
|
+
const params = new Map();
|
|
37
|
+
let offset = 0;
|
|
38
|
+
while (offset < buf.length) {
|
|
39
|
+
const id = decodeVarint(buf, offset);
|
|
40
|
+
offset += id.length;
|
|
41
|
+
const length = decodeVarint(buf, offset);
|
|
42
|
+
offset += length.length;
|
|
43
|
+
const valueEnd = offset + Number(length.value);
|
|
44
|
+
if (valueEnd > buf.length) {
|
|
45
|
+
throw new RangeError(`Transport parameter 0x${id.value.toString(16)}: value truncated (${Number(length.value)} bytes declared, ${buf.length - offset} available)`);
|
|
46
|
+
}
|
|
47
|
+
params.set(Number(id.value), buf.subarray(offset, valueEnd));
|
|
48
|
+
offset = valueEnd;
|
|
49
|
+
}
|
|
50
|
+
return params;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Convert high-level `QuicTransportParameters` to the wire-friendly map form.
|
|
54
|
+
* Only defined fields are emitted; absent fields are omitted.
|
|
55
|
+
*/
|
|
56
|
+
export function toWireParameters(params) {
|
|
57
|
+
const out = new Map();
|
|
58
|
+
if (params.maxIdleTimeoutMs !== undefined) {
|
|
59
|
+
out.set(TransportParameter.MAX_IDLE_TIMEOUT, encodeVarint(BigInt(params.maxIdleTimeoutMs)));
|
|
60
|
+
}
|
|
61
|
+
if (params.maxUdpPayloadSize !== undefined) {
|
|
62
|
+
out.set(TransportParameter.MAX_UDP_PAYLOAD_SIZE, encodeVarint(BigInt(params.maxUdpPayloadSize)));
|
|
63
|
+
}
|
|
64
|
+
if (params.initialMaxData !== undefined) {
|
|
65
|
+
out.set(TransportParameter.INITIAL_MAX_DATA, encodeVarint(params.initialMaxData));
|
|
66
|
+
}
|
|
67
|
+
if (params.initialMaxStreamDataBidiLocal !== undefined) {
|
|
68
|
+
out.set(TransportParameter.INITIAL_MAX_STREAM_DATA_BIDI_LOCAL, encodeVarint(params.initialMaxStreamDataBidiLocal));
|
|
69
|
+
}
|
|
70
|
+
if (params.initialMaxStreamDataBidiRemote !== undefined) {
|
|
71
|
+
out.set(TransportParameter.INITIAL_MAX_STREAM_DATA_BIDI_REMOTE, encodeVarint(params.initialMaxStreamDataBidiRemote));
|
|
72
|
+
}
|
|
73
|
+
if (params.initialMaxStreamDataUni !== undefined) {
|
|
74
|
+
out.set(TransportParameter.INITIAL_MAX_STREAM_DATA_UNI, encodeVarint(params.initialMaxStreamDataUni));
|
|
75
|
+
}
|
|
76
|
+
if (params.initialMaxStreamsBidi !== undefined) {
|
|
77
|
+
out.set(TransportParameter.INITIAL_MAX_STREAMS_BIDI, encodeVarint(params.initialMaxStreamsBidi));
|
|
78
|
+
}
|
|
79
|
+
if (params.initialMaxStreamsUni !== undefined) {
|
|
80
|
+
out.set(TransportParameter.INITIAL_MAX_STREAMS_UNI, encodeVarint(params.initialMaxStreamsUni));
|
|
81
|
+
}
|
|
82
|
+
if (params.activeConnectionIdLimit !== undefined) {
|
|
83
|
+
out.set(TransportParameter.ACTIVE_CONNECTION_ID_LIMIT, encodeVarint(BigInt(params.activeConnectionIdLimit)));
|
|
84
|
+
}
|
|
85
|
+
return out;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Convert the wire-friendly map form back to high-level
|
|
89
|
+
* `QuicTransportParameters`. Only the parameters `QuicTransportParameters`
|
|
90
|
+
* models are extracted; unknown ids in the map are ignored.
|
|
91
|
+
*/
|
|
92
|
+
export function fromWireParameters(params) {
|
|
93
|
+
// Decode every known id up front, then build the result in one
|
|
94
|
+
// assignment so we never mutate a readonly field mid-construction.
|
|
95
|
+
const maxIdle = params.get(TransportParameter.MAX_IDLE_TIMEOUT);
|
|
96
|
+
const maxUdp = params.get(TransportParameter.MAX_UDP_PAYLOAD_SIZE);
|
|
97
|
+
const initialMaxData = params.get(TransportParameter.INITIAL_MAX_DATA);
|
|
98
|
+
const bidiLocal = params.get(TransportParameter.INITIAL_MAX_STREAM_DATA_BIDI_LOCAL);
|
|
99
|
+
const bidiRemote = params.get(TransportParameter.INITIAL_MAX_STREAM_DATA_BIDI_REMOTE);
|
|
100
|
+
const uni = params.get(TransportParameter.INITIAL_MAX_STREAM_DATA_UNI);
|
|
101
|
+
const bidiStreams = params.get(TransportParameter.INITIAL_MAX_STREAMS_BIDI);
|
|
102
|
+
const uniStreams = params.get(TransportParameter.INITIAL_MAX_STREAMS_UNI);
|
|
103
|
+
const activeLimit = params.get(TransportParameter.ACTIVE_CONNECTION_ID_LIMIT);
|
|
104
|
+
return {
|
|
105
|
+
...(maxIdle === undefined ? {} : { maxIdleTimeoutMs: Number(decodeVarint(maxIdle).value) }),
|
|
106
|
+
...(maxUdp === undefined ? {} : { maxUdpPayloadSize: Number(decodeVarint(maxUdp).value) }),
|
|
107
|
+
...(initialMaxData === undefined ? {} : { initialMaxData: decodeVarint(initialMaxData).value }),
|
|
108
|
+
...(bidiLocal === undefined
|
|
109
|
+
? {}
|
|
110
|
+
: { initialMaxStreamDataBidiLocal: decodeVarint(bidiLocal).value }),
|
|
111
|
+
...(bidiRemote === undefined
|
|
112
|
+
? {}
|
|
113
|
+
: { initialMaxStreamDataBidiRemote: decodeVarint(bidiRemote).value }),
|
|
114
|
+
...(uni === undefined ? {} : { initialMaxStreamDataUni: decodeVarint(uni).value }),
|
|
115
|
+
...(bidiStreams === undefined
|
|
116
|
+
? {}
|
|
117
|
+
: { initialMaxStreamsBidi: decodeVarint(bidiStreams).value }),
|
|
118
|
+
...(uniStreams === undefined ? {} : { initialMaxStreamsUni: decodeVarint(uniStreams).value }),
|
|
119
|
+
...(activeLimit === undefined
|
|
120
|
+
? {}
|
|
121
|
+
: { activeConnectionIdLimit: Number(decodeVarint(activeLimit).value) }),
|
|
122
|
+
};
|
|
123
|
+
}
|
|
124
|
+
//# sourceMappingURL=transport-params.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transport-params.js","sourceRoot":"","sources":["../src/transport-params.ts"],"names":[],"mappings":"AAAA;;;;;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C,QAAQ,CAAC,mBAAmB,CAAC,EAAE,uBAAuB,CAAC;CAC1D;AAED,+DAA+D;AAC/D,MAAM,WAAW,uBAAuB;IACpC,QAAQ,CAAC,gBAAgB,CAAC,EAAE,MAAM,CAAC;IACnC,QAAQ,CAAC,iBAAiB,CAAC,EAAE,MAAM,CAAC;IACpC,QAAQ,CAAC,cAAc,CAAC,EAAE,MAAM,CAAC;IACjC,QAAQ,CAAC,6BAA6B,CAAC,EAAE,MAAM,CAAC;IAChD,QAAQ,CAAC,8BAA8B,CAAC,EAAE,MAAM,CAAC;IACjD,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;IAC1C,QAAQ,CAAC,qBAAqB,CAAC,EAAE,MAAM,CAAC;IACxC,QAAQ,CAAC,oBAAoB,CAAC,EAAE,MAAM,CAAC;IACvC,QAAQ,CAAC,uBAAuB,CAAC,EAAE,MAAM,CAAC;CAC7C"}
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAE3C;AAED,mCAAmC;AACnC,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU,CAK/D;AAED,6CAA6C;AAC7C,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,UAAU,
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,KAAK,GAAG,KAAK,CAE3C;AAED,mCAAmC;AACnC,wBAAgB,MAAM,CAAC,CAAC,EAAE,UAAU,EAAE,CAAC,EAAE,UAAU,GAAG,UAAU,CAK/D;AAED,6CAA6C;AAC7C,wBAAgB,SAAS,CAAC,KAAK,EAAE,SAAS,UAAU,EAAE,GAAG,UAAU,CAYlE;AAED,kDAAkD;AAClD,wBAAgB,GAAG,CAAC,KAAK,EAAE,UAAU,GAAG,MAAM,CAE7C"}
|
package/dist/utils.js
CHANGED
|
@@ -19,8 +19,9 @@ export function concat(a, b) {
|
|
|
19
19
|
/** Concatenate many byte arrays into one. */
|
|
20
20
|
export function concatAll(parts) {
|
|
21
21
|
let total = 0;
|
|
22
|
-
for (const p of parts)
|
|
22
|
+
for (const p of parts) {
|
|
23
23
|
total += p.length;
|
|
24
|
+
}
|
|
24
25
|
const out = new Uint8Array(total);
|
|
25
26
|
let offset = 0;
|
|
26
27
|
for (const p of parts) {
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;;;GAIG;AACH,MAAM,UAAU,WAAW,CAAC,CAAQ;IAChC,MAAM,IAAI,KAAK,CAAC,qBAAqB,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;AAC9D,CAAC;AAED,mCAAmC;AACnC,MAAM,UAAU,MAAM,CAAC,CAAa,EAAE,CAAa;IAC/C,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC;IAChD,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IACd,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC;IACrB,OAAO,GAAG,CAAC;AACf,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,SAAS,CAAC,KAA4B;IAClD,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,KAAK;
|
|
1
|
+
{"version":3,"file":"utils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C,CAAC,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;AAC3E,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,43 +1,54 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
2
|
+
"name": "@browsercore/quic",
|
|
3
|
+
"version": "0.1.7",
|
|
4
|
+
"description": "QUIC transport (RFC 9000) — packet headers, frames, packet protection, streams, and connection lifecycle over a datagram (UDP) transport. No knowledge of HTTP/3 or TLS handshake semantics.",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "https://github.com/jverneuer/browsercore-quic.git"
|
|
8
|
+
},
|
|
9
|
+
"homepage": "https://github.com/jverneuer/browsercore-quic#readme",
|
|
10
|
+
"bugs": {
|
|
11
|
+
"url": "https://github.com/jverneuer/browsercore-quic/issues"
|
|
12
|
+
},
|
|
13
|
+
"license": "MIT",
|
|
14
|
+
"type": "module",
|
|
15
|
+
"main": "./dist/index.js",
|
|
16
|
+
"types": "./dist/index.d.ts",
|
|
17
|
+
"exports": {
|
|
18
|
+
".": {
|
|
19
|
+
"types": "./dist/index.d.ts",
|
|
20
|
+
"import": "./dist/index.js"
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"files": [
|
|
24
|
+
"dist",
|
|
25
|
+
"LICENSE",
|
|
26
|
+
"README.md"
|
|
27
|
+
],
|
|
28
|
+
"scripts": {
|
|
29
|
+
"clean": "rm -rf dist *.tsbuildinfo",
|
|
30
|
+
"build": "tsc -p tsconfig.build.json",
|
|
31
|
+
"prepublishOnly": "npm run clean && npm run build",
|
|
32
|
+
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
33
|
+
"lint": "oxlint --type-aware src/",
|
|
34
|
+
"test": "vitest run"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {
|
|
37
|
+
"@browsercore/dev": "^0.1.2",
|
|
38
|
+
"@types/node": "^26.1.2",
|
|
39
|
+
"@vitest/coverage-v8": "^4.1.10",
|
|
40
|
+
"oxlint": "^1.76.0",
|
|
41
|
+
"oxlint-tsgolint": "7.0.2001",
|
|
42
|
+
"typescript": "^7.0.0",
|
|
43
|
+
"vitest": "^4.1.10"
|
|
44
|
+
},
|
|
45
|
+
"dependencies": {
|
|
46
|
+
"@browsercore/crypto": "0.1.4"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=26.0.0"
|
|
50
|
+
},
|
|
51
|
+
"publishConfig": {
|
|
52
|
+
"access": "public"
|
|
21
53
|
}
|
|
22
|
-
},
|
|
23
|
-
"scripts": {
|
|
24
|
-
"build": "tsc -p tsconfig.json",
|
|
25
|
-
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
26
|
-
"test": "vitest run",
|
|
27
|
-
"clean": "rm -rf dist *.tsbuildinfo"
|
|
28
|
-
},
|
|
29
|
-
"devDependencies": {
|
|
30
|
-
"@types/node": "^20.14.0",
|
|
31
|
-
"typescript": "^5.6.3",
|
|
32
|
-
"vitest": "^2.1.8"
|
|
33
|
-
},
|
|
34
|
-
"dependencies": {
|
|
35
|
-
"@browsercore/crypto": "latest"
|
|
36
|
-
},
|
|
37
|
-
"engines": {
|
|
38
|
-
"node": ">=24.0.0"
|
|
39
|
-
},
|
|
40
|
-
"publishConfig": {
|
|
41
|
-
"access": "public"
|
|
42
|
-
}
|
|
43
54
|
}
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [main]
|
|
5
|
-
pull_request:
|
|
6
|
-
branches: [main]
|
|
7
|
-
jobs:
|
|
8
|
-
build-and-test:
|
|
9
|
-
runs-on: ubuntu-latest
|
|
10
|
-
steps:
|
|
11
|
-
- uses: actions/checkout@v4
|
|
12
|
-
- uses: actions/setup-node@v4
|
|
13
|
-
with:
|
|
14
|
-
node-version: 24
|
|
15
|
-
- run: npm install
|
|
16
|
-
- run: npm test
|
|
17
|
-
- run: npm run build
|
|
@@ -1,49 +0,0 @@
|
|
|
1
|
-
name: Publish
|
|
2
|
-
on:
|
|
3
|
-
push:
|
|
4
|
-
branches: [main]
|
|
5
|
-
jobs:
|
|
6
|
-
publish:
|
|
7
|
-
runs-on: ubuntu-latest
|
|
8
|
-
permissions:
|
|
9
|
-
contents: write
|
|
10
|
-
id-token: write
|
|
11
|
-
steps:
|
|
12
|
-
- uses: actions/checkout@v4
|
|
13
|
-
with:
|
|
14
|
-
fetch-depth: 0
|
|
15
|
-
fetch-tags: true
|
|
16
|
-
token: ${{ secrets.GITHUB_TOKEN }}
|
|
17
|
-
- uses: actions/setup-node@v4
|
|
18
|
-
with:
|
|
19
|
-
node-version: 24
|
|
20
|
-
registry-url: https://registry.npmjs.org
|
|
21
|
-
- run: npm install
|
|
22
|
-
- run: npm run build
|
|
23
|
-
- run: npm test
|
|
24
|
-
- name: Publish to npm if version is new
|
|
25
|
-
run: |
|
|
26
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
27
|
-
NAME=$(node -p "require('./package.json').name")
|
|
28
|
-
if npm view "$NAME@$VERSION" version >/dev/null 2>&1; then
|
|
29
|
-
echo "$NAME@$VERSION already on npm — skipping publish"
|
|
30
|
-
else
|
|
31
|
-
npm publish --access public
|
|
32
|
-
fi
|
|
33
|
-
env:
|
|
34
|
-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
|
|
35
|
-
- name: Create git tag and GitHub Release
|
|
36
|
-
env:
|
|
37
|
-
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
38
|
-
run: |
|
|
39
|
-
VERSION=$(node -p "require('./package.json').version")
|
|
40
|
-
TAG="v$VERSION"
|
|
41
|
-
if git rev-parse "$TAG" >/dev/null 2>&1; then
|
|
42
|
-
echo "tag $TAG already exists — skipping release"
|
|
43
|
-
exit 0
|
|
44
|
-
fi
|
|
45
|
-
git config user.name "github-actions[bot]"
|
|
46
|
-
git config user.email "github-actions[bot]@users.noreply.github.com"
|
|
47
|
-
git tag "$TAG"
|
|
48
|
-
git push origin "$TAG"
|
|
49
|
-
gh release create "$TAG" --title "$TAG" --generate-notes
|
package/CODING_STANDARDS.md
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
# TypeScript Coding Standards
|
|
2
|
-
|
|
3
|
-
These rules are the standard for this codebase and **every** sub-package. Every PR,
|
|
4
|
-
every AI-generated snippet, and every hand-written file follows them. They exist so
|
|
5
|
-
the intended behavior lives in the types — never in tribal knowledge or hidden assumptions.
|
|
6
|
-
|
|
7
|
-
> Design for AI modification: before committing, ask *"Could another developer or an
|
|
8
|
-
> LLM understand the intended behavior without asking me?"* If not — add types, split
|
|
9
|
-
> functions, clarify states, rename.
|
|
10
|
-
|
|
11
|
-
---
|
|
12
|
-
|
|
13
|
-
## 1. Strict compiler — never relax it
|
|
14
|
-
|
|
15
|
-
Every `tsconfig.json` inherits `tsconfig.base.json`, which carries:
|
|
16
|
-
|
|
17
|
-
```json
|
|
18
|
-
{
|
|
19
|
-
"strict": true,
|
|
20
|
-
"noUncheckedIndexedAccess": true,
|
|
21
|
-
"exactOptionalPropertyTypes": true
|
|
22
|
-
}
|
|
23
|
-
```
|
|
24
|
-
|
|
25
|
-
- `noUncheckedIndexedAccess` → `arr[i]` is `T | undefined`.
|
|
26
|
-
- `exactOptionalPropertyTypes` → `?` means absent-or-present, not present-and-undefined.
|
|
27
|
-
|
|
28
|
-
Ambiguity creates bugs and forces LLMs to guess. **Never** override these to `false`
|
|
29
|
-
in a sub-package to dodge an error. Fix the error instead.
|
|
30
|
-
|
|
31
|
-
## 2. Every important data structure has a type
|
|
32
|
-
|
|
33
|
-
If data crosses a module boundary, it has an explicit type. No anonymous object
|
|
34
|
-
literals escaping a function.
|
|
35
|
-
|
|
36
|
-
```ts
|
|
37
|
-
// Bad
|
|
38
|
-
const frame = { type: 0x1, streamId: 3, data: buf };
|
|
39
|
-
|
|
40
|
-
// Good
|
|
41
|
-
interface HeadersFrame {
|
|
42
|
-
readonly type: FrameType.HEADERS;
|
|
43
|
-
readonly streamId: StreamId;
|
|
44
|
-
readonly data: Uint8Array;
|
|
45
|
-
}
|
|
46
|
-
```
|
|
47
|
-
|
|
48
|
-
## 3. Never `any`
|
|
49
|
-
|
|
50
|
-
Unknown external data is `unknown`, then validated. `any` is a build failure.
|
|
51
|
-
|
|
52
|
-
```ts
|
|
53
|
-
function parseFrame(raw: Uint8Array): Frame {
|
|
54
|
-
const unknown = decodeUnknown(raw); // unknown
|
|
55
|
-
return FrameSchema.parse(unknown); // validated → typed
|
|
56
|
-
}
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
## 4. Interfaces for domain objects, type aliases for states/constraints
|
|
60
|
-
|
|
61
|
-
- Interfaces for real entities (`TlsConnection`, `Http2Stream`, `Cookie`).
|
|
62
|
-
- Type aliases for states/constraints (`RunStatus`, `CipherSuite`).
|
|
63
|
-
- If values come from a known set, encode the set — never bare `string`.
|
|
64
|
-
|
|
65
|
-
## 5. Model states explicitly — make invalid states unrepresentable
|
|
66
|
-
|
|
67
|
-
No "state via nullable-field combos." Use discriminated unions.
|
|
68
|
-
|
|
69
|
-
```ts
|
|
70
|
-
// Bad — allows { state: "open", error: "failed" }
|
|
71
|
-
interface Connection {
|
|
72
|
-
state: string;
|
|
73
|
-
stream?: Stream;
|
|
74
|
-
error?: string;
|
|
75
|
-
}
|
|
76
|
-
|
|
77
|
-
// Good
|
|
78
|
-
type ConnectionState =
|
|
79
|
-
| { readonly state: "connecting" }
|
|
80
|
-
| { readonly state: "open"; readonly stream: Stream }
|
|
81
|
-
| { readonly state: "closed"; readonly reason: CloseReason };
|
|
82
|
-
```
|
|
83
|
-
|
|
84
|
-
## 6. Discriminated unions for every workflow/state
|
|
85
|
-
|
|
86
|
-
The compiler + LLM reason about every case.
|
|
87
|
-
|
|
88
|
-
## 7. Functions declare input AND output types
|
|
89
|
-
|
|
90
|
-
Public functions always define both sides — no inference-only signatures on exported APIs.
|
|
91
|
-
|
|
92
|
-
## 8. One function = one decision
|
|
93
|
-
|
|
94
|
-
No `processHandshake()` that validates + persists + schedules + notifies. Split:
|
|
95
|
-
`validate…`, `decodeStep`, `actuate`, `recordStep`.
|
|
96
|
-
|
|
97
|
-
## 9. No hidden behavior
|
|
98
|
-
|
|
99
|
-
A function named `updateSettings` does not also flush a log. Every side effect is its
|
|
100
|
-
own named call.
|
|
101
|
-
|
|
102
|
-
## 10. Name things explicitly
|
|
103
|
-
|
|
104
|
-
`cipherSuite`, `observedRank`, `clientHello` — never `data`, `result`, `obj`.
|
|
105
|
-
The name is the documentation.
|
|
106
|
-
|
|
107
|
-
## 11. Prefer immutable data + `readonly`
|
|
108
|
-
|
|
109
|
-
```ts
|
|
110
|
-
const next = { ...prev, cipherSuite } as const;
|
|
111
|
-
interface Connection { readonly id: ConnectionId; }
|
|
112
|
-
```
|
|
113
|
-
|
|
114
|
-
No in-place mutation of shared state. `const` over `let`.
|
|
115
|
-
|
|
116
|
-
## 12. Validate external data immediately
|
|
117
|
-
|
|
118
|
-
Everything from outside the boundary is `unknown`: sockets, files, captures, configs.
|
|
119
|
-
Use **Zod** at every boundary:
|
|
120
|
-
|
|
121
|
-
```ts
|
|
122
|
-
const frame = FrameSchema.parse(raw); // never `raw as Frame`
|
|
123
|
-
```
|
|
124
|
-
|
|
125
|
-
## 13. Types are contracts, not documentation
|
|
126
|
-
|
|
127
|
-
```ts
|
|
128
|
-
// Bad // user id
|
|
129
|
-
// id: string;
|
|
130
|
-
// Good
|
|
131
|
-
type UserId = string & { __brand: "UserId" };
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
## 14. Branded/opaque ID types — load-bearing
|
|
135
|
-
|
|
136
|
-
Don't use bare `number`/`string` for IDs. This kills the "pass an X where a Y belongs"
|
|
137
|
-
class of bug. The project uses these brands (defined per-package, see `types.ts`):
|
|
138
|
-
|
|
139
|
-
```ts
|
|
140
|
-
type ConnectionId = string & { __brand: "ConnectionId" };
|
|
141
|
-
type StreamId = number & { __brand: "StreamId" };
|
|
142
|
-
type SessionId = string & { __brand: "SessionId" };
|
|
143
|
-
```
|
|
144
|
-
|
|
145
|
-
## 15. Exhaustive switches
|
|
146
|
-
|
|
147
|
-
Every `switch` over a union hits `default: assertNever(x)`. Adding a state forces every
|
|
148
|
-
handler to compile-error until handled.
|
|
149
|
-
|
|
150
|
-
```ts
|
|
151
|
-
function assertNever(x: never): never {
|
|
152
|
-
throw new Error(`Unexpected value: ${JSON.stringify(x)}`);
|
|
153
|
-
}
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
## 16. Explicit, typed errors
|
|
157
|
-
|
|
158
|
-
```ts
|
|
159
|
-
// Bad
|
|
160
|
-
throw new Error("handshake failed");
|
|
161
|
-
// Good
|
|
162
|
-
throw new TlsHandshakeError("server_hello_parse", cause);
|
|
163
|
-
```
|
|
164
|
-
|
|
165
|
-
Errors are part of the API. Define them in each package's `errors.ts`.
|
|
166
|
-
|
|
167
|
-
## 17. No magic strings
|
|
168
|
-
|
|
169
|
-
`if (event === Event.COLD_START)` or a string-literal union — never bare `"cold_start"`.
|
|
170
|
-
|
|
171
|
-
## 18. Clear dependency boundaries
|
|
172
|
-
|
|
173
|
-
Domain (pure protocol logic) knows nothing of AWS / HTTP / DDB / sockets. Infrastructure
|
|
174
|
-
adapts. The protocol state machines stay I/O-free so they're unit-testable.
|
|
175
|
-
|
|
176
|
-
**Within this repo**, the dependency graph flows upward only — never sideways or downward:
|
|
177
|
-
|
|
178
|
-
```
|
|
179
|
-
@browsercore/fetch
|
|
180
|
-
└─ @browsercore/http2 @browsercore/http1 @browsercore/cookies @browsercore/profiles
|
|
181
|
-
└─ @browsercore/tls
|
|
182
|
-
└─ @browsercore/crypto @browsercore/transport
|
|
183
|
-
└─ node:net / node:crypto
|
|
184
|
-
```
|
|
185
|
-
|
|
186
|
-
A package may only import from packages *below* it in this graph.
|
|
187
|
-
|
|
188
|
-
## 19. Documentation: why, not what
|
|
189
|
-
|
|
190
|
-
Comments explain *why* ("crawl past our position so the competitor snapshot covers the
|
|
191
|
-
neighborhood"), never *what* the code obviously does. Priority: Types > Names > Structure >
|
|
192
|
-
Comments.
|
|
193
|
-
|
|
194
|
-
## 20. API contracts in one place
|
|
195
|
-
|
|
196
|
-
Domain types live in each package's `types.ts`; wire schemas in `schemas.ts`. One source
|
|
197
|
-
of truth, never duplicated shapes.
|
|
198
|
-
|
|
199
|
-
---
|
|
200
|
-
|
|
201
|
-
## The Golden Rule
|
|
202
|
-
|
|
203
|
-
Every piece of important information exists as one of: **a type, a function signature,
|
|
204
|
-
an explicit state model, a schema validation, or clear naming.** Never rely on tribal
|
|
205
|
-
knowledge or hidden assumptions.
|