@stonecrop/stonecrop 0.4.36 → 0.4.37
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/dist/composable.js +2 -3
- package/dist/exceptions.js +5 -11
- package/dist/src/composable.d.ts.map +1 -1
- package/dist/src/exceptions.d.ts +2 -3
- package/dist/src/exceptions.d.ts.map +1 -1
- package/dist/src/stonecrop.d.ts.map +1 -1
- package/dist/stonecrop.js +601 -608
- package/dist/stonecrop.js.map +1 -1
- package/dist/stonecrop.umd.cjs +7 -7
- package/dist/stonecrop.umd.cjs.map +1 -1
- package/package.json +16 -15
- package/src/composable.ts +2 -4
- package/src/exceptions.ts +5 -12
- package/src/stonecrop.ts +4 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stonecrop/stonecrop",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.37",
|
|
4
4
|
"description": "schema helper",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"src/*"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"immutable": "^5.1.
|
|
38
|
+
"immutable": "^5.1.4",
|
|
39
39
|
"pinia-shared-state": "^1.0.1",
|
|
40
40
|
"pinia-xstate": "^3.0.0",
|
|
41
41
|
"pinia": "^3.0.3",
|
|
@@ -44,23 +44,24 @@
|
|
|
44
44
|
"xstate": "^5.20.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@typescript-eslint/parser": "^7.18.0",
|
|
47
|
+
"@eslint/js": "^9.38.0",
|
|
48
|
+
"@microsoft/api-documenter": "^7.27.3",
|
|
49
|
+
"@rushstack/heft": "^1.1.3",
|
|
51
50
|
"@vitejs/plugin-vue": "^6.0.1",
|
|
52
|
-
"@vitest/coverage-istanbul": "^
|
|
51
|
+
"@vitest/coverage-istanbul": "^4.0.5",
|
|
53
52
|
"@vue/test-utils": "^2.4.6",
|
|
54
|
-
"eslint": "^
|
|
55
|
-
"eslint-config-prettier": "^
|
|
56
|
-
"eslint-plugin-vue": "^
|
|
57
|
-
"
|
|
53
|
+
"eslint": "^9.38.0",
|
|
54
|
+
"eslint-config-prettier": "^10.1.8",
|
|
55
|
+
"eslint-plugin-vue": "^10.5.1",
|
|
56
|
+
"globals": "^16.4.0",
|
|
57
|
+
"jsdom": "^27.1.0",
|
|
58
58
|
"typescript": "^5.9.3",
|
|
59
|
+
"typescript-eslint": "^8.46.2",
|
|
59
60
|
"vite": "^7.1.1",
|
|
60
|
-
"vitest": "^
|
|
61
|
-
"@stonecrop/
|
|
61
|
+
"vitest": "^4.0.5",
|
|
62
|
+
"@stonecrop/atable": "0.4.37",
|
|
62
63
|
"stonecrop-rig": "0.2.22",
|
|
63
|
-
"@stonecrop/
|
|
64
|
+
"@stonecrop/aform": "0.4.37"
|
|
64
65
|
},
|
|
65
66
|
"publishConfig": {
|
|
66
67
|
"access": "public"
|
|
@@ -73,7 +74,7 @@
|
|
|
73
74
|
"prepublish": "heft build && vite build && rushx docs",
|
|
74
75
|
"build": "heft build && vite build && rushx docs",
|
|
75
76
|
"docs": "cd ../common/autoinstallers/doc-tools && node generate-docs.mjs stonecrop",
|
|
76
|
-
"lint": "eslint .
|
|
77
|
+
"lint": "eslint .",
|
|
77
78
|
"preview": "vite preview",
|
|
78
79
|
"test": "vitest run --coverage.enabled false",
|
|
79
80
|
"test:watch": "vitest watch",
|
package/src/composable.ts
CHANGED
|
@@ -32,16 +32,14 @@ export function useStonecrop(registry?: Registry): StonecropReturn {
|
|
|
32
32
|
let store: ReturnType<typeof useDataStore>
|
|
33
33
|
try {
|
|
34
34
|
store = useDataStore()
|
|
35
|
-
} catch
|
|
35
|
+
} catch {
|
|
36
36
|
throw new Error('Please enable the Stonecrop plugin before using the Stonecrop composable')
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
stonecrop.value = new Stonecrop(registry, store)
|
|
40
40
|
const route = registry.router.currentRoute.value
|
|
41
41
|
const doctypeSlug = route.params.records?.toString().toLowerCase()
|
|
42
|
-
const recordId = route.params.record?.toString().toLowerCase()
|
|
43
|
-
|
|
44
|
-
// TODO: handle views other than list and form views?
|
|
42
|
+
const recordId = route.params.record?.toString().toLowerCase() // TODO: handle views other than list and form views?
|
|
45
43
|
if (!doctypeSlug && !recordId) {
|
|
46
44
|
return
|
|
47
45
|
}
|
package/src/exceptions.ts
CHANGED
|
@@ -8,16 +8,9 @@
|
|
|
8
8
|
* @see {@link https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Error|Error}
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
11
|
-
export
|
|
12
|
-
|
|
11
|
+
export class NotImplementedError extends Error {
|
|
12
|
+
constructor(message: string = '') {
|
|
13
|
+
super(message)
|
|
14
|
+
this.name = 'NotImplemented'
|
|
15
|
+
}
|
|
13
16
|
}
|
|
14
|
-
|
|
15
|
-
NotImplementedError.prototype = Object.create(Error.prototype, {
|
|
16
|
-
constructor: { value: NotImplementedError },
|
|
17
|
-
name: { value: 'NotImplemented' },
|
|
18
|
-
stack: {
|
|
19
|
-
get: function () {
|
|
20
|
-
return new Error().stack
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
})
|
package/src/stonecrop.ts
CHANGED
|
@@ -185,8 +185,12 @@ export class Stonecrop {
|
|
|
185
185
|
// TODO: should this happen with or without the workflow?
|
|
186
186
|
if (actions && actions.length > 0) {
|
|
187
187
|
actions.forEach(action => {
|
|
188
|
+
// TODO: Replace Function constructor with a safer action execution mechanism
|
|
189
|
+
// This is currently flagged as a security risk (implied eval)
|
|
190
|
+
// Consider using a registry of pre-defined action functions instead
|
|
188
191
|
// eslint-disable-next-line @typescript-eslint/no-implied-eval
|
|
189
192
|
const actionFn = new Function(action)
|
|
193
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-call
|
|
190
194
|
actionFn(id)
|
|
191
195
|
})
|
|
192
196
|
}
|