ERRORES RESUELTOS: 1. Colores de botones inválidos → colores válidos: - 'orange' → 'warning' (BackendVerificationButton) - 'purple' → 'primary' (FrontendVerificationButton) - 'red' → 'error' (CheckAuthentikAdminsButton) - 'blue' → 'info' (CheckGrupoPruebaButton) - 'green' → 'success' (CheckLvl0Button) - 'gray' → 'neutral' (CheckPublicAccessButton, UserMetadata) 2. Tipos no exportados en Nuxt UI v4: - Removidos imports: ButtonColor, ButtonVariant, ButtonSize - Reemplazados con tipos literales inline - Removido 'none' de variant (no válido en v4) 3. Subcategoria puede ser null: - FormularioMuestra: tipo cambiado a Exclude<Subcategoria, null> - sesion.vue: agregado ?? 'null' para key y guards para null 4. process.client no definido: - useCatacion.ts: process.client → import.meta.client (2 lugares) - Nuxt 4 usa import.meta.client en lugar de process.client 5. process.env en nuxt.config.ts: - Removido process.env.NUXT_PUBLIC_AUTHENTIK_URL - Nuxt runtimeConfig lee automáticamente de .env - Solo valor por defecto necesario 6. Propiedades no válidas en PWA manifest: - Removido: capture_links (no existe en ManifestOptions) - Removido: url_handlers (no existe en ManifestOptions) - Removido: handle_links (no existe en ManifestOptions) 7. Toast props no válidas: - Removido: timeout (no existe en Toast type) - BackendVerificationButton y FrontendVerificationButton RESULTADO: ✅ npx nuxi typecheck pasa sin errores ✅ Solo warnings de @nuxt/content (no críticos)
164 lines
4.2 KiB
TypeScript
164 lines
4.2 KiB
TypeScript
// https://nuxt.com/docs/api/configuration/nuxt-config
|
|
export default defineNuxtConfig({
|
|
compatibilityDate: '2025-07-15',
|
|
devtools: { enabled: true },
|
|
|
|
modules: [
|
|
'@nuxt/ui',
|
|
'@nuxt/test-utils',
|
|
'@nuxt/image',
|
|
'@nuxt/eslint',
|
|
'@nuxt/content',
|
|
'@vite-pwa/nuxt'
|
|
],
|
|
|
|
css: ['~/assets/css/main.css'],
|
|
|
|
runtimeConfig: {
|
|
public: {
|
|
authentikUrl: 'https://authentik.nucleoriofrio.com'
|
|
}
|
|
},
|
|
|
|
pwa: {
|
|
registerType: 'autoUpdate',
|
|
includeAssets: ['favicon.ico', 'apple-touch-icon.png', 'icon.svg', 'offline.html'],
|
|
manifest: {
|
|
id: '/?app=riocata',
|
|
name: 'RioCata - Sistema de Catación de Café',
|
|
short_name: 'RioCata',
|
|
description: 'Sistema de catación de café para evaluación y análisis de calidad',
|
|
lang: 'es',
|
|
dir: 'ltr',
|
|
theme_color: '#ffffff',
|
|
background_color: '#ffffff',
|
|
display: 'standalone',
|
|
display_override: ['window-controls-overlay', 'standalone'],
|
|
orientation: 'any',
|
|
scope: '/',
|
|
start_url: '/?source=pwa',
|
|
categories: ['productivity', 'business'],
|
|
// Control de ventanas - mantener una sola ventana al navegar
|
|
launch_handler: {
|
|
client_mode: 'navigate-existing'
|
|
},
|
|
icons: [
|
|
{
|
|
src: '/icon-72x72.png',
|
|
sizes: '72x72',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-96x96.png',
|
|
sizes: '96x96',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-128x128.png',
|
|
sizes: '128x128',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-144x144.png',
|
|
sizes: '144x144',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-152x152.png',
|
|
sizes: '152x152',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-192x192.png',
|
|
sizes: '192x192',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-256x256.png',
|
|
sizes: '256x256',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-384x384.png',
|
|
sizes: '384x384',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-512x512.png',
|
|
sizes: '512x512',
|
|
type: 'image/png',
|
|
purpose: 'any'
|
|
},
|
|
{
|
|
src: '/icon-512x512-maskable.png',
|
|
sizes: '512x512',
|
|
type: 'image/png',
|
|
purpose: 'maskable'
|
|
}
|
|
],
|
|
screenshots: [
|
|
{
|
|
src: '/screenshots/desktop-1.png',
|
|
sizes: '1920x1080',
|
|
type: 'image/png',
|
|
form_factor: 'wide',
|
|
label: 'Pantalla principal en escritorio'
|
|
},
|
|
{
|
|
src: '/screenshots/mobile-1.png',
|
|
sizes: '614x853',
|
|
type: 'image/png',
|
|
form_factor: 'narrow',
|
|
label: 'Pantalla principal en móvil'
|
|
}
|
|
]
|
|
},
|
|
workbox: {
|
|
navigateFallback: '/offline.html',
|
|
navigateFallbackDenylist: [/^\/api\//, /^\/authentik\//],
|
|
globPatterns: ['**/*.{js,css,html,png,svg,ico,json}'],
|
|
cleanupOutdatedCaches: true,
|
|
// Capturar todas las navegaciones dentro del scope
|
|
navigateFallbackAllowlist: [/^\//],
|
|
clientsClaim: true,
|
|
skipWaiting: true,
|
|
runtimeCaching: [
|
|
{
|
|
urlPattern: /^https:\/\/authentik\.nucleoriofrio\.com\/.*/i,
|
|
handler: 'NetworkOnly'
|
|
},
|
|
{
|
|
urlPattern: ({ url, request }) => {
|
|
return request.destination === 'document' ||
|
|
request.mode === 'navigate' ||
|
|
url.pathname === '/'
|
|
},
|
|
handler: 'NetworkFirst',
|
|
options: {
|
|
cacheName: 'pages-cache',
|
|
networkTimeoutSeconds: 3,
|
|
expiration: {
|
|
maxEntries: 50,
|
|
maxAgeSeconds: 60 * 60 * 24 * 7 // 7 days
|
|
},
|
|
cacheableResponse: {
|
|
statuses: [0, 200]
|
|
}
|
|
}
|
|
}
|
|
]
|
|
},
|
|
devOptions: {
|
|
enabled: true,
|
|
type: 'module'
|
|
}
|
|
}
|
|
}) |