@tinkered/bun 0.21.1 → 0.21.3

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 CHANGED
@@ -34,11 +34,16 @@ const socket = ws.server({
34
34
  path: "/rpc",
35
35
  services: [api],
36
36
  });
37
- const table = routes({ table, stop });
38
37
 
39
38
  export default defineMain(
40
- ({ env, signal, stdout }) =>
41
- createScope({
39
+ ({ env, signal, stdout }) => {
40
+ // `routes` is the template's request table.
41
+ const table = routes({
42
+ stop: signal,
43
+ table: { "GET /api/health": health },
44
+ });
45
+
46
+ return createScope({
42
47
  signal,
43
48
  capsules: [
44
49
  serve({
@@ -52,7 +57,8 @@ export default defineMain(
52
57
  socket,
53
58
  table,
54
59
  ],
55
- }),
60
+ });
61
+ },
56
62
  );
57
63
  ```
58
64
 
@@ -113,6 +119,21 @@ takes a bytes POST. Each answer:
113
119
  A bytes POST is for a key with a
114
120
  bytes field.
115
121
 
122
+ Two services with one address fail the start
123
+ with `DuplicateAddress`. The fault names both:
124
+
125
+ ```
126
+ two boards, each with a cell named "flows":
127
+
128
+ DuplicateAddress
129
+ address: "flows"
130
+ services: ["approvals.flows", "admin.flows"]
131
+ ```
132
+
133
+ - The fix is a rename of one cell.
134
+ - `strict: false` lets the first in the list
135
+ win, with a warning at start.
136
+
116
137
  The client:
117
138
 
118
139
  ```ts
package/dist/index.mjs CHANGED
@@ -13,7 +13,7 @@ function createWs() {
13
13
  const services = tag({ label: "ws.services" }).required;
14
14
  const strict = tag({
15
15
  label: "ws.strict",
16
- default: false
16
+ default: true
17
17
  });
18
18
  /** The public origin a socket comes from. Unset, it is the request URL's own origin; behind a
19
19
  * TLS proxy that is `http://<host>`, so the app binds its public `https` origin here. */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tinkered/bun",
3
- "version": "0.21.1",
3
+ "version": "0.21.3",
4
4
  "description": "Tinker on Bun: the host on Bun.serve, rpc over one WebSocket, and Bun's own databases (Bun.SQL, bun:sqlite).",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -24,7 +24,7 @@
24
24
  "access": "public"
25
25
  },
26
26
  "dependencies": {
27
- "@tinkered/core": "^0.21.1"
27
+ "@tinkered/core": "^0.21.3"
28
28
  },
29
29
  "devDependencies": {
30
30
  "@hughescr/stryker-bun-runner": "1.6.0",