@absolutejs/absolute 0.19.0-beta.855 → 0.19.0-beta.857

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -9832,7 +9832,7 @@ __export(exports_hmrInjectionPlugin, {
9832
9832
  });
9833
9833
  import { readFile as readFile5 } from "fs/promises";
9834
9834
  import { relative as relative6, resolve as resolve15 } from "path";
9835
- var COMPONENT_DECORATOR_RE, buildHmrTail = (className, encodedIdLiteral) => `
9835
+ var ENTITY_DECORATOR_RE, buildHmrTail = (className, encodedIdLiteral) => `
9836
9836
 
9837
9837
  // absolutejs HMR \u2014 auto-generated; mirrors compileHmrInitializer from
9838
9838
  // @angular/compiler with import.meta.hot adapted to globalThis.__angularHmr.
@@ -9867,7 +9867,7 @@ var COMPONENT_DECORATOR_RE, buildHmrTail = (className, encodedIdLiteral) => `
9867
9867
  const seen = new Set;
9868
9868
  const classNames = [];
9869
9869
  let match;
9870
- const re2 = new RegExp(COMPONENT_DECORATOR_RE.source, COMPONENT_DECORATOR_RE.flags);
9870
+ const re2 = new RegExp(ENTITY_DECORATOR_RE.source, ENTITY_DECORATOR_RE.flags);
9871
9871
  while ((match = re2.exec(text)) !== null) {
9872
9872
  const className = match[1];
9873
9873
  if (className && !seen.has(className)) {
@@ -9890,7 +9890,7 @@ var COMPONENT_DECORATOR_RE, buildHmrTail = (className, encodedIdLiteral) => `
9890
9890
  };
9891
9891
  };
