diff --git a/package.json b/package.json index cf914ae..0414996 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "dist" ], "engines": { - "node": ">=20.0.0" + "node": ">=22" }, "scripts": { "build": "unbuild", @@ -35,7 +35,7 @@ "vue": "^3.5.13" }, "dependencies": { - "@rocicorp/zero": "^0.21.0" + "@rocicorp/zero": "^0.22.0" }, "devDependencies": { "@antfu/eslint-config": "latest", diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 8aa2acd..ea89e6c 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -12,8 +12,8 @@ importers: .: dependencies: '@rocicorp/zero': - specifier: ^0.21.0 - version: 0.21.2025070200(@opentelemetry/core@2.0.1(@opentelemetry/api@1.9.0))(typescript@5.9.2) + specifier: ^0.22.0 + version: 0.22.2025080200(@opentelemetry/core@2.0.1(@opentelemetry/api@1.9.0))(typescript@5.9.2) devDependencies: '@antfu/eslint-config': specifier: latest @@ -1361,13 +1361,13 @@ packages: resolution: {integrity: sha512-TfjMTQp9cNNqNtHFfa+XHEGdA7NnmDRu+ZJH4YF3dso0Xk/b9DMhg/sl+b6CR4ThFZArXXDsG1j8Mwl34wcOZQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - '@rocicorp/zero-sqlite3@1.0.7': - resolution: {integrity: sha512-FnfBx4rPw7LSdNYdWW2kdQ6R795YDAmgfL0uw0hhCzsczgqz4HCj4t5GfaaMYFFsQLGD9cEAlQheJHyEaKf4Sw==} + '@rocicorp/zero-sqlite3@1.0.8': + resolution: {integrity: sha512-lWxHKeetYuqYHeM6G+r/1fyQ30JbyiP+IT23knLGowknkpZmdEMUN1453lRHPpvFASIWRwRmhKrUIFDwXHC/Dg==} hasBin: true - '@rocicorp/zero@0.21.2025070200': - resolution: {integrity: sha512-wYqanI8MSmsRqbvr+1vRnHo0OaRb2+SauERZoYKgk9KcITGQq7PW6JL/Uc3+Bh1qu0bM13SdOTOLVsNJqt2+hQ==} - engines: {node: '>=20'} + '@rocicorp/zero@0.22.2025080200': + resolution: {integrity: sha512-WM8QHcppkCT19rvICgFpgDqHDeIctZTmFlyuDPQy3l7UIeexdIJ+aBETrjpCXYcCYHotdwDyH5WUaWpwDjjfrQ==} + engines: {node: '>=22'} hasBin: true '@rolldown/pluginutils@1.0.0-beta.29': @@ -6250,12 +6250,12 @@ snapshots: '@rocicorp/resolver@1.0.2': {} - '@rocicorp/zero-sqlite3@1.0.7': + '@rocicorp/zero-sqlite3@1.0.8': dependencies: bindings: 1.5.0 prebuild-install: 7.1.3 - '@rocicorp/zero@0.21.2025070200(@opentelemetry/core@2.0.1(@opentelemetry/api@1.9.0))(typescript@5.9.2)': + '@rocicorp/zero@0.22.2025080200(@opentelemetry/core@2.0.1(@opentelemetry/api@1.9.0))(typescript@5.9.2)': dependencies: '@badrap/valita': 0.3.11 '@databases/escape-identifier': 1.0.3 @@ -6280,7 +6280,7 @@ snapshots: '@rocicorp/lock': 1.0.4 '@rocicorp/logger': 5.4.0 '@rocicorp/resolver': 1.0.2 - '@rocicorp/zero-sqlite3': 1.0.7 + '@rocicorp/zero-sqlite3': 1.0.8 '@types/basic-auth': 1.1.8 basic-auth: 2.0.1 chalk: 5.4.1 diff --git a/src/query.ts b/src/query.ts index 6598bbd..eec9100 100644 --- a/src/query.ts +++ b/src/query.ts @@ -4,7 +4,6 @@ import type { HumanReadable, Query, ResultType, Schema, TTL } from '@rocicorp/ze import type { ComputedRef, MaybeRefOrGetter } from 'vue' import type { VueView } from './view' -import { DEFAULT_TTL } from '@rocicorp/zero' import { computed, getCurrentInstance, @@ -15,6 +14,8 @@ import { } from 'vue' import { vueViewFactory } from './view' +const DEFAULT_TTL_MS = 1_000 * 60 * 5 + export interface UseQueryOptions { ttl?: TTL | undefined } @@ -33,7 +34,7 @@ export function useQuery< options?: MaybeRefOrGetter, ): QueryResult { const ttl = computed(() => { - return toValue(options)?.ttl ?? DEFAULT_TTL + return toValue(options)?.ttl ?? DEFAULT_TTL_MS }) const view = shallowRef> | null>(null)