Skip to content

Commit

Permalink
style: enable sort-imports eslint rule (nuxt#20133)
Browse files Browse the repository at this point in the history
  • Loading branch information
danielroe authored Apr 7, 2023
1 parent 11a9780 commit 9878c5b
Show file tree
Hide file tree
Showing 86 changed files with 135 additions and 129 deletions.
6 changes: 6 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,12 @@
"plugin:import/typescript"
],
"rules": {
"sort-imports": [
"error",
{
"ignoreDeclarationSort": true
}
],
"unicorn/prefer-node-protocol": "error",
"no-console": "off",
"vue/multi-word-component-names": "off",
Expand Down
2 changes: 1 addition & 1 deletion examples/app/error-handling/server/middleware/error.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getQuery, defineEventHandler } from 'h3'
import { defineEventHandler, getQuery } from 'h3'

export default defineEventHandler((event) => {
if ('api' in getQuery(event)) {
Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/build.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { WebpackPluginInstance, Configuration as WebpackConfig } from 'webpack'
import type { Plugin as VitePlugin, UserConfig as ViteConfig } from 'vite'
import type { Configuration as WebpackConfig, WebpackPluginInstance } from 'webpack'
import type { UserConfig as ViteConfig, Plugin as VitePlugin } from 'vite'
import { useNuxt } from './context'

export interface ExtendConfigOptions {
Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/components.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { pascalCase, kebabCase } from 'scule'
import type { ComponentsDir, Component } from '@nuxt/schema'
import { kebabCase, pascalCase } from 'scule'
import type { Component, ComponentsDir } from '@nuxt/schema'
import { useNuxt } from './context'
import { assertNuxtCompatibility } from './compatibility'

Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/ignore.test.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { expect, it, describe } from 'vitest'
import { describe, expect, it } from 'vitest'
import { resolveGroupSyntax } from './ignore.js'

describe('resolveGroupSyntax', () => {
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/internal/template.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { promises as fsp } from 'node:fs'
import lodashTemplate from 'lodash.template'
import { genSafeVariableName, genDynamicImport, genImport } from 'knitwork'
import { genDynamicImport, genImport, genSafeVariableName } from 'knitwork'

import type { NuxtTemplate } from '@nuxt/schema'

Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/loader/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { resolve } from 'pathe'
import { applyDefaults } from 'untyped'
import type { LoadConfigOptions } from 'c12'
import { loadConfig } from 'c12'
import type { NuxtOptions, NuxtConfig } from '@nuxt/schema'
import type { NuxtConfig, NuxtOptions } from '@nuxt/schema'
import { NuxtConfigSchema } from '@nuxt/schema'

export interface LoadNuxtConfigOptions extends LoadConfigOptions<NuxtConfig> {}
Expand Down
8 changes: 4 additions & 4 deletions packages/kit/src/module/define.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ import { performance } from 'node:perf_hooks'
import { defu } from 'defu'
import { applyDefaults } from 'untyped'
import { dirname } from 'pathe'
import type { Nuxt, NuxtModule, ModuleOptions, ModuleSetupReturn, ModuleDefinition, NuxtOptions, ResolvedNuxtTemplate } from '@nuxt/schema'
import type { ModuleDefinition, ModuleOptions, ModuleSetupReturn, Nuxt, NuxtModule, NuxtOptions, ResolvedNuxtTemplate } from '@nuxt/schema'
import { logger } from '../logger'
import { useNuxt, nuxtCtx, tryUseNuxt } from '../context'
import { isNuxt2, checkNuxtCompatibility } from '../compatibility'
import { templateUtils, compileTemplate } from '../internal/template'
import { nuxtCtx, tryUseNuxt, useNuxt } from '../context'
import { checkNuxtCompatibility, isNuxt2 } from '../compatibility'
import { compileTemplate, templateUtils } from '../internal/template'

/**
* Define a Nuxt module, automatically merging defaults with user provided options, installing
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/module/install.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { Nuxt, NuxtModule } from '@nuxt/schema'
import { isNuxt2 } from '../compatibility'
import { useNuxt } from '../context'
import { resolveModule, requireModule } from '../internal/cjs'
import { requireModule, resolveModule } from '../internal/cjs'
import { importModule } from '../internal/esm'
import { resolveAlias } from '../resolve'

Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/nitro.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { NitroEventHandler, NitroDevEventHandler, Nitro } from 'nitropack'
import type { Nitro, NitroDevEventHandler, NitroEventHandler } from 'nitropack'
import { normalize } from 'pathe'
import { useNuxt } from './context'

Expand Down
4 changes: 2 additions & 2 deletions packages/kit/src/resolve.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { promises as fsp, existsSync } from 'node:fs'
import { existsSync, promises as fsp } from 'node:fs'
import { fileURLToPath } from 'node:url'
import { basename, dirname, resolve, join, normalize, isAbsolute } from 'pathe'
import { basename, dirname, isAbsolute, join, normalize, resolve } from 'pathe'
import { globby } from 'globby'
import { resolveAlias as _resolveAlias } from 'pathe/utils'
import { tryUseNuxt } from './context'
Expand Down
2 changes: 1 addition & 1 deletion packages/kit/src/template.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { existsSync } from 'node:fs'
import { basename, parse, resolve } from 'pathe'
import hash from 'hash-sum'
import type { NuxtTemplate, ResolvedNuxtTemplate } from '@nuxt/schema'
import { useNuxt, tryUseNuxt } from './context'
import { tryUseNuxt, useNuxt } from './context'

/**
* Renders given template using lodash template during build into the project buildDir
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxi/src/commands/add.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { existsSync, promises as fsp } from 'node:fs'
import { resolve, dirname } from 'pathe'
import { dirname, resolve } from 'pathe'
import consola from 'consola'
import { loadKit } from '../utils/kit'
import { templates } from '../utils/templates'
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxi/src/commands/dev.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { AddressInfo } from 'node:net'
import type { RequestListener } from 'node:http'
import { resolve, relative } from 'pathe'
import { relative, resolve } from 'pathe'
import chokidar from 'chokidar'
import { debounce } from 'perfect-debounce'
import type { Nuxt } from '@nuxt/schema'
Expand All @@ -12,7 +12,7 @@ import { writeTypes } from '../utils/prepare'
import { loadKit } from '../utils/kit'
import { importModule } from '../utils/esm'
import { overrideEnv } from '../utils/env'
import { writeNuxtManifest, loadNuxtManifest, cleanupNuxtDirs } from '../utils/nuxt'
import { cleanupNuxtDirs, loadNuxtManifest, writeNuxtManifest } from '../utils/nuxt'
import { defineNuxtCommand } from './index'

export default defineNuxtCommand({
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxi/src/utils/cjs.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { createRequire } from 'node:module'
import { normalize, dirname } from 'pathe'
import { dirname, normalize } from 'pathe'

export function getModulePaths (paths?: string | string[]): string[] {
return ([] as Array<string | undefined>)
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxi/src/utils/diff.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import flatten from 'flat'
import { detailedDiff } from 'deep-object-diff'
import { green, red, blue, cyan } from 'colorette'
import { blue, cyan, green, red } from 'colorette'

function normalizeDiff (diffObj: any, type: 'added' | 'deleted' | 'updated', ignore: string[]) {
return Object.entries(flatten(diffObj) as Record<string, any>)
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxi/src/utils/nuxt.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { promises as fsp } from 'node:fs'
import { resolve, dirname } from 'pathe'
import { dirname, resolve } from 'pathe'
import consola from 'consola'
import { hash } from 'ohash'
import type { Nuxt } from '@nuxt/schema'
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, createElementBlock } from 'vue'
import { createElementBlock, defineComponent } from 'vue'

export default defineComponent({
name: 'NuxtClientFallback',
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { defineComponent, getCurrentInstance, onErrorCaptured } from 'vue'
import { ssrRenderVNode, ssrRenderAttrs, ssrRenderSlot } from 'vue/server-renderer'
import { ssrRenderAttrs, ssrRenderSlot, ssrRenderVNode } from 'vue/server-renderer'
import { createBuffer } from './utils'

const NuxtClientFallbackServer = defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/components/client-only.mjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { mergeProps, ref, onMounted, defineComponent, createElementBlock, h, createElementVNode } from 'vue'
import { createElementBlock, createElementVNode, defineComponent, h, mergeProps, onMounted, ref } from 'vue'

export default defineComponent({
name: 'ClientOnly',
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/components/island-renderer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { defineAsyncComponent } from 'vue'
import { defineComponent, createVNode } from 'vue'
import { createVNode, defineComponent } from 'vue'

// @ts-ignore
import * as islandComponents from '#build/components.islands.mjs'
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/components/layout.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Ref, VNode } from 'vue'
import { computed, defineComponent, h, inject, nextTick, onMounted, Transition, unref } from 'vue'
import { Transition, computed, defineComponent, h, inject, nextTick, onMounted, unref } from 'vue'
import type { RouteLocationNormalizedLoaded } from 'vue-router'
import { _wrapIf } from './utils'
import { useRoute } from '#app/composables/router'
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/components/nuxt-error-boundary.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, ref, onErrorCaptured } from 'vue'
import { defineComponent, onErrorCaptured, ref } from 'vue'
import { useNuxtApp } from '#app/nuxt'

export default defineComponent({
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/components/nuxt-island.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, createStaticVNode, computed, ref, watch, getCurrentInstance } from 'vue'
import { computed, createStaticVNode, defineComponent, getCurrentInstance, ref, watch } from 'vue'
import { debounce } from 'perfect-debounce'
import { hash } from 'ohash'
import { appendHeader } from 'h3'
Expand Down
6 changes: 3 additions & 3 deletions packages/nuxt/src/app/components/nuxt-link.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { PropType, DefineComponent, ComputedRef } from 'vue'
import { defineComponent, h, ref, resolveComponent, computed, onMounted, onBeforeUnmount } from 'vue'
import type { ComputedRef, DefineComponent, PropType } from 'vue'
import { computed, defineComponent, h, onBeforeUnmount, onMounted, ref, resolveComponent } from 'vue'
import type { RouteLocation, RouteLocationRaw } from 'vue-router'
import { hasProtocol, parseQuery, parseURL, withoutTrailingSlash, withTrailingSlash } from 'ufo'
import { hasProtocol, parseQuery, parseURL, withTrailingSlash, withoutTrailingSlash } from 'ufo'

import { preloadRouteComponents } from '../composables/preload'
import { onNuxtReady } from '../composables/ready'
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/components/server-placeholder.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, createElementBlock } from 'vue'
import { createElementBlock, defineComponent } from 'vue'

export default defineComponent({
name: 'ServerPlaceholder',
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/composables/asyncData.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { onBeforeMount, onServerPrefetch, onUnmounted, ref, getCurrentInstance, watch, unref, toRef } from 'vue'
import { getCurrentInstance, onBeforeMount, onServerPrefetch, onUnmounted, ref, toRef, unref, watch } from 'vue'
import type { Ref, WatchSource } from 'vue'
import type { NuxtApp } from '../nuxt'
import { useNuxtApp } from '../nuxt'
Expand Down
6 changes: 3 additions & 3 deletions packages/nuxt/src/app/composables/fetch.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import type { FetchError } from 'ofetch'
import type { TypedInternalResponse, NitroFetchOptions, NitroFetchRequest, AvailableRouterMethod } from 'nitropack'
import type { AvailableRouterMethod, NitroFetchOptions, NitroFetchRequest, TypedInternalResponse } from 'nitropack'
import type { Ref } from 'vue'
import { computed, unref, reactive } from 'vue'
import { computed, reactive, unref } from 'vue'
import { hash } from 'ohash'
import { useRequestFetch } from './ssr'
import type { AsyncDataOptions, _Transform, KeysOf, AsyncData, PickFrom, MultiWatchSources } from './asyncData'
import type { AsyncData, AsyncDataOptions, KeysOf, MultiWatchSources, PickFrom, _Transform } from './asyncData'
import { useAsyncData } from './asyncData'

export type FetchResult<ReqT extends NitroFetchRequest, M extends AvailableRouterMethod<ReqT>> = TypedInternalResponse<ReqT, unknown, M>
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/composables/payload.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { joinURL, hasProtocol } from 'ufo'
import { hasProtocol, joinURL } from 'ufo'
import { parse } from 'devalue'
import { useHead } from '@unhead/vue'
import { getCurrentInstance } from 'vue'
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/composables/router.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { getCurrentInstance, inject, onUnmounted } from 'vue'
import type { Ref } from 'vue'
import type { Router, RouteLocationNormalizedLoaded, NavigationGuard, RouteLocationNormalized, RouteLocationRaw, NavigationFailure, RouteLocationPathRaw } from 'vue-router'
import type { NavigationFailure, NavigationGuard, RouteLocationNormalized, RouteLocationNormalizedLoaded, RouteLocationPathRaw, RouteLocationRaw, Router } from 'vue-router'
import { sendRedirect } from 'h3'
import { hasProtocol, joinURL, parseURL } from 'ufo'

Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/app/entry.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// We set __webpack_public_path via this import with webpack builder
import { createSSRApp, createApp, nextTick } from 'vue'
import { createApp, createSSRApp, nextTick } from 'vue'
import { $fetch } from 'ofetch'
// @ts-ignore
import { baseURL } from '#build/paths.mjs'
import type { CreateOptions } from '#app'
import { createNuxtApp, applyPlugins, normalizePlugins } from '#app/nuxt'
import { applyPlugins, createNuxtApp, normalizePlugins } from '#app/nuxt'
import '#build/css'
// @ts-ignore
import _plugins from '#build/plugins'
Expand Down
8 changes: 4 additions & 4 deletions packages/nuxt/src/app/nuxt.ts
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
/* eslint-disable no-use-before-define */
import { getCurrentInstance, shallowReactive, reactive } from 'vue'
import type { App, onErrorCaptured, VNode, Ref } from 'vue'
import { getCurrentInstance, reactive, shallowReactive } from 'vue'
import type { App, Ref, VNode, onErrorCaptured } from 'vue'
import type { RouteLocationNormalizedLoaded } from 'vue-router'
import type { Hookable, HookCallback } from 'hookable'
import type { HookCallback, Hookable } from 'hookable'
import { createHooks } from 'hookable'
import { getContext } from 'unctx'
import type { SSRContext } from 'vue-bundle-renderer/runtime'
import type { H3Event } from 'h3'
import type { RuntimeConfig, AppConfigInput, AppConfig } from 'nuxt/schema'
import type { AppConfig, AppConfigInput, RuntimeConfig } from 'nuxt/schema'

// eslint-disable-next-line import/no-restricted-paths
import type { NuxtIslandContext } from '../core/runtime/nitro/renderer'
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/plugins/payload.client.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { parseURL } from 'ufo'
import { defineNuxtPlugin } from '#app/nuxt'
import { loadPayload, isPrerendered } from '#app/composables/payload'
import { isPrerendered, loadPayload } from '#app/composables/payload'
import { useRouter } from '#app/composables/router'

export default defineNuxtPlugin((nuxtApp) => {
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/plugins/revive-payload.client.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { reactive, ref, shallowRef, shallowReactive } from 'vue'
import { reactive, ref, shallowReactive, shallowRef } from 'vue'
import { definePayloadReviver, getNuxtClientPayload } from '#app/composables/payload'
import { createError } from '#app/composables/error'
import { callWithNuxt, defineNuxtPlugin } from '#app/nuxt'
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/app/plugins/revive-payload.server.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { isShallow, isRef, isReactive, toRaw } from 'vue'
import { isReactive, isRef, isShallow, toRaw } from 'vue'
import { definePayloadReducer } from '#app/composables/payload'
import { isNuxtError } from '#app/composables/error'
import { defineNuxtPlugin } from '#app/nuxt'
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/app/plugins/router.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { reactive, h, isReadonly } from 'vue'
import { parseURL, stringifyParsedURL, parseQuery, stringifyQuery, withoutBase, isEqual, joinURL } from 'ufo'
import { h, isReadonly, reactive } from 'vue'
import { isEqual, joinURL, parseQuery, parseURL, stringifyParsedURL, stringifyQuery, withoutBase } from 'ufo'
import { createError } from 'h3'
import { callWithNuxt, defineNuxtPlugin, useRuntimeConfig } from '../nuxt'
import { clearError, showError } from '../composables/error'
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/components/module.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { statSync } from 'node:fs'
import { relative, resolve } from 'pathe'
import { defineNuxtModule, resolveAlias, addTemplate, addPluginTemplate, updateTemplates } from '@nuxt/kit'
import { addPluginTemplate, addTemplate, defineNuxtModule, resolveAlias, updateTemplates } from '@nuxt/kit'
import type { Component, ComponentsDir, ComponentsOptions } from 'nuxt/schema'

import { distDir } from '../dirs'
import { clientFallbackAutoIdPlugin } from './client-fallback-auto-id'
import { componentsPluginTemplate, componentsTemplate, componentsIslandsTemplate, componentsTypeTemplate } from './templates'
import { componentsIslandsTemplate, componentsPluginTemplate, componentsTemplate, componentsTypeTemplate } from './templates'
import { scanComponents } from './scan'
import { loaderPlugin } from './loader'
import { TreeShakeTemplatePlugin } from './tree-shake'
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/components/runtime/server-component.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { defineComponent, createStaticVNode, computed, h, watch } from 'vue'
import { computed, createStaticVNode, defineComponent, h, watch } from 'vue'
import { debounce } from 'perfect-debounce'
import { hash } from 'ohash'
import { appendHeader } from 'h3'
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/components/scan.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { basename, extname, join, dirname, relative } from 'pathe'
import { basename, dirname, extname, join, relative } from 'pathe'
import { globby } from 'globby'
import { pascalCase, splitByCase } from 'scule'
import { isIgnored } from '@nuxt/kit'
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/components/tree-shake.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { pathToFileURL } from 'node:url'
import { parseURL } from 'ufo'
import MagicString from 'magic-string'
import { walk } from 'estree-walker'
import type { CallExpression, Property, Identifier, MemberExpression, Literal, ReturnStatement, VariableDeclaration, ObjectExpression, Node, Pattern, AssignmentProperty, Program } from 'estree'
import type { AssignmentProperty, CallExpression, Identifier, Literal, MemberExpression, Node, ObjectExpression, Pattern, Program, Property, ReturnStatement, VariableDeclaration } from 'estree'
import { createUnplugin } from 'unplugin'
import type { Component } from '@nuxt/schema'
import { resolve } from 'pathe'
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/core/app.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { promises as fsp } from 'node:fs'
import { dirname, resolve, join } from 'pathe'
import { dirname, join, resolve } from 'pathe'
import { defu } from 'defu'
import { findPath, resolveFiles, normalizePlugin, normalizeTemplate, compileTemplate, templateUtils, tryResolveModule, resolvePath, resolveAlias } from '@nuxt/kit'
import { compileTemplate, findPath, normalizePlugin, normalizeTemplate, resolveAlias, resolveFiles, resolvePath, templateUtils, tryResolveModule } from '@nuxt/kit'
import type { Nuxt, NuxtApp, NuxtPlugin, NuxtTemplate, ResolvedNuxtTemplate } from 'nuxt/schema'

import * as defaultTemplates from './templates'
Expand Down
2 changes: 1 addition & 1 deletion packages/nuxt/src/core/builder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { debounce } from 'perfect-debounce'
import { normalize } from 'pathe'
import type { Nuxt } from 'nuxt/schema'

import { createApp, generateApp as _generateApp } from './app'
import { generateApp as _generateApp, createApp } from './app'

export async function build (nuxt: Nuxt) {
const app = createApp(nuxt)
Expand Down
6 changes: 3 additions & 3 deletions packages/nuxt/src/core/nitro.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { existsSync, promises as fsp } from 'node:fs'
import { resolve, join, relative } from 'pathe'
import { createNitro, createDevServer, build, prepare, copyPublicAssets, writeTypes, scanHandlers, prerender } from 'nitropack'
import type { NitroConfig, Nitro } from 'nitropack'
import { join, relative, resolve } from 'pathe'
import { build, copyPublicAssets, createDevServer, createNitro, prepare, prerender, scanHandlers, writeTypes } from 'nitropack'
import type { Nitro, NitroConfig } from 'nitropack'
import { logger, resolvePath } from '@nuxt/kit'
import escapeRE from 'escape-string-regexp'
import { defu } from 'defu'
Expand Down
6 changes: 3 additions & 3 deletions packages/nuxt/src/core/nuxt.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { join, normalize, relative, resolve } from 'pathe'
import { createHooks, createDebugger } from 'hookable'
import { createDebugger, createHooks } from 'hookable'
import type { LoadNuxtOptions } from '@nuxt/kit'
import { logger, resolvePath, resolveAlias, resolveFiles, loadNuxtConfig, nuxtCtx, installModule, addComponent, addVitePlugin, addWebpackPlugin, tryResolveModule, addPlugin } from '@nuxt/kit'
import type { Nuxt, NuxtOptions, NuxtHooks } from 'nuxt/schema'
import { addComponent, addPlugin, addVitePlugin, addWebpackPlugin, installModule, loadNuxtConfig, logger, nuxtCtx, resolveAlias, resolveFiles, resolvePath, tryResolveModule } from '@nuxt/kit'
import type { Nuxt, NuxtHooks, NuxtOptions } from 'nuxt/schema'

import escapeRE from 'escape-string-regexp'
import fse from 'fs-extra'
Expand Down
4 changes: 2 additions & 2 deletions packages/nuxt/src/core/runtime/nitro/error.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { joinURL, withQuery } from 'ufo'
import type { NitroErrorHandler } from 'nitropack'
import type { H3Error } from 'h3'
import { setResponseHeader, getRequestHeaders, setResponseStatus } from 'h3'
import { getRequestHeaders, setResponseHeader, setResponseStatus } from 'h3'
import { useNitroApp, useRuntimeConfig } from '#internal/nitro'
import { normalizeError, isJsonRequest } from '#internal/nitro/utils'
import { isJsonRequest, normalizeError } from '#internal/nitro/utils'

export default <NitroErrorHandler> async function errorhandler (error: H3Error, event) {
// Parse and normalize error
Expand Down
Loading

0 comments on commit 9878c5b

Please sign in to comment.