@tanstack/query-devtools 5.0.0-alpha.86 → 5.0.0-alpha.88

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.
Files changed (43) hide show
  1. package/build/Devtools/OYHFZDAP.jsx +6711 -0
  2. package/build/Devtools/QBS7PB6D.js +5885 -0
  3. package/build/Devtools/QPWQM7BG.js +6068 -0
  4. package/build/Devtools/RZF5MSB2.jsx +6637 -0
  5. package/build/chunk/DFC6JMPR.jsx +1280 -0
  6. package/build/chunk/LOJK4LQB.jsx +1280 -0
  7. package/{dist/esm/index-7b089165.js → build/chunk/MZOCHHZD.js} +648 -416
  8. package/{dist/cjs/index-94a2ab18.cjs → build/chunk/YHTPXJWR.js} +648 -446
  9. package/build/dev.cjs +8116 -0
  10. package/build/dev.js +99 -0
  11. package/build/dev.jsx +98 -0
  12. package/build/index.cjs +7940 -0
  13. package/build/index.d.cts +55 -0
  14. package/build/index.d.ts +55 -0
  15. package/build/index.js +99 -0
  16. package/build/index.jsx +98 -0
  17. package/package.json +27 -23
  18. package/dist/cjs/Devtools-5eee2153.cjs +0 -6764
  19. package/dist/cjs/Devtools-5eee2153.cjs.map +0 -1
  20. package/dist/cjs/index-94a2ab18.cjs.map +0 -1
  21. package/dist/cjs/index.cjs +0 -8
  22. package/dist/cjs/index.cjs.map +0 -1
  23. package/dist/esm/Devtools-74e35f67.js +0 -6756
  24. package/dist/esm/Devtools-74e35f67.js.map +0 -1
  25. package/dist/esm/index-7b089165.js.map +0 -1
  26. package/dist/esm/index.js +0 -2
  27. package/dist/esm/index.js.map +0 -1
  28. package/dist/source/Context.js +0 -10
  29. package/dist/source/Devtools.jsx +0 -1510
  30. package/dist/source/Explorer.jsx +0 -264
  31. package/dist/source/fonts.js +0 -7
  32. package/dist/source/icons/index.jsx +0 -344
  33. package/dist/source/index.jsx +0 -88
  34. package/dist/source/theme.js +0 -304
  35. package/dist/source/utils.jsx +0 -77
  36. package/dist/types/Context.d.ts +0 -28
  37. package/dist/types/Devtools.d.ts +0 -22
  38. package/dist/types/Explorer.d.ts +0 -21
  39. package/dist/types/fonts.d.ts +0 -1
  40. package/dist/types/icons/index.d.ts +0 -11
  41. package/dist/types/index.d.ts +0 -29
  42. package/dist/types/theme.d.ts +0 -296
  43. package/dist/types/utils.d.ts +0 -23
