mirror of
https://github.com/nuxt/nuxt.git
synced 2025-01-22 11:22:43 +00:00
[autofix.ci] apply automated fixes
This commit is contained in:
parent
8b2b968977
commit
f22ef4f137
@ -24,7 +24,8 @@ export function useNuxt (): Nuxt {
|
|||||||
const fallbackInstance = fallbackNuxtCtx.tryUse()
|
const fallbackInstance = fallbackNuxtCtx.tryUse()
|
||||||
if (fallbackInstance) {
|
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.')
|
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!')
|
throw new Error('Nuxt instance is unavailable!')
|
||||||
}
|
}
|
||||||
|
@ -2,8 +2,8 @@ import { pathToFileURL } from 'node:url'
|
|||||||
import { readPackageJSON, resolvePackageJSON } from 'pkg-types'
|
import { readPackageJSON, resolvePackageJSON } from 'pkg-types'
|
||||||
import type { Nuxt } from '@nuxt/schema'
|
import type { Nuxt } from '@nuxt/schema'
|
||||||
import { importModule, tryImportModule } from '../internal/esm'
|
import { importModule, tryImportModule } from '../internal/esm'
|
||||||
import type { LoadNuxtConfigOptions } from './config'
|
|
||||||
import { asyncNameStorage } from '../utils'
|
import { asyncNameStorage } from '../utils'
|
||||||
|
import type { LoadNuxtConfigOptions } from './config'
|
||||||
|
|
||||||
export interface LoadNuxtOptions extends LoadNuxtConfigOptions {
|
export interface LoadNuxtOptions extends LoadNuxtConfigOptions {
|
||||||
/** Load nuxt with development mode */
|
/** Load nuxt with development mode */
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { AsyncLocalStorage } from "node:async_hooks"
|
import { AsyncLocalStorage } from 'node:async_hooks'
|
||||||
|
|
||||||
/** @since 3.9.0 */
|
/** @since 3.9.0 */
|
||||||
export function toArray<T> (value: T | T[]): T[] {
|
export function toArray<T> (value: T | T[]): T[] {
|
||||||
|
@ -4,7 +4,7 @@ import { join, normalize, relative, resolve } from 'pathe'
|
|||||||
import { createDebugger, createHooks } from 'hookable'
|
import { createDebugger, createHooks } from 'hookable'
|
||||||
import ignore from 'ignore'
|
import ignore from 'ignore'
|
||||||
import type { LoadNuxtOptions } from '@nuxt/kit'
|
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 { Nuxt, NuxtHooks, NuxtModule, NuxtOptions } from 'nuxt/schema'
|
||||||
import type { PackageJson } from 'pkg-types'
|
import type { PackageJson } from 'pkg-types'
|
||||||
import { readPackageJSON } from 'pkg-types'
|
import { readPackageJSON } from 'pkg-types'
|
||||||
@ -22,6 +22,7 @@ import { gt, satisfies } from 'semver'
|
|||||||
import { hasTTY, isCI } from 'std-env'
|
import { hasTTY, isCI } from 'std-env'
|
||||||
import { genImport } from 'knitwork'
|
import { genImport } from 'knitwork'
|
||||||
|
|
||||||
|
import { randomUUID } from 'uncrypto'
|
||||||
import pagesModule from '../pages/module'
|
import pagesModule from '../pages/module'
|
||||||
import metaModule from '../head/module'
|
import metaModule from '../head/module'
|
||||||
import componentsModule from '../components/module'
|
import componentsModule from '../components/module'
|
||||||
@ -46,7 +47,6 @@ import { ComposableKeysPlugin } from './plugins/composable-keys'
|
|||||||
import { resolveDeepImportsPlugin } from './plugins/resolve-deep-imports'
|
import { resolveDeepImportsPlugin } from './plugins/resolve-deep-imports'
|
||||||
import { PrehydrateTransformPlugin } from './plugins/prehydrate'
|
import { PrehydrateTransformPlugin } from './plugins/prehydrate'
|
||||||
import { VirtualFSPlugin } from './plugins/virtual'
|
import { VirtualFSPlugin } from './plugins/virtual'
|
||||||
import { randomUUID } from 'uncrypto'
|
|
||||||
|
|
||||||
export function createNuxt (options: NuxtOptions): Nuxt {
|
export function createNuxt (options: NuxtOptions): Nuxt {
|
||||||
const hooks = createHooks<NuxtHooks>()
|
const hooks = createHooks<NuxtHooks>()
|
||||||
|
@ -51,7 +51,7 @@ describe('loadNuxt', () => {
|
|||||||
}),
|
}),
|
||||||
loadNuxt({
|
loadNuxt({
|
||||||
cwd: repoRoot,
|
cwd: repoRoot,
|
||||||
})
|
}),
|
||||||
])
|
])
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
Loading…
Reference in New Issue
Block a user