@zerotal/client 1.7.2 → 1.7.4

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 CHANGED
@@ -8,13 +8,15 @@ follows the Zerotal monorepo's unified versioning.
8
8
 
9
9
  ## [Unreleased]
10
10
 
11
+ ## [1.7.2] — 2026-08-18
12
+
11
13
  ### Fixed
12
14
 
13
15
  - **The documented import could not be bundled for a browser.** `import { Socket } from
14
- "@zerotal/client"` — the line the broadcasting guide taught — failed with `Browser build cannot
15
- import() Bun builtin: "bun"`. The root entry also exports `ClientProvider`, which extends core's
16
+ "@zerotal/client"` — the line the broadcasting guide taught — failed with `Browser build cannot
17
+ import() Bun builtin: "bun"`. The root entry also exports `ClientProvider`, which extends core's
16
18
  `ServiceProvider`, which reaches `CommandRunner`, which reaches the built-in CLI commands, one of
17
- which does `await import("bun")`. That is a *resolution*-time error, so tree-shaking never got the
19
+ which does `await import("bun")`. That is a _resolution_-time error, so tree-shaking never got the
18
20
  chance to drop the half nobody in a browser wanted: one server-only export made the whole package
19
21
  unusable in the environment it exists for.
20
22
 
@@ -29,14 +31,13 @@ follows the Zerotal monorepo's unified versioning.
29
31
  browser entry re-exporting it from the barrel pulls the barrel back in — the first attempt at this
30
32
  fix did exactly that and bundled straight back into the same error. And the modules a browser can
31
33
  reach now import from narrow core subpaths (`@zerotal/core/errors`, `@zerotal/core/helpers`)
32
- rather than the root, because importing *anything at all* from core's root is enough to poison a
34
+ rather than the root, because importing _anything at all_ from core's root is enough to poison a
33
35
  browser bundle.
34
36
 
35
37
  Guarded by a test that runs `Bun.build` with `target: "browser"` — no unit test can see this,
36
38
  since every module imports fine under Bun — plus one that holds the browser entry in step with
37
39
  the barrel, since two entry points means two places to remember to add an export to.
38
40
 
39
-
40
41
  ## [1.0.3] — 2026-08-07
41
42
 
42
43
  ### Changed
package/api-surface.md CHANGED
@@ -285,10 +285,35 @@ type ResponseInterceptor = (ctx: ResponseContext) => ResponseContext | Promise<R
285
285
 
286
286
  type ResponseOf = `${Method} ${Path}` extends keyof Routes ? Routes[`${Method} ${Path}`] extends { response: infer R;} ? R : unknown : unknown
287
287
 
288
- type SocketState = 'error' | 'connecting' | 'connected' | 'disconnected' | 'reconnecting'
288
+ type SocketState = 'connecting' | 'connected' | 'disconnected' | 'reconnecting' | 'error'
289
289
 
290
290
  type TokenSource = string | (() => string | null | undefined | Promise<string | null | undefined>)
291
291
 
292
+ ## ./provider `(./src/provider/ClientProvider.ts)`
293
+
294
+ class ClientProvider = {
295
+ new (app: Application): ClientProvider
296
+ static dependsOn?: (new (app: Application) => ServiceProvider)[]
297
+ static environments: AppEnvironment[]
298
+ static priority?: number
299
+ static provides: readonly ['client']
300
+ devProcesses: () => DevProcessDefinition[]
301
+ doctorChecks: () => DoctorCheck[]
302
+ onBooted: () => Promise<void>
303
+ onBooting: () => Promise<void>
304
+ onRegister: () => void
305
+ onRequestProcessed: (_ctx: HttpContext) => Promise<void>
306
+ onRequestReceived: (_ctx: HttpContext) => Promise<void>
307
+ onResponseSent: (_ctx: HttpContext) => Promise<void>
308
+ onStarted: () => Promise<void>
309
+ onStarting: () => Promise<void>
310
+ onStopped: () => Promise<void>
311
+ onStopping: () => Promise<void>
312
+ replContext: () => Record<string, unknown>
313
+ }
314
+
315
+ const Client = ApiClient<Partial<Record<`GET ${string}` | `POST ${string}` | `PUT ${string}` | `PATCH ${string}` | `DELETE ${string}`, RouteShape>>>
316
+
292
317
  ## ./Socket `(./src/Socket.ts)`
293
318
 
294
319
  class Channel = {
@@ -364,4 +389,4 @@ interface SocketOptions = {
364
389
  url?: string
365
390
  }
366
391
 
367
- type SocketState = 'error' | 'connecting' | 'connected' | 'disconnected' | 'reconnecting'
392
+ type SocketState = 'connecting' | 'connected' | 'disconnected' | 'reconnecting' | 'error'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zerotal/client",
3
- "version": "1.7.2",
3
+ "version": "1.7.4",
4
4
  "license": "MIT",
5
5
  "maturity": "stable",
6
6
  "private": false,
@@ -35,7 +35,7 @@
35
35
  "typecheck": "tsc --noEmit"
36
36
  },
37
37
  "dependencies": {
38
- "@zerotal/core": "1.7.2"
38
+ "@zerotal/core": "1.7.4"
39
39
  },
40
40
  "devDependencies": {
41
41
  "typescript": "^5.8.0"