Skip to content

Commit ed615bc

Browse files
committed
chore: bump defu and switch to ohash
1 parent 61a1a28 commit ed615bc

5 files changed

Lines changed: 1400 additions & 1491 deletions

File tree

package.json

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,28 +46,28 @@
4646
"@nuxt/kit": "npm:@nuxt/kit-edge@latest",
4747
"@portabletext/types": "^1.0.3",
4848
"chalk": "^5.0.1",
49-
"defu": "^5.0.1",
49+
"defu": "^6.0.0",
5050
"fs-extra": "^10.0.1",
5151
"knitwork": "^0.1.1",
52-
"murmurhash-es": "^0.1.1",
52+
"ohash": "^0.1.0",
5353
"pathe": "^0.2.0"
5454
},
5555
"devDependencies": {
5656
"@nuxt/module-builder": "^0.1.7",
57-
"@nuxtjs/eslint-config-typescript": "^8.0.0",
58-
"@release-it/conventional-changelog": "^4.2.2",
59-
"@sanity/client": "^3.2.2",
57+
"@nuxtjs/eslint-config-typescript": "^9.0.0",
58+
"@release-it/conventional-changelog": "^4.3.0",
59+
"@sanity/client": "^3.3.0",
6060
"@types/fs-extra": "^9.0.13",
61-
"@vue/test-utils": "^2.0.0-rc.19",
61+
"@vue/test-utils": "^2.0.0-rc.20",
6262
"c8": "^7.11.0",
63-
"eslint": "^8.12.0",
64-
"happy-dom": "^2.46.3",
63+
"eslint": "^8.13.0",
64+
"happy-dom": "^2.55.0",
6565
"husky": "^7.0.4",
66-
"lint-staged": "^12.3.7",
66+
"lint-staged": "^12.3.8",
6767
"nuxi": "^0.10.1",
6868
"nuxt3": "latest",
69-
"release-it": "^14.12.5",
70-
"vitest": "^0.8.5"
69+
"release-it": "^14.14.2",
70+
"vitest": "^0.9.3"
7171
},
7272
"publishConfig": {
7373
"access": "public"

src/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { defineNuxtModule, requireModule, addTemplate, addComponentsDir, addAuto
44
import chalk from 'chalk'
55
import * as fse from 'fs-extra'
66
import { join, resolve } from 'pathe'
7-
import defu from 'defu'
7+
import { defu } from 'defu'
88
import { genImport } from 'knitwork'
99

1010
import { name, version } from '../package.json'

src/runtime/components/sanity-content.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import defu from 'defu'
1+
import { defu } from 'defu'
22
import { Component, defineComponent, h, VNode } from 'vue'
33
import type {
44
PortableTextBlock,

src/runtime/composables.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import defu from 'defu'
2-
import { murmurHashV3 } from 'murmurhash-es'
1+
import { defu } from 'defu'
2+
import { objectHash } from 'ohash'
33

44
import { useNuxtApp, useRuntimeConfig, AsyncDataOptions, useAsyncData, useLazyAsyncData } from '#app'
55
import type { SanityClient, SanityConfiguration } from './client'
@@ -59,11 +59,11 @@ interface UseSanityQueryOptions<T> extends AsyncDataOptions<T> {
5959
export const useSanityQuery = <T = unknown>(query: string, params?: Record<string, any>, options: UseSanityQueryOptions<T> = {}) => {
6060
const { client, ..._options } = options
6161
const sanity = useSanity(client)
62-
return useAsyncData<T>('sanity-' + murmurHashV3(query + (params ? JSON.stringify(params) : '')), () => sanity.fetch(query, params), _options)
62+
return useAsyncData<T>('sanity-' + objectHash(query + (params ? JSON.stringify(params) : '')), () => sanity.fetch(query, params), _options)
6363
}
6464

6565
export const useLazySanityQuery = <T = unknown>(query: string, params?: Record<string, any>, options: UseSanityQueryOptions<T> = {}) => {
6666
const { client, ..._options } = options
6767
const sanity = useSanity(client)
68-
return useLazyAsyncData<T>('sanity-' + murmurHashV3(query + (params ? JSON.stringify(params) : '')), () => sanity.fetch(query, params), _options)
68+
return useLazyAsyncData<T>('sanity-' + objectHash(query + (params ? JSON.stringify(params) : '')), () => sanity.fetch(query, params), _options)
6969
}

0 commit comments

Comments
 (0)