@kood/claude-code 0.2.2 → 0.2.3
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/dist/index.js
CHANGED
|
@@ -404,7 +404,7 @@ var init = async (options) => {
|
|
|
404
404
|
|
|
405
405
|
// src/index.ts
|
|
406
406
|
var program = new Command();
|
|
407
|
-
program.name("claude-code").description("Claude Code documentation installer for projects").version("0.2.
|
|
407
|
+
program.name("claude-code").description("Claude Code documentation installer for projects").version("0.2.3");
|
|
408
408
|
program.option(
|
|
409
409
|
"-t, --template <names>",
|
|
410
410
|
"template names (comma-separated: tanstack-start,hono)"
|
package/package.json
CHANGED
|
@@ -79,6 +79,7 @@ export default {
|
|
|
79
79
|
import { createServerFn } from '@tanstack/react-start'
|
|
80
80
|
import { drizzle } from 'drizzle-orm/d1'
|
|
81
81
|
import { eq } from 'drizzle-orm'
|
|
82
|
+
import { z } from 'zod'
|
|
82
83
|
import * as schema from '@/db/schema'
|
|
83
84
|
|
|
84
85
|
// D1 바인딩 접근 (Cloudflare Pages/Workers)
|
|
@@ -94,7 +95,7 @@ export const getUsers = createServerFn({ method: 'GET' })
|
|
|
94
95
|
})
|
|
95
96
|
|
|
96
97
|
export const createUser = createServerFn({ method: 'POST' })
|
|
97
|
-
.
|
|
98
|
+
.inputValidator(z.object({ email: z.email(), name: z.string().optional() }))
|
|
98
99
|
.handler(async ({ data }) => {
|
|
99
100
|
const db = getDb()
|
|
100
101
|
const [user] = await db.insert(schema.users).values(data).returning()
|
|
@@ -64,6 +64,7 @@ import { createServerFn } from '@tanstack/react-start'
|
|
|
64
64
|
import { db } from '@/lib/db'
|
|
65
65
|
import { users } from '@/db/schema'
|
|
66
66
|
import { eq } from 'drizzle-orm'
|
|
67
|
+
import { z } from 'zod'
|
|
67
68
|
|
|
68
69
|
export const getUsers = createServerFn({ method: 'GET' })
|
|
69
70
|
.handler(async () => {
|
|
@@ -71,14 +72,14 @@ export const getUsers = createServerFn({ method: 'GET' })
|
|
|
71
72
|
})
|
|
72
73
|
|
|
73
74
|
export const getUserById = createServerFn({ method: 'GET' })
|
|
74
|
-
.
|
|
75
|
+
.inputValidator(z.coerce.number())
|
|
75
76
|
.handler(async ({ data: id }) => {
|
|
76
77
|
const [user] = await db.select().from(users).where(eq(users.id, id))
|
|
77
78
|
return user
|
|
78
79
|
})
|
|
79
80
|
|
|
80
81
|
export const createUser = createServerFn({ method: 'POST' })
|
|
81
|
-
.
|
|
82
|
+
.inputValidator(z.object({ email: z.email(), name: z.string() }))
|
|
82
83
|
.handler(async ({ data }) => {
|
|
83
84
|
const [user] = await db.insert(users).values(data).returning()
|
|
84
85
|
return user
|
|
@@ -21,7 +21,7 @@ const createUserSchema = z.object({
|
|
|
21
21
|
})
|
|
22
22
|
|
|
23
23
|
export const createUser = createServerFn({ method: 'POST' })
|
|
24
|
-
.inputValidator(
|
|
24
|
+
.inputValidator(createUserSchema)
|
|
25
25
|
.handler(async ({ data }) => prisma.user.create({ data }))
|
|
26
26
|
```
|
|
27
27
|
|