@angular/compiler-cli 18.0.0-next.4 → 18.0.0-next.5

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.
@@ -44,7 +44,7 @@ import {
44
44
  isHostDirectiveMetaForGlobalMode,
45
45
  ivyTransformFactory,
46
46
  tryParseInitializerApi
47
- } from "./chunk-3XKDS7QX.js";
47
+ } from "./chunk-QT2OXMUI.js";
48
48
  import {
49
49
  AbsoluteModuleStrategy,
50
50
  AliasStrategy,
@@ -94,7 +94,7 @@ import {
94
94
  toUnredirectedSourceFile,
95
95
  translateExpression,
96
96
  translateType
97
- } from "./chunk-72BAHUP4.js";
97
+ } from "./chunk-GWZTRBUN.js";
98
98
  import {
99
99
  ActivePerfRecorder,
100
100
  DelegatingPerfRecorder,
@@ -184,6 +184,9 @@ var MemberTags;
184
184
  MemberTags2["Output"] = "output";
185
185
  MemberTags2["Inherited"] = "override";
186
186
  })(MemberTags || (MemberTags = {}));
187
+ function isDocEntryWithSourceInfo(entry) {
188
+ return "source" in entry;
189
+ }
187
190
 
188
191
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/docs/src/extractor.mjs
189
192
  import ts10 from "typescript";
@@ -913,7 +916,7 @@ var DocsExtractor = class {
913
916
  this.typeChecker = typeChecker;
914
917
  this.metadataReader = metadataReader;
915
918
  }
916
- extractAll(sourceFile) {
919
+ extractAll(sourceFile, rootDir) {
917
920
  const entries = [];
918
921
  const exportedDeclarations = this.getExportedDeclarations(sourceFile);
919
922
  for (const [exportName, node] of exportedDeclarations) {
@@ -922,6 +925,12 @@ var DocsExtractor = class {
922
925
  }
923
926
  const entry = this.extractDeclaration(node);
924
927
  if (entry && !isIgnoredDocEntry(entry)) {
928
+ const realSourceFile = node.getSourceFile();
929
+ entry.source = {
930
+ filePath: getRelativeFilePath(realSourceFile, rootDir),
931
+ startLine: ts10.getLineAndCharacterOfPosition(realSourceFile, node.getFullStart()).line,
932
+ endLine: ts10.getLineAndCharacterOfPosition(realSourceFile, node.getEnd()).line
933
+ };
925
934
  entries.push({ ...entry, name: exportName });
926
935
  }
927
936
  }
@@ -979,6 +988,11 @@ function isIgnoredDocEntry(entry) {
979
988
  }
980
989
  return isDocsPrivate !== void 0;
981
990
  }
991
+ function getRelativeFilePath(sourceFile, rootDir) {
992
+ const fullPath = sourceFile.fileName;
993
+ const relativePath = fullPath.replace(rootDir, "");
994
+ return relativePath;
995
+ }
982
996
 
983
997
  // bazel-out/darwin_arm64-fastbuild/bin/packages/compiler-cli/src/ngtsc/program.mjs
984
998
  import { HtmlParser, MessageBundle } from "@angular/compiler";
@@ -9480,7 +9494,8 @@ var NgCompiler = class {
9480
9494
  if (!entryPointSourceFile) {
9481
9495
  throw new Error(`Entry point "${entryPoint}" not found in program sources.`);
9482
9496
  }
9483
- return docsExtractor.extractAll(entryPointSourceFile);
9497
+ const rootDir = this.inputProgram.getCurrentDirectory();
9498
+ return docsExtractor.extractAll(entryPointSourceFile, rootDir);
9484
9499
  }
9485
9500
  xi18n(ctx) {
9486
9501
  const compilation = this.ensureAnalyzed();
@@ -10538,6 +10553,7 @@ export {
10538
10553
  MemberType,
10539
10554
  DecoratorType,
10540
10555
  MemberTags,
10556
+ isDocEntryWithSourceInfo,
10541
10557
  DocsExtractor,
10542
10558
  untagAllTsFiles,
10543
10559
  TsCreateProgramDriver,
@@ -10570,4 +10586,4 @@ export {
10570
10586
  * Use of this source code is governed by an MIT-style license that can be
10571
10587
  * found in the LICENSE file at https://angular.io/license
10572
10588
  */
10573
- //# sourceMappingURL=chunk-VK6ST3OM.js.map
10589
+ //# sourceMappingURL=chunk-AO7Q5KNS.js.map