Skip to content

Commit

Permalink
chore: update to nuxt 3.4
Browse files Browse the repository at this point in the history
  • Loading branch information
Baroshem committed May 8, 2023
1 parent f98f461 commit 1892edd
Show file tree
Hide file tree
Showing 7 changed files with 1,593 additions and 1,458 deletions.
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@
"dependencies": {
"@algolia/cache-in-memory": "^4.14.2",
"@algolia/recommend": "^4.12.2",
"@nuxt/kit": "^3.0.0",
"@nuxt/kit": "^3.4.0",
"algoliasearch": "^4.11.0",
"instantsearch.css": "^7.4.5",
"metadata-scraper": "^0.2.49",
Expand All @@ -51,7 +51,7 @@
"@nuxt/module-builder": "latest",
"@nuxtjs/eslint-config-typescript": "latest",
"eslint": "latest",
"nuxt": "^3.0.0",
"nuxt": "^3.4.0",
"standard-version": "^9.3.2"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion playground/pages/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import { useSeoMeta } from '@unhead/vue'
import { AisInstantSearch, AisSearchBox, AisHits } from 'vue-instantsearch/vue3/es'
// Grab DocSearch config from nuxt.config
// (the component does that by itself as well)
const { algolia: { docSearch } } = useRuntimeConfig()
const { algolia: { docSearch } } = useRuntimeConfig().public
// Used to try the refresh of the component on options changes
const indexName = ref('test_index')
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/components/AlgoliaDocSearch.vue
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ const options = computed<DocSearchOptions>(
() => {
if (props.options) { return props.options }
const { algolia } = useRuntimeConfig()
const { algolia } = useRuntimeConfig().public
if (algolia && algolia.docSearch) { return algolia.docSearch }
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/composables/useAlgoliaSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export function useAlgoliaSearch<K extends keyof AlgoliaIndices>(indexName?: K):
export function useAlgoliaSearch<T>(indexName?: string): UseSearchReturnType<T>
export function useAlgoliaSearch (indexName?: string) {
const config = useRuntimeConfig();
const index = indexName || config.algolia.globalIndex
const index = indexName || config.public.algolia.globalIndex

if (!index) throw new Error('`[@nuxtjs/algolia]` Cannot search in Algolia without `globalIndex` or `indexName` passed as a parameter')

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/composables/useAsyncAlgoliaSearch.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export type SearchParams = { query: string, indexName?: string } & RequestOption

export async function useAsyncAlgoliaSearch ({ query, requestOptions, indexName }: SearchParams) {
const config = useRuntimeConfig();
const index = indexName || config.algolia.globalIndex
const index = indexName || config.public.algolia.globalIndex

if (!index) throw new Error('`[@nuxtjs/algolia]` Cannot search in Algolia without `indexName`')

Expand Down
2 changes: 1 addition & 1 deletion src/runtime/plugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { defineNuxtPlugin, useRuntimeConfig } from '#imports'
import { createInMemoryCache } from '@algolia/cache-in-memory';

export default defineNuxtPlugin(async (nuxtApp) => {
const { applicationId, apiKey, lite, recommend, cache } = useRuntimeConfig().algolia
const { applicationId, apiKey, lite, recommend, cache } = useRuntimeConfig().public.algolia

// Have to import algoliasearch directly from esm.browser because algoliasearch by default provides umd.js file which causes Nuxt to throw error
// Also, cannot use simple string interpolation due to error 'Cannot read property 'stubModule' of undefined'
Expand Down
3,037 changes: 1,586 additions & 1,451 deletions yarn.lock

Large diffs are not rendered by default.

0 comments on commit 1892edd

Please sign in to comment.