Skip to content

Commit

Permalink
fix: add various missing imports
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe committed Mar 7, 2024
1 parent 02a8657 commit feea9d0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions src/runtime/composables/visual-editing.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { defu } from 'defu'
import { hash } from 'ohash'
import { reactive } from 'vue'
import { onScopeDispose, reactive, ref } from 'vue'
import { createQueryStore as createCoreQueryStore } from '@sanity/core-loader'
import { defineEncodeDataAttribute } from '@sanity/core-loader/encode-data-attribute'
import { enableVisualEditing } from '@sanity/visual-editing'
Expand All @@ -14,7 +14,7 @@ import type { AsyncData, AsyncDataOptions } from 'nuxt/app'
import type { ClientConfig, SanityClient } from '../client'
import type { SanityVisualEditingMode, SanityVisualEditingRefreshHandler, SanityVisualEditingZIndex } from '../../module'

import { createSanityClient, useNuxtApp, useRuntimeConfig, useAsyncData } from '#imports'
import { createSanityClient, useNuxtApp, useRuntimeConfig, useAsyncData, useState, useRouter, reloadNuxtApp } from '#imports'

export interface SanityVisualEditingConfiguration {
previewMode:
Expand Down
2 changes: 1 addition & 1 deletion src/runtime/plugins/visual-editing.client.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-expect-error need correct typing of #imports
import { defineNuxtPlugin, useSanityVisualEditing, useSanityLiveMode } from '#imports'
import { defineNuxtPlugin, useRuntimeConfig, useSanityVisualEditing, useSanityLiveMode } from '#imports'

export default defineNuxtPlugin(() => {
const $config = useRuntimeConfig();
Expand Down
4 changes: 3 additions & 1 deletion src/runtime/server/routes/preview/enable.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { defineEventHandler, setCookie, sendRedirect } from 'h3'
import { createError, defineEventHandler, getRequestURL, setCookie, sendRedirect } from 'h3'
import { validatePreviewUrl } from '@sanity/preview-url-secret'

import { useSanity, useRuntimeConfig } from '#imports'

export default defineEventHandler(async event => {
const $config = useRuntimeConfig()
const sanity = useSanity()
Expand Down

2 comments on commit feea9d0

@rdunk
Copy link
Collaborator

@rdunk rdunk commented on feea9d0 Mar 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you!

@danielroe
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@rdunk Not at all! It's not your bug. I raised unjs/nitro#2226 to fix the reason these weren't highlighted by your IDE or caught in type check.

Please sign in to comment.