From eb3ae7bf16b4211c3318a47ca65029a6b0694456 Mon Sep 17 00:00:00 2001 From: lazaroofarrill Date: Mon, 28 Mar 2022 23:44:31 -0400 Subject: [PATCH] change component template to work well with intellij --- packages/nuxi/src/utils/templates.ts | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/packages/nuxi/src/utils/templates.ts b/packages/nuxi/src/utils/templates.ts index 24c58db9e38..a5ea315b924 100644 --- a/packages/nuxi/src/utils/templates.ts +++ b/packages/nuxi/src/utils/templates.ts @@ -1,10 +1,10 @@ -import { upperFirst } from 'scule' +import {upperFirst} from 'scule' interface Template { (options: { name: string }): { path: string, contents: string } } -const api: Template = ({ name }) => ({ +const api: Template = ({name}) => ({ path: `server/api/${name}.ts`, contents: ` import { defineHandle } from 'h3' @@ -15,16 +15,21 @@ export default defineHandle((req, res) => { ` }) -const plugin: Template = ({ name }) => ({ +const plugin: Template = ({name}) => ({ path: `plugins/${name}.ts`, contents: ` export default defineNuxtPlugin((nuxtApp) => {}) ` }) -const component: Template = ({ name }) => ({ +const component: Template = ({name}) => ({ path: `components/${name}.vue`, contents: ` +