@tanstack/vue-query-devtools 5.8.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/LICENSE +21 -0
- package/dist/G2MVXYID-8a2f115e.js +9081 -0
- package/dist/devtools.vue.d.ts +13 -0
- package/dist/devtools.vue.d.ts.map +1 -0
- package/dist/devtools.vue_vue_type_script_setup_true_lang-7800e317.js +2381 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +8 -0
- package/dist/production.d.ts +3 -0
- package/dist/production.d.ts.map +1 -0
- package/dist/production.js +5 -0
- package/dist/types.d.ts +33 -0
- package/dist/types.d.ts.map +1 -0
- package/package.json +61 -0
- package/src/devtools.vue +41 -0
- package/src/index.ts +11 -0
- package/src/production.ts +3 -0
- package/src/shims-vue.d.ts +6 -0
- package/src/types.ts +37 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,KAAK,CAAA;AAC1C,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,SAAS,CAAA;AAE9C,eAAO,MAAM,gBAAgB,+CAMqB,CAAA"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"production.d.ts","sourceRoot":"","sources":["../src/production.ts"],"names":[],"mappings":"AAAA,OAAO,QAAQ,MAAM,gBAAgB,CAAA;AAErC,eAAe,QAAQ,CAAA"}
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { DevToolsErrorType, DevtoolsButtonPosition, DevtoolsPosition } from '@tanstack/query-devtools';
|
|
2
|
+
import type { QueryClient } from '@tanstack/vue-query';
|
|
3
|
+
export interface DevtoolsOptions {
|
|
4
|
+
/**
|
|
5
|
+
* Set this true if you want the dev tools to default to being open
|
|
6
|
+
*/
|
|
7
|
+
initialIsOpen?: boolean;
|
|
8
|
+
/**
|
|
9
|
+
* The position of the React Query logo to open and close the devtools panel.
|
|
10
|
+
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
11
|
+
* Defaults to 'bottom-left'.
|
|
12
|
+
*/
|
|
13
|
+
buttonPosition?: DevtoolsButtonPosition;
|
|
14
|
+
/**
|
|
15
|
+
* The position of the React Query devtools panel.
|
|
16
|
+
* 'top' | 'bottom' | 'left' | 'right'
|
|
17
|
+
* Defaults to 'bottom'.
|
|
18
|
+
*/
|
|
19
|
+
position?: DevtoolsPosition;
|
|
20
|
+
/**
|
|
21
|
+
* Custom instance of QueryClient
|
|
22
|
+
*/
|
|
23
|
+
client?: QueryClient;
|
|
24
|
+
/**
|
|
25
|
+
* Use this so you can define custom errors that can be shown in the devtools.
|
|
26
|
+
*/
|
|
27
|
+
errorTypes?: Array<DevToolsErrorType>;
|
|
28
|
+
/**
|
|
29
|
+
* 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.
|
|
30
|
+
*/
|
|
31
|
+
styleNonce?: string;
|
|
32
|
+
}
|
|
33
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,iBAAiB,EACjB,sBAAsB,EACtB,gBAAgB,EACjB,MAAM,0BAA0B,CAAA;AACjC,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAA;AAEtD,MAAM,WAAW,eAAe;IAC9B;;OAEG;IACH,aAAa,CAAC,EAAE,OAAO,CAAA;IACvB;;;;OAIG;IACH,cAAc,CAAC,EAAE,sBAAsB,CAAA;IACvC;;;;OAIG;IACH,QAAQ,CAAC,EAAE,gBAAgB,CAAA;IAC3B;;OAEG;IACH,MAAM,CAAC,EAAE,WAAW,CAAA;IACpB;;OAEG;IACH,UAAU,CAAC,EAAE,KAAK,CAAC,iBAAiB,CAAC,CAAA;IACrC;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAA;CACpB"}
|
package/package.json
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tanstack/vue-query-devtools",
|
|
3
|
+
"version": "5.8.0",
|
|
4
|
+
"description": "Developer tools to interact with and visualize the TanStack/vue-query cache",
|
|
5
|
+
"author": "tannerlinsley",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/TanStack/query.git",
|
|
10
|
+
"directory": "packages/vue-query-devtools"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://tanstack.com/query",
|
|
13
|
+
"funding": {
|
|
14
|
+
"type": "github",
|
|
15
|
+
"url": "https://github.com/sponsors/tannerlinsley"
|
|
16
|
+
},
|
|
17
|
+
"type": "module",
|
|
18
|
+
"types": "dist/index.d.ts",
|
|
19
|
+
"module": "dist/index.js",
|
|
20
|
+
"main": "dist/index.js",
|
|
21
|
+
"exports": {
|
|
22
|
+
".": {
|
|
23
|
+
"types": "./dist/index.d.ts",
|
|
24
|
+
"default": "./dist/index.js"
|
|
25
|
+
},
|
|
26
|
+
"./production": {
|
|
27
|
+
"types": "./dist/production.d.ts",
|
|
28
|
+
"default": "./dist/production.js"
|
|
29
|
+
},
|
|
30
|
+
"./dist/production.js": {
|
|
31
|
+
"types": "./dist/production.d.ts",
|
|
32
|
+
"default": "./dist/production.js"
|
|
33
|
+
},
|
|
34
|
+
"./package.json": "./package.json"
|
|
35
|
+
},
|
|
36
|
+
"sideEffects": false,
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"src"
|
|
40
|
+
],
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@tanstack/query-devtools": "5.7.4"
|
|
43
|
+
},
|
|
44
|
+
"devDependencies": {
|
|
45
|
+
"@vitejs/plugin-vue": "^4.4.0",
|
|
46
|
+
"vue": "^3.3.0",
|
|
47
|
+
"vue-tsc": "^1.8.21",
|
|
48
|
+
"vite": "^4.4.4",
|
|
49
|
+
"@tanstack/vue-query": "5.7.3"
|
|
50
|
+
},
|
|
51
|
+
"peerDependencies": {
|
|
52
|
+
"vue": "^3.3.0"
|
|
53
|
+
},
|
|
54
|
+
"scripts": {
|
|
55
|
+
"clean": "rimraf ./build && rimraf ./coverage",
|
|
56
|
+
"test:eslint": "eslint --ext .ts,.tsx ./src",
|
|
57
|
+
"test:types": "tsc",
|
|
58
|
+
"test:build": "publint --strict",
|
|
59
|
+
"build": "vite build && vue-tsc"
|
|
60
|
+
}
|
|
61
|
+
}
|
package/src/devtools.vue
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
import { onMounted, onScopeDispose, watchEffect, ref } from 'vue'
|
|
3
|
+
import { onlineManager, useQueryClient } from '@tanstack/vue-query'
|
|
4
|
+
import { TanstackQueryDevtools } from '@tanstack/query-devtools'
|
|
5
|
+
import type { DevtoolsOptions } from './types'
|
|
6
|
+
|
|
7
|
+
const props = defineProps<DevtoolsOptions>()
|
|
8
|
+
|
|
9
|
+
const div = ref<HTMLElement>()
|
|
10
|
+
const client = props.client || useQueryClient()
|
|
11
|
+
const devtools = new TanstackQueryDevtools({
|
|
12
|
+
client,
|
|
13
|
+
queryFlavor: 'Vue Query',
|
|
14
|
+
version: '5',
|
|
15
|
+
onlineManager,
|
|
16
|
+
buttonPosition: props.buttonPosition,
|
|
17
|
+
position: props.position,
|
|
18
|
+
initialIsOpen: props.initialIsOpen,
|
|
19
|
+
errorTypes: props.errorTypes,
|
|
20
|
+
styleNonce: props.styleNonce,
|
|
21
|
+
})
|
|
22
|
+
|
|
23
|
+
watchEffect(() => {
|
|
24
|
+
devtools.setButtonPosition(props.buttonPosition || 'bottom-left')
|
|
25
|
+
devtools.setPosition(props.position || 'bottom')
|
|
26
|
+
devtools.setInitialIsOpen(props.initialIsOpen)
|
|
27
|
+
devtools.setErrorTypes(props.errorTypes || [])
|
|
28
|
+
})
|
|
29
|
+
|
|
30
|
+
onMounted(() => {
|
|
31
|
+
devtools.mount(div.value as HTMLElement)
|
|
32
|
+
})
|
|
33
|
+
|
|
34
|
+
onScopeDispose(() => {
|
|
35
|
+
devtools.unmount()
|
|
36
|
+
})
|
|
37
|
+
</script>
|
|
38
|
+
|
|
39
|
+
<template>
|
|
40
|
+
<div className="tsqd-parent-container" ref="div"></div>
|
|
41
|
+
</template>
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import devtools from './devtools.vue'
|
|
2
|
+
import type { DefineComponent } from 'vue'
|
|
3
|
+
import type { DevtoolsOptions } from './types'
|
|
4
|
+
|
|
5
|
+
export const VueQueryDevtools = (
|
|
6
|
+
process.env.NODE_ENV !== 'development'
|
|
7
|
+
? function () {
|
|
8
|
+
return null
|
|
9
|
+
}
|
|
10
|
+
: devtools
|
|
11
|
+
) as DefineComponent<DevtoolsOptions, {}, unknown>
|
package/src/types.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
DevToolsErrorType,
|
|
3
|
+
DevtoolsButtonPosition,
|
|
4
|
+
DevtoolsPosition,
|
|
5
|
+
} from '@tanstack/query-devtools'
|
|
6
|
+
import type { QueryClient } from '@tanstack/vue-query'
|
|
7
|
+
|
|
8
|
+
export interface DevtoolsOptions {
|
|
9
|
+
/**
|
|
10
|
+
* Set this true if you want the dev tools to default to being open
|
|
11
|
+
*/
|
|
12
|
+
initialIsOpen?: boolean
|
|
13
|
+
/**
|
|
14
|
+
* The position of the React Query logo to open and close the devtools panel.
|
|
15
|
+
* 'top-left' | 'top-right' | 'bottom-left' | 'bottom-right'
|
|
16
|
+
* Defaults to 'bottom-left'.
|
|
17
|
+
*/
|
|
18
|
+
buttonPosition?: DevtoolsButtonPosition
|
|
19
|
+
/**
|
|
20
|
+
* The position of the React Query devtools panel.
|
|
21
|
+
* 'top' | 'bottom' | 'left' | 'right'
|
|
22
|
+
* Defaults to 'bottom'.
|
|
23
|
+
*/
|
|
24
|
+
position?: DevtoolsPosition
|
|
25
|
+
/**
|
|
26
|
+
* Custom instance of QueryClient
|
|
27
|
+
*/
|
|
28
|
+
client?: QueryClient
|
|
29
|
+
/**
|
|
30
|
+
* Use this so you can define custom errors that can be shown in the devtools.
|
|
31
|
+
*/
|
|
32
|
+
errorTypes?: Array<DevToolsErrorType>
|
|
33
|
+
/**
|
|
34
|
+
* 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.
|
|
35
|
+
*/
|
|
36
|
+
styleNonce?: string
|
|
37
|
+
}
|