/** * Vite Configuration Types for Burdenoff Microfrontends and App Shells * * @description Type definitions for standardized Vite configurations * @version Vite 8.0.0-beta.8+ */ import type { Plugin } from 'vite'; /** * Microfrontend configuration options */ export interface MicrofrontendConfig { /** Microfrontend name (e.g., 'tags', 'auth', 'billing') */ name: string; /** Development server port (must be unique across all MFEs) */ port: number; /** Entry point for library build (relative to src/) */ entry?: string; /** Path to fe-libs/src (relative from the MFE root) */ feLibsPath?: string; /** Additional external dependencies to exclude from bundle */ additionalExternals?: string[]; /** Additional resolve aliases */ additionalAliases?: Record; /** Additional Vite plugins */ additionalPlugins?: Plugin[]; /** Enable TypeScript declaration generation */ generateDts?: boolean; } /** * App Shell configuration options */ export interface AppShellConfig { /** Application name (e.g., 'workspaces', 'fluidgrids') */ name: string; /** Development server port */ port: number; /** Path to fe-libs/src (relative from the app root) */ feLibsPath?: string; /** Microfrontends to consume (e.g., ['auth', 'billing', 'tags']) */ microfrontends: string[]; /** Path to microfe directory (relative from the app root) */ microfePath?: string; /** Additional resolve aliases */ additionalAliases?: Record; /** Additional Vite plugins */ additionalPlugins?: Plugin[]; /** Manual chunks configuration */ manualChunks?: Record; /** Dependencies to include in optimizeDeps */ optimizeDepsInclude?: string[]; } /** * Standard external dependencies for microfrontends * These are provided by the host app shell and should not be bundled */ export const STANDARD_MFE_EXTERNALS = [ // React ecosystem 'react', 'react-dom', 'react/jsx-runtime', 'react/jsx-dev-runtime', 'react-router', // Apollo Client '@apollo/client', '@apollo/client/react', '@apollo/client/link/error', '@apollo/client/link/retry', '@apollo/client/link/context', '@apollo/client/core', '@apollo/client/cache', 'graphql', // State management 'zustand', 'zustand/middleware', // React Query '@tanstack/react-query', // Common UI 'lucide-react', // fe-libs (provided by app shell) '@burdenoff/fe-libs', /^@burdenoff\/fe-libs\/.*/, ] as const; /** * Standard watch ignore patterns */ export const STANDARD_WATCH_IGNORE = [ '**/node_modules/**', '**/dist/**', '**/.git/**', '**/coverage/**', '**/.turbo/**', '**/build/**', '**/*.log', '**/tmp/**', '**/.cache/**', '**/test-results/**', '**/__snapshots__/**', '**/.idea/**', '**/.vscode/**', '**/.DS_Store', '**/Thumbs.db', ] as const; /** * Port assignments for microfrontends (to avoid conflicts) */ export const MFE_PORT_MAP: Record = { // Core modules (5100-5109) auth: 5100, rbac: 5101, tenant: 5102, organization: 5103, billing: 5104, product: 5105, // Collaboration modules (5110-5119) workspaces: 5110, groups: 5111, calendar: 5112, files: 5113, tags: 5114, workflows: 5115, // Communication modules (5120-5129) notification: 5120, newsletter: 5121, support: 5122, // Analytics & Insights (5130-5139) analytics: 5130, tours: 5131, // Product-specific modules (5140-5149) bigconsole: 5140, vibecontrols: 5141, // Utility modules (5150-5159) i18n: 5150, store: 5151, }; /** * Port assignments for app shells */ export const APP_SHELL_PORT_MAP: Record = { workspaces: 5200, fluidgrids: 5201, botlit: 5202, bigconsole: 5203, vibecontrols: 5204, };