From 960523c4b8a6bc54bbb8610a586e7ef8497ebc35 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Wed, 17 Mar 2021 09:11:37 +0000 Subject: [PATCH] chore: improve ide dx in playground (#185) * chore: improve ide dx in playground * fix(types): correct builder types --- packages/nuxt3/src/app/plugins/vuex.ts | 2 +- packages/nuxt3/src/builder/pages.ts | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/packages/nuxt3/src/app/plugins/vuex.ts b/packages/nuxt3/src/app/plugins/vuex.ts index 4dbe729839..92264d9517 100644 --- a/packages/nuxt3/src/app/plugins/vuex.ts +++ b/packages/nuxt3/src/app/plugins/vuex.ts @@ -17,7 +17,7 @@ export default function ({ app }) { ) } -export function createStore (arg1, arg2) { +export function createStore (arg1: any, arg2?: any) { const store = defineStore(arg1, arg2) return () => useStore(store) diff --git a/packages/nuxt3/src/builder/pages.ts b/packages/nuxt3/src/builder/pages.ts index e387e3100a..2171c27171 100644 --- a/packages/nuxt3/src/builder/pages.ts +++ b/packages/nuxt3/src/builder/pages.ts @@ -1,17 +1,18 @@ import { resolve, extname, relative } from 'path' import { encodePath } from 'ufo' import { NuxtApp } from './app' +import { Builder } from './builder' import { resolveFiles } from './utils' // Check if name has [slug] export interface NuxtRoute { - name: string + name?: string path: string file: string children: NuxtRoute[] } -export async function resolvePagesRoutes (builder, app: NuxtApp) { +export async function resolvePagesRoutes (builder: Builder, app: NuxtApp) { const pagesDir = resolve(app.dir, app.pages!.dir) const pagesPattern = `${app.pages!.dir}/**/*.{${app.extensions.join(',')}}` const files = await resolveFiles(builder, pagesPattern, app.dir)