@angular/compiler-cli 21.1.3 → 21.1.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.
@@ -88,7 +88,7 @@ import {
88
88
  toUnredirectedSourceFile,
89
89
  tryParseInitializerApi,
90
90
  untagAllTsFiles
91
- } from "./chunk-GBKWMNM6.js";
91
+ } from "./chunk-MKYLKJX2.js";
92
92
  import {
93
93
  LogicalFileSystem,
94
94
  absoluteFromSourceFile,
@@ -709,11 +709,9 @@ var PipeExtractor = class extends ClassExtractor {
709
709
  };
710
710
  var NgModuleExtractor = class extends ClassExtractor {
711
711
  reference;
712
- metadata;
713
- constructor(declaration, reference, metadata, typeChecker) {
712
+ constructor(declaration, reference, typeChecker) {
714
713
  super(declaration, typeChecker);
715
714
  this.reference = reference;
716
- this.metadata = metadata;
717
715
  }
718
716
  extract() {
719
717
  return {
@@ -733,7 +731,7 @@ function extractClass(classDeclaration, metadataReader, typeChecker) {
733
731
  } else if (pipeMetadata) {
734
732
  extractor = new PipeExtractor(classDeclaration, ref, pipeMetadata, typeChecker);
735
733
  } else if (ngModuleMetadata) {
736
- extractor = new NgModuleExtractor(classDeclaration, ref, ngModuleMetadata, typeChecker);
734
+ extractor = new NgModuleExtractor(classDeclaration, ref, typeChecker);
737
735
  } else {
738
736
  extractor = new ClassExtractor(classDeclaration, typeChecker);
739
737
  }
@@ -1591,7 +1589,7 @@ function isLocalFile(sf) {
1591
1589
  return !sf.isDeclarationFile;
1592
1590
  }
1593
1591
  function isTypeOnlyImportClause(node) {
1594
- if (node.isTypeOnly) {
1592
+ if (node.phaseModifier === ts15.SyntaxKind.TypeKeyword) {
1595
1593
  return true;
1596
1594
  }
1597
1595
  if (node.namedBindings !== void 0 && ts15.isNamedImports(node.namedBindings) && node.namedBindings.elements.every((specifier) => specifier.isTypeOnly)) {
@@ -4480,7 +4478,7 @@ var NgCompiler = class _NgCompiler {
4480
4478
  }
4481
4479
  const defaultImportTracker = new DefaultImportTracker();
4482
4480
  const before = [
4483
- ivyTransformFactory(compilation.traitCompiler, compilation.reflector, importRewriter, defaultImportTracker, compilation.localCompilationExtraImportsTracker, this.delegatingPerfRecorder, compilation.isCore, this.closureCompilerEnabled, this.emitDeclarationOnly),
4481
+ ivyTransformFactory(compilation.traitCompiler, compilation.reflector, importRewriter, defaultImportTracker, compilation.localCompilationExtraImportsTracker, this.delegatingPerfRecorder, compilation.isCore, this.closureCompilerEnabled, this.emitDeclarationOnly, compilation.refEmitter, !!this.options["_experimentalEmitIntermediateTs"]),
4484
4482
  aliasTransformFactory(compilation.traitCompiler.exportStatements),
4485
4483
  defaultImportTracker.importPreservingTransformer()
4486
4484
  ];
@@ -4918,7 +4916,7 @@ var NgCompiler = class _NgCompiler {
4918
4916
  new InjectableDecoratorHandler(reflector, evaluator, isCore, strictCtorDeps, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, compilationMode),
4919
4917
  new NgModuleDecoratorHandler(reflector, evaluator, metaReader, metaRegistry, ngModuleScopeRegistry, referencesRegistry, exportedProviderStatusResolver, semanticDepGraphUpdater, isCore, refEmitter, this.closureCompilerEnabled, this.options.onlyPublishPublicTypingsForNgModules ?? false, injectableRegistry, this.delegatingPerfRecorder, supportTestBed, supportJitMode, compilationMode, localCompilationExtraImportsTracker, jitDeclarationRegistry, this.emitDeclarationOnly)
4920
4918
  ];
4921
- const traitCompiler = new TraitCompiler(handlers, reflector, this.delegatingPerfRecorder, this.incrementalCompilation, this.options.compileNonExportedClasses !== false, compilationMode, dtsTransforms, semanticDepGraphUpdater, this.adapter, this.emitDeclarationOnly);
4919
+ const traitCompiler = new TraitCompiler(handlers, reflector, this.delegatingPerfRecorder, this.incrementalCompilation, this.options.compileNonExportedClasses !== false, compilationMode, dtsTransforms, semanticDepGraphUpdater, this.adapter, this.emitDeclarationOnly, !!this.options["_experimentalEmitIntermediateTs"]);
4922
4920
  const notifyingDriver = new NotifyingProgramDriverWrapper(this.programDriver, (program) => {
4923
4921
  this.incrementalStrategy.setIncrementalState(this.incrementalCompilation.state, program);
4924
4922
  this.currentProgram = program;
@@ -229,7 +229,7 @@ var COMPILER_ERRORS_WITH_GUIDES = /* @__PURE__ */ new Set([
229
229
  import { VERSION } from "@angular/compiler";
230
230
  var DOC_PAGE_BASE_URL = (() => {
231
231
  const full = VERSION.full;
232
- const isPreRelease = full.includes("-next") || full.includes("-rc") || full === "21.1.3";
232
+ const isPreRelease = full.includes("-next") || full.includes("-rc") || full === "21.1.5";
233
233
  const prefix = isPreRelease ? "next" : `v${VERSION.major}`;
234
234
  return `https://${prefix}.angular.dev`;
235
235
  })();
@@ -694,7 +694,7 @@ function typeToValue(typeNode, checker, isLocalCompilation) {
694
694
  const firstDecl = local.declarations && local.declarations[0];
695
695
  if (firstDecl !== void 0) {
696
696
  if (ts5.isImportClause(firstDecl) && firstDecl.name !== void 0) {
697
- if (firstDecl.isTypeOnly) {
697
+ if (firstDecl.phaseModifier === ts5.SyntaxKind.TypeKeyword) {
698
698
  return typeOnlyImport(typeNode, firstDecl);
699
699
  }
700
700
  if (!ts5.isImportDeclaration(firstDecl.parent)) {
@@ -709,7 +709,7 @@ function typeToValue(typeNode, checker, isLocalCompilation) {
709
709
  if (firstDecl.isTypeOnly) {
710
710
  return typeOnlyImport(typeNode, firstDecl);
711
711
  }
712
- if (firstDecl.parent.parent.isTypeOnly) {
712
+ if (firstDecl.parent.parent.phaseModifier === ts5.SyntaxKind.TypeKeyword) {
713
713
  return typeOnlyImport(typeNode, firstDecl.parent.parent);
714
714
  }
715
715
  const importedName = (firstDecl.propertyName || firstDecl.name).text;
@@ -727,7 +727,7 @@ function typeToValue(typeNode, checker, isLocalCompilation) {
727
727
  nestedPath
728
728
  };
729
729
  } else if (ts5.isNamespaceImport(firstDecl)) {
730
- if (firstDecl.parent.isTypeOnly) {
730
+ if (firstDecl.parent.phaseModifier === ts5.SyntaxKind.TypeKeyword) {
731
731
  return typeOnlyImport(typeNode, firstDecl.parent);
732
732
  }
733
733
  if (symbols.symbolNames.length === 1) {
@@ -1930,7 +1930,7 @@ var DeferredSymbolTracker = class {
1930
1930
  if (importDecl.importClause === void 0) {
1931
1931
  throw new Error(`Provided import declaration doesn't have any symbols.`);
1932
1932
  }
1933
- if (importDecl.importClause.isTypeOnly) {
1933
+ if (importDecl.importClause.phaseModifier === ts10.SyntaxKind.TypeKeyword) {
1934
1934
  return symbolMap;
1935
1935
  }
1936
1936
  if (importDecl.importClause.namedBindings !== void 0) {
@@ -2648,7 +2648,7 @@ function resolveProvidersRequiringFactory(rawProviders, reflector, evaluator) {
2648
2648
  });
2649
2649
  return providers;
2650
2650
  }
2651
- function wrapTypeReference(reflector, clazz) {
2651
+ function wrapTypeReference(clazz) {
2652
2652
  const value = new WrappedNodeExpr2(clazz.name);
2653
2653
  const type = value;
2654
2654
  return { value, type };
@@ -4737,7 +4737,7 @@ function createTsTransformForImportManager(manager, extraStatementsForFiles) {
4737
4737
  if (clause.namedBindings === void 0 || !ts19.isNamedImports(clause.namedBindings) || !updatedImports.has(clause.namedBindings)) {
4738
4738
  return node;
4739
4739
  }
4740
- const newClause = ctx.factory.updateImportClause(clause, clause.isTypeOnly, clause.name, updatedImports.get(clause.namedBindings));
4740
+ const newClause = ctx.factory.updateImportClause(clause, clause.phaseModifier, clause.name, updatedImports.get(clause.namedBindings));
4741
4741
  const newImport = ctx.factory.updateImportDeclaration(node, node.modifiers, newClause, node.moduleSpecifier, node.attributes);
4742
4742
  ts19.setOriginalNode(newImport, {
4743
4743
  importClause: newClause,
@@ -4809,7 +4809,7 @@ function attemptToReuseExistingSourceFileImports(tracker, sourceFile, request) {
4809
4809
  if (!ts21.isImportDeclaration(statement) || !ts21.isStringLiteral(statement.moduleSpecifier)) {
4810
4810
  continue;
4811
4811
  }
4812
- if (!statement.importClause || statement.importClause.isTypeOnly) {
4812
+ if (!statement.importClause || statement.importClause.phaseModifier === ts21.SyntaxKind.TypeKeyword) {
4813
4813
  continue;
4814
4814
  }
4815
4815
  const moduleSpecifier = statement.moduleSpecifier.text;
@@ -6005,6 +6005,7 @@ var TraitCompiler = class {
6005
6005
  semanticDepGraphUpdater;
6006
6006
  sourceFileTypeIdentifier;
6007
6007
  emitDeclarationOnly;
6008
+ emitIntermediateTs;
6008
6009
  /**
6009
6010
  * Maps class declarations to their `ClassRecord`, which tracks the Ivy traits being applied to
6010
6011
  * those classes.
@@ -6022,7 +6023,7 @@ var TraitCompiler = class {
6022
6023
  filesWithoutTraits = /* @__PURE__ */ new Set();
6023
6024
  reexportMap = /* @__PURE__ */ new Map();
6024
6025
  handlersByName = /* @__PURE__ */ new Map();
6025
- constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater, sourceFileTypeIdentifier, emitDeclarationOnly) {
6026
+ constructor(handlers, reflector, perf, incrementalBuild, compileNonExportedClasses, compilationMode, dtsTransforms, semanticDepGraphUpdater, sourceFileTypeIdentifier, emitDeclarationOnly, emitIntermediateTs) {
6026
6027
  this.handlers = handlers;
6027
6028
  this.reflector = reflector;
6028
6029
  this.perf = perf;
@@ -6033,6 +6034,7 @@ var TraitCompiler = class {
6033
6034
  this.semanticDepGraphUpdater = semanticDepGraphUpdater;
6034
6035
  this.sourceFileTypeIdentifier = sourceFileTypeIdentifier;
6035
6036
  this.emitDeclarationOnly = emitDeclarationOnly;
6037
+ this.emitIntermediateTs = emitIntermediateTs;
6036
6038
  for (const handler of handlers) {
6037
6039
  this.handlersByName.set(handler.name, handler);
6038
6040
  }
@@ -6707,11 +6709,11 @@ var Visitor = class {
6707
6709
  // packages/compiler-cli/src/ngtsc/transform/src/transform.js
6708
6710
  var NO_DECORATORS = /* @__PURE__ */ new Set();
6709
6711
  var CLOSURE_FILE_OVERVIEW_REGEXP = /\s+@fileoverview\s+/i;
6710
- function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, localCompilationExtraImportsTracker, perf, isCore, isClosureCompilerEnabled, emitDeclarationOnly) {
6712
+ function ivyTransformFactory(compilation, reflector, importRewriter, defaultImportTracker, localCompilationExtraImportsTracker, perf, isCore, isClosureCompilerEnabled, emitDeclarationOnly, refEmitter, enableTypeReification) {
6711
6713
  const recordWrappedNode = createRecorderFn(defaultImportTracker);
6712
6714
  return (context) => {
6713
6715
  return (file) => {
6714
- return perf.inPhase(PerfPhase.Compile, () => transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, recordWrappedNode));
6716
+ return perf.inPhase(PerfPhase.Compile, () => transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, refEmitter, enableTypeReification, recordWrappedNode));
6715
6717
  };
6716
6718
  };
6717
6719
  }
@@ -6747,7 +6749,9 @@ var IvyTransformationVisitor = class extends Visitor {
6747
6749
  isClosureCompilerEnabled;
6748
6750
  isCore;
6749
6751
  deferrableImports;
6750
- constructor(compilation, classCompilationMap, reflector, importManager, recordWrappedNodeExpr, isClosureCompilerEnabled, isCore, deferrableImports) {
6752
+ refEmitter;
6753
+ enableTypeReification;
6754
+ constructor(compilation, classCompilationMap, reflector, importManager, recordWrappedNodeExpr, isClosureCompilerEnabled, isCore, deferrableImports, refEmitter, enableTypeReification) {
6751
6755
  super();
6752
6756
  this.compilation = compilation;
6753
6757
  this.classCompilationMap = classCompilationMap;
@@ -6757,6 +6761,8 @@ var IvyTransformationVisitor = class extends Visitor {
6757
6761
  this.isClosureCompilerEnabled = isClosureCompilerEnabled;
6758
6762
  this.isCore = isCore;
6759
6763
  this.deferrableImports = deferrableImports;
6764
+ this.refEmitter = refEmitter;
6765
+ this.enableTypeReification = enableTypeReification;
6760
6766
  }
6761
6767
  visitClassDeclaration(node) {
6762
6768
  if (!this.classCompilationMap.has(node)) {
@@ -6774,7 +6780,11 @@ var IvyTransformationVisitor = class extends Visitor {
6774
6780
  continue;
6775
6781
  }
6776
6782
  const exprNode = translateExpression(sourceFile, field.initializer, this.importManager, translateOptions);
6777
- const property = ts31.factory.createPropertyDeclaration([ts31.factory.createToken(ts31.SyntaxKind.StaticKeyword)], field.name, void 0, void 0, exprNode);
6783
+ let typeNode = void 0;
6784
+ if (this.enableTypeReification && this.refEmitter !== null) {
6785
+ typeNode = translateType(field.type, sourceFile, this.reflector, this.refEmitter, this.importManager);
6786
+ }
6787
+ const property = ts31.factory.createPropertyDeclaration([ts31.factory.createToken(ts31.SyntaxKind.StaticKeyword)], field.name, void 0, typeNode, exprNode);
6778
6788
  if (this.isClosureCompilerEnabled) {
6779
6789
  ts31.addSyntheticLeadingComment(
6780
6790
  property,
@@ -6873,7 +6883,7 @@ var IvyTransformationVisitor = class extends Visitor {
6873
6883
  return node;
6874
6884
  }
6875
6885
  };
6876
- function transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, recordWrappedNode) {
6886
+ function transformIvySourceFile(compilation, context, reflector, importRewriter, localCompilationExtraImportsTracker, file, isCore, isClosureCompilerEnabled, emitDeclarationOnly, refEmitter, enableTypeReification, recordWrappedNode) {
6877
6887
  const constantPool = new ConstantPool(isClosureCompilerEnabled);
6878
6888
  const importManager = new ImportManager({
6879
6889
  ...presetImportManagerForceNamespaceImports,
@@ -6884,7 +6894,7 @@ function transformIvySourceFile(compilation, context, reflector, importRewriter,
6884
6894
  if (emitDeclarationOnly) {
6885
6895
  return file;
6886
6896
  }
6887
- const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore, compilationVisitor.deferrableImports);
6897
+ const transformationVisitor = new IvyTransformationVisitor(compilation, compilationVisitor.classCompilationMap, reflector, importManager, recordWrappedNode, isClosureCompilerEnabled, isCore, compilationVisitor.deferrableImports, refEmitter, enableTypeReification);
6888
6898
  let sf = visit(file, transformationVisitor, context);
6889
6899
  const downlevelTranslatedCode = getLocalizeCompileTarget(context) < ts31.ScriptTarget.ES2015;
6890
6900
  const constants = constantPool.statements.map((stmt) => translateStatement(file, stmt, importManager, {
@@ -8252,7 +8262,7 @@ function extractDirectiveMetadata(clazz, decorator, reflector, importTracker, ev
8252
8262
  }
8253
8263
  const usesInheritance = reflector.hasBaseClass(clazz);
8254
8264
  const sourceFile = clazz.getSourceFile();
8255
- const type = wrapTypeReference(reflector, clazz);
8265
+ const type = wrapTypeReference(clazz);
8256
8266
  const rawHostDirectives = directive.get("hostDirectives") || null;
8257
8267
  const hostDirectives = rawHostDirectives === null ? null : extractHostDirectives(rawHostDirectives, evaluator, reflector, compilationMode, createForwardRefResolver(isCore), emitDeclarationOnly);
8258
8268
  if (compilationMode !== CompilationMode.LOCAL && hostDirectives !== null) {
@@ -10764,7 +10774,7 @@ var SelectorlessComponentScopeReader = class {
10764
10774
  result.set(stmt.name.text, stmt.name);
10765
10775
  continue;
10766
10776
  }
10767
- if (ts46.isImportDeclaration(stmt) && stmt.importClause !== void 0 && !stmt.importClause.isTypeOnly) {
10777
+ if (ts46.isImportDeclaration(stmt) && stmt.importClause !== void 0 && !(stmt.importClause.phaseModifier === ts46.SyntaxKind.TypeKeyword)) {
10768
10778
  const clause = stmt.importClause;
10769
10779
  if (clause.namedBindings !== void 0 && ts46.isNamedImports(clause.namedBindings)) {
10770
10780
  for (const element of clause.namedBindings.elements) {
@@ -20015,7 +20025,7 @@ var NgModuleDecoratorHandler = class {
20015
20025
  const exports = exportRefs.map((exp) => this._toR3Reference(exp.getOriginForDiagnostics(meta, node.name), exp, valueContext));
20016
20026
  const isForwardReference = (ref) => isExpressionForwardReference(ref.value, node.name, valueContext);
20017
20027
  const containsForwardDecls = bootstrap.some(isForwardReference) || declarations.some(isForwardReference) || imports.some(isForwardReference) || exports.some(isForwardReference);
20018
- const type = wrapTypeReference(this.reflector, node);
20028
+ const type = wrapTypeReference(node);
20019
20029
  let ngModuleMetadata;
20020
20030
  if (allowUnresolvedReferences) {
20021
20031
  ngModuleMetadata = {
@@ -20696,7 +20706,7 @@ function getTopLevelDeclarationNames(sourceFile) {
20696
20706
  }
20697
20707
  if (ts91.isImportDeclaration(node) && node.importClause) {
20698
20708
  const importClause = node.importClause;
20699
- if (importClause.isTypeOnly) {
20709
+ if (importClause.phaseModifier === ts91.SyntaxKind.TypeKeyword) {
20700
20710
  continue;
20701
20711
  }
20702
20712
  if (importClause.name) {
@@ -22445,7 +22455,7 @@ var InjectableDecoratorHandler = class {
22445
22455
  };
22446
22456
  function extractInjectableMetadata(clazz, decorator, reflector) {
22447
22457
  const name = clazz.name.text;
22448
- const type = wrapTypeReference(reflector, clazz);
22458
+ const type = wrapTypeReference(clazz);
22449
22459
  const typeArgumentCount = reflector.getGenericArityOfClass(clazz) || 0;
22450
22460
  if (decorator.args === null) {
22451
22461
  throw new FatalDiagnosticError(ErrorCode.DECORATOR_NOT_CALLED, decorator.node, "@Injectable must be called");
@@ -22647,7 +22657,7 @@ var PipeDecoratorHandler = class {
22647
22657
  analyze(clazz, decorator) {
22648
22658
  this.perf.eventCount(PerfEvent.AnalyzePipe);
22649
22659
  const name = clazz.name.text;
22650
- const type = wrapTypeReference(this.reflector, clazz);
22660
+ const type = wrapTypeReference(clazz);
22651
22661
  if (decorator.args === null) {
22652
22662
  throw new FatalDiagnosticError(ErrorCode.DECORATOR_NOT_CALLED, decorator.node, `@Pipe must be called`);
22653
22663
  }
@@ -8,7 +8,7 @@ import {
8
8
  TrackedIncrementalBuildStrategy,
9
9
  freshCompilationTicket,
10
10
  incrementalFromCompilerTicket
11
- } from "./chunk-YPCN4FK3.js";
11
+ } from "./chunk-5DFEL3JC.js";
12
12
  import {
13
13
  ActivePerfRecorder,
14
14
  OptimizeFor,
@@ -18,7 +18,7 @@ import {
18
18
  TsCreateProgramDriver,
19
19
  replaceTsWithNgInErrors,
20
20
  retagAllTsFiles
21
- } from "./chunk-GBKWMNM6.js";
21
+ } from "./chunk-MKYLKJX2.js";
22
22
  import {
23
23
  absoluteFrom,
24
24
  createFileSystemTsReadDirectoryFn,
@@ -12,7 +12,7 @@ import {
12
12
  formatDiagnostics,
13
13
  performCompilation,
14
14
  readConfiguration
15
- } from "./chunk-HGWUZTYN.js";
15
+ } from "./chunk-MMUJKZHA.js";
16
16
 
17
17
  // packages/compiler-cli/src/main.js
18
18
  import ts2 from "typescript";
@@ -455,7 +455,7 @@ import { compileDirectiveFromMetadata, makeBindingParser, ParseLocation, ParseSo
455
455
  // packages/compiler-cli/linker/src/file_linker/partial_linkers/util.js
456
456
  import { createMayBeForwardRefExpression, outputAst as o2 } from "@angular/compiler";
457
457
  import semver from "semver";
458
- var PLACEHOLDER_VERSION = "21.1.3";
458
+ var PLACEHOLDER_VERSION = "21.1.5";
459
459
  function wrapReference(wrapped) {
460
460
  return { value: wrapped, type: wrapped };
461
461
  }
package/bundles/index.js CHANGED
@@ -17,7 +17,7 @@ import {
17
17
  isTsDiagnostic,
18
18
  performCompilation,
19
19
  readConfiguration
20
- } from "./chunk-HGWUZTYN.js";
20
+ } from "./chunk-MMUJKZHA.js";
21
21
  import {
22
22
  ConsoleLogger,
23
23
  LogLevel
@@ -34,7 +34,7 @@ import {
34
34
  freshCompilationTicket,
35
35
  incrementalFromStateTicket,
36
36
  isDocEntryWithSourceInfo
37
- } from "./chunk-YPCN4FK3.js";
37
+ } from "./chunk-5DFEL3JC.js";
38
38
  import {
39
39
  ActivePerfRecorder,
40
40
  ErrorCode,
@@ -46,7 +46,7 @@ import {
46
46
  getInitializerApiJitTransform,
47
47
  isLocalCompilationDiagnostics,
48
48
  ngErrorCode
49
- } from "./chunk-GBKWMNM6.js";
49
+ } from "./chunk-MKYLKJX2.js";
50
50
  import "./chunk-FROPOOFC.js";
51
51
  import {
52
52
  InvalidFileSystem,
@@ -77,7 +77,7 @@ import "./chunk-G7GFT6BU.js";
77
77
 
78
78
  // packages/compiler-cli/src/version.js
79
79
  import { Version } from "@angular/compiler";
80
- var VERSION = new Version("21.1.3");
80
+ var VERSION = new Version("21.1.5");
81
81
 
82
82
  // packages/compiler-cli/private/tooling.js
83
83
  var GLOBAL_DEFS_FOR_TERSER = {
@@ -5,7 +5,7 @@
5
5
  import {
6
6
  DiagnosticCategoryLabel,
7
7
  NgCompiler
8
- } from "../chunk-YPCN4FK3.js";
8
+ } from "../chunk-5DFEL3JC.js";
9
9
  import {
10
10
  CompilationMode,
11
11
  DtsMetadataReader,
@@ -32,7 +32,7 @@ import {
32
32
  queryDecoratorNames,
33
33
  reflectObjectLiteral,
34
34
  unwrapExpression
35
- } from "../chunk-GBKWMNM6.js";
35
+ } from "../chunk-MKYLKJX2.js";
36
36
  import "../chunk-FROPOOFC.js";
37
37
  import {
38
38
  getFileSystem,
@@ -6,7 +6,7 @@ import {
6
6
  ImportedSymbolsTracker,
7
7
  TypeScriptReflectionHost,
8
8
  getInitializerApiJitTransform
9
- } from "../chunk-GBKWMNM6.js";
9
+ } from "../chunk-MKYLKJX2.js";
10
10
  import "../chunk-FROPOOFC.js";
11
11
  import {
12
12
  InvalidFileSystem,
@@ -415,8 +415,9 @@ var FS_ALL = [FS_OS_X, FS_WINDOWS, FS_UNIX, FS_NATIVE];
415
415
  function runInEachFileSystemFn(callback) {
416
416
  FS_ALL.forEach((os2) => runInFileSystem(os2, callback, false));
417
417
  }
418
+ var counter = 0;
418
419
  function runInFileSystem(os2, callback, error) {
419
- describe(`<<FileSystem: ${os2}>>`, () => {
420
+ describe(`<<FileSystem: ${os2}>>/${counter++}`, () => {
420
421
  beforeEach(() => initMockFileSystem(os2));
421
422
  afterEach(() => setFileSystem(new InvalidFileSystem()));
422
423
  callback(os2);
@@ -4,7 +4,7 @@
4
4
 
5
5
  import {
6
6
  angularJitApplicationTransform
7
- } from "../chunk-GBKWMNM6.js";
7
+ } from "../chunk-MKYLKJX2.js";
8
8
  import "../chunk-FROPOOFC.js";
9
9
  import "../chunk-CEBE44Q5.js";
10
10
  import "../chunk-XYYEESKY.js";
@@ -6,12 +6,12 @@
6
6
  import {
7
7
  main,
8
8
  readCommandLineAndConfiguration
9
- } from "../../chunk-C74B7SVK.js";
9
+ } from "../../chunk-QDMTHXKM.js";
10
10
  import {
11
11
  EmitFlags
12
- } from "../../chunk-HGWUZTYN.js";
13
- import "../../chunk-YPCN4FK3.js";
14
- import "../../chunk-GBKWMNM6.js";
12
+ } from "../../chunk-MMUJKZHA.js";
13
+ import "../../chunk-5DFEL3JC.js";
14
+ import "../../chunk-MKYLKJX2.js";
15
15
  import "../../chunk-FROPOOFC.js";
16
16
  import {
17
17
  setFileSystem
@@ -5,10 +5,10 @@
5
5
 
6
6
  import {
7
7
  main
8
- } from "../../chunk-C74B7SVK.js";
9
- import "../../chunk-HGWUZTYN.js";
10
- import "../../chunk-YPCN4FK3.js";
11
- import "../../chunk-GBKWMNM6.js";
8
+ } from "../../chunk-QDMTHXKM.js";
9
+ import "../../chunk-MMUJKZHA.js";
10
+ import "../../chunk-5DFEL3JC.js";
11
+ import "../../chunk-MKYLKJX2.js";
12
12
  import "../../chunk-FROPOOFC.js";
13
13
  import {
14
14
  setFileSystem
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import { MaybeForwardRefExpression, outputAst as o, R3DeclareDependencyMetadata, R3DependencyMetadata, R3Reference } from '@angular/compiler';
9
9
  import { AstObject, AstValue } from '../../ast/ast_value';
10
- export declare const PLACEHOLDER_VERSION = "21.1.3";
10
+ export declare const PLACEHOLDER_VERSION = "21.1.5";
11
11
  export declare function wrapReference<TExpression>(wrapped: o.WrappedNodeExpr<TExpression>): R3Reference;
12
12
  /**
13
13
  * Parses the value of an enum from the AST value's symbol name.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "21.1.3",
3
+ "version": "21.1.5",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -43,7 +43,7 @@
43
43
  "typescript": "5.9.3"
44
44
  },
45
45
  "peerDependencies": {
46
- "@angular/compiler": "21.1.3",
46
+ "@angular/compiler": "21.1.5",
47
47
  "typescript": ">=5.9 <6.0"
48
48
  },
49
49
  "peerDependenciesMeta": {
@@ -104,7 +104,7 @@ export declare function resolveProvidersRequiringFactory(rawProviders: ts.Expres
104
104
  * The `value` is the exported declaration of the class from its source file.
105
105
  * The `type` is an expression that would be used in the typings (.d.ts) files.
106
106
  */
107
- export declare function wrapTypeReference(reflector: ReflectionHost, clazz: ClassDeclaration): R3Reference;
107
+ export declare function wrapTypeReference(clazz: ClassDeclaration): R3Reference;
108
108
  /** Creates a ParseSourceSpan for a TypeScript node. */
109
109
  export declare function createSourceSpan(node: ts.Node): ParseSourceSpan;
110
110
  /**
@@ -0,0 +1,33 @@
1
+ /**
2
+ * @license
3
+ * Copyright Google LLC All Rights Reserved.
4
+ *
5
+ * Use of this source code is governed by an MIT-style license that can be
6
+ * found in the LICENSE file at https://angular.dev/license
7
+ */
8
+ import ts from 'typescript';
9
+ import { NgCompiler } from './core';
10
+ import { NgCompilerOptions } from './core/api';
11
+ /**
12
+ * A driver for the Angular Compiler that performs "Source-to-Source" transformation.
13
+ *
14
+ * Unlike `NgtscProgram`, this driver does NOT use `program.emit()`. Instead, it:
15
+ * 1. Analyzes the program using `NgCompiler`.
16
+ * 2. Manually runs `ts.transform` with Angular's Ivy transformers.
17
+ * 3. Prints the transformed AST back to a TypeScript string.
18
+ *
19
+ * This mode is designed for a mode where the Angular Compiler
20
+ * acts as a pre-processor for a downstream TypeScript compiler.
21
+ */
22
+ export declare class NgtscIsolatedPreprocessor {
23
+ private options;
24
+ readonly compiler: NgCompiler;
25
+ private tsProgram;
26
+ private host;
27
+ private incrementalStrategy;
28
+ constructor(rootNames: ReadonlyArray<string>, options: NgCompilerOptions, delegateHost: ts.CompilerHost, oldProgram?: NgtscIsolatedPreprocessor);
29
+ transformAndPrint(): {
30
+ fileName: string;
31
+ content: string;
32
+ }[];
33
+ }
@@ -66,6 +66,7 @@ export declare class TraitCompiler implements ProgramTypeCheckAdapter {
66
66
  private semanticDepGraphUpdater;
67
67
  private sourceFileTypeIdentifier;
68
68
  private emitDeclarationOnly;
69
+ private emitIntermediateTs;
69
70
  /**
70
71
  * Maps class declarations to their `ClassRecord`, which tracks the Ivy traits being applied to
71
72
  * those classes.
@@ -83,7 +84,7 @@ export declare class TraitCompiler implements ProgramTypeCheckAdapter {
83
84
  private filesWithoutTraits;
84
85
  private reexportMap;
85
86
  private handlersByName;
86
- constructor(handlers: DecoratorHandler<unknown, unknown, SemanticSymbol | null, unknown>[], reflector: ReflectionHost, perf: PerfRecorder, incrementalBuild: IncrementalBuild<ClassRecord, unknown>, compileNonExportedClasses: boolean, compilationMode: CompilationMode, dtsTransforms: DtsTransformRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, sourceFileTypeIdentifier: SourceFileTypeIdentifier, emitDeclarationOnly: boolean);
87
+ constructor(handlers: DecoratorHandler<unknown, unknown, SemanticSymbol | null, unknown>[], reflector: ReflectionHost, perf: PerfRecorder, incrementalBuild: IncrementalBuild<ClassRecord, unknown>, compileNonExportedClasses: boolean, compilationMode: CompilationMode, dtsTransforms: DtsTransformRegistry, semanticDepGraphUpdater: SemanticDepGraphUpdater | null, sourceFileTypeIdentifier: SourceFileTypeIdentifier, emitDeclarationOnly: boolean, emitIntermediateTs: boolean);
87
88
  analyzeSync(sf: ts.SourceFile): void;
88
89
  analyzeAsync(sf: ts.SourceFile): Promise<void> | undefined;
89
90
  private analyze;
@@ -6,8 +6,8 @@
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
8
  import ts from 'typescript';
9
- import { DefaultImportTracker, ImportRewriter, LocalCompilationExtraImportsTracker } from '../../imports';
9
+ import { DefaultImportTracker, ImportRewriter, LocalCompilationExtraImportsTracker, ReferenceEmitter } from '../../imports';
10
10
  import { PerfRecorder } from '../../perf';
11
11
  import { ReflectionHost } from '../../reflection';
12
12
  import { TraitCompiler } from './compilation';
13
- export declare function ivyTransformFactory(compilation: TraitCompiler, reflector: ReflectionHost, importRewriter: ImportRewriter, defaultImportTracker: DefaultImportTracker, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null, perf: PerfRecorder, isCore: boolean, isClosureCompilerEnabled: boolean, emitDeclarationOnly: boolean): ts.TransformerFactory<ts.SourceFile>;
13
+ export declare function ivyTransformFactory(compilation: TraitCompiler, reflector: ReflectionHost, importRewriter: ImportRewriter, defaultImportTracker: DefaultImportTracker, localCompilationExtraImportsTracker: LocalCompilationExtraImportsTracker | null, perf: PerfRecorder, isCore: boolean, isClosureCompilerEnabled: boolean, emitDeclarationOnly: boolean, refEmitter: ReferenceEmitter | null, enableTypeReification: boolean): ts.TransformerFactory<ts.SourceFile>;