@tanstack/query-devtools 5.0.0-alpha.27

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 (45) hide show
  1. package/LICENSE +21 -0
  2. package/build/.tsbuildinfo +1 -0
  3. package/build/cjs/index.js +7966 -0
  4. package/build/cjs/index.js.map +1 -0
  5. package/build/esm/index.js +7964 -0
  6. package/build/esm/index.js.map +1 -0
  7. package/build/source/Context.js +10 -0
  8. package/build/source/Devtools.jsx +1485 -0
  9. package/build/source/Explorer.jsx +266 -0
  10. package/build/source/__tests__/devtools.test.jsx +6 -0
  11. package/build/source/fonts.js +7 -0
  12. package/build/source/icons/index.jsx +344 -0
  13. package/build/source/index.jsx +64 -0
  14. package/build/source/theme.js +304 -0
  15. package/build/source/utils.jsx +74 -0
  16. package/build/types/Context.d.ts +29 -0
  17. package/build/types/Context.d.ts.map +1 -0
  18. package/build/types/Devtools.d.ts +23 -0
  19. package/build/types/Devtools.d.ts.map +1 -0
  20. package/build/types/Explorer.d.ts +22 -0
  21. package/build/types/Explorer.d.ts.map +1 -0
  22. package/build/types/__tests__/devtools.test.d.ts +1 -0
  23. package/build/types/__tests__/devtools.test.d.ts.map +1 -0
  24. package/build/types/fonts.d.ts +2 -0
  25. package/build/types/fonts.d.ts.map +1 -0
  26. package/build/types/icons/index.d.ts +12 -0
  27. package/build/types/icons/index.d.ts.map +1 -0
  28. package/build/types/index.d.ts +27 -0
  29. package/build/types/index.d.ts.map +1 -0
  30. package/build/types/theme.d.ts +297 -0
  31. package/build/types/theme.d.ts.map +1 -0
  32. package/build/types/utils.d.ts +22 -0
  33. package/build/types/utils.d.ts.map +1 -0
  34. package/build/umd/index.js +872 -0
  35. package/build/umd/index.js.map +1 -0
  36. package/package.json +53 -0
  37. package/src/Context.ts +41 -0
  38. package/src/Devtools.tsx +1890 -0
  39. package/src/Explorer.tsx +348 -0
  40. package/src/__tests__/devtools.test.tsx +5 -0
  41. package/src/fonts.ts +7 -0
  42. package/src/icons/index.tsx +1065 -0
  43. package/src/index.tsx +113 -0
  44. package/src/theme.ts +321 -0
  45. package/src/utils.tsx +103 -0
package/package.json ADDED
@@ -0,0 +1,53 @@
1
+ {
2
+ "name": "@tanstack/query-devtools",
3
+ "version": "5.0.0-alpha.27",
4
+ "description": "Developer tools to interact with and visualize the TanStack Query cache",
5
+ "author": "tannerlinsley",
6
+ "license": "MIT",
7
+ "repository": "tanstack/query",
8
+ "homepage": "https://tanstack.com/query",
9
+ "funding": {
10
+ "type": "github",
11
+ "url": "https://github.com/sponsors/tannerlinsley"
12
+ },
13
+ "types": "./build/types/index.d.ts",
14
+ "main": "./build/umd/index.js",
15
+ "module": "./build/esm/index.js",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./build/esm/index.js",
19
+ "require": "./build/umd/index.js",
20
+ "default": "./build/umd/index.js"
21
+ }
22
+ },
23
+ "files": [
24
+ "build",
25
+ "src"
26
+ ],
27
+ "devDependencies": {
28
+ "vite-plugin-solid": "^2.5.0",
29
+ "@tanstack/query-core": "5.0.0-alpha.26"
30
+ },
31
+ "dependencies": {
32
+ "@emotion/css": "^11.10.5",
33
+ "@solid-primitives/keyed": "^1.1.4",
34
+ "@solid-primitives/resize-observer": "^2.0.15",
35
+ "@solid-primitives/storage": "^1.3.9",
36
+ "@tanstack/match-sorter-utils": "^8.8.4",
37
+ "solid-js": "^1.6.10",
38
+ "solid-transition-group": "^0.2.2",
39
+ "superjson": "^1.12.1"
40
+ },
41
+ "peerDependencies": {
42
+ "@tanstack/query-core": "5.0.0-alpha.26"
43
+ },
44
+ "peerDependenciesMeta": {},
45
+ "scripts": {
46
+ "clean": "rimraf ./build",
47
+ "test:eslint": "eslint --ext .ts,.tsx ./src",
48
+ "test:types": "tsc",
49
+ "test:lib": "vitest run --coverage",
50
+ "test:lib:dev": "pnpm run test:lib --watch",
51
+ "build:types": "tsc --build"
52
+ }
53
+ }
package/src/Context.ts ADDED
@@ -0,0 +1,41 @@
1
+ import type { QueryClient, onlineManager, Query } from '@tanstack/query-core'
2
+ import { createContext, useContext } from 'solid-js'
3
+
4
+ type XPosition = 'left' | 'right'
5
+ type YPosition = 'top' | 'bottom'
6
+ export type DevtoolsPosition = XPosition | YPosition
7
+ export type DevtoolsButtonPosition = `${YPosition}-${XPosition}`
8
+
9
+ export interface DevToolsErrorType {
10
+ /**
11
+ * The name of the error.
12
+ */
13
+ name: string
14
+ /**
15
+ * How the error is initialized.
16
+ */
17
+ initializer: (query: Query) => Error
18
+ }
19
+
20
+ export interface QueryDevtoolsProps {
21
+ readonly client: QueryClient
22
+ queryFlavor: string
23
+ version: string
24
+ onlineManager: typeof onlineManager
25
+
26
+ buttonPosition?: DevtoolsButtonPosition
27
+ position?: DevtoolsPosition
28
+ initialIsOpen?: boolean
29
+ errorTypes?: DevToolsErrorType[]
30
+ }
31
+
32
+ export const QueryDevtoolsContext = createContext<QueryDevtoolsProps>({
33
+ client: undefined as unknown as QueryClient,
34
+ onlineManager: undefined as unknown as typeof onlineManager,
35
+ queryFlavor: '',
36
+ version: '',
37
+ })
38
+
39
+ export function useQueryDevtoolsContext() {
40
+ return useContext(QueryDevtoolsContext)
41
+ }