@stonecrop/stonecrop 0.3.3 → 0.3.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.3.3",
3
+ "version": "0.3.5",
4
4
  "description": "schema helper",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -52,9 +52,9 @@
52
52
  "eslint-plugin-vue": "^9.11.1",
53
53
  "typescript": "^5.6.3",
54
54
  "vite": "^5.4.5",
55
- "@stonecrop/aform": "0.3.3",
55
+ "@stonecrop/aform": "0.3.5",
56
56
  "stonecrop-rig": "0.2.22",
57
- "@stonecrop/atable": "0.3.3"
57
+ "@stonecrop/atable": "0.3.5"
58
58
  },
59
59
  "publishConfig": {
60
60
  "access": "public"
package/src/composable.ts CHANGED
@@ -14,7 +14,13 @@ export function useStonecrop(registry?: Registry): StonecropReturn {
14
14
  registry = inject<Registry>('$registry')
15
15
  }
16
16
 
17
- const store = useDataStore()
17
+ let store: ReturnType<typeof useDataStore>
18
+ try {
19
+ store = useDataStore()
20
+ } catch (e) {
21
+ throw new Error('Please enable the Stonecrop plugin before using the Stonecrop composable')
22
+ }
23
+
18
24
  const stonecrop = ref(new Stonecrop(registry, store))
19
25
  const isReady = ref(false)
20
26