@tanstack/svelte-query-devtools 5.0.0-alpha.52 → 5.0.0-alpha.54

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.
@@ -1,55 +1,40 @@
1
- <script lang="ts">
2
- import { onMount } from 'svelte'
3
- import { DEV, BROWSER } from 'esm-env'
4
- import type { QueryClient } from '@tanstack/svelte-query'
5
- import { useQueryClient, onlineManager } from '@tanstack/svelte-query'
6
- import type {
7
- TanstackQueryDevtools,
8
- DevtoolsButtonPosition,
9
- DevtoolsPosition,
10
- DevToolsErrorType,
11
- } from '@tanstack/query-devtools'
12
-
13
- export let initialIsOpen = false
14
- export let buttonPosition: DevtoolsButtonPosition = 'bottom-left'
15
- export let position: DevtoolsPosition = 'bottom'
16
- export let client: QueryClient = useQueryClient()
17
- export let errorTypes: DevToolsErrorType[] = []
18
-
19
- let ref: HTMLDivElement
20
- let devtools: TanstackQueryDevtools | undefined
21
-
22
- if (DEV && BROWSER) {
23
- onMount(async () => {
24
- const QueryDevtools = (await import('@tanstack/query-devtools'))
25
- .TanstackQueryDevtools
26
- devtools = new QueryDevtools({
27
- client,
28
- queryFlavor: 'Svelte Query',
29
- version: '5',
30
- onlineManager,
31
- buttonPosition,
32
- position,
33
- initialIsOpen,
34
- errorTypes,
35
- })
36
-
37
- devtools.mount(ref)
38
-
39
- return () => {
40
- devtools?.unmount()
41
- }
42
- })
43
- }
44
-
45
- $: {
46
- if (devtools) {
47
- devtools.setButtonPosition(buttonPosition)
48
- devtools.setPosition(position)
49
- devtools.setInitialIsOpen(initialIsOpen)
50
- devtools.setErrorTypes(errorTypes)
51
- }
1
+ <script>import { onMount } from "svelte";
2
+ import { DEV, BROWSER } from "esm-env";
3
+ import { useQueryClient, onlineManager } from "@tanstack/svelte-query";
4
+ export let initialIsOpen = false;
5
+ export let buttonPosition = "bottom-left";
6
+ export let position = "bottom";
7
+ export let client = useQueryClient();
8
+ export let errorTypes = [];
9
+ let ref;
10
+ let devtools;
11
+ if (DEV && BROWSER) {
12
+ onMount(async () => {
13
+ const QueryDevtools = (await import("@tanstack/query-devtools")).TanstackQueryDevtools;
14
+ devtools = new QueryDevtools({
15
+ client,
16
+ queryFlavor: "Svelte Query",
17
+ version: "5",
18
+ onlineManager,
19
+ buttonPosition,
20
+ position,
21
+ initialIsOpen,
22
+ errorTypes
23
+ });
24
+ devtools.mount(ref);
25
+ return () => {
26
+ devtools?.unmount();
27
+ };
28
+ });
29
+ }
30
+ $: {
31
+ if (devtools) {
32
+ devtools.setButtonPosition(buttonPosition);
33
+ devtools.setPosition(position);
34
+ devtools.setInitialIsOpen(initialIsOpen);
35
+ devtools.setErrorTypes(errorTypes);
52
36
  }
37
+ }
53
38
  </script>
54
39
 
55
40
  <div bind:this={ref} />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tanstack/svelte-query-devtools",
3
- "version": "5.0.0-alpha.52",
3
+ "version": "5.0.0-alpha.54",
4
4
  "description": "Developer tools to interact with and visualize the TanStack/svelte-query cache",
5
5
  "author": "Lachlan Collins",
6
6
  "license": "MIT",
@@ -50,6 +50,7 @@
50
50
  "clean": "rimraf ./build && rimraf ./coverage",
51
51
  "test:types": "svelte-check --tsconfig ./tsconfig.json",
52
52
  "test:eslint": "eslint --ext .svelte,.ts ./src",
53
+ "test:build": "publint",
53
54
  "build": "svelte-package --input ./src --output ./build/lib"
54
55
  }
55
56
  }