@@ -0,0 +1,55 @@
1
+ import { Query, QueryClient, onlineManager } from '@tanstack/query-core';
2
+ import { Component, Signal } from 'solid-js';
3
+
4
+ type XPosition = 'left' | 'right';
5
+ type YPosition = 'top' | 'bottom';
6
+ type DevtoolsPosition = XPosition | YPosition;
7
+ type DevtoolsButtonPosition = `${YPosition}-${XPosition}`;
8
+ interface DevToolsErrorType {
9
+ /**
10
+ * The name of the error.
11
+ */
12
+ name: string;
13
+ /**
14
+ * How the error is initialized.
15
+ */
16
+ initializer: (query: Query) => Error;
17
+ }
18
+ interface QueryDevtoolsProps {
19
+ readonly client: QueryClient;
20
+ queryFlavor: string;
21
+ version: string;
22
+ onlineManager: typeof onlineManager;
23
+ buttonPosition?: DevtoolsButtonPosition;
24
+ position?: DevtoolsPosition;
25
+ initialIsOpen?: boolean;
26
+ errorTypes?: DevToolsErrorType[];
27
+ }
28
+
29
+ declare const DevtoolsComponent: Component<QueryDevtoolsProps>;
30
+
31
+ interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
32
+ }
33
+ declare class TanstackQueryDevtools {
34
+ client: Signal<QueryClient>;
35
+ onlineManager: typeof onlineManager;
36
+ queryFlavor: string;
37
+ version: string;
38
+ isMounted: boolean;
39
+ buttonPosition: Signal<DevtoolsButtonPosition | undefined>;
40
+ position: Signal<DevtoolsPosition | undefined>;
41
+ initialIsOpen: Signal<boolean | undefined>;
42
+ errorTypes: Signal<DevToolsErrorType[] | undefined>;
43
+ Component: typeof DevtoolsComponent | undefined;
44
+ dispose?: () => void;
45
+ constructor(config: TanstackQueryDevtoolsConfig);
46
+ setButtonPosition(position: DevtoolsButtonPosition): void;
47
+ setPosition(position: DevtoolsPosition): void;
48
+ setInitialIsOpen(isOpen: boolean): void;
49
+ setErrorTypes(errorTypes: DevToolsErrorType[]): void;
50
+ setClient(client: QueryClient): void;
51
+ mount<T extends HTMLElement>(el: T): void;
52
+ unmount(): void;
53
+ }
54
+
55
+ export { DevToolsErrorType, DevtoolsButtonPosition, DevtoolsPosition, TanstackQueryDevtools, TanstackQueryDevtoolsConfig };
@@ -0,0 +1,55 @@
1
+ import { Query, QueryClient, onlineManager } from '@tanstack/query-core';
2
+ import { Component, Signal } from 'solid-js';
3
+
4
+ type XPosition = 'left' | 'right';
5
+ type YPosition = 'top' | 'bottom';
6
+ type DevtoolsPosition = XPosition | YPosition;
7
+ type DevtoolsButtonPosition = `${YPosition}-${XPosition}`;
8
+ interface DevToolsErrorType {
9
+ /**
10
+ * The name of the error.
11
+ */
12
+ name: string;
13
+ /**
14
+ * How the error is initialized.
15
+ */
16
+ initializer: (query: Query) => Error;
17
+ }
18
+ interface QueryDevtoolsProps {
19
+ readonly client: QueryClient;
20
+ queryFlavor: string;
21
+ version: string;
22
+ onlineManager: typeof onlineManager;
23
+ buttonPosition?: DevtoolsButtonPosition;
24
+ position?: DevtoolsPosition;
25
+ initialIsOpen?: boolean;
26
+ errorTypes?: DevToolsErrorType[];
27
+ }
28
+
29
+ declare const DevtoolsComponent: Component<QueryDevtoolsProps>;
30
+
31
+ interface TanstackQueryDevtoolsConfig extends QueryDevtoolsProps {
32
+ }
33
+ declare class TanstackQueryDevtools {
34
+ client: Signal<QueryClient>;
35
+ onlineManager: typeof onlineManager;
36
+ queryFlavor: string;
37
+ version: string;
38
+ isMounted: boolean;
39
+ buttonPosition: Signal<DevtoolsButtonPosition | undefined>;
40
+ position: Signal<DevtoolsPosition | undefined>;
41
+ initialIsOpen: Signal<boolean | undefined>;
42
+ errorTypes: Signal<DevToolsErrorType[] | undefined>;
43
+ Component: typeof DevtoolsComponent | undefined;
44
+ dispose?: () => void;
45
+ constructor(config: TanstackQueryDevtoolsConfig);
46
+ setButtonPosition(position: DevtoolsButtonPosition): void;
47
+ setPosition(position: DevtoolsPosition): void;
48
+ setInitialIsOpen(isOpen: boolean): void;
49
+ setErrorTypes(errorTypes: DevToolsErrorType[]): void;
50
+ setClient(client: QueryClient): void;
51
+ mount<T extends HTMLElement>(el: T): void;
52
+ unmount(): void;
53
+ }
54
+
55
+ export { DevToolsErrorType, DevtoolsButtonPosition, DevtoolsPosition, TanstackQueryDevtools, TanstackQueryDevtoolsConfig };
package/build/index.js ADDED
@@ -0,0 +1,99 @@
1
+ import { createSignal, render, lazy, createComponent, mergeProps } from './chunk/MZOCHHZD.js';
2
+
3
+ // src/index.tsx
4
+ var TanstackQueryDevtools = class {
5
+ isMounted = false;
6
+ constructor(config) {
7
+ const {
8
+ client,
9
+ queryFlavor,
10
+ version,
11
+ onlineManager,
12
+ buttonPosition,
13
+ position,
14
+ initialIsOpen,
15
+ errorTypes
16
+ } = config;
17
+ this.client = createSignal(client);
18
+ this.queryFlavor = queryFlavor;
19
+ this.version = version;
20
+ this.onlineManager = onlineManager;
21
+ this.buttonPosition = createSignal(buttonPosition);
22
+ this.position = createSignal(position);
23
+ this.initialIsOpen = createSignal(initialIsOpen);
24
+ this.errorTypes = createSignal(errorTypes);
25
+ }
26
+ setButtonPosition(position) {
27
+ this.buttonPosition[1](position);
28
+ }
29
+ setPosition(position) {
30
+ this.position[1](position);
31
+ }
32
+ setInitialIsOpen(isOpen) {
33
+ this.initialIsOpen[1](isOpen);
34
+ }
35
+ setErrorTypes(errorTypes) {
36
+ this.errorTypes[1](errorTypes);
37
+ }
38
+ setClient(client) {
39
+ this.client[1](client);
40
+ }
41
+ mount(el) {
42
+ if (this.isMounted) {
43
+ throw new Error("Devtools is already mounted");
44
+ }
45
+ const dispose = render(() => {
46
+ const [btnPosition] = this.buttonPosition;
47
+ const [pos] = this.position;
48
+ const [isOpen] = this.initialIsOpen;
49
+ const [errors] = this.errorTypes;
50
+ const [queryClient] = this.client;
51
+ let Devtools;
52
+ if (this.Component) {
53
+ Devtools = this.Component;
54
+ } else {
55
+ Devtools = lazy(() => import('./Devtools/QBS7PB6D.js'));
56
+ this.Component = Devtools;
57
+ }
58
+ const _self$ = this;
59
+ return createComponent(Devtools, mergeProps({
60
+ get queryFlavor() {
61
+ return _self$.queryFlavor;
62
+ },
63
+ get version() {
64
+ return _self$.version;
65
+ },
66
+ get onlineManager() {
67
+ return _self$.onlineManager;
68
+ }
69
+ }, {
70
+ get client() {
71
+ return queryClient();
72
+ },
73
+ get buttonPosition() {
74
+ return btnPosition();
75
+ },
76
+ get position() {
77
+ return pos();
78
+ },
79
+ get initialIsOpen() {
80
+ return isOpen();
81
+ },
82
+ get errorTypes() {
83
+ return errors();
84
+ }
85
+ }));
86
+ }, el);
87
+ this.isMounted = true;
88
+ this.dispose = dispose;
89
+ }
90
+ unmount() {
91
+ if (!this.isMounted) {
92
+ throw new Error("Devtools is not mounted");
93
+ }
94
+ this.dispose?.();
95
+ this.isMounted = false;
96
+ }
97
+ };
98
+
99
+ export { TanstackQueryDevtools };
@@ -0,0 +1,98 @@
1
+ import {
2
+ createSignal,
3
+ lazy,
4
+ render
5
+ } from "./chunk/LOJK4LQB.jsx";
6
+
7
+ // src/index.tsx
8
+ var TanstackQueryDevtools = class {
9
+ constructor(config) {
10
+ this.isMounted = false;
11
+ const {
12
+ client,
13
+ queryFlavor,
14
+ version,
15
+ onlineManager,
16
+ buttonPosition,
17
+ position,
18
+ initialIsOpen,
19
+ errorTypes
20
+ } = config;
21
+ this.client = createSignal(client);
22
+ this.queryFlavor = queryFlavor;
23
+ this.version = version;
24
+ this.onlineManager = onlineManager;
25
+ this.buttonPosition = createSignal(buttonPosition);
26
+ this.position = createSignal(position);
27
+ this.initialIsOpen = createSignal(initialIsOpen);
28
+ this.errorTypes = createSignal(errorTypes);
29
+ }
30
+ setButtonPosition(position) {
31
+ this.buttonPosition[1](position);
32
+ }
33
+ setPosition(position) {
34
+ this.position[1](position);
35
+ }
36
+ setInitialIsOpen(isOpen) {
37
+ this.initialIsOpen[1](isOpen);
38
+ }
39
+ setErrorTypes(errorTypes) {
40
+ this.errorTypes[1](errorTypes);
41
+ }
42
+ setClient(client) {
43
+ this.client[1](client);
44
+ }
45
+ mount(el) {
46
+ if (this.isMounted) {
47
+ throw new Error("Devtools is already mounted");
48
+ }
49
+ const dispose = render(() => {
50
+ const [btnPosition] = this.buttonPosition;
51
+ const [pos] = this.position;
52
+ const [isOpen] = this.initialIsOpen;
53
+ const [errors] = this.errorTypes;
54
+ const [queryClient] = this.client;
55
+ let Devtools;
56
+ if (this.Component) {
57
+ Devtools = this.Component;
58
+ } else {
59
+ Devtools = lazy(() => import("./Devtools/RZF5MSB2.jsx"));
60
+ this.Component = Devtools;
61
+ }
62
+ return <Devtools
63
+ queryFlavor={this.queryFlavor}
64
+ version={this.version}
65
+ onlineManager={this.onlineManager}
66
+ {...{
67
+ get client() {
68
+ return queryClient();
69
+ },
70
+ get buttonPosition() {
71
+ return btnPosition();
72
+ },
73
+ get position() {
74
+ return pos();
75
+ },
76
+ get initialIsOpen() {
77
+ return isOpen();
78
+ },
79
+ get errorTypes() {
80
+ return errors();
81
+ }
82
+ }}
83
+ />;
84
+ }, el);
85
+ this.isMounted = true;
86
+ this.dispose = dispose;
87
+ }
88
+ unmount() {
89
+ if (!this.isMounted) {
90
+ throw new Error("Devtools is not mounted");
91
+ }
92
+ this.dispose?.();
93
+ this.isMounted = false;
94
+ }
95
+ };
96
+ export {
97
+ TanstackQueryDevtools
98
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/query-devtools",
3
- "version": "5.0.0-alpha.86",
3
+ "version": "5.0.0-alpha.88",
4
4
  "description": "Developer tools to interact with and visualize the TanStack Query cache",
5
5
  "author": "tannerlinsley",
6
6
  "license": "MIT",
@@ -11,28 +11,33 @@
11
11
  "url": "https://github.com/sponsors/tannerlinsley"
12
12
  },
