@zukhruf/net 0.8.241 → 0.8.243
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 +18 -13
- package/package.json +5 -5
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
# @zukhruf/net
|
|
2
2
|
|
|
3
|
-
> **In build (backlog #6078).** The API on paper was approved on 2026-11-28, and it is built as the paper shows. It is on npm, and the test files of sdk-it, text2sql, finetuning, mteb, deepagents
|
|
3
|
+
> **In build (backlog #6078).** The API on paper was approved on 2026-11-28, and it is built as the paper shows. It is on npm, and the test files of sdk-it, text2sql, finetuning, mteb, deepagents, offers-evals, elt and context-compiler moved onto it, so `@zukhruf/testing/http` is gone; the other consumers move next (see [Who uses it](#who-uses-it)). Each decision is an accepted ADR, and each detail that the review decided is in [Decided in the review](#decided-in-the-review).
|
|
4
4
|
|
|
5
5
|
A server of this program that accepts connections, and that ends each one at its end. A `Server` says what to do with each connection. `server.serve(endpoint)` listens on a TCP port of the loopback address or on a pipe, and gives a `Serving`. The serving keeps each socket that it accepted. Its `close()` destroys each one and waits for its close, and its `shutdown(signal)` waits until each one ends by itself and closes the rest at the abort. `@zukhruf/net/http` is the same server for HTTP.
|
|
6
6
|
|
|
7
|
-
A test needs this server most: 48 test files of 9 repositories
|
|
7
|
+
A test needs this server most: when the package began, 48 test files of 9 repositories had their own copy of it, and 13 files had their own `portOf` ([ADR 0001](./docs/adr/0001-a-base-package-above-pipes-owns-the-connections-that-a-server-accepts-and-testings-httpserver-converges-into-it.md)). It is a base package, so shipped code can use it too.
|
|
8
8
|
|
|
9
9
|
The words in these documents have one meaning each. See the glossary in [CONTEXT.md](./CONTEXT.md).
|
|
10
10
|
|
|
@@ -88,7 +88,7 @@ const answer = await fetch(`${site.origin}/`);
|
|
|
88
88
|
- `shutdown(signal)` ends each idle connection at once, and each other connection after its response, as Go's `Shutdown`.
|
|
89
89
|
- `options` are those of `http.createServer` (`keepAliveTimeout`, `highWaterMark`, ...) and `upgrade`, a listener of the `upgrade` event. docker's fake engine needs all three.
|
|
90
90
|
|
|
91
|
-
| `@zukhruf/testing/http
|
|
91
|
+
| `@zukhruf/testing/http`, removed (#6078) | `@zukhruf/net/http` |
|
|
92
92
|
| -------------------------------------------- | ---------------------------------------------------------- |
|
|
93
93
|
| `await new HttpServer().start(handler)` | `await new HttpServer(handler).serve(new TcpEndpoint())` |
|
|
94
94
|
| `handle.origin` | `serving.origin` |
|
|
@@ -115,16 +115,17 @@ The package has no error class of its own. A caller does not do a different next
|
|
|
115
115
|
|
|
116
116
|
## Who uses it
|
|
117
117
|
|
|
118
|
-
| Consumer
|
|
119
|
-
|
|
|
120
|
-
|
|
|
121
|
-
|
|
|
122
|
-
|
|
|
123
|
-
|
|
|
124
|
-
|
|
|
125
|
-
| ssh `
|
|
126
|
-
|
|
|
127
|
-
|
|
|
118
|
+
| Consumer | How | Record |
|
|
119
|
+
| ------------------------------------------------------------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------- | ------------- |
|
|
120
|
+
| 106 test files of elt (49), text2sql (20), sdk-it (18), finetuning (9), mteb (6), deepagents (2), context-compiler (1) and offers-evals (1) | `HttpServer` on a `TcpEndpoint` | backlog #6078 |
|
|
121
|
+
| docker's 12 test files of the engine | `HttpServer` on a `PipeEndpoint`, today `fakeEngine` | backlog #6078 |
|
|
122
|
+
| ssh's `client`, `config-dial-route` and `config-dial` tests | `Server` whose handler only notes the accept, in place of `startSilentServer` | backlog #6078 |
|
|
123
|
+
| 6 mutex and 3 single-flight test files | `Server` on a `PipeEndpoint`, today `standInServer` | backlog #6078 |
|
|
124
|
+
| ssh `control.test.ts`, `owner-death.test.ts` and `channels.test.ts` | `Server` on a `TcpEndpoint` or a `PipeEndpoint`, with `allowHalfOpen` where the test answers after the end, in place of `listen` | backlog #6078 |
|
|
125
|
+
| ssh `client-ref.test.ts`, `src/testing/reports.ts` and `src/testing/ssh-client.ts` | `Server` on a `TcpEndpoint`; `ssh-client.ts` ends with `shutdown(signal)` | backlog #6078 |
|
|
126
|
+
| 9 files of ssh, and tools/eslint-rules `repoint.test.ts` | `serving.address.port`, in place of `portOf` | backlog #5947 |
|
|
127
|
+
| the `sshd.ts` of ssh, docker and testing | `serving.address.port`, today `portOf`; each `sshd.ts` hands the socket to a child and needs `pauseOnConnect`, which `Server` lacks | backlog #5947 |
|
|
128
|
+
| `@zukhruf/chaos` | `Proxy` is a handler that a `Server` serves | backlog #6078 |
|
|
128
129
|
|
|
129
130
|
## The same concepts in other systems
|
|
130
131
|
|
|
@@ -250,6 +251,10 @@ Each item is a detail that a caller sees. Ezz approved each proposal on 2026-11-
|
|
|
250
251
|
|
|
251
252
|
## Documentation
|
|
252
253
|
|
|
254
|
+
**Recipes**
|
|
255
|
+
|
|
256
|
+
- [Stand in for an HTTP API with a local server](./docs/recipes/stand-in-for-an-http-api.md)
|
|
257
|
+
|
|
253
258
|
**Decisions**
|
|
254
259
|
|
|
255
260
|
- [ADR 0001](./docs/adr/0001-a-base-package-above-pipes-owns-the-connections-that-a-server-accepts-and-testings-httpserver-converges-into-it.md): a base package above pipes owns the connections that a server accepts, and testing's HttpServer converges into it.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zukhruf/net",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.243",
|
|
4
4
|
"description": "A server that accepts connections on a TCP port or a pipe and owns each socket: close destroys each one and waits for its close, shutdown waits until its signal aborts; @zukhruf/net/http serves HTTP the same way. After Go's net and net/http.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -49,9 +49,9 @@
|
|
|
49
49
|
"access": "public"
|
|
50
50
|
},
|
|
51
51
|
"devDependencies": {
|
|
52
|
-
"@zukhruf/fs": "^0.8.
|
|
53
|
-
"@zukhruf/parameterized-test": "^0.8.
|
|
54
|
-
"@zukhruf/pipes": "^0.8.
|
|
55
|
-
"@zukhruf/process": "^0.8.
|
|
52
|
+
"@zukhruf/fs": "^0.8.243",
|
|
53
|
+
"@zukhruf/parameterized-test": "^0.8.243",
|
|
54
|
+
"@zukhruf/pipes": "^0.8.243",
|
|
55
|
+
"@zukhruf/process": "^0.8.243"
|
|
56
56
|
}
|
|
57
57
|
}
|