@stonecrop/stonecrop 0.12.3 → 0.12.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@stonecrop/stonecrop",
3
- "version": "0.12.3",
3
+ "version": "0.12.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "author": {
@@ -34,7 +34,7 @@
34
34
  "pinia-shared-state": "^1.0.1",
35
35
  "pinia-xstate": "^3.0.0",
36
36
  "xstate": "^5.25.0",
37
- "@stonecrop/schema": "0.12.3"
37
+ "@stonecrop/schema": "0.12.5"
38
38
  },
39
39
  "peerDependencies": {
40
40
  "pinia": "^3.0.4",
@@ -60,8 +60,8 @@
60
60
  "vue-router": "^5.0.6",
61
61
  "vite": "^7.3.2",
62
62
  "vitest": "^4.1.5",
63
- "@stonecrop/aform": "0.12.3",
64
- "@stonecrop/atable": "0.12.3",
63
+ "@stonecrop/atable": "0.12.5",
64
+ "@stonecrop/aform": "0.12.5",
65
65
  "stonecrop-rig": "0.7.0"
66
66
  },
67
67
  "description": "Schema-driven framework with XState workflows and HST state management",
package/src/registry.ts CHANGED
@@ -163,11 +163,28 @@ export default class Registry {
163
163
  if (!link) {
164
164
  const doctype =
165
165
  typeof (field as FieldMeta).options === 'string' ? ((field as FieldMeta).options as string) : undefined
166
+
167
+ if (doctype === undefined) {
168
+ // eslint-disable-next-line no-console
169
+ console.warn(
170
+ `[Stonecrop] Link field "${field.fieldname}" has no \`options\` or corresponding \`links\` declaration. ` +
171
+ `AFormLink will be created without a \`doctype\` prop, so navigation will not work. ` +
172
+ `Add \`"options": "<doctype-slug>"\` to the field definition.`
173
+ )
174
+ }
175
+
176
+ // Strip any raw `doctype` from the JSON; only `options` is the authoritative source.
177
+ const { doctype: _rawDoctype, ...fieldRest } = field as typeof field & {
178
+ doctype?: unknown
179
+ component?: string
180
+ }
181
+
166
182
  resolvedFields.push({
167
- ...field,
168
- component: 'AFormLink',
183
+ ...fieldRest,
184
+ component: fieldRest.component || 'AFormLink',
169
185
  ...(doctype !== undefined ? { doctype } : {}),
170
186
  })
187
+
171
188
  continue
172
189
  }
173
190