@beignet/next 0.0.3 → 0.0.5

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
@@ -1,5 +1,133 @@
1
1
  # @beignet/next
2
2
 
3
+ ## 0.0.5
4
+
5
+ ### Patch Changes
6
+
7
+ - @beignet/web@0.0.5
8
+
9
+ ## 0.0.4
10
+
11
+ ### Patch Changes
12
+
13
+ - 8bcb31f: Mark package READMEs with Beignet's experimental alpha status and 0.0.x stability expectations.
14
+ - d137044: Declare `@beignet/core` as a peer dependency with a lockstep version range in
15
+ every integration and provider package instead of a regular `"*"` dependency.
16
+ Installs now always resolve a single shared copy of core, so `instanceof`
17
+ checks such as `isContractError` and upload error identity keep working, and
18
+ mixed Beignet versions fail loudly at install time instead of at runtime.
19
+
20
+ If your package manager does not install peer dependencies automatically, add
21
+ `@beignet/core` to your app alongside these packages. `@beignet/nuqs` now also
22
+ declares `@beignet/react-query` as a peer dependency, and
23
+ `@beignet/provider-storage-s3` now expects you to install
24
+ `@aws-sdk/client-s3` and `@aws-sdk/s3-request-presigner` yourself, matching
25
+ how other providers treat their SDKs.
26
+
27
+ - 603478f: Align package documentation with the canonical route registry and AppContext conventions.
28
+ - ac78cdf: Make `createAuthHooks` the single route-scoped auth hook API. The factory is
29
+ now curried — `createAuthHooks<AppContext>()({ resolve })` — so added context
30
+ fields are inferred from `resolve` instead of passed as a type argument, and a
31
+ new optional `headers` schema validates the raw lowercase request header
32
+ record before `resolve` runs, giving `resolve` typed credential headers
33
+ without contract casts. On `required()` hooks a header schema failure returns
34
+ a framework-owned 401; `optional()` hooks skip auth resolution; `public()`
35
+ hooks never parse headers. `defineRouteHook` (and the `RouteHookBuilder`
36
+ types) are removed — write non-auth route hooks as plain `RouteHook` object
37
+ literals.
38
+ - 1a79090: Emit Node-compatible ESM: all relative imports in published packages now carry explicit .js extensions, fixing ERR_MODULE_NOT_FOUND when running the CLI or importing package dist files under plain Node.
39
+ - 079bf59: Clarify unsupported catch-all contract path diagnostics and document that catch-all route files belong to runtime adapters, not individual contracts.
40
+ - 303ba07: Define the public HTTP adapter contract and expose the Web Fetch adapter implementation.
41
+ - 493d23b: Make the framework own context assembly with a server context blueprint and first-class service contexts.
42
+
43
+ - `createServer(...)` (and the Next/Web adapters) replace the `createContext` option with `context`. Gate-less contexts keep the plain request-factory shorthand; contexts that declare a `gate` must use the blueprint form `{ gate: (ports) => ports.gate, request, service }`. Returning `gate` from a context factory or hook addition is now a compile error.
44
+ - The gate port gains `gate.attach(ctx)`: it attaches a live, non-enumerable `ctx.gate` getter that re-binds against the receiving object on every access, so identity changes (including auth-hook elevation) can never authorize against a stale context, and spread copies drop the gate loudly instead of silently keeping stale identity. `bind(...)` remains the low-level primitive.
45
+ - Servers expose `createRequestContext(req)` and `createServiceContext(input?)`; the optional `context.service` factory powers schedule, outbox, command, and background contexts. Provider `setup`, `start`, and `stop` receive a late-bound `createServiceContext` so infra providers no longer hand-build background contexts.
46
+ - `createTestContextFactory(...)` now attaches the gate after all `extra` and override fields merge, fixing a stale-identity bug in tests.
47
+ - CLI templates, generators, and doctor diagnostics emit and check the new context blueprint and service-context wrappers.
48
+
49
+ - eda7b59: Clarify that app-owned error details are public response data and should be
50
+ mapped explicitly rather than automatically redacted by the framework.
51
+ - ac78cdf: Add `createScheduleRoute(...)` to `@beignet/next` for triggering one registered schedule from a serverless cron route, with the same fail-closed bearer auth and JSON envelope conventions as `createOutboxDrainRoute(...)`. Unknown schedule names throw when the route module loads.
52
+
53
+ The inline schedule runner in `@beignet/core/schedules` now accepts `instrumentation` and `instrumentationContext` options and records `schedule` devtools events (`started`, `completed`, `failed`) itself. Recording failures are isolated from schedule execution and reported to `onHookError`. `createScheduleRoute(...)`, `beignet schedule run`, and generated cron routes use this instead of hand-rolled lifecycle hooks.
54
+
55
+ Security: cron route bearer secrets in `createScheduleRoute(...)` and `createOutboxDrainRoute(...)` are now compared with a timing-safe SHA-256 digest comparison instead of `!==`.
56
+
57
+ - 89390fe: Decouple devtools from app code with server-owned instrumentation.
58
+
59
+ - `@beignet/core/tracing` is a new dependency-free subpath with the W3C trace
60
+ primitives (`TraceContext`, `createTraceContext`, `createChildTraceContext`,
61
+ `parseTraceparent`, `createTraceparent`, `createTraceId`, `createSpanId`).
62
+ App context types now use `Partial<TraceContext>` instead of importing
63
+ `DevtoolsTraceContext` from `@beignet/devtools`.
64
+ - `createServer(...)` owns request instrumentation through a new
65
+ `instrumentation` option (`ServerInstrumentationOptions | false`). The server
66
+ resolves request IDs and trace context before user hooks and context
67
+ creation, passes them to context factories as `requestId` and `trace`,
68
+ writes `x-request-id`/`traceparent` response headers by default, and records
69
+ request/error events into the instrumentation port resolved from final ports
70
+ (`ports.instrumentation`, then `ports.devtools`). The ambient request
71
+ context (`enterActiveRequestContext` and friends) moved into
72
+ `@beignet/core/server`.
73
+ - `createUseCase(...)` instruments runs by default, resolving the
74
+ instrumentation port from `ctx.ports` per run; opt out with
75
+ `instrumentation: false`. App `onRun` observers run in addition.
76
+ - `createInstrumentedAuditLog({ audit, instrumentation })` in
77
+ `@beignet/core/ports` replaces `createDevtoolsAuditLog`.
78
+ - `createServer(...)` gains `validateResponses` (default `true`) to skip
79
+ route-owned response validation, mirroring the client option.
80
+ - Removed from `@beignet/devtools`: `createDevtoolsHooks`,
81
+ `createDevtoolsUseCaseObserver`, `createDevtoolsAuditLog`, and the
82
+ trace/request-context modules. Apps now only need `createDevtoolsProvider()`
83
+ plus the devtools route; deleting both leaves the rest of the app compiling
84
+ and running unchanged.
85
+ - `@beignet/next` cron and upload helpers resolve their instrumentation sink
86
+ with `resolveProviderInstrumentationPort(ctx.ports)` instead of hardcoding
87
+ `ports.devtools`.
88
+ - `beignet create` templates generate the decoupled shape.
89
+
90
+ - 16cc113: Clarify the canonical route registration story and align generated starters on `app-context.ts`.
91
+ - be85ab2: Document Next.js App Router server component, hydration, client component, and route handler patterns.
92
+ - ac78cdf: Split the client `validate` config flag into `validateInput` (default false)
93
+ and `validateResponses` (default true). Client-side input validation failures
94
+ now throw a client-source `ContractError` with code `INPUT_VALIDATION_ERROR`
95
+ and no HTTP status instead of a synthetic 422 `VALIDATION_ERROR`. Setting
96
+ `validateResponses: false` returns success bodies as-is and classifies non-2xx
97
+ responses structurally while keeping `INVALID_JSON` transport errors.
98
+ - cca08b1: Align generated apps and package docs around the canonical auth, policy, and AppContext model.
99
+ - d6ad8bb: Standardize generated client helpers around `client/index.ts`, add a typed
100
+ React Query invalidation helper, and align package docs with the canonical app
101
+ client entrypoint.
102
+ - a67c637: Add Beignet runtime boundary markers and extend `beignet lint` to catch client-safe roots that value-reach server-only code.
103
+ - 7b0f708: Add first-class outbox instrumentation and devtools visibility for delivered, retried, and dead-lettered messages.
104
+ - 493d23b: Add typed provider-contributed ports. `InferProviderPorts` (replacing
105
+ `ProvidedPortsOfList`) merges the ports a provider list contributes so apps can
106
+ type `ctx.ports` as `AppPorts & InferProviderPorts<typeof providers>` without
107
+ casts. The curried `definePorts<AppPorts>()({ bound, deferred })` form replaces
108
+ throwing stub boilerplate: deferred keys boot as descriptive placeholders and
109
+ `createServer(...)` fails startup with the unbound key list (configurable via
110
+ `onUnboundPorts: "error" | "warn" | "ignore"`). App-local providers can declare
111
+ required ports, app context, and service-context input through the curried
112
+ `createProvider<Requires, Context, ServiceInput>()` form, which types
113
+ `setup({ ports, createServiceContext })` and lifecycle contexts end to end.
114
+ CLI templates and `beignet make` generate and maintain the new forms.
115
+ - 8063d38: Rename the contract front door to `defineContract`/`defineContractGroup`, rename operational commands to tasks (`@beignet/core/tasks`, `defineTasks`, `runTask`, `beignet task run`, `beignet make task`, `server/tasks.ts`, `features/<feature>/tasks/`, `paths.tasks`), and standardize context binding: context-free declarations stay top-level (`defineEvent`), while context-bound definitions come from per-capability factories (`createListeners`, `createJobs`, `createSchedules`, `createNotifications`, `createTasks`) called once in `lib/`. Top-level context-generic `defineListener`, `defineJob`, `defineSchedule`, and `defineNotification` are removed.
116
+ - 192c6ad: Routes can bind a contract directly to a use case with `{ contract, useCase }` — status is inferred from a sole 2xx response, input defaults to merged path/query/body parts, and validated inputs are not re-parsed when the use case reuses the contract schema by reference. Full `handle` routes remain the escape hatch for headers, streaming, and multi-status responses.
117
+ - Updated dependencies [8bcb31f]
118
+ - Updated dependencies [d137044]
119
+ - Updated dependencies [ac78cdf]
120
+ - Updated dependencies [1a79090]
121
+ - Updated dependencies [82c48dc]
122
+ - Updated dependencies [303ba07]
123
+ - Updated dependencies [493d23b]
124
+ - Updated dependencies [89390fe]
125
+ - Updated dependencies [e9c3209]
126
+ - Updated dependencies [493d23b]
127
+ - Updated dependencies [192c6ad]
128
+ - Updated dependencies [255527d]
129
+ - @beignet/web@0.0.4
130
+
3
131
  ## 0.0.3
4
132
 
5
133
  ### Patch Changes