@beignet/next 0.0.24 → 0.0.26
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 +14 -0
- package/README.md +2 -1
- package/package.json +2 -2
- package/skills/routes-server/SKILL.md +21 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @beignet/next
|
|
2
2
|
|
|
3
|
+
## 0.0.26
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 104302c: Refresh package-shipped TanStack Intent skills and add package skills for Drizzle database providers, Better Auth, React Hook Form, and React uploads.
|
|
8
|
+
- @beignet/web@0.0.26
|
|
9
|
+
|
|
10
|
+
## 0.0.25
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- 7c83da7: Refresh package-shipped TanStack Intent skills to match current Beignet app structure, generators, route helpers, and React Query cache helpers.
|
|
15
|
+
- @beignet/web@0.0.25
|
|
16
|
+
|
|
3
17
|
## 0.0.24
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -37,7 +37,8 @@ This package requires TypeScript 5.0 or higher for proper type inference.
|
|
|
37
37
|
This package ships a TanStack Intent skill for coding agents:
|
|
38
38
|
`@beignet/next#routes-server`. Load it when wiring route groups, central route
|
|
39
39
|
registration, `createNextServer`, server context, OpenAPI/devtools routes,
|
|
40
|
-
Next catch-all API adapters, uploads, webhooks,
|
|
40
|
+
Next catch-all API adapters, uploads, storage routes, webhooks, schedule cron
|
|
41
|
+
routes, or outbox drain routes.
|
|
41
42
|
|
|
42
43
|
## Quick start
|
|
43
44
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beignet/next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.26",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Next.js server-side handlers for Beignet",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -59,7 +59,7 @@
|
|
|
59
59
|
"next": "^14.0.0 || ^15.0.0 || ^16.0.0"
|
|
60
60
|
},
|
|
61
61
|
"dependencies": {
|
|
62
|
-
"@beignet/web": "^0.0.
|
|
62
|
+
"@beignet/web": "^0.0.26",
|
|
63
63
|
"@standard-schema/spec": "^1.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
---
|
|
2
2
|
name: routes-server
|
|
3
|
-
description: "Build Beignet Next.js server integration with @beignet/next: defineRouteGroup, defineRoutes, contractsFromRoutes, createNextServer, server context, hooks, OpenAPI
|
|
3
|
+
description: "Build Beignet Next.js server integration with @beignet/next: defineRouteGroup, defineRoutes, contractsFromRoutes, createNextServer, createNextClient, server context, hooks, OpenAPI and Swagger UI handlers, devtools routes, catch-all API adapters, uploads, storage routes, generic webhooks, payment webhooks, schedule cron routes, outbox drains, and route inspection. Use when wiring or debugging Beignet routes in a Next app."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
6
|
# Beignet Next Routes And Server
|
|
@@ -102,7 +102,8 @@ HTTP surfaces:
|
|
|
102
102
|
- devtools
|
|
103
103
|
- uploads
|
|
104
104
|
- storage object routes
|
|
105
|
-
- payment or webhook adapters
|
|
105
|
+
- payment or generic webhook adapters
|
|
106
|
+
- schedule cron routes
|
|
106
107
|
- outbox drains
|
|
107
108
|
- redirects or downloads
|
|
108
109
|
|
|
@@ -110,18 +111,35 @@ Use a route `handle` escape hatch only when the route intentionally returns a
|
|
|
110
111
|
native `Response`, streams, owns custom headers, or otherwise sits outside the
|
|
111
112
|
normal use-case binder.
|
|
112
113
|
|
|
114
|
+
Prefer adapter helpers for focused surfaces when the package provides them:
|
|
115
|
+
`createOpenAPIHandler(...)`, `createSwaggerUIHandler(...)`,
|
|
116
|
+
`createUploadRoute(...)`, `createStorageRoute(...)`,
|
|
117
|
+
`createWebhookRoute(...)`, `createPaymentWebhookRoute(...)`,
|
|
118
|
+
`createScheduleRoute(...)`, and `createOutboxDrainRoute(...)`.
|
|
119
|
+
|
|
113
120
|
## Context
|
|
114
121
|
|
|
115
122
|
`server/context.ts` should use `defineServerContext`. Request context reads the
|
|
116
123
|
session, creates an actor, attaches ports, request IDs, and trace context.
|
|
117
124
|
Service context is for schedules, tasks, outbox drains, and background work;
|
|
118
|
-
create a service actor and do not assume a request session.
|
|
125
|
+
create a service actor and do not assume a request session. Focused helpers
|
|
126
|
+
such as `createOutboxDrainRoute(...)`, `createScheduleRoute(...)`, and webhook
|
|
127
|
+
routes build context through the server; keep their fulfillment behavior in
|
|
128
|
+
use cases or app service functions.
|
|
129
|
+
|
|
130
|
+
## Next Client
|
|
131
|
+
|
|
132
|
+
Shared browser client setup usually lives in root `client/`. Use
|
|
133
|
+
`createClient(...)` from `@beignet/core/client` when same-origin relative
|
|
134
|
+
requests are enough. Use `createNextClient(...)` from `@beignet/next` when
|
|
135
|
+
server-side calls need Next-friendly absolute URL defaults.
|
|
119
136
|
|
|
120
137
|
## Debugging
|
|
121
138
|
|
|
122
139
|
- Route group exists but does not run: register it in `server/routes.ts`.
|
|
123
140
|
- Contract missing from OpenAPI: export `contracts = contractsFromRoutes(routes)`.
|
|
124
141
|
- `doctor` dislikes the route shape: use `defineRouteGroup<AppContext>()({ ... })`.
|
|
142
|
+
- Cron route fails closed: verify `CRON_SECRET` and the route's bearer token.
|
|
125
143
|
- Client code imports `server/`: move shared DTOs to schemas and call through
|
|
126
144
|
contracts and the typed client.
|
|
127
145
|
|