@graview/studio 0.1.4 → 0.1.5

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.
@@ -0,0 +1,34 @@
1
+ /** What a field of a document carries that the studio keeps and will not change, in the order a person reads it. */
2
+ export function keptBy(field) {
3
+ if (!field)
4
+ return [];
5
+ return [
6
+ ...(field.format ? [{ property: "format", said: `shown as ${field.format}` }] : []),
7
+ ...(field.unit ? [{ property: "unit", said: `counted in ${field.unit}` }] : []),
8
+ ...(field.of ? [{ property: "of", said: `a list of ${field.of}s` }] : []),
9
+ ];
10
+ }
11
+ const CODE = { format: "studio-keeps-format", unit: "studio-keeps-unit", of: "studio-keeps-item-type" };
12
+ /**
13
+ * ONE FINDING PER FIELD PROPERTY the studio keeps but will not change, at
14
+ * the field's path (`kinds.vendor.fields.quote`), as a note: nothing is
15
+ * wrong, and the change belongs in the document itself.
16
+ */
17
+ export function uneditable(document) {
18
+ const found = [];
19
+ for (const [kind, spec] of Object.entries(document.kinds)) {
20
+ for (const [name, field] of Object.entries(spec.fields)) {
21
+ for (const kept of keptBy(field)) {
22
+ found.push({
23
+ severity: "note",
24
+ code: CODE[kept.property],
25
+ path: `kinds.${kind}.fields.${name}`,
26
+ message: `${kind}'s ${name} is ${kept.said}; the studio keeps that as it is and will not change it, nor retype the field`,
27
+ fix: "change it in the document itself",
28
+ });
29
+ }
30
+ }
31
+ }
32
+ return found;
33
+ }
34
+ //# sourceMappingURL=uneditable.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uneditable.js","sourceRoot":"","sources":["../src/uneditable.ts"],"names":[],"mappings":"AAsBA,oHAAoH;AACpH,MAAM,UAAU,MAAM,CAAC,KAA6B;IAClD,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO;QACL,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,QAAiB,EAAE,IAAI,EAAE,YAA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AC;YACL,CAAC;QACH,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@graview/studio",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "description": "The declaration itself as a graph: kinds, fields, edges, acts, rules, roles and grants as nodes, edited with ordinary mutations in Graview's own interface, checked before they are applied, migrated, and written back as the files graview create writes.",
6
6
  "keywords": [
@@ -22,13 +22,13 @@
22
22
  },
23
23
  "dependencies": {
24
24
  "zod": "^4.6.5",
25
- "@graview/core": "0.1.4",
26
- "@graview/layout": "0.1.4",
27
- "@graview/pages": "0.1.4",
28
- "@graview/primitives": "0.1.4",
29
- "@graview/react": "0.1.4",
30
- "@graview/ship": "0.1.4",
31
- "@graview/tools": "0.1.4"
25
+ "@graview/core": "0.1.5",
26
+ "@graview/pages": "0.1.5",
27
+ "@graview/layout": "0.1.5",
28
+ "@graview/react": "0.1.5",
29
+ "@graview/primitives": "0.1.5",
30
+ "@graview/ship": "0.1.5",
31
+ "@graview/tools": "0.1.5"
32
32
  },
33
33
  "peerDependencies": {
34
34
  "react": ">=18",