9892
9892
  var init_hmrInjectionPlugin = __esm(() => {
9893
- COMPONENT_DECORATOR_RE = /([A-Z][A-Za-z0-9_$]*)\s*=\s*__legacyDecorateClassTS[A-Za-z0-9_$]*\s*\(\s*\[[\s\S]*?\bComponent[A-Za-z0-9_$]*\s*\(/g;
9893
+ ENTITY_DECORATOR_RE = /([A-Z][A-Za-z0-9_$]*)\s*=\s*__legacyDecorateClassTS[A-Za-z0-9_$]*\s*\(\s*\[[\s\S]*?\b(?:Component|Directive|Pipe|Injectable)[A-Za-z0-9_$]*\s*\(/g;
9894
9894
  });
9895
9895
 
9896
9896
  // src/utils/cleanStaleOutputs.ts
@@ -17486,7 +17486,7 @@ __export(exports_resolveOwningComponents, {
17486
17486
  import { readdirSync as readdirSync2, readFileSync as readFileSync19, statSync as statSync3 } from "fs";
17487
17487
  import { dirname as dirname18, extname as extname9, join as join29, resolve as resolve32 } from "path";
17488
17488
  import ts3 from "typescript";
17489
- var isComponentTsFile = (file5) => file5.endsWith(".component.ts") || file5.endsWith(".component.tsx"), walkComponentTsFiles = (root) => {
17489
+ var ENTITY_DECORATORS, isAngularSourceFile = (file5) => file5.endsWith(".ts") || file5.endsWith(".tsx"), walkAngularSourceFiles = (root) => {
17490
17490
  const out = [];
17491
17491
  const visit = (dir) => {
17492
17492
  let entries;
@@ -17502,7 +17502,7 @@ var isComponentTsFile = (file5) => file5.endsWith(".component.ts") || file5.ends
17502
17502
  const full = join29(dir, entry.name);
17503
17503
  if (entry.isDirectory()) {
17504
17504
  visit(full);
17505
- } else if (entry.isFile() && isComponentTsFile(entry.name)) {
17505
+ } else if (entry.isFile() && isAngularSourceFile(entry.name)) {
17506
17506
  out.push(full);
17507
17507
  }
17508
17508
  }
@@ -17540,58 +17540,67 @@ var isComponentTsFile = (file5) => file5.endsWith(".component.ts") || file5.ends
17540
17540
  }
17541
17541
  }
17542
17542
  return out;
17543
- }, parseComponentRefs = (filePath) => {
17544
- const refs = {
17545
- classNames: [],
17546
- templateUrls: [],
17547
- styleUrls: []
17548
- };
17543
+ }, parseDecoratedClasses = (filePath) => {
17549
17544
  let source;
17550
17545
  try {
17551
17546
  source = readFileSync19(filePath, "utf8");
17552
17547
  } catch {
17553
- return refs;
17548
+ return [];
17554
17549
  }
17555
17550
  const sourceFile = ts3.createSourceFile(filePath, source, ts3.ScriptTarget.ES2022, true, ts3.ScriptKind.TS);
17551
+ const out = [];
17556
17552
  const visit = (node) => {
17557
17553
  if (ts3.isClassDeclaration(node) && node.name) {
17558
- const decorators = ts3.getDecorators(node) ?? [];
17559
- for (const decorator of decorators) {
17554
+ for (const decorator of ts3.getDecorators(node) ?? []) {
17560
17555
  const expr = decorator.expression;
17561
17556
  if (!ts3.isCallExpression(expr))
17562
17557
  continue;
17563
17558
  const fn2 = expr.expression;
17564
- if (!ts3.isIdentifier(fn2) || fn2.text !== "Component")
17559
+ if (!ts3.isIdentifier(fn2))
17565
17560
  continue;
17566
- refs.classNames.push(node.name.text);
17567
- const arg = expr.arguments[0];
17568
- if (!arg || !ts3.isObjectLiteralExpression(arg))
17561
+ const kind = ENTITY_DECORATORS[fn2.text];
17562
+ if (!kind)
17569
17563
  continue;
17570
- const tplUrl = getStringPropertyValue(arg, "templateUrl");
17571
- if (tplUrl)
17572
- refs.templateUrls.push(tplUrl);
17573
- const styleUrl = getStringPropertyValue(arg, "styleUrl");
17574
- if (styleUrl)
17575
- refs.styleUrls.push(styleUrl);
17576
- refs.styleUrls.push(...getStringArrayProperty(arg, "styleUrls"));
17564
+ const entry = {
17565
+ className: node.name.text,
17566
+ kind,
17567
+ styleUrls: [],
17568
+ templateUrls: []
17569
+ };
17570
+ const arg = expr.arguments[0];
17571
+ if (arg && ts3.isObjectLiteralExpression(arg) && kind === "component") {
17572
+ const tplUrl = getStringPropertyValue(arg, "templateUrl");
17573
+ if (tplUrl)
17574
+ entry.templateUrls.push(tplUrl);
17575
+ const styleUrl = getStringPropertyValue(arg, "styleUrl");
17576
+ if (styleUrl)
17577
+ entry.styleUrls.push(styleUrl);
17578
+ entry.styleUrls.push(...getStringArrayProperty(arg, "styleUrls"));
17579
+ }
17580
+ out.push(entry);
17581
+ break;
17577
17582
  }
17578
17583
  }
17579
17584
  ts3.forEachChild(node, visit);
17580
17585
  };
17581
17586
  visit(sourceFile);
17582
- return refs;
17587
+ return out;
17583
17588
  }, safeNormalize = (path) => resolve32(path).replace(/\\/g, "/"), resolveOwningComponents = (params) => {
17584
17589
  const { changedFilePath, userAngularRoot } = params;
17585
17590
  const changedAbs = safeNormalize(changedFilePath);
17586
17591
  const out = [];
17587
- if (changedAbs.endsWith(".component.ts")) {
17588
- const refs = parseComponentRefs(changedAbs);
17589
- for (const className of refs.classNames) {
17590
- out.push({ componentFilePath: changedAbs, className });
17592
+ const ext = extname9(changedAbs).toLowerCase();
17593
+ if (ext === ".ts" || ext === ".tsx") {
17594
+ const classes = parseDecoratedClasses(changedAbs);
17595
+ for (const cls of classes) {
17596
+ out.push({
17597
+ className: cls.className,
17598
+ componentFilePath: changedAbs,
17599
+ kind: cls.kind
17600
+ });
17591
17601
  }
17592
17602
  return out;
17593
17603
  }
17594
- const ext = extname9(changedAbs).toLowerCase();
17595
17604
  if (ext !== ".html" && ext !== ".css" && ext !== ".scss" && ext !== ".sass") {
17596
17605
  return out;
17597
17606
  }
@@ -17603,26 +17612,36 @@ var isComponentTsFile = (file5) => file5.endsWith(".component.ts") || file5.ends
17603
17612
  }
17604
17613
  if (!rootStat.isDirectory())
17605
17614
  return out;
17606
- for (const componentTsPath of walkComponentTsFiles(userAngularRoot)) {
17607
- const refs = parseComponentRefs(componentTsPath);
17608
- const componentDir = dirname18(componentTsPath);
17615
+ for (const tsPath of walkAngularSourceFiles(userAngularRoot)) {
17616
+ const classes = parseDecoratedClasses(tsPath);
17617
+ const componentDir = dirname18(tsPath);
17609
17618
  const matchesResource = (relativeUrl) => {
17610
17619
  const abs = safeNormalize(resolve32(componentDir, relativeUrl));
17611
17620
  return abs === changedAbs;
17612
17621
  };
17613
- const referencesChanged = refs.templateUrls.some(matchesResource) || refs.styleUrls.some(matchesResource);
17614
- if (!referencesChanged)
17615
- continue;
17616
- for (const className of refs.classNames) {
17622
+ for (const cls of classes) {
17623
+ if (cls.kind !== "component")
17624
+ continue;
17625
+ const referencesChanged = cls.templateUrls.some(matchesResource) || cls.styleUrls.some(matchesResource);
17626
+ if (!referencesChanged)
17627
+ continue;
17617
17628
  out.push({
17618
- componentFilePath: componentTsPath,
17619
- className
17629
+ className: cls.className,
17630
+ componentFilePath: tsPath,
17631
+ kind: "component"
17620
17632
  });
17621
17633
  }
17622
17634
  }
17623
17635
  return out;
17624
17636
  };
17625
- var init_resolveOwningComponents = () => {};
17637
+ var init_resolveOwningComponents = __esm(() => {
17638
+ ENTITY_DECORATORS = {
17639
+ Component: "component",
17640
+ Directive: "directive",
17641
+ Pipe: "pipe",
17642
+ Injectable: "service"
17643
+ };
17644
+ });
17626
17645
 
17627
17646
  // src/dev/angular/hmrImportGenerator.ts
17628
17647
  import ts4 from "typescript";
@@ -18287,40 +18306,38 @@ __export(exports_fastHmrCompiler, {
18287
18306
  recordFingerprint: () => recordFingerprint,
18288
18307
  invalidateFingerprintCache: () => invalidateFingerprintCache
18289
18308
  });
18290
- import { existsSync as existsSync26, readFileSync as readFileSync20 } from "fs";
18309
+ import { existsSync as existsSync26, readFileSync as readFileSync20, statSync as statSync4 } from "fs";
18291
18310
  import { dirname as dirname19, relative as relative13, resolve as resolve33 } from "path";
18292
18311
  import ts7 from "typescript";
18293
- var fail = (reason, detail) => ({ ok: false, reason, detail }), fingerprintCache, fingerprintsEqual = (a, b2) => {
18312
+ var fail = (reason, detail) => ({ ok: false, reason, detail }), fingerprintCache, arraysEqual = (a, b2) => {
18313
+ if (a.length !== b2.length)
18314
+ return false;
18315
+ for (let i = 0;i < a.length; i++) {
18316
+ if (a[i] !== b2[i])
18317
+ return false;
18318
+ }
18319
+ return true;
18320
+ }, fingerprintsEqual = (a, b2) => {
18294
18321
  if (a.className !== b2.className)
18295
18322
  return false;
18296
18323
  if (a.selector !== b2.selector)
18297
18324
  return false;
18298
18325
  if (a.standalone !== b2.standalone)
18299
18326
  return false;
18300
- if (a.importsArity !== b2.importsArity)
18301
- return false;
18302
18327
  if (a.hasProviders !== b2.hasProviders)
18303
18328
  return false;
18304
18329
  if (a.hasViewProviders !== b2.hasViewProviders)
18305
18330
  return false;
18306
- if (a.ctorParamTypes.length !== b2.ctorParamTypes.length)
18331
+ if (!arraysEqual(a.ctorParamTypes, b2.ctorParamTypes))
18307
18332
  return false;
18308
- for (let i = 0;i < a.ctorParamTypes.length; i++) {
18309
- if (a.ctorParamTypes[i] !== b2.ctorParamTypes[i])
18310
- return false;
18311
- }
18312
- if (a.inputs.length !== b2.inputs.length)
18333
+ if (!arraysEqual(a.inputs, b2.inputs))
18313
18334
  return false;
18314
- for (let i = 0;i < a.inputs.length; i++) {
18315
- if (a.inputs[i] !== b2.inputs[i])
18316
- return false;
18317
- }
18318
- if (a.outputs.length !== b2.outputs.length)
18335
+ if (!arraysEqual(a.outputs, b2.outputs))
18336
+ return false;
18337
+ if (!arraysEqual(a.providerImportSig, b2.providerImportSig))
18338
+ return false;
18339
+ if (!arraysEqual(a.arrowFieldSig, b2.arrowFieldSig))
18319
18340
  return false;
18320
- for (let i = 0;i < a.outputs.length; i++) {
18321
- if (a.outputs[i] !== b2.outputs[i])
18322
- return false;
18323
- }
18324
18341
  return true;
18325
18342
  }, recordFingerprint = (id, fp) => {
18326
18343
  fingerprintCache.set(id, fp);
@@ -18568,7 +18585,137 @@ var fail = (reason, detail) => ({ ok: false, reason, detail }), fingerprintCache
18568
18585
  }
18569
18586
  }
18570
18587
  return { inputs, outputs };
18571
- }, extractFingerprint = (cls, className, decoratorMeta, inputs, outputs) => {
18588
+ }, djb2Hash = (s2) => {
18589
+ let h2 = 5381;
18590
+ for (let i = 0;i < s2.length; i++) {
18591
+ h2 = h2 * 33 ^ s2.charCodeAt(i);
18592
+ }
18593
+ return (h2 >>> 0).toString(36);
18594
+ }, extractArrowFieldSig = (cls) => {
18595
+ const entries = [];
18596
+ for (const member of cls.members) {
18597
+ if (!ts7.isPropertyDeclaration(member))
18598
+ continue;
18599
+ const init = member.initializer;
18600
+ if (!init)
18601
+ continue;
18602
+ if (!ts7.isArrowFunction(init) && !ts7.isFunctionExpression(init)) {
18603
+ continue;
18604
+ }
18605
+ const name = member.name.getText();
18606
+ const bodyHash = djb2Hash(init.getText());
18607
+ entries.push(`${name}:${bodyHash}`);
18608
+ }
18609
+ return entries.sort();
18610
+ }, providerProbeCache, fileHasModuleProviders = (filePath) => {
18611
+ let stat3;
18612
+ try {
18613
+ stat3 = statSync4(filePath);
18614
+ } catch {
18615
+ return true;
18616
+ }
18617
+ const cached = providerProbeCache.get(filePath);
18618
+ if (cached && cached.mtimeMs === stat3.mtimeMs)
18619
+ return cached.hasProviders;
18620
+ let source;
18621
+ try {
18622
+ source = readFileSync20(filePath, "utf8");
18623
+ } catch {
18624
+ return true;
18625
+ }
18626
+ const sf = ts7.createSourceFile(filePath, source, ts7.ScriptTarget.ES2022, true, ts7.ScriptKind.TS);
18627
+ let hasProviders = false;
18628
+ const visit = (node) => {
18629
+ if (hasProviders)
18630
+ return;
18631
+ if (ts7.isClassDeclaration(node)) {
18632
+ for (const decorator of ts7.getDecorators(node) ?? []) {
18633
+ const expr = decorator.expression;
18634
+ if (!ts7.isCallExpression(expr))
18635
+ continue;
18636
+ const arg = expr.arguments[0];
18637
+ if (!arg || !ts7.isObjectLiteralExpression(arg))
18638
+ continue;
18639
+ if (getProperty(arg, "providers") !== null) {
18640
+ hasProviders = true;
18641
+ return;
18642
+ }
18643
+ }
18644
+ }
18645
+ ts7.forEachChild(node, visit);
18646
+ };
18647
+ visit(sf);
18648
+ providerProbeCache.set(filePath, {
18649
+ hasProviders,
18650
+ mtimeMs: stat3.mtimeMs
18651
+ });
18652
+ return hasProviders;
18653
+ }, TS_EXTENSIONS, resolveImportSource = (identifierName, sourceFile, componentDir) => {
18654
+ for (const stmt of sourceFile.statements) {
18655
+ if (!ts7.isImportDeclaration(stmt))
18656
+ continue;
18657
+ const moduleSpec = stmt.moduleSpecifier;
18658
+ if (!ts7.isStringLiteral(moduleSpec))
18659
+ continue;
18660
+ const spec = moduleSpec.text;
18661
+ if (!spec.startsWith(".") && !spec.startsWith("/"))
18662
+ continue;
18663
+ const importClause = stmt.importClause;
18664
+ if (!importClause)
18665
+ continue;
18666
+ let matches = false;
18667
+ if (importClause.name && importClause.name.text === identifierName) {
18668
+ matches = true;
18669
+ }
18670
+ if (importClause.namedBindings) {
18671
+ const nb = importClause.namedBindings;
18672
+ if (ts7.isNamespaceImport(nb)) {
18673
+ if (nb.name.text === identifierName)
18674
+ matches = true;
18675
+ } else {
18676
+ for (const element of nb.elements) {
18677
+ if (element.name.text === identifierName) {
18678
+ matches = true;
18679
+ break;
18680
+ }
18681
+ }
18682
+ }
18683
+ }
18684
+ if (!matches)
18685
+ continue;
18686
+ const resolved = resolve33(componentDir, spec);
18687
+ for (const ext of TS_EXTENSIONS) {
18688
+ const candidate = resolved + ext;
18689
+ if (existsSync26(candidate))
18690
+ return candidate;
18691
+ }
18692
+ const indexCandidate = resolve33(resolved, "index.ts");
18693
+ if (existsSync26(indexCandidate))
18694
+ return indexCandidate;
18695
+ }
18696
+ return null;
18697
+ }, extractProviderImportSig = (importsExpr, sourceFile, componentDir) => {
18698
+ if (!importsExpr)
18699
+ return [];
18700
+ const sig = [];
18701
+ for (const entry of importsExpr.elements) {
18702
+ if (ts7.isIdentifier(entry)) {
18703
+ const importPath = resolveImportSource(entry.text, sourceFile, componentDir);
18704
+ if (importPath) {
18705
+ if (fileHasModuleProviders(importPath)) {
18706
+ sig.push(`P:${entry.text}`);
18707
+ }
18708
+ continue;
18709
+ }
18710
+ if (/Module$/.test(entry.text)) {
18711
+ sig.push(`P:${entry.text}`);
18712
+ }
18713
+ } else {
18714
+ sig.push(`P:${entry.getText()}`);
18715
+ }
18716
+ }
18717
+ return sig.sort();
18718
+ }, extractFingerprint = (cls, className, decoratorMeta, inputs, outputs, sourceFile, componentDir) => {
18572
18719
  const ctorParamTypes = [];
18573
18720
  for (const member of cls.members) {
18574
18721
  if (!ts7.isConstructorDeclaration(member))
@@ -18580,29 +18727,30 @@ var fail = (reason, detail) => ({ ok: false, reason, detail }), fingerprintCache
18580
18727
  }
18581
18728
  const inputNames = Object.keys(inputs).sort();
18582
18729
  const outputNames = Object.keys(outputs).sort();
18583
- const importsArity = decoratorMeta.importsExpr ? decoratorMeta.importsExpr.elements.length : 0;
18584
- const hasProviders = decoratorMeta.hasProviders;
18585
- const hasViewProviders = decoratorMeta.hasViewProviders;
18730
+ const arrowFieldSig = extractArrowFieldSig(cls);
18731
+ const providerImportSig = extractProviderImportSig(decoratorMeta.importsExpr, sourceFile, componentDir);
18586
18732
  return {
18733
+ arrowFieldSig,
18587
18734
  className,
18588
18735
  ctorParamTypes,
18589
- hasProviders,
18590
- hasViewProviders,
18591
- importsArity,
18736
+ hasProviders: decoratorMeta.hasProviders,
18737
+ hasViewProviders: decoratorMeta.hasViewProviders,
18592
18738
  inputs: inputNames,
18593
18739
  outputs: outputNames,
18740
+ providerImportSig,
18594
18741
  selector: decoratorMeta.selector,
18595
18742
  standalone: decoratorMeta.standalone
18596
18743
  };
18597
18744
  }, buildFreshClassMethodsBlock = (classNode, className) => {
18598
18745
  const methodSources = [];
18746
+ let hasStatic = false;
18599
18747
  for (const member of classNode.members) {
18600
18748
  if (ts7.isMethodDeclaration(member) || ts7.isGetAccessorDeclaration(member) || ts7.isSetAccessorDeclaration(member)) {
18601
- const modifiers = ts7.getModifiers(member) ?? [];
18602
- const isStatic = modifiers.some((m) => m.kind === ts7.SyntaxKind.StaticKeyword);
18603
- if (isStatic)
18604
- continue;
18605
18749
  methodSources.push(member.getText());
18750
+ const modifiers = ts7.getModifiers(member) ?? [];
18751
+ if (modifiers.some((m) => m.kind === ts7.SyntaxKind.StaticKeyword)) {
18752
+ hasStatic = true;
18753
+ }
18606
18754
  }
18607
18755
  }
18608
18756
  if (methodSources.length === 0)
@@ -18623,9 +18771,18 @@ ${methodSources.join(`
18623
18771
  } catch {
18624
18772
  return null;
18625
18773
  }
18626
- return `// SURGICAL_HMR \u2014 patch prototype methods so existing instances
18627
- // pick up new method bodies (\`compileComponentFromMetadata\` only
18628
- // updates \`\u0275cmp\`, never the prototype).
18774
+ const staticPatch = hasStatic ? `
18775
+ {
18776
+ for (const __name of Object.getOwnPropertyNames(_Fresh)) {
18777
+ if (__name === 'length' || __name === 'name' || __name === 'prototype') continue;
18778
+ const __desc = Object.getOwnPropertyDescriptor(_Fresh, __name);
18779
+ if (__desc) Object.defineProperty(${className}, __name, __desc);
18780
+ }
18781
+ }` : "";
18782
+ return `// SURGICAL_HMR \u2014 patch prototype + static methods so existing
18783
+ // instances and direct \`Class.staticMethod()\` calls pick up new
18784
+ // method bodies (\`compileComponentFromMetadata\` only updates
18785
+ // \`\u0275cmp\`, never the prototype or the class itself).
18629
18786
  ${transpiled}
18630
18787
  {
18631
18788
  const __fresh_proto = _Fresh.prototype;
@@ -18634,7 +18791,7 @@ ${transpiled}
18634
18791
  const __desc = Object.getOwnPropertyDescriptor(__fresh_proto, __name);
18635
18792
  if (__desc) Object.defineProperty(${className}.prototype, __name, __desc);
18636
18793
  }
18637
- }`;
18794
+ }${staticPatch}`;
18638
18795
  }, resolveAndReadResource = (componentDir, url) => {
18639
18796
  const abs = resolve33(componentDir, url);
18640
18797
  if (!existsSync26(abs))
@@ -18653,6 +18810,16 @@ ${transpiled}
18653
18810
  styles.push(css);
18654
18811
  }
18655
18812
  return { styles, missing: null };
18813
+ }, buildSimpleEntityModule = (classNode, className) => {
18814
+ const block = buildFreshClassMethodsBlock(classNode, className);
18815
+ if (!block) {
18816
+ return `export default function ${className}_UpdateMetadata(${className}, \u0275\u0275namespaces) { /* no method-body changes detected */ }
18817
+ `;
18818
+ }
18819
+ return `export default function ${className}_UpdateMetadata(${className}, \u0275\u0275namespaces) {
18820
+ ${block}
18821
+ }
18822
+ `;
18656
18823
  }, tryFastHmr = async (params) => {
18657
18824
  const { componentFilePath, className } = params;
18658
18825
  const projectRoot = params.projectRoot ?? process.cwd();
@@ -18671,6 +18838,14 @@ ${transpiled}
18671
18838
  if (!classNode) {
18672
18839
  return fail("class-not-found", `${className} in ${componentFilePath}`);
18673
18840
  }
18841
+ const kind = params.kind ?? "component";
18842
+ if (kind !== "component") {
18843
+ const moduleText = buildSimpleEntityModule(classNode, className);
18844
+ if (!moduleText) {
18845
+ return fail("unexpected-error", `buildSimpleEntityModule returned null for ${className}`);
18846
+ }
18847
+ return { componentSource: sourceFile, moduleText, ok: true };
18848
+ }
18674
18849
  if (inheritsDecoratedClass(classNode)) {
18675
18850
  return fail("inherits-decorated-class");
18676
18851
  }
@@ -18722,7 +18897,7 @@ ${transpiled}
18722
18897
  const { inputs, outputs } = extractInputsAndOutputs(classNode);
18723
18898
  const projectRelPath = relative13(projectRoot, componentFilePath).replace(/\\/g, "/");
18724
18899
  const fingerprintId = encodeURIComponent(`${projectRelPath}@${className}`);
18725
- const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs);
18900
+ const currentFingerprint = extractFingerprint(classNode, className, decoratorMeta, inputs, outputs, sourceFile, componentDir);
18726
18901
  const cachedFingerprint = fingerprintCache.get(fingerprintId);
18727
18902
  if (cachedFingerprint && !fingerprintsEqual(cachedFingerprint, currentFingerprint)) {
18728
18903
  return fail("structural-change", `fingerprint changed for ${className}; escalate to Tier 1`);
@@ -18854,6 +19029,8 @@ var init_fastHmrCompiler = __esm(() => {
18854
19029
  init_hmrImportGenerator();
18855
19030
  init_typescript_translator();
18856
19031
  fingerprintCache = new Map;
19032
+ providerProbeCache = new Map;
19033
+ TS_EXTENSIONS = [".ts", ".tsx", ".d.ts"];
18857
19034
  });
18858
19035
 
18859
19036
  // src/dev/angular/hmrCompiler.ts
@@ -19017,10 +19194,17 @@ var globalCache, getCachedHmrProgram = () => globalCache.__ABSOLUTE_ANGULAR_HMR_
19017
19194
  const filePathRel = decoded.slice(0, at2);
19018
19195
  const className = decoded.slice(at2 + 1);
19019
19196
  const componentFilePath = resolve34(process.cwd(), filePathRel);
19197
+ const { resolveOwningComponents: resolveOwningComponents2 } = await Promise.resolve().then(() => (init_resolveOwningComponents(), exports_resolveOwningComponents));
19198
+ const owners = resolveOwningComponents2({
19199
+ changedFilePath: componentFilePath,
19200
+ userAngularRoot: dirname20(componentFilePath)
19201
+ });
19202
+ const owner = owners.find((o2) => o2.className === className);
19203
+ const kind = owner?.kind ?? "component";
19020
19204
  const fastStart = performance2.now();
19021
- const fast = await tryFastHmr({ componentFilePath, className });
19205
+ const fast = await tryFastHmr({ className, componentFilePath, kind });
19022
19206
  if (fast.ok) {
19023
- logInfo(`[ng-hmr fast] ${className} ${(performance2.now() - fastStart).toFixed(1)}ms`);
19207
+ logInfo(`[ng-hmr fast/${kind}] ${className} ${(performance2.now() - fastStart).toFixed(1)}ms`);
19024
19208
  return fast.moduleText;
19025
19209
  }
19026
19210
  logWarn(`[ng-hmr slow] ${className} fast path bailed (${fast.reason}${fast.detail ? `: ${fast.detail}` : ""}), falling back to ngtsc`);
@@ -19640,17 +19824,21 @@ var moduleServerPromise, getModuleServer = () => moduleServerPromise, runSequent
19640
19824
  changedFilePath: editedFile,
19641
19825
  userAngularRoot: angularDir
19642
19826
  });
19643
- if (owners.length === 0 && editedFile.endsWith(".component.ts")) {
19827
+ if (owners.length === 0 && (editedFile.endsWith(".component.ts") || editedFile.endsWith(".directive.ts") || editedFile.endsWith(".pipe.ts") || editedFile.endsWith(".service.ts"))) {
19644
19828
  return {
19645
- reason: `no @Component class found in ${editedFile}`,
19829
+ reason: `no Angular-decorated class found in ${editedFile}`,
19646
19830
  tier: 1
19647
19831
  };
19648
19832
  }
19649
- for (const { componentFilePath, className } of owners) {
19833
+ for (const { componentFilePath, className, kind } of owners) {
19650
19834
  const id = encodeHmrComponentId2(componentFilePath, className);
19651
19835
  if (queueIds.has(id))
19652
19836
  continue;
19653
- const result = await tryFastHmr2({ className, componentFilePath });
19837
+ const result = await tryFastHmr2({
19838
+ className,
19839
+ componentFilePath,
19840
+ kind
19841
+ });
19654
19842
  if (!result.ok) {
19655
19843
  return {
19656
19844
  reason: `${className}: ${result.reason}${result.detail ? ` (${result.detail})` : ""}`,
@@ -21078,7 +21266,7 @@ __export(exports_devBuild, {
21078
21266
  devBuild: () => devBuild
21079
21267
  });
21080
21268
  import { readdir as readdir5 } from "fs/promises";
21081
- import { statSync as statSync4 } from "fs";
21269
+ import { statSync as statSync5 } from "fs";
21082
21270
  import { resolve as resolve38 } from "path";
21083
21271
  var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
21084
21272
  const configuredDirs = [
@@ -21187,7 +21375,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
21187
21375
  state.fileChangeQueue.clear();
21188
21376
  }
21189
21377
  }, handleCachedReload = async () => {
21190
- const serverMtime = statSync4(resolve38(Bun.main)).mtimeMs;
21378
+ const serverMtime = statSync5(resolve38(Bun.main)).mtimeMs;
21191
21379
  const lastMtime = globalThis.__hmrServerMtime;
21192
21380
  globalThis.__hmrServerMtime = serverMtime;
21193
21381
  const cached = globalThis.__hmrDevResult;
@@ -21401,7 +21589,7 @@ var FRAMEWORK_DIR_KEYS, collectDepVendorSourceDirs = (config) => {
21401
21589
  manifest
21402
21590
  };
21403
21591
  globalThis.__hmrDevResult = result;
21404
- globalThis.__hmrServerMtime = statSync4(resolve38(Bun.main)).mtimeMs;
21592
+ globalThis.__hmrServerMtime = statSync5(resolve38(Bun.main)).mtimeMs;
21405
21593
  return result;
21406
21594
  };
21407
21595
  var init_devBuild = __esm(() => {
@@ -30003,5 +30191,5 @@ export {
30003
30191
  ANGULAR_INIT_TIMEOUT_MS
30004
30192
  };
30005
30193
 
30006
- //# debugId=A3C5EF48AC33740564756E2164756E21
30194
+ //# debugId=E460962A6A20B90264756E2164756E21
30007
30195
  //# sourceMappingURL=index.js.map