create-daloy 0.3.0 → 0.4.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/package.json +2 -2
- package/templates/bun-basic/package.json +1 -1
- package/templates/bun-basic/src/index.ts +12 -6
- package/templates/cloudflare-worker/package.json +1 -1
- package/templates/deno-basic/deno.json +2 -2
- package/templates/deno-basic/src/main.ts +10 -6
- package/templates/node-basic/AGENTS.md +1 -1
- package/templates/node-basic/package.json +2 -2
- package/templates/node-basic/src/index.ts +12 -6
- package/templates/vercel-edge/package.json +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-daloy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.1",
|
|
4
4
|
"description": "Scaffold a new DaloyJS project. Run with `pnpm create daloy`, `npm create daloy@latest`, `yarn create daloy`, or `bun create daloy`.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
"openapi"
|
|
28
28
|
],
|
|
29
29
|
"engines": {
|
|
30
|
-
"node": ">=
|
|
30
|
+
"node": ">=24.15.0"
|
|
31
31
|
},
|
|
32
32
|
"bin": {
|
|
33
33
|
"create-daloy": "bin/create-daloy.mjs"
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { serve } from "@daloyjs/core/bun";
|
|
2
|
+
import { printStartupBanner, type StartupBannerLink } from "@daloyjs/core/banner";
|
|
2
3
|
import { buildApp } from "./build-app.ts";
|
|
3
4
|
|
|
4
5
|
const app = buildApp();
|
|
@@ -9,11 +10,16 @@ const handle = serve(app, {
|
|
|
9
10
|
// Bun closes idle keep-alive connections after this many seconds.
|
|
10
11
|
idleTimeout: 30,
|
|
11
12
|
});
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
|
|
14
|
+
const url = handle.url ? String(handle.url) : `http://localhost:${port}`;
|
|
15
|
+
const links: StartupBannerLink[] = [
|
|
16
|
+
// daloy-minimal:strip-start docs
|
|
17
|
+
{ label: "Swagger UI", url: `${url}/docs` },
|
|
18
|
+
{ label: "OpenAPI JSON", url: `${url}/openapi.json` },
|
|
19
|
+
// daloy-minimal:strip-end docs
|
|
20
|
+
{ label: "Health", url: `${url}/healthz` },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
printStartupBanner({ name: "DaloyJS API", url, runtime: "Bun", links });
|
|
18
24
|
|
|
19
25
|
export default app;
|
|
@@ -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.9.1",
|
|
12
|
+
"@daloyjs/core/": "npm:@daloyjs/core@^0.9.1/",
|
|
13
13
|
"zod": "npm:zod@^4.4.3"
|
|
14
14
|
},
|
|
15
15
|
"compilerOptions": {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { serve } from "@daloyjs/core/deno";
|
|
2
|
+
import { printStartupBanner, type StartupBannerLink } from "@daloyjs/core/banner";
|
|
2
3
|
import { buildApp } from "./build-app.ts";
|
|
3
4
|
|
|
4
5
|
const app = buildApp();
|
|
@@ -7,11 +8,14 @@ const port = Number(Deno.env.get("PORT") ?? 3000);
|
|
|
7
8
|
serve(app, {
|
|
8
9
|
port,
|
|
9
10
|
onListen: ({ hostname, port: actualPort }) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
const url = `http://${hostname}:${actualPort}`;
|
|
12
|
+
const links: StartupBannerLink[] = [
|
|
13
|
+
// daloy-minimal:strip-start docs
|
|
14
|
+
{ label: "Swagger UI", url: `${url}/docs` },
|
|
15
|
+
{ label: "OpenAPI JSON", url: `${url}/openapi.json` },
|
|
16
|
+
// daloy-minimal:strip-end docs
|
|
17
|
+
{ label: "Health", url: `${url}/healthz` },
|
|
18
|
+
];
|
|
19
|
+
printStartupBanner({ name: "DaloyJS API", url, runtime: "Deno", links });
|
|
16
20
|
},
|
|
17
21
|
});
|
|
@@ -4,7 +4,7 @@ A [DaloyJS](https://daloyjs.dev) Node.js REST API. **Contract-first**:
|
|
|
4
4
|
routes are defined with Zod schemas and OpenAPI 3.1 is generated from them.
|
|
5
5
|
|
|
6
6
|
- Package manager: pnpm (use `pnpm` unless the project's `package.json` was rewritten for npm/yarn/bun).
|
|
7
|
-
- Runtime: Node.js >=
|
|
7
|
+
- Runtime: Node.js >= 24.15 (active LTS).
|
|
8
8
|
|
|
9
9
|
## Commands
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
"private": true,
|
|
5
5
|
"type": "module",
|
|
6
6
|
"engines": {
|
|
7
|
-
"node": ">=
|
|
7
|
+
"node": ">=24.15.0"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"dev": "node --import tsx/esm --watch src/index.ts",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"audit": "pnpm audit --prod"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@daloyjs/core": "^0.
|
|
21
|
+
"@daloyjs/core": "^0.9.1",
|
|
22
22
|
"zod": "^4.4.3"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
import { serve } from "@daloyjs/core/node";
|
|
2
|
+
import { printStartupBanner, type StartupBannerLink } from "@daloyjs/core/banner";
|
|
2
3
|
import { buildApp } from "./build-app.js";
|
|
3
4
|
|
|
4
5
|
const app = buildApp();
|
|
5
6
|
const port = Number(process.env.PORT ?? 3000);
|
|
6
7
|
|
|
7
8
|
serve(app, { port });
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
|
|
10
|
+
const url = `http://localhost:${port}`;
|
|
11
|
+
const links: StartupBannerLink[] = [
|
|
12
|
+
// daloy-minimal:strip-start docs
|
|
13
|
+
{ label: "Swagger UI", url: `${url}/docs` },
|
|
14
|
+
{ label: "OpenAPI JSON", url: `${url}/openapi.json` },
|
|
15
|
+
// daloy-minimal:strip-end docs
|
|
16
|
+
{ label: "Health", url: `${url}/healthz` },
|
|
17
|
+
];
|
|
18
|
+
|
|
19
|
+
printStartupBanner({ name: "DaloyJS API", url, runtime: "Node.js", links });
|
|
14
20
|
|
|
15
21
|
export default app;
|