@beignet/next 0.0.26 → 0.0.28
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 +25 -0
- package/README.md +351 -203
- package/dist/index.d.ts +91 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +128 -21
- package/dist/index.js.map +1 -1
- package/package.json +2 -2
- package/skills/routes-server/SKILL.md +9 -10
- package/src/index.ts +800 -200
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beignet/next",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.28",
|
|
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.28",
|
|
63
63
|
"@standard-schema/spec": "^1.0.0"
|
|
64
64
|
},
|
|
65
65
|
"devDependencies": {
|
|
@@ -64,6 +64,7 @@ registry. If a route is missing from OpenAPI or clients, check this file first.
|
|
|
64
64
|
`server/index.ts` owns runtime composition:
|
|
65
65
|
|
|
66
66
|
- `createNextServer(...)`
|
|
67
|
+
- `createNextServerLoader(...)`
|
|
67
68
|
- app ports
|
|
68
69
|
- providers
|
|
69
70
|
- hooks
|
|
@@ -79,19 +80,17 @@ feature route files.
|
|
|
79
80
|
Application API routes usually use one catch-all file:
|
|
80
81
|
|
|
81
82
|
```ts
|
|
82
|
-
import {
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
export const GET =
|
|
86
|
-
|
|
87
|
-
export const OPTIONS = server.api;
|
|
88
|
-
export const PATCH = server.api;
|
|
89
|
-
export const POST = server.api;
|
|
90
|
-
export const PUT = server.api;
|
|
83
|
+
import { createApiRoute } from "@beignet/next";
|
|
84
|
+
import { getServer } from "@/server";
|
|
85
|
+
|
|
86
|
+
export const { DELETE, GET, HEAD, OPTIONS, PATCH, POST, PUT } =
|
|
87
|
+
createApiRoute(getServer);
|
|
91
88
|
```
|
|
92
89
|
|
|
93
90
|
The catch-all file is adapter glue. Contracts should still use explicit paths
|
|
94
|
-
such as `/projects/:id`, not catch-all contract patterns.
|
|
91
|
+
such as `/projects/:id`, not catch-all contract patterns. Keep provider
|
|
92
|
+
startup behind `getServer` so Next production builds can import route modules
|
|
93
|
+
without booting the app runtime.
|
|
95
94
|
|
|
96
95
|
## Focused Routes
|
|
97
96
|
|