snapshot of https://github.com/TanStack/query.git (main, 2026-09-16; blobs > 131072B omitted)
This commit is contained in:
7
packages/vue-query-devtools/.attw.json
Normal file
7
packages/vue-query-devtools/.attw.json
Normal file
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"ignoreRules": [
|
||||
"cjs-resolves-to-esm",
|
||||
"internal-resolution-error",
|
||||
"no-resolution"
|
||||
]
|
||||
}
|
||||
412
packages/vue-query-devtools/CHANGELOG.md
Normal file
412
packages/vue-query-devtools/CHANGELOG.md
Normal file
@@ -0,0 +1,412 @@
|
||||
# @tanstack/vue-query-devtools
|
||||
|
||||
## 6.1.48
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.102.8
|
||||
- @tanstack/vue-query@5.102.8
|
||||
|
||||
## 6.1.47
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.102.7
|
||||
- @tanstack/vue-query@5.102.7
|
||||
|
||||
## 6.1.46
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.102.6
|
||||
- @tanstack/vue-query@5.102.6
|
||||
|
||||
## 6.1.45
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`ef1eff1`](https://github.com/TanStack/query/commit/ef1eff1b62a657d6ff6f2af819c1cb8b73ad2af5)]:
|
||||
- @tanstack/query-devtools@5.102.5
|
||||
- @tanstack/vue-query@5.102.5
|
||||
|
||||
## 6.1.44
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.102.4
|
||||
- @tanstack/vue-query@5.102.4
|
||||
|
||||
## 6.1.43
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.102.3
|
||||
- @tanstack/vue-query@5.102.3
|
||||
|
||||
## 6.1.42
|
||||
|
||||
## 6.1.41
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.102.2
|
||||
- @tanstack/vue-query@5.102.2
|
||||
|
||||
## 6.1.40
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.102.1
|
||||
- @tanstack/vue-query@5.102.1
|
||||
|
||||
## 6.1.39
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- [#10849](https://github.com/TanStack/query/pull/10849) [`3196e06`](https://github.com/TanStack/query/commit/3196e06b76ce430e35b22798094d4d551ef64c64) - fix(vue-query-devtools): use class instead of className in templates
|
||||
|
||||
- Updated dependencies [[`97ce30b`](https://github.com/TanStack/query/commit/97ce30b51e3040752f3f4172e9fd11be4edea774), [`6e3d521`](https://github.com/TanStack/query/commit/6e3d521fe54f78624e53c1c6f9cadd678504bee8), [`294d4e6`](https://github.com/TanStack/query/commit/294d4e62c4f7d674574a4903eef2a1bc3dd1413b), [`2215bb0`](https://github.com/TanStack/query/commit/2215bb031139cdc8a84751b37a485c38ca9d2b6e), [`1ef4208`](https://github.com/TanStack/query/commit/1ef42087c9a266c2137d2ef645cbcc662f60ac93), [`5199f08`](https://github.com/TanStack/query/commit/5199f0884ca59878bd9e5d352606af13bc5f51fb)]:
|
||||
- @tanstack/vue-query@5.102.0
|
||||
- @tanstack/query-devtools@5.102.0
|
||||
|
||||
## 6.1.38
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.101.4
|
||||
- @tanstack/vue-query@5.101.4
|
||||
|
||||
## 6.1.37
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.101.3
|
||||
- @tanstack/vue-query@5.101.3
|
||||
|
||||
## 6.1.36
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`f5bf180`](https://github.com/TanStack/query/commit/f5bf180d933d8b8d9d9e7b845e55b26a3a413b07), [`25cdd97`](https://github.com/TanStack/query/commit/25cdd975fed4703d2ca5b600ca5ccd2b600b3dd8), [`ecd89c8`](https://github.com/TanStack/query/commit/ecd89c8faf7acc226f00633ea3a761d3ab842c1d), [`01c7634`](https://github.com/TanStack/query/commit/01c763444e3cf3dfa9744f13911aa1533cac3c29), [`49012db`](https://github.com/TanStack/query/commit/49012dbd5192dfe483d3b108b72ffaa7f2849e0f)]:
|
||||
- @tanstack/query-devtools@5.101.2
|
||||
- @tanstack/vue-query@5.101.2
|
||||
|
||||
## 6.1.35
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.101.1
|
||||
- @tanstack/vue-query@5.101.1
|
||||
|
||||
## 6.1.34
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`3042860`](https://github.com/TanStack/query/commit/3042860e3c8731c94ca4dec0e277e415d0484fce), [`e631dc3`](https://github.com/TanStack/query/commit/e631dc3fa17bff71f413246b7a770a730016d346), [`1348095`](https://github.com/TanStack/query/commit/134809544c27cc033ef696d79e3fe4bf75d1e6a8)]:
|
||||
- @tanstack/query-devtools@5.101.0
|
||||
- @tanstack/vue-query@5.101.0
|
||||
|
||||
## 6.1.33
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.100.14
|
||||
- @tanstack/vue-query@5.100.14
|
||||
|
||||
## 6.1.32
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`d423168`](https://github.com/TanStack/query/commit/d423168f6261a5cb3d353e53b27c8150cc271151)]:
|
||||
- @tanstack/vue-query@5.100.13
|
||||
- @tanstack/query-devtools@5.100.13
|
||||
|
||||
## 6.1.31
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.100.12
|
||||
- @tanstack/vue-query@5.100.12
|
||||
|
||||
## 6.1.30
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Use the Vue `class` attribute for devtools template containers. ([#10635](https://github.com/TanStack/query/pull/10635))
|
||||
|
||||
- Updated dependencies [[`139e67c`](https://github.com/TanStack/query/commit/139e67ccab2c8efba7c4dccdffa6f447350446ae)]:
|
||||
- @tanstack/vue-query@5.100.11
|
||||
- @tanstack/query-devtools@5.100.11
|
||||
|
||||
## 6.1.29
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`4d130b9`](https://github.com/TanStack/query/commit/4d130b992d2ac396d75f921bfc530dd3a9d50577)]:
|
||||
- @tanstack/query-devtools@5.100.10
|
||||
- @tanstack/vue-query@5.100.10
|
||||
|
||||
## 6.1.28
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`3d21cac`](https://github.com/TanStack/query/commit/3d21cacdec3028b700c4c2e3e0ff8dbe7a235e8c)]:
|
||||
- @tanstack/query-devtools@5.100.9
|
||||
- @tanstack/vue-query@5.100.9
|
||||
|
||||
## 6.1.27
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.100.8
|
||||
- @tanstack/vue-query@5.100.8
|
||||
|
||||
## 6.1.26
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- docs(devtools): align logo, panel, and 'buttonPosition' union descriptions across docs and JSDoc ([#10617](https://github.com/TanStack/query/pull/10617))
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.100.7
|
||||
- @tanstack/vue-query@5.100.7
|
||||
|
||||
## 6.1.25
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.100.6
|
||||
- @tanstack/vue-query@5.100.6
|
||||
|
||||
## 6.1.24
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.100.5
|
||||
- @tanstack/vue-query@5.100.5
|
||||
|
||||
## 6.1.23
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- fix(devtools): change onClose callback type from () => unknown to () => void ([#10118](https://github.com/TanStack/query/pull/10118))
|
||||
|
||||
- Updated dependencies [[`3d1a62e`](https://github.com/TanStack/query/commit/3d1a62e63bd864359e369bb21356fa80d043f2ba)]:
|
||||
- @tanstack/query-devtools@5.100.4
|
||||
- @tanstack/vue-query@5.100.4
|
||||
|
||||
## 6.1.22
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.100.3
|
||||
- @tanstack/vue-query@5.100.3
|
||||
|
||||
## 6.1.21
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.100.2
|
||||
- @tanstack/vue-query@5.100.2
|
||||
|
||||
## 6.1.20
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.100.1
|
||||
- @tanstack/vue-query@5.100.1
|
||||
|
||||
## 6.1.19
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.100.0
|
||||
- @tanstack/vue-query@5.100.0
|
||||
|
||||
## 6.1.18
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`c2d0dff`](https://github.com/TanStack/query/commit/c2d0dfff5704406a8920348c602f8b97cfda34e7)]:
|
||||
- @tanstack/vue-query@5.99.2
|
||||
- @tanstack/query-devtools@5.99.2
|
||||
|
||||
## 6.1.17
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.99.1
|
||||
- @tanstack/vue-query@5.99.1
|
||||
|
||||
## 6.1.16
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`f279ad2`](https://github.com/TanStack/query/commit/f279ad24887051e81185aff64864a938ff7c139b)]:
|
||||
- @tanstack/vue-query@5.99.0
|
||||
- @tanstack/query-devtools@5.99.0
|
||||
|
||||
## 6.1.15
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Fix Vue SSR devtools cleanup by only registering `unmount()` after `mount()` has run. ([#10439](https://github.com/TanStack/query/pull/10439))
|
||||
|
||||
- Updated dependencies [[`b97513f`](https://github.com/TanStack/query/commit/b97513f2888ed1310a5b39bf91d559c5bc6b83e0), [`29e80d9`](https://github.com/TanStack/query/commit/29e80d9f79d7b71ac89f2c37ee254a5f718abac7)]:
|
||||
- @tanstack/vue-query@5.98.0
|
||||
- @tanstack/query-devtools@5.98.0
|
||||
|
||||
## 6.1.14
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.97.0
|
||||
- @tanstack/vue-query@5.97.0
|
||||
|
||||
## 6.1.13
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.96.2
|
||||
- @tanstack/vue-query@5.96.2
|
||||
|
||||
## 6.1.12
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.96.1
|
||||
- @tanstack/vue-query@5.96.1
|
||||
|
||||
## 6.1.11
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.96.0
|
||||
- @tanstack/vue-query@5.96.0
|
||||
|
||||
## 6.1.10
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.95.2
|
||||
- @tanstack/vue-query@5.95.2
|
||||
|
||||
## 6.1.9
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.95.1
|
||||
- @tanstack/vue-query@5.95.1
|
||||
|
||||
## 6.1.8
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies []:
|
||||
- @tanstack/query-devtools@5.95.0
|
||||
- @tanstack/vue-query@5.95.0
|
||||
|
||||
## 6.1.7
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- fix(\*): resolve issue about excluded build directory ([#10312](https://github.com/TanStack/query/pull/10312))
|
||||
|
||||
- Updated dependencies [[`4b6536d`](https://github.com/TanStack/query/commit/4b6536dfce99036f4e37f52943c6fed3ad0e0a18)]:
|
||||
- @tanstack/query-devtools@5.94.5
|
||||
- @tanstack/vue-query@5.94.5
|
||||
|
||||
## 6.1.6
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- chore: fixed version ([#10064](https://github.com/TanStack/query/pull/10064))
|
||||
|
||||
- Updated dependencies [[`4c75210`](https://github.com/TanStack/query/commit/4c75210ce8235fe3d39b67e1029eff11278927cc)]:
|
||||
- @tanstack/query-devtools@5.94.4
|
||||
- @tanstack/vue-query@5.94.4
|
||||
|
||||
## 6.1.5
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- fix: style prop type ([#10087](https://github.com/TanStack/query/pull/10087))
|
||||
|
||||
## 6.1.4
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`83366c4`](https://github.com/TanStack/query/commit/83366c46a6825b5c591399c705d8128743c527dd)]:
|
||||
- @tanstack/query-devtools@5.93.0
|
||||
|
||||
## 6.1.3
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`f9fc56a`](https://github.com/TanStack/query/commit/f9fc56a9b8724bcfae46f8f6cb229123478eb4db), [`0b29b6f`](https://github.com/TanStack/query/commit/0b29b6f877d4b3a6d05b1c85fb9cb1e6ea736291)]:
|
||||
- @tanstack/query-devtools@5.92.0
|
||||
- @tanstack/vue-query@5.92.3
|
||||
|
||||
## 6.1.2
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`758414f`](https://github.com/TanStack/query/commit/758414fcecb9b56142014edf3ff455c283fb556e)]:
|
||||
- @tanstack/vue-query@5.92.0
|
||||
|
||||
## 6.1.1
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`b261b6f`](https://github.com/TanStack/query/commit/b261b6f29eee2a9bdbe1bc20035fe9b83b15376b)]:
|
||||
- @tanstack/query-devtools@5.91.1
|
||||
|
||||
## 6.1.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- feat(devtools): allow passing a theme via prop ([#9887](https://github.com/TanStack/query/pull/9887))
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`0e9d5b5`](https://github.com/TanStack/query/commit/0e9d5b565276f0de2a1a14ffbb079b5988581c27)]:
|
||||
- @tanstack/query-devtools@5.91.0
|
||||
|
||||
## 6.0.0
|
||||
|
||||
### Patch Changes
|
||||
|
||||
- Updated dependencies [[`b2bd79d`](https://github.com/TanStack/query/commit/b2bd79d0a6b2707461897c426b0d2275a3318e4b)]:
|
||||
- @tanstack/vue-query@5.91.0
|
||||
|
||||
## 5.91.0
|
||||
|
||||
### Minor Changes
|
||||
|
||||
- feat(vue-query-devtools): Add embedded panel mode ([#9790](https://github.com/TanStack/query/pull/9790))
|
||||
6
packages/vue-query-devtools/eslint.config.js
Normal file
6
packages/vue-query-devtools/eslint.config.js
Normal file
@@ -0,0 +1,6 @@
|
||||
// @ts-check
|
||||
|
||||
import pluginVue from 'eslint-plugin-vue'
|
||||
import rootConfig from './root.eslint.config.js'
|
||||
|
||||
export default [...rootConfig, ...pluginVue.configs['flat/base']]
|
||||
80
packages/vue-query-devtools/package.json
Normal file
80
packages/vue-query-devtools/package.json
Normal file
@@ -0,0 +1,80 @@
|
||||
{
|
||||
"name": "@tanstack/vue-query-devtools",
|
||||
"version": "6.1.48",
|
||||
"description": "Developer tools to interact with and visualize the TanStack/vue-query cache",
|
||||
"author": "tannerlinsley",
|
||||
"license": "MIT",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/TanStack/query.git",
|
||||
"directory": "packages/vue-query-devtools"
|
||||
},
|
||||
"homepage": "https://tanstack.com/query",
|
||||
"funding": {
|
||||
"type": "github",
|
||||
"url": "https://github.com/sponsors/tannerlinsley"
|
||||
},
|
||||
"scripts": {
|
||||
"clean": "premove ./build ./coverage ./dist-ts ./.cache/test-types",
|
||||
"compile": "vue-tsc --project tsconfig.json",
|
||||
"test:eslint": "eslint --concurrency=auto ./src",
|
||||
"test:types": "vue-tsc --project tsconfig.json --outDir .cache/test-types/tscurrent --tsBuildInfoFile .cache/test-types/tscurrent.tsbuildinfo",
|
||||
"test:lib": "vitest",
|
||||
"test:lib:dev": "pnpm run test:lib --watch",
|
||||
"test:build": "publint --strict && attw --pack",
|
||||
"build": "vite build"
|
||||
},
|
||||
"type": "module",
|
||||
"types": "dist/esm/index.d.ts",
|
||||
"module": "dist/esm/index.js",
|
||||
"main": "dist/esm/index.js",
|
||||
"exports": {
|
||||
".": {
|
||||
"@tanstack/custom-condition": "./src/index.ts",
|
||||
"types": "./dist/esm/index.d.ts",
|
||||
"default": "./dist/esm/index.js"
|
||||
},
|
||||
"./production": {
|
||||
"@tanstack/custom-condition": "./src/production.ts",
|
||||
"types": "./dist/esm/production.d.ts",
|
||||
"default": "./dist/esm/production.js"
|
||||
},
|
||||
"./dist/production.js": {
|
||||
"types": "./dist/esm/production.d.ts",
|
||||
"default": "./dist/esm/production.js"
|
||||
},
|
||||
"./package.json": "./package.json"
|
||||
},
|
||||
"sideEffects": false,
|
||||
"files": [
|
||||
"dist",
|
||||
"src",
|
||||
"!src/__tests__"
|
||||
],
|
||||
"dependencies": {
|
||||
"@tanstack/query-devtools": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@tanstack/vue-query": "workspace:*",
|
||||
"@vitejs/plugin-vue": "^5.2.4",
|
||||
"eslint-plugin-vue": "^10.5.0",
|
||||
"typescript": "5.8.3",
|
||||
"vite": "^6.4.1",
|
||||
"vue": "^3.4.27",
|
||||
"vue-tsc": "^2.2.8"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@tanstack/vue-query": "workspace:^",
|
||||
"vue": "^3.3.0"
|
||||
},
|
||||
"nx": {
|
||||
"targets": {
|
||||
"build": {
|
||||
"dependsOn": [
|
||||
"^build",
|
||||
"compile"
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1
packages/vue-query-devtools/root.eslint.config.js
Symbolic link
1
packages/vue-query-devtools/root.eslint.config.js
Symbolic link
@@ -0,0 +1 @@
|
||||
../../eslint.config.js
|
||||
@@ -0,0 +1,16 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
|
||||
describe('VueQueryDevtools', () => {
|
||||
it('should return null in non-development environments', async () => {
|
||||
vi.stubEnv('NODE_ENV', 'production')
|
||||
vi.resetModules()
|
||||
|
||||
try {
|
||||
const { VueQueryDevtools } = await import('..')
|
||||
expect((VueQueryDevtools as unknown as () => null)()).toBeNull()
|
||||
} finally {
|
||||
vi.unstubAllEnvs()
|
||||
vi.resetModules()
|
||||
}
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,16 @@
|
||||
import { describe, expect, it, vi } from 'vitest'
|
||||
|
||||
describe('VueQueryDevtoolsPanel', () => {
|
||||
it('should return null in non-development environments', async () => {
|
||||
vi.stubEnv('NODE_ENV', 'production')
|
||||
vi.resetModules()
|
||||
|
||||
try {
|
||||
const { VueQueryDevtoolsPanel } = await import('..')
|
||||
expect((VueQueryDevtoolsPanel as unknown as () => null)()).toBeNull()
|
||||
} finally {
|
||||
vi.unstubAllEnvs()
|
||||
vi.resetModules()
|
||||
}
|
||||
})
|
||||
})
|
||||
44
packages/vue-query-devtools/src/devtools.vue
Normal file
44
packages/vue-query-devtools/src/devtools.vue
Normal file
@@ -0,0 +1,44 @@
|
||||
<script setup lang="ts">
|
||||
import { onMounted, onScopeDispose, ref, watchEffect } from 'vue'
|
||||
import { onlineManager, useQueryClient } from '@tanstack/vue-query'
|
||||
import { TanstackQueryDevtools } from '@tanstack/query-devtools'
|
||||
import type { DevtoolsOptions } from './types'
|
||||
|
||||
const props = defineProps<DevtoolsOptions>()
|
||||
|
||||
const div = ref<HTMLElement>()
|
||||
const client = props.client || useQueryClient()
|
||||
const devtools = new TanstackQueryDevtools({
|
||||
client,
|
||||
queryFlavor: 'Vue Query',
|
||||
version: '5',
|
||||
onlineManager,
|
||||
buttonPosition: props.buttonPosition,
|
||||
position: props.position,
|
||||
initialIsOpen: props.initialIsOpen,
|
||||
errorTypes: props.errorTypes,
|
||||
styleNonce: props.styleNonce,
|
||||
shadowDOMTarget: props.shadowDOMTarget,
|
||||
hideDisabledQueries: props.hideDisabledQueries,
|
||||
theme: props.theme,
|
||||
})
|
||||
|
||||
watchEffect(() => {
|
||||
devtools.setButtonPosition(props.buttonPosition || 'bottom-right')
|
||||
devtools.setPosition(props.position || 'bottom')
|
||||
devtools.setInitialIsOpen(props.initialIsOpen)
|
||||
devtools.setErrorTypes(props.errorTypes || [])
|
||||
devtools.setTheme(props.theme || 'system')
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
devtools.mount(div.value as HTMLElement)
|
||||
onScopeDispose(() => {
|
||||
devtools.unmount()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div class="tsqd-parent-container" ref="div"></div>
|
||||
</template>
|
||||
49
packages/vue-query-devtools/src/devtoolsPanel.vue
Normal file
49
packages/vue-query-devtools/src/devtoolsPanel.vue
Normal file
@@ -0,0 +1,49 @@
|
||||
<script setup lang="ts">
|
||||
import { computed, onMounted, onScopeDispose, ref, watchEffect } from 'vue'
|
||||
import { onlineManager, useQueryClient } from '@tanstack/vue-query'
|
||||
import { TanstackQueryDevtoolsPanel } from '@tanstack/query-devtools'
|
||||
import type { DevtoolsPanelOptions } from './types'
|
||||
|
||||
const props = defineProps<DevtoolsPanelOptions>()
|
||||
const style = computed<any>(() => {
|
||||
return {
|
||||
height: '500px',
|
||||
...props.style,
|
||||
}
|
||||
})
|
||||
|
||||
const div = ref<HTMLElement>()
|
||||
const client = props.client || useQueryClient()
|
||||
const devtools = new TanstackQueryDevtoolsPanel({
|
||||
client,
|
||||
queryFlavor: 'Vue Query',
|
||||
version: '5',
|
||||
onlineManager,
|
||||
buttonPosition: 'bottom-left',
|
||||
position: 'bottom',
|
||||
initialIsOpen: true,
|
||||
errorTypes: props.errorTypes,
|
||||
styleNonce: props.styleNonce,
|
||||
shadowDOMTarget: props.shadowDOMTarget,
|
||||
hideDisabledQueries: props.hideDisabledQueries,
|
||||
onClose: props.onClose,
|
||||
theme: props.theme,
|
||||
})
|
||||
|
||||
watchEffect(() => {
|
||||
devtools.setOnClose(props.onClose ?? (() => {}))
|
||||
devtools.setErrorTypes(props.errorTypes || [])
|
||||
devtools.setTheme(props.theme)
|
||||
})
|
||||
|
||||
onMounted(() => {
|
||||
devtools.mount(div.value as HTMLElement)
|
||||
onScopeDispose(() => {
|
||||
devtools.unmount()
|
||||
})
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<div :style="style" class="tsqd-parent-container" ref="div"></div>
|
||||
</template>
|
||||
20
packages/vue-query-devtools/src/index.ts
Normal file
20
packages/vue-query-devtools/src/index.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import devtools from './devtools.vue'
|
||||
import devtoolsPanel from './devtoolsPanel.vue'
|
||||
import type { DefineComponent } from 'vue'
|
||||
import type { DevtoolsOptions, DevtoolsPanelOptions } from './types'
|
||||
|
||||
export const VueQueryDevtools = (
|
||||
process.env.NODE_ENV !== 'development'
|
||||
? function () {
|
||||
return null
|
||||
}
|
||||
: devtools
|
||||
) as DefineComponent<DevtoolsOptions, {}, unknown>
|
||||
|
||||
export const VueQueryDevtoolsPanel = (
|
||||
process.env.NODE_ENV !== 'development'
|
||||
? function () {
|
||||
return null
|
||||
}
|
||||
: devtoolsPanel
|
||||
) as DefineComponent<DevtoolsPanelOptions, {}, unknown>
|
||||
3
packages/vue-query-devtools/src/production.ts
Normal file
3
packages/vue-query-devtools/src/production.ts
Normal file
@@ -0,0 +1,3 @@
|
||||
import devtools from './devtools.vue'
|
||||
|
||||
export default devtools
|
||||
92
packages/vue-query-devtools/src/types.ts
Normal file
92
packages/vue-query-devtools/src/types.ts
Normal file
@@ -0,0 +1,92 @@
|
||||
import type {
|
||||
DevtoolsButtonPosition,
|
||||
DevtoolsErrorType,
|
||||
DevtoolsPosition,
|
||||
Theme,
|
||||
} from '@tanstack/query-devtools'
|
||||
import type { QueryClient } from '@tanstack/vue-query'
|
||||
|
||||
export interface DevtoolsOptions {
|
||||
/**
|
||||
* Set this true if you want the dev tools to default to being open
|
||||
*/
|
||||
initialIsOpen?: boolean
|
||||
/**
|
||||
* The position of the TanStack logo to open and close the devtools panel.
|
||||
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right' | 'relative'
|
||||
* Defaults to 'bottom-right'.
|
||||
*/
|
||||
buttonPosition?: DevtoolsButtonPosition
|
||||
/**
|
||||
* The position of the Vue Query devtools panel.
|
||||
* 'top' | 'bottom' | 'left' | 'right'
|
||||
* Defaults to 'bottom'.
|
||||
*/
|
||||
position?: DevtoolsPosition
|
||||
/**
|
||||
* Custom instance of QueryClient
|
||||
*/
|
||||
client?: QueryClient
|
||||
/**
|
||||
* Use this so you can define custom errors that can be shown in the devtools.
|
||||
*/
|
||||
errorTypes?: Array<DevtoolsErrorType>
|
||||
/**
|
||||
* Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
|
||||
*/
|
||||
styleNonce?: string
|
||||
/**
|
||||
* Use this so you can attach the devtool's styles to specific element in the DOM.
|
||||
*/
|
||||
shadowDOMTarget?: ShadowRoot
|
||||
/**
|
||||
* Set this to true to hide disabled queries from the devtools panel.
|
||||
*/
|
||||
hideDisabledQueries?: boolean
|
||||
/**
|
||||
* Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
|
||||
* Defaults to 'system'.
|
||||
*/
|
||||
theme?: Theme
|
||||
}
|
||||
|
||||
export interface DevtoolsPanelOptions {
|
||||
/**
|
||||
* Custom instance of QueryClient
|
||||
*/
|
||||
client?: QueryClient
|
||||
/**
|
||||
* Use this so you can define custom errors that can be shown in the devtools.
|
||||
*/
|
||||
errorTypes?: Array<DevtoolsErrorType>
|
||||
/**
|
||||
* Use this to pass a nonce to the style tag that is added to the document head. This is useful if you are using a Content Security Policy (CSP) nonce to allow inline styles.
|
||||
*/
|
||||
styleNonce?: string
|
||||
/**
|
||||
* Use this so you can attach the devtool's styles to specific element in the DOM.
|
||||
*/
|
||||
shadowDOMTarget?: ShadowRoot
|
||||
|
||||
/**
|
||||
* Custom styles for the devtools panel
|
||||
* @default { height: '500px' }
|
||||
* @example { height: '100%' }
|
||||
* @example { height: '100%', width: '100%' }
|
||||
*/
|
||||
style?: Partial<CSSStyleDeclaration>
|
||||
|
||||
/**
|
||||
* Callback function that is called when the devtools panel is closed
|
||||
*/
|
||||
onClose?: () => void
|
||||
/**
|
||||
* Set this to true to hide disabled queries from the devtools panel.
|
||||
*/
|
||||
hideDisabledQueries?: boolean
|
||||
/**
|
||||
* Set this to 'light', 'dark', or 'system' to change the theme of the devtools panel.
|
||||
* Defaults to 'system'.
|
||||
*/
|
||||
theme?: Theme
|
||||
}
|
||||
9
packages/vue-query-devtools/tsconfig.json
Normal file
9
packages/vue-query-devtools/tsconfig.json
Normal file
@@ -0,0 +1,9 @@
|
||||
{
|
||||
"extends": "../../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"outDir": "./dist-ts",
|
||||
"rootDir": "."
|
||||
},
|
||||
"include": ["src", "*.config.ts", "*.config.js", "package.json"],
|
||||
"references": [{ "path": "../vue-query" }, { "path": "../query-devtools" }]
|
||||
}
|
||||
42
packages/vue-query-devtools/vite.config.ts
Normal file
42
packages/vue-query-devtools/vite.config.ts
Normal file
@@ -0,0 +1,42 @@
|
||||
import { defineConfig, mergeConfig } from 'vitest/config'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
import { tanstackViteConfig } from '@tanstack/vite-config'
|
||||
|
||||
import packageJson from './package.json'
|
||||
|
||||
const config = defineConfig({
|
||||
plugins: [vue()],
|
||||
// fix from https://github.com/vitest-dev/vitest/issues/6992#issuecomment-2509408660
|
||||
resolve: {
|
||||
conditions: ['@tanstack/custom-condition'],
|
||||
},
|
||||
environments: {
|
||||
ssr: {
|
||||
resolve: {
|
||||
conditions: ['@tanstack/custom-condition'],
|
||||
},
|
||||
},
|
||||
},
|
||||
test: {
|
||||
name: packageJson.name,
|
||||
dir: './src',
|
||||
watch: false,
|
||||
environment: 'jsdom',
|
||||
coverage: {
|
||||
enabled: !!process.env.CI,
|
||||
provider: 'istanbul',
|
||||
include: ['src/**/*'],
|
||||
exclude: ['src/__tests__/**'],
|
||||
},
|
||||
typecheck: { enabled: true },
|
||||
restoreMocks: true,
|
||||
},
|
||||
})
|
||||
|
||||
export default mergeConfig(
|
||||
config,
|
||||
tanstackViteConfig({
|
||||
entry: ['src/index.ts', 'src/production.ts'],
|
||||
srcDir: 'src',
|
||||
}),
|
||||
)
|
||||
Reference in New Issue
Block a user