Initial commit

This commit is contained in:
2026-02-10 01:25:57 +01:00
commit 7020a6a339
53 changed files with 1503 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
{
"name": "@cms/content",
"version": "0.0.1",
"private": true,
"type": "module",
"exports": {
".": "./src/index.ts"
},
"scripts": {
"build": "tsc -p tsconfig.json",
"lint": "biome check src",
"typecheck": "tsc -p tsconfig.json --noEmit"
},
"dependencies": {
"zod": "latest"
},
"devDependencies": {
"@cms/config": "workspace:*",
"@biomejs/biome": "latest",
"typescript": "latest"
}
}

View File

@@ -0,0 +1,23 @@
import { z } from "zod"
export const postStatusSchema = z.enum(["draft", "published"])
export const postSchema = z.object({
id: z.string().uuid(),
title: z.string().min(3).max(180),
slug: z.string().min(3).max(180),
excerpt: z.string().max(320).optional(),
body: z.string().min(1),
status: postStatusSchema,
createdAt: z.date(),
updatedAt: z.date(),
})
export const upsertPostSchema = postSchema.omit({
id: true,
createdAt: true,
updatedAt: true,
})
export type Post = z.infer<typeof postSchema>
export type UpsertPostInput = z.infer<typeof upsertPostSchema>

View File

@@ -0,0 +1,8 @@
{
"extends": "@cms/config/tsconfig/base",
"compilerOptions": {
"noEmit": false,
"outDir": "dist"
},
"include": ["src/**/*.ts"]
}