[autofix.ci] apply automated fixes

This commit is contained in:
autofix-ci[bot] 2025-01-09 14:46:41 +00:00 committed by Julien Huang
parent 8b2b968977
commit f22ef4f137
6 changed files with 25 additions and 24 deletions

View File

@ -24,7 +24,8 @@ export function useNuxt (): Nuxt {
const fallbackInstance = fallbackNuxtCtx.tryUse()
if (fallbackInstance) {
logger.warn('Using fallback global Nuxt instance. You may be using a @nuxt/kit composable outside of a Nuxt context, this behavior is deprecated and will be removed in v4.')
return fallbackInstance }
return fallbackInstance
}
throw new Error('Nuxt instance is unavailable!')
}

View File

@ -2,8 +2,8 @@ import { pathToFileURL } from 'node:url'
import { readPackageJSON, resolvePackageJSON } from 'pkg-types'
import type { Nuxt } from '@nuxt/schema'
import { importModule, tryImportModule } from '../internal/esm'
import type { LoadNuxtConfigOptions } from './config'
import { asyncNameStorage } from '../utils'
import type { LoadNuxtConfigOptions } from './config'
export interface LoadNuxtOptions extends LoadNuxtConfigOptions {
/** Load nuxt with development mode */

View File

@ -1,4 +1,4 @@
import { AsyncLocalStorage } from "node:async_hooks"
import { AsyncLocalStorage } from 'node:async_hooks'
/** @since 3.9.0 */
export function toArray<T> (value: T | T[]): T[] {

View File

@ -4,7 +4,7 @@ import { join, normalize, relative, resolve } from 'pathe'
import { createDebugger, createHooks } from 'hookable'
import ignore from 'ignore'
import type { LoadNuxtOptions } from '@nuxt/kit'
import { addBuildPlugin, addComponent, addPlugin, addPluginTemplate, addRouteMiddleware, addServerPlugin, addTypeTemplate, addVitePlugin, addWebpackPlugin, installModule, loadNuxtConfig, nuxtCtx, resolveAlias, resolveFiles, resolveIgnorePatterns, resolvePath, tryResolveModule, useNitro, asyncNameStorage, fallbackNuxtCtx } from '@nuxt/kit'
import { addBuildPlugin, addComponent, addPlugin, addPluginTemplate, addRouteMiddleware, addServerPlugin, addTypeTemplate, addVitePlugin, addWebpackPlugin, asyncNameStorage, fallbackNuxtCtx, installModule, loadNuxtConfig, nuxtCtx, resolveAlias, resolveFiles, resolveIgnorePatterns, resolvePath, tryResolveModule, useNitro } from '@nuxt/kit'
import type { Nuxt, NuxtHooks, NuxtModule, NuxtOptions } from 'nuxt/schema'
import type { PackageJson } from 'pkg-types'
import { readPackageJSON } from 'pkg-types'
@ -22,6 +22,7 @@ import { gt, satisfies } from 'semver'
import { hasTTY, isCI } from 'std-env'
import { genImport } from 'knitwork'
import { randomUUID } from 'uncrypto'
import pagesModule from '../pages/module'
import metaModule from '../head/module'
import componentsModule from '../components/module'
@ -46,7 +47,6 @@ import { ComposableKeysPlugin } from './plugins/composable-keys'
import { resolveDeepImportsPlugin } from './plugins/resolve-deep-imports'
import { PrehydrateTransformPlugin } from './plugins/prehydrate'
import { VirtualFSPlugin } from './plugins/virtual'
import { randomUUID } from 'uncrypto'
export function createNuxt (options: NuxtOptions): Nuxt {
const hooks = createHooks<NuxtHooks>()

View File

@ -51,7 +51,7 @@ describe('loadNuxt', () => {
}),
loadNuxt({
cwd: repoRoot,
})
}),
])
})
})