13
13
  "type": "module",
14
- "types": "dist/types/index.d.ts",
15
- "main": "dist/cjs/index.cjs",
16
- "module": "dist/esm/index.js",
14
+ "main": "./build/index.cjs",
15
+ "module": "./build/index.js",
16
+ "types": "./build/index.d.ts",
17
+ "browser": {},
17
18
  "exports": {
18
- ".": {
19
- "types": "./dist/types/index.d.ts",
20
- "solid": "./dist/source/index.jsx",
21
- "import": "./dist/esm/index.js",
22
- "browser": {
23
- "import": "./dist/esm/index.js",
24
- "require": "./dist/cjs/index.cjs"
19
+ "solid": {
20
+ "development": "./build/dev.jsx",
21
+ "import": "./build/index.jsx"
22
+ },
23
+ "development": {
24
+ "import": {
25
+ "types": "./build/index.d.ts",
26
+ "default": "./build/dev.js"
25
27
  },
26
- "require": "./dist/cjs/index.cjs",
27
- "node": "./dist/cjs/index.cjs"
28
+ "require": "./build/dev.cjs"
29
+ },
30
+ "import": {
31
+ "types": "./build/index.d.ts",
32
+ "default": "./build/index.js"
28
33
  },
29
- "./package.json": "./package.json"
34
+ "require": "./build/index.cjs"
30
35
  },
31
36
  "files": [
32
- "dist",
37
+ "build",
33
38
  "src"
34
39
  ],
35
- "dependencies": {
40
+ "devDependencies": {
36
41
  "@emotion/css": "^11.11.0",
37
42
  "@solid-primitives/keyed": "^1.2.0",
38
43
  "@solid-primitives/resize-observer": "^2.0.18",
@@ -40,19 +45,18 @@
40
45
  "@tanstack/match-sorter-utils": "^8.8.4",
41
46
  "solid-js": "^1.6.13",
42
47
  "solid-transition-group": "^0.2.2",
43
- "superjson": "^1.12.4"
44
- },
45
- "devDependencies": {
48
+ "superjson": "^1.12.4",
49
+ "tsup-preset-solid": "^0.1.8",
46
50
  "vite-plugin-solid": "^2.5.0",
47
- "@tanstack/query-core": "5.0.0-alpha.86"
51
+ "@tanstack/query-core": "5.0.0-alpha.88"
48
52
  },
49
53
  "scripts": {
50
- "clean": "rimraf ./dist && rimraf ./coverage",
54
+ "clean": "rimraf ./build && rimraf ./coverage",
51
55
  "test:eslint": "eslint --ext .ts,.tsx ./src",
52
- "test:types": "tsc --noEmit",
56
+ "test:types": "tsc",
53
57
  "test:lib": "vitest run --coverage",
54
58
  "test:lib:dev": "pnpm run test:lib --watch",
55
59
  "test:build": "publint --strict",
56
- "build": "rollup --config rollup.config.js"
60
+ "build": "tsup"
57
61
  }
58
62
  }