@tooluminati/state 0.1.0 → 0.2.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/dist/annotations.test.d.ts +2 -0
- package/dist/annotations.test.d.ts.map +1 -0
- package/dist/annotations.test.js +20 -0
- package/dist/apollo.js +1 -1
- package/dist/index.cjs +3 -3
- package/dist/index.js +3 -3
- package/dist/selector-tool.js +1 -1
- package/dist/tanstack-query.js +1 -1
- package/package.json +2 -2
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"annotations.test.d.ts","sourceRoot":"","sources":["../src/annotations.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { expect, it } from 'vitest';
|
|
2
|
+
import { createStateSummaryTool } from './selector-tool';
|
|
3
|
+
import { createApolloSummaryTool } from './apollo';
|
|
4
|
+
import { createQueryCacheSummaryTool } from './tanstack-query';
|
|
5
|
+
const tools = [
|
|
6
|
+
createStateSummaryTool({
|
|
7
|
+
name: 'state',
|
|
8
|
+
description: 'Reads state.',
|
|
9
|
+
getState: () => ({}),
|
|
10
|
+
selector: (state) => state,
|
|
11
|
+
}),
|
|
12
|
+
createApolloSummaryTool({ getQueries: () => [] }),
|
|
13
|
+
createQueryCacheSummaryTool({
|
|
14
|
+
queryClient: { getQueryCache: () => ({ findAll: () => [] }) },
|
|
15
|
+
allowKeys: ['test'],
|
|
16
|
+
}),
|
|
17
|
+
];
|
|
18
|
+
it.each(tools.map((tool) => [tool.name, tool]))('%s is a read-only diagnostic', (_name, tool) => {
|
|
19
|
+
expect(tool.annotations).toEqual({ readOnlyHint: true, debugging: true });
|
|
20
|
+
});
|
package/dist/apollo.js
CHANGED
|
@@ -7,7 +7,7 @@ export function createApolloSummaryTool(options) {
|
|
|
7
7
|
properties: {},
|
|
8
8
|
additionalProperties: false,
|
|
9
9
|
},
|
|
10
|
-
annotations: { readOnlyHint: true },
|
|
10
|
+
annotations: { readOnlyHint: true, debugging: true },
|
|
11
11
|
execute: () => ({ queries: options.getQueries() }),
|
|
12
12
|
};
|
|
13
13
|
}
|
package/dist/index.cjs
CHANGED
|
@@ -39,7 +39,7 @@ function createApolloSummaryTool(options) {
|
|
|
39
39
|
properties: {},
|
|
40
40
|
additionalProperties: false
|
|
41
41
|
},
|
|
42
|
-
annotations: { readOnlyHint: true },
|
|
42
|
+
annotations: { readOnlyHint: true, debugging: true },
|
|
43
43
|
execute: () => ({ queries: options.getQueries() })
|
|
44
44
|
};
|
|
45
45
|
}
|
|
@@ -60,7 +60,7 @@ function createStateSummaryTool({
|
|
|
60
60
|
properties: {},
|
|
61
61
|
additionalProperties: false
|
|
62
62
|
},
|
|
63
|
-
annotations: { readOnlyHint: true },
|
|
63
|
+
annotations: { readOnlyHint: true, debugging: true },
|
|
64
64
|
execute: () => {
|
|
65
65
|
const summary = selector(getState());
|
|
66
66
|
return redact ? redact(summary) : summary;
|
|
@@ -138,7 +138,7 @@ function createQueryCacheSummaryTool({
|
|
|
138
138
|
properties: {},
|
|
139
139
|
additionalProperties: false
|
|
140
140
|
},
|
|
141
|
-
annotations: { readOnlyHint: true },
|
|
141
|
+
annotations: { readOnlyHint: true, debugging: true },
|
|
142
142
|
execute: () => {
|
|
143
143
|
if (!allowKeys?.length) {
|
|
144
144
|
throw new Error(
|
package/dist/index.js
CHANGED
|
@@ -8,7 +8,7 @@ function createApolloSummaryTool(options) {
|
|
|
8
8
|
properties: {},
|
|
9
9
|
additionalProperties: false
|
|
10
10
|
},
|
|
11
|
-
annotations: { readOnlyHint: true },
|
|
11
|
+
annotations: { readOnlyHint: true, debugging: true },
|
|
12
12
|
execute: () => ({ queries: options.getQueries() })
|
|
13
13
|
};
|
|
14
14
|
}
|
|
@@ -29,7 +29,7 @@ function createStateSummaryTool({
|
|
|
29
29
|
properties: {},
|
|
30
30
|
additionalProperties: false
|
|
31
31
|
},
|
|
32
|
-
annotations: { readOnlyHint: true },
|
|
32
|
+
annotations: { readOnlyHint: true, debugging: true },
|
|
33
33
|
execute: () => {
|
|
34
34
|
const summary = selector(getState());
|
|
35
35
|
return redact ? redact(summary) : summary;
|
|
@@ -107,7 +107,7 @@ function createQueryCacheSummaryTool({
|
|
|
107
107
|
properties: {},
|
|
108
108
|
additionalProperties: false
|
|
109
109
|
},
|
|
110
|
-
annotations: { readOnlyHint: true },
|
|
110
|
+
annotations: { readOnlyHint: true, debugging: true },
|
|
111
111
|
execute: () => {
|
|
112
112
|
if (!allowKeys?.length) {
|
|
113
113
|
throw new Error(
|
package/dist/selector-tool.js
CHANGED
|
@@ -7,7 +7,7 @@ export function createStateSummaryTool({ name, description, getState, selector,
|
|
|
7
7
|
properties: {},
|
|
8
8
|
additionalProperties: false,
|
|
9
9
|
},
|
|
10
|
-
annotations: { readOnlyHint: true },
|
|
10
|
+
annotations: { readOnlyHint: true, debugging: true },
|
|
11
11
|
execute: () => {
|
|
12
12
|
const summary = selector(getState());
|
|
13
13
|
return redact ? redact(summary) : summary;
|
package/dist/tanstack-query.js
CHANGED
|
@@ -24,7 +24,7 @@ export function createQueryCacheSummaryTool({ queryClient, allowKeys, includeDat
|
|
|
24
24
|
properties: {},
|
|
25
25
|
additionalProperties: false,
|
|
26
26
|
},
|
|
27
|
-
annotations: { readOnlyHint: true },
|
|
27
|
+
annotations: { readOnlyHint: true, debugging: true },
|
|
28
28
|
execute: () => {
|
|
29
29
|
if (!allowKeys?.length) {
|
|
30
30
|
throw new Error('allowKeys is required for query cache summary tool. ' +
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tooluminati/state",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "Safe state and data-cache summaries for Tooluminati.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
}
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@tooluminati/core": "0.
|
|
18
|
+
"@tooluminati/core": "0.2.0"
|
|
19
19
|
},
|
|
20
20
|
"files": [
|
|
21
21
|
"dist"
|