@meith/plugin-reference 0.21.1 → 0.22.0
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 +2 -2
- package/src/plugin.tsx +9 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@meith/plugin-reference",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.22.0",
|
|
4
4
|
"description": "The reference plugin: a handler for every hook Meith fires, as documentation that runs.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
"access": "public"
|
|
21
21
|
},
|
|
22
22
|
"dependencies": {
|
|
23
|
-
"@meith/plugin-kit": "^0.
|
|
23
|
+
"@meith/plugin-kit": "^0.22.0"
|
|
24
24
|
},
|
|
25
25
|
"peerDependencies": {
|
|
26
26
|
"react": "^19.2.0"
|
package/src/plugin.tsx
CHANGED
|
@@ -9,15 +9,17 @@ import en from './messages/en.json'
|
|
|
9
9
|
|
|
10
10
|
export const RECORDED: {
|
|
11
11
|
hooks: { name: string; value: unknown }[]
|
|
12
|
+
hookRuntimes: { hook: string; settings: readonly string[] }[]
|
|
12
13
|
regions: PluginRegion[]
|
|
13
14
|
lifecycle: string[]
|
|
14
15
|
tasks: string[]
|
|
15
16
|
routes: { path: string; method: string }[]
|
|
16
17
|
pages: string[]
|
|
17
|
-
} = { hooks: [], regions: [], lifecycle: [], tasks: [], routes: [], pages: [] }
|
|
18
|
+
} = { hooks: [], hookRuntimes: [], regions: [], lifecycle: [], tasks: [], routes: [], pages: [] }
|
|
18
19
|
|
|
19
20
|
export function resetRecorder(): void {
|
|
20
21
|
RECORDED.hooks = []
|
|
22
|
+
RECORDED.hookRuntimes = []
|
|
21
23
|
RECORDED.regions = []
|
|
22
24
|
RECORDED.lifecycle = []
|
|
23
25
|
RECORDED.tasks = []
|
|
@@ -49,7 +51,7 @@ export const referencePlugin = definePlugin({
|
|
|
49
51
|
key: 'reference',
|
|
50
52
|
name: en['reference.definition.name'],
|
|
51
53
|
nameKey: 'reference.definition.name',
|
|
52
|
-
version: '0.
|
|
54
|
+
version: '0.22.0',
|
|
53
55
|
description: en['reference.definition.description'],
|
|
54
56
|
descriptionKey: 'reference.definition.description',
|
|
55
57
|
apiVersion: '0',
|
|
@@ -404,8 +406,12 @@ export const referencePlugin = definePlugin({
|
|
|
404
406
|
'thread.created': (value) => {
|
|
405
407
|
record('thread.created', value)
|
|
406
408
|
},
|
|
407
|
-
'post.created': (value) => {
|
|
409
|
+
'post.created': async (value, _context, runtime) => {
|
|
408
410
|
record('post.created', value)
|
|
411
|
+
RECORDED.hookRuntimes.push({
|
|
412
|
+
hook: 'post.created',
|
|
413
|
+
settings: Object.keys((await runtime()).settings).sort(),
|
|
414
|
+
})
|
|
409
415
|
},
|
|
410
416
|
'post.edited': (value) => {
|
|
411
417
|
record('post.edited', value)
|