@setzkasten-cms/core 0.4.2 → 0.4.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/README.md +51 -0
- package/package.json +19 -1
package/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# @setzkasten-cms/core
|
|
2
|
+
|
|
3
|
+
> Schema-Engine, Feldtypen und Validierung für Setzkasten CMS.
|
|
4
|
+
|
|
5
|
+
Dieses Package ist das Herzstück von [Setzkasten](https://github.com/thosor87/setzkasten) — einem git-basierten CMS für Astro.
|
|
6
|
+
|
|
7
|
+
## Features
|
|
8
|
+
|
|
9
|
+
- **Schema-First** — `defineConfig`, `defineSection`, `defineCollection` für typsichere Content-Strukturen
|
|
10
|
+
- **10 Feldtypen** — `text`, `number`, `boolean`, `select`, `image`, `icon`, `array`, `object`, `color`, `override`
|
|
11
|
+
- **Inline Formatting** — Jedes Text-Feld wird per Toggle oder `f.text({ formatting: true })` zum Rich-Text-Editor
|
|
12
|
+
- **Zod-Validierung** — Automatische Validierung basierend auf dem Schema
|
|
13
|
+
- **Ports & Adapters** — Interfaces für `ContentRepository`, `AuthProvider`, `AssetStore`
|
|
14
|
+
|
|
15
|
+
## Installation
|
|
16
|
+
|
|
17
|
+
```bash
|
|
18
|
+
npm install @setzkasten-cms/core
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
In den meisten Fällen reicht es, `@setzkasten-cms/astro` zu installieren — dieses Package wird automatisch mitinstalliert.
|
|
22
|
+
|
|
23
|
+
## Verwendung
|
|
24
|
+
|
|
25
|
+
```typescript
|
|
26
|
+
import { defineConfig, defineSection, f } from '@setzkasten-cms/core'
|
|
27
|
+
|
|
28
|
+
export default defineConfig({
|
|
29
|
+
products: {
|
|
30
|
+
website: {
|
|
31
|
+
label: 'Website',
|
|
32
|
+
sections: {
|
|
33
|
+
hero: defineSection({
|
|
34
|
+
label: 'Hero',
|
|
35
|
+
fields: {
|
|
36
|
+
heading: f.text({ label: 'Überschrift', required: true }),
|
|
37
|
+
description: f.text({ label: 'Beschreibung', formatting: true }),
|
|
38
|
+
image: f.image({ label: 'Bild', directory: 'images/hero' }),
|
|
39
|
+
},
|
|
40
|
+
}),
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
})
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Lizenz
|
|
48
|
+
|
|
49
|
+
Setzkasten Community License — [Details](https://github.com/thosor87/setzkasten/blob/main/LICENSE)
|
|
50
|
+
|
|
51
|
+
Entwickelt von [Lilapixel](https://lilapixel.de).
|
package/package.json
CHANGED
|
@@ -1,7 +1,25 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@setzkasten-cms/core",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.3",
|
|
4
|
+
"description": "Schema-Engine, Feldtypen und Validierung für Setzkasten CMS",
|
|
4
5
|
"type": "module",
|
|
6
|
+
"license": "SEE LICENSE IN LICENSE",
|
|
7
|
+
"author": "Lilapixel <hello@lilapixel.de>",
|
|
8
|
+
"homepage": "https://github.com/thosor87/setzkasten/tree/main/packages/core#readme",
|
|
9
|
+
"repository": {
|
|
10
|
+
"type": "git",
|
|
11
|
+
"url": "https://github.com/thosor87/setzkasten.git",
|
|
12
|
+
"directory": "packages/core"
|
|
13
|
+
},
|
|
14
|
+
"bugs": "https://github.com/thosor87/setzkasten/issues",
|
|
15
|
+
"keywords": [
|
|
16
|
+
"cms",
|
|
17
|
+
"setzkasten",
|
|
18
|
+
"schema",
|
|
19
|
+
"astro",
|
|
20
|
+
"git-based",
|
|
21
|
+
"headless-cms"
|
|
22
|
+
],
|
|
5
23
|
"exports": {
|
|
6
24
|
".": {
|
|
7
25
|
"import": "./src/index.ts",
|