@sigx/ssg 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +358 -0
- package/dist/build.d.ts +17 -0
- package/dist/build.d.ts.map +1 -0
- package/dist/build.js +309 -0
- package/dist/build.js.map +1 -0
- package/dist/cli.d.ts +3 -0
- package/dist/cli.d.ts.map +1 -0
- package/dist/cli.js +62 -0
- package/dist/cli.js.map +1 -0
- package/dist/client.d.ts +28 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +38 -0
- package/dist/client.js.map +1 -0
- package/dist/config.d.ts +33 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/dev.d.ts +43 -0
- package/dist/dev.d.ts.map +1 -0
- package/dist/dev.js +71 -0
- package/dist/dev.js.map +1 -0
- package/dist/errors.d.ts +58 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/index.d.ts +14 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +58 -0
- package/dist/index.js.map +1 -0
- package/dist/layouts/index.d.ts +7 -0
- package/dist/layouts/index.d.ts.map +1 -0
- package/dist/layouts/resolver.d.ts +49 -0
- package/dist/layouts/resolver.d.ts.map +1 -0
- package/dist/layouts/virtual.d.ts +34 -0
- package/dist/layouts/virtual.d.ts.map +1 -0
- package/dist/mdx/frontmatter.d.ts +42 -0
- package/dist/mdx/frontmatter.d.ts.map +1 -0
- package/dist/mdx/index.d.ts +9 -0
- package/dist/mdx/index.d.ts.map +1 -0
- package/dist/mdx/plugin.d.ts +32 -0
- package/dist/mdx/plugin.d.ts.map +1 -0
- package/dist/mdx/rehype-headings.d.ts +39 -0
- package/dist/mdx/rehype-headings.d.ts.map +1 -0
- package/dist/mdx/shiki.d.ts +32 -0
- package/dist/mdx/shiki.d.ts.map +1 -0
- package/dist/plugin-DxH1VUGC.js +547 -0
- package/dist/plugin-DxH1VUGC.js.map +1 -0
- package/dist/routing/index.d.ts +12 -0
- package/dist/routing/index.d.ts.map +1 -0
- package/dist/routing/navigation.d.ts +44 -0
- package/dist/routing/navigation.d.ts.map +1 -0
- package/dist/routing/resolver.d.ts +66 -0
- package/dist/routing/resolver.d.ts.map +1 -0
- package/dist/routing/scanner.d.ts +60 -0
- package/dist/routing/scanner.d.ts.map +1 -0
- package/dist/routing/virtual-navigation.d.ts +39 -0
- package/dist/routing/virtual-navigation.d.ts.map +1 -0
- package/dist/routing/virtual.d.ts +28 -0
- package/dist/routing/virtual.d.ts.map +1 -0
- package/dist/sitemap.d.ts +55 -0
- package/dist/sitemap.d.ts.map +1 -0
- package/dist/types.d.ts +562 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/virtual-entries-Bz97SKQ0.js +1053 -0
- package/dist/virtual-entries-Bz97SKQ0.js.map +1 -0
- package/dist/vite/index.d.ts +6 -0
- package/dist/vite/index.d.ts.map +1 -0
- package/dist/vite/plugin.d.ts +35 -0
- package/dist/vite/plugin.d.ts.map +1 -0
- package/dist/vite/plugin.js +3 -0
- package/dist/vite/virtual-entries.d.ts +59 -0
- package/dist/vite/virtual-entries.d.ts.map +1 -0
- package/package.json +92 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-entries-Bz97SKQ0.js","names":[],"sources":["../src/config.ts","../src/mdx/frontmatter.ts","../src/routing/scanner.ts","../src/routing/virtual.ts","../src/routing/navigation.ts","../src/routing/virtual-navigation.ts","../src/layouts/resolver.ts","../src/layouts/virtual.ts","../src/vite/virtual-entries.ts"],"sourcesContent":["/**\r\n * SSG Configuration helper\r\n */\r\n\r\nimport path from 'node:path';\r\nimport type { SSGConfig } from './types';\r\n\r\n/**\r\n * Define SSG configuration with type safety\r\n *\r\n * @example\r\n * ```ts\r\n * // ssg.config.ts\r\n * import { defineSSGConfig } from '@sigx/ssg';\r\n *\r\n * export default defineSSGConfig({\r\n * pages: 'src/pages',\r\n * layouts: 'src/layouts',\r\n * theme: '@sigx/ssg-theme-daisyui',\r\n * site: {\r\n * title: 'My Site',\r\n * description: 'A SignalX-powered static site'\r\n * }\r\n * });\r\n * ```\r\n */\r\nexport function defineSSGConfig(config: SSGConfig): SSGConfig {\r\n return {\r\n // Defaults\r\n pages: 'src/pages',\r\n layouts: 'src/layouts',\r\n content: 'src/content',\r\n defaultLayout: 'default',\r\n outDir: 'dist',\r\n base: '/',\r\n // Zero-config defaults\r\n autoEntries: true,\r\n prefetch: true,\r\n // User overrides\r\n ...config,\r\n // Merge nested objects\r\n site: {\r\n lang: 'en',\r\n ...config.site,\r\n },\r\n markdown: {\r\n shiki: true,\r\n ...config.markdown,\r\n },\r\n toc: {\r\n minLevel: 2,\r\n maxLevel: 3,\r\n ...config.toc,\r\n },\r\n };\r\n}\r\n\r\n/**\r\n * Load SSG config from file\r\n */\r\nexport async function loadConfig(configPath?: string): Promise<SSGConfig> {\r\n const fsPath = await import('node:path');\r\n const fs = await import('node:fs');\r\n const { pathToFileURL } = await import('node:url');\r\n const os = await import('node:os');\r\n\r\n // Find config file\r\n const cwd = process.cwd();\r\n const possiblePaths = configPath\r\n ? [fsPath.resolve(cwd, configPath)]\r\n : [\r\n fsPath.resolve(cwd, 'ssg.config.ts'),\r\n fsPath.resolve(cwd, 'ssg.config.js'),\r\n fsPath.resolve(cwd, 'ssg.config.mjs'),\r\n ];\r\n\r\n let foundPath: string | null = null;\r\n for (const p of possiblePaths) {\r\n if (fs.existsSync(p)) {\r\n foundPath = p;\r\n break;\r\n }\r\n }\r\n\r\n if (!foundPath) {\r\n console.warn('No ssg.config found, using defaults');\r\n return defineSSGConfig({});\r\n }\r\n\r\n try {\r\n // For TypeScript files, use esbuild to compile them first\r\n if (foundPath.endsWith('.ts')) {\r\n const esbuild = await import('esbuild');\r\n const tempDir = os.tmpdir();\r\n const tempFile = fsPath.join(tempDir, `ssg-config-${Date.now()}.mjs`);\r\n \r\n // Read and transform the TypeScript file\r\n const source = fs.readFileSync(foundPath, 'utf-8');\r\n \r\n // Transform: remove the import and defineSSGConfig wrapper\r\n // The config file typically does: export default defineSSGConfig({ ... })\r\n // We just need the config object, so we can transform it\r\n const result = await esbuild.transform(source, {\r\n loader: 'ts',\r\n format: 'esm',\r\n });\r\n \r\n // Write the transformed code to a temp file in the same directory as the config\r\n // This ensures relative imports and package resolution work correctly\r\n const configDir = fsPath.dirname(foundPath);\r\n const localTempFile = fsPath.join(configDir, `.ssg-config-temp-${Date.now()}.mjs`);\r\n \r\n fs.writeFileSync(localTempFile, result.code);\r\n \r\n try {\r\n const configModule = await import(pathToFileURL(localTempFile).href);\r\n return defineSSGConfig(configModule.default || configModule);\r\n } finally {\r\n // Clean up temp file\r\n try {\r\n fs.unlinkSync(localTempFile);\r\n } catch {\r\n // Ignore cleanup errors\r\n }\r\n }\r\n }\r\n \r\n // For JS files, import directly\r\n const configModule = await import(pathToFileURL(foundPath).href);\r\n return defineSSGConfig(configModule.default || configModule);\r\n } catch (err) {\r\n console.error(`Failed to load config from ${foundPath}:`, err);\r\n return defineSSGConfig({});\r\n }\r\n}\r\n\r\n/**\r\n * Resolve paths in config to absolute paths\r\n */\r\nexport function resolveConfigPaths(config: SSGConfig, root: string): SSGConfig {\r\n return {\r\n ...config,\r\n pages: path.resolve(root, config.pages || 'src/pages'),\r\n layouts: path.resolve(root, config.layouts || 'src/layouts'),\r\n content: path.resolve(root, config.content || 'src/content'),\r\n outDir: path.resolve(root, config.outDir || 'dist'),\r\n };\r\n}\r\n","/**\r\n * Frontmatter parser\r\n *\r\n * Extracts and parses YAML frontmatter from Markdown/MDX files.\r\n */\r\n\r\nimport matter from 'gray-matter';\r\nimport type { PageMeta } from '../types';\r\n\r\n/**\r\n * Result of parsing frontmatter\r\n */\r\nexport interface FrontmatterResult {\r\n /**\r\n * Parsed frontmatter data\r\n */\r\n data: PageMeta;\r\n\r\n /**\r\n * Content body without frontmatter\r\n */\r\n content: string;\r\n\r\n /**\r\n * Raw frontmatter string\r\n */\r\n raw: string;\r\n\r\n /**\r\n * Whether frontmatter was present\r\n */\r\n hasFrontmatter: boolean;\r\n}\r\n\r\n/**\r\n * Parse frontmatter from content\r\n */\r\nexport function parseFrontmatter(source: string): FrontmatterResult {\r\n const { data, content, matter: raw } = matter(source);\r\n\r\n return {\r\n data: normalizeFrontmatter(data),\r\n content,\r\n raw: raw || '',\r\n hasFrontmatter: !!raw,\r\n };\r\n}\r\n\r\n/**\r\n * Normalize frontmatter data to PageMeta\r\n */\r\nfunction normalizeFrontmatter(data: Record<string, unknown>): PageMeta {\r\n const meta: PageMeta = {};\r\n\r\n // Standard fields\r\n if (typeof data.title === 'string') meta.title = data.title;\r\n if (typeof data.description === 'string') meta.description = data.description;\r\n if (typeof data.layout === 'string') meta.layout = data.layout;\r\n if (typeof data.draft === 'boolean') meta.draft = data.draft;\r\n\r\n // Date handling\r\n if (data.date) {\r\n if (data.date instanceof Date) {\r\n meta.date = data.date;\r\n } else if (typeof data.date === 'string') {\r\n meta.date = new Date(data.date);\r\n }\r\n }\r\n\r\n // Tags\r\n if (Array.isArray(data.tags)) {\r\n meta.tags = data.tags.filter((t) => typeof t === 'string');\r\n }\r\n\r\n // SSR flag\r\n if (typeof data.ssr === 'boolean') meta.ssr = data.ssr;\r\n\r\n // Copy all other fields\r\n for (const [key, value] of Object.entries(data)) {\r\n if (!(key in meta)) {\r\n meta[key] = value;\r\n }\r\n }\r\n\r\n return meta;\r\n}\r\n\r\n/**\r\n * Extract title from markdown content if not in frontmatter\r\n *\r\n * Looks for the first H1 heading\r\n */\r\nexport function extractTitleFromContent(content: string): string | null {\r\n const h1Match = content.match(/^#\\s+(.+)$/m);\r\n return h1Match ? h1Match[1].trim() : null;\r\n}\r\n\r\n/**\r\n * Serialize frontmatter back to YAML string\r\n */\r\nexport function serializeFrontmatter(data: PageMeta): string {\r\n const lines: string[] = ['---'];\r\n\r\n for (const [key, value] of Object.entries(data)) {\r\n if (value === undefined) continue;\r\n\r\n if (value instanceof Date) {\r\n lines.push(`${key}: ${value.toISOString().split('T')[0]}`);\r\n } else if (Array.isArray(value)) {\r\n lines.push(`${key}:`);\r\n for (const item of value) {\r\n lines.push(` - ${JSON.stringify(item)}`);\r\n }\r\n } else if (typeof value === 'object' && value !== null) {\r\n lines.push(`${key}: ${JSON.stringify(value)}`);\r\n } else {\r\n lines.push(`${key}: ${JSON.stringify(value)}`);\r\n }\r\n }\r\n\r\n lines.push('---');\r\n return lines.join('\\n');\r\n}\r\n","/**\r\n * File-based route scanner\r\n *\r\n * Scans a pages directory and generates route definitions from file paths.\r\n * Supports dynamic routes with [param] and catch-all with [...slug] patterns.\r\n */\r\n\r\nimport fg from 'fast-glob';\r\nimport path from 'node:path';\r\nimport fs from 'node:fs';\r\nimport type { SSGRoute, SSGConfig, PageMeta } from '../types';\r\nimport { parseFrontmatter } from '../mdx/frontmatter';\r\n\r\n/**\r\n * File extensions to treat as pages\r\n */\r\nconst PAGE_EXTENSIONS = ['.tsx', '.jsx', '.mdx', '.md'];\r\n\r\n/**\r\n * Files/directories to exclude from routing\r\n * \r\n * Only exclude common non-page folders at the ROOT of pages directory.\r\n * Nested folders like /docs/components/ are valid routes.\r\n */\r\nconst EXCLUDED_PATTERNS = [\r\n 'components/**', // Root-level components folder only\r\n 'hooks/**', // Root-level hooks folder only\r\n 'utils/**', // Root-level utils folder only\r\n 'lib/**', // Root-level lib folder only\r\n '**/_*', // Files/folders starting with underscore (at any level)\r\n '**/*.test.*',\r\n '**/*.spec.*',\r\n];\r\n\r\n/**\r\n * Scan pages directory and generate routes\r\n */\r\nexport async function scanPages(config: SSGConfig, root: string): Promise<SSGRoute[]> {\r\n const pagesDir = path.resolve(root, config.pages || 'src/pages');\r\n\r\n // Find all page files\r\n const patterns = PAGE_EXTENSIONS.map(ext => `**/*${ext}`);\r\n const files = await fg(patterns, {\r\n cwd: pagesDir,\r\n ignore: EXCLUDED_PATTERNS,\r\n onlyFiles: true,\r\n absolute: false,\r\n });\r\n\r\n // Convert files to routes (with frontmatter extraction)\r\n const routes: SSGRoute[] = [];\r\n\r\n for (const file of files) {\r\n const route = await fileToRouteWithMeta(file, pagesDir);\r\n if (route) {\r\n routes.push(route);\r\n }\r\n }\r\n\r\n // Sort routes by specificity (static > dynamic > catch-all)\r\n return sortRoutes(routes);\r\n}\r\n\r\n/**\r\n * Convert a file path to a route definition with frontmatter metadata\r\n */\r\nasync function fileToRouteWithMeta(filePath: string, pagesDir: string): Promise<SSGRoute | null> {\r\n const route = fileToRoute(filePath, pagesDir);\r\n if (!route) return null;\r\n\r\n // Extract frontmatter from MDX/MD files\r\n const ext = path.extname(filePath).toLowerCase();\r\n if (ext === '.mdx' || ext === '.md') {\r\n try {\r\n const content = fs.readFileSync(route.file, 'utf-8');\r\n const { data } = parseFrontmatter(content);\r\n route.meta = data;\r\n } catch (err) {\r\n // Ignore read errors - frontmatter just won't be available\r\n }\r\n }\r\n\r\n return route;\r\n}\r\n\r\n/**\r\n * Convert a file path to a route definition\r\n */\r\nexport function fileToRoute(filePath: string, pagesDir: string): SSGRoute | null {\r\n // Remove extension\r\n const ext = path.extname(filePath);\r\n let routePath = filePath.slice(0, -ext.length);\r\n\r\n // Handle index files\r\n if (routePath.endsWith('/index') || routePath === 'index') {\r\n routePath = routePath.replace(/\\/?index$/, '') || '/';\r\n }\r\n\r\n // Convert file path to URL path\r\n routePath = filePathToRoutePath(routePath);\r\n\r\n // Generate route name from path\r\n const name = pathToRouteName(routePath);\r\n\r\n return {\r\n path: routePath.startsWith('/') ? routePath : `/${routePath}`,\r\n file: path.join(pagesDir, filePath),\r\n name,\r\n };\r\n}\r\n\r\n/**\r\n * Convert file path patterns to route path patterns\r\n *\r\n * Examples:\r\n * blog/[slug] -> /blog/:slug\r\n * docs/[...path] -> /docs/*path\r\n * users/[id]/posts -> /users/:id/posts\r\n */\r\nexport function filePathToRoutePath(filePath: string): string {\r\n return filePath\r\n .split('/')\r\n .map(segment => {\r\n // Catch-all: [...slug] -> *slug\r\n if (segment.startsWith('[...') && segment.endsWith(']')) {\r\n const param = segment.slice(4, -1);\r\n return `*${param}`;\r\n }\r\n\r\n // Optional catch-all: [[...slug]] -> *slug (same behavior)\r\n if (segment.startsWith('[[...') && segment.endsWith(']]')) {\r\n const param = segment.slice(5, -2);\r\n return `*${param}`;\r\n }\r\n\r\n // Dynamic segment: [id] -> :id\r\n if (segment.startsWith('[') && segment.endsWith(']')) {\r\n const param = segment.slice(1, -1);\r\n return `:${param}`;\r\n }\r\n\r\n // Optional segment: [[id]] -> :id?\r\n if (segment.startsWith('[[') && segment.endsWith(']]')) {\r\n const param = segment.slice(2, -2);\r\n return `:${param}?`;\r\n }\r\n\r\n return segment;\r\n })\r\n .join('/');\r\n}\r\n\r\n/**\r\n * Convert route path to a route name\r\n *\r\n * Examples:\r\n * / -> index\r\n * /about -> about\r\n * /blog/:slug -> blog-slug\r\n * /docs/*path -> docs-path\r\n */\r\nexport function pathToRouteName(routePath: string): string {\r\n if (routePath === '/' || routePath === '') {\r\n return 'index';\r\n }\r\n\r\n return routePath\r\n .replace(/^\\//, '') // Remove leading slash\r\n .replace(/\\//g, '-') // Replace slashes with dashes\r\n .replace(/:/g, '') // Remove param colons\r\n .replace(/\\*/g, '') // Remove wildcards\r\n .replace(/\\?/g, '') // Remove optional markers\r\n .replace(/-+/g, '-') // Collapse multiple dashes\r\n .replace(/-$/, ''); // Remove trailing dash\r\n}\r\n\r\n/**\r\n * Sort routes by specificity\r\n *\r\n * Order:\r\n * 1. Static routes (most specific)\r\n * 2. Dynamic param routes\r\n * 3. Catch-all routes (least specific)\r\n *\r\n * Within each category, longer paths come first\r\n */\r\nexport function sortRoutes(routes: SSGRoute[]): SSGRoute[] {\r\n return routes.sort((a, b) => {\r\n const scoreA = getRouteScore(a.path);\r\n const scoreB = getRouteScore(b.path);\r\n\r\n // Higher score = more specific = should come first\r\n if (scoreA !== scoreB) {\r\n return scoreB - scoreA;\r\n }\r\n\r\n // Same score: longer paths first\r\n return b.path.length - a.path.length;\r\n });\r\n}\r\n\r\n/**\r\n * Calculate specificity score for a route\r\n */\r\nfunction getRouteScore(routePath: string): number {\r\n const segments = routePath.split('/').filter(Boolean);\r\n let score = 0;\r\n\r\n for (const segment of segments) {\r\n if (segment.startsWith('*')) {\r\n // Catch-all: lowest priority\r\n score += 1;\r\n } else if (segment.startsWith(':')) {\r\n // Dynamic param: medium priority\r\n score += 10;\r\n } else {\r\n // Static segment: highest priority\r\n score += 100;\r\n }\r\n }\r\n\r\n return score;\r\n}\r\n\r\n/**\r\n * Check if a route has dynamic segments\r\n */\r\nexport function isDynamicRoute(route: SSGRoute): boolean {\r\n return route.path.includes(':') || route.path.includes('*');\r\n}\r\n\r\n/**\r\n * Extract parameter names from a route path\r\n */\r\nexport function extractParams(routePath: string): string[] {\r\n const params: string[] = [];\r\n const segments = routePath.split('/');\r\n\r\n for (const segment of segments) {\r\n if (segment.startsWith(':')) {\r\n params.push(segment.slice(1).replace('?', ''));\r\n } else if (segment.startsWith('*')) {\r\n params.push(segment.slice(1));\r\n }\r\n }\r\n\r\n return params;\r\n}\r\n\r\n/**\r\n * Generate all static paths for a route using getStaticPaths\r\n */\r\nexport function expandDynamicRoute(\r\n route: SSGRoute,\r\n staticPaths: Array<{ params: Record<string, string> }>\r\n): string[] {\r\n const paths: string[] = [];\r\n\r\n for (const { params } of staticPaths) {\r\n let expandedPath = route.path;\r\n\r\n for (const [key, value] of Object.entries(params)) {\r\n // Replace :param with value\r\n expandedPath = expandedPath.replace(`:${key}`, value);\r\n // Replace *param with value\r\n expandedPath = expandedPath.replace(`*${key}`, value);\r\n }\r\n\r\n paths.push(expandedPath);\r\n }\r\n\r\n return paths;\r\n}\r\n","/**\r\n * Virtual module generator for routes\r\n *\r\n * Generates the virtual:ssg-routes module that exports all routes\r\n * for use by the router.\r\n */\r\n\r\nimport type { SSGRoute, SSGConfig } from '../types';\r\nimport { scanPages } from './scanner';\r\n\r\n/**\r\n * Virtual module ID for SSG routes\r\n */\r\nexport const VIRTUAL_ROUTES_ID = 'virtual:ssg-routes';\r\nexport const RESOLVED_VIRTUAL_ROUTES_ID = '\\0' + VIRTUAL_ROUTES_ID;\r\n\r\n/**\r\n * Normalize file path to use forward slashes (for ES module imports)\r\n */\r\nfunction normalizePath(filePath: string): string {\r\n return filePath.replace(/\\\\/g, '/');\r\n}\r\n\r\n/**\r\n * Generate the virtual routes module code\r\n */\r\nexport function generateRoutesModule(routes: SSGRoute[], config: SSGConfig): string {\r\n const imports: string[] = [];\r\n const routeDefinitions: string[] = [];\r\n\r\n for (let i = 0; i < routes.length; i++) {\r\n const route = routes[i];\r\n const componentName = `Page${i}`;\r\n const metaName = `meta${i}`;\r\n const normalizedFile = normalizePath(route.file);\r\n\r\n // Import the full module to access both default export and named exports\r\n imports.push(`import * as ${componentName}Module from '${normalizedFile}';`);\r\n\r\n // Build meta from module exports with safe access (avoid Rollup warnings)\r\n // For TSX pages, meta is a named export\r\n // For MDX pages, frontmatter might be attached to the default export\r\n // Also include headings for table of contents (exported by MDX plugin)\r\n imports.push(\r\n `const ${metaName} = { ...('meta' in ${componentName}Module ? ${componentName}Module.meta : ${componentName}Module.default?.frontmatter || ${JSON.stringify(route.meta || {})}), headings: 'headings' in ${componentName}Module ? ${componentName}Module.headings : [] };`\r\n );\r\n imports.push(\r\n `const ${componentName} = ${componentName}Module.default || ${componentName}Module;`\r\n );\r\n\r\n routeDefinitions.push(`\r\n {\r\n path: '${route.path}',\r\n name: '${route.name}',\r\n file: '${normalizedFile}',\r\n component: ${componentName},\r\n meta: ${metaName},\r\n layout: ${metaName}.layout || '${config.defaultLayout || 'default'}',\r\n }`);\r\n }\r\n\r\n return `\r\n${imports.join('\\n')}\r\n\r\nconst routes = [${routeDefinitions.join(',')}\r\n];\r\n\r\nexport default routes;\r\n`;\r\n}\r\n\r\n/**\r\n * Generate lazy-loading routes module (for development with HMR)\r\n */\r\nexport function generateLazyRoutesModule(routes: SSGRoute[], config: SSGConfig): string {\r\n const imports: string[] = [];\r\n const routeDefinitions: string[] = [];\r\n\r\n for (let i = 0; i < routes.length; i++) {\r\n const route = routes[i];\r\n const componentName = `Page${i}`;\r\n const metaName = `meta${i}`;\r\n const normalizedFile = normalizePath(route.file);\r\n\r\n // Import the module to read meta/frontmatter for layout resolution\r\n imports.push(`import * as ${componentName}Module from '${normalizedFile}';`);\r\n // Build meta with safe access to avoid Rollup warnings about missing exports\r\n imports.push(\r\n `const ${metaName} = { ...('meta' in ${componentName}Module ? ${componentName}Module.meta : ${componentName}Module.default?.frontmatter || ${JSON.stringify(route.meta || {})}), headings: 'headings' in ${componentName}Module ? ${componentName}Module.headings : [] };`\r\n );\r\n\r\n routeDefinitions.push(`\r\n {\r\n path: '${route.path}',\r\n name: '${route.name}',\r\n file: '${normalizedFile}',\r\n component: () => import('${normalizedFile}'),\r\n meta: ${metaName},\r\n layout: ${metaName}.layout || '${config.defaultLayout || 'default'}',\r\n }`);\r\n }\r\n\r\n return `\r\n${imports.join('\\n')}\r\n\r\nconst routes = [${routeDefinitions.join(',')}\r\n];\r\n\r\nexport default routes;\r\n`;\r\n}\r\n\r\n/**\r\n * Create a module loader for routes\r\n */\r\nexport async function loadRoutesModule(\r\n config: SSGConfig,\r\n root: string\r\n): Promise<{ routes: SSGRoute[]; code: string }> {\r\n const routes = await scanPages(config, root);\r\n const code = generateRoutesModule(routes, config);\r\n\r\n return { routes, code };\r\n}\r\n","/**\r\n * Navigation generator for SSG\r\n *\r\n * Generates navigation structure from scanned routes based on\r\n * page frontmatter (category, order) or explicit configuration.\r\n */\r\n\r\nimport type { SSGRoute, SSGConfig, NavSection, NavItem, PageMeta, CollectionConfig } from '../types';\r\n\r\n/**\r\n * Collection navigation result\r\n */\r\nexport interface CollectionNavigation {\r\n sidebar: NavSection[];\r\n}\r\n\r\n/**\r\n * Internal type for building navigation tree\r\n */\r\ninterface NavBuildContext {\r\n categories: Map<string, NavBuildCategory>;\r\n uncategorized: NavBuildItem[];\r\n}\r\n\r\ninterface NavBuildCategory {\r\n title: string;\r\n order: number | undefined;\r\n items: NavBuildItem[];\r\n children: Map<string, NavBuildCategory>;\r\n}\r\n\r\ninterface NavBuildItem {\r\n title: string;\r\n href: string;\r\n order: number;\r\n}\r\n\r\n/**\r\n * Generate navigation structure from routes for a specific collection path\r\n *\r\n * @param routes - Scanned SSG routes\r\n * @param collectionPath - Path prefix for the collection (e.g., '/docs')\r\n * @param showDrafts - Whether to show draft pages\r\n * @param isDev - Whether running in development mode\r\n */\r\nexport function generateNavigation(\r\n routes: SSGRoute[],\r\n collectionPath: string,\r\n showDrafts: 'dev' | 'never',\r\n isDev: boolean\r\n): CollectionNavigation {\r\n // Filter routes for navigation\r\n const navRoutes = routes.filter((route) => {\r\n // Must be under collection path\r\n if (!route.path.startsWith(collectionPath)) {\r\n return false;\r\n }\r\n\r\n const meta = route.meta || {};\r\n\r\n // Check sidebar flag (default true)\r\n if (meta.sidebar === false) {\r\n return false;\r\n }\r\n\r\n // Handle draft pages\r\n if (meta.draft) {\r\n if (showDrafts === 'never') {\r\n return false;\r\n }\r\n if (showDrafts === 'dev' && !isDev) {\r\n return false;\r\n }\r\n }\r\n\r\n return true;\r\n });\r\n\r\n // Build navigation structure\r\n const context: NavBuildContext = {\r\n categories: new Map(),\r\n uncategorized: [],\r\n };\r\n\r\n for (const route of navRoutes) {\r\n const meta = route.meta || {};\r\n const title = meta.title || routeToTitle(route.path);\r\n const order = typeof meta.order === 'number' ? meta.order : 999;\r\n const category = meta.category;\r\n\r\n const item: NavBuildItem = {\r\n title,\r\n href: route.path,\r\n order,\r\n };\r\n\r\n if (!category) {\r\n // No category - add to uncategorized\r\n context.uncategorized.push(item);\r\n } else if (typeof category === 'string') {\r\n // Single category\r\n addToCategory(context.categories, [category], item);\r\n } else if (Array.isArray(category)) {\r\n // Nested categories\r\n addToCategory(context.categories, category, item);\r\n }\r\n }\r\n\r\n // Convert to NavSection array\r\n const sidebar = buildSections(context);\r\n\r\n return { sidebar };\r\n}\r\n\r\n/**\r\n * Add an item to a nested category structure\r\n */\r\nfunction addToCategory(\r\n categories: Map<string, NavBuildCategory>,\r\n path: string[],\r\n item: NavBuildItem\r\n): void {\r\n if (path.length === 0) {\r\n return;\r\n }\r\n\r\n const [first, ...rest] = path;\r\n\r\n let category = categories.get(first);\r\n if (!category) {\r\n category = {\r\n title: first,\r\n order: undefined,\r\n items: [],\r\n children: new Map(),\r\n };\r\n categories.set(first, category);\r\n }\r\n\r\n if (rest.length === 0) {\r\n // This is the target category\r\n category.items.push(item);\r\n } else {\r\n // Recurse into children\r\n addToCategory(category.children, rest, item);\r\n }\r\n}\r\n\r\n/**\r\n * Common section ordering for navigation\r\n * Used for both top-level sections and nested categories\r\n */\r\nconst SECTION_ORDER: Record<string, number> = {\r\n 'Getting Started': 10,\r\n 'Core Concepts': 20,\r\n 'Core': 20,\r\n 'Built-in Components': 30,\r\n 'Components': 30,\r\n 'Guides': 40,\r\n 'Advanced': 50,\r\n 'Ecosystem': 60,\r\n 'API Reference': 70,\r\n 'API': 70,\r\n 'Reference': 80,\r\n // DaisyUI component categories (matching DaisyUI website)\r\n 'Actions': 100,\r\n 'Data Display': 110,\r\n 'Navigation': 120,\r\n 'Feedback': 130,\r\n 'Data Input': 140,\r\n 'Layout': 150,\r\n 'Mockup': 160,\r\n 'Other': 999,\r\n};\r\n\r\n/**\r\n * Get sort order for a section/category title\r\n */\r\nfunction getSectionOrder(title: string, explicitOrder?: number): number {\r\n if (explicitOrder !== undefined) {\r\n return explicitOrder;\r\n }\r\n return SECTION_ORDER[title] ?? 50;\r\n}\r\n\r\n/**\r\n * Build NavSection array from context\r\n */\r\nfunction buildSections(context: NavBuildContext): NavSection[] {\r\n const sections: NavSection[] = [];\r\n\r\n // Add categorized items\r\n for (const [, category] of context.categories) {\r\n sections.push(buildSection(category));\r\n }\r\n\r\n // Add uncategorized items as a section if any exist\r\n if (context.uncategorized.length > 0) {\r\n sections.push({\r\n title: 'Other',\r\n items: context.uncategorized\r\n .sort((a, b) => a.order - b.order || a.title.localeCompare(b.title))\r\n .map((item) => ({\r\n title: item.title,\r\n href: item.href,\r\n order: item.order,\r\n })),\r\n order: 999,\r\n });\r\n }\r\n\r\n sections.sort((a, b) => {\r\n const orderA = getSectionOrder(a.title, a.order);\r\n const orderB = getSectionOrder(b.title, b.order);\r\n return orderA - orderB;\r\n });\r\n\r\n return sections;\r\n}\r\n\r\n/**\r\n * Build a NavSection from a category\r\n */\r\nfunction buildSection(category: NavBuildCategory): NavSection {\r\n // Sort items\r\n const sortedItems = category.items\r\n .sort((a, b) => a.order - b.order || a.title.localeCompare(b.title))\r\n .map((item) => ({\r\n title: item.title,\r\n href: item.href,\r\n order: item.order,\r\n }));\r\n\r\n // Build nested children\r\n const childSections: NavItem[] = [];\r\n for (const [, child] of category.children) {\r\n childSections.push(buildNestedSection(child));\r\n }\r\n\r\n // Merge items and child sections\r\n const items: NavItem[] = [...sortedItems];\r\n\r\n // Add nested sections as groups, sorted by section order\r\n for (const nested of childSections.sort((a, b) => {\r\n const orderA = getSectionOrder(a.title, a.order);\r\n const orderB = getSectionOrder(b.title, b.order);\r\n return orderA - orderB;\r\n })) {\r\n items.push(nested);\r\n }\r\n\r\n return {\r\n title: category.title,\r\n items,\r\n order: category.order,\r\n };\r\n}\r\n\r\n/**\r\n * Build a nested NavItem from a child category\r\n */\r\nfunction buildNestedSection(category: NavBuildCategory): NavItem {\r\n const sortedItems = category.items\r\n .sort((a, b) => a.order - b.order || a.title.localeCompare(b.title))\r\n .map((item) => ({\r\n title: item.title,\r\n href: item.href,\r\n order: item.order,\r\n }));\r\n\r\n // Recursively build children\r\n const childItems: NavItem[] = [];\r\n for (const [, child] of category.children) {\r\n childItems.push(buildNestedSection(child));\r\n }\r\n\r\n return {\r\n title: category.title,\r\n items: [...sortedItems, ...childItems.sort((a, b) => (a.order ?? 0) - (b.order ?? 0))],\r\n order: category.order,\r\n };\r\n}\r\n\r\n/**\r\n * Convert route path to a display title\r\n *\r\n * @example '/docs/getting-started' -> 'Getting Started'\r\n * @example '/docs/api/router' -> 'Router'\r\n */\r\nfunction routeToTitle(routePath: string): string {\r\n const segments = routePath.split('/').filter(Boolean);\r\n const lastSegment = segments[segments.length - 1] || 'Home';\r\n\r\n return lastSegment\r\n .replace(/-/g, ' ')\r\n .replace(/\\b\\w/g, (c) => c.toUpperCase());\r\n}\r\n\r\n/**\r\n * Merge explicit sidebar config with auto-generated navigation\r\n */\r\nexport function mergeNavigation(\r\n autoGenerated: NavSection[],\r\n explicit: NavSection[]\r\n): NavSection[] {\r\n const merged = new Map<string, NavSection>();\r\n\r\n // Add auto-generated first\r\n for (const section of autoGenerated) {\r\n merged.set(section.title, section);\r\n }\r\n\r\n // Override/add explicit sections\r\n for (const section of explicit) {\r\n if (merged.has(section.title)) {\r\n // Merge items\r\n const existing = merged.get(section.title)!;\r\n merged.set(section.title, {\r\n ...existing,\r\n ...section,\r\n items: [...existing.items, ...section.items],\r\n });\r\n } else {\r\n merged.set(section.title, section);\r\n }\r\n }\r\n\r\n return Array.from(merged.values());\r\n}\r\n\r\n/**\r\n * Generate navigation for all collections\r\n *\r\n * @param routes - Scanned SSG routes\r\n * @param config - SSG configuration\r\n * @param isDev - Whether running in development mode\r\n * @returns Record mapping collection names to their navigation\r\n */\r\nexport function generateAllCollections(\r\n routes: SSGRoute[],\r\n config: SSGConfig,\r\n isDev: boolean\r\n): Record<string, CollectionNavigation> {\r\n const collections = config.collections || {};\r\n const result: Record<string, CollectionNavigation> = {};\r\n\r\n for (const [name, collectionConfig] of Object.entries(collections)) {\r\n const showDrafts = collectionConfig.showDrafts ?? config.navigation?.showDrafts ?? 'dev';\r\n result[name] = generateNavigation(routes, collectionConfig.path, showDrafts, isDev);\r\n }\r\n\r\n return result;\r\n}\r\n\r\n/**\r\n * Detect which collection a route path belongs to\r\n *\r\n * @param path - Current route path\r\n * @param collections - Collections configuration\r\n * @returns The collection name if found, undefined otherwise\r\n */\r\nexport function detectCollection(\r\n path: string,\r\n collections: Record<string, CollectionConfig>\r\n): string | undefined {\r\n // Sort by path length descending to match most specific path first\r\n const sorted = Object.entries(collections).sort(\r\n ([, a], [, b]) => b.path.length - a.path.length\r\n );\r\n\r\n for (const [name, config] of sorted) {\r\n if (path.startsWith(config.path)) {\r\n return name;\r\n }\r\n }\r\n\r\n return undefined;\r\n}\r\n","/**\r\n * Virtual module generator for navigation\r\n *\r\n * Generates the virtual:ssg-navigation module that exports\r\n * the navigation structure for all collections.\r\n */\r\n\r\nimport type { SSGConfig, NavSection, NavItem, CollectionConfig } from '../types';\r\nimport type { SSGRoute } from '../types';\r\nimport { generateAllCollections, detectCollection as detectCollectionImpl, CollectionNavigation } from './navigation';\r\n\r\n/**\r\n * Virtual module ID for SSG navigation\r\n */\r\nexport const VIRTUAL_NAVIGATION_ID = 'virtual:ssg-navigation';\r\nexport const RESOLVED_VIRTUAL_NAVIGATION_ID = '\\0' + VIRTUAL_NAVIGATION_ID;\r\n\r\n/**\r\n * Navigation module result type\r\n */\r\nexport interface NavigationModule {\r\n /** Navigation keyed by collection name */\r\n navigation: Record<string, CollectionNavigation>;\r\n /** Collections configuration for path detection */\r\n collections: Record<string, CollectionConfig>;\r\n}\r\n\r\n/**\r\n * Generate the virtual navigation module code\r\n *\r\n * @param routes - Scanned SSG routes with metadata\r\n * @param config - SSG configuration\r\n * @param isDev - Whether running in development mode\r\n */\r\nexport function generateNavigationModule(\r\n routes: SSGRoute[],\r\n config: SSGConfig,\r\n isDev: boolean\r\n): string {\r\n const navigation = generateAllCollections(routes, config, isDev);\r\n const collections = config.collections || {};\r\n\r\n // Serialize navigation and collections to JSON\r\n const navJson = JSON.stringify(navigation, null, 2);\r\n const collectionsJson = JSON.stringify(collections, null, 2);\r\n\r\n return `\r\n/**\r\n * Auto-generated navigation module\r\n * \r\n * @generated by @sigx/ssg\r\n */\r\n\r\n/**\r\n * Navigation for all collections, keyed by collection name\r\n */\r\nexport const navigation = ${navJson};\r\n\r\n/**\r\n * Collections configuration\r\n */\r\nconst collections = ${collectionsJson};\r\n\r\n/**\r\n * Get navigation for a specific collection\r\n * @param name - Collection name (e.g., 'docs', 'examples')\r\n * @returns The collection's navigation or undefined if not found\r\n */\r\nexport function getCollectionNav(name) {\r\n return navigation[name];\r\n}\r\n\r\n/**\r\n * Detect which collection a route path belongs to\r\n * @param path - Current route path\r\n * @returns The collection name if found, undefined otherwise\r\n */\r\nexport function detectCollection(path) {\r\n // Sort by path length descending to match most specific path first\r\n const sorted = Object.entries(collections).sort(\r\n ([, a], [, b]) => b.path.length - a.path.length\r\n );\r\n\r\n for (const [name, config] of sorted) {\r\n if (path.startsWith(config.path)) {\r\n return name;\r\n }\r\n }\r\n\r\n return undefined;\r\n}\r\n\r\n/**\r\n * Get sidebar for a specific collection\r\n * @param name - Collection name\r\n * @returns The sidebar array or empty array if not found\r\n */\r\nexport function getSidebar(name) {\r\n return navigation[name]?.sidebar || [];\r\n}\r\n\r\nexport default { navigation, collections, getCollectionNav, detectCollection, getSidebar };\r\n`;\r\n}\r\n\r\n/**\r\n * Create a loader for the navigation module\r\n */\r\nexport async function loadNavigationModule(\r\n routes: SSGRoute[],\r\n config: SSGConfig,\r\n isDev: boolean\r\n): Promise<{ navigation: Record<string, CollectionNavigation>; code: string }> {\r\n const navigation = generateAllCollections(routes, config, isDev);\r\n const code = generateNavigationModule(routes, config, isDev);\r\n return { navigation, code };\r\n}\r\n","/**\r\n * Layout resolver\r\n *\r\n * Resolves layouts from local layouts directory or theme packages.\r\n * Layouts wrap page content and provide consistent structure.\r\n */\r\n\r\nimport fg from 'fast-glob';\r\nimport path from 'node:path';\r\nimport fs from 'node:fs';\r\nimport type { SSGConfig, LayoutModule, ThemeModule } from '../types';\r\n\r\n/**\r\n * Discovered layout information\r\n */\r\nexport interface LayoutInfo {\r\n /**\r\n * Layout name (e.g., 'default', 'docs', 'blog')\r\n */\r\n name: string;\r\n\r\n /**\r\n * Absolute file path to the layout component\r\n */\r\n file: string;\r\n\r\n /**\r\n * Source: 'local' or theme package name\r\n */\r\n source: string;\r\n}\r\n\r\n/**\r\n * Layout extensions to search for\r\n */\r\nconst LAYOUT_EXTENSIONS = ['.tsx', '.jsx'];\r\n\r\n/**\r\n * Scan local layouts directory\r\n */\r\nexport async function scanLocalLayouts(config: SSGConfig, root: string): Promise<LayoutInfo[]> {\r\n const layoutsDir = path.resolve(root, config.layouts || 'src/layouts');\r\n\r\n if (!fs.existsSync(layoutsDir)) {\r\n return [];\r\n }\r\n\r\n const patterns = LAYOUT_EXTENSIONS.map((ext) => `*${ext}`);\r\n const files = await fg(patterns, {\r\n cwd: layoutsDir,\r\n onlyFiles: true,\r\n absolute: false,\r\n });\r\n\r\n return files.map((file) => {\r\n const ext = path.extname(file);\r\n const name = file.slice(0, -ext.length);\r\n\r\n return {\r\n name,\r\n file: path.join(layoutsDir, file),\r\n source: 'local',\r\n };\r\n });\r\n}\r\n\r\n/**\r\n * Load layouts from a theme package\r\n */\r\nexport async function loadThemeLayouts(themeName: string, root: string): Promise<LayoutInfo[]> {\r\n try {\r\n // Import theme package from the project's context\r\n // Use createRequire to resolve from the project root\r\n const { createRequire } = await import('node:module');\r\n const { pathToFileURL } = await import('node:url');\r\n const require = createRequire(path.join(root, 'package.json'));\r\n \r\n // Resolve the theme package directory from the project\r\n // Use require.resolve with the package.json to get the package directory\r\n const themePackageJson = require.resolve(`${themeName}/package.json`);\r\n const themeDir = path.dirname(themePackageJson);\r\n \r\n // Read the package.json to find the main export\r\n const packageJson = JSON.parse(fs.readFileSync(themePackageJson, 'utf-8'));\r\n const mainFile = packageJson.exports?.['.']?.import || packageJson.main || './dist/index.js';\r\n const themePath = path.resolve(themeDir, mainFile);\r\n \r\n const themeModule = (await import(pathToFileURL(themePath).href)) as ThemeModule;\r\n\r\n if (!themeModule.layouts) {\r\n return [];\r\n }\r\n\r\n // Theme layouts are already loaded as components\r\n // We need to create virtual files for them\r\n return Object.keys(themeModule.layouts).map((name) => ({\r\n name,\r\n file: `${themeName}/layouts/${name}`,\r\n source: themeName,\r\n }));\r\n } catch (err) {\r\n console.warn(`Failed to load theme ${themeName}:`, err);\r\n return [];\r\n }\r\n}\r\n\r\n/**\r\n * Discover all available layouts\r\n *\r\n * Priority order:\r\n * 1. Local layouts (can override theme)\r\n * 2. Theme layouts\r\n */\r\nexport async function discoverLayouts(config: SSGConfig, root: string): Promise<LayoutInfo[]> {\r\n const layouts: Map<string, LayoutInfo> = new Map();\r\n\r\n // Load theme layouts first (can be overridden)\r\n if (config.theme) {\r\n const themeLayouts = await loadThemeLayouts(config.theme, root);\r\n for (const layout of themeLayouts) {\r\n layouts.set(layout.name, layout);\r\n }\r\n }\r\n\r\n // Load local layouts (override theme)\r\n const localLayouts = await scanLocalLayouts(config, root);\r\n for (const layout of localLayouts) {\r\n layouts.set(layout.name, layout);\r\n }\r\n\r\n return Array.from(layouts.values());\r\n}\r\n\r\n/**\r\n * Get the default layout\r\n */\r\nexport function getDefaultLayout(layouts: LayoutInfo[], config: SSGConfig): LayoutInfo | null {\r\n const defaultName = config.defaultLayout || 'default';\r\n return layouts.find((l) => l.name === defaultName) || layouts[0] || null;\r\n}\r\n\r\n/**\r\n * Find a layout by name\r\n */\r\nexport function findLayout(layouts: LayoutInfo[], name: string): LayoutInfo | null {\r\n return layouts.find((l) => l.name === name) || null;\r\n}\r\n","/**\r\n * Virtual module generator for layouts\r\n *\r\n * Generates the virtual:generated-layouts module that provides\r\n * layout components and the setupLayouts function.\r\n * \r\n * IMPORTANT: Layouts are designed to persist across navigation.\r\n * Instead of wrapping each route with a layout component (which causes\r\n * full re-renders on navigation), we use a shared LayoutRouter component\r\n * that maintains the layout and only updates the page content reactively.\r\n */\r\n\r\nimport type { SSGConfig, SSGRoute } from '../types';\r\nimport type { LayoutInfo } from './resolver';\r\nimport { discoverLayouts } from './resolver';\r\n\r\n// Note: The generated virtual module imports component from sigx\r\n\r\n/**\r\n * Virtual module ID for generated layouts\r\n */\r\nexport const VIRTUAL_LAYOUTS_ID = 'virtual:generated-layouts';\r\nexport const RESOLVED_VIRTUAL_LAYOUTS_ID = '\\0virtual:generated-layouts';\r\n\r\n/**\r\n * Normalize file path to use forward slashes (for ES module imports)\r\n */\r\nfunction normalizePath(filePath: string): string {\r\n return filePath.replace(/\\\\/g, '/');\r\n}\r\n\r\n/**\r\n * Generate the virtual layouts module code\r\n */\r\nexport function generateLayoutsModule(layouts: LayoutInfo[], config: SSGConfig): string {\r\n const imports: string[] = [];\r\n const layoutEntries: string[] = [];\r\n\r\n for (let i = 0; i < layouts.length; i++) {\r\n const layout = layouts[i];\r\n const importName = `Layout${i}`;\r\n\r\n // Handle theme vs local layouts differently\r\n if (layout.source === 'local') {\r\n const normalizedFile = normalizePath(layout.file);\r\n imports.push(`import ${importName} from '${normalizedFile}';`);\r\n } else {\r\n // Theme layout - import from theme package\r\n imports.push(`import { layouts as themeLayouts${i} } from '${layout.source}';`);\r\n imports.push(`const ${importName} = themeLayouts${i}['${layout.name}'];`);\r\n }\r\n\r\n layoutEntries.push(` '${layout.name}': ${importName}.default || ${importName}`);\r\n }\r\n\r\n return `\r\nimport { component, signal, jsx } from 'sigx';\r\nimport { useRoute } from '@sigx/router';\r\n${imports.join('\\n')}\r\n\r\n/**\r\n * All available layouts\r\n */\r\nexport const layouts = {\r\n${layoutEntries.join(',\\n')}\r\n};\r\n\r\n/**\r\n * Default layout name\r\n */\r\nexport const defaultLayout = '${config.defaultLayout || 'default'}';\r\n\r\n/**\r\n * Check if a component is marked as lazy (created by lazy())\r\n */\r\nfunction isMarkedLazy(component) {\r\n return component && component.__lazy === true;\r\n}\r\n\r\n/**\r\n * Check if a value is a Promise/thenable\r\n */\r\nfunction isPromise(value) {\r\n return value && typeof value.then === 'function';\r\n}\r\n\r\n/**\r\n * Track hydration state - we're hydrating if the app container has SSR content\r\n */\r\nlet isHydrating = typeof window !== 'undefined' && \r\n document.getElementById('app')?.innerHTML?.trim().length > 0;\r\n\r\n// After first render, we're no longer hydrating\r\nif (typeof window !== 'undefined') {\r\n const markHydrationComplete = () => { isHydrating = false; };\r\n if ('requestIdleCallback' in window) {\r\n window.requestIdleCallback(markHydrationComplete);\r\n } else {\r\n setTimeout(markHydrationComplete, 0);\r\n }\r\n}\r\n\r\n/**\r\n * Placeholder component that preserves existing DOM during hydration.\r\n */\r\nconst HydrationPlaceholder = component(() => {\r\n return () => null;\r\n}, { name: 'HydrationPlaceholder' });\r\n\r\n/**\r\n * Layout router component that preserves layouts across navigation.\r\n * \r\n * This component renders the current route's layout and page content reactively.\r\n * When navigating between routes with the same layout, only the page content\r\n * updates - the layout (Navbar, Sidebar, Footer) persists without re-rendering.\r\n */\r\nexport const LayoutRouter = component((ctx) => {\r\n const route = useRoute();\r\n \r\n // Track loaded lazy components to avoid reloading\r\n const loadedComponents = {};\r\n \r\n // Track if this is the initial hydration render\r\n let initialRender = true;\r\n \r\n // HMR support: Listen for MDX updates and clear the component cache\r\n if (typeof window !== 'undefined' && import.meta.hot) {\r\n // Listen for sigx:mdx-hmr events dispatched by MDX files after they accept HMR\r\n const handleMdxHmr = (event) => {\r\n const { moduleId, newModule } = event.detail || {};\r\n \r\n // Clear all cached components to force reload with new module\r\n for (const key in loadedComponents) {\r\n delete loadedComponents[key];\r\n }\r\n \r\n // If we have the new module directly from HMR, cache it for the matching route\r\n if (newModule?.default) {\r\n const currentPath = route.path;\r\n loadedComponents[currentPath] = newModule.default;\r\n }\r\n \r\n // Force re-render\r\n ctx.update();\r\n };\r\n \r\n window.addEventListener('sigx:mdx-hmr', handleMdxHmr);\r\n \r\n ctx.onUnmounted(() => {\r\n window.removeEventListener('sigx:mdx-hmr', handleMdxHmr);\r\n });\r\n }\r\n \r\n return () => {\r\n const matched = route.matched;\r\n if (!matched || matched.length === 0) return null;\r\n \r\n const match = matched[0];\r\n if (!match) return null;\r\n \r\n // Get layout name from route meta or use default\r\n const layoutName = match.layout || match.meta?.layout || defaultLayout;\r\n const Layout = layouts[layoutName];\r\n \r\n if (!Layout) {\r\n console.warn(\\`Layout \"\\${layoutName}\" not found for route \\${route.path}\\`);\r\n return null;\r\n }\r\n \r\n // Get the original (unwrapped) component\r\n const rawComponent = match.originalComponent || match.component;\r\n const routePath = route.path;\r\n \r\n // Handle lazy/dynamic import components\r\n if (isMarkedLazy(rawComponent) || (typeof rawComponent === 'function' && !rawComponent.__setup)) {\r\n // Check if already loaded\r\n if (loadedComponents[routePath]) {\r\n const PageComponent = loadedComponents[routePath];\r\n initialRender = false;\r\n return jsx(Layout, { \r\n meta: match.meta, \r\n path: routePath, \r\n key: layoutName, // Key by layout to preserve layout across pages\r\n children: PageComponent({}) \r\n });\r\n }\r\n \r\n // Load the component\r\n const loadState = signal({ value: null, loading: true, error: null });\r\n \r\n try {\r\n const result = rawComponent();\r\n if (isPromise(result)) {\r\n result.then(module => {\r\n const Component = module.default || module;\r\n loadedComponents[routePath] = Component;\r\n loadState.value = Component;\r\n loadState.loading = false;\r\n }).catch(err => {\r\n console.error('Failed to load component for route:', routePath, err);\r\n loadState.error = err;\r\n loadState.loading = false;\r\n });\r\n } else {\r\n // Not a promise, use directly\r\n loadedComponents[routePath] = rawComponent;\r\n loadState.value = rawComponent;\r\n loadState.loading = false;\r\n }\r\n } catch (err) {\r\n loadState.error = err;\r\n loadState.loading = false;\r\n }\r\n \r\n // During hydration, preserve existing SSR content instead of showing loading state\r\n if (loadState.loading) {\r\n if (isHydrating && initialRender) {\r\n return jsx(Layout, { \r\n meta: match.meta, \r\n path: routePath, \r\n key: layoutName,\r\n children: jsx(HydrationPlaceholder, {})\r\n });\r\n }\r\n return jsx(Layout, { \r\n meta: match.meta, \r\n path: routePath, \r\n key: layoutName,\r\n children: null \r\n });\r\n }\r\n \r\n if (loadState.error || !loadState.value) {\r\n return jsx(Layout, { \r\n meta: match.meta, \r\n path: routePath, \r\n key: layoutName,\r\n children: null \r\n });\r\n }\r\n \r\n const PageComponent = loadState.value;\r\n initialRender = false;\r\n return jsx(Layout, { \r\n meta: match.meta, \r\n path: routePath, \r\n key: layoutName,\r\n children: PageComponent({}) \r\n });\r\n }\r\n \r\n // Eager component (has __setup)\r\n // Check cache first for HMR-updated components\r\n if (loadedComponents[routePath]) {\r\n const PageComponent = loadedComponents[routePath];\r\n initialRender = false;\r\n return jsx(Layout, { \r\n meta: match.meta, \r\n path: routePath, \r\n key: layoutName,\r\n children: PageComponent({}) \r\n });\r\n }\r\n \r\n initialRender = false;\r\n return jsx(Layout, { \r\n meta: match.meta, \r\n path: routePath, \r\n key: layoutName,\r\n children: rawComponent({}) \r\n });\r\n };\r\n}, { name: 'LayoutRouter' });\r\n\r\n/**\r\n * Setup layouts for routes\r\n *\r\n * This function now simply annotates routes with their layout information.\r\n * The actual layout wrapping is handled by LayoutRouter, which preserves\r\n * layouts across navigation.\r\n */\r\nexport function setupLayouts(routes) {\r\n const availableLayoutNames = Object.keys(layouts);\r\n \r\n return routes.map(route => {\r\n const layoutName = route.layout || route.meta?.layout || defaultLayout;\r\n const Layout = layouts[layoutName];\r\n\r\n if (!Layout) {\r\n console.error(\r\n \\`❌ SSG103: Layout \"\\${layoutName}\" not found for route \\${route.path}\\\\n\\` +\r\n \\` 📁 \\${route.file || 'unknown'}\\\\n\\` +\r\n \\` 💡 Available layouts: \\${availableLayoutNames.join(', ') || 'none'}\\\\n\\` +\r\n \\` Create src/layouts/\\${layoutName}.tsx or set a valid layout in frontmatter.\\`\r\n );\r\n return route;\r\n }\r\n\r\n // Store layout info on the route, but don't wrap the component\r\n // LayoutRouter will handle layout rendering\r\n return {\r\n ...route,\r\n layout: layoutName,\r\n originalComponent: route.component,\r\n meta: {\r\n ...route.meta,\r\n layout: layoutName,\r\n },\r\n };\r\n });\r\n}\r\n\r\nexport default layouts;\r\n`;\r\n}\r\n\r\n/**\r\n * Generate a simpler layouts module for theme-only setups\r\n */\r\nexport function generateThemeLayoutsModule(themeName: string, config: SSGConfig): string {\r\n return `\r\nimport { component, signal, jsx } from 'sigx';\r\nimport { useRoute } from '@sigx/router';\r\nimport { layouts as themeLayouts, config as themeConfig } from '${themeName}';\r\n\r\nexport const layouts = themeLayouts || {};\r\nexport const defaultLayout = '${config.defaultLayout}' || themeConfig?.defaultLayout || 'default';\r\n\r\n/**\r\n * Check if a component is marked as lazy (created by lazy())\r\n */\r\nfunction isMarkedLazy(component) {\r\n return component && component.__lazy === true;\r\n}\r\n\r\n/**\r\n * Check if a value is a Promise/thenable\r\n */\r\nfunction isPromise(value) {\r\n return value && typeof value.then === 'function';\r\n}\r\n\r\n/**\r\n * Layout router component that preserves layouts across navigation.\r\n */\r\nexport const LayoutRouter = component((ctx) => {\r\n const route = useRoute();\r\n const loadedComponents = {};\r\n \r\n // HMR support: Listen for MDX updates and clear the component cache\r\n if (typeof window !== 'undefined' && import.meta.hot) {\r\n const handleMdxHmr = (event) => {\r\n for (const key in loadedComponents) {\r\n delete loadedComponents[key];\r\n }\r\n ctx.update();\r\n };\r\n \r\n window.addEventListener('sigx:mdx-hmr', handleMdxHmr);\r\n \r\n import.meta.hot.on('vite:beforeUpdate', (payload) => {\r\n const hasMdxUpdate = payload.updates?.some(update => \r\n update.path?.endsWith('.mdx') || update.path?.endsWith('.md')\r\n );\r\n if (hasMdxUpdate) {\r\n for (const key in loadedComponents) {\r\n delete loadedComponents[key];\r\n }\r\n }\r\n });\r\n \r\n ctx.onUnmounted(() => {\r\n window.removeEventListener('sigx:mdx-hmr', handleMdxHmr);\r\n });\r\n }\r\n \r\n return () => {\r\n const matched = route.matched;\r\n if (!matched || matched.length === 0) return null;\r\n \r\n const match = matched[0];\r\n if (!match) return null;\r\n \r\n const layoutName = match.layout || match.meta?.layout || defaultLayout;\r\n const Layout = layouts[layoutName];\r\n \r\n if (!Layout) {\r\n console.warn(\\`Layout \"\\${layoutName}\" not found for route \\${route.path}\\`);\r\n return null;\r\n }\r\n \r\n const rawComponent = match.originalComponent || match.component;\r\n const routePath = route.path;\r\n \r\n // Handle lazy/dynamic import components\r\n if (isMarkedLazy(rawComponent) || (typeof rawComponent === 'function' && !rawComponent.__setup)) {\r\n if (loadedComponents[routePath]) {\r\n const PageComponent = loadedComponents[routePath];\r\n return jsx(Layout, { \r\n meta: match.meta, \r\n path: routePath, \r\n key: layoutName,\r\n children: PageComponent({}) \r\n });\r\n }\r\n \r\n const loadState = signal({ value: null, loading: true, error: null });\r\n \r\n try {\r\n const result = rawComponent();\r\n if (isPromise(result)) {\r\n result.then(module => {\r\n const Component = module.default || module;\r\n loadedComponents[routePath] = Component;\r\n loadState.value = Component;\r\n loadState.loading = false;\r\n }).catch(err => {\r\n console.error('Failed to load component:', routePath, err);\r\n loadState.error = err;\r\n loadState.loading = false;\r\n });\r\n } else {\r\n loadedComponents[routePath] = rawComponent;\r\n loadState.value = rawComponent;\r\n loadState.loading = false;\r\n }\r\n } catch (err) {\r\n loadState.error = err;\r\n loadState.loading = false;\r\n }\r\n \r\n if (loadState.loading) {\r\n return jsx(Layout, { meta: match.meta, path: routePath, key: layoutName, children: null });\r\n }\r\n if (loadState.error || !loadState.value) {\r\n return jsx(Layout, { meta: match.meta, path: routePath, key: layoutName, children: null });\r\n }\r\n \r\n return jsx(Layout, { \r\n meta: match.meta, \r\n path: routePath, \r\n key: layoutName,\r\n children: loadState.value({}) \r\n });\r\n }\r\n \r\n return jsx(Layout, { \r\n meta: match.meta, \r\n path: routePath, \r\n key: layoutName,\r\n children: rawComponent({}) \r\n });\r\n };\r\n}, { name: 'LayoutRouter' });\r\n\r\nexport function setupLayouts(routes) {\r\n return routes.map(route => {\r\n const layoutName = route.layout || route.meta?.layout || defaultLayout;\r\n const Layout = layouts[layoutName];\r\n\r\n if (!Layout) {\r\n console.warn(\\`Layout \"\\${layoutName}\" not found for route \\${route.path}\\`);\r\n return route;\r\n }\r\n\r\n return {\r\n ...route,\r\n layout: layoutName,\r\n originalComponent: route.component,\r\n meta: {\r\n ...route.meta,\r\n layout: layoutName,\r\n },\r\n };\r\n });\r\n}\r\n\r\nexport default layouts;\r\n`;\r\n}\r\n\r\n/**\r\n * Load and generate the layouts module\r\n */\r\nexport async function loadLayoutsModule(\r\n config: SSGConfig,\r\n root: string\r\n): Promise<{ layouts: LayoutInfo[]; code: string }> {\r\n const layouts = await discoverLayouts(config, root);\r\n const code = generateLayoutsModule(layouts, config);\r\n\r\n return { layouts, code };\r\n}\r\n","/**\r\n * Virtual Entry Point Generation\r\n * \r\n * Generates auto-configured client and server entry points for zero-config mode.\r\n * Users can override by providing their own entry files.\r\n */\r\n\r\nimport fs from 'node:fs';\r\nimport path from 'node:path';\r\nimport type { SSGConfig } from '../types';\r\n\r\n/**\r\n * Virtual module IDs\r\n * Note: We use a special path format that Vite can resolve from HTML\r\n */\r\nexport const VIRTUAL_CLIENT_ID = 'virtual:ssg-client';\r\nexport const RESOLVED_VIRTUAL_CLIENT_ID = '\\0' + VIRTUAL_CLIENT_ID + '.tsx';\r\n\r\n// Special entry path that can be used in HTML and resolved by the plugin\r\nexport const SSG_CLIENT_ENTRY_PATH = '/@ssg/client.tsx';\r\n\r\nexport const VIRTUAL_SERVER_ID = 'virtual:ssg-server';\r\nexport const RESOLVED_VIRTUAL_SERVER_ID = '\\0' + VIRTUAL_SERVER_ID + '.tsx';\r\n\r\nexport const VIRTUAL_HTML_ID = 'virtual:ssg-html';\r\nexport const RESOLVED_VIRTUAL_HTML_ID = '\\0' + VIRTUAL_HTML_ID;\r\n\r\n/**\r\n * Detection result for custom entry points\r\n */\r\nexport interface EntryDetectionResult {\r\n /** Whether to use virtual client entry */\r\n useVirtualClient: boolean;\r\n /** Whether to use virtual server entry */\r\n useVirtualServer: boolean;\r\n /** Whether to use virtual HTML template */\r\n useVirtualHtml: boolean;\r\n /** Path to custom client entry if found */\r\n customClientPath?: string;\r\n /** Path to custom server entry if found */\r\n customServerPath?: string;\r\n /** Path to custom HTML template if found */\r\n customHtmlPath?: string;\r\n /** Path to global CSS if found */\r\n globalCssPath?: string;\r\n}\r\n\r\n/**\r\n * Detect if user has custom entry points\r\n */\r\nexport function detectCustomEntries(root: string, config: SSGConfig): EntryDetectionResult {\r\n // Custom client entry paths (if found, user has custom setup)\r\n const clientPaths = [\r\n 'src/main.tsx',\r\n 'src/main.ts',\r\n 'src/entry-client.tsx',\r\n 'src/entry-client.ts',\r\n 'src/entry.tsx',\r\n 'src/entry.ts',\r\n ];\r\n\r\n const serverPaths = [\r\n 'src/entry-server.tsx',\r\n 'src/entry-server.ts',\r\n ];\r\n\r\n const htmlPaths = [\r\n 'index.html',\r\n ];\r\n\r\n // Global CSS to auto-import (checked in order of preference)\r\n const cssPaths = [\r\n 'src/styles/global.css',\r\n 'src/styles/main.css',\r\n 'src/styles/index.css',\r\n 'src/style.css',\r\n 'src/global.css',\r\n 'src/index.css',\r\n ];\r\n\r\n let customClientPath: string | undefined;\r\n let customServerPath: string | undefined;\r\n let customHtmlPath: string | undefined;\r\n let globalCssPath: string | undefined;\r\n\r\n // Check for custom client entry\r\n for (const p of clientPaths) {\r\n const fullPath = path.join(root, p);\r\n if (fs.existsSync(fullPath)) {\r\n customClientPath = fullPath;\r\n break;\r\n }\r\n }\r\n\r\n // Check for custom server entry\r\n for (const p of serverPaths) {\r\n const fullPath = path.join(root, p);\r\n if (fs.existsSync(fullPath)) {\r\n customServerPath = fullPath;\r\n break;\r\n }\r\n }\r\n\r\n // Check for custom HTML template\r\n for (const p of htmlPaths) {\r\n const fullPath = path.join(root, p);\r\n if (fs.existsSync(fullPath)) {\r\n customHtmlPath = fullPath;\r\n break;\r\n }\r\n }\r\n\r\n // Check for global CSS\r\n for (const p of cssPaths) {\r\n const fullPath = path.join(root, p);\r\n if (fs.existsSync(fullPath)) {\r\n globalCssPath = '/' + p.replace(/\\\\/g, '/');\r\n break;\r\n }\r\n }\r\n\r\n return {\r\n useVirtualClient: !customClientPath,\r\n useVirtualServer: !customServerPath,\r\n useVirtualHtml: !customHtmlPath,\r\n customClientPath,\r\n customServerPath,\r\n customHtmlPath,\r\n globalCssPath,\r\n };\r\n}\r\n\r\n/**\r\n * Generate virtual client entry code\r\n */\r\nexport function generateClientEntry(config: SSGConfig, detection: EntryDetectionResult): string {\r\n const cssImport = detection.globalCssPath\r\n ? `import '${detection.globalCssPath}';\\n`\r\n : '';\r\n\r\n // Additional client imports from config\r\n const additionalImports = (config.clientImports ?? [])\r\n .map(imp => `import '${imp}';`)\r\n .join('\\n');\r\n const additionalImportsBlock = additionalImports ? `\\n${additionalImports}\\n` : '';\r\n\r\n const prefetchDelay = typeof config.prefetch === 'object'\r\n ? config.prefetch.delay ?? 100\r\n : 100;\r\n\r\n const prefetchEnabled = config.prefetch !== false;\r\n\r\n return `/**\r\n * Auto-generated client entry point\r\n * This file is generated by @sigx/ssg when no custom entry is detected.\r\n * To customize, create src/main.tsx or src/entry-client.tsx\r\n */\r\n${cssImport}${additionalImportsBlock}\r\nimport { defineApp, component } from 'sigx';\r\nimport { createRouter, createWebHistory } from '@sigx/router';\r\nimport { ssrClientPlugin } from '@sigx/ssg/client';\r\nimport routes from 'virtual:ssg-routes';\r\nimport { setupLayouts, LayoutRouter } from 'virtual:generated-layouts';\r\n${prefetchEnabled ? `import { setupPrefetch } from '@sigx/ssg/client';` : ''}\r\n\r\n// Apply layouts to routes (annotates routes with layout info)\r\nconst layoutRoutes = setupLayouts(routes);\r\n\r\n// Create router with browser history\r\nconst router = createRouter({\r\n history: createWebHistory('${config.base || '/'}'),\r\n routes: layoutRoutes,\r\n});\r\n\r\n// Root app component - uses LayoutRouter which preserves layouts across navigation\r\nconst App = component(() => {\r\n return () => <LayoutRouter />;\r\n});\r\n\r\n// Hydrate the server-rendered HTML\r\ndefineApp(<App />)\r\n .use(router)\r\n .use(ssrClientPlugin)\r\n .hydrate('#app');\r\n\r\n${prefetchEnabled ? `// Enable link prefetching for faster navigation\r\nsetupPrefetch({ delay: ${prefetchDelay} });` : ''}\r\n`;\r\n}\r\n\r\n/**\r\n * Generate virtual server entry code\r\n */\r\nexport function generateServerEntry(config: SSGConfig): string {\r\n return `/**\r\n * Auto-generated server entry point\r\n * This file is generated by @sigx/ssg when no custom entry is detected.\r\n * To customize, create src/entry-server.tsx\r\n */\r\nimport { renderToString } from '@sigx/server-renderer/server';\r\nimport { defineApp } from 'sigx';\r\nimport { createRouter, createMemoryHistory } from '@sigx/router';\r\nimport routes from 'virtual:ssg-routes';\r\nimport { setupLayouts, LayoutRouter } from 'virtual:generated-layouts';\r\n\r\n// Pre-process routes with layouts once at module load time (not per-render)\r\nconst routesWithLayouts = setupLayouts(routes);\r\n\r\n/**\r\n * Render the app to HTML string for a given URL\r\n */\r\nexport async function render(url, context) {\r\n // Create router with memory history for SSR\r\n // Note: We must create a new router per render because history is URL-specific\r\n const router = createRouter({\r\n routes: routesWithLayouts,\r\n history: createMemoryHistory({ initialLocation: url || '/' }),\r\n });\r\n\r\n // Create app with router - router's install() sets up DI via app.defineProvide()\r\n const app = defineApp(<LayoutRouter />).use(router);\r\n \r\n const html = await renderToString(app);\r\n return html;\r\n}\r\n`;\r\n}\r\n\r\n/**\r\n * Generate virtual HTML template\r\n */\r\nexport function generateHtmlTemplate(config: SSGConfig): string {\r\n const site = config.site || {};\r\n const lang = site.lang || 'en';\r\n const title = site.title || 'SignalX App';\r\n const description = site.description || '';\r\n const favicon = site.favicon || '/favicon.ico';\r\n const themeColor = site.themeColor || '#000000';\r\n const ogImage = site.ogImage || '';\r\n const url = site.url || '';\r\n const twitter = site.twitter || '';\r\n const fonts = site.fonts || [];\r\n\r\n // Build font preconnect and stylesheet links\r\n let fontLinks = '';\r\n if (fonts.length > 0) {\r\n fontLinks = `\r\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\r\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin />\r\n <link href=\"https://fonts.googleapis.com/css2?family=${fonts.join('&family=')}&display=swap\" rel=\"stylesheet\" />`;\r\n }\r\n\r\n // Build OG meta tags\r\n let ogTags = '';\r\n if (url || ogImage) {\r\n ogTags = `\r\n <!-- Open Graph -->\r\n <meta property=\"og:type\" content=\"website\" />\r\n <meta property=\"og:title\" content=\"${title}\" />\r\n <meta property=\"og:description\" content=\"${description}\" />${url ? `\r\n <meta property=\"og:url\" content=\"${url}\" />` : ''}${ogImage ? `\r\n <meta property=\"og:image\" content=\"${ogImage}\" />` : ''}`;\r\n }\r\n\r\n // Build Twitter card tags\r\n let twitterTags = '';\r\n if (twitter || ogImage) {\r\n twitterTags = `\r\n <!-- Twitter Card -->\r\n <meta name=\"twitter:card\" content=\"${ogImage ? 'summary_large_image' : 'summary'}\" />${twitter ? `\r\n <meta name=\"twitter:site\" content=\"@${twitter}\" />` : ''}\r\n <meta name=\"twitter:title\" content=\"${title}\" />\r\n <meta name=\"twitter:description\" content=\"${description}\" />${ogImage ? `\r\n <meta name=\"twitter:image\" content=\"${ogImage}\" />` : ''}`;\r\n }\r\n\r\n return `<!DOCTYPE html>\r\n<html lang=\"${lang}\">\r\n<head>\r\n <meta charset=\"UTF-8\" />\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\r\n <meta name=\"description\" content=\"${description}\" />\r\n <meta name=\"theme-color\" content=\"${themeColor}\" />\r\n <link rel=\"icon\" type=\"image/x-icon\" href=\"${favicon}\" />${fontLinks}${ogTags}${twitterTags}\r\n <title>${title}</title>\r\n <!--head-tags-->\r\n</head>\r\n<body>\r\n <div id=\"app\"><!--app-html--></div>\r\n <script type=\"module\" src=\"/@ssg/client.tsx\"></script>\r\n</body>\r\n</html>\r\n`;\r\n}\r\n\r\n/**\r\n * Generate HTML template for production build\r\n * Uses the actual client entry path instead of virtual module\r\n */\r\nexport function generateProductionHtmlTemplate(config: SSGConfig, clientEntryPath: string): string {\r\n const site = config.site || {};\r\n const lang = site.lang || 'en';\r\n const title = site.title || 'SignalX App';\r\n const description = site.description || '';\r\n const favicon = site.favicon || '/favicon.ico';\r\n const themeColor = site.themeColor || '#000000';\r\n const ogImage = site.ogImage || '';\r\n const url = site.url || '';\r\n const twitter = site.twitter || '';\r\n const fonts = site.fonts || [];\r\n\r\n // Build font preconnect and stylesheet links\r\n let fontLinks = '';\r\n if (fonts.length > 0) {\r\n fontLinks = `\r\n <link rel=\"preconnect\" href=\"https://fonts.googleapis.com\" />\r\n <link rel=\"preconnect\" href=\"https://fonts.gstatic.com\" crossorigin />\r\n <link href=\"https://fonts.googleapis.com/css2?family=${fonts.join('&family=')}&display=swap\" rel=\"stylesheet\" />`;\r\n }\r\n\r\n // Build OG meta tags\r\n let ogTags = '';\r\n if (url || ogImage) {\r\n ogTags = `\r\n <!-- Open Graph -->\r\n <meta property=\"og:type\" content=\"website\" />\r\n <meta property=\"og:title\" content=\"${title}\" />\r\n <meta property=\"og:description\" content=\"${description}\" />${url ? `\r\n <meta property=\"og:url\" content=\"${url}\" />` : ''}${ogImage ? `\r\n <meta property=\"og:image\" content=\"${ogImage}\" />` : ''}`;\r\n }\r\n\r\n // Build Twitter card tags\r\n let twitterTags = '';\r\n if (twitter || ogImage) {\r\n twitterTags = `\r\n <!-- Twitter Card -->\r\n <meta name=\"twitter:card\" content=\"${ogImage ? 'summary_large_image' : 'summary'}\" />${twitter ? `\r\n <meta name=\"twitter:site\" content=\"@${twitter}\" />` : ''}\r\n <meta name=\"twitter:title\" content=\"${title}\" />\r\n <meta name=\"twitter:description\" content=\"${description}\" />${ogImage ? `\r\n <meta name=\"twitter:image\" content=\"${ogImage}\" />` : ''}`;\r\n }\r\n\r\n return `<!DOCTYPE html>\r\n<html lang=\"${lang}\">\r\n<head>\r\n <meta charset=\"UTF-8\" />\r\n <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\" />\r\n <meta name=\"description\" content=\"${description}\" />\r\n <meta name=\"theme-color\" content=\"${themeColor}\" />\r\n <link rel=\"icon\" type=\"image/x-icon\" href=\"${favicon}\" />${fontLinks}${ogTags}${twitterTags}\r\n <title>${title}</title>\r\n <!--head-tags-->\r\n</head>\r\n<body>\r\n <div id=\"app\"><!--app-html--></div>\r\n <script type=\"module\" src=\"${clientEntryPath}\"></script>\r\n</body>\r\n</html>\r\n`;\r\n}\r\n"],"mappings":";;;;AA0BA,SAAgB,gBAAgB,QAA8B;AAC1D,QAAO;EAEH,OAAO;EACP,SAAS;EACT,SAAS;EACT,eAAe;EACf,QAAQ;EACR,MAAM;EAEN,aAAa;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gDACA,YAAY,MAAM,UAAU;0CAClC,QAAQ,QAAQ;AAGtD,QAAO;cACG,KAAK;;;;wCAIqB,YAAY;wCACZ,WAAW;iDACF,QAAQ,MAAM,YAAY,SAAS,YAAY;aACnF,MAAM;;;;;iCAKc,gBAAgB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/vite/index.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAC9C,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* SSG Vite Plugin
|
|
3
|
+
*
|
|
4
|
+
* Main Vite plugin for @sigx/ssg that integrates:
|
|
5
|
+
* - File-based routing with virtual modules
|
|
6
|
+
* - Layout system
|
|
7
|
+
* - MDX processing
|
|
8
|
+
* - HMR for development
|
|
9
|
+
* - Zero-config entry point generation
|
|
10
|
+
*/
|
|
11
|
+
import type { Plugin } from 'vite';
|
|
12
|
+
import type { SSGConfig } from '../types';
|
|
13
|
+
/**
|
|
14
|
+
* SSG Plugin options
|
|
15
|
+
*/
|
|
16
|
+
export interface SSGPluginOptions extends Partial<SSGConfig> {
|
|
17
|
+
/**
|
|
18
|
+
* Path to ssg.config.ts
|
|
19
|
+
*/
|
|
20
|
+
configPath?: string;
|
|
21
|
+
/**
|
|
22
|
+
* Enable built-in MDX processing. Set to false if using external MDX plugin.
|
|
23
|
+
* @default true
|
|
24
|
+
*/
|
|
25
|
+
enableMdx?: boolean;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Create the SSG Vite plugin
|
|
29
|
+
*/
|
|
30
|
+
export declare function ssgPlugin(options?: SSGPluginOptions): Plugin[];
|
|
31
|
+
/**
|
|
32
|
+
* Export the plugin as default
|
|
33
|
+
*/
|
|
34
|
+
export default ssgPlugin;
|
|
35
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../src/vite/plugin.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,KAAK,EAAE,MAAM,EAAiC,MAAM,MAAM,CAAC;AAGlE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAsB1C;;GAEG;AACH,MAAM,WAAW,gBAAiB,SAAQ,OAAO,CAAC,SAAS,CAAC;IACxD;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,SAAS,CAAC,EAAE,OAAO,CAAC;CACvB;AAQD;;GAEG;AACH,wBAAgB,SAAS,CAAC,OAAO,GAAE,gBAAqB,GAAG,MAAM,EAAE,CA8SlE;AAED;;GAEG;AACH,eAAe,SAAS,CAAC"}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Virtual Entry Point Generation
|
|
3
|
+
*
|
|
4
|
+
* Generates auto-configured client and server entry points for zero-config mode.
|
|
5
|
+
* Users can override by providing their own entry files.
|
|
6
|
+
*/
|
|
7
|
+
import type { SSGConfig } from '../types';
|
|
8
|
+
/**
|
|
9
|
+
* Virtual module IDs
|
|
10
|
+
* Note: We use a special path format that Vite can resolve from HTML
|
|
11
|
+
*/
|
|
12
|
+
export declare const VIRTUAL_CLIENT_ID = "virtual:ssg-client";
|
|
13
|
+
export declare const RESOLVED_VIRTUAL_CLIENT_ID: string;
|
|
14
|
+
export declare const SSG_CLIENT_ENTRY_PATH = "/@ssg/client.tsx";
|
|
15
|
+
export declare const VIRTUAL_SERVER_ID = "virtual:ssg-server";
|
|
16
|
+
export declare const RESOLVED_VIRTUAL_SERVER_ID: string;
|
|
17
|
+
export declare const VIRTUAL_HTML_ID = "virtual:ssg-html";
|
|
18
|
+
export declare const RESOLVED_VIRTUAL_HTML_ID: string;
|
|
19
|
+
/**
|
|
20
|
+
* Detection result for custom entry points
|
|
21
|
+
*/
|
|
22
|
+
export interface EntryDetectionResult {
|
|
23
|
+
/** Whether to use virtual client entry */
|
|
24
|
+
useVirtualClient: boolean;
|
|
25
|
+
/** Whether to use virtual server entry */
|
|
26
|
+
useVirtualServer: boolean;
|
|
27
|
+
/** Whether to use virtual HTML template */
|
|
28
|
+
useVirtualHtml: boolean;
|
|
29
|
+
/** Path to custom client entry if found */
|
|
30
|
+
customClientPath?: string;
|
|
31
|
+
/** Path to custom server entry if found */
|
|
32
|
+
customServerPath?: string;
|
|
33
|
+
/** Path to custom HTML template if found */
|
|
34
|
+
customHtmlPath?: string;
|
|
35
|
+
/** Path to global CSS if found */
|
|
36
|
+
globalCssPath?: string;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Detect if user has custom entry points
|
|
40
|
+
*/
|
|
41
|
+
export declare function detectCustomEntries(root: string, config: SSGConfig): EntryDetectionResult;
|
|
42
|
+
/**
|
|
43
|
+
* Generate virtual client entry code
|
|
44
|
+
*/
|
|
45
|
+
export declare function generateClientEntry(config: SSGConfig, detection: EntryDetectionResult): string;
|
|
46
|
+
/**
|
|
47
|
+
* Generate virtual server entry code
|
|
48
|
+
*/
|
|
49
|
+
export declare function generateServerEntry(config: SSGConfig): string;
|
|
50
|
+
/**
|
|
51
|
+
* Generate virtual HTML template
|
|
52
|
+
*/
|
|
53
|
+
export declare function generateHtmlTemplate(config: SSGConfig): string;
|
|
54
|
+
/**
|
|
55
|
+
* Generate HTML template for production build
|
|
56
|
+
* Uses the actual client entry path instead of virtual module
|
|
57
|
+
*/
|
|
58
|
+
export declare function generateProductionHtmlTemplate(config: SSGConfig, clientEntryPath: string): string;
|
|
59
|
+
//# sourceMappingURL=virtual-entries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"virtual-entries.d.ts","sourceRoot":"","sources":["../../src/vite/virtual-entries.ts"],"names":[],"mappings":"AAAA;;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G"}
|
package/package.json
ADDED
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sigx/ssg",
|
|
3
|
+
"version": "0.1.6",
|
|
4
|
+
"description": "Static Site Generator for SignalX with file-based routing, MDX support, and pluggable themes",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"types": "./dist/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"import": "./dist/index.js",
|
|
11
|
+
"types": "./dist/index.d.ts"
|
|
12
|
+
},
|
|
13
|
+
"./vite": {
|
|
14
|
+
"import": "./dist/vite/plugin.js",
|
|
15
|
+
"types": "./dist/vite/plugin.d.ts"
|
|
16
|
+
},
|
|
17
|
+
"./build": {
|
|
18
|
+
"import": "./dist/build.js",
|
|
19
|
+
"types": "./dist/build.d.ts"
|
|
20
|
+
},
|
|
21
|
+
"./dev": {
|
|
22
|
+
"import": "./dist/dev.js",
|
|
23
|
+
"types": "./dist/dev.d.ts"
|
|
24
|
+
},
|
|
25
|
+
"./client": {
|
|
26
|
+
"import": "./dist/client.js",
|
|
27
|
+
"types": "./dist/client.d.ts"
|
|
28
|
+
},
|
|
29
|
+
"./virtual": {
|
|
30
|
+
"types": "./src/client.d.ts"
|
|
31
|
+
}
|
|
32
|
+
},
|
|
33
|
+
"bin": {
|
|
34
|
+
"ssg": "./dist/cli.js"
|
|
35
|
+
},
|
|
36
|
+
"files": [
|
|
37
|
+
"dist"
|
|
38
|
+
],
|
|
39
|
+
"keywords": [
|
|
40
|
+
"sigx",
|
|
41
|
+
"ssg",
|
|
42
|
+
"static-site-generator",
|
|
43
|
+
"vite",
|
|
44
|
+
"mdx",
|
|
45
|
+
"markdown"
|
|
46
|
+
],
|
|
47
|
+
"author": "Andreas Ekdahl",
|
|
48
|
+
"license": "MIT",
|
|
49
|
+
"repository": {
|
|
50
|
+
"type": "git",
|
|
51
|
+
"url": "git+https://github.com/signalxjs/core.git",
|
|
52
|
+
"directory": "packages/ssg"
|
|
53
|
+
},
|
|
54
|
+
"homepage": "https://github.com/signalxjs",
|
|
55
|
+
"bugs": {
|
|
56
|
+
"url": "https://github.com/signalxjs/core/issues"
|
|
57
|
+
},
|
|
58
|
+
"dependencies": {
|
|
59
|
+
"esbuild": "^0.24.0",
|
|
60
|
+
"fast-glob": "^3.3.2",
|
|
61
|
+
"gray-matter": "^4.0.3",
|
|
62
|
+
"hast-util-from-html": "^2.0.3",
|
|
63
|
+
"hast-util-to-string": "^3.0.1",
|
|
64
|
+
"rehype-autolink-headings": "^7.1.0",
|
|
65
|
+
"rehype-slug": "^6.0.0",
|
|
66
|
+
"rehype-stringify": "^10.0.1",
|
|
67
|
+
"remark-frontmatter": "^5.0.0",
|
|
68
|
+
"remark-gfm": "^4.0.0",
|
|
69
|
+
"remark-mdx-frontmatter": "^5.0.0",
|
|
70
|
+
"remark-parse": "^11.0.0",
|
|
71
|
+
"remark-rehype": "^11.1.1",
|
|
72
|
+
"shiki": "^1.24.0",
|
|
73
|
+
"unified": "^11.0.5",
|
|
74
|
+
"unist-util-visit": "^5.0.0",
|
|
75
|
+
"@sigx/router": "^0.1.6",
|
|
76
|
+
"@sigx/server-renderer": "^0.1.6"
|
|
77
|
+
},
|
|
78
|
+
"peerDependencies": {
|
|
79
|
+
"sigx": "*",
|
|
80
|
+
"vite": ">=8.0.0-beta.0"
|
|
81
|
+
},
|
|
82
|
+
"devDependencies": {
|
|
83
|
+
"@mdx-js/rollup": "^3.1.0",
|
|
84
|
+
"@types/node": "^22.19.1",
|
|
85
|
+
"typescript": "^5.9.3",
|
|
86
|
+
"vite": "^8.0.0-beta.9"
|
|
87
|
+
},
|
|
88
|
+
"scripts": {
|
|
89
|
+
"build": "vite build && tsc --emitDeclarationOnly",
|
|
90
|
+
"dev": "vite build --watch"
|
|
91
|
+
}
|
|
92
|
+
}
|