@outfitter/presets 0.2.1 → 0.3.0
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/presets/_base/AGENTS.md.template +3 -0
- package/presets/_base/CLAUDE.md.template +35 -0
- package/presets/_examples/cli-todo/src/program.ts.template +202 -0
- package/presets/_examples/mcp-files/src/mcp.ts.template +181 -0
- package/presets/basic/README.md.template +22 -0
- package/presets/basic/package.json.template +41 -37
- package/presets/basic/src/index.test.ts.template +26 -0
- package/presets/basic/src/index.ts.template +32 -15
- package/presets/basic/tsconfig.json.template +28 -29
- package/presets/cli/CLAUDE.md.template +60 -0
- package/presets/cli/README.md.template +5 -1
- package/presets/cli/package.json.template +47 -44
- package/presets/cli/src/commands/hello.ts.template +26 -0
- package/presets/cli/src/index.test.ts.template +38 -0
- package/presets/cli/src/index.ts.template +2 -0
- package/presets/cli/src/program.ts.template +17 -19
- package/presets/cli/src/types.ts.template +13 -0
- package/presets/cli/tsconfig.json.template +29 -29
- package/presets/daemon/CLAUDE.md.template +53 -0
- package/presets/daemon/README.md.template +6 -7
- package/presets/daemon/package.json.template +50 -47
- package/presets/daemon/src/cli.ts.template +73 -66
- package/presets/daemon/src/daemon-main.ts.template +56 -55
- package/presets/daemon/src/daemon.ts.template +7 -3
- package/presets/daemon/src/index.test.ts.template +9 -0
- package/presets/daemon/tsconfig.json.template +21 -21
- package/presets/full-stack/CLAUDE.md.template +66 -0
- package/presets/full-stack/apps/cli/package.json.template +34 -33
- package/presets/full-stack/apps/cli/src/cli.ts.template +16 -15
- package/presets/full-stack/apps/cli/src/index.test.ts.template +12 -11
- package/presets/full-stack/apps/cli/tsconfig.json.template +32 -32
- package/presets/full-stack/apps/mcp/package.json.template +35 -34
- package/presets/full-stack/apps/mcp/src/index.test.ts.template +12 -11
- package/presets/full-stack/apps/mcp/src/mcp.ts.template +10 -10
- package/presets/full-stack/apps/mcp/src/server.ts.template +3 -2
- package/presets/full-stack/apps/mcp/tsconfig.json.template +32 -32
- package/presets/full-stack/package.json.template +20 -14
- package/presets/full-stack/packages/core/package.json.template +31 -30
- package/presets/full-stack/packages/core/src/handlers.ts.template +29 -24
- package/presets/full-stack/packages/core/src/index.test.ts.template +23 -21
- package/presets/full-stack/packages/core/src/types.ts.template +11 -8
- package/presets/full-stack/packages/core/tsconfig.json.template +29 -29
- package/presets/library/CLAUDE.md.template +68 -0
- package/presets/library/bunup.config.ts.template +16 -16
- package/presets/library/package.json.template +51 -50
- package/presets/library/src/handlers.ts.template +51 -27
- package/presets/library/src/index.test.ts.template +40 -29
- package/presets/library/src/types.ts.template +14 -8
- package/presets/library/tsconfig.json.template +29 -29
- package/presets/mcp/CLAUDE.md.template +97 -0
- package/presets/mcp/README.md.template +12 -9
- package/presets/mcp/package.json.template +48 -44
- package/presets/mcp/src/index.test.ts.template +49 -0
- package/presets/mcp/src/index.ts.template +2 -0
- package/presets/mcp/src/mcp.ts.template +16 -16
- package/presets/mcp/src/server.ts.template +8 -1
- package/presets/mcp/src/tools/hello.ts.template +48 -0
- package/presets/mcp/tsconfig.json.template +21 -21
- package/presets/minimal/README.md.template +22 -0
- package/presets/minimal/package.json.template +47 -44
- package/presets/minimal/src/index.test.ts.template +19 -0
- package/presets/minimal/src/index.ts.template +10 -15
- package/presets/minimal/tsconfig.json.template +28 -29
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"lib": ["ESNext"],
|
|
8
|
+
"types": ["@types/bun"],
|
|
9
|
+
"baseUrl": ".",
|
|
10
|
+
"paths": {
|
|
11
|
+
"{{packageName}}-core": ["../../packages/core/src/index.ts"]
|
|
12
|
+
},
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
"strict": true,
|
|
15
|
+
"noImplicitAny": true,
|
|
16
|
+
"strictNullChecks": true,
|
|
17
|
+
"noUncheckedIndexedAccess": true,
|
|
18
|
+
"exactOptionalPropertyTypes": true,
|
|
19
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
20
|
+
"noImplicitReturns": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
"declaration": true,
|
|
24
|
+
"declarationMap": true,
|
|
25
|
+
"sourceMap": true,
|
|
26
|
+
"outDir": "./dist",
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
"esModuleInterop": true,
|
|
29
|
+
"forceConsistentCasingInFileNames": true,
|
|
30
|
+
"isolatedModules": true,
|
|
31
|
+
"verbatimModuleSyntax": true,
|
|
32
|
+
"skipLibCheck": true,
|
|
33
|
+
"resolveJsonModule": true
|
|
34
|
+
},
|
|
35
|
+
"include": ["src/**/*"],
|
|
36
|
+
"exclude": ["node_modules", "dist"]
|
|
37
37
|
}
|
|
@@ -1,36 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
2
|
+
"name": "{{packageName}}-mcp",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"description": "MCP surface for {{projectName}}",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"{{projectName}}-mcp": "./dist/server.js"
|
|
8
|
+
},
|
|
9
|
+
"type": "module",
|
|
10
|
+
"main": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"exports": {
|
|
13
|
+
".": {
|
|
14
|
+
"types": "./dist/index.d.ts",
|
|
15
|
+
"import": "./dist/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "bun build src/server.ts --outdir dist --target bun && bun build src/index.ts --outdir dist --target bun --sourcemap",
|
|
20
|
+
"dev": "bun --watch src/server.ts",
|
|
21
|
+
"test": "bun test",
|
|
22
|
+
"test:watch": "bun test --watch",
|
|
23
|
+
"typecheck": "tsc --noEmit",
|
|
24
|
+
"lint": "oxlint .",
|
|
25
|
+
"lint:fix": "oxlint --fix .",
|
|
26
|
+
"format": "oxfmt --write .",
|
|
27
|
+
"check": "ultracite check",
|
|
28
|
+
"clean:artifacts": "rm -rf dist .turbo"
|
|
29
|
+
},
|
|
30
|
+
"dependencies": {
|
|
31
|
+
"@outfitter/contracts": "workspace:*",
|
|
32
|
+
"@outfitter/mcp": "workspace:*",
|
|
33
|
+
"zod": "catalog:",
|
|
34
|
+
"{{packageName}}-core": "workspace:*"
|
|
35
|
+
},
|
|
36
|
+
"devDependencies": {}
|
|
36
37
|
}
|
|
@@ -1,18 +1,19 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
+
|
|
2
3
|
import { createContext } from "@outfitter/contracts";
|
|
3
4
|
import { createGreeting } from "{{packageName}}-core";
|
|
4
5
|
|
|
5
6
|
describe("mcp surface", () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
test("can use shared core handler", async () => {
|
|
8
|
+
const result = await createGreeting(
|
|
9
|
+
{ name: "MCP" },
|
|
10
|
+
createContext({ cwd: process.cwd(), env: process.env })
|
|
11
|
+
);
|
|
11
12
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
13
|
+
expect(result.isOk()).toBe(true);
|
|
14
|
+
if (result.isErr()) {
|
|
15
|
+
return;
|
|
16
|
+
}
|
|
17
|
+
expect(result.value.message).toBe("Hello, MCP.");
|
|
18
|
+
});
|
|
18
19
|
});
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { createGreeting } from "{{packageName}}-core";
|
|
2
1
|
import { createMcpServer, defineTool } from "@outfitter/mcp";
|
|
3
2
|
import { z } from "zod";
|
|
3
|
+
import { createGreeting } from "{{packageName}}-core";
|
|
4
4
|
|
|
5
5
|
const server = createMcpServer({
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
name: "{{projectName}}-mcp",
|
|
7
|
+
version: "{{version}}",
|
|
8
8
|
});
|
|
9
9
|
|
|
10
10
|
const greetTool = defineTool({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
11
|
+
name: "greet",
|
|
12
|
+
description: "Generate greeting via shared core handler",
|
|
13
|
+
inputSchema: z.object({
|
|
14
|
+
name: z.string().default("World").describe("Name to greet"),
|
|
15
|
+
excited: z.boolean().default(false),
|
|
16
|
+
}),
|
|
17
|
+
handler: async (input, ctx) => createGreeting(input, ctx),
|
|
18
18
|
});
|
|
19
19
|
|
|
20
20
|
server.registerTool(greetTool);
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { connectStdio } from "@outfitter/mcp";
|
|
2
|
+
|
|
2
3
|
import { server } from "./mcp.js";
|
|
3
4
|
|
|
4
5
|
export async function startServer(): Promise<void> {
|
|
5
|
-
|
|
6
|
+
await connectStdio(server);
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
if (import.meta.main) {
|
|
9
|
-
|
|
10
|
+
await startServer();
|
|
10
11
|
}
|
|
@@ -1,37 +1,37 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"lib": ["ESNext"],
|
|
8
|
+
"types": ["@types/bun"],
|
|
9
|
+
"baseUrl": ".",
|
|
10
|
+
"paths": {
|
|
11
|
+
"{{packageName}}-core": ["../../packages/core/src/index.ts"]
|
|
12
|
+
},
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
14
|
+
"strict": true,
|
|
15
|
+
"noImplicitAny": true,
|
|
16
|
+
"strictNullChecks": true,
|
|
17
|
+
"noUncheckedIndexedAccess": true,
|
|
18
|
+
"exactOptionalPropertyTypes": true,
|
|
19
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
20
|
+
"noImplicitReturns": true,
|
|
21
|
+
"noFallthroughCasesInSwitch": true,
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
"declaration": true,
|
|
24
|
+
"declarationMap": true,
|
|
25
|
+
"sourceMap": true,
|
|
26
|
+
"outDir": "./dist",
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
28
|
+
"esModuleInterop": true,
|
|
29
|
+
"forceConsistentCasingInFileNames": true,
|
|
30
|
+
"isolatedModules": true,
|
|
31
|
+
"verbatimModuleSyntax": true,
|
|
32
|
+
"skipLibCheck": true,
|
|
33
|
+
"resolveJsonModule": true
|
|
34
|
+
},
|
|
35
|
+
"include": ["src/**/*"],
|
|
36
|
+
"exclude": ["node_modules", "dist"]
|
|
37
37
|
}
|
|
@@ -1,16 +1,22 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
2
|
+
"name": "{{packageName}}",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"private": true,
|
|
5
|
+
"workspaces": [
|
|
6
|
+
"apps/*",
|
|
7
|
+
"packages/*"
|
|
8
|
+
],
|
|
9
|
+
"type": "module",
|
|
10
|
+
"scripts": {
|
|
11
|
+
"build": "bun run --filter '*' build",
|
|
12
|
+
"dev": "bun run --filter '*' dev",
|
|
13
|
+
"test": "bun run --filter '*' test",
|
|
14
|
+
"typecheck": "bun run --filter '*' typecheck",
|
|
15
|
+
"lint": "bun run --filter '*' lint",
|
|
16
|
+
"lint:fix": "bun run --filter '*' lint:fix",
|
|
17
|
+
"format": "bun run --filter '*' format",
|
|
18
|
+
"check": "bun run --filter '*' check",
|
|
19
|
+
"clean": "bun run --filter '*' clean:artifacts",
|
|
20
|
+
"verify:ci": "bun run clean && bun run typecheck && bun run check && bun run build && bun run test"
|
|
21
|
+
}
|
|
16
22
|
}
|
|
@@ -1,32 +1,33 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
2
|
+
"name": "{{packageName}}-core",
|
|
3
|
+
"version": "{{version}}",
|
|
4
|
+
"description": "Shared handlers for {{projectName}}",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"main": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"scripts": {
|
|
16
|
+
"build": "bun build src/index.ts --outdir dist --format=esm && tsc --emitDeclarationOnly --outDir dist",
|
|
17
|
+
"dev": "bun --watch src/index.ts",
|
|
18
|
+
"test": "bun test",
|
|
19
|
+
"test:watch": "bun test --watch",
|
|
20
|
+
"typecheck": "tsc --noEmit",
|
|
21
|
+
"lint": "oxlint .",
|
|
22
|
+
"lint:fix": "oxlint --fix .",
|
|
23
|
+
"format": "oxfmt --write .",
|
|
24
|
+
"check": "ultracite check",
|
|
25
|
+
"clean:artifacts": "rm -rf dist .turbo"
|
|
26
|
+
},
|
|
27
|
+
"dependencies": {
|
|
28
|
+
"@outfitter/contracts": "workspace:*",
|
|
29
|
+
"@outfitter/logging": "workspace:*",
|
|
30
|
+
"zod": "catalog:"
|
|
31
|
+
},
|
|
32
|
+
"devDependencies": {}
|
|
32
33
|
}
|
|
@@ -1,31 +1,36 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
Result,
|
|
3
|
+
ValidationError,
|
|
4
|
+
type HandlerContext,
|
|
5
|
+
} from "@outfitter/contracts";
|
|
2
6
|
import { createLogger } from "@outfitter/logging";
|
|
7
|
+
|
|
3
8
|
import { greetingInputSchema, type Greeting } from "./types.js";
|
|
4
9
|
|
|
5
10
|
const logger = createLogger({ name: "{{projectName}}-core" });
|
|
6
11
|
|
|
7
|
-
export
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
)
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
export async function createGreeting(
|
|
13
|
+
input: unknown,
|
|
14
|
+
ctx: HandlerContext
|
|
15
|
+
): Promise<Result<Greeting, ValidationError>> {
|
|
16
|
+
const parsed = greetingInputSchema.safeParse(input);
|
|
17
|
+
if (!parsed.success) {
|
|
18
|
+
return Result.err(
|
|
19
|
+
new ValidationError({
|
|
20
|
+
message: "Invalid greeting input",
|
|
21
|
+
field: "name",
|
|
22
|
+
})
|
|
23
|
+
);
|
|
24
|
+
}
|
|
20
25
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
+
const suffix = parsed.data.excited ? "!" : ".";
|
|
27
|
+
const greeting: Greeting = {
|
|
28
|
+
message: `Hello, ${parsed.data.name}${suffix}`,
|
|
29
|
+
issuedAt: new Date().toISOString(),
|
|
30
|
+
};
|
|
26
31
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
}
|
|
32
|
+
logger.info(`Created greeting for ${parsed.data.name}`, {
|
|
33
|
+
requestId: ctx.requestId,
|
|
34
|
+
});
|
|
35
|
+
return Result.ok(greeting);
|
|
36
|
+
}
|
|
@@ -1,30 +1,32 @@
|
|
|
1
1
|
import { describe, expect, test } from "bun:test";
|
|
2
|
+
|
|
2
3
|
import { createContext } from "@outfitter/contracts";
|
|
4
|
+
|
|
3
5
|
import { createGreeting } from "./handlers.js";
|
|
4
6
|
|
|
5
7
|
describe("createGreeting", () => {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
8
|
+
test("returns greeting for valid input", async () => {
|
|
9
|
+
const result = await createGreeting(
|
|
10
|
+
{ name: "Outfitter", excited: true },
|
|
11
|
+
createContext({ cwd: process.cwd(), env: process.env })
|
|
12
|
+
);
|
|
11
13
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
14
|
+
expect(result.isOk()).toBe(true);
|
|
15
|
+
if (result.isErr()) {
|
|
16
|
+
return;
|
|
17
|
+
}
|
|
18
|
+
expect(result.value.message).toBe("Hello, Outfitter!");
|
|
19
|
+
});
|
|
18
20
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
test("returns validation error for invalid input", async () => {
|
|
22
|
+
const result = await createGreeting(
|
|
23
|
+
{ name: "" },
|
|
24
|
+
createContext({ cwd: process.cwd(), env: process.env })
|
|
25
|
+
);
|
|
24
26
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
expect(result.isErr()).toBe(true);
|
|
28
|
+
if (result.isErr()) {
|
|
29
|
+
expect(result.error.name).toBe("ValidationError");
|
|
30
|
+
}
|
|
31
|
+
});
|
|
30
32
|
});
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import { z } from "zod";
|
|
1
|
+
import { type ZodType, z } from "zod";
|
|
2
2
|
|
|
3
|
-
export
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
}
|
|
3
|
+
export interface GreetingInput {
|
|
4
|
+
readonly name: string;
|
|
5
|
+
readonly excited: boolean;
|
|
6
|
+
}
|
|
7
7
|
|
|
8
|
-
export
|
|
8
|
+
export const greetingInputSchema: ZodType<GreetingInput> = z.object({
|
|
9
|
+
name: z.string().min(1, "name is required"),
|
|
10
|
+
excited: z.boolean().default(false),
|
|
11
|
+
});
|
|
9
12
|
|
|
10
13
|
export interface Greeting {
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
readonly message: string;
|
|
15
|
+
readonly issuedAt: string;
|
|
13
16
|
}
|
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
{
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
2
|
+
"$schema": "https://json.schemastore.org/tsconfig",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"target": "ESNext",
|
|
5
|
+
"module": "ESNext",
|
|
6
|
+
"moduleResolution": "bundler",
|
|
7
|
+
"lib": ["ESNext"],
|
|
8
|
+
"types": ["@types/bun"],
|
|
9
9
|
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
10
|
+
"strict": true,
|
|
11
|
+
"noImplicitAny": true,
|
|
12
|
+
"strictNullChecks": true,
|
|
13
|
+
"noUncheckedIndexedAccess": true,
|
|
14
|
+
"exactOptionalPropertyTypes": true,
|
|
15
|
+
"noPropertyAccessFromIndexSignature": true,
|
|
16
|
+
"noImplicitReturns": true,
|
|
17
|
+
"noFallthroughCasesInSwitch": true,
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
"declaration": true,
|
|
20
|
+
"declarationMap": true,
|
|
21
|
+
"sourceMap": true,
|
|
22
|
+
"outDir": "./dist",
|
|
23
|
+
"rootDir": "./src",
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
25
|
+
"esModuleInterop": true,
|
|
26
|
+
"forceConsistentCasingInFileNames": true,
|
|
27
|
+
"isolatedModules": true,
|
|
28
|
+
"verbatimModuleSyntax": true,
|
|
29
|
+
"skipLibCheck": true,
|
|
30
|
+
"resolveJsonModule": true
|
|
31
|
+
},
|
|
32
|
+
"include": ["src/**/*"],
|
|
33
|
+
"exclude": ["node_modules", "dist"]
|
|
34
34
|
}
|