@abraca/schema 2.4.0 → 2.6.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/README.md +30 -0
- package/dist/index.d.ts +3 -3
- package/package.json +2 -2
package/README.md
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# @abraca/schema
|
|
2
|
+
|
|
3
|
+
The canonical page-type schema spec for Abracadabra. One Zod declaration per doc-type generates TypeScript, a JSON-Schema bundle, Rust, Swift, and Markdown — so every language validates the same shapes. **Zero runtime dependencies.**
|
|
4
|
+
|
|
5
|
+
## Documentation
|
|
6
|
+
|
|
7
|
+
Full, code-derived documentation lives in [`docs/`](docs/) — the registry model, the
|
|
8
|
+
universal meta object, all 16 page types, the query DSL, CRDT markers, the plugin
|
|
9
|
+
manifest validator, and the codegen pipeline. It is the source of truth (more
|
|
10
|
+
authoritative than any prose page-type guide).
|
|
11
|
+
|
|
12
|
+
## At a glance
|
|
13
|
+
|
|
14
|
+
```ts
|
|
15
|
+
import { defineSchema, Kanban, Doc } from "@abraca/schema";
|
|
16
|
+
const schema = defineSchema({ types: [Kanban, Doc] });
|
|
17
|
+
schema.validateMeta("kanban", meta); // {ok:true} for unknown types (Rule 4)
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
- **16 page types** — doc, prose, kanban, gallery, table, outline, checklist, graph, timeline, calendar, map, dashboard, chart, sheets, slides, overview.
|
|
21
|
+
- **Additive / opt-in** — no aggregate schema; compose the subset you need; unknown types are never rejected, known types are closed (`additionalProperties:false`).
|
|
22
|
+
- **`query.ts`** is the wire contract the Rust server's query engine mirrors.
|
|
23
|
+
|
|
24
|
+
::
|
|
25
|
+
|
|
26
|
+
> The generated **JSON-Schema bundle** (`registry/v1.json`) is the real cross-language contract — consumed by the Rust `SchemaValidationExtension` and MCP tool schemas. Never hand-edit `src/generated/**`; run `pnpm schema:gen` (CI verifies). `yjs`/`zod` are peer deps.
|
|
27
|
+
|
|
28
|
+
## License
|
|
29
|
+
|
|
30
|
+
MIT.
|
package/dist/index.d.ts
CHANGED
|
@@ -945,8 +945,8 @@ declare const GalleryMeta: z.ZodObject<{
|
|
|
945
945
|
gallerySortBy: z.ZodOptional<z.ZodEnum<{
|
|
946
946
|
date: "date";
|
|
947
947
|
rating: "rating";
|
|
948
|
-
manual: "manual";
|
|
949
948
|
name: "name";
|
|
949
|
+
manual: "manual";
|
|
950
950
|
}>>;
|
|
951
951
|
}, z.core.$strict>;
|
|
952
952
|
declare const Gallery: DocType<"gallery", z.ZodObject<{
|
|
@@ -994,8 +994,8 @@ declare const Gallery: DocType<"gallery", z.ZodObject<{
|
|
|
994
994
|
gallerySortBy: z.ZodOptional<z.ZodEnum<{
|
|
995
995
|
date: "date";
|
|
996
996
|
rating: "rating";
|
|
997
|
-
manual: "manual";
|
|
998
997
|
name: "name";
|
|
998
|
+
manual: "manual";
|
|
999
999
|
}>>;
|
|
1000
1000
|
}, z.core.$strict>, undefined>;
|
|
1001
1001
|
declare const gallerySchema: SchemaRegistry<{
|
|
@@ -1031,7 +1031,7 @@ declare const gallerySchema: SchemaRegistry<{
|
|
|
1031
1031
|
galleryAspect?: "square" | "4:3" | "3:2" | "16:9" | "free" | undefined;
|
|
1032
1032
|
galleryCardStyle?: "default" | "compact" | "detailed" | undefined;
|
|
1033
1033
|
galleryShowLabels?: boolean | undefined;
|
|
1034
|
-
gallerySortBy?: "date" | "rating" | "
|
|
1034
|
+
gallerySortBy?: "date" | "rating" | "name" | "manual" | undefined;
|
|
1035
1035
|
};
|
|
1036
1036
|
}>;
|
|
1037
1037
|
//#endregion
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abraca/schema",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "One declaration of doc-types — generates TypeScript, JSON Schema, Rust, MCP tool, and Markdown reference output.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"devDependencies": {
|
|
32
32
|
"yjs": "^13.6.8",
|
|
33
33
|
"zod": "^4.3.6",
|
|
34
|
-
"@abraca/plugin": "2.
|
|
34
|
+
"@abraca/plugin": "2.6.0"
|
|
35
35
|
},
|
|
36
36
|
"scripts": {
|
|
37
37
|
"test": "node --no-warnings --conditions=source --experimental-transform-types --test 'tests/*.test.ts'",
|