@noego/forge 0.1.24 → 0.1.27
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/README.md +2 -0
- package/dist/client.cjs +3 -3
- package/dist/client.cjs.map +1 -1
- package/dist/client.d.ts +25 -0
- package/dist/client.mjs +895 -824
- package/dist/client.mjs.map +1 -1
- package/dist/lint/cli.js +28 -2
- package/dist/lint/cli.js.map +1 -1
- package/dist/lint/config.js +19 -2
- package/dist/lint/config.js.map +1 -1
- package/dist/lint/route_parser.js +8 -30
- package/dist/lint/route_parser.js.map +1 -1
- package/dist/lint/rules/no_invalid_html_nesting.d.ts +3 -0
- package/dist/lint/rules/no_invalid_html_nesting.js +123 -0
- package/dist/lint/rules/no_invalid_html_nesting.js.map +1 -0
- package/dist/lint/tests/no_invalid_html_nesting.test.d.ts +1 -0
- package/dist/lint/tests/no_invalid_html_nesting.test.js +61 -0
- package/dist/lint/tests/no_invalid_html_nesting.test.js.map +1 -0
- package/dist/page.svelte-4uv4nQ2i.js.map +1 -1
- package/dist/page.svelte-CW8PJDdH.cjs.map +1 -1
- package/dist-ssr/{path-BqcF5dbs.js → path-2bYzpvRB.js} +3 -1
- package/dist-ssr/{path-BqcF5dbs.js.map → path-2bYzpvRB.js.map} +1 -1
- package/dist-ssr/{path-sxXxpB6R.cjs → path-DCxJMpj7.cjs} +3 -1
- package/dist-ssr/{path-sxXxpB6R.cjs.map → path-DCxJMpj7.cjs.map} +1 -1
- package/dist-ssr/server.cjs +20 -3
- package/dist-ssr/server.cjs.map +1 -1
- package/dist-ssr/server.js +20 -3
- package/dist-ssr/server.js.map +1 -1
- package/dist-ssr/shared.cjs +1 -1
- package/dist-ssr/shared.js +1 -1
- package/dist-ssr/static.cjs +1 -1
- package/dist-ssr/static.d.ts +4 -0
- package/dist-ssr/static.js +1 -1
- package/dist-ssr/test.d.ts +4 -0
- package/dist-ssr/{url_parser-DHQiBy_-.js → url_parser-B6dvK0DX.js} +36 -3
- package/dist-ssr/{url_parser-DHQiBy_-.js.map → url_parser-B6dvK0DX.js.map} +1 -1
- package/dist-ssr/{url_parser-BGkQselu.cjs → url_parser-D7ZqJUTw.cjs} +36 -3
- package/dist-ssr/{url_parser-BGkQselu.cjs.map → url_parser-D7ZqJUTw.cjs.map} +1 -1
- package/package.json +2 -2
- package/src/components/RecursiveRender.svelte +39 -18
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url_parser-DHQiBy_-.js","sources":["../src/routing/component_loader/component_loader.ts","../src/parser/openapi.ts","../src/routing/component_loader/component_manager.ts","../src/routing/url_parser.ts"],"sourcesContent":["import type { SvelteComponent } from 'svelte';\nimport type { ViteDevServer } from 'vite';\nimport path from 'path';\nimport fs from 'fs';\nimport { pathToFileURL } from 'url';\nimport { SvelteImport, SvelteModuleComponent } from '../base';\nimport { getLogger } from '@noego/logger';\n\nconst log = getLogger('forge:components');\n\n\ntype SvelteResource<K> = SvelteImport<K> & SvelteModuleComponent\n\nexport interface IComponentLoader{\n load(component: string,options?:any): Promise<SvelteResource<SvelteComponent>>\n getComponentFullPath(component: string, options?: any): string\n}\n\n\nexport class BasicComponentLoader implements IComponentLoader {\n private resolvedBasePath: string;\n\n constructor(private basePath: string) {\n // Resolve basePath relative to current working directory\n this.resolvedBasePath = path.isAbsolute(basePath)\n ? basePath\n : path.resolve(process.cwd(), basePath);\n }\n\n async load(componentPath: string) {\n const component_full_path = this.getComponentFullPath(componentPath);\n // Use pathToFileURL for proper ESM import of absolute paths\n const module = await import(pathToFileURL(component_full_path).href);\n return module as SvelteResource<any>;\n }\n\n getComponentFullPath(componentPath: string): string {\n return path.join(this.resolvedBasePath, componentPath);\n }\n}\n\n\n\nexport class ViteComponentLoader implements IComponentLoader {\n constructor(private basePath:string, private vite: ViteDevServer) {}\n \n async load(componentPath: string, options = {use_base_path:true}): Promise<SvelteResource<any>> {\n const absoluteComponentPath = this.getComponentFullPath(componentPath, options);\n\n log.debug(`Loading component from path: ${absoluteComponentPath}`);\n\n // Smart detection: check for precompiled .js file first\n const jsPath = absoluteComponentPath.replace(/\\.svelte$/, '.js');\n const jsExists = fs.existsSync(jsPath);\n\n // TODO: Remove this if we only need svelte files\n if (false && jsExists) {\n // Precompiled .js exists - use it directly (production mode)\n log.debug(`Found precompiled component at: ${jsPath}`);\n try {\n const module: any = await import(jsPath);\n log.debug(`Loaded precompiled module successfully`);\n return module as SvelteResource<any>;\n } catch (error) {\n log.error(`Error loading precompiled module from ${jsPath}`, error);\n throw error;\n }\n }\n\n // No .js file - fall back to Vite dev mode (.svelte)\n let vitePath = path.relative(process.cwd(), absoluteComponentPath);\n\n vitePath = vitePath.replace(/\\\\/g, '/');\n\n if (!vitePath.startsWith('/')) {\n vitePath = '/' + vitePath;\n }\n\n log.debug(`Resolved Vite path: ${vitePath} from componentPath: ${componentPath}`);\n\n\n try {\n log.debug(`Loading module for vitePath: ${vitePath}`);\n const module = await this.vite.ssrLoadModule(vitePath);\n log.debug(`Module loaded successfully for: ${vitePath}`);\n if (!module || !module.default) {\n log.error(`Loaded module for ${vitePath} is invalid or missing a default export. Module content:`, module);\n throw new Error(`Module ${vitePath} loaded successfully but is invalid or missing default export.`);\n }\n return module as SvelteResource<any>;\n } catch (error) {\n log.error(`Error loading module for vitePath: ${vitePath} (derived from componentPath: ${componentPath})`, error);\n\n try {\n await fs.promises.access(absoluteComponentPath);\n } catch (fsError) {\n }\n throw error;\n }\n }\n\n getComponentFullPath(componentPath: string, options = {use_base_path:true}): string {\n const use_base_path = options.use_base_path || false;\n\n if (use_base_path) {\n return path.join(this.basePath, componentPath);\n }\n\n if (path.isAbsolute(componentPath)) {\n return componentPath;\n }\n\n return componentPath;\n }\n}\n\n\nexport class ProdComponentLoader implements IComponentLoader {\n\n private componentMapPromise: Promise<Record<string, SvelteResource<any>>> | null = null;\n\n constructor(private base_path: string) {}\n\n async load(componentPath: string): Promise<SvelteResource<any>> {\n const normalized = this.normalizeKey(componentPath);\n\n try {\n const map = await this.loadComponentMap();\n const module = map[normalized];\n if (module) {\n return module;\n }\n } catch (error) {\n log.warn(`Failed to load component \"${componentPath}\" from entry manifest:`, error);\n }\n\n const component_path = this.getComponentFullPath(componentPath);\n const fallbackPath = component_path.endsWith('.js')\n ? component_path\n : component_path.replace(/\\.svelte$/, '.js');\n const module: any = await import(pathToFileURL(fallbackPath).href);\n return module as SvelteResource<any>;\n }\n\n getComponentFullPath(componentPath: string): string {\n return path.join(this.base_path, componentPath);\n }\n\n private normalizeKey(componentPath: string): string {\n const trimmed = componentPath.replace(/^\\.\\//, '');\n if (trimmed.endsWith('.svelte')) {\n return trimmed.replace(/\\.svelte$/, '.js');\n }\n return trimmed;\n }\n\n private async loadComponentMap(): Promise<Record<string, SvelteResource<any>>> {\n if (!this.componentMapPromise) {\n const entryPath = path.join(this.base_path, 'entry-ssr.js');\n const entryUrl = pathToFileURL(entryPath).href;\n this.componentMapPromise = import(entryUrl)\n .then((mod: any) => {\n const source = mod.components ?? mod.default ?? {};\n const normalized: Record<string, SvelteResource<any>> = {};\n for (const [key, value] of Object.entries<SvelteResource<any>>(source)) {\n const cleanKey = key.replace(/^\\.\\//, '');\n normalized[cleanKey] = value;\n if (cleanKey.startsWith('ui/')) {\n normalized[cleanKey.slice(3)] = value;\n }\n if (cleanKey.endsWith('.svelte')) {\n const jsKey = cleanKey.replace(/\\.svelte$/, '.js');\n normalized[jsKey] = value;\n }\n }\n return normalized;\n })\n .catch((error) => {\n this.componentMapPromise = null;\n throw error;\n });\n }\n return this.componentMapPromise;\n }\n}\n","import yaml from 'js-yaml'\nimport clone from 'clone-deep'\nimport join from 'url-join'\nimport type {IRoute, IServerRoute} from \"./IRoute\"\nimport {parsePathConfig} from \"./path\"\nimport fs from 'fs'\nimport { getLogger } from '@noego/logger'\n\nconst log = getLogger('forge:parser')\n\nconst HTTP_METHODS = new Set([\n 'get',\n 'post',\n 'put',\n 'delete',\n 'patch',\n 'head',\n 'options',\n 'trace'\n])\n\nfunction getGlobalPathsMiddleware(openapi:any): string[] {\n if (!openapi || !openapi.paths) {\n return []\n }\n const value = openapi.paths['x-middleware']\n return Array.isArray(value) ? [...value] : []\n}\n\nexport function parseConfigfile(file_content:string) {\n let config:any = null\n try {\n config = yaml.load(file_content)\n } catch (e) {\n log.error('Failed to parse config file:', e)\n }\n return config\n}\n\n\nexport function parse_modules(openapi:any, inheritedMiddleware: string[] = []){\n const modules_config = (openapi.modules || openapi.module)\n if (!modules_config) {\n return\n }\n\n // Detect format: array (deprecated) vs named object (new)\n const isArrayFormat = Array.isArray(modules_config)\n\n let moduleEntries: Array<{module: any, name: string, isObjectFormat: boolean}>\n\n if (isArrayFormat) {\n // Old array format - backwards compatible, log deprecation warning\n log.warn('Deprecation warning: Array format for modules is deprecated. ' +\n 'Please migrate to named object format: modules: { moduleName: { basePath, paths, x-layout } }')\n moduleEntries = modules_config.map((m: any, idx: number) => ({\n module: m,\n name: `module[${idx}]`,\n isObjectFormat: false\n }))\n } else {\n // New named object format - validate like Dinner\n moduleEntries = Object.entries(modules_config).map(([name, module]: [string, any]) => {\n if (!module.basePath) {\n throw new Error(`Module '${name}' is missing required 'basePath' property`)\n }\n if (!module.paths) {\n throw new Error(`Module '${name}' is missing required 'paths' property`)\n }\n return { module, name, isObjectFormat: true }\n })\n }\n\n const globalMiddleware = [...inheritedMiddleware, ...getGlobalPathsMiddleware(openapi)]\n\n const modules_path: (IRoute[] | undefined)[] = moduleEntries.map(({ module, isObjectFormat }) => {\n const basePath = module.basePath || ''\n // Use x-layout for object format, baseLayouts for array format (backwards compat)\n const baseLayouts = isObjectFormat\n ? (module['x-layout'] || [])\n : (module.baseLayouts || [])\n const moduleMiddleware = Array.isArray(module['x-middleware']) ? module['x-middleware'] : []\n const inherited = [...globalMiddleware, ...moduleMiddleware]\n\n const paths = module.paths\n\n if(!paths){\n return\n }\n\n const configurations = Object.entries(paths)\n .filter(([path]) => typeof path === 'string' && path.startsWith('/'))\n .map(([path, method_config]:[string,any]) => {\n return Object.entries(method_config)\n .filter(([method]) => HTTP_METHODS.has(String(method).toLowerCase()))\n .map(([method, config]) => {\n const methodName = String(method)\n return parsePathConfig(path,methodName,config,inherited)\n })\n })\n\n const routes = configurations.reduce((flat_config,config)=>{\n return flat_config.concat(config)\n },[])\n\n routes.forEach((route:IRoute) => {\n route.path = join(basePath, route.path)\n route.layout = baseLayouts.concat(route.layout|| [])\n })\n return routes\n })\n\n return modules_path.reduce((flat_config,config)=>{\n if (!config) {\n return flat_config\n }\n return flat_config.concat(config)\n }\n ,[] as IRoute[])\n}\n\n\nexport function parse_paths(openapi:any, inheritedMiddleware: string[] = []){\n const paths = openapi.paths\n if (!paths) {\n return\n }\n\n const globalMiddleware = [...inheritedMiddleware, ...getGlobalPathsMiddleware(openapi)]\n\n const configurations = Object.entries(paths)\n .filter(([path]) => typeof path === 'string' && path.startsWith('/'))\n .map(([path, method_config]:[string,any]) => {\n return Object.entries(method_config)\n .filter(([method]) => HTTP_METHODS.has(String(method).toLowerCase()))\n .map(([method, config]) => {\n const methodName = String(method)\n return parsePathConfig(path,methodName,config,globalMiddleware)\n })\n })\n\n const routes = configurations.reduce((flat_config,config)=>{\n return flat_config.concat(config)\n },[] as IRoute[])\n\n return routes\n}\n\n\n\n\nexport function transform_openapi_spec(openapi_spec:string) {\n\n const openapi = parseConfigfile(openapi_spec)\n const config = normalize_openapi_config(openapi)\n return yaml.dump(config)\n}\n\n\nexport function normalize_openapi_config(openapi_config:any){\n const config = clone(openapi_config)\n\n const modules = parse_modules(config) || []\n const paths = parse_paths(config) || []\n\n const routes = [...modules, ...paths]\n\n routes.forEach((route:IRoute) => {\n const path = route.path\n const method = route.method\n const config_path = config.paths[path] || {}\n const config_method = config_path[method] || {}\n\n config_method.summary = route.summary\n config_method.description = route.description\n config_method.parameters = route.parameters\n config_method.query = route.query\n config_method.body = route.body\n config_method.responses = route.responses\n config_method['x-view'] = route.view\n config_method['x-layout'] = route.layout\n if (route.middleware && route.middleware.length > 0) {\n config_method['x-middleware'] = route.middleware\n } else {\n delete config_method['x-middleware']\n }\n\n config_path[method] = config_method\n config.paths[path] = config_path\n })\n\n delete config.modules\n return config\n}\n\n\n/**\n * Check if a YAML document is a stitch configuration file\n * @param document The parsed YAML document\n * @returns True if it's a stitch config, false otherwise\n */\nfunction isStitchConfig(document: any): boolean {\n return document && typeof document === 'object' && 'stitch' in document;\n}\n\n/**\n * Check if a YAML document is a regular OpenAPI file\n * @param document The parsed YAML document\n * @returns True if it's a regular OpenAPI file, false otherwise\n */\nfunction isOpenAPIConfig(document: any): boolean {\n return document && typeof document === 'object' && ('paths' in document || 'module' in document || 'modules' in document);\n}\n\nexport async function parse_openapi_config(openapi_config_path:string):Promise<IServerRoute>{\n const content = fs.readFileSync(openapi_config_path, 'utf8')\n const parsed_config = parseConfigfile(content)\n \n let openapi_config: any;\n \n if (isStitchConfig(parsed_config)) {\n // Handle stitch configuration - build using Node.js stitch engine\n log.info('Detected stitch configuration, building with Node.js stitch engine...');\n\n try {\n const { StitchEngine } = await import('@noego/stitch');\n\n const startTime = Date.now();\n const engine = new StitchEngine();\n const result = engine.buildSync(openapi_config_path, { format: 'json' });\n\n if (!result.success) {\n throw new Error(`Stitch build failed: ${result.error}`);\n }\n\n const buildTime = Date.now() - startTime;\n log.info(`Stitch build completed in ${buildTime} ms – ${parsed_config.stitch ? parsed_config.stitch.length : 0} modules processed`);\n\n // Parse the JSON string result to get the JavaScript object\n openapi_config = typeof result.data === 'string' ? JSON.parse(result.data) : result.data;\n } catch (error) {\n throw new Error(`Failed to process stitch configuration: ${error instanceof Error ? error.message : String(error)}`);\n }\n } else if (isOpenAPIConfig(parsed_config)) {\n // Handle regular OpenAPI file (legacy path)\n log.info('Detected regular OpenAPI configuration');\n openapi_config = parsed_config;\n } else {\n throw new Error(`Invalid OpenAPI or stitch configuration file: ${openapi_config_path}. File must contain either 'stitch', 'paths', 'module', or 'modules' at the root level.`);\n }\n const globalPathsMiddleware = getGlobalPathsMiddleware(openapi_config)\n\n let modules = parse_modules(openapi_config) || []\n let paths = parse_paths(openapi_config) || []\n\n let fallback_layout = openapi_config['x-fallback-layout'] || null\n let fallback_view = openapi_config['x-fallback-view'] || null\n const fallback_middleware = Array.isArray(openapi_config['x-fallback-middleware'])\n ? [...openapi_config['x-fallback-middleware']]\n : [...globalPathsMiddleware]\n let fallback = {\n layout: fallback_layout ? [fallback_layout]:[],\n view: fallback_view,\n middleware: fallback_middleware\n }\n\n const routes = [...modules, ...paths]\n\n let config = {\n fallback,\n routes\n }\n return config\n}\n\n\nexport function transform_openapi_config(openapi_config:any):IRoute[] {\n let modules = parse_modules(openapi_config) || []\n let paths = parse_paths(openapi_config) || []\n\n let routes = [...modules, ...paths]\n return routes\n}\n","import path from \"path\";\nimport { pathToFileURL } from \"url\";\nimport type { IRoute } from \"../../parser/IRoute\";\nimport type { IComponentLoader } from \"./component_loader\";\nimport { getLogger } from '@noego/logger';\n\nconst log = getLogger('forge:components');\n\n\n\n\n\n\nexport class ComponentManager {\n\n constructor(\n private componentLoader: IComponentLoader\n ){\n\n }\n\n async getLayoutComponents(route:IRoute){\n const layout_paths = route.layout || [];\n const layouts_components = await Promise.all(layout_paths.map((layout)=>{\n log.debug(\"layout path\",layout)\n return this.componentLoader.load(layout)}))\n return layouts_components\n }\n\n async getLayouts(route:IRoute){\n const layout_paths = route.layout || [];\n const layouts_components = await Promise.all(layout_paths.map(async (layout_path)=>{\n const layout = await this.componentLoader.load(layout_path)\n return layout.default\n \n }))\n return layouts_components\n }\n\n async getLayoutLoaders(route:IRoute){\n const layout_paths = route.layout || [];\n \n // First, check for .load.js/.load.ts files using resolveLoader (maintains order)\n // Each loader at index N corresponds to the layout at index N\n const loaders_from_files = await Promise.all(\n layout_paths.map((layoutPath) => this.resolveLoader(layoutPath))\n );\n \n // Check if any need fallback to old-style component.load\n const needs_fallback = loaders_from_files.some(loader => !loader);\n \n if (needs_fallback) {\n // Fall back to old-style component.load for backward compatibility\n const layout_components = await this.getLayoutComponents(route);\n const old_style_loaders = layout_components.map(layout => layout.load);\n \n // Merge: prefer .load.js/.load.ts file loaders, fall back to old-style component.load\n // This maintains order: loader[index] corresponds to layout_paths[index]\n // Only include loaders that are actually functions\n return loaders_from_files.map((loader, index) => {\n const resolved = loader || old_style_loaders[index];\n return typeof resolved === 'function' ? resolved : null;\n });\n }\n \n return loaders_from_files;\n }\n\n\n async getViewComponent(route: IRoute) {\n return await this.componentLoader.load(route.view)\n }\n\n\n async hasLoaders(route:IRoute):Promise<boolean>{\n const componentPaths = [...(route.layout || []), route.view];\n\n for (const componentPath of componentPaths) {\n const loader = await this.resolveLoader(componentPath);\n if (loader) {\n return true;\n }\n }\n\n return false;\n }\n\n\n async getLoaders(route: IRoute) {\n const layoutPaths = route.layout || [];\n const layouts = await Promise.all(layoutPaths.map((layoutPath) => this.resolveLoader(layoutPath)));\n const view = await this.resolveLoader(route.view);\n\n return {\n layouts,\n view\n };\n }\n\n\n private getLoaderFilePath(componentPath?: string | null, extension: '.js' | '.ts' = '.js'): string | null {\n if (!componentPath) {\n return null;\n }\n\n const fullPath = this.componentLoader.getComponentFullPath(componentPath);\n const { dir, name } = path.parse(fullPath);\n return path.join(dir, `${name}.load${extension}`);\n }\n\n\n private async resolveLoader(componentPath?: string | null): Promise<((...args: any[]) => any) | null> {\n if (!componentPath) {\n return null;\n }\n\n // Try .load.js first (production), then .load.ts (development)\n const extensions: Array<'.js' | '.ts'> = ['.js', '.ts'];\n \n for (const ext of extensions) {\n const loaderFilePath = this.getLoaderFilePath(componentPath, ext);\n if (!loaderFilePath) {\n continue;\n }\n\n try {\n log.debug(`Trying loader path: ${loaderFilePath}`);\n const module = await import(pathToFileURL(loaderFilePath).href);\n const loader = module?.default;\n log.debug(`Imported loader module: default=${typeof loader}`);\n if (typeof loader === \"function\") {\n log.debug(`Loaded loader function from: ${loaderFilePath}`);\n return loader;\n }\n } catch (error: any) {\n const code = error?.code || error?.name || 'UNKNOWN_ERROR';\n if (code === \"MODULE_NOT_FOUND\" || code === \"ERR_MODULE_NOT_FOUND\") {\n log.warn(`Loader not found at ${loaderFilePath} (${ext}): ${error?.message || code}`);\n // File doesn't exist with this extension, try next one\n continue;\n }\n // Other errors (syntax errors, etc.) should be logged\n log.error(`Failed to load loader for ${componentPath} (${ext}) at ${loaderFilePath}:`, error);\n // Continue to try next extension\n }\n }\n\n // Neither .load.js nor .load.ts found\n return null;\n }\n\n\n async getView(route: IRoute) {\n const view = await this.componentLoader.load(route.view)\n return view.default\n }\n}\n","import pathToRegex from 'path-to-regex';\nimport type { IRoute } from '../parser/IRoute';\n\n\n\nexport function makeUrlParser(pattern: string) {\n const parser = new pathToRegex(pattern);\n return (pathname: string) => {\n const result = parser.match(pathname);\n if (!result) return null;\n\n // Decode URL-encoded param values\n const decoded: Record<string, string> = {};\n for (const [key, value] of Object.entries(result)) {\n decoded[key] = decodeURIComponent(value as string);\n }\n return decoded;\n };\n}\n\n\nexport type UrlMatcher = {\n pattern: string,\n parser: ReturnType<typeof makeUrlParser>\n}\n\nexport function findRoute(pathname:string, routes: UrlMatcher[]) {\n for (const { pattern, parser } of routes) {\n const params = parser(pathname);\n if (params) {\n return { pattern, params };\n }\n }\n return null;\n}\n\n\n\n\n\nexport function initialize_route_matchers(routes: IRoute[]): UrlMatcher[] {\n return routes.map((route: IRoute) => {\n const pattern = route.path;\n const parser = makeUrlParser(pattern);\n return { pattern, parser };\n })\n}\n"],"names":["log","path","fs","module"],"mappings":";;;;;;;;;;;;AAQA,MAAMA,QAAM,UAAU,kBAAkB;AAWjC,MAAM,qBAAiD;AAAA,EAG1D,YAAoB,UAAkB;AAF9B;AAEY,SAAA,WAAA;AAElB,SAAK,mBAAmBC,cAAK,WAAW,QAAQ,IAC5C,WACAA,cAAK,QAAQ,QAAQ,IAAA,GAAO,QAAQ;AAAA,EAC1C;AAAA,EAEA,MAAM,KAAK,eAAuB;AAChC,UAAM,sBAAsB,KAAK,qBAAqB,aAAa;AAEnE,UAAM,SAAS,MAAM,OAAO,cAAc,mBAAmB,EAAE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QAAQ;AACpC,QAAI,CAAC,OAAQ,QAAO;AAGpB,UAAM,UAAkC,CAAA;AACxC,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,cAAQ,GAAG,IAAI,mBAAmB,KAAe;AAAA,IACnD;AACA,WAAO;AAAA,EACT;AACF;AAQO,SAAS,UAAU,UAAiB,QAAsB;AAC/D,aAAW,EAAE,SAAS,OAAA,KAAY,QAAQ;AACxC,UAAM,SAAS,OAAO,QAAQ;AAC9B,QAAI,QAAQ;AACV,aAAO,EAAE,SAAS,OAAA;AAAA,IACpB;AAAA,EACF;AACA,SAAO;AACT;AAMO,SAAS,0BAA0B,QAAgC;AACxE,SAAO,OAAO,IAAI,CAAC,UAAkB;AACnC,UAAM,UAAU,MAAM;AACtB,UAAM,SAAS,cAAc,OAAO;AACpC,WAAO,EAAE,SAAS,OAAA;AAAA,EACpB,CAAC;AACH;"}
|
|
1
|
+
{"version":3,"file":"url_parser-B6dvK0DX.js","sources":["../src/routing/component_loader/component_loader.ts","../src/parser/openapi.ts","../src/routing/component_loader/component_manager.ts","../src/routing/url_parser.ts"],"sourcesContent":["import type { SvelteComponent } from 'svelte';\nimport type { ViteDevServer } from 'vite';\nimport path from 'path';\nimport fs from 'fs';\nimport { pathToFileURL } from 'url';\nimport { SvelteImport, SvelteModuleComponent } from '../base';\nimport { getLogger } from '@noego/logger';\n\nconst log = getLogger('forge:components');\n\n\ntype SvelteResource<K> = SvelteImport<K> & SvelteModuleComponent\n\nexport interface IComponentLoader{\n load(component: string,options?:any): Promise<SvelteResource<SvelteComponent>>\n getComponentFullPath(component: string, options?: any): string\n}\n\n\nexport class BasicComponentLoader implements IComponentLoader {\n private resolvedBasePath: string;\n\n constructor(private basePath: string) {\n // Resolve basePath relative to current working directory\n this.resolvedBasePath = path.isAbsolute(basePath)\n ? basePath\n : path.resolve(process.cwd(), basePath);\n }\n\n async load(componentPath: string) {\n const component_full_path = this.getComponentFullPath(componentPath);\n // Use pathToFileURL for proper ESM import of absolute paths\n const module = await import(pathToFileURL(component_full_path).href);\n return module as SvelteResource<any>;\n }\n\n getComponentFullPath(componentPath: string): string {\n return path.join(this.resolvedBasePath, componentPath);\n }\n}\n\n\n\nexport class ViteComponentLoader implements IComponentLoader {\n constructor(private basePath:string, private vite: ViteDevServer) {}\n \n async load(componentPath: string, options = {use_base_path:true}): Promise<SvelteResource<any>> {\n const absoluteComponentPath = this.getComponentFullPath(componentPath, options);\n\n log.debug(`Loading component from path: ${absoluteComponentPath}`);\n\n // Smart detection: check for precompiled .js file first\n const jsPath = absoluteComponentPath.replace(/\\.svelte$/, '.js');\n const jsExists = fs.existsSync(jsPath);\n\n // TODO: Remove this if we only need svelte files\n if (false && jsExists) {\n // Precompiled .js exists - use it directly (production mode)\n log.debug(`Found precompiled component at: ${jsPath}`);\n try {\n const module: any = await import(jsPath);\n log.debug(`Loaded precompiled module successfully`);\n return module as SvelteResource<any>;\n } catch (error) {\n log.error(`Error loading precompiled module from ${jsPath}`, error);\n throw error;\n }\n }\n\n // No .js file - fall back to Vite dev mode (.svelte)\n let vitePath = path.relative(process.cwd(), absoluteComponentPath);\n\n vitePath = vitePath.replace(/\\\\/g, '/');\n\n if (!vitePath.startsWith('/')) {\n vitePath = '/' + vitePath;\n }\n\n log.debug(`Resolved Vite path: ${vitePath} from componentPath: ${componentPath}`);\n\n\n try {\n log.debug(`Loading module for vitePath: ${vitePath}`);\n const module = await this.vite.ssrLoadModule(vitePath);\n log.debug(`Module loaded successfully for: ${vitePath}`);\n if (!module || !module.default) {\n log.error(`Loaded module for ${vitePath} is invalid or missing a default export. Module content:`, module);\n throw new Error(`Module ${vitePath} loaded successfully but is invalid or missing default export.`);\n }\n return module as SvelteResource<any>;\n } catch (error) {\n log.error(`Error loading module for vitePath: ${vitePath} (derived from componentPath: ${componentPath})`, error);\n\n try {\n await fs.promises.access(absoluteComponentPath);\n } catch (fsError) {\n }\n throw error;\n }\n }\n\n getComponentFullPath(componentPath: string, options = {use_base_path:true}): string {\n const use_base_path = options.use_base_path || false;\n\n if (use_base_path) {\n return path.join(this.basePath, componentPath);\n }\n\n if (path.isAbsolute(componentPath)) {\n return componentPath;\n }\n\n return componentPath;\n }\n}\n\n\nexport class ProdComponentLoader implements IComponentLoader {\n\n private componentMapPromise: Promise<Record<string, SvelteResource<any>>> | null = null;\n\n constructor(private base_path: string) {}\n\n async load(componentPath: string): Promise<SvelteResource<any>> {\n const normalized = this.normalizeKey(componentPath);\n\n try {\n const map = await this.loadComponentMap();\n const module = map[normalized];\n if (module) {\n return module;\n }\n } catch (error) {\n log.warn(`Failed to load component \"${componentPath}\" from entry manifest:`, error);\n }\n\n const component_path = this.getComponentFullPath(componentPath);\n const fallbackPath = component_path.endsWith('.js')\n ? component_path\n : component_path.replace(/\\.svelte$/, '.js');\n const module: any = await import(pathToFileURL(fallbackPath).href);\n return module as SvelteResource<any>;\n }\n\n getComponentFullPath(componentPath: string): string {\n return path.join(this.base_path, componentPath);\n }\n\n private normalizeKey(componentPath: string): string {\n const trimmed = componentPath.replace(/^\\.\\//, '');\n if (trimmed.endsWith('.svelte')) {\n return trimmed.replace(/\\.svelte$/, '.js');\n }\n return trimmed;\n }\n\n private async loadComponentMap(): Promise<Record<string, SvelteResource<any>>> {\n if (!this.componentMapPromise) {\n const entryPath = path.join(this.base_path, 'entry-ssr.js');\n const entryUrl = pathToFileURL(entryPath).href;\n this.componentMapPromise = import(entryUrl)\n .then((mod: any) => {\n const source = mod.components ?? mod.default ?? {};\n const normalized: Record<string, SvelteResource<any>> = {};\n for (const [key, value] of Object.entries<SvelteResource<any>>(source)) {\n const cleanKey = key.replace(/^\\.\\//, '');\n normalized[cleanKey] = value;\n if (cleanKey.startsWith('ui/')) {\n normalized[cleanKey.slice(3)] = value;\n }\n if (cleanKey.endsWith('.svelte')) {\n const jsKey = cleanKey.replace(/\\.svelte$/, '.js');\n normalized[jsKey] = value;\n }\n }\n return normalized;\n })\n .catch((error) => {\n this.componentMapPromise = null;\n throw error;\n });\n }\n return this.componentMapPromise;\n }\n}\n","import yaml from 'js-yaml'\nimport clone from 'clone-deep'\nimport join from 'url-join'\nimport type {IRoute, IServerRoute} from \"./IRoute\"\nimport {parsePathConfig} from \"./path\"\nimport fs from 'fs'\nimport { getLogger } from '@noego/logger'\n\nconst log = getLogger('forge:parser')\n\nconst HTTP_METHODS = new Set([\n 'get',\n 'post',\n 'put',\n 'delete',\n 'patch',\n 'head',\n 'options',\n 'trace'\n])\n\nfunction getGlobalPathsMiddleware(openapi:any): string[] {\n if (!openapi || !openapi.paths) {\n return []\n }\n const value = openapi.paths['x-middleware']\n return Array.isArray(value) ? [...value] : []\n}\n\nexport function parseConfigfile(file_content:string) {\n let config:any = null\n try {\n config = yaml.load(file_content)\n } catch (e) {\n log.error('Failed to parse config file:', e)\n }\n return config\n}\n\n\nexport function parse_modules(openapi:any, inheritedMiddleware: string[] = []){\n const modules_config = (openapi.modules || openapi.module)\n if (!modules_config) {\n return\n }\n\n // Detect format: array (deprecated) vs named object (new)\n const isArrayFormat = Array.isArray(modules_config)\n\n let moduleEntries: Array<{module: any, name: string, isObjectFormat: boolean}>\n\n if (isArrayFormat) {\n // Old array format - backwards compatible, log deprecation warning\n log.warn('Deprecation warning: Array format for modules is deprecated. ' +\n 'Please migrate to named object format: modules: { moduleName: { basePath, paths, x-layout } }')\n moduleEntries = modules_config.map((m: any, idx: number) => ({\n module: m,\n name: `module[${idx}]`,\n isObjectFormat: false\n }))\n } else {\n // New named object format - validate like Dinner\n moduleEntries = Object.entries(modules_config).map(([name, module]: [string, any]) => {\n if (!module.basePath) {\n throw new Error(`Module '${name}' is missing required 'basePath' property`)\n }\n if (!module.paths) {\n throw new Error(`Module '${name}' is missing required 'paths' property`)\n }\n return { module, name, isObjectFormat: true }\n })\n }\n\n const globalMiddleware = [...inheritedMiddleware, ...getGlobalPathsMiddleware(openapi)]\n\n const modules_path: (IRoute[] | undefined)[] = moduleEntries.map(({ module, isObjectFormat }) => {\n const basePath = module.basePath || ''\n // Use x-layout for object format, baseLayouts for array format (backwards compat)\n const baseLayouts = isObjectFormat\n ? (module['x-layout'] || [])\n : (module.baseLayouts || [])\n const moduleMiddleware = Array.isArray(module['x-middleware']) ? module['x-middleware'] : []\n const inherited = [...globalMiddleware, ...moduleMiddleware]\n\n const paths = module.paths\n\n if(!paths){\n return\n }\n\n const configurations = Object.entries(paths)\n .filter(([path]) => typeof path === 'string' && path.startsWith('/'))\n .map(([path, method_config]:[string,any]) => {\n return Object.entries(method_config)\n .filter(([method]) => HTTP_METHODS.has(String(method).toLowerCase()))\n .map(([method, config]) => {\n const methodName = String(method)\n return parsePathConfig(path,methodName,config,inherited)\n })\n })\n\n const routes = configurations.reduce((flat_config,config)=>{\n return flat_config.concat(config)\n },[])\n\n routes.forEach((route:IRoute) => {\n route.path = join(basePath, route.path)\n route.layout = baseLayouts.concat(route.layout|| [])\n })\n return routes\n })\n\n return modules_path.reduce((flat_config,config)=>{\n if (!config) {\n return flat_config\n }\n return flat_config.concat(config)\n }\n ,[] as IRoute[])\n}\n\n\nexport function parse_paths(openapi:any, inheritedMiddleware: string[] = []){\n const paths = openapi.paths\n if (!paths) {\n return\n }\n\n const globalMiddleware = [...inheritedMiddleware, ...getGlobalPathsMiddleware(openapi)]\n\n const configurations = Object.entries(paths)\n .filter(([path]) => typeof path === 'string' && path.startsWith('/'))\n .map(([path, method_config]:[string,any]) => {\n return Object.entries(method_config)\n .filter(([method]) => HTTP_METHODS.has(String(method).toLowerCase()))\n .map(([method, config]) => {\n const methodName = String(method)\n return parsePathConfig(path,methodName,config,globalMiddleware)\n })\n })\n\n const routes = configurations.reduce((flat_config,config)=>{\n return flat_config.concat(config)\n },[] as IRoute[])\n\n return routes\n}\n\n\n\n\nexport function transform_openapi_spec(openapi_spec:string) {\n\n const openapi = parseConfigfile(openapi_spec)\n const config = normalize_openapi_config(openapi)\n return yaml.dump(config)\n}\n\n\nexport function normalize_openapi_config(openapi_config:any){\n const config = clone(openapi_config)\n\n const modules = parse_modules(config) || []\n const paths = parse_paths(config) || []\n\n const routes = [...modules, ...paths]\n\n routes.forEach((route:IRoute) => {\n const path = route.path\n const method = route.method\n const config_path = config.paths[path] || {}\n const config_method = config_path[method] || {}\n\n config_method.summary = route.summary\n config_method.description = route.description\n config_method.parameters = route.parameters\n config_method.query = route.query\n config_method.body = route.body\n config_method.responses = route.responses\n config_method['x-view'] = route.view\n config_method['x-layout'] = route.layout\n if (route.middleware && route.middleware.length > 0) {\n config_method['x-middleware'] = route.middleware\n } else {\n delete config_method['x-middleware']\n }\n\n config_path[method] = config_method\n config.paths[path] = config_path\n })\n\n delete config.modules\n return config\n}\n\n\n/**\n * Check if a YAML document is a stitch configuration file\n * @param document The parsed YAML document\n * @returns True if it's a stitch config, false otherwise\n */\nfunction isStitchConfig(document: any): boolean {\n return document && typeof document === 'object' && 'stitch' in document;\n}\n\n/**\n * Check if a YAML document is a regular OpenAPI file\n * @param document The parsed YAML document\n * @returns True if it's a regular OpenAPI file, false otherwise\n */\nfunction isOpenAPIConfig(document: any): boolean {\n return document && typeof document === 'object' && ('paths' in document || 'module' in document || 'modules' in document);\n}\n\nexport async function parse_openapi_config(openapi_config_path:string):Promise<IServerRoute>{\n const content = fs.readFileSync(openapi_config_path, 'utf8')\n const parsed_config = parseConfigfile(content)\n \n let openapi_config: any;\n \n if (isStitchConfig(parsed_config)) {\n // Handle stitch configuration - build using Node.js stitch engine\n log.info('Detected stitch configuration, building with Node.js stitch engine...');\n\n try {\n const { StitchEngine } = await import('@noego/stitch');\n\n const startTime = Date.now();\n const engine = new StitchEngine();\n const result = engine.buildSync(openapi_config_path, { format: 'json' });\n\n if (!result.success) {\n throw new Error(`Stitch build failed: ${result.error}`);\n }\n\n const buildTime = Date.now() - startTime;\n log.info(`Stitch build completed in ${buildTime} ms – ${parsed_config.stitch ? parsed_config.stitch.length : 0} modules processed`);\n\n // Parse the JSON string result to get the JavaScript object\n openapi_config = typeof result.data === 'string' ? JSON.parse(result.data) : result.data;\n } catch (error) {\n throw new Error(`Failed to process stitch configuration: ${error instanceof Error ? error.message : String(error)}`);\n }\n } else if (isOpenAPIConfig(parsed_config)) {\n // Handle regular OpenAPI file (legacy path)\n log.info('Detected regular OpenAPI configuration');\n openapi_config = parsed_config;\n } else {\n throw new Error(`Invalid OpenAPI or stitch configuration file: ${openapi_config_path}. File must contain either 'stitch', 'paths', 'module', or 'modules' at the root level.`);\n }\n const globalPathsMiddleware = getGlobalPathsMiddleware(openapi_config)\n\n let modules = parse_modules(openapi_config) || []\n let paths = parse_paths(openapi_config) || []\n\n let fallback_layout = openapi_config['x-fallback-layout'] || null\n let fallback_view = openapi_config['x-fallback-view'] || null\n const fallback_middleware = Array.isArray(openapi_config['x-fallback-middleware'])\n ? [...openapi_config['x-fallback-middleware']]\n : [...globalPathsMiddleware]\n let fallback = {\n layout: fallback_layout ? [fallback_layout]:[],\n view: fallback_view,\n middleware: fallback_middleware\n }\n\n const routes = [...modules, ...paths]\n\n let config = {\n fallback,\n routes\n }\n return config\n}\n\n\nexport function transform_openapi_config(openapi_config:any):IRoute[] {\n let modules = parse_modules(openapi_config) || []\n let paths = parse_paths(openapi_config) || []\n\n let routes = [...modules, ...paths]\n return routes\n}\n","import path from \"path\";\nimport { pathToFileURL } from \"url\";\nimport fs from \"fs\";\nimport { promisify } from \"util\";\nimport type { IRoute } from \"../../parser/IRoute\";\nimport type { IComponentLoader } from \"./component_loader\";\nimport { getLogger } from '@noego/logger';\n\nconst log = getLogger('forge:components');\nconst stat = promisify(fs.stat);\n\n\n\n\n\n\nexport class ComponentManager {\n private loaderCache: Map<string, { result: any | null, mtime: number | null }> = new Map();\n\n constructor(\n private componentLoader: IComponentLoader\n ){\n\n }\n\n async getLayoutComponents(route:IRoute){\n const layout_paths = route.layout || [];\n const layouts_components = await Promise.all(layout_paths.map((layout)=>{\n log.debug(\"layout path\",layout)\n return this.componentLoader.load(layout)}))\n return layouts_components\n }\n\n async getLayouts(route:IRoute){\n const layout_paths = route.layout || [];\n const layouts_components = await Promise.all(layout_paths.map(async (layout_path)=>{\n const layout = await this.componentLoader.load(layout_path)\n return layout.default\n \n }))\n return layouts_components\n }\n\n async getLayoutLoaders(route:IRoute){\n const layout_paths = route.layout || [];\n \n // First, check for .load.js/.load.ts files using resolveLoader (maintains order)\n // Each loader at index N corresponds to the layout at index N\n const loaders_from_files = await Promise.all(\n layout_paths.map((layoutPath) => this.resolveLoader(layoutPath))\n );\n \n // Check if any need fallback to old-style component.load\n const needs_fallback = loaders_from_files.some(loader => !loader);\n \n if (needs_fallback) {\n // Fall back to old-style component.load for backward compatibility\n const layout_components = await this.getLayoutComponents(route);\n const old_style_loaders = layout_components.map(layout => layout.load);\n \n // Merge: prefer .load.js/.load.ts file loaders, fall back to old-style component.load\n // This maintains order: loader[index] corresponds to layout_paths[index]\n // Only include loaders that are actually functions\n return loaders_from_files.map((loader, index) => {\n const resolved = loader || old_style_loaders[index];\n return typeof resolved === 'function' ? resolved : null;\n });\n }\n \n return loaders_from_files;\n }\n\n\n async getViewComponent(route: IRoute) {\n return await this.componentLoader.load(route.view)\n }\n\n\n async hasLoaders(route:IRoute):Promise<boolean>{\n const componentPaths = [...(route.layout || []), route.view];\n\n for (const componentPath of componentPaths) {\n const loader = await this.resolveLoader(componentPath);\n if (loader) {\n return true;\n }\n }\n\n return false;\n }\n\n\n async getLoaders(route: IRoute) {\n const layoutPaths = route.layout || [];\n const layouts = await Promise.all(layoutPaths.map((layoutPath) => this.resolveLoader(layoutPath)));\n const view = await this.resolveLoader(route.view);\n\n return {\n layouts,\n view\n };\n }\n\n\n private getLoaderFilePath(componentPath?: string | null, extension: '.js' | '.ts' = '.js'): string | null {\n if (!componentPath) {\n return null;\n }\n\n const fullPath = this.componentLoader.getComponentFullPath(componentPath);\n const { dir, name } = path.parse(fullPath);\n return path.join(dir, `${name}.load${extension}`);\n }\n\n private async getFileMtime(filePath: string): Promise<number | null> {\n try {\n const stats = await stat(filePath);\n return stats.mtimeMs;\n } catch (error: any) {\n if (error?.code === 'ENOENT') {\n // File doesn't exist, return null\n return null;\n }\n // For other errors, log and return null\n log.debug(`Failed to stat file ${filePath}: ${error?.message}`);\n return null;\n }\n }\n\n\n private async resolveLoader(componentPath?: string | null): Promise<((...args: any[]) => any) | null> {\n if (!componentPath) {\n return null;\n }\n\n // Check mtimes of both .load.js and .load.ts files\n const jsLoaderPath = this.getLoaderFilePath(componentPath, '.js');\n const tsLoaderPath = this.getLoaderFilePath(componentPath, '.ts');\n\n const [jsMtime, tsMtime] = await Promise.all([\n jsLoaderPath ? this.getFileMtime(jsLoaderPath) : Promise.resolve(null),\n tsLoaderPath ? this.getFileMtime(tsLoaderPath) : Promise.resolve(null)\n ]);\n\n // Use most recent mtime if either file exists\n const currentMtime = Math.max(jsMtime || 0, tsMtime || 0) || null;\n\n // Check cache\n const cached = this.loaderCache.get(componentPath);\n if (cached && cached.mtime === currentMtime) {\n log.debug(`Cache hit for loader: ${componentPath} (mtime: ${currentMtime})`);\n return cached.result;\n }\n\n // Cache miss - resolve the loader\n log.debug(`Cache miss for loader: ${componentPath} (cached mtime: ${cached?.mtime}, current mtime: ${currentMtime})`);\n const result = await this._resolveLoaderInternal(componentPath);\n\n // Update cache\n this.loaderCache.set(componentPath, { result, mtime: currentMtime });\n\n return result;\n }\n\n private async _resolveLoaderInternal(componentPath: string): Promise<((...args: any[]) => any) | null> {\n // Try .load.js first (production), then .load.ts (development)\n const extensions: Array<'.js' | '.ts'> = ['.js', '.ts'];\n\n for (const ext of extensions) {\n const loaderFilePath = this.getLoaderFilePath(componentPath, ext);\n if (!loaderFilePath) {\n continue;\n }\n\n try {\n log.debug(`Trying loader path: ${loaderFilePath}`);\n const module = await import(pathToFileURL(loaderFilePath).href);\n const loader = module?.default;\n log.debug(`Imported loader module: default=${typeof loader}`);\n if (typeof loader === \"function\") {\n log.debug(`Loaded loader function from: ${loaderFilePath}`);\n return loader;\n }\n } catch (error: any) {\n const code = error?.code || error?.name || 'UNKNOWN_ERROR';\n if (code === \"MODULE_NOT_FOUND\" || code === \"ERR_MODULE_NOT_FOUND\") {\n log.debug(`Loader not found at ${loaderFilePath} (${ext}) - this is expected if no loader exists`);\n // File doesn't exist with this extension, try next one\n continue;\n }\n // Other errors (syntax errors, etc.) should be logged\n log.error(`Failed to load loader for ${componentPath} (${ext}) at ${loaderFilePath}:`, error);\n // Continue to try next extension\n }\n }\n\n // Neither .load.js nor .load.ts found\n return null;\n }\n\n\n async getView(route: IRoute) {\n const view = await this.componentLoader.load(route.view)\n return view.default\n }\n}\n","import pathToRegex from 'path-to-regex';\nimport type { IRoute } from '../parser/IRoute';\n\n\n\nexport function makeUrlParser(pattern: string) {\n const parser = new pathToRegex(pattern);\n return (pathname: string) => {\n const result = parser.match(pathname);\n if (!result) return null;\n\n // Decode URL-encoded param values\n const decoded: Record<string, string> = {};\n for (const [key, value] of Object.entries(result)) {\n decoded[key] = decodeURIComponent(value as string);\n }\n return decoded;\n };\n}\n\n\nexport type UrlMatcher = {\n pattern: string,\n parser: ReturnType<typeof makeUrlParser>\n}\n\nexport function findRoute(pathname:string, routes: UrlMatcher[]) {\n for (const { pattern, parser } of routes) {\n const params = parser(pathname);\n if (params) {\n return { pattern, params };\n }\n }\n return null;\n}\n\n\n\n\n\nexport function initialize_route_matchers(routes: IRoute[]): UrlMatcher[] {\n return routes.map((route: IRoute) => {\n const pattern = route.path;\n const parser = makeUrlParser(pattern);\n return { pattern, parser };\n })\n}\n"],"names":["log","path","fs","module"],"mappings":";;;;;;;;;;;;;AAQA,MAAMA,QAAM,UAAU,kBAAkB;AAWjC,MAAM,qBAAiD;AAAA,EAG1D,YAAoB,UAAkB;AAF9B;AAEY,SAAA,WAAA;AAElB,SAAK,mBAAmBC,cAAK,WAAW,QAAQ,IAC5C,WACAA,cAAK,QAAQ,QAAQ,IAAA,GAAO,QAAQ;AAAA,EAC1C;AAAA,EAEA,MAAM,KAAK,eAAuB;AAChC,UAAM,sBAAsB,KAAK,qBAAqB,aAAa;AAEnE,UAA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Q,GAAG,IAAI,mBAAmB,KAAe;AAAA,IACnD;AACA,WAAO;AAAA,EACT;AACF;AAQO,SAAS,UAAU,UAAiB,QAAsB;AAC/D,aAAW,EAAE,SAAS,OAAA,KAAY,QAAQ;AACxC,UAAM,SAAS,OAAO,QAAQ;AAC9B,QAAI,QAAQ;AACV,aAAO,EAAE,SAAS,OAAA;AAAA,IACpB;AAAA,EACF;AACA,SAAO;AACT;AAMO,SAAS,0BAA0B,QAAgC;AACxE,SAAO,OAAO,IAAI,CAAC,UAAkB;AACnC,UAAM,UAAU,MAAM;AACtB,UAAM,SAAS,cAAc,OAAO;AACpC,WAAO,EAAE,SAAS,OAAA;AAAA,EACpB,CAAC;AACH;"}
|
|
@@ -30,7 +30,8 @@ const logger = require("@noego/logger");
|
|
|
30
30
|
const yaml = require("js-yaml");
|
|
31
31
|
require("clone-deep");
|
|
32
32
|
const join = require("url-join");
|
|
33
|
-
const path$1 = require("./path-
|
|
33
|
+
const path$1 = require("./path-DCxJMpj7.cjs");
|
|
34
|
+
const util = require("util");
|
|
34
35
|
const pathToRegex = require("path-to-regex");
|
|
35
36
|
const log$2 = logger.getLogger("forge:components");
|
|
36
37
|
class BasicComponentLoader {
|
|
@@ -306,8 +307,10 @@ async function parse_openapi_config(openapi_config_path) {
|
|
|
306
307
|
return config;
|
|
307
308
|
}
|
|
308
309
|
const log = logger.getLogger("forge:components");
|
|
310
|
+
const stat = util.promisify(fs.stat);
|
|
309
311
|
class ComponentManager {
|
|
310
312
|
constructor(componentLoader) {
|
|
313
|
+
__publicField(this, "loaderCache", /* @__PURE__ */ new Map());
|
|
311
314
|
this.componentLoader = componentLoader;
|
|
312
315
|
}
|
|
313
316
|
async getLayoutComponents(route) {
|
|
@@ -372,10 +375,40 @@ class ComponentManager {
|
|
|
372
375
|
const { dir, name } = path.parse(fullPath);
|
|
373
376
|
return path.join(dir, `${name}.load${extension}`);
|
|
374
377
|
}
|
|
378
|
+
async getFileMtime(filePath) {
|
|
379
|
+
try {
|
|
380
|
+
const stats = await stat(filePath);
|
|
381
|
+
return stats.mtimeMs;
|
|
382
|
+
} catch (error) {
|
|
383
|
+
if ((error == null ? void 0 : error.code) === "ENOENT") {
|
|
384
|
+
return null;
|
|
385
|
+
}
|
|
386
|
+
log.debug(`Failed to stat file ${filePath}: ${error == null ? void 0 : error.message}`);
|
|
387
|
+
return null;
|
|
388
|
+
}
|
|
389
|
+
}
|
|
375
390
|
async resolveLoader(componentPath) {
|
|
376
391
|
if (!componentPath) {
|
|
377
392
|
return null;
|
|
378
393
|
}
|
|
394
|
+
const jsLoaderPath = this.getLoaderFilePath(componentPath, ".js");
|
|
395
|
+
const tsLoaderPath = this.getLoaderFilePath(componentPath, ".ts");
|
|
396
|
+
const [jsMtime, tsMtime] = await Promise.all([
|
|
397
|
+
jsLoaderPath ? this.getFileMtime(jsLoaderPath) : Promise.resolve(null),
|
|
398
|
+
tsLoaderPath ? this.getFileMtime(tsLoaderPath) : Promise.resolve(null)
|
|
399
|
+
]);
|
|
400
|
+
const currentMtime = Math.max(jsMtime || 0, tsMtime || 0) || null;
|
|
401
|
+
const cached = this.loaderCache.get(componentPath);
|
|
402
|
+
if (cached && cached.mtime === currentMtime) {
|
|
403
|
+
log.debug(`Cache hit for loader: ${componentPath} (mtime: ${currentMtime})`);
|
|
404
|
+
return cached.result;
|
|
405
|
+
}
|
|
406
|
+
log.debug(`Cache miss for loader: ${componentPath} (cached mtime: ${cached == null ? void 0 : cached.mtime}, current mtime: ${currentMtime})`);
|
|
407
|
+
const result = await this._resolveLoaderInternal(componentPath);
|
|
408
|
+
this.loaderCache.set(componentPath, { result, mtime: currentMtime });
|
|
409
|
+
return result;
|
|
410
|
+
}
|
|
411
|
+
async _resolveLoaderInternal(componentPath) {
|
|
379
412
|
const extensions = [".js", ".ts"];
|
|
380
413
|
for (const ext of extensions) {
|
|
381
414
|
const loaderFilePath = this.getLoaderFilePath(componentPath, ext);
|
|
@@ -394,7 +427,7 @@ class ComponentManager {
|
|
|
394
427
|
} catch (error) {
|
|
395
428
|
const code = (error == null ? void 0 : error.code) || (error == null ? void 0 : error.name) || "UNKNOWN_ERROR";
|
|
396
429
|
if (code === "MODULE_NOT_FOUND" || code === "ERR_MODULE_NOT_FOUND") {
|
|
397
|
-
log.
|
|
430
|
+
log.debug(`Loader not found at ${loaderFilePath} (${ext}) - this is expected if no loader exists`);
|
|
398
431
|
continue;
|
|
399
432
|
}
|
|
400
433
|
log.error(`Failed to load loader for ${componentPath} (${ext}) at ${loaderFilePath}:`, error);
|
|
@@ -442,4 +475,4 @@ exports.ViteComponentLoader = ViteComponentLoader;
|
|
|
442
475
|
exports.findRoute = findRoute;
|
|
443
476
|
exports.initialize_route_matchers = initialize_route_matchers;
|
|
444
477
|
exports.parse_openapi_config = parse_openapi_config;
|
|
445
|
-
//# sourceMappingURL=url_parser-
|
|
478
|
+
//# sourceMappingURL=url_parser-D7ZqJUTw.cjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"url_parser-BGkQselu.cjs","sources":["../src/routing/component_loader/component_loader.ts","../src/parser/openapi.ts","../src/routing/component_loader/component_manager.ts","../src/routing/url_parser.ts"],"sourcesContent":["import type { SvelteComponent } from 'svelte';\nimport type { ViteDevServer } from 'vite';\nimport path from 'path';\nimport fs from 'fs';\nimport { pathToFileURL } from 'url';\nimport { SvelteImport, SvelteModuleComponent } from '../base';\nimport { getLogger } from '@noego/logger';\n\nconst log = getLogger('forge:components');\n\n\ntype SvelteResource<K> = SvelteImport<K> & SvelteModuleComponent\n\nexport interface IComponentLoader{\n load(component: string,options?:any): Promise<SvelteResource<SvelteComponent>>\n getComponentFullPath(component: string, options?: any): string\n}\n\n\nexport class BasicComponentLoader implements IComponentLoader {\n private resolvedBasePath: string;\n\n constructor(private basePath: string) {\n // Resolve basePath relative to current working directory\n this.resolvedBasePath = path.isAbsolute(basePath)\n ? basePath\n : path.resolve(process.cwd(), basePath);\n }\n\n async load(componentPath: string) {\n const component_full_path = this.getComponentFullPath(componentPath);\n // Use pathToFileURL for proper ESM import of absolute paths\n const module = await import(pathToFileURL(component_full_path).href);\n return module as SvelteResource<any>;\n }\n\n getComponentFullPath(componentPath: string): string {\n return path.join(this.resolvedBasePath, componentPath);\n }\n}\n\n\n\nexport class ViteComponentLoader implements IComponentLoader {\n constructor(private basePath:string, private vite: ViteDevServer) {}\n \n async load(componentPath: string, options = {use_base_path:true}): Promise<SvelteResource<any>> {\n const absoluteComponentPath = this.getComponentFullPath(componentPath, options);\n\n log.debug(`Loading component from path: ${absoluteComponentPath}`);\n\n // Smart detection: check for precompiled .js file first\n const jsPath = absoluteComponentPath.replace(/\\.svelte$/, '.js');\n const jsExists = fs.existsSync(jsPath);\n\n // TODO: Remove this if we only need svelte files\n if (false && jsExists) {\n // Precompiled .js exists - use it directly (production mode)\n log.debug(`Found precompiled component at: ${jsPath}`);\n try {\n const module: any = await import(jsPath);\n log.debug(`Loaded precompiled module successfully`);\n return module as SvelteResource<any>;\n } catch (error) {\n log.error(`Error loading precompiled module from ${jsPath}`, error);\n throw error;\n }\n }\n\n // No .js file - fall back to Vite dev mode (.svelte)\n let vitePath = path.relative(process.cwd(), absoluteComponentPath);\n\n vitePath = vitePath.replace(/\\\\/g, '/');\n\n if (!vitePath.startsWith('/')) {\n vitePath = '/' + vitePath;\n }\n\n log.debug(`Resolved Vite path: ${vitePath} from componentPath: ${componentPath}`);\n\n\n try {\n log.debug(`Loading module for vitePath: ${vitePath}`);\n const module = await this.vite.ssrLoadModule(vitePath);\n log.debug(`Module loaded successfully for: ${vitePath}`);\n if (!module || !module.default) {\n log.error(`Loaded module for ${vitePath} is invalid or missing a default export. Module content:`, module);\n throw new Error(`Module ${vitePath} loaded successfully but is invalid or missing default export.`);\n }\n return module as SvelteResource<any>;\n } catch (error) {\n log.error(`Error loading module for vitePath: ${vitePath} (derived from componentPath: ${componentPath})`, error);\n\n try {\n await fs.promises.access(absoluteComponentPath);\n } catch (fsError) {\n }\n throw error;\n }\n }\n\n getComponentFullPath(componentPath: string, options = {use_base_path:true}): string {\n const use_base_path = options.use_base_path || false;\n\n if (use_base_path) {\n return path.join(this.basePath, componentPath);\n }\n\n if (path.isAbsolute(componentPath)) {\n return componentPath;\n }\n\n return componentPath;\n }\n}\n\n\nexport class ProdComponentLoader implements IComponentLoader {\n\n private componentMapPromise: Promise<Record<string, SvelteResource<any>>> | null = null;\n\n constructor(private base_path: string) {}\n\n async load(componentPath: string): Promise<SvelteResource<any>> {\n const normalized = this.normalizeKey(componentPath);\n\n try {\n const map = await this.loadComponentMap();\n const module = map[normalized];\n if (module) {\n return module;\n }\n } catch (error) {\n log.warn(`Failed to load component \"${componentPath}\" from entry manifest:`, error);\n }\n\n const component_path = this.getComponentFullPath(componentPath);\n const fallbackPath = component_path.endsWith('.js')\n ? component_path\n : component_path.replace(/\\.svelte$/, '.js');\n const module: any = await import(pathToFileURL(fallbackPath).href);\n return module as SvelteResource<any>;\n }\n\n getComponentFullPath(componentPath: string): string {\n return path.join(this.base_path, componentPath);\n }\n\n private normalizeKey(componentPath: string): string {\n const trimmed = componentPath.replace(/^\\.\\//, '');\n if (trimmed.endsWith('.svelte')) {\n return trimmed.replace(/\\.svelte$/, '.js');\n }\n return trimmed;\n }\n\n private async loadComponentMap(): Promise<Record<string, SvelteResource<any>>> {\n if (!this.componentMapPromise) {\n const entryPath = path.join(this.base_path, 'entry-ssr.js');\n const entryUrl = pathToFileURL(entryPath).href;\n this.componentMapPromise = import(entryUrl)\n .then((mod: any) => {\n const source = mod.components ?? mod.default ?? {};\n const normalized: Record<string, SvelteResource<any>> = {};\n for (const [key, value] of Object.entries<SvelteResource<any>>(source)) {\n const cleanKey = key.replace(/^\\.\\//, '');\n normalized[cleanKey] = value;\n if (cleanKey.startsWith('ui/')) {\n normalized[cleanKey.slice(3)] = value;\n }\n if (cleanKey.endsWith('.svelte')) {\n const jsKey = cleanKey.replace(/\\.svelte$/, '.js');\n normalized[jsKey] = value;\n }\n }\n return normalized;\n })\n .catch((error) => {\n this.componentMapPromise = null;\n throw error;\n });\n }\n return this.componentMapPromise;\n }\n}\n","import yaml from 'js-yaml'\nimport clone from 'clone-deep'\nimport join from 'url-join'\nimport type {IRoute, IServerRoute} from \"./IRoute\"\nimport {parsePathConfig} from \"./path\"\nimport fs from 'fs'\nimport { getLogger } from '@noego/logger'\n\nconst log = getLogger('forge:parser')\n\nconst HTTP_METHODS = new Set([\n 'get',\n 'post',\n 'put',\n 'delete',\n 'patch',\n 'head',\n 'options',\n 'trace'\n])\n\nfunction getGlobalPathsMiddleware(openapi:any): string[] {\n if (!openapi || !openapi.paths) {\n return []\n }\n const value = openapi.paths['x-middleware']\n return Array.isArray(value) ? [...value] : []\n}\n\nexport function parseConfigfile(file_content:string) {\n let config:any = null\n try {\n config = yaml.load(file_content)\n } catch (e) {\n log.error('Failed to parse config file:', e)\n }\n return config\n}\n\n\nexport function parse_modules(openapi:any, inheritedMiddleware: string[] = []){\n const modules_config = (openapi.modules || openapi.module)\n if (!modules_config) {\n return\n }\n\n // Detect format: array (deprecated) vs named object (new)\n const isArrayFormat = Array.isArray(modules_config)\n\n let moduleEntries: Array<{module: any, name: string, isObjectFormat: boolean}>\n\n if (isArrayFormat) {\n // Old array format - backwards compatible, log deprecation warning\n log.warn('Deprecation warning: Array format for modules is deprecated. ' +\n 'Please migrate to named object format: modules: { moduleName: { basePath, paths, x-layout } }')\n moduleEntries = modules_config.map((m: any, idx: number) => ({\n module: m,\n name: `module[${idx}]`,\n isObjectFormat: false\n }))\n } else {\n // New named object format - validate like Dinner\n moduleEntries = Object.entries(modules_config).map(([name, module]: [string, any]) => {\n if (!module.basePath) {\n throw new Error(`Module '${name}' is missing required 'basePath' property`)\n }\n if (!module.paths) {\n throw new Error(`Module '${name}' is missing required 'paths' property`)\n }\n return { module, name, isObjectFormat: true }\n })\n }\n\n const globalMiddleware = [...inheritedMiddleware, ...getGlobalPathsMiddleware(openapi)]\n\n const modules_path: (IRoute[] | undefined)[] = moduleEntries.map(({ module, isObjectFormat }) => {\n const basePath = module.basePath || ''\n // Use x-layout for object format, baseLayouts for array format (backwards compat)\n const baseLayouts = isObjectFormat\n ? (module['x-layout'] || [])\n : (module.baseLayouts || [])\n const moduleMiddleware = Array.isArray(module['x-middleware']) ? module['x-middleware'] : []\n const inherited = [...globalMiddleware, ...moduleMiddleware]\n\n const paths = module.paths\n\n if(!paths){\n return\n }\n\n const configurations = Object.entries(paths)\n .filter(([path]) => typeof path === 'string' && path.startsWith('/'))\n .map(([path, method_config]:[string,any]) => {\n return Object.entries(method_config)\n .filter(([method]) => HTTP_METHODS.has(String(method).toLowerCase()))\n .map(([method, config]) => {\n const methodName = String(method)\n return parsePathConfig(path,methodName,config,inherited)\n })\n })\n\n const routes = configurations.reduce((flat_config,config)=>{\n return flat_config.concat(config)\n },[])\n\n routes.forEach((route:IRoute) => {\n route.path = join(basePath, route.path)\n route.layout = baseLayouts.concat(route.layout|| [])\n })\n return routes\n })\n\n return modules_path.reduce((flat_config,config)=>{\n if (!config) {\n return flat_config\n }\n return flat_config.concat(config)\n }\n ,[] as IRoute[])\n}\n\n\nexport function parse_paths(openapi:any, inheritedMiddleware: string[] = []){\n const paths = openapi.paths\n if (!paths) {\n return\n }\n\n const globalMiddleware = [...inheritedMiddleware, ...getGlobalPathsMiddleware(openapi)]\n\n const configurations = Object.entries(paths)\n .filter(([path]) => typeof path === 'string' && path.startsWith('/'))\n .map(([path, method_config]:[string,any]) => {\n return Object.entries(method_config)\n .filter(([method]) => HTTP_METHODS.has(String(method).toLowerCase()))\n .map(([method, config]) => {\n const methodName = String(method)\n return parsePathConfig(path,methodName,config,globalMiddleware)\n })\n })\n\n const routes = configurations.reduce((flat_config,config)=>{\n return flat_config.concat(config)\n },[] as IRoute[])\n\n return routes\n}\n\n\n\n\nexport function transform_openapi_spec(openapi_spec:string) {\n\n const openapi = parseConfigfile(openapi_spec)\n const config = normalize_openapi_config(openapi)\n return yaml.dump(config)\n}\n\n\nexport function normalize_openapi_config(openapi_config:any){\n const config = clone(openapi_config)\n\n const modules = parse_modules(config) || []\n const paths = parse_paths(config) || []\n\n const routes = [...modules, ...paths]\n\n routes.forEach((route:IRoute) => {\n const path = route.path\n const method = route.method\n const config_path = config.paths[path] || {}\n const config_method = config_path[method] || {}\n\n config_method.summary = route.summary\n config_method.description = route.description\n config_method.parameters = route.parameters\n config_method.query = route.query\n config_method.body = route.body\n config_method.responses = route.responses\n config_method['x-view'] = route.view\n config_method['x-layout'] = route.layout\n if (route.middleware && route.middleware.length > 0) {\n config_method['x-middleware'] = route.middleware\n } else {\n delete config_method['x-middleware']\n }\n\n config_path[method] = config_method\n config.paths[path] = config_path\n })\n\n delete config.modules\n return config\n}\n\n\n/**\n * Check if a YAML document is a stitch configuration file\n * @param document The parsed YAML document\n * @returns True if it's a stitch config, false otherwise\n */\nfunction isStitchConfig(document: any): boolean {\n return document && typeof document === 'object' && 'stitch' in document;\n}\n\n/**\n * Check if a YAML document is a regular OpenAPI file\n * @param document The parsed YAML document\n * @returns True if it's a regular OpenAPI file, false otherwise\n */\nfunction isOpenAPIConfig(document: any): boolean {\n return document && typeof document === 'object' && ('paths' in document || 'module' in document || 'modules' in document);\n}\n\nexport async function parse_openapi_config(openapi_config_path:string):Promise<IServerRoute>{\n const content = fs.readFileSync(openapi_config_path, 'utf8')\n const parsed_config = parseConfigfile(content)\n \n let openapi_config: any;\n \n if (isStitchConfig(parsed_config)) {\n // Handle stitch configuration - build using Node.js stitch engine\n log.info('Detected stitch configuration, building with Node.js stitch engine...');\n\n try {\n const { StitchEngine } = await import('@noego/stitch');\n\n const startTime = Date.now();\n const engine = new StitchEngine();\n const result = engine.buildSync(openapi_config_path, { format: 'json' });\n\n if (!result.success) {\n throw new Error(`Stitch build failed: ${result.error}`);\n }\n\n const buildTime = Date.now() - startTime;\n log.info(`Stitch build completed in ${buildTime} ms – ${parsed_config.stitch ? parsed_config.stitch.length : 0} modules processed`);\n\n // Parse the JSON string result to get the JavaScript object\n openapi_config = typeof result.data === 'string' ? JSON.parse(result.data) : result.data;\n } catch (error) {\n throw new Error(`Failed to process stitch configuration: ${error instanceof Error ? error.message : String(error)}`);\n }\n } else if (isOpenAPIConfig(parsed_config)) {\n // Handle regular OpenAPI file (legacy path)\n log.info('Detected regular OpenAPI configuration');\n openapi_config = parsed_config;\n } else {\n throw new Error(`Invalid OpenAPI or stitch configuration file: ${openapi_config_path}. File must contain either 'stitch', 'paths', 'module', or 'modules' at the root level.`);\n }\n const globalPathsMiddleware = getGlobalPathsMiddleware(openapi_config)\n\n let modules = parse_modules(openapi_config) || []\n let paths = parse_paths(openapi_config) || []\n\n let fallback_layout = openapi_config['x-fallback-layout'] || null\n let fallback_view = openapi_config['x-fallback-view'] || null\n const fallback_middleware = Array.isArray(openapi_config['x-fallback-middleware'])\n ? [...openapi_config['x-fallback-middleware']]\n : [...globalPathsMiddleware]\n let fallback = {\n layout: fallback_layout ? [fallback_layout]:[],\n view: fallback_view,\n middleware: fallback_middleware\n }\n\n const routes = [...modules, ...paths]\n\n let config = {\n fallback,\n routes\n }\n return config\n}\n\n\nexport function transform_openapi_config(openapi_config:any):IRoute[] {\n let modules = parse_modules(openapi_config) || []\n let paths = parse_paths(openapi_config) || []\n\n let routes = [...modules, ...paths]\n return routes\n}\n","import path from \"path\";\nimport { pathToFileURL } from \"url\";\nimport type { IRoute } from \"../../parser/IRoute\";\nimport type { IComponentLoader } from \"./component_loader\";\nimport { getLogger } from '@noego/logger';\n\nconst log = getLogger('forge:components');\n\n\n\n\n\n\nexport class ComponentManager {\n\n constructor(\n private componentLoader: IComponentLoader\n ){\n\n }\n\n async getLayoutComponents(route:IRoute){\n const layout_paths = route.layout || [];\n const layouts_components = await Promise.all(layout_paths.map((layout)=>{\n log.debug(\"layout path\",layout)\n return this.componentLoader.load(layout)}))\n return layouts_components\n }\n\n async getLayouts(route:IRoute){\n const layout_paths = route.layout || [];\n const layouts_components = await Promise.all(layout_paths.map(async (layout_path)=>{\n const layout = await this.componentLoader.load(layout_path)\n return layout.default\n \n }))\n return layouts_components\n }\n\n async getLayoutLoaders(route:IRoute){\n const layout_paths = route.layout || [];\n \n // First, check for .load.js/.load.ts files using resolveLoader (maintains order)\n // Each loader at index N corresponds to the layout at index N\n const loaders_from_files = await Promise.all(\n layout_paths.map((layoutPath) => this.resolveLoader(layoutPath))\n );\n \n // Check if any need fallback to old-style component.load\n const needs_fallback = loaders_from_files.some(loader => !loader);\n \n if (needs_fallback) {\n // Fall back to old-style component.load for backward compatibility\n const layout_components = await this.getLayoutComponents(route);\n const old_style_loaders = layout_components.map(layout => layout.load);\n \n // Merge: prefer .load.js/.load.ts file loaders, fall back to old-style component.load\n // This maintains order: loader[index] corresponds to layout_paths[index]\n // Only include loaders that are actually functions\n return loaders_from_files.map((loader, index) => {\n const resolved = loader || old_style_loaders[index];\n return typeof resolved === 'function' ? resolved : null;\n });\n }\n \n return loaders_from_files;\n }\n\n\n async getViewComponent(route: IRoute) {\n return await this.componentLoader.load(route.view)\n }\n\n\n async hasLoaders(route:IRoute):Promise<boolean>{\n const componentPaths = [...(route.layout || []), route.view];\n\n for (const componentPath of componentPaths) {\n const loader = await this.resolveLoader(componentPath);\n if (loader) {\n return true;\n }\n }\n\n return false;\n }\n\n\n async getLoaders(route: IRoute) {\n const layoutPaths = route.layout || [];\n const layouts = await Promise.all(layoutPaths.map((layoutPath) => this.resolveLoader(layoutPath)));\n const view = await this.resolveLoader(route.view);\n\n return {\n layouts,\n view\n };\n }\n\n\n private getLoaderFilePath(componentPath?: string | null, extension: '.js' | '.ts' = '.js'): string | null {\n if (!componentPath) {\n return null;\n }\n\n const fullPath = this.componentLoader.getComponentFullPath(componentPath);\n const { dir, name } = path.parse(fullPath);\n return path.join(dir, `${name}.load${extension}`);\n }\n\n\n private async resolveLoader(componentPath?: string | null): Promise<((...args: any[]) => any) | null> {\n if (!componentPath) {\n return null;\n }\n\n // Try .load.js first (production), then .load.ts (development)\n const extensions: Array<'.js' | '.ts'> = ['.js', '.ts'];\n \n for (const ext of extensions) {\n const loaderFilePath = this.getLoaderFilePath(componentPath, ext);\n if (!loaderFilePath) {\n continue;\n }\n\n try {\n log.debug(`Trying loader path: ${loaderFilePath}`);\n const module = await import(pathToFileURL(loaderFilePath).href);\n const loader = module?.default;\n log.debug(`Imported loader module: default=${typeof loader}`);\n if (typeof loader === \"function\") {\n log.debug(`Loaded loader function from: ${loaderFilePath}`);\n return loader;\n }\n } catch (error: any) {\n const code = error?.code || error?.name || 'UNKNOWN_ERROR';\n if (code === \"MODULE_NOT_FOUND\" || code === \"ERR_MODULE_NOT_FOUND\") {\n log.warn(`Loader not found at ${loaderFilePath} (${ext}): ${error?.message || code}`);\n // File doesn't exist with this extension, try next one\n continue;\n }\n // Other errors (syntax errors, etc.) should be logged\n log.error(`Failed to load loader for ${componentPath} (${ext}) at ${loaderFilePath}:`, error);\n // Continue to try next extension\n }\n }\n\n // Neither .load.js nor .load.ts found\n return null;\n }\n\n\n async getView(route: IRoute) {\n const view = await this.componentLoader.load(route.view)\n return view.default\n }\n}\n","import pathToRegex from 'path-to-regex';\nimport type { IRoute } from '../parser/IRoute';\n\n\n\nexport function makeUrlParser(pattern: string) {\n const parser = new pathToRegex(pattern);\n return (pathname: string) => {\n const result = parser.match(pathname);\n if (!result) return null;\n\n // Decode URL-encoded param values\n const decoded: Record<string, string> = {};\n for (const [key, value] of Object.entries(result)) {\n decoded[key] = decodeURIComponent(value as string);\n }\n return decoded;\n };\n}\n\n\nexport type UrlMatcher = {\n pattern: string,\n parser: ReturnType<typeof makeUrlParser>\n}\n\nexport function findRoute(pathname:string, routes: UrlMatcher[]) {\n for (const { pattern, parser } of routes) {\n const params = parser(pathname);\n if (params) {\n return { pattern, params };\n }\n }\n return null;\n}\n\n\n\n\n\nexport function initialize_route_matchers(routes: IRoute[]): UrlMatcher[] {\n return routes.map((route: IRoute) => {\n const pattern = route.path;\n const parser = makeUrlParser(pattern);\n return { pattern, parser };\n })\n}\n"],"names":["log","getLogger","module","pathToFileURL","path","parsePathConfig"],"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,YAAI,SAAS,sBAAsB,SAAS,wBAAwB;AAChE,cAAI,KAAK,uBAAuB,cAAc,KAAK,GAAG,OAAM,+BAAO,YAAW,IAAI,EAAE;AAEpF;AAAA,QACJ;AAEA,YAAI,MAAM,6BAA6B,aAAa,KAAK,GAAG,QAAQ,cAAc,KAAK,KAAK;AAAA,MAEhG;AAAA,IACJ;AAGA,WAAO;AAAA,EACX;AAAA,EAGA,MAAM,QAAQ,OAAe;AACzB,UAAM,OAAO,MAAM,KAAK,gBAAgB,KAAK,MAAM,IAAI;AACvD,WAAO,KAAK;AAAA,EAChB;AACJ;ACvJO,SAAS,cAAc,SAAiB;AAC7C,QAAM,SAAS,IAAI,YAAY,OAAO;AACtC,SAAO,CAAC,aAAqB;AAC3B,UAAM,SAAS,OAAO,MAAM,QAAQ;AACpC,QAAI,CAAC,OAAQ,QAAO;AAGpB,UAAM,UAAkC,CAAA;AACxC,eAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,MAAM,GAAG;AACjD,cAAQ,GAAG,IAAI,mBAAmB,KAAe;AAAA,IACnD;AACA,WAAO;AAAA,EACT;AACF;AAQO,SAAS,UAAU,UAAiB,QAAsB;AAC/D,aAAW,EAAE,SAAS,OAAA,KAAY,QAAQ;AACxC,UAAM,SAAS,OAAO,QAAQ;AAC9B,QAAI,QAAQ;AACV,aAAO,EAAE,SAAS,OAAA;AAAA,IACpB;AAAA,EACF;AACA,SAAO;AACT;AAMO,SAAS,0BAA0B,QAAgC;AACxE,SAAO,OAAO,IAAI,CAAC,UAAkB;AACnC,UAAM,UAAU,MAAM;AACtB,UAAM,SAAS,cAAc,OAAO;AACpC,WAAO,EAAE,SAAS,OAAA;AAAA,EACpB,CAAC;AACH;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"url_parser-D7ZqJUTw.cjs","sources":["../src/routing/component_loader/component_loader.ts","../src/parser/openapi.ts","../src/routing/component_loader/component_manager.ts","../src/routing/url_parser.ts"],"sourcesContent":["import type { SvelteComponent } from 'svelte';\nimport type { ViteDevServer } from 'vite';\nimport path from 'path';\nimport fs from 'fs';\nimport { pathToFileURL } from 'url';\nimport { SvelteImport, SvelteModuleComponent } from '../base';\nimport { getLogger } from '@noego/logger';\n\nconst log = getLogger('forge:components');\n\n\ntype SvelteResource<K> = SvelteImport<K> & SvelteModuleComponent\n\nexport interface IComponentLoader{\n load(component: string,options?:any): Promise<SvelteResource<SvelteComponent>>\n getComponentFullPath(component: string, options?: any): string\n}\n\n\nexport class BasicComponentLoader implements IComponentLoader {\n private resolvedBasePath: string;\n\n constructor(private basePath: string) {\n // Resolve basePath relative to current working directory\n this.resolvedBasePath = path.isAbsolute(basePath)\n ? basePath\n : path.resolve(process.cwd(), basePath);\n }\n\n async load(componentPath: string) {\n const component_full_path = this.getComponentFullPath(componentPath);\n // Use pathToFileURL for proper ESM import of absolute paths\n const module = await import(pathToFileURL(component_full_path).href);\n return module as SvelteResource<any>;\n }\n\n getComponentFullPath(componentPath: string): string {\n return path.join(this.resolvedBasePath, componentPath);\n }\n}\n\n\n\nexport class ViteComponentLoader implements IComponentLoader {\n constructor(private basePath:string, private vite: ViteDevServer) {}\n \n async load(componentPath: string, options = {use_base_path:true}): Promise<SvelteResource<any>> {\n const absoluteComponentPath = this.getComponentFullPath(componentPath, options);\n\n log.debug(`Loading component from path: ${absoluteComponentPath}`);\n\n // Smart detection: check for precompiled .js file first\n const jsPath = absoluteComponentPath.replace(/\\.svelte$/, '.js');\n const jsExists = fs.existsSync(jsPath);\n\n // TODO: Remove this if we only need svelte files\n if (false && jsExists) {\n // Precompiled .js exists - use it directly (production mode)\n log.debug(`Found precompiled component at: ${jsPath}`);\n try {\n const module: any = await import(jsPath);\n log.debug(`Loaded precompiled module successfully`);\n return module as SvelteResource<any>;\n } catch (error) {\n log.error(`Error loading precompiled module from ${jsPath}`, error);\n throw error;\n }\n }\n\n // No .js file - fall back to Vite dev mode (.svelte)\n let vitePath = path.relative(process.cwd(), absoluteComponentPath);\n\n vitePath = vitePath.replace(/\\\\/g, '/');\n\n if (!vitePath.startsWith('/')) {\n vitePath = '/' + vitePath;\n }\n\n log.debug(`Resolved Vite path: ${vitePath} from componentPath: ${componentPath}`);\n\n\n try {\n log.debug(`Loading module for vitePath: ${vitePath}`);\n const module = await this.vite.ssrLoadModule(vitePath);\n log.debug(`Module loaded successfully for: ${vitePath}`);\n if (!module || !module.default) {\n log.error(`Loaded module for ${vitePath} is invalid or missing a default export. Module content:`, module);\n throw new Error(`Module ${vitePath} loaded successfully but is invalid or missing default export.`);\n }\n return module as SvelteResource<any>;\n } catch (error) {\n log.error(`Error loading module for vitePath: ${vitePath} (derived from componentPath: ${componentPath})`, error);\n\n try {\n await fs.promises.access(absoluteComponentPath);\n } catch (fsError) {\n }\n throw error;\n }\n }\n\n getComponentFullPath(componentPath: string, options = {use_base_path:true}): string {\n const use_base_path = options.use_base_path || false;\n\n if (use_base_path) {\n return path.join(this.basePath, componentPath);\n }\n\n if (path.isAbsolute(componentPath)) {\n return componentPath;\n }\n\n return componentPath;\n }\n}\n\n\nexport class ProdComponentLoader implements IComponentLoader {\n\n private componentMapPromise: Promise<Record<string, SvelteResource<any>>> | null = null;\n\n constructor(private base_path: string) {}\n\n async load(componentPath: string): Promise<SvelteResource<any>> {\n const normalized = this.normalizeKey(componentPath);\n\n try {\n const map = await this.loadComponentMap();\n const module = map[normalized];\n if (module) {\n return module;\n }\n } catch (error) {\n log.warn(`Failed to load component \"${componentPath}\" from entry manifest:`, error);\n }\n\n const component_path = this.getComponentFullPath(componentPath);\n const fallbackPath = component_path.endsWith('.js')\n ? component_path\n : component_path.replace(/\\.svelte$/, '.js');\n const module: any = await import(pathToFileURL(fallbackPath).href);\n return module as SvelteResource<any>;\n }\n\n getComponentFullPath(componentPath: string): string {\n return path.join(this.base_path, componentPath);\n }\n\n private normalizeKey(componentPath: string): string {\n const trimmed = componentPath.replace(/^\\.\\//, '');\n if (trimmed.endsWith('.svelte')) {\n return trimmed.replace(/\\.svelte$/, '.js');\n }\n return trimmed;\n }\n\n private async loadComponentMap(): Promise<Record<string, SvelteResource<any>>> {\n if (!this.componentMapPromise) {\n const entryPath = path.join(this.base_path, 'entry-ssr.js');\n const entryUrl = pathToFileURL(entryPath).href;\n this.componentMapPromise = import(entryUrl)\n .then((mod: any) => {\n const source = mod.components ?? mod.default ?? {};\n const normalized: Record<string, SvelteResource<any>> = {};\n for (const [key, value] of Object.entries<SvelteResource<any>>(source)) {\n const cleanKey = key.replace(/^\\.\\//, '');\n normalized[cleanKey] = value;\n if (cleanKey.startsWith('ui/')) {\n normalized[cleanKey.slice(3)] = value;\n }\n if (cleanKey.endsWith('.svelte')) {\n const jsKey = cleanKey.replace(/\\.svelte$/, '.js');\n normalized[jsKey] = value;\n }\n }\n return normalized;\n })\n .catch((error) => {\n this.componentMapPromise = null;\n throw error;\n });\n }\n return this.componentMapPromise;\n }\n}\n","import yaml from 'js-yaml'\nimport clone from 'clone-deep'\nimport join from 'url-join'\nimport type {IRoute, IServerRoute} from \"./IRoute\"\nimport {parsePathConfig} from \"./path\"\nimport fs from 'fs'\nimport { getLogger } from '@noego/logger'\n\nconst log = getLogger('forge:parser')\n\nconst HTTP_METHODS = new Set([\n 'get',\n 'post',\n 'put',\n 'delete',\n 'patch',\n 'head',\n 'options',\n 'trace'\n])\n\nfunction getGlobalPathsMiddleware(openapi:any): string[] {\n if (!openapi || !openapi.paths) {\n return []\n }\n const value = openapi.paths['x-middleware']\n return Array.isArray(value) ? [...value] : []\n}\n\nexport function parseConfigfile(file_content:string) {\n let config:any = null\n try {\n config = yaml.load(file_content)\n } catch (e) {\n log.error('Failed to parse config file:', e)\n }\n return config\n}\n\n\nexport function parse_modules(openapi:any, inheritedMiddleware: string[] = []){\n const modules_config = (openapi.modules || openapi.module)\n if (!modules_config) {\n return\n }\n\n // Detect format: array (deprecated) vs named object (new)\n const isArrayFormat = Array.isArray(modules_config)\n\n let moduleEntries: Array<{module: any, name: string, isObjectFormat: boolean}>\n\n if (isArrayFormat) {\n // Old array format - backwards compatible, log deprecation warning\n log.warn('Deprecation warning: Array format for modules is deprecated. ' +\n 'Please migrate to named object format: modules: { moduleName: { basePath, paths, x-layout } }')\n moduleEntries = modules_config.map((m: any, idx: number) => ({\n module: m,\n name: `module[${idx}]`,\n isObjectFormat: false\n }))\n } else {\n // New named object format - validate like Dinner\n moduleEntries = Object.entries(modules_config).map(([name, module]: [string, any]) => {\n if (!module.basePath) {\n throw new Error(`Module '${name}' is missing required 'basePath' property`)\n }\n if (!module.paths) {\n throw new Error(`Module '${name}' is missing required 'paths' property`)\n }\n return { module, name, isObjectFormat: true }\n })\n }\n\n const globalMiddleware = [...inheritedMiddleware, ...getGlobalPathsMiddleware(openapi)]\n\n const modules_path: (IRoute[] | undefined)[] = moduleEntries.map(({ module, isObjectFormat }) => {\n const basePath = module.basePath || ''\n // Use x-layout for object format, baseLayouts for array format (backwards compat)\n const baseLayouts = isObjectFormat\n ? (module['x-layout'] || [])\n : (module.baseLayouts || [])\n const moduleMiddleware = Array.isArray(module['x-middleware']) ? module['x-middleware'] : []\n const inherited = [...globalMiddleware, ...moduleMiddleware]\n\n const paths = module.paths\n\n if(!paths){\n return\n }\n\n const configurations = Object.entries(paths)\n .filter(([path]) => typeof path === 'string' && path.startsWith('/'))\n .map(([path, method_config]:[string,any]) => {\n return Object.entries(method_config)\n .filter(([method]) => HTTP_METHODS.has(String(method).toLowerCase()))\n .map(([method, config]) => {\n const methodName = String(method)\n return parsePathConfig(path,methodName,config,inherited)\n })\n })\n\n const routes = configurations.reduce((flat_config,config)=>{\n return flat_config.concat(config)\n },[])\n\n routes.forEach((route:IRoute) => {\n route.path = join(basePath, route.path)\n route.layout = baseLayouts.concat(route.layout|| [])\n })\n return routes\n })\n\n return modules_path.reduce((flat_config,config)=>{\n if (!config) {\n return flat_config\n }\n return flat_config.concat(config)\n }\n ,[] as IRoute[])\n}\n\n\nexport function parse_paths(openapi:any, inheritedMiddleware: string[] = []){\n const paths = openapi.paths\n if (!paths) {\n return\n }\n\n const globalMiddleware = [...inheritedMiddleware, ...getGlobalPathsMiddleware(openapi)]\n\n const configurations = Object.entries(paths)\n .filter(([path]) => typeof path === 'string' && path.startsWith('/'))\n .map(([path, method_config]:[string,any]) => {\n return Object.entries(method_config)\n .filter(([method]) => HTTP_METHODS.has(String(method).toLowerCase()))\n .map(([method, config]) => {\n const methodName = String(method)\n return parsePathConfig(path,methodName,config,globalMiddleware)\n })\n })\n\n const routes = configurations.reduce((flat_config,config)=>{\n return flat_config.concat(config)\n },[] as IRoute[])\n\n return routes\n}\n\n\n\n\nexport function transform_openapi_spec(openapi_spec:string) {\n\n const openapi = parseConfigfile(openapi_spec)\n const config = normalize_openapi_config(openapi)\n return yaml.dump(config)\n}\n\n\nexport function normalize_openapi_config(openapi_config:any){\n const config = clone(openapi_config)\n\n const modules = parse_modules(config) || []\n const paths = parse_paths(config) || []\n\n const routes = [...modules, ...paths]\n\n routes.forEach((route:IRoute) => {\n const path = route.path\n const method = route.method\n const config_path = config.paths[path] || {}\n const config_method = config_path[method] || {}\n\n config_method.summary = route.summary\n config_method.description = route.description\n config_method.parameters = route.parameters\n config_method.query = route.query\n config_method.body = route.body\n config_method.responses = route.responses\n config_method['x-view'] = route.view\n config_method['x-layout'] = route.layout\n if (route.middleware && route.middleware.length > 0) {\n config_method['x-middleware'] = route.middleware\n } else {\n delete config_method['x-middleware']\n }\n\n config_path[method] = config_method\n config.paths[path] = config_path\n })\n\n delete config.modules\n return config\n}\n\n\n/**\n * Check if a YAML document is a stitch configuration file\n * @param document The parsed YAML document\n * @returns True if it's a stitch config, false otherwise\n */\nfunction isStitchConfig(document: any): boolean {\n return document && typeof document === 'object' && 'stitch' in document;\n}\n\n/**\n * Check if a YAML document is a regular OpenAPI file\n * @param document The parsed YAML document\n * @returns True if it's a regular OpenAPI file, false otherwise\n */\nfunction isOpenAPIConfig(document: any): boolean {\n return document && typeof document === 'object' && ('paths' in document || 'module' in document || 'modules' in document);\n}\n\nexport async function parse_openapi_config(openapi_config_path:string):Promise<IServerRoute>{\n const content = fs.readFileSync(openapi_config_path, 'utf8')\n const parsed_config = parseConfigfile(content)\n \n let openapi_config: any;\n \n if (isStitchConfig(parsed_config)) {\n // Handle stitch configuration - build using Node.js stitch engine\n log.info('Detected stitch configuration, building with Node.js stitch engine...');\n\n try {\n const { StitchEngine } = await import('@noego/stitch');\n\n const startTime = Date.now();\n const engine = new StitchEngine();\n const result = engine.buildSync(openapi_config_path, { format: 'json' });\n\n if (!result.success) {\n throw new Error(`Stitch build failed: ${result.error}`);\n }\n\n const buildTime = Date.now() - startTime;\n log.info(`Stitch build completed in ${buildTime} ms – ${parsed_config.stitch ? parsed_config.stitch.length : 0} modules processed`);\n\n // Parse the JSON string result to get the JavaScript object\n openapi_config = typeof result.data === 'string' ? JSON.parse(result.data) : result.data;\n } catch (error) {\n throw new Error(`Failed to process stitch configuration: ${error instanceof Error ? error.message : String(error)}`);\n }\n } else if (isOpenAPIConfig(parsed_config)) {\n // Handle regular OpenAPI file (legacy path)\n log.info('Detected regular OpenAPI configuration');\n openapi_config = parsed_config;\n } else {\n throw new Error(`Invalid OpenAPI or stitch configuration file: ${openapi_config_path}. File must contain either 'stitch', 'paths', 'module', or 'modules' at the root level.`);\n }\n const globalPathsMiddleware = getGlobalPathsMiddleware(openapi_config)\n\n let modules = parse_modules(openapi_config) || []\n let paths = parse_paths(openapi_config) || []\n\n let fallback_layout = openapi_config['x-fallback-layout'] || null\n let fallback_view = openapi_config['x-fallback-view'] || null\n const fallback_middleware = Array.isArray(openapi_config['x-fallback-middleware'])\n ? [...openapi_config['x-fallback-middleware']]\n : [...globalPathsMiddleware]\n let fallback = {\n layout: fallback_layout ? [fallback_layout]:[],\n view: fallback_view,\n middleware: fallback_middleware\n }\n\n const routes = [...modules, ...paths]\n\n let config = {\n fallback,\n routes\n }\n return config\n}\n\n\nexport function transform_openapi_config(openapi_config:any):IRoute[] {\n let modules = parse_modules(openapi_config) || []\n let paths = parse_paths(openapi_config) || []\n\n let routes = [...modules, ...paths]\n return routes\n}\n","import path from \"path\";\nimport { pathToFileURL } from \"url\";\nimport fs from \"fs\";\nimport { promisify } from \"util\";\nimport type { IRoute } from \"../../parser/IRoute\";\nimport type { IComponentLoader } from \"./component_loader\";\nimport { getLogger } from '@noego/logger';\n\nconst log = getLogger('forge:components');\nconst stat = promisify(fs.stat);\n\n\n\n\n\n\nexport class ComponentManager {\n private loaderCache: Map<string, { result: any | null, mtime: number | null }> = new Map();\n\n constructor(\n private componentLoader: IComponentLoader\n ){\n\n }\n\n async getLayoutComponents(route:IRoute){\n const layout_paths = route.layout || [];\n const layouts_components = await Promise.all(layout_paths.map((layout)=>{\n log.debug(\"layout path\",layout)\n return this.componentLoader.load(layout)}))\n return layouts_components\n }\n\n async getLayouts(route:IRoute){\n const layout_paths = route.layout || [];\n const layouts_components = await Promise.all(layout_paths.map(async (layout_path)=>{\n const layout = await this.componentLoader.load(layout_path)\n return layout.default\n \n }))\n return layouts_components\n }\n\n async getLayoutLoaders(route:IRoute){\n const layout_paths = route.layout || [];\n \n // First, check for .load.js/.load.ts files using resolveLoader (maintains order)\n // Each loader at index N corresponds to the layout at index N\n const loaders_from_files = await Promise.all(\n layout_paths.map((layoutPath) => this.resolveLoader(layoutPath))\n );\n \n // Check if any need fallback to old-style component.load\n const needs_fallback = loaders_from_files.some(loader => !loader);\n \n if (needs_fallback) {\n // Fall back to old-style component.load for backward compatibility\n const layout_components = await this.getLayoutComponents(route);\n const old_style_loaders = layout_components.map(layout => layout.load);\n \n // Merge: prefer .load.js/.load.ts file loaders, fall back to old-style component.load\n // This maintains order: loader[index] corresponds to layout_paths[index]\n // Only include loaders that are actually functions\n return loaders_from_files.map((loader, index) => {\n const resolved = loader || old_style_loaders[index];\n return typeof resolved === 'function' ? resolved : null;\n });\n }\n \n return loaders_from_files;\n }\n\n\n async getViewComponent(route: IRoute) {\n return await this.componentLoader.load(route.view)\n }\n\n\n async hasLoaders(route:IRoute):Promise<boolean>{\n const componentPaths = [...(route.layout || []), route.view];\n\n for (const componentPath of componentPaths) {\n const loader = await this.resolveLoader(componentPath);\n if (loader) {\n return true;\n }\n }\n\n return false;\n }\n\n\n async getLoaders(route: IRoute) {\n const layoutPaths = route.layout || [];\n const layouts = await Promise.all(layoutPaths.map((layoutPath) => this.resolveLoader(layoutPath)));\n const view = await this.resolveLoader(route.view);\n\n return {\n layouts,\n view\n };\n }\n\n\n private getLoaderFilePath(componentPath?: string | null, extension: '.js' | '.ts' = '.js'): string | null {\n if (!componentPath) {\n return null;\n }\n\n const fullPath = this.componentLoader.getComponentFullPath(componentPath);\n const { dir, name } = path.parse(fullPath);\n return path.join(dir, `${name}.load${extension}`);\n }\n\n private async getFileMtime(filePath: string): Promise<number | null> {\n try {\n const stats = await stat(filePath);\n return stats.mtimeMs;\n } catch (error: any) {\n if (error?.code === 'ENOENT') {\n // File doesn't exist, return null\n return null;\n }\n // For other errors, log and return null\n log.debug(`Failed to stat file ${filePath}: ${error?.message}`);\n return null;\n }\n }\n\n\n private async resolveLoader(componentPath?: string | null): Promise<((...args: any[]) => any) | null> {\n if (!componentPath) {\n return null;\n }\n\n // Check mtimes of both .load.js and .load.ts files\n const jsLoaderPath = this.getLoaderFilePath(componentPath, '.js');\n const tsLoaderPath = this.getLoaderFilePath(componentPath, '.ts');\n\n const [jsMtime, tsMtime] = await Promise.all([\n jsLoaderPath ? this.getFileMtime(jsLoaderPath) : Promise.resolve(null),\n tsLoaderPath ? this.getFileMtime(tsLoaderPath) : Promise.resolve(null)\n ]);\n\n // Use most recent mtime if either file exists\n const currentMtime = Math.max(jsMtime || 0, tsMtime || 0) || null;\n\n // Check cache\n const cached = this.loaderCache.get(componentPath);\n if (cached && cached.mtime === currentMtime) {\n log.debug(`Cache hit for loader: ${componentPath} (mtime: ${currentMtime})`);\n return cached.result;\n }\n\n // Cache miss - resolve the loader\n log.debug(`Cache miss for loader: ${componentPath} (cached mtime: ${cached?.mtime}, current mtime: ${currentMtime})`);\n const result = await this._resolveLoaderInternal(componentPath);\n\n // Update cache\n this.loaderCache.set(componentPath, { result, mtime: currentMtime });\n\n return result;\n }\n\n private async _resolveLoaderInternal(componentPath: string): Promise<((...args: any[]) => any) | null> {\n // Try .load.js first (production), then .load.ts (development)\n const extensions: Array<'.js' | '.ts'> = ['.js', '.ts'];\n\n for (const ext of extensions) {\n const loaderFilePath = this.getLoaderFilePath(componentPath, ext);\n if (!loaderFilePath) {\n continue;\n }\n\n try {\n log.debug(`Trying loader path: ${loaderFilePath}`);\n const module = await import(pathToFileURL(loaderFilePath).href);\n const loader = module?.default;\n log.debug(`Imported loader module: default=${typeof loader}`);\n if (typeof loader === \"function\") {\n log.debug(`Loaded loader function from: ${loaderFilePath}`);\n return loader;\n }\n } catch (error: any) {\n const code = error?.code || error?.name || 'UNKNOWN_ERROR';\n if (code === \"MODULE_NOT_FOUND\" || code === \"ERR_MODULE_NOT_FOUND\") {\n log.debug(`Loader not found at ${loaderFilePath} (${ext}) - this is expected if no loader exists`);\n // File doesn't exist with this extension, try next one\n continue;\n }\n // Other errors (syntax errors, etc.) should be logged\n log.error(`Failed to load loader for ${componentPath} (${ext}) at ${loaderFilePath}:`, error);\n // Continue to try next extension\n }\n }\n\n // Neither .load.js nor .load.ts found\n return null;\n }\n\n\n async getView(route: IRoute) {\n const view = await this.componentLoader.load(route.view)\n return view.default\n }\n}\n","import pathToRegex from 'path-to-regex';\nimport type { IRoute } from '../parser/IRoute';\n\n\n\nexport function makeUrlParser(pattern: string) {\n const parser = new pathToRegex(pattern);\n return (pathname: string) => {\n const result = parser.match(pathname);\n if (!result) return null;\n\n // Decode URL-encoded param values\n const decoded: Record<string, string> = {};\n for (const [key, value] of Object.entries(result)) {\n decoded[key] = decodeURIComponent(value as string);\n }\n return decoded;\n };\n}\n\n\nexport type UrlMatcher = {\n pattern: string,\n parser: ReturnType<typeof makeUrlParser>\n}\n\nexport function findRoute(pathname:string, routes: UrlMatcher[]) {\n for (const { pattern, parser } of routes) {\n const params = parser(pathname);\n if (params) {\n return { pattern, params };\n }\n }\n return null;\n}\n\n\n\n\n\nexport function initialize_route_matchers(routes: IRoute[]): UrlMatcher[] {\n return routes.map((route: IRoute) => {\n const pattern = route.path;\n const parser = makeUrlParser(pattern);\n return { pattern, parser };\n })\n}\n"],"names":["log","getLogger","module","pathToFileURL","path","parsePathConfig","promisify"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,MAAMA,QAAMC,OAAAA,UAAU,kBAAkB;AAWjC,MAAM,qBAAiD;AAAA,EAG1D,YAAoB,UAAkB;AAF9B;AAEY,SAAA,WAAA;AAElB,SAAK,mBAAmB,KAAK,WAAW,QAAQ,IAC5C,WACA,KAAK,QAAQ,QAAQ,IAAA,GAAO,QAAQ;AAAA,EAC1C;AAAA,EAEA,MAAM,KAAK,eAAuB;AAChC,UAAM,sBAAsB,KAAK,qBAAqB,aAAa;AAEnE,UAAMC,UAAS,MAAM,OAAOC,IAAAA,cAAc,mBAAmB,EAAE;AAC/D,WAAOD;AAAA,EACT;AAAA,EAEA,qBAAqB,eAA+B;AAClD,WAAO,KAAK,KAAK,KAAK,kBAAkB,aAAa;AAAA,EACvD;AACJ;AAIO,MAAM,oBAAgD;AAAA,EACzD,YAAoB,UAAyB,MAAqB;AAA9C,SAAA,WAAA;AAAyB,SAAA,OAAA;AAAA,EAAsB;AAAA,EAEnE,MAAM,KAAK,eAAuB,UAAU,EAAC,eAAc,QAAqC;AAC5F,UAAM,wBAAwB,KAAK,qBAAqB,eAAe,OAAO;AAE9EF,UAAI,MAAM,gCAAgC,qBAAqB,EAAE;AAGjE,UAAM,SAAS,sBAAsB,QAAQ,aAAa,KAAK;AAC9C,OAAG,WAAW,MAAM;AAiBrC,QAAI,WAAW,KAAK,SAAS,QAAQ,IAAA,GAAO,qBAAqB;AAEjE,eAAW,SAAS,QAAQ,OAAO,GAAG;AAEtC,QAAI,CAAC,SAAS,WAAW,GAAG,GAAG;AAC3B,iBAAW,MAAM;AAAA,IACrB;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|
3
|
+
"version": "0.1.27",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"imports": {
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
},
|
|
90
90
|
"peerDependencies": {
|
|
91
91
|
"eslint": "^9.0.0",
|
|
92
|
-
"eslint-plugin-svelte": "^
|
|
92
|
+
"eslint-plugin-svelte": "^3.14.0",
|
|
93
93
|
"express": "^4",
|
|
94
94
|
"playwright": "^1.40.0",
|
|
95
95
|
"svelte": "^5.28.2",
|
|
@@ -77,6 +77,9 @@
|
|
|
77
77
|
console.log('[RecursiveRender] Data received:', { data, view_data, viewName: view?.name, viewPath });
|
|
78
78
|
})
|
|
79
79
|
|
|
80
|
+
// PageController instance (if route has x-controller)
|
|
81
|
+
let controller = $derived(active.controller);
|
|
82
|
+
|
|
80
83
|
// Compute a stable key for the {#key} block that changes when navigation occurs
|
|
81
84
|
// This forces Svelte to destroy the old component tree before rendering the new one,
|
|
82
85
|
// preventing the race condition where old components receive new props
|
|
@@ -151,14 +154,14 @@
|
|
|
151
154
|
|
|
152
155
|
{#if errorState}
|
|
153
156
|
<!-- Error UI rendered outside the boundary so navigation can clear it -->
|
|
154
|
-
<div style="padding: 2rem; background: #fee; border: 2px solid #c00; border-radius: 8px; margin: 1rem;">
|
|
157
|
+
<div style="padding: 2rem; background: #fee; border: 2px solid #c00; border-radius: 8px; margin: 1rem; color: #222;">
|
|
155
158
|
<h2 style="color: #c00; margin-top: 0;">Error Rendering Page</h2>
|
|
156
159
|
<p><strong>View:</strong> <code style="background: #fff; padding: 2px 6px; border-radius: 3px;">{errorState.context.viewPath || errorState.context.viewName || 'Unknown'}</code></p>
|
|
157
160
|
{#if errorState.context.layoutPaths?.length > 0}
|
|
158
161
|
<p><strong>Layouts:</strong> {errorState.context.layoutPaths.map((p: string) => p).join(' → ')}</p>
|
|
159
162
|
{/if}
|
|
160
163
|
<p><strong>Error:</strong> {errorState.error?.message || String(errorState.error)}</p>
|
|
161
|
-
<p style="font-size: 0.85em; color: #
|
|
164
|
+
<p style="font-size: 0.85em; color: #444;"><strong>Captured at:</strong> {errorState.context.timestamp}</p>
|
|
162
165
|
|
|
163
166
|
<!-- Stack Trace -->
|
|
164
167
|
<details open style="margin-top: 1rem;">
|
|
@@ -244,14 +247,23 @@
|
|
|
244
247
|
/>
|
|
245
248
|
{:else if topLayout}
|
|
246
249
|
{#snippet view_child()}
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
250
|
+
{#if controller}
|
|
251
|
+
<svelte:component
|
|
252
|
+
this={view}
|
|
253
|
+
data={controller.data}
|
|
254
|
+
input={controller.input}
|
|
255
|
+
events={controller.events}
|
|
256
|
+
/>
|
|
257
|
+
{:else}
|
|
258
|
+
<svelte:component
|
|
259
|
+
this={view}
|
|
260
|
+
{...(view_data || {})}
|
|
261
|
+
params={params}
|
|
262
|
+
urlParams={urlParams}
|
|
263
|
+
query={query}
|
|
264
|
+
page={page}
|
|
265
|
+
/>
|
|
266
|
+
{/if}
|
|
255
267
|
{/snippet}
|
|
256
268
|
<svelte:component
|
|
257
269
|
this={topLayout}
|
|
@@ -263,14 +275,23 @@
|
|
|
263
275
|
children={view_child}
|
|
264
276
|
/>
|
|
265
277
|
{:else}
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
278
|
+
{#if controller}
|
|
279
|
+
<svelte:component
|
|
280
|
+
this={view}
|
|
281
|
+
data={controller.data}
|
|
282
|
+
input={controller.input}
|
|
283
|
+
events={controller.events}
|
|
284
|
+
/>
|
|
285
|
+
{:else}
|
|
286
|
+
<svelte:component
|
|
287
|
+
this={view}
|
|
288
|
+
{...(view_data || {})}
|
|
289
|
+
params={params}
|
|
290
|
+
urlParams={urlParams}
|
|
291
|
+
query={query}
|
|
292
|
+
page={page}
|
|
293
|
+
/>
|
|
294
|
+
{/if}
|
|
274
295
|
{/if}
|
|
275
296
|
</svelte:boundary>
|
|
276
297
|
{/key}
|