@metaobjectsdev/sdk 0.12.0 → 0.12.1
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.
|
@@ -15,6 +15,27 @@ concept (`meta.commerce.json`, `meta.users.yaml`, …). Each file declares a
|
|
|
15
15
|
`package` on its root node. Files in the same `package` with the same object
|
|
16
16
|
`name` are merged by the loader.
|
|
17
17
|
|
|
18
|
+
## Find the construct first — model it, don't hand-write it
|
|
19
|
+
|
|
20
|
+
You do **not** know the full vocabulary from memory, and it is larger and more
|
|
21
|
+
powerful than the basics below. Before authoring anything non-trivial, and the
|
|
22
|
+
moment you reach for hand-written data logic, **search the live metamodel**:
|
|
23
|
+
|
|
24
|
+
```
|
|
25
|
+
meta types relationship # find by name
|
|
26
|
+
meta types --all aggregate # find by WHAT IT DOES (searches descriptions)
|
|
27
|
+
meta types origin.aggregate --detail # one construct: description, when to use it, valid @attrs
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
**The rule:** before you hand-write any data logic — a join, a foreign key, a
|
|
31
|
+
derived/aggregate value (count/sum/avg), a uniqueness / format / range / cross-field
|
|
32
|
+
rule, a relationship between entities, a derived read model — run `meta types` and
|
|
33
|
+
check for a construct that **declares** it. If one exists, declare it instead. That
|
|
34
|
+
is the entire point of MetaObjects: declared metadata is generated, typed, and
|
|
35
|
+
regenerates on change; hand-written logic drifts and is the thing this tool exists
|
|
36
|
+
to eliminate. When you catch yourself writing a query, a validator, or an FK by
|
|
37
|
+
hand, stop and search the types first.
|
|
38
|
+
|
|
18
39
|
Two on-disk formats, one shape:
|
|
19
40
|
|
|
20
41
|
- **Canonical JSON** — the on-disk interchange. Every node is a single-key map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metaobjectsdev/sdk",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.1",
|
|
4
4
|
"description": "Workspace helpers and agent-docs utilities for MetaObjects projects.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -56,7 +56,7 @@
|
|
|
56
56
|
"access": "public"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
|
-
"@metaobjectsdev/metadata": "0.12.
|
|
59
|
+
"@metaobjectsdev/metadata": "0.12.1",
|
|
60
60
|
"zod": "^3.23.0"
|
|
61
61
|
},
|
|
62
62
|
"devDependencies": {
|