@analogjs/vite-plugin-angular 3.0.0-beta.57 → 3.0.0-beta.59

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.
Files changed (85) hide show
  1. package/migrations/migrate-setup-vitest/migrate-setup-vitest.js +1 -2
  2. package/package.json +2 -2
  3. package/src/index.js +1 -2
  4. package/src/lib/analog-plugin-interop.js +1 -2
  5. package/src/lib/angular-build-context.js +3 -4
  6. package/src/lib/angular-build-optimizer-plugin.js +2 -3
  7. package/src/lib/angular-jit-plugin.js +3 -4
  8. package/src/lib/angular-vite-plugin.js +4 -5
  9. package/src/lib/angular-vitest-plugin.js +2 -3
  10. package/src/lib/companion-plugins.js +2 -3
  11. package/src/lib/compilation-api/compilation-api-plugin.js +6 -7
  12. package/src/lib/compilation-api/index.js +1 -2
  13. package/src/lib/compiler/angular-version.js +0 -1
  14. package/src/lib/compiler/class-field-lowering.js +1 -2
  15. package/src/lib/compiler/compile.js +2 -3
  16. package/src/lib/compiler/compile.js.map +1 -1
  17. package/src/lib/compiler/constants.js +1 -2
  18. package/src/lib/compiler/debug.js +1 -2
  19. package/src/lib/compiler/defer.js +1 -2
  20. package/src/lib/compiler/dts-reader.js +1 -2
  21. package/src/lib/compiler/dts-reader.js.map +1 -1
  22. package/src/lib/compiler/hmr.js +1 -2
  23. package/src/lib/compiler/index.js +3 -3
  24. package/src/lib/compiler/jit-metadata.js +1 -2
  25. package/src/lib/compiler/jit-transform.js +2 -3
  26. package/src/lib/compiler/js-emitter.js +1 -2
  27. package/src/lib/compiler/metadata.js +2 -3
  28. package/src/lib/compiler/registry.js +2 -3
  29. package/src/lib/compiler/resource-inliner.js +1 -2
  30. package/src/lib/compiler/resource-inliner.js.map +1 -1
  31. package/src/lib/compiler/style-ast.js +1 -2
  32. package/src/lib/compiler/type-elision.js +1 -2
  33. package/src/lib/compiler/utils.js +1 -2
  34. package/src/lib/compiler/utils.js.map +1 -1
  35. package/src/lib/compiler-plugin.js +1 -2
  36. package/src/lib/component-resolvers.js +1 -2
  37. package/src/lib/component-scanner.js +3 -4
  38. package/src/lib/component-scanner.js.map +1 -1
  39. package/src/lib/component-styles-plugin.js +3 -4
  40. package/src/lib/compose-angular-plugins.js +2 -3
  41. package/src/lib/dev-server-mode-plugin.js +1 -2
  42. package/src/lib/encapsulation-plugin.js +1 -2
  43. package/src/lib/fast-compile-api.js +1 -2
  44. package/src/lib/fast-compile-plugin.js +11 -12
  45. package/src/lib/fast-compile-plugin.js.map +1 -1
  46. package/src/lib/host.js +3 -4
  47. package/src/lib/hot-update-batch.js +1 -2
  48. package/src/lib/live-reload-plugin.js +2 -3
  49. package/src/lib/ngp-compile-api.js +1 -2
  50. package/src/lib/ngp-compile-plugin.js +7 -8
  51. package/src/lib/ngp-compile-plugin.js.map +1 -1
  52. package/src/lib/ngtsc-compile-plugin.js +10 -11
  53. package/src/lib/nx-folder-plugin.js +1 -2
  54. package/src/lib/plugins/file-replacements.plugin.js +2 -3
  55. package/src/lib/router-plugin.js +2 -3
  56. package/src/lib/style-preprocessor.js +1 -2
  57. package/src/lib/stylesheet-registry.js +1 -2
  58. package/src/lib/stylesheet-registry.js.map +1 -1
  59. package/src/lib/tools/src/builders/vite/vite-build.impl.js +1 -2
  60. package/src/lib/tools/src/builders/vite/vite-build.impl.js.map +1 -1
  61. package/src/lib/tools/src/builders/vite-dev-server/dev-server.impl.js +1 -2
  62. package/src/lib/tools/src/builders/vite-dev-server/dev-server.impl.js.map +1 -1
  63. package/src/lib/utils/compilation-shared.js +2 -3
  64. package/src/lib/utils/css-extension-resolver.js +1 -2
  65. package/src/lib/utils/css-preprocessor-workers.js +1 -2
  66. package/src/lib/utils/debug-harness.js +1 -2
  67. package/src/lib/utils/debug-log-file.js +1 -2
  68. package/src/lib/utils/debug.js +1 -2
  69. package/src/lib/utils/devkit.js +1 -2
  70. package/src/lib/utils/hmr-component-updates.js +1 -2
  71. package/src/lib/utils/jit-inline-styles.js +1 -2
  72. package/src/lib/utils/lsp-type-checker.js +1 -2
  73. package/src/lib/utils/ngp-host-fs.js +1 -2
  74. package/src/lib/utils/plugin-config.js +1 -2
  75. package/src/lib/utils/rolldown.js +1 -2
  76. package/src/lib/utils/safe-module-paths.js +1 -2
  77. package/src/lib/utils/stylesheet-warning.js +1 -2
  78. package/src/lib/utils/transform-cache.js +1 -2
  79. package/src/lib/utils/transform-cache.js.map +1 -1
  80. package/src/lib/utils/tsconfig-resolver.js +1 -2
  81. package/src/lib/utils/virtual-ids.js +1 -2
  82. package/src/lib/utils/virtual-resources.js +1 -2
  83. package/src/lib/utils/virtual-resources.js.map +1 -1
  84. package/src/lib/virtual-modules-plugin.js +28 -4
  85. package/src/lib/virtual-modules-plugin.js.map +1 -1
