create-daloy 0.7.4 → 0.8.1
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 +2 -0
- package/bin/create-daloy.mjs +1 -1
- package/package.json +1 -1
- package/templates/bun-basic/README.md +5 -1
- package/templates/bun-basic/package.json +1 -1
- package/templates/cloudflare-worker/package.json +1 -1
- package/templates/deno-basic/README.md +5 -1
- package/templates/deno-basic/deno.json +2 -2
- package/templates/node-basic/README.md +3 -1
- package/templates/node-basic/package.json +1 -1
- package/templates/vercel-edge/README.md +5 -3
- package/templates/vercel-edge/package.json +1 -1
package/README.md
CHANGED
|
@@ -67,6 +67,8 @@ A production-ready Node.js HTTP server using `@daloyjs/core` with:
|
|
|
67
67
|
- `secureHeaders`, `requestId`, and `rateLimit` enabled by default (`rateLimit` is global until you configure `keyGenerator` or trusted proxy headers).
|
|
68
68
|
- A sample `GET /healthz` and contract-first `GET /books/:id` route with Zod validation.
|
|
69
69
|
- `pnpm gen` wired to emit OpenAPI 3.1 + a typed Hey API client.
|
|
70
|
+
- Auto-mounted Scalar docs can be branded by changing `docs: true` to
|
|
71
|
+
`docs: { scalar: { theme, customCss } }`.
|
|
70
72
|
|
|
71
73
|
### `cloudflare-worker`
|
|
72
74
|
|
package/bin/create-daloy.mjs
CHANGED
|
@@ -587,7 +587,7 @@ function setupPackageManagerStep(packageManager) {
|
|
|
587
587
|
return ` - name: Set up pnpm
|
|
588
588
|
uses: pnpm/action-setup@ac6db6d3c1f721f886538a378a2d73e85697340a # v6
|
|
589
589
|
with:
|
|
590
|
-
version: 11.1.
|
|
590
|
+
version: 11.1.3
|
|
591
591
|
run_install: false`;
|
|
592
592
|
}
|
|
593
593
|
if (packageManager === "yarn") {
|
package/package.json
CHANGED
|
@@ -19,12 +19,16 @@ curl http://localhost:3000/books/1
|
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- daloy-minimal:strip-start docs -->
|
|
22
|
+
|
|
22
23
|
## API documentation
|
|
23
24
|
|
|
24
25
|
- API docs (Scalar): <http://localhost:3000/docs>
|
|
25
26
|
- OpenAPI 3.1 JSON: <http://localhost:3000/openapi.json>
|
|
26
27
|
- OpenAPI 3.1 YAML: <http://localhost:3000/openapi.yaml>
|
|
27
|
-
|
|
28
|
+
|
|
29
|
+
The spec is generated live from your routes, so it stays in sync with what is actually deployed.
|
|
30
|
+
To brand Scalar, change `docs: true` in `src/build-app.ts` to `docs: { scalar: { theme, customCss } }`.
|
|
31
|
+
|
|
28
32
|
<!-- daloy-minimal:strip-end docs -->
|
|
29
33
|
|
|
30
34
|
## Generate OpenAPI + typed client
|
|
@@ -18,12 +18,16 @@ curl http://localhost:3000/books/1
|
|
|
18
18
|
```
|
|
19
19
|
|
|
20
20
|
<!-- daloy-minimal:strip-start docs -->
|
|
21
|
+
|
|
21
22
|
## API documentation
|
|
22
23
|
|
|
23
24
|
- API docs (Scalar): <http://localhost:3000/docs>
|
|
24
25
|
- OpenAPI 3.1 JSON: <http://localhost:3000/openapi.json>
|
|
25
26
|
- OpenAPI 3.1 YAML: <http://localhost:3000/openapi.yaml>
|
|
26
|
-
|
|
27
|
+
|
|
28
|
+
The spec is generated live from your routes, so it stays in sync with what is actually deployed.
|
|
29
|
+
To brand Scalar, change `docs: true` in `src/build-app.ts` to `docs: { scalar: { theme, customCss } }`.
|
|
30
|
+
|
|
27
31
|
<!-- daloy-minimal:strip-end docs -->
|
|
28
32
|
|
|
29
33
|
## Generate the OpenAPI spec
|
|
@@ -8,8 +8,8 @@
|
|
|
8
8
|
"gen:openapi": "deno run --allow-net --allow-env --allow-read --allow-write scripts/dump-openapi.ts"
|
|
9
9
|
},
|
|
10
10
|
"imports": {
|
|
11
|
-
"@daloyjs/core": "npm:@daloyjs/core@^0.
|
|
12
|
-
"@daloyjs/core/": "npm:@daloyjs/core@^0.
|
|
11
|
+
"@daloyjs/core": "npm:@daloyjs/core@^0.14.1",
|
|
12
|
+
"@daloyjs/core/": "npm:@daloyjs/core@^0.14.1/",
|
|
13
13
|
"zod": "npm:zod@^4.4.3"
|
|
14
14
|
},
|
|
15
15
|
"compilerOptions": {
|
|
@@ -19,14 +19,16 @@ curl http://localhost:3000/books/1
|
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- daloy-minimal:strip-start docs -->
|
|
22
|
+
|
|
22
23
|
## API documentation
|
|
23
24
|
|
|
24
25
|
- API docs (Scalar): <http://localhost:3000/docs>
|
|
25
26
|
- OpenAPI 3.1 JSON: <http://localhost:3000/openapi.json>
|
|
26
27
|
- OpenAPI 3.1 YAML: <http://localhost:3000/openapi.yaml>
|
|
27
|
-
- OpenAPI 3.1 YAML: <http://localhost:3000/openapi.yaml>
|
|
28
28
|
|
|
29
29
|
The spec is generated live from your routes, so it stays in sync with what is actually deployed.
|
|
30
|
+
To brand Scalar, change `docs: true` in `src/build-app.ts` to `docs: { scalar: { theme, customCss } }`.
|
|
31
|
+
|
|
30
32
|
<!-- daloy-minimal:strip-end docs -->
|
|
31
33
|
|
|
32
34
|
## Generate OpenAPI + typed client
|
|
@@ -19,14 +19,16 @@ curl http://localhost:3000/books/1
|
|
|
19
19
|
```
|
|
20
20
|
|
|
21
21
|
<!-- daloy-minimal:strip-start docs -->
|
|
22
|
+
|
|
22
23
|
## API documentation
|
|
23
24
|
|
|
24
25
|
- API docs (Scalar): <http://localhost:3000/docs>
|
|
25
26
|
- OpenAPI 3.1 JSON: <http://localhost:3000/openapi.json>
|
|
26
27
|
- OpenAPI 3.1 YAML: <http://localhost:3000/openapi.yaml>
|
|
27
|
-
- OpenAPI 3.1 YAML: <http://localhost:3000/openapi.yaml>
|
|
28
28
|
|
|
29
29
|
After deploying, the same routes serve `/docs`, `/openapi.json`, and `/openapi.yaml` from your Vercel Edge URL.
|
|
30
|
+
To brand Scalar, change `docs: true` in `api/[...path].ts` to `docs: { scalar: { theme, customCss } }`.
|
|
31
|
+
|
|
30
32
|
<!-- daloy-minimal:strip-end docs -->
|
|
31
33
|
|
|
32
34
|
## Deploy
|
|
@@ -61,7 +63,7 @@ That catch-all API route lets DaloyJS own routing while Vercel handles the runti
|
|
|
61
63
|
- Smaller edge-friendly body and timeout limits in the generated app.
|
|
62
64
|
<!-- daloy-minimal:strip-start books -->
|
|
63
65
|
- A health route and a contract-first `/books/:id` route with Zod validation.
|
|
64
|
-
<!-- daloy-minimal:strip-end books -->
|
|
65
|
-
<!-- daloy-minimal:strip-start docs -->
|
|
66
|
+
<!-- daloy-minimal:strip-end books -->
|
|
67
|
+
<!-- daloy-minimal:strip-start docs -->
|
|
66
68
|
- A Scalar API reference UI at `/docs`, plus live OpenAPI 3.1 specs at `/openapi.json` and `/openapi.yaml`.
|
|
67
69
|
<!-- daloy-minimal:strip-end docs -->
|