From 1a70600f8b4dd63f3bf047814477cf6b41deb7ed Mon Sep 17 00:00:00 2001 From: "autofix-ci[bot]" <114827586+autofix-ci[bot]@users.noreply.github.com> Date: Mon, 6 Jan 2025 18:49:17 +0000 Subject: [PATCH] [autofix.ci] apply automated fixes --- src/utils/templates/api.ts | 4 ++-- src/utils/templates/app.ts | 4 ++-- src/utils/templates/component.ts | 2 +- src/utils/templates/composable.ts | 2 +- src/utils/templates/error.ts | 2 +- src/utils/templates/index.ts | 4 ++-- src/utils/templates/layer.ts | 6 +++--- src/utils/templates/layout.ts | 2 +- src/utils/templates/middleware.ts | 2 +- src/utils/templates/page.ts | 2 +- src/utils/templates/plugin.ts | 2 +- src/utils/templates/server-middleware.ts | 2 +- 12 files changed, 17 insertions(+), 17 deletions(-) diff --git a/src/utils/templates/api.ts b/src/utils/templates/api.ts index 48a8ef80..01671b67 100644 --- a/src/utils/templates/api.ts +++ b/src/utils/templates/api.ts @@ -1,6 +1,6 @@ -import { applySuffix } from '.' -import { resolve } from 'pathe' import type { Template } from '.' +import { resolve } from 'pathe' +import { applySuffix } from '.' const httpMethods = [ 'connect', diff --git a/src/utils/templates/app.ts b/src/utils/templates/app.ts index b6756168..f434492e 100644 --- a/src/utils/templates/app.ts +++ b/src/utils/templates/app.ts @@ -1,9 +1,9 @@ -import { resolve } from 'pathe' import type { Template } from '.' +import { resolve } from 'pathe' const app: Template = ({ args, nuxtOptions }) => ({ path: resolve(nuxtOptions.srcDir, 'app.vue'), - contents: args['pages'] + contents: args.pages ? ` diff --git a/src/utils/templates/component.ts b/src/utils/templates/component.ts index 90b89314..21724e63 100644 --- a/src/utils/templates/component.ts +++ b/src/utils/templates/component.ts @@ -1,6 +1,6 @@ import type { Template } from '.' -import { applySuffix } from '.' import { resolve } from 'pathe' +import { applySuffix } from '.' const component: Template = ({ name, args, nuxtOptions }) => ({ path: resolve(nuxtOptions.srcDir, `components/${name}${applySuffix( diff --git a/src/utils/templates/composable.ts b/src/utils/templates/composable.ts index d3b23ba4..6fea3a9e 100644 --- a/src/utils/templates/composable.ts +++ b/src/utils/templates/composable.ts @@ -1,6 +1,6 @@ +import type { Template } from '.' import { resolve } from 'pathe' import { camelCase, upperFirst } from 'scule' -import type { Template } from '.' const composable: Template = ({ name, nuxtOptions }) => { const nameWithoutUsePrefix = name.replace(/^use-?/, '') diff --git a/src/utils/templates/error.ts b/src/utils/templates/error.ts index 40e4b380..ef8d659e 100644 --- a/src/utils/templates/error.ts +++ b/src/utils/templates/error.ts @@ -1,5 +1,5 @@ -import { resolve } from 'pathe' import type { Template } from '.' +import { resolve } from 'pathe' const error: Template = ({ nuxtOptions }) => ({ path: resolve(nuxtOptions.srcDir, 'error.vue'), diff --git a/src/utils/templates/index.ts b/src/utils/templates/index.ts index 0160edb6..deb9583b 100644 --- a/src/utils/templates/index.ts +++ b/src/utils/templates/index.ts @@ -1,3 +1,4 @@ +import type { NuxtOptions } from '@nuxt/schema' import { api } from './api' import { app } from './app' import { component } from './component' @@ -9,7 +10,6 @@ import { middleware } from './middleware' import { page } from './page' import { plugin } from './plugin' import { serverMiddleware } from './server-middleware' -import type { NuxtOptions } from '@nuxt/schema' interface TemplateOptions { name: string @@ -59,4 +59,4 @@ function applySuffix( return suffix } -export { templates, applySuffix, TemplateOptions, Template } +export { applySuffix, Template, TemplateOptions, templates } diff --git a/src/utils/templates/layer.ts b/src/utils/templates/layer.ts index 86b6b84a..8a8019d0 100644 --- a/src/utils/templates/layer.ts +++ b/src/utils/templates/layer.ts @@ -1,5 +1,5 @@ -import { resolve } from "pathe" -import { Template } from "." +import type { Template } from '.' +import { resolve } from 'pathe' const layer: Template = ({ name, nuxtOptions }) => { return { @@ -10,4 +10,4 @@ export default defineNuxtConfig({}) } } -export { layer } \ No newline at end of file +export { layer } diff --git a/src/utils/templates/layout.ts b/src/utils/templates/layout.ts index f9879f87..8506d7b2 100644 --- a/src/utils/templates/layout.ts +++ b/src/utils/templates/layout.ts @@ -1,5 +1,5 @@ -import { resolve } from 'pathe' import type { Template } from '.' +import { resolve } from 'pathe' const layout: Template = ({ name, nuxtOptions }) => ({ path: resolve(nuxtOptions.srcDir, nuxtOptions.dir.layouts, `${name}.vue`), diff --git a/src/utils/templates/middleware.ts b/src/utils/templates/middleware.ts index 6310508a..7183e53f 100644 --- a/src/utils/templates/middleware.ts +++ b/src/utils/templates/middleware.ts @@ -1,5 +1,5 @@ -import { resolve } from 'pathe' import type { Template } from '.' +import { resolve } from 'pathe' import { applySuffix } from '.' const middleware: Template = ({ name, args, nuxtOptions }) => ({ diff --git a/src/utils/templates/page.ts b/src/utils/templates/page.ts index 0647d196..68308ea7 100644 --- a/src/utils/templates/page.ts +++ b/src/utils/templates/page.ts @@ -1,5 +1,5 @@ -import { resolve } from 'pathe' import type { Template } from '.' +import { resolve } from 'pathe' const page: Template = ({ name, nuxtOptions }) => ({ path: resolve(nuxtOptions.srcDir, nuxtOptions.dir.pages, `${name}.vue`), diff --git a/src/utils/templates/plugin.ts b/src/utils/templates/plugin.ts index 30f68c62..4411189b 100644 --- a/src/utils/templates/plugin.ts +++ b/src/utils/templates/plugin.ts @@ -1,6 +1,6 @@ import type { Template } from '.' -import { applySuffix } from '.' import { resolve } from 'pathe' +import { applySuffix } from '.' const plugin: Template = ({ name, args, nuxtOptions }) => ({ path: resolve(nuxtOptions.srcDir, nuxtOptions.dir.plugins, `${name}${applySuffix(args, ['client', 'server'], 'mode')}.ts`), diff --git a/src/utils/templates/server-middleware.ts b/src/utils/templates/server-middleware.ts index 055d32e0..0ca9e615 100644 --- a/src/utils/templates/server-middleware.ts +++ b/src/utils/templates/server-middleware.ts @@ -1,5 +1,5 @@ -import { resolve } from 'pathe' import type { Template } from '.' +import { resolve } from 'pathe' const serverMiddleware: Template = ({ name, nuxtOptions }) => ({ path: nuxtOptions.future.compatibilityVersion === 3