feat(module): devtools integration (#2196)

Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
Romain Hamel
2024-11-05 22:17:56 +01:00
committed by GitHub
parent 7fc6b387b3
commit 701c75a2a8
100 changed files with 2062 additions and 59 deletions

View File

@@ -5,6 +5,13 @@ import type { Nuxt, NuxtTemplate, NuxtTypeTemplate } from '@nuxt/schema'
import type { ModuleOptions } from './module'
import * as theme from './theme'
export function buildTemplates(options: ModuleOptions) {
return Object.entries(theme).reduce((acc, [key, component]) => {
acc[key] = typeof component === 'function' ? component(options as Required<ModuleOptions>) : component
return acc
}, {} as Record<string, any>)
}
export function getTemplates(options: ModuleOptions, uiConfig: Record<string, any>) {
const templates: NuxtTemplate[] = []