mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-26 18:00:43 +01:00
docs: integrate @nuxt/ui-pro (#739)
Co-authored-by: Pooya Parsa <pooya@pi0.io> Co-authored-by: Florent Delerue <florentdelerue@hotmail.com> Co-authored-by: Sébastien Chopin <seb@nuxt.com>
This commit is contained in:
@@ -8,7 +8,13 @@ const { resolve } = createResolver(import.meta.url)
|
||||
|
||||
export default defineNuxtConfig({
|
||||
// @ts-ignore
|
||||
extends: process.env.NUXT_UI_PRO_PATH || '@nuxt/ui-pro',
|
||||
extends: process.env.NUXT_UI_PRO_PATH ? [
|
||||
process.env.NUXT_UI_PRO_PATH,
|
||||
resolve(process.env.NUXT_UI_PRO_PATH, '.docs')
|
||||
] : [
|
||||
'@nuxt/ui-pro',
|
||||
process.env.NUXT_GITHUB_TOKEN && ['github:nuxt/ui-pro/.docs#dev', { giget: { auth: process.env.NUXT_GITHUB_TOKEN } }]
|
||||
].filter(Boolean),
|
||||
modules: [
|
||||
'@nuxt/content',
|
||||
'nuxt-og-image',
|
||||
@@ -30,7 +36,7 @@ export default defineNuxtConfig({
|
||||
},
|
||||
ui: {
|
||||
global: true,
|
||||
icons: ['heroicons', 'simple-icons'],
|
||||
icons: ['heroicons', 'logos', 'simple-icons'],
|
||||
safelistColors: excludeColors(colors)
|
||||
},
|
||||
content: {
|
||||
@@ -46,7 +52,19 @@ export default defineNuxtConfig({
|
||||
repo: 'nuxt/ui',
|
||||
branch: 'main',
|
||||
dir: 'docs/content'
|
||||
}
|
||||
},
|
||||
pro: process.env.NUXT_UI_PRO_PATH ? {
|
||||
prefix: '/pro',
|
||||
driver: 'fs',
|
||||
base: resolve(process.env.NUXT_UI_PRO_PATH, '.docs/content/pro')
|
||||
} : process.env.NUXT_GITHUB_TOKEN ? {
|
||||
prefix: '/pro',
|
||||
driver: 'github',
|
||||
repo: 'nuxt/ui-pro',
|
||||
branch: 'dev',
|
||||
dir: '.docs/content/pro',
|
||||
token: process.env.NUXT_GITHUB_TOKEN || ''
|
||||
} : undefined
|
||||
}
|
||||
},
|
||||
fontMetrics: {
|
||||
@@ -70,11 +88,20 @@ export default defineNuxtConfig({
|
||||
}
|
||||
},
|
||||
componentMeta: {
|
||||
globalsOnly: true,
|
||||
exclude: ['@nuxtjs/mdc', resolve('./components'), resolve('@nuxt/ui-pro/components')],
|
||||
exclude: [
|
||||
'@nuxt/content',
|
||||
'@nuxt/ui-templates',
|
||||
'@nuxtjs/color-mode',
|
||||
'@nuxtjs/mdc',
|
||||
'nuxt/dist',
|
||||
'nuxt-og-image',
|
||||
'nuxt-site-config',
|
||||
resolve('./components'),
|
||||
process.env.NUXT_UI_PRO_PATH ? resolve(process.env.NUXT_UI_PRO_PATH, '.docs', 'components') : '.c12'
|
||||
],
|
||||
metaFields: {
|
||||
props: true,
|
||||
slots: false,
|
||||
slots: true,
|
||||
events: false,
|
||||
exposed: false
|
||||
}
|
||||
@@ -87,7 +114,9 @@ export default defineNuxtConfig({
|
||||
// Related to https://github.com/nuxt/nuxt/pull/22558
|
||||
'components:extend': (components) => {
|
||||
components.forEach((component) => {
|
||||
if (component.global) {
|
||||
if (component.shortPath.includes(process.env.NUXT_UI_PRO_PATH || '@nuxt/ui-pro')) {
|
||||
component.global = true
|
||||
} else if (component.global) {
|
||||
component.global = 'sync'
|
||||
}
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user