@@ -1 +1 @@
1
- {"version":3,"file":"compile.js","names":[],"sources":["../../../../src/lib/compiler/compile.ts"],"sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as o from '@angular/compiler';\nimport MagicString from 'magic-string';\nimport type { parseSync } from 'oxc-parser';\nimport { parseOxc } from './utils.js';\nimport {\n ConstantPool,\n compileComponentFromMetadata,\n compileDirectiveFromMetadata,\n compilePipeFromMetadata,\n compileNgModule,\n compileInjector,\n R3NgModuleMetadataKind,\n R3SelectorScopeMode,\n FactoryTarget,\n compileFactoryFunction,\n parseTemplate,\n makeBindingParser,\n parseHostBindings,\n ParseSourceFile,\n ParseLocation,\n ParseSourceSpan,\n compileClassMetadata,\n compileComponentClassMetadata,\n compileDeclareComponentFromMetadata,\n compileDeclareDirectiveFromMetadata,\n compileDeclarePipeFromMetadata,\n compileDeclareNgModuleFromMetadata,\n compileDeclareInjectorFromMetadata,\n compileDeclareInjectableFromMetadata,\n compileDeclareFactoryFunction,\n compileDeclareClassMetadata,\n} from '@angular/compiler';\nimport { ComponentRegistry } from './registry.js';\nimport {\n findAllClasses,\n resolveSyntheticImportSpecifier,\n walkOxc,\n} from './utils.js';\nimport { ANGULAR_DECORATORS, FIELD_DECORATORS } from './constants.js';\nimport { angularVersionAtLeast } from './angular-version.js';\nimport {\n detectTypeOnlyImportNames,\n elideTypeOnlyImportsMagicString,\n} from './type-elision.js';\n\nimport {\n emitAngularExpr,\n emitAngularStmt,\n setEmitterSourceCode,\n} from './js-emitter.js';\nimport { lowerClassFields } from './class-field-lowering.js';\nimport {\n extractMetadata,\n collectStringConstants,\n detectSignals,\n detectFieldDecorators,\n extractConstructorDeps,\n} from './metadata.js';\nimport { buildDeferDependencyMap, buildImportMap } from './defer.js';\nimport { buildCtorParameters, buildPropDecorators } from './jit-metadata.js';\nimport { debugCompile, debugEmit } from './debug.js';\nimport {\n getPropertyKey,\n inlineStyleRanges,\n type InlineStyle,\n type InlineStyleRange,\n} from './style-ast.js';\n\n/**\n * COMPLETE EXHAUSTIVE ANGULAR LITE COMPILER\n * Translates Angular Decorators + Signals to Ivy Static Definitions.\n *\n * @param registry - Optional external registry from the global analysis plugin.\n * When provided, used to resolve component/directive selectors for template compilation.\n */\nexport interface CompileResult {\n code: string;\n /** Source map for the transformation */\n map: ReturnType<MagicString['generateMap']>;\n /** Absolute paths of external resources (templateUrl, styleUrl) read during compilation */\n resourceDependencies: string[];\n}\n\nexport interface CompileOptions {\n registry?: ComponentRegistry;\n /** Pre-resolved style contents keyed by absolute file path (e.g. SCSS already compiled to CSS). */\n resolvedStyles?: Map<string, string>;\n /** Pre-processed inline styles (index in styles array → compiled CSS). */\n resolvedInlineStyles?: Map<number, string>;\n /**\n * When `false` (default), instance class field initializers are lowered to\n * constructor assignments (matching TypeScript's `useDefineForClassFields: false`\n * behavior). This is required for Angular's `inject()` and constructor DI to\n * work correctly with the standard Angular tsconfig.\n */\n useDefineForClassFields?: boolean;\n /** Enable legacy i18n message ID format (default: true). */\n enableI18nLegacyMessageIdFormat?: boolean;\n /** Normalize line endings in ICU expressions (default: true). */\n i18nNormalizeLineEndingsInICUs?: boolean;\n /** Use external IDs in `$localize` calls (for Closure Compiler compatibility). */\n i18nUseExternalIds?: boolean;\n /**\n * Compilation output mode.\n * - `'full'` (default): Emit final Ivy definitions (`ɵɵdefineComponent`) for application builds.\n * - `'partial'`: Emit partial declarations (`ɵɵngDeclareComponent`) for library publishing.\n * Partial output is version-stable and linked at application build time.\n */\n compilationMode?: 'full' | 'partial';\n /**\n * Pre-parsed OXC program of `sourceCode`, so callers that already parsed\n * the identical string can avoid a re-parse. Treated as read-only.\n */\n oxcProgram?: ReturnType<typeof parseSync>['program'];\n}\n\ntype CompileMetadata = ReturnType<typeof extractMetadata>;\n\ntype CompileDeclaration = {\n type: o.Expression;\n selector: string | null;\n className?: string;\n kind: number;\n name?: string;\n inputs?: string[];\n outputs?: string[];\n exportAs?: string[];\n isComponent?: boolean;\n};\n\n/** A top-level statement with any `export` wrapper unwrapped. */\ninterface TopLevelStatement {\n /** The declaration (or the statement itself when not exported). */\n decl: any;\n exported: boolean;\n /** Start of the whole statement, including leading class decorators. */\n start: number;\n end: number;\n}\n\nfunction toTopLevelStatement(stmt: any): TopLevelStatement {\n const isExport =\n (stmt.type === 'ExportNamedDeclaration' ||\n stmt.type === 'ExportDefaultDeclaration') &&\n stmt.declaration;\n const decl = isExport ? stmt.declaration : stmt;\n return {\n decl,\n exported: !!isExport,\n start: Math.min(stmt.start, decl.decorators?.[0]?.start ?? stmt.start),\n end: stmt.end,\n };\n}\n\n/** Get the callee name of a decorator call, e.g. `Component` for `@Component(...)`. */\nfunction decoratorCallName(dec: any, sourceCode: string): string | undefined {\n const callee = dec.expression;\n if (callee?.type !== 'CallExpression') return undefined;\n return sourceCode.slice(callee.callee.start, callee.callee.end);\n}\n\n/** An inline style and the CSS the style pipeline produced for it. */\ninterface ResolvedInlineStyle extends InlineStyle {\n css: string;\n}\n\n/**\n * Pair each inline style of a component with its processed CSS, skipping the\n * ones whose processing failed.\n */\nfunction resolveInlineStyles(\n range: InlineStyleRange | undefined,\n resolvedInlineStyles: Map<number, string> | undefined,\n): ResolvedInlineStyle[] {\n if (!range || !resolvedInlineStyles) return [];\n return range.styles.flatMap((style, k) => {\n const css = resolvedInlineStyles.get(range.start + k);\n return css === undefined ? [] : [{ ...style, css }];\n });\n}\n\n/**\n * Source text of a `styles` value with each resolved inline style replaced by\n * its processed CSS, so the class metadata a TestBed override recompiles from\n * carries the same styles as ɵcmp.\n */\nfunction withResolvedInlineStyles(\n stylesNode: any,\n styles: ResolvedInlineStyle[],\n sourceCode: string,\n): string {\n let text = '';\n let pos = stylesNode.start;\n for (const { node, css } of styles) {\n text += sourceCode.slice(pos, node.start) + JSON.stringify(css);\n pos = node.end;\n }\n return text + sourceCode.slice(pos, stylesNode.end);\n}\n\n/**\n * Normalize a `providers` / `viewProviders` metadata value into the single\n * `o.Expression` Angular's injector/host emitters expect.\n *\n * `extractMetadata` stores these as an array of `WrappedNodeExpr` when the\n * source used an inline array literal (`providers: [A, B]`) — those get\n * wrapped in a `LiteralArrayExpr`. When the source referenced a const,\n * spread, or call instead (`providers: safeProviders`), it stores the raw\n * expression, which is emitted by value. Returns `null` when there is\n * nothing to emit so callers skip the feature entirely.\n */\nfunction providersToExpr(\n value: o.Expression[] | o.Expression | undefined | null,\n): o.Expression | null {\n if (!value) return null;\n if (Array.isArray(value)) {\n return value.length ? new o.LiteralArrayExpr(value) : null;\n }\n return value;\n}\n\nconst LAZY_SCOPE_TYPES = new Set([\n 'FunctionDeclaration',\n 'FunctionExpression',\n 'ArrowFunctionExpression',\n 'ClassDeclaration',\n 'ClassExpression',\n 'TSFunctionType',\n 'TSConstructorType',\n 'TSMethodSignature',\n 'TSCallSignatureDeclaration',\n 'TSConstructSignatureDeclaration',\n]);\n\n/**\n * Collect identifier names referenced in eagerly-evaluated code only.\n * Skips function/arrow/class bodies so that lazy references\n * (e.g. `const TOKEN = () => LaterClass`) are not treated as dependencies.\n * The root node's own children are always walked.\n */\nfunction collectIdentifiers(root: any): Set<string> {\n const ids = new Set<string>();\n walkOxc(root, (n) => {\n if (n.type === 'Identifier') ids.add(n.name);\n return n === root || !LAZY_SCOPE_TYPES.has(n.type);\n });\n return ids;\n}\n\n/** Extract the names defined by a top-level declaration. */\nfunction getDefinedNames(decl: any): string[] {\n if (decl.type === 'VariableDeclaration') {\n const names: string[] = [];\n for (const d of decl.declarations) {\n collectBindingNames(d.id, names);\n }\n return names;\n }\n if (\n (decl.type === 'FunctionDeclaration' || decl.type === 'ClassDeclaration') &&\n decl.id\n ) {\n return [decl.id.name];\n }\n return [];\n}\n\n/** Recursively collect all bound identifiers from a binding pattern. */\nfunction collectBindingNames(pattern: any, out: string[]): void {\n if (!pattern) return;\n switch (pattern.type) {\n case 'Identifier':\n out.push(pattern.name);\n break;\n case 'ObjectPattern':\n for (const prop of pattern.properties) {\n collectBindingNames(\n prop.type === 'RestElement' ? prop.argument : prop.value,\n out,\n );\n }\n break;\n case 'ArrayPattern':\n for (const el of pattern.elements) collectBindingNames(el, out);\n break;\n case 'RestElement':\n collectBindingNames(pattern.argument, out);\n break;\n case 'AssignmentPattern':\n collectBindingNames(pattern.left, out);\n break;\n }\n}\n\nexport function compile(\n sourceCode: string,\n fileName: string,\n optionsOrRegistry?: CompileOptions | ComponentRegistry,\n): CompileResult {\n // Backward compat: accept ComponentRegistry directly\n const opts: CompileOptions =\n optionsOrRegistry instanceof Map\n ? { registry: optionsOrRegistry }\n : optionsOrRegistry || {};\n const registry = opts.registry;\n const resolvedStyles = opts.resolvedStyles;\n const resolvedInlineStyles = opts.resolvedInlineStyles;\n const useDefineForClassFields = opts.useDefineForClassFields ?? false;\n const isPartial = opts.compilationMode === 'partial';\n const startTimeMs = debugCompile.enabled ? performance.now() : 0;\n debugCompile(\n 'compile %s (mode=%s, registry=%d entries)',\n fileName,\n isPartial ? 'partial' : 'full',\n registry?.size ?? 0,\n );\n const oxcProgram = opts.oxcProgram ?? parseOxc(fileName, sourceCode).program;\n const styleRanges = resolvedInlineStyles && inlineStyleRanges(oxcProgram);\n const oxcClassMap = new Map<string, any>();\n for (const stmt of oxcProgram.body) {\n const decl =\n stmt.type === 'ExportNamedDeclaration' ||\n stmt.type === 'ExportDefaultDeclaration'\n ? (stmt as any).declaration\n : stmt;\n if (\n decl &&\n (decl.type === 'ClassDeclaration' || decl.type === 'ClassExpression') &&\n decl.id?.name\n ) {\n oxcClassMap.set(decl.id.name, decl);\n }\n }\n\n // Collect module-level string constants so decorator metadata can resolve\n // template-literal interpolations like `template: \\`<div class=\"${tw}\">x</div>\\``.\n const stringConsts = collectStringConstants(oxcProgram);\n\n const constantPool = new ConstantPool();\n const resourceDependencies: string[] = [];\n const parseFile = new ParseSourceFile(sourceCode, fileName);\n const parseLoc = new ParseLocation(parseFile, 0, 0, 0);\n const typeSourceSpan = new ParseSourceSpan(parseLoc, parseLoc);\n const typeOnlyImports = detectTypeOnlyImportNames(sourceCode, oxcProgram);\n const importSpecifierByName = new Map<string, string>();\n const importedNames = new Set<string>();\n const typeOnlyImportedNames = new Set<string>();\n\n for (const stmt of oxcProgram.body as any[]) {\n if (stmt.type !== 'ImportDeclaration') continue;\n\n const moduleSpecifier: string = stmt.source.value;\n // Explicit `import type { X }` — declaration-level type-only import\n const isDeclarationTypeOnly = stmt.importKind === 'type';\n for (const element of stmt.specifiers) {\n if (element.type !== 'ImportSpecifier') continue;\n const localName: string = element.local.name;\n importSpecifierByName.set(localName, moduleSpecifier);\n // Explicit `import { type X }` — specifier-level type-only import.\n // Both forms erase the symbol at runtime, so they cannot be used as\n // DI tokens. Add them to typeOnlyImports so extractConstructorDeps\n // surfaces ɵɵinvalidFactory() instead of emitting a broken\n // ɵɵdirectiveInject(X) referring to a non-existent value.\n if (isDeclarationTypeOnly || element.importKind === 'type') {\n typeOnlyImports.add(localName);\n typeOnlyImportedNames.add(localName);\n } else {\n importedNames.add(localName);\n }\n }\n }\n\n // Build a file-local selector map as fallback when no external registry is provided.\n // Skip the expensive extractMetadata scan when a registry covers all classes.\n const localSelectors = new Map<string, string>();\n /**\n * Per component class: the dependencies only its @defer blocks use, which\n * its class metadata must load lazily (`ɵsetClassMetadataAsync`).\n */\n const deferredMetadataDeps = new Map<\n string,\n { symbolName: string; importPath: string; isDefaultImport: boolean }[]\n >();\n if (!registry) {\n for (const [clsName, oxcNode] of oxcClassMap) {\n const decs: any[] = oxcNode.decorators || [];\n if (decs.length > 0) {\n const meta = extractMetadata(decs[0], sourceCode, stringConsts);\n if (meta?.selector) {\n localSelectors.set(clsName, meta.selector.split(',')[0].trim());\n }\n }\n }\n }\n\n const bindingParser = isPartial ? undefined : makeBindingParser();\n setEmitterSourceCode(sourceCode);\n\n // --- Direct walk: compile each Angular-decorated class and collect string outputs ---\n interface ClassCompileResult {\n ivyCode: string[]; // \"static ɵfac = ...\", \"static ɵcmp = ...\", etc.\n decorators: any[]; // Angular decorators to remove (OXC nodes)\n classEnd: number; // Position of closing } in original source\n // setClassMetadata calls for classes nested in a function scope, which\n // must be emitted next to the class rather than at module scope.\n scopedMetadata: o.Statement[];\n }\n const classResults: ClassCompileResult[] = [];\n const topLevelClasses = new Set(\n (oxcProgram.body as any[]).map((stmt) => toTopLevelStatement(stmt).decl),\n );\n // Track synthetic imports needed for NgModule export expansion.\n // Maps exported class name → import specifier.\n const syntheticImports = new Map<string, string>();\n // A type-only import is erased at runtime, so its synthetic value import\n // needs an alias to avoid redeclaring the type-only binding.\n const dependencyLocalName = (name: string) =>\n typeOnlyImportedNames.has(name) ? `ɵngDep_${name}` : name;\n\n // ANGULAR_DECORATORS imported from utils\n\n for (const node of findAllClasses(oxcProgram)) {\n const decorators: any[] = node.decorators;\n if (!decorators || decorators.length === 0) continue;\n\n const className: string | undefined = node.id?.name;\n if (!className) continue;\n\n const angularDecorators = decorators.filter((dec) =>\n ANGULAR_DECORATORS.has(decoratorCallName(dec, sourceCode) ?? ''),\n );\n if (angularDecorators.length === 0) continue;\n\n const ivyCode: string[] = [];\n let targetType: FactoryTarget = FactoryTarget.Injectable;\n // Store resolved resources per decorator for metadata inlining\n const resolvedResources = new Map<\n any,\n { template?: string; styles?: string[] }\n >();\n\n const classRef: o.R3Reference = {\n value: new o.WrappedNodeExpr(className),\n type: new o.WrappedNodeExpr(className),\n };\n\n // Detect `class Foo extends Bar` so the directive/component def\n // gets `usesInheritance: true`. Angular's compiler turns that into\n // `features: [InheritDefinitionFeature]`, which is what causes the\n // runtime to merge inputs/outputs/queries/host bindings from the\n // base class. Without it, derived directives like\n // `BrnPopover extends BrnDialog` lose every input declared on the\n // base, and any host directive that references those inputs by\n // public name fails at runtime with NG0311.\n const usesInheritance = !!node.superClass;\n\n let classCompileError: Error | null = null;\n\n angularDecorators.forEach((dec) => {\n const decoratorName = decoratorCallName(dec, sourceCode)!;\n const meta = extractMetadata(dec, sourceCode, stringConsts);\n const sigs = detectSignals(node, sourceCode);\n const fields = detectFieldDecorators(node, sourceCode);\n const hostBindings = parseHostBindings(meta.hostRaw || {});\n\n const hostMetadata: o.R3HostMetadata = {\n attributes: hostBindings.attributes,\n listeners: { ...hostBindings.listeners, ...fields.hostListeners },\n properties: { ...hostBindings.properties, ...fields.hostProperties },\n specialAttributes: hostBindings.specialAttributes,\n };\n\n switch (decoratorName) {\n case 'Component': {\n targetType = FactoryTarget.Component;\n if (!meta.selector) {\n meta.selector = `ng-component-${className.toLowerCase()}`;\n }\n\n const declarations: CompileDeclaration[] = [];\n // Dedupe by class name across direct imports, tuple-barrel\n // expansion, and NgModule export expansion so the final\n // `dependencies: () => [...]` list never contains the same\n // class twice. Otherwise Angular's runtime throws NG0300\n // (\"Multiple components match …\") when a file lists both\n // `NgIcon` and a barrel like `HlmIconImports = [HlmIcon, NgIcon]`\n // that re-exports it, or when two NgModules re-export the same\n // directive (e.g. FormsModule + ReactiveFormsModule →\n // DefaultValueAccessor).\n const seenDeclarationNames = new Set<string>();\n\n // Expand `imports` entries that are not directives themselves\n // (e.g. NgModules and tuple barrels like `HlmSelectImports =\n // [HlmSelect, HlmSelectContent, ...] as const`) into the\n // underlying directive class names. Returns the original entry\n // when it doesn't match either expansion case.\n const collectExpandedImports = (\n depClassName: string,\n visited: Set<string>,\n ): string[] => {\n if (visited.has(depClassName)) return [];\n visited.add(depClassName);\n const entry = registry?.get(depClassName);\n if (!entry) return [depClassName];\n if (entry.kind === 'ngmodule' && entry.exports) {\n const out: string[] = [];\n for (const name of entry.exports) {\n out.push(...collectExpandedImports(name, visited));\n }\n return out;\n }\n if (entry.kind === 'tuple' && entry.members) {\n const out: string[] = [];\n for (const name of entry.members) {\n out.push(...collectExpandedImports(name, visited));\n }\n return out;\n }\n return [depClassName];\n };\n\n for (const dep of Array.isArray(meta.imports) ? meta.imports : []) {\n const depNode = dep.node;\n const depClassName: string =\n typeof depNode === 'string'\n ? depNode\n : (depNode?.name ?? depNode?.type === 'Identifier')\n ? depNode.name\n : sourceCode.slice(depNode?.start ?? 0, depNode?.end ?? 0);\n const registryEntry = registry?.get(depClassName);\n\n // Tuple barrel: `imports: [HlmSelectImports]` where the\n // const is `[HlmSelect, HlmSelectContent, ...] as const`.\n // Expand into the underlying directive declarations and\n // track synthetic imports for any classes not already\n // referenced in this file.\n if (registryEntry?.kind === 'tuple' && registryEntry.members) {\n const expanded = collectExpandedImports(depClassName, new Set());\n const tupleSpecifier = importSpecifierByName.get(depClassName);\n for (const memberName of expanded) {\n const memberEntry = registry?.get(memberName);\n if (!memberEntry || memberEntry.kind === 'tuple') continue;\n const memberRef = new o.WrappedNodeExpr(\n dependencyLocalName(memberName),\n );\n if (!importedNames.has(memberName)) {\n const memberSpecifier = resolveSyntheticImportSpecifier(\n fileName,\n memberEntry,\n tupleSpecifier,\n );\n if (memberSpecifier) {\n syntheticImports.set(memberName, memberSpecifier);\n }\n }\n const kind = memberEntry.kind === 'pipe' ? 1 : 0;\n const memberDecl: CompileDeclaration = {\n type: memberRef,\n selector: memberEntry.selector,\n kind,\n ...(kind === 1 ? { name: memberEntry.pipeName } : {}),\n };\n if (memberEntry.inputs) {\n memberDecl.inputs = Object.values(memberEntry.inputs).map(\n (i) => i.bindingPropertyName,\n );\n }\n if (memberEntry.outputs) {\n memberDecl.outputs = Object.values(\n memberEntry.outputs,\n ) as string[];\n }\n if (!seenDeclarationNames.has(memberName)) {\n seenDeclarationNames.add(memberName);\n declarations.push(memberDecl);\n }\n }\n continue;\n }\n\n if (registryEntry?.kind === 'ngmodule' && registryEntry.exports) {\n const moduleSpecifier = importSpecifierByName.get(depClassName);\n\n // Recursively collect all non-module exports (handles nested NgModules\n // like ReactiveFormsModule → ɵInternalFormsSharedModule → DefaultValueAccessor)\n const allExports: string[] = [];\n const expandModule = (\n moduleName: string,\n visited = new Set<string>(),\n ) => {\n if (visited.has(moduleName)) return;\n visited.add(moduleName);\n const mod = registry?.get(moduleName);\n if (!mod?.exports) return;\n for (const name of mod.exports) {\n const entry = registry?.get(name);\n if (!entry) continue;\n if (entry.kind === 'ngmodule') {\n expandModule(name, visited);\n } else {\n allExports.push(name);\n }\n }\n };\n expandModule(depClassName);\n\n for (const exportedName of allExports) {\n const exportedEntry = registry?.get(exportedName);\n if (exportedEntry) {\n const kind = exportedEntry.kind === 'pipe' ? 1 : 0;\n // Create a reference to the exported class. If it's not\n // already imported, track it for synthetic import injection.\n const exportedRef = new o.WrappedNodeExpr(\n dependencyLocalName(exportedName),\n );\n const exportedSpecifier = resolveSyntheticImportSpecifier(\n fileName,\n exportedEntry,\n moduleSpecifier,\n );\n if (exportedSpecifier) {\n syntheticImports.set(exportedName, exportedSpecifier);\n }\n const decl: CompileDeclaration = {\n type: exportedRef,\n selector: exportedEntry.selector,\n kind,\n ...(kind === 1 ? { name: exportedEntry.pipeName } : {}),\n };\n if (exportedEntry.inputs) {\n decl.inputs = Object.values(exportedEntry.inputs).map(\n (i) => i.bindingPropertyName,\n );\n }\n if (exportedEntry.outputs) {\n decl.outputs = Object.values(\n exportedEntry.outputs,\n ) as string[];\n }\n if (!seenDeclarationNames.has(exportedName)) {\n seenDeclarationNames.add(exportedName);\n declarations.push(decl);\n }\n }\n }\n continue;\n }\n\n const selector =\n registryEntry?.selector ?? localSelectors.get(depClassName);\n const kind = registryEntry?.kind === 'pipe' ? 1 : 0;\n const decl: CompileDeclaration = {\n type: dep,\n selector: selector || `_unresolved-${depClassName}`,\n kind,\n ...(kind === 1 ? { name: registryEntry?.pipeName } : {}),\n };\n // Pass inputs/outputs from registry so template bindings resolve.\n // R3DirectiveDependencyMetadata expects inputs/outputs as string[]\n // of binding property names.\n if (registryEntry?.inputs) {\n decl.inputs = Object.values(registryEntry.inputs).map(\n (i) => i.bindingPropertyName,\n );\n }\n if (registryEntry?.outputs) {\n decl.outputs = Object.values(registryEntry.outputs) as string[];\n }\n if (!seenDeclarationNames.has(depClassName)) {\n seenDeclarationNames.add(depClassName);\n declarations.push(decl);\n }\n }\n\n // Add self-reference so recursive components (e.g. tree views)\n // can use their own selector in their template.\n // Skip in partial mode — the linker handles self-resolution.\n if (!isPartial && !seenDeclarationNames.has(className)) {\n const selfInputs = Object.entries(sigs.inputs).map(\n ([, v]: [string, any]) => v.bindingPropertyName,\n );\n const selfOutputs = Object.values({\n ...meta.outputs,\n ...fields.outputs,\n ...sigs.outputs,\n }) as string[];\n seenDeclarationNames.add(className);\n declarations.push({\n type: classRef.value,\n selector: meta.selector,\n kind: 0,\n ...(selfInputs.length > 0 ? { inputs: selfInputs } : {}),\n ...(selfOutputs.length > 0 ? { outputs: selfOutputs } : {}),\n });\n }\n\n // Non-standalone components get their directive/pipe scope from the\n // @NgModule that declares them. Whole-program ngtsc resolves this; a\n // per-file engine can't read the module from the component file, but the\n // project-wide registry (populated at buildStart) records every module's\n // declarations + imports. We resolve the owning module's transitive scope\n // here and inline it into the component's own `dependencies` — matching\n // ngtsc, and surviving tree-shaking (unlike a separate, droppable\n // `ɵɵsetComponentScope` call).\n //\n // A component declared in an @NgModule must set\n // `standalone: false`, so only those need the owning-module lookup.\n if (!isPartial && meta.standalone === false && registry) {\n let owningModule:\n | { declarations?: string[]; imports?: string[] }\n | undefined;\n for (const entry of registry.values()) {\n if (\n entry.kind === 'ngmodule' &&\n entry.declarations?.includes(className)\n ) {\n owningModule = entry;\n break;\n }\n }\n if (owningModule) {\n // Transitive scope = the module's own declarations + the exported\n // declarations of every imported module (recursively) + tuple members.\n const scopeNames = new Set<string>();\n const addExportsOf = (modName: string, visited: Set<string>) => {\n if (visited.has(modName)) return;\n visited.add(modName);\n const e = registry.get(modName);\n if (!e) return;\n if (e.kind === 'ngmodule') {\n for (const exp of e.exports ?? []) addExportsOf(exp, visited);\n } else if (e.kind === 'tuple') {\n for (const m of e.members ?? []) scopeNames.add(m);\n } else {\n scopeNames.add(modName);\n }\n };\n for (const d of owningModule.declarations ?? [])\n scopeNames.add(d);\n for (const imp of owningModule.imports ?? [])\n addExportsOf(imp, new Set());\n\n for (const name of scopeNames) {\n if (seenDeclarationNames.has(name)) continue;\n const entry = registry.get(name);\n if (\n !entry ||\n entry.kind === 'ngmodule' ||\n entry.kind === 'tuple'\n )\n continue;\n if (!importedNames.has(name)) {\n const spec = resolveSyntheticImportSpecifier(\n fileName,\n entry,\n importSpecifierByName.get(name),\n );\n if (spec) syntheticImports.set(name, spec);\n }\n const kind = entry.kind === 'pipe' ? 1 : 0;\n const decl: CompileDeclaration = {\n type: new o.WrappedNodeExpr(dependencyLocalName(name)),\n selector: entry.selector || `_unresolved-${name}`,\n kind,\n ...(kind === 1 ? { name: entry.pipeName } : {}),\n };\n if (entry.inputs) {\n decl.inputs = Object.values(entry.inputs).map(\n (i) => i.bindingPropertyName,\n );\n }\n if (entry.outputs) {\n decl.outputs = Object.values(entry.outputs) as string[];\n }\n seenDeclarationNames.add(name);\n declarations.push(decl);\n }\n }\n }\n\n let templateContent = meta.template || '';\n if (!templateContent && meta.templateUrl) {\n try {\n const templatePath = path.resolve(\n path.dirname(fileName),\n meta.templateUrl,\n );\n templateContent = fs.readFileSync(templatePath, 'utf-8');\n resourceDependencies.push(templatePath);\n } catch {\n console.warn(\n `[fast-compile] Could not read template file \"${meta.templateUrl}\" for ${className}`,\n );\n }\n }\n\n if (Array.isArray(meta.styleUrls)) {\n for (const url of meta.styleUrls) {\n try {\n const stylePath = path.resolve(path.dirname(fileName), url);\n const styleContent =\n resolvedStyles?.get(stylePath) ??\n fs.readFileSync(stylePath, 'utf-8');\n meta.styles.push(styleContent);\n resourceDependencies.push(stylePath);\n } catch {\n console.warn(\n `[fast-compile] Could not read style file \"${url}\" for ${className}`,\n );\n }\n }\n }\n\n for (const { index, css } of resolveInlineStyles(\n styleRanges?.get(dec),\n resolvedInlineStyles,\n )) {\n meta.styles[index] = css;\n }\n\n // Store resolved resources for metadata inlining. `styles` is set only\n // when a styleUrl was read here, and then holds every style ɵcmp got,\n // inline ones included.\n resolvedResources.set(dec, {\n template: templateContent || undefined,\n styles:\n meta.styleUrls.length > 0 && meta.styles?.length > 0\n ? [...meta.styles]\n : undefined,\n });\n\n const parsedTemplate = parseTemplate(templateContent, fileName, {\n preserveWhitespaces: meta.preserveWhitespaces,\n enableI18nLegacyMessageIdFormat:\n opts.enableI18nLegacyMessageIdFormat ?? true,\n i18nNormalizeLineEndingsInICUs:\n opts.i18nNormalizeLineEndingsInICUs ?? true,\n });\n\n const ivyInputs: Record<string, unknown> = {};\n if (Array.isArray(meta.inputs)) {\n meta.inputs.forEach((i: string) => (ivyInputs[i] = i));\n } else if (meta.inputs) {\n Object.assign(ivyInputs, meta.inputs);\n }\n Object.assign(ivyInputs, fields.inputs);\n for (const [key, val] of Object.entries(sigs.inputs)) {\n const sigDesc = val as {\n bindingPropertyName?: string;\n required?: boolean;\n transform?: o.Expression | null;\n };\n ivyInputs[key] = {\n classPropertyName: key,\n // Honor the binding name (alias) extracted by detectSignals\n // so `input(null, { alias: 'aria-label' })` registers with\n // the public name `aria-label`, not the class property name.\n bindingPropertyName: sigDesc.bindingPropertyName ?? key,\n isSignal: true,\n required: sigDesc.required || false,\n transformFunction: sigDesc.transform || null,\n };\n }\n const templateErrors = parsedTemplate.errors ?? [];\n if (templateErrors.length > 0) {\n const firstError = templateErrors[0];\n classCompileError = new Error(\n `[fast-compile] Template parse error in ${fileName} (${className}): ${firstError.msg}`,\n );\n return;\n }\n\n // Classes used only inside @defer blocks load through the blocks'\n // dynamic import()s, so they must not also be eager dependencies:\n // that would keep their module in this chunk. Once nothing else\n // references them, the TypeScript strip pass drops their imports.\n const deferDependencies = buildDeferDependencyMap(\n parsedTemplate,\n oxcProgram,\n registry,\n localSelectors,\n );\n if (!isPartial && deferDependencies.deferredImports.size > 0) {\n const importMap = buildImportMap(oxcProgram);\n const metadataDeps: {\n symbolName: string;\n importPath: string;\n isDefaultImport: boolean;\n }[] = [];\n for (let i = declarations.length - 1; i >= 0; i--) {\n const name = declarationName(declarations[i]);\n const info = name !== null ? importMap.get(name) : undefined;\n if (\n name === null ||\n info === undefined ||\n !deferDependencies.deferredImports.has(name)\n ) {\n continue;\n }\n declarations.splice(i, 1);\n metadataDeps.unshift({\n symbolName: name,\n importPath: info.path,\n isDefaultImport: info.isDefault,\n });\n }\n if (metadataDeps.length > 0) {\n deferredMetadataDeps.set(className, metadataDeps);\n }\n }\n\n const componentMeta: CompileMetadata & {\n name: string;\n type: o.R3Reference;\n typeSourceSpan: ParseSourceSpan;\n declarations: CompileDeclaration[];\n template: {\n nodes: o.Node[];\n ngContentSelectors: string[];\n preserveWhitespaces: boolean;\n };\n } = {\n ...meta,\n name: className,\n type: classRef,\n typeSourceSpan,\n declarations,\n template: {\n nodes: parsedTemplate.nodes,\n ngContentSelectors: parsedTemplate.ngContentSelectors,\n preserveWhitespaces: parsedTemplate.preserveWhitespaces,\n },\n styles: [...(meta.styles || []), ...(parsedTemplate.styles || [])],\n inputs: ivyInputs,\n outputs: { ...meta.outputs, ...fields.outputs, ...sigs.outputs },\n viewQueries: [...fields.viewQueries, ...sigs.viewQueries],\n queries: [...fields.contentQueries, ...sigs.contentQueries],\n host: hostMetadata,\n changeDetection: meta.changeDetection ?? (isPartial ? null : 1),\n encapsulation: meta.encapsulation ?? 0,\n exportAs: meta.exportAs,\n providers: providersToExpr(meta.providers),\n viewProviders: providersToExpr(meta.viewProviders),\n animations: meta.animations?.length\n ? new o.LiteralArrayExpr(meta.animations)\n : null,\n isStandalone: meta.standalone,\n imports: meta.imports,\n lifecycle: { usesOnChanges: false },\n // Angular v19/v20's `createComponentDefinitionMap` reads\n // `meta.interpolation.start` and `meta.interpolation.end`\n // unconditionally (the `!== DEFAULT_INTERPOLATION_CONFIG` check\n // is reference-equality, so a missing field enters the block\n // and crashes with `Cannot read properties of undefined`). v21\n // dropped the field from `createComponentDefinitionMap`\n // entirely. Use the v19/v20 singleton when the Angular package\n // exports it (matches the reference-equality check, skipping\n // the partial-mode emission block) and fall back to a plain\n // shape on v21+ where the field is ignored anyway.\n interpolation: (\n o as {\n DEFAULT_INTERPOLATION_CONFIG?: { start: string; end: string };\n }\n ).DEFAULT_INTERPOLATION_CONFIG ?? { start: '{{', end: '}}' },\n usesInheritance,\n defer: {\n mode: 0,\n blocks: deferDependencies.blocks,\n },\n declarationListEmitMode: 1,\n i18nUseExternalIds: opts.i18nUseExternalIds ?? false,\n relativeContextFilePath: fileName,\n controlCreate: null,\n hasDirectiveDependencies:\n declarations.length > 0 ||\n (Array.isArray(meta.imports) && meta.imports.length > 0),\n };\n\n if (isPartial) {\n // Partial compilation accesses .inputs, .outputs, .exportAs on\n // each declaration — ensure they are arrays (not undefined).\n componentMeta.declarations = declarations.map((d) => ({\n ...d,\n inputs: d.inputs ?? null,\n outputs: d.outputs ?? null,\n exportAs: d.exportAs ?? null,\n isComponent: d.isComponent ?? false,\n }));\n const cmp = compileDeclareComponentFromMetadata(\n componentMeta,\n parsedTemplate,\n {\n content: templateContent,\n sourceUrl: fileName,\n isInline: !meta.templateUrl,\n inlineTemplateLiteralExpression: null,\n },\n );\n ivyCode.push(\n `static ɵcmp = /*@__PURE__*/ ${emitAngularExpr(cmp.expression)}`,\n );\n } else {\n const cmp = compileComponentFromMetadata(\n componentMeta,\n constantPool,\n bindingParser!,\n );\n ivyCode.push(\n `static ɵcmp = /*@__PURE__*/ ${emitAngularExpr(cmp.expression)}`,\n );\n }\n break;\n }\n\n case 'Directive': {\n targetType = FactoryTarget.Directive;\n // Build proper input descriptors (same as Component path)\n const dirInputs: Record<string, unknown> = {};\n if (Array.isArray(meta.inputs)) {\n meta.inputs.forEach((i: string) => (dirInputs[i] = i));\n } else if (meta.inputs) {\n Object.assign(dirInputs, meta.inputs);\n }\n Object.assign(dirInputs, fields.inputs);\n for (const [key, val] of Object.entries(sigs.inputs)) {\n const sigDesc = val as {\n bindingPropertyName?: string;\n required?: boolean;\n transform?: o.Expression | null;\n };\n dirInputs[key] = {\n classPropertyName: key,\n // Honor the binding name (alias) extracted by detectSignals.\n bindingPropertyName: sigDesc.bindingPropertyName ?? key,\n isSignal: true,\n required: sigDesc.required || false,\n transformFunction: sigDesc.transform || null,\n };\n }\n const directiveMeta = {\n ...meta,\n // Abstract base directives are declared as `@Directive()` with\n // no metadata. Angular's R3DirectiveMetadata accepts\n // `selector: string | null`, but the downstream selector parser\n // calls `.replace()` on the value and crashes on `undefined`.\n // Coerce missing selectors to `null` so abstract base classes\n // compile correctly.\n selector: meta.selector ?? null,\n name: className,\n type: classRef,\n typeSourceSpan,\n host: hostMetadata,\n inputs: dirInputs,\n outputs: { ...meta.outputs, ...fields.outputs, ...sigs.outputs },\n viewQueries: [...fields.viewQueries, ...sigs.viewQueries],\n queries: [...fields.contentQueries, ...sigs.contentQueries],\n // Angular's compiler treats `providers` as an Expression and\n // emits `ɵɵProvidersFeature(<expr>)` whenever it is truthy.\n // `providersToExpr` lowers an inline array literal to a\n // LiteralArrayExpr (matching the Component branch) and passes a\n // const/spread reference through by value — returning `null`\n // when there are no providers so Angular skips the feature\n // entirely. Passing the bare JS array would otherwise be lowered\n // to `null` and crash Angular at runtime in `resolveProvider`.\n providers: providersToExpr(meta.providers),\n exportAs: meta.exportAs,\n isStandalone: meta.standalone,\n lifecycle: { usesOnChanges: false },\n usesInheritance,\n controlCreate: null,\n };\n if (isPartial) {\n const dir = compileDeclareDirectiveFromMetadata(directiveMeta);\n ivyCode.push(\n `static ɵdir = /*@__PURE__*/ ${emitAngularExpr(dir.expression)}`,\n );\n } else {\n const dir = compileDirectiveFromMetadata(\n directiveMeta,\n constantPool,\n bindingParser!,\n );\n ivyCode.push(\n `static ɵdir = /*@__PURE__*/ ${emitAngularExpr(dir.expression)}`,\n );\n }\n break;\n }\n\n case 'Pipe': {\n targetType = FactoryTarget.Pipe;\n const pipeMeta = {\n ...meta,\n name: className,\n pipeName: meta.name,\n type: classRef,\n isStandalone: meta.standalone,\n pure: meta.pure ?? true,\n };\n if (isPartial) {\n const pipe = compileDeclarePipeFromMetadata(pipeMeta);\n ivyCode.push(\n `static ɵpipe = /*@__PURE__*/ ${emitAngularExpr(pipe.expression)}`,\n );\n } else {\n const pipe = compilePipeFromMetadata(pipeMeta);\n ivyCode.push(\n `static ɵpipe = /*@__PURE__*/ ${emitAngularExpr(pipe.expression)}`,\n );\n }\n break;\n }\n\n case 'Injectable': {\n targetType = FactoryTarget.Injectable;\n const injectableMeta: any = {\n name: className,\n type: classRef,\n typeArgumentCount: 0,\n providedIn: {\n expression: new o.LiteralExpr(meta.providedIn ?? null),\n forwardRef: 0,\n },\n };\n // Forward provider configuration so `ɵprov` honors useFactory/\n // useClass/useExisting/useValue. Without this, an\n // `@Injectable({ useFactory: () => ... })` quietly falls back\n // to constructor instantiation.\n if (meta.useClass) injectableMeta.useClass = meta.useClass;\n if (meta.useFactory) injectableMeta.useFactory = meta.useFactory;\n if (meta.useExisting) injectableMeta.useExisting = meta.useExisting;\n if (meta.useValue) injectableMeta.useValue = meta.useValue;\n // Dependency list for `useFactory` / `useClass`; without it the\n // emitted factory is invoked with no arguments.\n if (meta.deps) injectableMeta.deps = meta.deps;\n if (isPartial) {\n const inj = compileDeclareInjectableFromMetadata(injectableMeta);\n ivyCode.push(\n `static ɵprov = /*@__PURE__*/ ${emitAngularExpr(inj.expression)}`,\n );\n } else {\n const inj = o.compileInjectable(injectableMeta, true);\n ivyCode.push(\n `static ɵprov = /*@__PURE__*/ ${emitAngularExpr(inj.expression)}`,\n );\n }\n break;\n }\n\n case 'Service': {\n // `@Service` (and the `compileService` compiler API) landed in\n // Angular 22. On older peers the decorator does not exist; fail\n // loudly rather than falling through and emitting a default\n // `Injectable`-target factory with no `ɵprov`.\n if (!angularVersionAtLeast(22)) {\n classCompileError = new Error(\n `[fast-compile] @Service on ${className} requires Angular 22 or later`,\n );\n break;\n }\n targetType = (FactoryTarget as any).Service;\n const serviceMeta: any = {\n name: className,\n type: classRef,\n typeArgumentCount: 0,\n };\n if (meta.autoProvided === false) serviceMeta.autoProvided = false;\n if (meta.factory) serviceMeta.factory = meta.factory;\n if (isPartial) {\n const svc = (o as any).compileDeclareServiceFromMetadata(\n serviceMeta,\n );\n ivyCode.push(\n `static ɵprov = /*@__PURE__*/ ${emitAngularExpr(svc.expression)}`,\n );\n } else {\n const svc = (o as any).compileService(serviceMeta, false);\n ivyCode.push(\n `static ɵprov = /*@__PURE__*/ ${emitAngularExpr(svc.expression)}`,\n );\n }\n break;\n }\n\n case 'NgModule': {\n targetType = FactoryTarget.NgModule;\n const ngModuleImports = Array.isArray(meta.imports)\n ? meta.imports\n : [];\n const ngModuleDeclarations = Array.isArray(meta.declarations)\n ? meta.declarations\n : [];\n const ngModuleExports = Array.isArray(meta.exports)\n ? meta.exports\n : [];\n const ngModuleBootstrap = Array.isArray(meta.bootstrap)\n ? meta.bootstrap\n : [];\n\n const ngModuleMeta = {\n kind: R3NgModuleMetadataKind.Global as const,\n type: classRef,\n bootstrap: ngModuleBootstrap.map((e: o.WrappedNodeExpr<any>) => ({\n value: e,\n type: e,\n })),\n declarations: ngModuleDeclarations.map(\n (e: o.WrappedNodeExpr<any>) => ({ value: e, type: e }),\n ),\n publicDeclarationTypes: null,\n imports: ngModuleImports.map((e: o.WrappedNodeExpr<any>) => ({\n value: e,\n type: e,\n })),\n includeImportTypes: true,\n exports: ngModuleExports.map((e: o.WrappedNodeExpr<any>) => ({\n value: e,\n type: e,\n })),\n selectorScopeMode: R3SelectorScopeMode.Inline,\n containsForwardDecls: false,\n schemas: [],\n id: null,\n };\n const injectorMeta = {\n name: className,\n type: classRef,\n providers: providersToExpr(meta.providers),\n imports: ngModuleImports.map((e: o.WrappedNodeExpr<any>) => e),\n };\n if (isPartial) {\n const ngMod = compileDeclareNgModuleFromMetadata(ngModuleMeta);\n ivyCode.push(\n `static ɵmod = /*@__PURE__*/ ${emitAngularExpr(ngMod.expression)}`,\n );\n const injector = compileDeclareInjectorFromMetadata(injectorMeta);\n ivyCode.push(\n `static ɵinj = /*@__PURE__*/ ${emitAngularExpr(injector.expression)}`,\n );\n } else {\n const ngMod = compileNgModule(ngModuleMeta);\n ivyCode.push(\n `static ɵmod = /*@__PURE__*/ ${emitAngularExpr(ngMod.expression)}`,\n );\n const injector = compileInjector(injectorMeta);\n ivyCode.push(\n `static ɵinj = /*@__PURE__*/ ${emitAngularExpr(injector.expression)}`,\n );\n }\n break;\n }\n }\n });\n\n if (classCompileError) {\n throw classCompileError;\n }\n\n // Generate factory\n const deps = extractConstructorDeps(node, sourceCode, typeOnlyImports);\n if (deps === null) {\n const baseVar = `ɵ${className}_BaseFactory`;\n ivyCode.unshift(\n `static ɵfac = /*@__PURE__*/ (() => { let ${baseVar}; return function ${className}_Factory(__ngFactoryType__) { return (${baseVar} || (${baseVar} = i0.ɵɵgetInheritedFactory(${className})))(__ngFactoryType__ || ${className}); }; })()`,\n );\n } else if (deps === 'invalid') {\n ivyCode.unshift(\n `static ɵfac = function ${className}_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory(); }`,\n );\n } else {\n const factoryMeta = {\n name: className,\n type: classRef,\n typeArgumentCount: 0,\n deps,\n target: targetType,\n };\n if (isPartial) {\n const fac = compileDeclareFactoryFunction(factoryMeta);\n ivyCode.unshift(\n `static ɵfac = /*@__PURE__*/ ${emitAngularExpr(fac.expression)}`,\n );\n } else {\n const fac = compileFactoryFunction(factoryMeta);\n ivyCode.unshift(\n `static ɵfac = /*@__PURE__*/ ${emitAngularExpr(fac.expression)}`,\n );\n }\n }\n\n // Emit setClassMetadata for runtime decorator reflection (devMode only)\n const ctorParameters = buildCtorParameters(\n node,\n sourceCode,\n typeOnlyImports,\n );\n const propDecorators = buildPropDecorators(node, sourceCode, 'i0.');\n const scopedMetadata: o.Statement[] = [];\n angularDecorators.forEach((dec) => {\n const decName = decoratorCallName(dec, sourceCode)!;\n const decArgsNode = dec.expression.arguments[0];\n const textOf = (n: any) => sourceCode.slice(n.start, n.end);\n\n // Build the decorator args for setClassMetadata, inlining resources if needed.\n const resources = resolvedResources.get(dec);\n let metadataArgsExpr: string | null = null;\n if (decArgsNode) {\n if (resources && decArgsNode.type === 'ObjectExpression') {\n // Inline external templateUrl/styleUrl(s) into the metadata so Angular's\n // runtime doesn't try to fetch relative URLs (which fails during SSR).\n const rewrittenProps: string[] = [];\n let needsTransform = false;\n const inlineStyles = resolveInlineStyles(\n styleRanges?.get(dec),\n resolvedInlineStyles,\n );\n let resourceStylesWritten = false;\n for (const prop of decArgsNode.properties) {\n if (\n prop.type !== 'Property' ||\n prop.shorthand ||\n prop.method ||\n prop.kind !== 'init'\n ) {\n rewrittenProps.push(textOf(prop));\n continue;\n }\n const propName = getPropertyKey(prop);\n\n if (propName === 'templateUrl' && resources.template) {\n rewrittenProps.push(\n `template: ${JSON.stringify(resources.template)}`,\n );\n needsTransform = true;\n } else if (\n (propName === 'styleUrl' ||\n propName === 'styleUrls' ||\n propName === 'styles') &&\n resources.styles\n ) {\n // One `styles` key for all of them: a second one would win\n // over the first and drop its styles.\n if (!resourceStylesWritten) {\n rewrittenProps.push(\n `styles: [${resources.styles.map((s) => JSON.stringify(s)).join(', ')}]`,\n );\n resourceStylesWritten = true;\n }\n needsTransform = true;\n } else if (propName === 'styles' && inlineStyles.length > 0) {\n rewrittenProps.push(\n `styles: ${withResolvedInlineStyles(prop.value, inlineStyles, sourceCode)}`,\n );\n needsTransform = true;\n } else {\n rewrittenProps.push(textOf(prop));\n }\n }\n metadataArgsExpr = needsTransform\n ? `{${rewrittenProps.join(', ')}}`\n : textOf(decArgsNode);\n } else {\n metadataArgsExpr = textOf(decArgsNode);\n }\n }\n\n try {\n // `LiteralMapPropertyAssignment` was a class with a constructor in\n // Angular up through ~v19, removed-then-restored in later v20/v21\n // patches. The only stable shape across versions is the plain\n // `{ key, value, quoted }` object literal — Angular's own emitter\n // and Analog's `JSEmitter` both consume entries via duck typing\n // (`.key` / `.value` / `.quoted`), and `compileClassMetadata` does\n // not `instanceof`-check entries. The js-emitter has a matching\n // comment at the consumption site. Using `new o.LiteralMapProperty\n // Assignment(...)` would throw \"is not a constructor\" on Angular\n // versions where the class export is missing (e.g. 20.3.x), and\n // the surrounding try/catch would silently disable class metadata\n // emission for every class in the project.\n const classMetaInput = {\n type: new o.WrappedNodeExpr(className),\n decorators: new o.LiteralArrayExpr([\n new o.LiteralMapExpr([\n {\n key: 'type',\n value: new o.WrappedNodeExpr(decName),\n quoted: false,\n },\n ...(metadataArgsExpr\n ? [\n {\n key: 'args',\n value: new o.LiteralArrayExpr([\n new o.WrappedNodeExpr(metadataArgsExpr),\n ]),\n quoted: false,\n },\n ]\n : []),\n ] as unknown as o.LiteralMapPropertyAssignment[]),\n ]),\n ctorParameters: ctorParameters\n ? new o.WrappedNodeExpr(`() => [${ctorParameters}]`)\n : null,\n propDecorators: propDecorators\n ? new o.WrappedNodeExpr(propDecorators)\n : null,\n };\n // A component whose @defer blocks load some dependencies lazily must\n // not reference them eagerly in its metadata either.\n const deferredDeps =\n decName === 'Component'\n ? deferredMetadataDeps.get(className)\n : undefined;\n const classMetadataExpr = isPartial\n ? compileDeclareClassMetadata(classMetaInput)\n : deferredDeps\n ? compileComponentClassMetadata(classMetaInput, deferredDeps)\n : compileClassMetadata(classMetaInput);\n const metadataStmt = new o.ExpressionStatement(classMetadataExpr);\n if (topLevelClasses.has(node)) {\n constantPool.statements.push(metadataStmt);\n } else {\n scopedMetadata.push(metadataStmt);\n }\n } catch (e) {\n // Skip if compileClassMetadata fails — surfaced via DEBUG=analog-fast-compile\n if (debugCompile.enabled) {\n debugCompile(\n 'compileClassMetadata failed for %s in %s: %s',\n className,\n fileName,\n (e as Error)?.message,\n );\n }\n }\n });\n\n // Collect member decorators (@HostListener, @HostBinding, @Input, @Output,\n // @ViewChild, @ContentChild, etc.) so they are removed from the source.\n // The metadata has already been extracted by detectFieldDecorators().\n const memberDecorators: any[] = [];\n for (const member of node.body.body) {\n for (const dec of member.decorators ?? []) {\n if (FIELD_DECORATORS.has(decoratorCallName(dec, sourceCode) ?? '')) {\n memberDecorators.push(dec);\n }\n }\n }\n\n classResults.push({\n ivyCode,\n decorators: [...angularDecorators, ...memberDecorators],\n classEnd: node.end,\n scopedMetadata,\n });\n }\n\n // Apply edits via MagicString\n const ms = new MagicString(sourceCode, { filename: fileName });\n\n // 1. Prepend i0 import (skip if already present)\n if (!sourceCode.includes('import * as i0 from')) {\n ms.prepend('import * as i0 from \"@angular/core\";\\n');\n }\n\n // 1b. Inject synthetic imports for NgModule-exported classes\n for (const [name, specifier] of syntheticImports) {\n const localName = dependencyLocalName(name);\n if (!importedNames.has(localName)) {\n const binding = localName === name ? name : `${name} as ${localName}`;\n ms.prepend(`import { ${binding} } from \"${specifier}\";\\n`);\n importedNames.add(localName);\n }\n }\n\n // 2a. Hoist non-exported variable/function declarations that appear after\n // a class to just before the first class. This avoids TDZ errors when\n // static ɵcmp references file-level constants declared after the class.\n //\n // We must NOT hoist a statement whose initializer references a name\n // (class, exported const/let) that is defined between firstClassPos and\n // the statement itself — doing so would move the reference before the\n // definition and cause a TDZ error at runtime.\n if (classResults.length > 0) {\n // Find the position right before the first class (any class, not just Angular-decorated)\n const statements = (oxcProgram.body as any[]).map(toTopLevelStatement);\n let firstClassPos = Infinity;\n const nonHoistableNames = new Set<string>();\n for (const { decl, start } of statements) {\n if (decl.type === 'ClassDeclaration') {\n firstClassPos = start;\n // The first class itself is non-hoistable — statements hoisted\n // before it must not reference it.\n if (decl.id) {\n nonHoistableNames.add(decl.id.name);\n }\n break;\n }\n }\n\n // Pass 1: collect names defined by statements that will NOT be hoisted\n // (classes, enums, exported vars/functions) and therefore remain after\n // firstClassPos.\n for (const { decl, exported, start } of statements) {\n if (start <= firstClassPos) continue;\n\n if (\n decl.type === 'ClassDeclaration' ||\n decl.type === 'TSEnumDeclaration'\n ) {\n if (decl.id) nonHoistableNames.add(decl.id.name);\n } else if (\n exported &&\n (decl.type === 'VariableDeclaration' ||\n decl.type === 'FunctionDeclaration')\n ) {\n for (const n of getDefinedNames(decl)) {\n nonHoistableNames.add(n);\n }\n }\n }\n\n // Pass 2: for each hoist candidate, check if it references any\n // non-hoistable name. If it does, skip it and add its own names to the\n // non-hoistable set (transitivity).\n for (const { decl, exported, start, end } of statements) {\n if (start <= firstClassPos) continue;\n\n const isCandidate =\n !exported &&\n (decl.type === 'VariableDeclaration' ||\n decl.type === 'FunctionDeclaration');\n if (!isCandidate) continue;\n\n const referencedIds = collectIdentifiers(decl);\n let referencesNonHoistable = false;\n for (const id of referencedIds) {\n if (nonHoistableNames.has(id)) {\n referencesNonHoistable = true;\n break;\n }\n }\n\n if (referencesNonHoistable) {\n // Don't hoist — mark this statement's names as non-hoistable too\n for (const name of getDefinedNames(decl)) {\n nonHoistableNames.add(name);\n }\n } else {\n // Move rather than re-insert so the statement keeps its source map.\n // The separating newline is attached to the moved chunk.\n ms.appendLeft(end, '\\n');\n ms.move(start, end, firstClassPos);\n }\n }\n }\n\n // 2. For each compiled class: remove decorators + insert Ivy definitions\n for (const cr of classResults) {\n // Remove Angular decorators from source\n for (const dec of cr.decorators) {\n const start = dec.start;\n const end = dec.end;\n let trimEnd = end;\n while (\n trimEnd < sourceCode.length &&\n (sourceCode[trimEnd] === ' ' ||\n sourceCode[trimEnd] === '\\n' ||\n sourceCode[trimEnd] === '\\r')\n ) {\n trimEnd++;\n }\n ms.remove(start, trimEnd);\n }\n\n // Insert static members before closing }\n if (cr.ivyCode.length > 0) {\n const memberCode = cr.ivyCode.map((c) => ' ' + c + ';').join('\\n');\n ms.appendLeft(cr.classEnd - 1, '\\n' + memberCode + '\\n');\n }\n\n for (const stmt of cr.scopedMetadata) {\n ms.appendLeft(cr.classEnd, `\\n/*@__PURE__*/ ${emitAngularStmt(stmt)}`);\n }\n }\n\n // 3. Emit constant pool statements.\n // Split into: helper declarations (const/function) that must appear before\n // the class (since static property initializers reference them), and\n // side-effect statements (setClassMetadata IIFEs) that go after.\n const helpers: string[] = [];\n const sideEffects: string[] = [];\n for (const s of constantPool.statements) {\n const code = emitAngularStmt(s);\n if (\n s instanceof o.ExpressionStatement &&\n s.expr instanceof o.InvokeFunctionExpr\n ) {\n // setClassMetadata is wrapped in `(() => { ... })()` — annotate\n // the IIFE call so bundlers can drop it when ngDevMode is folded\n // to false at production build time.\n sideEffects.push(`/*@__PURE__*/ ${code}`);\n } else {\n helpers.push(code);\n }\n }\n\n if (sideEffects.length > 0) {\n ms.append('\\n\\n' + sideEffects.join('\\n'));\n }\n\n // 4. Lower class field initializers to constructor assignments when\n // useDefineForClassFields is false (standard Angular tsconfig).\n // Uses the original OXC AST positions which are still valid for MagicString\n // since MagicString tracks edits relative to the original source.\n // Ivy static definitions (ɵcmp, ɵfac) are not in the original AST so they\n // are unaffected, and shouldLowerField skips static fields regardless.\n if (!useDefineForClassFields) {\n lowerClassFields(ms, sourceCode, oxcProgram);\n }\n\n // 5. Elide imports that are only used in type positions (type annotations,\n // implements, generics, etc.). Without this pass, single-file transpilers\n // like OXC / esbuild cannot tell that `import { SomeType }` is type-only\n // and will leave the import in the output, causing runtime errors.\n // Detection runs once on the final output; helpers are appended for\n // analysis only, since their position does not affect references.\n const helperCode = helpers.join('\\n');\n const willElide = detectTypeOnlyImportNames(\n ms.toString() + '\\n' + helperCode,\n );\n if (helpers.length > 0) {\n // Insert helpers after the last import / top-level non-class statement,\n // well before any class that references them. Skip imports that will be\n // fully removed by type elision (step 5): inserting inside a\n // soon-to-be-removed range would discard the helpers with the import.\n let insertPos = 0;\n for (const stmt of oxcProgram.body as any[]) {\n const { decl } = toTopLevelStatement(stmt);\n if (stmt.type === 'ImportDeclaration') {\n // Skip imports that will be entirely removed by type elision\n if (willElide.size > 0 && stmt.specifiers.length > 0) {\n const allElided = stmt.specifiers.every(\n (spec: any) =>\n spec.type === 'ImportNamespaceSpecifier' ||\n spec.importKind === 'type' ||\n willElide.has(spec.local.name),\n );\n if (allElided) continue;\n }\n insertPos = stmt.end;\n } else if (\n decl.type === 'VariableDeclaration' &&\n !sourceCode.slice(stmt.start, stmt.end).includes('class')\n ) {\n insertPos = stmt.end;\n } else if (\n stmt.type !== 'TSExportAssignment' &&\n !(\n stmt.type === 'ExportDefaultDeclaration' &&\n decl.type !== 'ClassDeclaration' &&\n decl.type !== 'FunctionDeclaration'\n )\n ) {\n // Stop at the first class or non-import/non-variable statement\n break;\n }\n }\n // Helpers must survive downstream `ms.overwrite()` / `ms.remove()` of\n // imports performed by the type-only specifier elision pass (step 5).\n //\n // Case `insertPos > 0`: a surviving import ends at `insertPos`. Use\n // `appendRight(insertPos, …)` so helpers bind to the `\\n` after the\n // import's `;` — outside any overwrite range `[node.start, node.end)`\n // of a preceding import. `appendLeft(insertPos, …)` would bind to the\n // `;` itself, which IS inside the overwrite range and would be wiped.\n //\n // Case `insertPos === 0`: no import survives — every import is going\n // to be elided, and `elideTypeOnlyImportsMagicString` will\n // `ms.remove(0, declEnd)` the first one. `appendRight(0, …)` anchors\n // to the character at position 0 (the first import's first char),\n // which is inside `[0, declEnd)` and gets wiped. Use `appendLeft(0, …)`\n // instead — it anchors to the LEFT of position 0, outside any range\n // starting at 0, so the helpers survive. Ordering is still correct\n // because the i0 import prepended in step 1 lives in MagicString's\n // `intro` (from `ms.prepend`), which always emits before any\n // `appendLeft` content at position 0.\n if (insertPos === 0) {\n ms.appendLeft(0, helperCode + '\\n');\n } else {\n ms.appendRight(insertPos, '\\n' + helperCode + '\\n');\n }\n }\n elideTypeOnlyImportsMagicString(ms, oxcProgram, willElide);\n\n const map = ms.generateMap({\n source: fileName,\n file: fileName + '.js',\n includeContent: true,\n hires: 'boundary',\n });\n\n if (debugCompile.enabled) {\n debugCompile(\n 'compile %s done (%dms, %d classes, %d resource deps)',\n fileName,\n Math.round(performance.now() - startTimeMs),\n classResults.length,\n resourceDependencies.length,\n );\n }\n return {\n code: ms.toString(),\n map,\n resourceDependencies,\n };\n}\n\n/** The local class name an `imports` entry declares, when it is a plain identifier. */\nfunction declarationName(declaration: CompileDeclaration): string | null {\n const node = (declaration.type as { node?: unknown }).node as\n | string\n | { type?: string; name?: string }\n | undefined;\n if (typeof node === 'string') {\n return node;\n }\n if (node?.type === 'Identifier' && typeof node.name === 'string') {\n return node.name;\n }\n return declaration.className ?? null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA8IA,SAAS,oBAAoB,MAA8B;CACzD,MAAM,YACH,KAAK,SAAS,4BACb,KAAK,SAAS,+BAChB,KAAK;CACP,MAAM,OAAO,WAAW,KAAK,cAAc;CAC3C,OAAO;EACL;EACA,UAAU,CAAC,CAAC;EACZ,OAAO,KAAK,IAAI,KAAK,OAAO,KAAK,aAAa,EAAE,EAAE,SAAS,KAAK,KAAK;EACrE,KAAK,KAAK;CACZ;AACF;;AAGA,SAAS,kBAAkB,KAAU,YAAwC;CAC3E,MAAM,SAAS,IAAI;CACnB,IAAI,QAAQ,SAAS,kBAAkB,OAAO,KAAA;CAC9C,OAAO,WAAW,MAAM,OAAO,OAAO,OAAO,OAAO,OAAO,GAAG;AAChE;;;;;AAWA,SAAS,oBACP,OACA,sBACuB;CACvB,IAAI,CAAC,SAAS,CAAC,sBAAsB,OAAO,CAAC;CAC7C,OAAO,MAAM,OAAO,SAAS,OAAO,MAAM;EACxC,MAAM,MAAM,qBAAqB,IAAI,MAAM,QAAQ,CAAC;EACpD,OAAO,QAAQ,KAAA,IAAY,CAAC,IAAI,CAAC;GAAE,GAAG;GAAO;EAAI,CAAC;CACpD,CAAC;AACH;;;;;;AAOA,SAAS,yBACP,YACA,QACA,YACQ;CACR,IAAI,OAAO;CACX,IAAI,MAAM,WAAW;CAC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Y,KAAK;QACZ,IACL,KAAK,SAAS,wBACd,EACE,KAAK,SAAS,8BACd,KAAK,SAAS,sBACd,KAAK,SAAS,wBAIhB;EAEJ;EAoBA,IAAI,cAAc,GAChB,GAAG,WAAW,GAAG,aAAa,IAAI;OAElC,GAAG,YAAY,WAAW,OAAO,aAAa,IAAI;CAEtD;CACA,gCAAgC,IAAI,YAAY,SAAS;CAEzD,MAAM,MAAM,GAAG,YAAY;EACzB,QAAQ;EACR,MAAM,WAAW;EACjB,gBAAgB;EAChB,OAAO;CACT,CAAC;CAED,IAAI,aAAa,SACf,aACE,wDACA,UACA,KAAK,MAAM,YAAY,IAAI,IAAI,WAAW,GAC1C,aAAa,QACb,qBAAqB,MACvB;CAEF,OAAO;EACL,MAAM,GAAG,SAAS;EAClB;EACA;CACF;AACF;;AAGA,SAAS,gBAAgB,aAAgD;CACvE,MAAM,OAAQ,YAAY,KAA4B;CAItD,IAAI,OAAO,SAAS,UAClB,OAAO;CAET,IAAI,MAAM,SAAS,gBAAgB,OAAO,KAAK,SAAS,UACtD,OAAO,KAAK;CAEd,OAAO,YAAY,aAAa;AAClC"}
1
+ {"version":3,"file":"compile.js","names":["path"],"sources":["../../../../src/lib/compiler/compile.ts"],"sourcesContent":["import * as fs from 'node:fs';\nimport * as path from 'node:path';\nimport * as o from '@angular/compiler';\nimport MagicString from 'magic-string';\nimport type { parseSync } from 'oxc-parser';\nimport { parseOxc } from './utils.js';\nimport {\n ConstantPool,\n compileComponentFromMetadata,\n compileDirectiveFromMetadata,\n compilePipeFromMetadata,\n compileNgModule,\n compileInjector,\n R3NgModuleMetadataKind,\n R3SelectorScopeMode,\n FactoryTarget,\n compileFactoryFunction,\n parseTemplate,\n makeBindingParser,\n parseHostBindings,\n ParseSourceFile,\n ParseLocation,\n ParseSourceSpan,\n compileClassMetadata,\n compileComponentClassMetadata,\n compileDeclareComponentFromMetadata,\n compileDeclareDirectiveFromMetadata,\n compileDeclarePipeFromMetadata,\n compileDeclareNgModuleFromMetadata,\n compileDeclareInjectorFromMetadata,\n compileDeclareInjectableFromMetadata,\n compileDeclareFactoryFunction,\n compileDeclareClassMetadata,\n} from '@angular/compiler';\nimport { ComponentRegistry } from './registry.js';\nimport {\n findAllClasses,\n resolveSyntheticImportSpecifier,\n walkOxc,\n} from './utils.js';\nimport { ANGULAR_DECORATORS, FIELD_DECORATORS } from './constants.js';\nimport { angularVersionAtLeast } from './angular-version.js';\nimport {\n detectTypeOnlyImportNames,\n elideTypeOnlyImportsMagicString,\n} from './type-elision.js';\n\nimport {\n emitAngularExpr,\n emitAngularStmt,\n setEmitterSourceCode,\n} from './js-emitter.js';\nimport { lowerClassFields } from './class-field-lowering.js';\nimport {\n extractMetadata,\n collectStringConstants,\n detectSignals,\n detectFieldDecorators,\n extractConstructorDeps,\n} from './metadata.js';\nimport { buildDeferDependencyMap, buildImportMap } from './defer.js';\nimport { buildCtorParameters, buildPropDecorators } from './jit-metadata.js';\nimport { debugCompile, debugEmit } from './debug.js';\nimport {\n getPropertyKey,\n inlineStyleRanges,\n type InlineStyle,\n type InlineStyleRange,\n} from './style-ast.js';\n\n/**\n * COMPLETE EXHAUSTIVE ANGULAR LITE COMPILER\n * Translates Angular Decorators + Signals to Ivy Static Definitions.\n *\n * @param registry - Optional external registry from the global analysis plugin.\n * When provided, used to resolve component/directive selectors for template compilation.\n */\nexport interface CompileResult {\n code: string;\n /** Source map for the transformation */\n map: ReturnType<MagicString['generateMap']>;\n /** Absolute paths of external resources (templateUrl, styleUrl) read during compilation */\n resourceDependencies: string[];\n}\n\nexport interface CompileOptions {\n registry?: ComponentRegistry;\n /** Pre-resolved style contents keyed by absolute file path (e.g. SCSS already compiled to CSS). */\n resolvedStyles?: Map<string, string>;\n /** Pre-processed inline styles (index in styles array → compiled CSS). */\n resolvedInlineStyles?: Map<number, string>;\n /**\n * When `false` (default), instance class field initializers are lowered to\n * constructor assignments (matching TypeScript's `useDefineForClassFields: false`\n * behavior). This is required for Angular's `inject()` and constructor DI to\n * work correctly with the standard Angular tsconfig.\n */\n useDefineForClassFields?: boolean;\n /** Enable legacy i18n message ID format (default: true). */\n enableI18nLegacyMessageIdFormat?: boolean;\n /** Normalize line endings in ICU expressions (default: true). */\n i18nNormalizeLineEndingsInICUs?: boolean;\n /** Use external IDs in `$localize` calls (for Closure Compiler compatibility). */\n i18nUseExternalIds?: boolean;\n /**\n * Compilation output mode.\n * - `'full'` (default): Emit final Ivy definitions (`ɵɵdefineComponent`) for application builds.\n * - `'partial'`: Emit partial declarations (`ɵɵngDeclareComponent`) for library publishing.\n * Partial output is version-stable and linked at application build time.\n */\n compilationMode?: 'full' | 'partial';\n /**\n * Pre-parsed OXC program of `sourceCode`, so callers that already parsed\n * the identical string can avoid a re-parse. Treated as read-only.\n */\n oxcProgram?: ReturnType<typeof parseSync>['program'];\n}\n\ntype CompileMetadata = ReturnType<typeof extractMetadata>;\n\ntype CompileDeclaration = {\n type: o.Expression;\n selector: string | null;\n className?: string;\n kind: number;\n name?: string;\n inputs?: string[];\n outputs?: string[];\n exportAs?: string[];\n isComponent?: boolean;\n};\n\n/** A top-level statement with any `export` wrapper unwrapped. */\ninterface TopLevelStatement {\n /** The declaration (or the statement itself when not exported). */\n decl: any;\n exported: boolean;\n /** Start of the whole statement, including leading class decorators. */\n start: number;\n end: number;\n}\n\nfunction toTopLevelStatement(stmt: any): TopLevelStatement {\n const isExport =\n (stmt.type === 'ExportNamedDeclaration' ||\n stmt.type === 'ExportDefaultDeclaration') &&\n stmt.declaration;\n const decl = isExport ? stmt.declaration : stmt;\n return {\n decl,\n exported: !!isExport,\n start: Math.min(stmt.start, decl.decorators?.[0]?.start ?? stmt.start),\n end: stmt.end,\n };\n}\n\n/** Get the callee name of a decorator call, e.g. `Component` for `@Component(...)`. */\nfunction decoratorCallName(dec: any, sourceCode: string): string | undefined {\n const callee = dec.expression;\n if (callee?.type !== 'CallExpression') return undefined;\n return sourceCode.slice(callee.callee.start, callee.callee.end);\n}\n\n/** An inline style and the CSS the style pipeline produced for it. */\ninterface ResolvedInlineStyle extends InlineStyle {\n css: string;\n}\n\n/**\n * Pair each inline style of a component with its processed CSS, skipping the\n * ones whose processing failed.\n */\nfunction resolveInlineStyles(\n range: InlineStyleRange | undefined,\n resolvedInlineStyles: Map<number, string> | undefined,\n): ResolvedInlineStyle[] {\n if (!range || !resolvedInlineStyles) return [];\n return range.styles.flatMap((style, k) => {\n const css = resolvedInlineStyles.get(range.start + k);\n return css === undefined ? [] : [{ ...style, css }];\n });\n}\n\n/**\n * Source text of a `styles` value with each resolved inline style replaced by\n * its processed CSS, so the class metadata a TestBed override recompiles from\n * carries the same styles as ɵcmp.\n */\nfunction withResolvedInlineStyles(\n stylesNode: any,\n styles: ResolvedInlineStyle[],\n sourceCode: string,\n): string {\n let text = '';\n let pos = stylesNode.start;\n for (const { node, css } of styles) {\n text += sourceCode.slice(pos, node.start) + JSON.stringify(css);\n pos = node.end;\n }\n return text + sourceCode.slice(pos, stylesNode.end);\n}\n\n/**\n * Normalize a `providers` / `viewProviders` metadata value into the single\n * `o.Expression` Angular's injector/host emitters expect.\n *\n * `extractMetadata` stores these as an array of `WrappedNodeExpr` when the\n * source used an inline array literal (`providers: [A, B]`) — those get\n * wrapped in a `LiteralArrayExpr`. When the source referenced a const,\n * spread, or call instead (`providers: safeProviders`), it stores the raw\n * expression, which is emitted by value. Returns `null` when there is\n * nothing to emit so callers skip the feature entirely.\n */\nfunction providersToExpr(\n value: o.Expression[] | o.Expression | undefined | null,\n): o.Expression | null {\n if (!value) return null;\n if (Array.isArray(value)) {\n return value.length ? new o.LiteralArrayExpr(value) : null;\n }\n return value;\n}\n\nconst LAZY_SCOPE_TYPES = new Set([\n 'FunctionDeclaration',\n 'FunctionExpression',\n 'ArrowFunctionExpression',\n 'ClassDeclaration',\n 'ClassExpression',\n 'TSFunctionType',\n 'TSConstructorType',\n 'TSMethodSignature',\n 'TSCallSignatureDeclaration',\n 'TSConstructSignatureDeclaration',\n]);\n\n/**\n * Collect identifier names referenced in eagerly-evaluated code only.\n * Skips function/arrow/class bodies so that lazy references\n * (e.g. `const TOKEN = () => LaterClass`) are not treated as dependencies.\n * The root node's own children are always walked.\n */\nfunction collectIdentifiers(root: any): Set<string> {\n const ids = new Set<string>();\n walkOxc(root, (n) => {\n if (n.type === 'Identifier') ids.add(n.name);\n return n === root || !LAZY_SCOPE_TYPES.has(n.type);\n });\n return ids;\n}\n\n/** Extract the names defined by a top-level declaration. */\nfunction getDefinedNames(decl: any): string[] {\n if (decl.type === 'VariableDeclaration') {\n const names: string[] = [];\n for (const d of decl.declarations) {\n collectBindingNames(d.id, names);\n }\n return names;\n }\n if (\n (decl.type === 'FunctionDeclaration' || decl.type === 'ClassDeclaration') &&\n decl.id\n ) {\n return [decl.id.name];\n }\n return [];\n}\n\n/** Recursively collect all bound identifiers from a binding pattern. */\nfunction collectBindingNames(pattern: any, out: string[]): void {\n if (!pattern) return;\n switch (pattern.type) {\n case 'Identifier':\n out.push(pattern.name);\n break;\n case 'ObjectPattern':\n for (const prop of pattern.properties) {\n collectBindingNames(\n prop.type === 'RestElement' ? prop.argument : prop.value,\n out,\n );\n }\n break;\n case 'ArrayPattern':\n for (const el of pattern.elements) collectBindingNames(el, out);\n break;\n case 'RestElement':\n collectBindingNames(pattern.argument, out);\n break;\n case 'AssignmentPattern':\n collectBindingNames(pattern.left, out);\n break;\n }\n}\n\nexport function compile(\n sourceCode: string,\n fileName: string,\n optionsOrRegistry?: CompileOptions | ComponentRegistry,\n): CompileResult {\n // Backward compat: accept ComponentRegistry directly\n const opts: CompileOptions =\n optionsOrRegistry instanceof Map\n ? { registry: optionsOrRegistry }\n : optionsOrRegistry || {};\n const registry = opts.registry;\n const resolvedStyles = opts.resolvedStyles;\n const resolvedInlineStyles = opts.resolvedInlineStyles;\n const useDefineForClassFields = opts.useDefineForClassFields ?? false;\n const isPartial = opts.compilationMode === 'partial';\n const startTimeMs = debugCompile.enabled ? performance.now() : 0;\n debugCompile(\n 'compile %s (mode=%s, registry=%d entries)',\n fileName,\n isPartial ? 'partial' : 'full',\n registry?.size ?? 0,\n );\n const oxcProgram = opts.oxcProgram ?? parseOxc(fileName, sourceCode).program;\n const styleRanges = resolvedInlineStyles && inlineStyleRanges(oxcProgram);\n const oxcClassMap = new Map<string, any>();\n for (const stmt of oxcProgram.body) {\n const decl =\n stmt.type === 'ExportNamedDeclaration' ||\n stmt.type === 'ExportDefaultDeclaration'\n ? (stmt as any).declaration\n : stmt;\n if (\n decl &&\n (decl.type === 'ClassDeclaration' || decl.type === 'ClassExpression') &&\n decl.id?.name\n ) {\n oxcClassMap.set(decl.id.name, decl);\n }\n }\n\n // Collect module-level string constants so decorator metadata can resolve\n // template-literal interpolations like `template: \\`<div class=\"${tw}\">x</div>\\``.\n const stringConsts = collectStringConstants(oxcProgram);\n\n const constantPool = new ConstantPool();\n const resourceDependencies: string[] = [];\n const parseFile = new ParseSourceFile(sourceCode, fileName);\n const parseLoc = new ParseLocation(parseFile, 0, 0, 0);\n const typeSourceSpan = new ParseSourceSpan(parseLoc, parseLoc);\n const typeOnlyImports = detectTypeOnlyImportNames(sourceCode, oxcProgram);\n const importSpecifierByName = new Map<string, string>();\n const importedNames = new Set<string>();\n const typeOnlyImportedNames = new Set<string>();\n\n for (const stmt of oxcProgram.body as any[]) {\n if (stmt.type !== 'ImportDeclaration') continue;\n\n const moduleSpecifier: string = stmt.source.value;\n // Explicit `import type { X }` — declaration-level type-only import\n const isDeclarationTypeOnly = stmt.importKind === 'type';\n for (const element of stmt.specifiers) {\n if (element.type !== 'ImportSpecifier') continue;\n const localName: string = element.local.name;\n importSpecifierByName.set(localName, moduleSpecifier);\n // Explicit `import { type X }` — specifier-level type-only import.\n // Both forms erase the symbol at runtime, so they cannot be used as\n // DI tokens. Add them to typeOnlyImports so extractConstructorDeps\n // surfaces ɵɵinvalidFactory() instead of emitting a broken\n // ɵɵdirectiveInject(X) referring to a non-existent value.\n if (isDeclarationTypeOnly || element.importKind === 'type') {\n typeOnlyImports.add(localName);\n typeOnlyImportedNames.add(localName);\n } else {\n importedNames.add(localName);\n }\n }\n }\n\n // Build a file-local selector map as fallback when no external registry is provided.\n // Skip the expensive extractMetadata scan when a registry covers all classes.\n const localSelectors = new Map<string, string>();\n /**\n * Per component class: the dependencies only its @defer blocks use, which\n * its class metadata must load lazily (`ɵsetClassMetadataAsync`).\n */\n const deferredMetadataDeps = new Map<\n string,\n { symbolName: string; importPath: string; isDefaultImport: boolean }[]\n >();\n if (!registry) {\n for (const [clsName, oxcNode] of oxcClassMap) {\n const decs: any[] = oxcNode.decorators || [];\n if (decs.length > 0) {\n const meta = extractMetadata(decs[0], sourceCode, stringConsts);\n if (meta?.selector) {\n localSelectors.set(clsName, meta.selector.split(',')[0].trim());\n }\n }\n }\n }\n\n const bindingParser = isPartial ? undefined : makeBindingParser();\n setEmitterSourceCode(sourceCode);\n\n // --- Direct walk: compile each Angular-decorated class and collect string outputs ---\n interface ClassCompileResult {\n ivyCode: string[]; // \"static ɵfac = ...\", \"static ɵcmp = ...\", etc.\n decorators: any[]; // Angular decorators to remove (OXC nodes)\n classEnd: number; // Position of closing } in original source\n // setClassMetadata calls for classes nested in a function scope, which\n // must be emitted next to the class rather than at module scope.\n scopedMetadata: o.Statement[];\n }\n const classResults: ClassCompileResult[] = [];\n const topLevelClasses = new Set(\n (oxcProgram.body as any[]).map((stmt) => toTopLevelStatement(stmt).decl),\n );\n // Track synthetic imports needed for NgModule export expansion.\n // Maps exported class name → import specifier.\n const syntheticImports = new Map<string, string>();\n // A type-only import is erased at runtime, so its synthetic value import\n // needs an alias to avoid redeclaring the type-only binding.\n const dependencyLocalName = (name: string) =>\n typeOnlyImportedNames.has(name) ? `ɵngDep_${name}` : name;\n\n // ANGULAR_DECORATORS imported from utils\n\n for (const node of findAllClasses(oxcProgram)) {\n const decorators: any[] = node.decorators;\n if (!decorators || decorators.length === 0) continue;\n\n const className: string | undefined = node.id?.name;\n if (!className) continue;\n\n const angularDecorators = decorators.filter((dec) =>\n ANGULAR_DECORATORS.has(decoratorCallName(dec, sourceCode) ?? ''),\n );\n if (angularDecorators.length === 0) continue;\n\n const ivyCode: string[] = [];\n let targetType: FactoryTarget = FactoryTarget.Injectable;\n // Store resolved resources per decorator for metadata inlining\n const resolvedResources = new Map<\n any,\n { template?: string; styles?: string[] }\n >();\n\n const classRef: o.R3Reference = {\n value: new o.WrappedNodeExpr(className),\n type: new o.WrappedNodeExpr(className),\n };\n\n // Detect `class Foo extends Bar` so the directive/component def\n // gets `usesInheritance: true`. Angular's compiler turns that into\n // `features: [InheritDefinitionFeature]`, which is what causes the\n // runtime to merge inputs/outputs/queries/host bindings from the\n // base class. Without it, derived directives like\n // `BrnPopover extends BrnDialog` lose every input declared on the\n // base, and any host directive that references those inputs by\n // public name fails at runtime with NG0311.\n const usesInheritance = !!node.superClass;\n\n let classCompileError: Error | null = null;\n\n angularDecorators.forEach((dec) => {\n const decoratorName = decoratorCallName(dec, sourceCode)!;\n const meta = extractMetadata(dec, sourceCode, stringConsts);\n const sigs = detectSignals(node, sourceCode);\n const fields = detectFieldDecorators(node, sourceCode);\n const hostBindings = parseHostBindings(meta.hostRaw || {});\n\n const hostMetadata: o.R3HostMetadata = {\n attributes: hostBindings.attributes,\n listeners: { ...hostBindings.listeners, ...fields.hostListeners },\n properties: { ...hostBindings.properties, ...fields.hostProperties },\n specialAttributes: hostBindings.specialAttributes,\n };\n\n switch (decoratorName) {\n case 'Component': {\n targetType = FactoryTarget.Component;\n if (!meta.selector) {\n meta.selector = `ng-component-${className.toLowerCase()}`;\n }\n\n const declarations: CompileDeclaration[] = [];\n // Dedupe by class name across direct imports, tuple-barrel\n // expansion, and NgModule export expansion so the final\n // `dependencies: () => [...]` list never contains the same\n // class twice. Otherwise Angular's runtime throws NG0300\n // (\"Multiple components match …\") when a file lists both\n // `NgIcon` and a barrel like `HlmIconImports = [HlmIcon, NgIcon]`\n // that re-exports it, or when two NgModules re-export the same\n // directive (e.g. FormsModule + ReactiveFormsModule →\n // DefaultValueAccessor).\n const seenDeclarationNames = new Set<string>();\n\n // Expand `imports` entries that are not directives themselves\n // (e.g. NgModules and tuple barrels like `HlmSelectImports =\n // [HlmSelect, HlmSelectContent, ...] as const`) into the\n // underlying directive class names. Returns the original entry\n // when it doesn't match either expansion case.\n const collectExpandedImports = (\n depClassName: string,\n visited: Set<string>,\n ): string[] => {\n if (visited.has(depClassName)) return [];\n visited.add(depClassName);\n const entry = registry?.get(depClassName);\n if (!entry) return [depClassName];\n if (entry.kind === 'ngmodule' && entry.exports) {\n const out: string[] = [];\n for (const name of entry.exports) {\n out.push(...collectExpandedImports(name, visited));\n }\n return out;\n }\n if (entry.kind === 'tuple' && entry.members) {\n const out: string[] = [];\n for (const name of entry.members) {\n out.push(...collectExpandedImports(name, visited));\n }\n return out;\n }\n return [depClassName];\n };\n\n for (const dep of Array.isArray(meta.imports) ? meta.imports : []) {\n const depNode = dep.node;\n const depClassName: string =\n typeof depNode === 'string'\n ? depNode\n : (depNode?.name ?? depNode?.type === 'Identifier')\n ? depNode.name\n : sourceCode.slice(depNode?.start ?? 0, depNode?.end ?? 0);\n const registryEntry = registry?.get(depClassName);\n\n // Tuple barrel: `imports: [HlmSelectImports]` where the\n // const is `[HlmSelect, HlmSelectContent, ...] as const`.\n // Expand into the underlying directive declarations and\n // track synthetic imports for any classes not already\n // referenced in this file.\n if (registryEntry?.kind === 'tuple' && registryEntry.members) {\n const expanded = collectExpandedImports(depClassName, new Set());\n const tupleSpecifier = importSpecifierByName.get(depClassName);\n for (const memberName of expanded) {\n const memberEntry = registry?.get(memberName);\n if (!memberEntry || memberEntry.kind === 'tuple') continue;\n const memberRef = new o.WrappedNodeExpr(\n dependencyLocalName(memberName),\n );\n if (!importedNames.has(memberName)) {\n const memberSpecifier = resolveSyntheticImportSpecifier(\n fileName,\n memberEntry,\n tupleSpecifier,\n );\n if (memberSpecifier) {\n syntheticImports.set(memberName, memberSpecifier);\n }\n }\n const kind = memberEntry.kind === 'pipe' ? 1 : 0;\n const memberDecl: CompileDeclaration = {\n type: memberRef,\n selector: memberEntry.selector,\n kind,\n ...(kind === 1 ? { name: memberEntry.pipeName } : {}),\n };\n if (memberEntry.inputs) {\n memberDecl.inputs = Object.values(memberEntry.inputs).map(\n (i) => i.bindingPropertyName,\n );\n }\n if (memberEntry.outputs) {\n memberDecl.outputs = Object.values(\n memberEntry.outputs,\n ) as string[];\n }\n if (!seenDeclarationNames.has(memberName)) {\n seenDeclarationNames.add(memberName);\n declarations.push(memberDecl);\n }\n }\n continue;\n }\n\n if (registryEntry?.kind === 'ngmodule' && registryEntry.exports) {\n const moduleSpecifier = importSpecifierByName.get(depClassName);\n\n // Recursively collect all non-module exports (handles nested NgModules\n // like ReactiveFormsModule → ɵInternalFormsSharedModule → DefaultValueAccessor)\n const allExports: string[] = [];\n const expandModule = (\n moduleName: string,\n visited = new Set<string>(),\n ) => {\n if (visited.has(moduleName)) return;\n visited.add(moduleName);\n const mod = registry?.get(moduleName);\n if (!mod?.exports) return;\n for (const name of mod.exports) {\n const entry = registry?.get(name);\n if (!entry) continue;\n if (entry.kind === 'ngmodule') {\n expandModule(name, visited);\n } else {\n allExports.push(name);\n }\n }\n };\n expandModule(depClassName);\n\n for (const exportedName of allExports) {\n const exportedEntry = registry?.get(exportedName);\n if (exportedEntry) {\n const kind = exportedEntry.kind === 'pipe' ? 1 : 0;\n // Create a reference to the exported class. If it's not\n // already imported, track it for synthetic import injection.\n const exportedRef = new o.WrappedNodeExpr(\n dependencyLocalName(exportedName),\n );\n const exportedSpecifier = resolveSyntheticImportSpecifier(\n fileName,\n exportedEntry,\n moduleSpecifier,\n );\n if (exportedSpecifier) {\n syntheticImports.set(exportedName, exportedSpecifier);\n }\n const decl: CompileDeclaration = {\n type: exportedRef,\n selector: exportedEntry.selector,\n kind,\n ...(kind === 1 ? { name: exportedEntry.pipeName } : {}),\n };\n if (exportedEntry.inputs) {\n decl.inputs = Object.values(exportedEntry.inputs).map(\n (i) => i.bindingPropertyName,\n );\n }\n if (exportedEntry.outputs) {\n decl.outputs = Object.values(\n exportedEntry.outputs,\n ) as string[];\n }\n if (!seenDeclarationNames.has(exportedName)) {\n seenDeclarationNames.add(exportedName);\n declarations.push(decl);\n }\n }\n }\n continue;\n }\n\n const selector =\n registryEntry?.selector ?? localSelectors.get(depClassName);\n const kind = registryEntry?.kind === 'pipe' ? 1 : 0;\n const decl: CompileDeclaration = {\n type: dep,\n selector: selector || `_unresolved-${depClassName}`,\n kind,\n ...(kind === 1 ? { name: registryEntry?.pipeName } : {}),\n };\n // Pass inputs/outputs from registry so template bindings resolve.\n // R3DirectiveDependencyMetadata expects inputs/outputs as string[]\n // of binding property names.\n if (registryEntry?.inputs) {\n decl.inputs = Object.values(registryEntry.inputs).map(\n (i) => i.bindingPropertyName,\n );\n }\n if (registryEntry?.outputs) {\n decl.outputs = Object.values(registryEntry.outputs) as string[];\n }\n if (!seenDeclarationNames.has(depClassName)) {\n seenDeclarationNames.add(depClassName);\n declarations.push(decl);\n }\n }\n\n // Add self-reference so recursive components (e.g. tree views)\n // can use their own selector in their template.\n // Skip in partial mode — the linker handles self-resolution.\n if (!isPartial && !seenDeclarationNames.has(className)) {\n const selfInputs = Object.entries(sigs.inputs).map(\n ([, v]: [string, any]) => v.bindingPropertyName,\n );\n const selfOutputs = Object.values({\n ...meta.outputs,\n ...fields.outputs,\n ...sigs.outputs,\n }) as string[];\n seenDeclarationNames.add(className);\n declarations.push({\n type: classRef.value,\n selector: meta.selector,\n kind: 0,\n ...(selfInputs.length > 0 ? { inputs: selfInputs } : {}),\n ...(selfOutputs.length > 0 ? { outputs: selfOutputs } : {}),\n });\n }\n\n // Non-standalone components get their directive/pipe scope from the\n // @NgModule that declares them. Whole-program ngtsc resolves this; a\n // per-file engine can't read the module from the component file, but the\n // project-wide registry (populated at buildStart) records every module's\n // declarations + imports. We resolve the owning module's transitive scope\n // here and inline it into the component's own `dependencies` — matching\n // ngtsc, and surviving tree-shaking (unlike a separate, droppable\n // `ɵɵsetComponentScope` call).\n //\n // A component declared in an @NgModule must set\n // `standalone: false`, so only those need the owning-module lookup.\n if (!isPartial && meta.standalone === false && registry) {\n let owningModule:\n | { declarations?: string[]; imports?: string[] }\n | undefined;\n for (const entry of registry.values()) {\n if (\n entry.kind === 'ngmodule' &&\n entry.declarations?.includes(className)\n ) {\n owningModule = entry;\n break;\n }\n }\n if (owningModule) {\n // Transitive scope = the module's own declarations + the exported\n // declarations of every imported module (recursively) + tuple members.\n const scopeNames = new Set<string>();\n const addExportsOf = (modName: string, visited: Set<string>) => {\n if (visited.has(modName)) return;\n visited.add(modName);\n const e = registry.get(modName);\n if (!e) return;\n if (e.kind === 'ngmodule') {\n for (const exp of e.exports ?? []) addExportsOf(exp, visited);\n } else if (e.kind === 'tuple') {\n for (const m of e.members ?? []) scopeNames.add(m);\n } else {\n scopeNames.add(modName);\n }\n };\n for (const d of owningModule.declarations ?? [])\n scopeNames.add(d);\n for (const imp of owningModule.imports ?? [])\n addExportsOf(imp, new Set());\n\n for (const name of scopeNames) {\n if (seenDeclarationNames.has(name)) continue;\n const entry = registry.get(name);\n if (\n !entry ||\n entry.kind === 'ngmodule' ||\n entry.kind === 'tuple'\n )\n continue;\n if (!importedNames.has(name)) {\n const spec = resolveSyntheticImportSpecifier(\n fileName,\n entry,\n importSpecifierByName.get(name),\n );\n if (spec) syntheticImports.set(name, spec);\n }\n const kind = entry.kind === 'pipe' ? 1 : 0;\n const decl: CompileDeclaration = {\n type: new o.WrappedNodeExpr(dependencyLocalName(name)),\n selector: entry.selector || `_unresolved-${name}`,\n kind,\n ...(kind === 1 ? { name: entry.pipeName } : {}),\n };\n if (entry.inputs) {\n decl.inputs = Object.values(entry.inputs).map(\n (i) => i.bindingPropertyName,\n );\n }\n if (entry.outputs) {\n decl.outputs = Object.values(entry.outputs) as string[];\n }\n seenDeclarationNames.add(name);\n declarations.push(decl);\n }\n }\n }\n\n let templateContent = meta.template || '';\n if (!templateContent && meta.templateUrl) {\n try {\n const templatePath = path.resolve(\n path.dirname(fileName),\n meta.templateUrl,\n );\n templateContent = fs.readFileSync(templatePath, 'utf-8');\n resourceDependencies.push(templatePath);\n } catch {\n console.warn(\n `[fast-compile] Could not read template file \"${meta.templateUrl}\" for ${className}`,\n );\n }\n }\n\n if (Array.isArray(meta.styleUrls)) {\n for (const url of meta.styleUrls) {\n try {\n const stylePath = path.resolve(path.dirname(fileName), url);\n const styleContent =\n resolvedStyles?.get(stylePath) ??\n fs.readFileSync(stylePath, 'utf-8');\n meta.styles.push(styleContent);\n resourceDependencies.push(stylePath);\n } catch {\n console.warn(\n `[fast-compile] Could not read style file \"${url}\" for ${className}`,\n );\n }\n }\n }\n\n for (const { index, css } of resolveInlineStyles(\n styleRanges?.get(dec),\n resolvedInlineStyles,\n )) {\n meta.styles[index] = css;\n }\n\n // Store resolved resources for metadata inlining. `styles` is set only\n // when a styleUrl was read here, and then holds every style ɵcmp got,\n // inline ones included.\n resolvedResources.set(dec, {\n template: templateContent || undefined,\n styles:\n meta.styleUrls.length > 0 && meta.styles?.length > 0\n ? [...meta.styles]\n : undefined,\n });\n\n const parsedTemplate = parseTemplate(templateContent, fileName, {\n preserveWhitespaces: meta.preserveWhitespaces,\n enableI18nLegacyMessageIdFormat:\n opts.enableI18nLegacyMessageIdFormat ?? true,\n i18nNormalizeLineEndingsInICUs:\n opts.i18nNormalizeLineEndingsInICUs ?? true,\n });\n\n const ivyInputs: Record<string, unknown> = {};\n if (Array.isArray(meta.inputs)) {\n meta.inputs.forEach((i: string) => (ivyInputs[i] = i));\n } else if (meta.inputs) {\n Object.assign(ivyInputs, meta.inputs);\n }\n Object.assign(ivyInputs, fields.inputs);\n for (const [key, val] of Object.entries(sigs.inputs)) {\n const sigDesc = val as {\n bindingPropertyName?: string;\n required?: boolean;\n transform?: o.Expression | null;\n };\n ivyInputs[key] = {\n classPropertyName: key,\n // Honor the binding name (alias) extracted by detectSignals\n // so `input(null, { alias: 'aria-label' })` registers with\n // the public name `aria-label`, not the class property name.\n bindingPropertyName: sigDesc.bindingPropertyName ?? key,\n isSignal: true,\n required: sigDesc.required || false,\n transformFunction: sigDesc.transform || null,\n };\n }\n const templateErrors = parsedTemplate.errors ?? [];\n if (templateErrors.length > 0) {\n const firstError = templateErrors[0];\n classCompileError = new Error(\n `[fast-compile] Template parse error in ${fileName} (${className}): ${firstError.msg}`,\n );\n return;\n }\n\n // Classes used only inside @defer blocks load through the blocks'\n // dynamic import()s, so they must not also be eager dependencies:\n // that would keep their module in this chunk. Once nothing else\n // references them, the TypeScript strip pass drops their imports.\n const deferDependencies = buildDeferDependencyMap(\n parsedTemplate,\n oxcProgram,\n registry,\n localSelectors,\n );\n if (!isPartial && deferDependencies.deferredImports.size > 0) {\n const importMap = buildImportMap(oxcProgram);\n const metadataDeps: {\n symbolName: string;\n importPath: string;\n isDefaultImport: boolean;\n }[] = [];\n for (let i = declarations.length - 1; i >= 0; i--) {\n const name = declarationName(declarations[i]);\n const info = name !== null ? importMap.get(name) : undefined;\n if (\n name === null ||\n info === undefined ||\n !deferDependencies.deferredImports.has(name)\n ) {\n continue;\n }\n declarations.splice(i, 1);\n metadataDeps.unshift({\n symbolName: name,\n importPath: info.path,\n isDefaultImport: info.isDefault,\n });\n }\n if (metadataDeps.length > 0) {\n deferredMetadataDeps.set(className, metadataDeps);\n }\n }\n\n const componentMeta: CompileMetadata & {\n name: string;\n type: o.R3Reference;\n typeSourceSpan: ParseSourceSpan;\n declarations: CompileDeclaration[];\n template: {\n nodes: o.Node[];\n ngContentSelectors: string[];\n preserveWhitespaces: boolean;\n };\n } = {\n ...meta,\n name: className,\n type: classRef,\n typeSourceSpan,\n declarations,\n template: {\n nodes: parsedTemplate.nodes,\n ngContentSelectors: parsedTemplate.ngContentSelectors,\n preserveWhitespaces: parsedTemplate.preserveWhitespaces,\n },\n styles: [...(meta.styles || []), ...(parsedTemplate.styles || [])],\n inputs: ivyInputs,\n outputs: { ...meta.outputs, ...fields.outputs, ...sigs.outputs },\n viewQueries: [...fields.viewQueries, ...sigs.viewQueries],\n queries: [...fields.contentQueries, ...sigs.contentQueries],\n host: hostMetadata,\n changeDetection: meta.changeDetection ?? (isPartial ? null : 1),\n encapsulation: meta.encapsulation ?? 0,\n exportAs: meta.exportAs,\n providers: providersToExpr(meta.providers),\n viewProviders: providersToExpr(meta.viewProviders),\n animations: meta.animations?.length\n ? new o.LiteralArrayExpr(meta.animations)\n : null,\n isStandalone: meta.standalone,\n imports: meta.imports,\n lifecycle: { usesOnChanges: false },\n // Angular v19/v20's `createComponentDefinitionMap` reads\n // `meta.interpolation.start` and `meta.interpolation.end`\n // unconditionally (the `!== DEFAULT_INTERPOLATION_CONFIG` check\n // is reference-equality, so a missing field enters the block\n // and crashes with `Cannot read properties of undefined`). v21\n // dropped the field from `createComponentDefinitionMap`\n // entirely. Use the v19/v20 singleton when the Angular package\n // exports it (matches the reference-equality check, skipping\n // the partial-mode emission block) and fall back to a plain\n // shape on v21+ where the field is ignored anyway.\n interpolation: (\n o as {\n DEFAULT_INTERPOLATION_CONFIG?: { start: string; end: string };\n }\n ).DEFAULT_INTERPOLATION_CONFIG ?? { start: '{{', end: '}}' },\n usesInheritance,\n defer: {\n mode: 0,\n blocks: deferDependencies.blocks,\n },\n declarationListEmitMode: 1,\n i18nUseExternalIds: opts.i18nUseExternalIds ?? false,\n relativeContextFilePath: fileName,\n controlCreate: null,\n hasDirectiveDependencies:\n declarations.length > 0 ||\n (Array.isArray(meta.imports) && meta.imports.length > 0),\n };\n\n if (isPartial) {\n // Partial compilation accesses .inputs, .outputs, .exportAs on\n // each declaration — ensure they are arrays (not undefined).\n componentMeta.declarations = declarations.map((d) => ({\n ...d,\n inputs: d.inputs ?? null,\n outputs: d.outputs ?? null,\n exportAs: d.exportAs ?? null,\n isComponent: d.isComponent ?? false,\n }));\n const cmp = compileDeclareComponentFromMetadata(\n componentMeta,\n parsedTemplate,\n {\n content: templateContent,\n sourceUrl: fileName,\n isInline: !meta.templateUrl,\n inlineTemplateLiteralExpression: null,\n },\n );\n ivyCode.push(\n `static ɵcmp = /*@__PURE__*/ ${emitAngularExpr(cmp.expression)}`,\n );\n } else {\n const cmp = compileComponentFromMetadata(\n componentMeta,\n constantPool,\n bindingParser!,\n );\n ivyCode.push(\n `static ɵcmp = /*@__PURE__*/ ${emitAngularExpr(cmp.expression)}`,\n );\n }\n break;\n }\n\n case 'Directive': {\n targetType = FactoryTarget.Directive;\n // Build proper input descriptors (same as Component path)\n const dirInputs: Record<string, unknown> = {};\n if (Array.isArray(meta.inputs)) {\n meta.inputs.forEach((i: string) => (dirInputs[i] = i));\n } else if (meta.inputs) {\n Object.assign(dirInputs, meta.inputs);\n }\n Object.assign(dirInputs, fields.inputs);\n for (const [key, val] of Object.entries(sigs.inputs)) {\n const sigDesc = val as {\n bindingPropertyName?: string;\n required?: boolean;\n transform?: o.Expression | null;\n };\n dirInputs[key] = {\n classPropertyName: key,\n // Honor the binding name (alias) extracted by detectSignals.\n bindingPropertyName: sigDesc.bindingPropertyName ?? key,\n isSignal: true,\n required: sigDesc.required || false,\n transformFunction: sigDesc.transform || null,\n };\n }\n const directiveMeta = {\n ...meta,\n // Abstract base directives are declared as `@Directive()` with\n // no metadata. Angular's R3DirectiveMetadata accepts\n // `selector: string | null`, but the downstream selector parser\n // calls `.replace()` on the value and crashes on `undefined`.\n // Coerce missing selectors to `null` so abstract base classes\n // compile correctly.\n selector: meta.selector ?? null,\n name: className,\n type: classRef,\n typeSourceSpan,\n host: hostMetadata,\n inputs: dirInputs,\n outputs: { ...meta.outputs, ...fields.outputs, ...sigs.outputs },\n viewQueries: [...fields.viewQueries, ...sigs.viewQueries],\n queries: [...fields.contentQueries, ...sigs.contentQueries],\n // Angular's compiler treats `providers` as an Expression and\n // emits `ɵɵProvidersFeature(<expr>)` whenever it is truthy.\n // `providersToExpr` lowers an inline array literal to a\n // LiteralArrayExpr (matching the Component branch) and passes a\n // const/spread reference through by value — returning `null`\n // when there are no providers so Angular skips the feature\n // entirely. Passing the bare JS array would otherwise be lowered\n // to `null` and crash Angular at runtime in `resolveProvider`.\n providers: providersToExpr(meta.providers),\n exportAs: meta.exportAs,\n isStandalone: meta.standalone,\n lifecycle: { usesOnChanges: false },\n usesInheritance,\n controlCreate: null,\n };\n if (isPartial) {\n const dir = compileDeclareDirectiveFromMetadata(directiveMeta);\n ivyCode.push(\n `static ɵdir = /*@__PURE__*/ ${emitAngularExpr(dir.expression)}`,\n );\n } else {\n const dir = compileDirectiveFromMetadata(\n directiveMeta,\n constantPool,\n bindingParser!,\n );\n ivyCode.push(\n `static ɵdir = /*@__PURE__*/ ${emitAngularExpr(dir.expression)}`,\n );\n }\n break;\n }\n\n case 'Pipe': {\n targetType = FactoryTarget.Pipe;\n const pipeMeta = {\n ...meta,\n name: className,\n pipeName: meta.name,\n type: classRef,\n isStandalone: meta.standalone,\n pure: meta.pure ?? true,\n };\n if (isPartial) {\n const pipe = compileDeclarePipeFromMetadata(pipeMeta);\n ivyCode.push(\n `static ɵpipe = /*@__PURE__*/ ${emitAngularExpr(pipe.expression)}`,\n );\n } else {\n const pipe = compilePipeFromMetadata(pipeMeta);\n ivyCode.push(\n `static ɵpipe = /*@__PURE__*/ ${emitAngularExpr(pipe.expression)}`,\n );\n }\n break;\n }\n\n case 'Injectable': {\n targetType = FactoryTarget.Injectable;\n const injectableMeta: any = {\n name: className,\n type: classRef,\n typeArgumentCount: 0,\n providedIn: {\n expression: new o.LiteralExpr(meta.providedIn ?? null),\n forwardRef: 0,\n },\n };\n // Forward provider configuration so `ɵprov` honors useFactory/\n // useClass/useExisting/useValue. Without this, an\n // `@Injectable({ useFactory: () => ... })` quietly falls back\n // to constructor instantiation.\n if (meta.useClass) injectableMeta.useClass = meta.useClass;\n if (meta.useFactory) injectableMeta.useFactory = meta.useFactory;\n if (meta.useExisting) injectableMeta.useExisting = meta.useExisting;\n if (meta.useValue) injectableMeta.useValue = meta.useValue;\n // Dependency list for `useFactory` / `useClass`; without it the\n // emitted factory is invoked with no arguments.\n if (meta.deps) injectableMeta.deps = meta.deps;\n if (isPartial) {\n const inj = compileDeclareInjectableFromMetadata(injectableMeta);\n ivyCode.push(\n `static ɵprov = /*@__PURE__*/ ${emitAngularExpr(inj.expression)}`,\n );\n } else {\n const inj = o.compileInjectable(injectableMeta, true);\n ivyCode.push(\n `static ɵprov = /*@__PURE__*/ ${emitAngularExpr(inj.expression)}`,\n );\n }\n break;\n }\n\n case 'Service': {\n // `@Service` (and the `compileService` compiler API) landed in\n // Angular 22. On older peers the decorator does not exist; fail\n // loudly rather than falling through and emitting a default\n // `Injectable`-target factory with no `ɵprov`.\n if (!angularVersionAtLeast(22)) {\n classCompileError = new Error(\n `[fast-compile] @Service on ${className} requires Angular 22 or later`,\n );\n break;\n }\n targetType = (FactoryTarget as any).Service;\n const serviceMeta: any = {\n name: className,\n type: classRef,\n typeArgumentCount: 0,\n };\n if (meta.autoProvided === false) serviceMeta.autoProvided = false;\n if (meta.factory) serviceMeta.factory = meta.factory;\n if (isPartial) {\n const svc = (o as any).compileDeclareServiceFromMetadata(\n serviceMeta,\n );\n ivyCode.push(\n `static ɵprov = /*@__PURE__*/ ${emitAngularExpr(svc.expression)}`,\n );\n } else {\n const svc = (o as any).compileService(serviceMeta, false);\n ivyCode.push(\n `static ɵprov = /*@__PURE__*/ ${emitAngularExpr(svc.expression)}`,\n );\n }\n break;\n }\n\n case 'NgModule': {\n targetType = FactoryTarget.NgModule;\n const ngModuleImports = Array.isArray(meta.imports)\n ? meta.imports\n : [];\n const ngModuleDeclarations = Array.isArray(meta.declarations)\n ? meta.declarations\n : [];\n const ngModuleExports = Array.isArray(meta.exports)\n ? meta.exports\n : [];\n const ngModuleBootstrap = Array.isArray(meta.bootstrap)\n ? meta.bootstrap\n : [];\n\n const ngModuleMeta = {\n kind: R3NgModuleMetadataKind.Global as const,\n type: classRef,\n bootstrap: ngModuleBootstrap.map((e: o.WrappedNodeExpr<any>) => ({\n value: e,\n type: e,\n })),\n declarations: ngModuleDeclarations.map(\n (e: o.WrappedNodeExpr<any>) => ({ value: e, type: e }),\n ),\n publicDeclarationTypes: null,\n imports: ngModuleImports.map((e: o.WrappedNodeExpr<any>) => ({\n value: e,\n type: e,\n })),\n includeImportTypes: true,\n exports: ngModuleExports.map((e: o.WrappedNodeExpr<any>) => ({\n value: e,\n type: e,\n })),\n selectorScopeMode: R3SelectorScopeMode.Inline,\n containsForwardDecls: false,\n schemas: [],\n id: null,\n };\n const injectorMeta = {\n name: className,\n type: classRef,\n providers: providersToExpr(meta.providers),\n imports: ngModuleImports.map((e: o.WrappedNodeExpr<any>) => e),\n };\n if (isPartial) {\n const ngMod = compileDeclareNgModuleFromMetadata(ngModuleMeta);\n ivyCode.push(\n `static ɵmod = /*@__PURE__*/ ${emitAngularExpr(ngMod.expression)}`,\n );\n const injector = compileDeclareInjectorFromMetadata(injectorMeta);\n ivyCode.push(\n `static ɵinj = /*@__PURE__*/ ${emitAngularExpr(injector.expression)}`,\n );\n } else {\n const ngMod = compileNgModule(ngModuleMeta);\n ivyCode.push(\n `static ɵmod = /*@__PURE__*/ ${emitAngularExpr(ngMod.expression)}`,\n );\n const injector = compileInjector(injectorMeta);\n ivyCode.push(\n `static ɵinj = /*@__PURE__*/ ${emitAngularExpr(injector.expression)}`,\n );\n }\n break;\n }\n }\n });\n\n if (classCompileError) {\n throw classCompileError;\n }\n\n // Generate factory\n const deps = extractConstructorDeps(node, sourceCode, typeOnlyImports);\n if (deps === null) {\n const baseVar = `ɵ${className}_BaseFactory`;\n ivyCode.unshift(\n `static ɵfac = /*@__PURE__*/ (() => { let ${baseVar}; return function ${className}_Factory(__ngFactoryType__) { return (${baseVar} || (${baseVar} = i0.ɵɵgetInheritedFactory(${className})))(__ngFactoryType__ || ${className}); }; })()`,\n );\n } else if (deps === 'invalid') {\n ivyCode.unshift(\n `static ɵfac = function ${className}_Factory(__ngFactoryType__) { i0.ɵɵinvalidFactory(); }`,\n );\n } else {\n const factoryMeta = {\n name: className,\n type: classRef,\n typeArgumentCount: 0,\n deps,\n target: targetType,\n };\n if (isPartial) {\n const fac = compileDeclareFactoryFunction(factoryMeta);\n ivyCode.unshift(\n `static ɵfac = /*@__PURE__*/ ${emitAngularExpr(fac.expression)}`,\n );\n } else {\n const fac = compileFactoryFunction(factoryMeta);\n ivyCode.unshift(\n `static ɵfac = /*@__PURE__*/ ${emitAngularExpr(fac.expression)}`,\n );\n }\n }\n\n // Emit setClassMetadata for runtime decorator reflection (devMode only)\n const ctorParameters = buildCtorParameters(\n node,\n sourceCode,\n typeOnlyImports,\n );\n const propDecorators = buildPropDecorators(node, sourceCode, 'i0.');\n const scopedMetadata: o.Statement[] = [];\n angularDecorators.forEach((dec) => {\n const decName = decoratorCallName(dec, sourceCode)!;\n const decArgsNode = dec.expression.arguments[0];\n const textOf = (n: any) => sourceCode.slice(n.start, n.end);\n\n // Build the decorator args for setClassMetadata, inlining resources if needed.\n const resources = resolvedResources.get(dec);\n let metadataArgsExpr: string | null = null;\n if (decArgsNode) {\n if (resources && decArgsNode.type === 'ObjectExpression') {\n // Inline external templateUrl/styleUrl(s) into the metadata so Angular's\n // runtime doesn't try to fetch relative URLs (which fails during SSR).\n const rewrittenProps: string[] = [];\n let needsTransform = false;\n const inlineStyles = resolveInlineStyles(\n styleRanges?.get(dec),\n resolvedInlineStyles,\n );\n let resourceStylesWritten = false;\n for (const prop of decArgsNode.properties) {\n if (\n prop.type !== 'Property' ||\n prop.shorthand ||\n prop.method ||\n prop.kind !== 'init'\n ) {\n rewrittenProps.push(textOf(prop));\n continue;\n }\n const propName = getPropertyKey(prop);\n\n if (propName === 'templateUrl' && resources.template) {\n rewrittenProps.push(\n `template: ${JSON.stringify(resources.template)}`,\n );\n needsTransform = true;\n } else if (\n (propName === 'styleUrl' ||\n propName === 'styleUrls' ||\n propName === 'styles') &&\n resources.styles\n ) {\n // One `styles` key for all of them: a second one would win\n // over the first and drop its styles.\n if (!resourceStylesWritten) {\n rewrittenProps.push(\n `styles: [${resources.styles.map((s) => JSON.stringify(s)).join(', ')}]`,\n );\n resourceStylesWritten = true;\n }\n needsTransform = true;\n } else if (propName === 'styles' && inlineStyles.length > 0) {\n rewrittenProps.push(\n `styles: ${withResolvedInlineStyles(prop.value, inlineStyles, sourceCode)}`,\n );\n needsTransform = true;\n } else {\n rewrittenProps.push(textOf(prop));\n }\n }\n metadataArgsExpr = needsTransform\n ? `{${rewrittenProps.join(', ')}}`\n : textOf(decArgsNode);\n } else {\n metadataArgsExpr = textOf(decArgsNode);\n }\n }\n\n try {\n // `LiteralMapPropertyAssignment` was a class with a constructor in\n // Angular up through ~v19, removed-then-restored in later v20/v21\n // patches. The only stable shape across versions is the plain\n // `{ key, value, quoted }` object literal — Angular's own emitter\n // and Analog's `JSEmitter` both consume entries via duck typing\n // (`.key` / `.value` / `.quoted`), and `compileClassMetadata` does\n // not `instanceof`-check entries. The js-emitter has a matching\n // comment at the consumption site. Using `new o.LiteralMapProperty\n // Assignment(...)` would throw \"is not a constructor\" on Angular\n // versions where the class export is missing (e.g. 20.3.x), and\n // the surrounding try/catch would silently disable class metadata\n // emission for every class in the project.\n const classMetaInput = {\n type: new o.WrappedNodeExpr(className),\n decorators: new o.LiteralArrayExpr([\n new o.LiteralMapExpr([\n {\n key: 'type',\n value: new o.WrappedNodeExpr(decName),\n quoted: false,\n },\n ...(metadataArgsExpr\n ? [\n {\n key: 'args',\n value: new o.LiteralArrayExpr([\n new o.WrappedNodeExpr(metadataArgsExpr),\n ]),\n quoted: false,\n },\n ]\n : []),\n ] as unknown as o.LiteralMapPropertyAssignment[]),\n ]),\n ctorParameters: ctorParameters\n ? new o.WrappedNodeExpr(`() => [${ctorParameters}]`)\n : null,\n propDecorators: propDecorators\n ? new o.WrappedNodeExpr(propDecorators)\n : null,\n };\n // A component whose @defer blocks load some dependencies lazily must\n // not reference them eagerly in its metadata either.\n const deferredDeps =\n decName === 'Component'\n ? deferredMetadataDeps.get(className)\n : undefined;\n const classMetadataExpr = isPartial\n ? compileDeclareClassMetadata(classMetaInput)\n : deferredDeps\n ? compileComponentClassMetadata(classMetaInput, deferredDeps)\n : compileClassMetadata(classMetaInput);\n const metadataStmt = new o.ExpressionStatement(classMetadataExpr);\n if (topLevelClasses.has(node)) {\n constantPool.statements.push(metadataStmt);\n } else {\n scopedMetadata.push(metadataStmt);\n }\n } catch (e) {\n // Skip if compileClassMetadata fails — surfaced via DEBUG=analog-fast-compile\n if (debugCompile.enabled) {\n debugCompile(\n 'compileClassMetadata failed for %s in %s: %s',\n className,\n fileName,\n (e as Error)?.message,\n );\n }\n }\n });\n\n // Collect member decorators (@HostListener, @HostBinding, @Input, @Output,\n // @ViewChild, @ContentChild, etc.) so they are removed from the source.\n // The metadata has already been extracted by detectFieldDecorators().\n const memberDecorators: any[] = [];\n for (const member of node.body.body) {\n for (const dec of member.decorators ?? []) {\n if (FIELD_DECORATORS.has(decoratorCallName(dec, sourceCode) ?? '')) {\n memberDecorators.push(dec);\n }\n }\n }\n\n classResults.push({\n ivyCode,\n decorators: [...angularDecorators, ...memberDecorators],\n classEnd: node.end,\n scopedMetadata,\n });\n }\n\n // Apply edits via MagicString\n const ms = new MagicString(sourceCode, { filename: fileName });\n\n // 1. Prepend i0 import (skip if already present)\n if (!sourceCode.includes('import * as i0 from')) {\n ms.prepend('import * as i0 from \"@angular/core\";\\n');\n }\n\n // 1b. Inject synthetic imports for NgModule-exported classes\n for (const [name, specifier] of syntheticImports) {\n const localName = dependencyLocalName(name);\n if (!importedNames.has(localName)) {\n const binding = localName === name ? name : `${name} as ${localName}`;\n ms.prepend(`import { ${binding} } from \"${specifier}\";\\n`);\n importedNames.add(localName);\n }\n }\n\n // 2a. Hoist non-exported variable/function declarations that appear after\n // a class to just before the first class. This avoids TDZ errors when\n // static ɵcmp references file-level constants declared after the class.\n //\n // We must NOT hoist a statement whose initializer references a name\n // (class, exported const/let) that is defined between firstClassPos and\n // the statement itself — doing so would move the reference before the\n // definition and cause a TDZ error at runtime.\n if (classResults.length > 0) {\n // Find the position right before the first class (any class, not just Angular-decorated)\n const statements = (oxcProgram.body as any[]).map(toTopLevelStatement);\n let firstClassPos = Infinity;\n const nonHoistableNames = new Set<string>();\n for (const { decl, start } of statements) {\n if (decl.type === 'ClassDeclaration') {\n firstClassPos = start;\n // The first class itself is non-hoistable — statements hoisted\n // before it must not reference it.\n if (decl.id) {\n nonHoistableNames.add(decl.id.name);\n }\n break;\n }\n }\n\n // Pass 1: collect names defined by statements that will NOT be hoisted\n // (classes, enums, exported vars/functions) and therefore remain after\n // firstClassPos.\n for (const { decl, exported, start } of statements) {\n if (start <= firstClassPos) continue;\n\n if (\n decl.type === 'ClassDeclaration' ||\n decl.type === 'TSEnumDeclaration'\n ) {\n if (decl.id) nonHoistableNames.add(decl.id.name);\n } else if (\n exported &&\n (decl.type === 'VariableDeclaration' ||\n decl.type === 'FunctionDeclaration')\n ) {\n for (const n of getDefinedNames(decl)) {\n nonHoistableNames.add(n);\n }\n }\n }\n\n // Pass 2: for each hoist candidate, check if it references any\n // non-hoistable name. If it does, skip it and add its own names to the\n // non-hoistable set (transitivity).\n for (const { decl, exported, start, end } of statements) {\n if (start <= firstClassPos) continue;\n\n const isCandidate =\n !exported &&\n (decl.type === 'VariableDeclaration' ||\n decl.type === 'FunctionDeclaration');\n if (!isCandidate) continue;\n\n const referencedIds = collectIdentifiers(decl);\n let referencesNonHoistable = false;\n for (const id of referencedIds) {\n if (nonHoistableNames.has(id)) {\n referencesNonHoistable = true;\n break;\n }\n }\n\n if (referencesNonHoistable) {\n // Don't hoist — mark this statement's names as non-hoistable too\n for (const name of getDefinedNames(decl)) {\n nonHoistableNames.add(name);\n }\n } else {\n // Move rather than re-insert so the statement keeps its source map.\n // The separating newline is attached to the moved chunk.\n ms.appendLeft(end, '\\n');\n ms.move(start, end, firstClassPos);\n }\n }\n }\n\n // 2. For each compiled class: remove decorators + insert Ivy definitions\n for (const cr of classResults) {\n // Remove Angular decorators from source\n for (const dec of cr.decorators) {\n const start = dec.start;\n const end = dec.end;\n let trimEnd = end;\n while (\n trimEnd < sourceCode.length &&\n (sourceCode[trimEnd] === ' ' ||\n sourceCode[trimEnd] === '\\n' ||\n sourceCode[trimEnd] === '\\r')\n ) {\n trimEnd++;\n }\n ms.remove(start, trimEnd);\n }\n\n // Insert static members before closing }\n if (cr.ivyCode.length > 0) {\n const memberCode = cr.ivyCode.map((c) => ' ' + c + ';').join('\\n');\n ms.appendLeft(cr.classEnd - 1, '\\n' + memberCode + '\\n');\n }\n\n for (const stmt of cr.scopedMetadata) {\n ms.appendLeft(cr.classEnd, `\\n/*@__PURE__*/ ${emitAngularStmt(stmt)}`);\n }\n }\n\n // 3. Emit constant pool statements.\n // Split into: helper declarations (const/function) that must appear before\n // the class (since static property initializers reference them), and\n // side-effect statements (setClassMetadata IIFEs) that go after.\n const helpers: string[] = [];\n const sideEffects: string[] = [];\n for (const s of constantPool.statements) {\n const code = emitAngularStmt(s);\n if (\n s instanceof o.ExpressionStatement &&\n s.expr instanceof o.InvokeFunctionExpr\n ) {\n // setClassMetadata is wrapped in `(() => { ... })()` — annotate\n // the IIFE call so bundlers can drop it when ngDevMode is folded\n // to false at production build time.\n sideEffects.push(`/*@__PURE__*/ ${code}`);\n } else {\n helpers.push(code);\n }\n }\n\n if (sideEffects.length > 0) {\n ms.append('\\n\\n' + sideEffects.join('\\n'));\n }\n\n // 4. Lower class field initializers to constructor assignments when\n // useDefineForClassFields is false (standard Angular tsconfig).\n // Uses the original OXC AST positions which are still valid for MagicString\n // since MagicString tracks edits relative to the original source.\n // Ivy static definitions (ɵcmp, ɵfac) are not in the original AST so they\n // are unaffected, and shouldLowerField skips static fields regardless.\n if (!useDefineForClassFields) {\n lowerClassFields(ms, sourceCode, oxcProgram);\n }\n\n // 5. Elide imports that are only used in type positions (type annotations,\n // implements, generics, etc.). Without this pass, single-file transpilers\n // like OXC / esbuild cannot tell that `import { SomeType }` is type-only\n // and will leave the import in the output, causing runtime errors.\n // Detection runs once on the final output; helpers are appended for\n // analysis only, since their position does not affect references.\n const helperCode = helpers.join('\\n');\n const willElide = detectTypeOnlyImportNames(\n ms.toString() + '\\n' + helperCode,\n );\n if (helpers.length > 0) {\n // Insert helpers after the last import / top-level non-class statement,\n // well before any class that references them. Skip imports that will be\n // fully removed by type elision (step 5): inserting inside a\n // soon-to-be-removed range would discard the helpers with the import.\n let insertPos = 0;\n for (const stmt of oxcProgram.body as any[]) {\n const { decl } = toTopLevelStatement(stmt);\n if (stmt.type === 'ImportDeclaration') {\n // Skip imports that will be entirely removed by type elision\n if (willElide.size > 0 && stmt.specifiers.length > 0) {\n const allElided = stmt.specifiers.every(\n (spec: any) =>\n spec.type === 'ImportNamespaceSpecifier' ||\n spec.importKind === 'type' ||\n willElide.has(spec.local.name),\n );\n if (allElided) continue;\n }\n insertPos = stmt.end;\n } else if (\n decl.type === 'VariableDeclaration' &&\n !sourceCode.slice(stmt.start, stmt.end).includes('class')\n ) {\n insertPos = stmt.end;\n } else if (\n stmt.type !== 'TSExportAssignment' &&\n !(\n stmt.type === 'ExportDefaultDeclaration' &&\n decl.type !== 'ClassDeclaration' &&\n decl.type !== 'FunctionDeclaration'\n )\n ) {\n // Stop at the first class or non-import/non-variable statement\n break;\n }\n }\n // Helpers must survive downstream `ms.overwrite()` / `ms.remove()` of\n // imports performed by the type-only specifier elision pass (step 5).\n //\n // Case `insertPos > 0`: a surviving import ends at `insertPos`. Use\n // `appendRight(insertPos, …)` so helpers bind to the `\\n` after the\n // import's `;` — outside any overwrite range `[node.start, node.end)`\n // of a preceding import. `appendLeft(insertPos, …)` would bind to the\n // `;` itself, which IS inside the overwrite range and would be wiped.\n //\n // Case `insertPos === 0`: no import survives — every import is going\n // to be elided, and `elideTypeOnlyImportsMagicString` will\n // `ms.remove(0, declEnd)` the first one. `appendRight(0, …)` anchors\n // to the character at position 0 (the first import's first char),\n // which is inside `[0, declEnd)` and gets wiped. Use `appendLeft(0, …)`\n // instead — it anchors to the LEFT of position 0, outside any range\n // starting at 0, so the helpers survive. Ordering is still correct\n // because the i0 import prepended in step 1 lives in MagicString's\n // `intro` (from `ms.prepend`), which always emits before any\n // `appendLeft` content at position 0.\n if (insertPos === 0) {\n ms.appendLeft(0, helperCode + '\\n');\n } else {\n ms.appendRight(insertPos, '\\n' + helperCode + '\\n');\n }\n }\n elideTypeOnlyImportsMagicString(ms, oxcProgram, willElide);\n\n const map = ms.generateMap({\n source: fileName,\n file: fileName + '.js',\n includeContent: true,\n hires: 'boundary',\n });\n\n if (debugCompile.enabled) {\n debugCompile(\n 'compile %s done (%dms, %d classes, %d resource deps)',\n fileName,\n Math.round(performance.now() - startTimeMs),\n classResults.length,\n resourceDependencies.length,\n );\n }\n return {\n code: ms.toString(),\n map,\n resourceDependencies,\n };\n}\n\n/** The local class name an `imports` entry declares, when it is a plain identifier. */\nfunction declarationName(declaration: CompileDeclaration): string | null {\n const node = (declaration.type as { node?: unknown }).node as\n | string\n | { type?: string; name?: string }\n | undefined;\n if (typeof node === 'string') {\n return node;\n }\n if (node?.type === 'Identifier' && typeof node.name === 'string') {\n return node.name;\n }\n return declaration.className ?? null;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;AA8IA,SAAS,oBAAoB,MAA8B;CACzD,MAAM,YACH,KAAK,SAAS,4BACb,KAAK,SAAS,+BAChB,KAAK;CACP,MAAM,OAAO,WAAW,KAAK,cAAc;CAC3C,OAAO;EACL;EACA,UAAU,CAAC,CAAC;EACZ,OAAO,KAAK,IAAI,KAAK,OAAO,KAAK,aAAa,EAAE,EAAE,SAAS,KAAK,KAAK;EACrE,KAAK,KAAK;CACZ;AACF;;AAGA,SAAS,kBAAkB,KAAU,YAAwC;CAC3E,MAAM,SAAS,IAAI;CACnB,IAAI,QAAQ,SAAS,kBAAkB,OAAO,KAAA;CAC9C,OAAO,WAAW,MAAM,OAAO,OAAO,OAAO,OAAO,OAAO,GAAG;AAChE;;;;;AAWA,SAAS,oBACP,OACA,sBACuB;CACvB,IAAI,CAAC,SAAS,CAAC,sBAAsB,OAAO,CAAC;CAC7C,OAAO,MAAM,OAAO,SAAS,OAAO,MAAM;EAC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AW,OAC/B,SACC,KAAK,SAAS,8BACd,KAAK,eAAe,UACpB,UAAU,IAAI,KAAK,MAAM,IAAI,CAE7B,GAAW;IAAA;IAEjB,YAAY,KAAK;GACnB,OAAO,IACL,KAAK,SAAS,yBACd,CAAC,WAAW,MAAM,KAAK,OAAO,KAAK,GAAG,CAAC,CAAC,SAAS,OAAO,GAExD,YAAY,KAAK;QACZ,IACL,KAAK,SAAS,wBACd,EACE,KAAK,SAAS,8BACd,KAAK,SAAS,sBACd,KAAK,SAAS,wBAIhB;EAEJ;EAoBA,IAAI,cAAc,GAChB,GAAG,WAAW,GAAG,aAAa,IAAI;OAElC,GAAG,YAAY,WAAW,OAAO,aAAa,IAAI;CAEtD;CACA,gCAAgC,IAAI,YAAY,SAAS;CAEzD,MAAM,MAAM,GAAG,YAAY;EACzB,QAAQ;EACR,MAAM,WAAW;EACjB,gBAAgB;EAChB,OAAO;CACT,CAAC;CAED,IAAI,aAAa,SACf,aACE,wDACA,UACA,KAAK,MAAM,YAAY,IAAI,IAAI,WAAW,GAC1C,aAAa,QACb,qBAAqB,MACvB;CAEF,OAAO;EACL,MAAM,GAAG,SAAS;EAClB;EACA;CACF;AACF;;AAGA,SAAS,gBAAgB,aAAgD;CACvE,MAAM,OAAQ,YAAY,KAA4B;CAItD,IAAI,OAAO,SAAS,UAClB,OAAO;CAET,IAAI,MAAM,SAAS,gBAAgB,OAAO,KAAK,SAAS,UACtD,OAAO,KAAK;CAEd,OAAO,YAAY,aAAa;AAClC"}
@@ -1,4 +1,4 @@
1
- //#region packages/vite-plugin-angular/src/lib/compiler/constants.ts
1
+ // packages/vite-plugin-angular/src/lib/compiler/constants.ts
2
2
  /**
3
3
  * Shared Angular name constants for the fast-compile path.
4
4
  *
@@ -53,7 +53,6 @@ var SIGNAL_APIS = /* @__PURE__ */ new Set([
53
53
  "contentChild",
54
54
  "contentChildren"
55
55
  ]);
56
- //#endregion
57
56
  export { ANGULAR_DECORATORS, ANGULAR_DECORATOR_CALL_RE, COMPILABLE_DECORATORS, FIELD_DECORATORS, SIGNAL_APIS };
58
57
 
59
58
  //# sourceMappingURL=constants.js.map
@@ -1,5 +1,5 @@
1
1
  import { createDebug } from "obug";
2
- //#region packages/vite-plugin-angular/src/lib/compiler/debug.ts
2
+ // packages/vite-plugin-angular/src/lib/compiler/debug.ts
3
3
  var root = createDebug("analog-fast-compile");
4
4
  /**
5
5
  * Top-level compile/transform events: per-file start, end, timing,
@@ -14,7 +14,6 @@ var debugCompile = root;
14
14
  var debugRegistry = root.extend("registry");
15
15
  root.extend("resolve");
16
16
  root.extend("emit");
17
- //#endregion
18
17
  export { debugCompile, debugRegistry };
19
18
 
20
19
  //# sourceMappingURL=debug.js.map
@@ -1,5 +1,5 @@
1
1
  import * as o from "@angular/compiler";
2
- //#region packages/vite-plugin-angular/src/lib/compiler/defer.ts
2
+ // packages/vite-plugin-angular/src/lib/compiler/defer.ts
3
3
  /** Recursively collect all DeferredBlock nodes from a template AST. */
4
4
  function collectDeferBlocks(nodes) {
5
5
  const result = [];
@@ -148,7 +148,6 @@ function buildDeferDependencyMap(parsedTemplate, program, registry, localSelecto
148
148
  deferredImports
149
149
  };
150
150
  }
151
- //#endregion
152
151
  export { buildDeferDependencyMap, buildImportMap, collectDeferBlocks, collectElementNames };
153
152
 
154
153
  //# sourceMappingURL=defer.js.map
@@ -1,7 +1,7 @@
1
1
  import { parseOxc } from "./utils.js";
2
2
  import * as fs from "node:fs";
3
3
  import * as path$1 from "node:path";
4
- //#region packages/vite-plugin-angular/src/lib/compiler/dts-reader.ts
4
+ // packages/vite-plugin-angular/src/lib/compiler/dts-reader.ts
5
5
  /**
6
6
  * Scan a single .d.ts file and extract Angular directive/component/pipe
7
7
  * metadata from the static ɵdir / ɵcmp / ɵpipe type declarations.
@@ -398,7 +398,6 @@ function collectDtsFiles(dir) {
398
398
  }
399
399
  return results;
400
400
  }
401
- //#endregion
402
401
  export { collectAllImports, collectImportedPackages, collectReExports, collectRelativeReExports, scanDtsFile, scanPackageDts };
403
402
 
404
403
  //# sourceMappingURL=dts-reader.js.map