@angular/compiler-cli 13.1.0-next.2 → 13.1.0-next.3

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/bundles/{chunk-S3QIIFH7.js → chunk-4EDYFHXN.js} +6 -3
  2. package/bundles/chunk-4EDYFHXN.js.map +6 -0
  3. package/bundles/{chunk-2DL256T3.js → chunk-7HBAJSZA.js} +403 -402
  4. package/bundles/chunk-7HBAJSZA.js.map +6 -0
  5. package/bundles/{chunk-BUHTODFL.js → chunk-7HVF6UHR.js} +2 -2
  6. package/bundles/{chunk-BUHTODFL.js.map → chunk-7HVF6UHR.js.map} +0 -0
  7. package/bundles/{chunk-VKIZ4TCJ.js → chunk-COAETSNP.js} +6227 -10693
  8. package/bundles/chunk-COAETSNP.js.map +6 -0
  9. package/bundles/{chunk-WYO7JO2T.js → chunk-HDZS2JG2.js} +6 -2
  10. package/bundles/chunk-HDZS2JG2.js.map +6 -0
  11. package/bundles/{chunk-MIQ5UCHZ.js → chunk-IESRH26X.js} +26 -5
  12. package/bundles/chunk-IESRH26X.js.map +6 -0
  13. package/bundles/{chunk-PBA67OV4.js → chunk-JJMLEEKA.js} +28 -4
  14. package/bundles/chunk-JJMLEEKA.js.map +6 -0
  15. package/bundles/{chunk-JNWO3JB2.js → chunk-MFCLQBFK.js} +4 -4
  16. package/bundles/{chunk-JNWO3JB2.js.map → chunk-MFCLQBFK.js.map} +1 -1
  17. package/bundles/{chunk-WOC6KEUY.js → chunk-UIKTHF6Z.js} +6 -6
  18. package/bundles/{chunk-WOC6KEUY.js.map → chunk-UIKTHF6Z.js.map} +1 -1
  19. package/bundles/index.js +6 -55
  20. package/bundles/index.js.map +1 -1
  21. package/bundles/linker/babel/index.js +2 -2
  22. package/bundles/linker/index.js +2 -2
  23. package/bundles/ngcc/index.js +6 -7
  24. package/bundles/ngcc/index.js.map +1 -1
  25. package/bundles/ngcc/main-ngcc.js +6 -7
  26. package/bundles/ngcc/main-ngcc.js.map +1 -1
  27. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +5 -6
  28. package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +1 -1
  29. package/bundles/private/migrations.js +3 -3
  30. package/bundles/private/tooling.js +2 -3
  31. package/bundles/src/bin/ng_xi18n.js +5 -6
  32. package/bundles/src/bin/ng_xi18n.js.map +1 -1
  33. package/bundles/src/bin/ngc.js +5 -6
  34. package/bundles/src/bin/ngc.js.map +1 -1
  35. package/bundles_metadata.json +1 -1
  36. package/index.d.ts +0 -1
  37. package/ngcc/src/host/delegating_host.d.ts +1 -2
  38. package/ngcc/src/host/esm2015_host.d.ts +1 -8
  39. package/ngcc/src/host/ngcc_host.d.ts +0 -13
  40. package/ngcc/src/host/umd_host.d.ts +3 -0
  41. package/ngcc/src/packages/build_marker.d.ts +1 -1
  42. package/ngcc/src/packages/transformer.d.ts +0 -2
  43. package/ngcc/src/rendering/esm_rendering_formatter.d.ts +1 -5
  44. package/ngcc/src/rendering/renderer.d.ts +2 -3
  45. package/ngcc/src/rendering/rendering_formatter.d.ts +0 -2
  46. package/ngcc/src/utils.d.ts +0 -7
  47. package/package.json +3 -3
  48. package/src/ngtsc/core/src/host.d.ts +2 -1
  49. package/src/ngtsc/partial_evaluator/src/builtin.d.ts +5 -0
  50. package/src/ngtsc/program_driver/src/ts_create_program_driver.d.ts +2 -1
  51. package/src/ngtsc/reflection/src/host.d.ts +1 -1
  52. package/src/ngtsc/util/src/typescript.d.ts +10 -0
  53. package/src/transformers/compiler_host.d.ts +1 -97
  54. package/src/transformers/program.d.ts +0 -19
  55. package/src/transformers/util.d.ts +1 -18
  56. package/src/{diagnostics/typescript_version.d.ts → version_helpers.d.ts} +1 -1
  57. package/bundles/chunk-2DL256T3.js.map +0 -6
  58. package/bundles/chunk-ACINBTQB.js +0 -43
  59. package/bundles/chunk-ACINBTQB.js.map +0 -6
  60. package/bundles/chunk-MIQ5UCHZ.js.map +0 -6
  61. package/bundles/chunk-PBA67OV4.js.map +0 -6
  62. package/bundles/chunk-S3QIIFH7.js.map +0 -6
  63. package/bundles/chunk-VKIZ4TCJ.js.map +0 -6
  64. package/bundles/chunk-WYO7JO2T.js.map +0 -6
  65. package/ngcc/src/analysis/switch_marker_analyzer.d.ts +0 -35
  66. package/src/diagnostics/translate_diagnostics.d.ts +0 -18
  67. package/src/language_services.d.ts +0 -11
  68. package/src/metadata/bundle_index_host.d.ts +0 -16
  69. package/src/metadata/bundler.d.ts +0 -66
  70. package/src/metadata/collector.d.ts +0 -44
  71. package/src/metadata/evaluator.d.ts +0 -58
  72. package/src/metadata/index.d.ts +0 -11
  73. package/src/metadata/index_writer.d.ts +0 -10
  74. package/src/metadata/schema.d.ts +0 -182
  75. package/src/metadata/symbols.d.ts +0 -22
  76. package/src/ngtsc/switch/index.d.ts +0 -9
  77. package/src/ngtsc/switch/src/switch.d.ts +0 -10
  78. package/src/transformers/inline_resources.d.ts +0 -26
  79. package/src/transformers/lower_expressions.d.ts +0 -30
  80. package/src/transformers/metadata_cache.d.ts +0 -27
  81. package/src/transformers/metadata_reader.d.ts +0 -19
  82. package/src/transformers/node_emitter.d.ts +0 -105
  83. package/src/transformers/node_emitter_transform.d.ts +0 -19
  84. package/src/transformers/r3_metadata_transform.d.ts +0 -16
  85. package/src/transformers/r3_transform.d.ts +0 -16
package/index.d.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  /// <amd-module name="@angular/compiler-cli" />
2
2
  export { AotCompilerHost, AotCompilerHost as StaticReflectorHost, StaticReflector, StaticSymbol } from '@angular/compiler';
3
3
  export { VERSION } from './src/version';
4
- export * from './src/metadata';
5
4
  export * from './src/transformers/api';
6
5
  export * from './src/transformers/entry_points';
7
6
  export * from './src/perform_compile';
@@ -8,7 +8,7 @@
8
8
  /// <amd-module name="@angular/compiler-cli/ngcc/src/host/delegating_host" />
9
9
  import ts from 'typescript';
10
10
  import { ClassDeclaration, ClassMember, CtorParameter, Declaration, DeclarationNode, Decorator, FunctionDefinition, Import, ReflectionHost } from '../../../src/ngtsc/reflection';
11
- import { NgccClassSymbol, NgccReflectionHost, SwitchableVariableDeclaration } from './ngcc_host';
11
+ import { NgccClassSymbol, NgccReflectionHost } from './ngcc_host';
12
12
  /**
13
13
  * A reflection host implementation that delegates reflector queries depending on whether they
14
14
  * reflect on declaration files (for dependent libraries) or source files within the entry-point
@@ -38,7 +38,6 @@ export declare class DelegatingReflectionHost implements NgccReflectionHost {
38
38
  findClassSymbols(sourceFile: ts.SourceFile): NgccClassSymbol[];
39
39
  getClassSymbol(node: ts.Node): NgccClassSymbol | undefined;
40
40
  getDecoratorsOfSymbol(symbol: NgccClassSymbol): Decorator[] | null;
41
- getSwitchableDeclarations(module: ts.Node): SwitchableVariableDeclaration[];
42
41
  getEndOfClass(classSymbol: NgccClassSymbol): ts.Node;
43
42
  detectKnownDeclaration<T extends Declaration>(decl: T): T;
44
43
  isStaticallyExported(decl: ts.Node): boolean;
@@ -10,7 +10,7 @@ import ts from 'typescript';
10
10
  import { Logger } from '../../../src/ngtsc/logging';
11
11
  import { ClassDeclaration, ClassMember, ClassMemberKind, CtorParameter, Declaration, DeclarationNode, Decorator, EnumMember, TypeScriptReflectionHost } from '../../../src/ngtsc/reflection';
12
12
  import { BundleProgram } from '../packages/bundle_program';
13
- import { NgccClassSymbol, NgccReflectionHost, SwitchableVariableDeclaration } from './ngcc_host';
13
+ import { NgccClassSymbol, NgccReflectionHost } from './ngcc_host';
14
14
  export declare const DECORATORS: ts.__String;
15
15
  export declare const PROP_DECORATORS: ts.__String;
16
16
  export declare const CONSTRUCTOR: ts.__String;
@@ -186,13 +186,6 @@ export declare class Esm2015ReflectionHost extends TypeScriptReflectionHost impl
186
186
  * injected by a migration will not be present in the returned collection.
187
187
  */
188
188
  getDecoratorsOfSymbol(symbol: NgccClassSymbol): Decorator[] | null;
189
- /**
190
- * Search the given module for variable declarations in which the initializer
191
- * is an identifier marked with the `PRE_R3_MARKER`.
192
- * @param module the module in which to search for switchable declarations.
193
- * @returns an array of variable declarations that match.
194
- */
195
- getSwitchableDeclarations(module: ts.Node): SwitchableVariableDeclaration[];
196
189
  getVariableValue(declaration: ts.VariableDeclaration): ts.Expression | null;
197
190
  /**
198
191
  * Find all top-level class symbols in the given file.
@@ -9,12 +9,6 @@
9
9
  import ts from 'typescript';
10
10
  import { ClassDeclaration, Declaration, Decorator, ReflectionHost } from '../../../src/ngtsc/reflection';
11
11
  import { SymbolWithValueDeclaration } from '../../../src/ngtsc/util/src/typescript';
12
- export declare const PRE_R3_MARKER = "__PRE_R3__";
13
- export declare const POST_R3_MARKER = "__POST_R3__";
14
- export declare type SwitchableVariableDeclaration = ts.VariableDeclaration & {
15
- initializer: ts.Identifier;
16
- };
17
- export declare function isSwitchableVariableDeclaration(node: ts.Node): node is SwitchableVariableDeclaration;
18
12
  /**
19
13
  * The symbol corresponding to a "class" declaration. I.e. a `ts.Symbol` whose `valueDeclaration` is
20
14
  * a `ClassDeclaration`.
@@ -60,13 +54,6 @@ export interface NgccReflectionHost extends ReflectionHost {
60
54
  * a "class" or has no symbol.
61
55
  */
62
56
  getClassSymbol(declaration: ts.Node): NgccClassSymbol | undefined;
63
- /**
64
- * Search the given module for variable declarations in which the initializer
65
- * is an identifier marked with the `PRE_R3_MARKER`.
66
- * @param module The module in which to search for switchable declarations.
67
- * @returns An array of variable declarations that match.
68
- */
69
- getSwitchableDeclarations(module: ts.Node): SwitchableVariableDeclaration[];
70
57
  /**
71
58
  * Retrieves all decorators of a given class symbol.
72
59
  * @param symbol Class symbol that can refer to a declaration which can hold decorators.
@@ -79,5 +79,8 @@ export declare function getImportsOfUmdModule(umdModule: UmdModule): {
79
79
  interface UmdModule {
80
80
  wrapperFn: ts.FunctionExpression;
81
81
  factoryFn: ts.FunctionExpression;
82
+ factoryCalls: Record<'amdDefine' | 'commonJs' | 'commonJs2' | 'global', ts.CallExpression | null> & {
83
+ cjsCallForImports: ts.CallExpression;
84
+ };
82
85
  }
83
86
  export {};
@@ -9,7 +9,7 @@
9
9
  import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
10
10
  import { PackageJsonUpdater } from '../writing/package_json_updater';
11
11
  import { EntryPointPackageJson, PackageJsonFormatProperties } from './entry_point';
12
- export declare const NGCC_VERSION = "13.1.0-next.2";
12
+ export declare const NGCC_VERSION = "13.1.0-next.3";
13
13
  /**
14
14
  * Returns true if there is a format in this entry-point that was compiled with an outdated version
15
15
  * of ngcc.
@@ -12,7 +12,6 @@ import { ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
12
12
  import { Logger } from '../../../src/ngtsc/logging';
13
13
  import { ModuleWithProvidersAnalyses } from '../analysis/module_with_providers_analyzer';
14
14
  import { ExportInfo } from '../analysis/private_declarations_analyzer';
15
- import { SwitchMarkerAnalyses } from '../analysis/switch_marker_analyzer';
16
15
  import { CompiledFile } from '../analysis/types';
17
16
  import { NgccReflectionHost } from '../host/ngcc_host';
18
17
  import { RenderingFormatter } from '../rendering/rendering_formatter';
@@ -65,7 +64,6 @@ export declare class Transformer {
65
64
  export declare function hasErrors(diagnostics: ts.Diagnostic[]): boolean;
66
65
  interface ProgramAnalyses {
67
66
  decorationAnalyses: Map<ts.SourceFile, CompiledFile>;
68
- switchMarkerAnalyses: SwitchMarkerAnalyses;
69
67
  privateDeclarationsAnalyses: ExportInfo[];
70
68
  moduleWithProvidersAnalyses: ModuleWithProvidersAnalyses | null;
71
69
  diagnostics: ts.Diagnostic[];
@@ -15,7 +15,7 @@ import { Import, ImportManager } from '../../../src/ngtsc/translator';
15
15
  import { ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
16
16
  import { ExportInfo } from '../analysis/private_declarations_analyzer';
17
17
  import { CompiledClass } from '../analysis/types';
18
- import { NgccReflectionHost, SwitchableVariableDeclaration } from '../host/ngcc_host';
18
+ import { NgccReflectionHost } from '../host/ngcc_host';
19
19
  import { RedundantDecoratorMap, RenderingFormatter } from './rendering_formatter';
20
20
  /**
21
21
  * A RenderingFormatter that works with ECMAScript Module import and export statements.
@@ -57,10 +57,6 @@ export declare class EsmRenderingFormatter implements RenderingFormatter {
57
57
  * Remove static decorator properties from classes.
58
58
  */
59
59
  removeDecorators(output: MagicString, decoratorsToRemove: RedundantDecoratorMap): void;
60
- /**
61
- * Rewrite the IVY switch markers to indicate we are in IVY mode.
62
- */
63
- rewriteSwitchableDeclarations(outputText: MagicString, sourceFile: ts.SourceFile, declarations: SwitchableVariableDeclaration[]): void;
64
60
  /**
65
61
  * Add the type parameters to the appropriate functions that return `ModuleWithProviders`
66
62
  * structures.
@@ -13,7 +13,6 @@ import { Logger } from '../../../src/ngtsc/logging';
13
13
  import { ImportManager } from '../../../src/ngtsc/translator';
14
14
  import { ParsedConfiguration } from '../../../src/perform_compile';
15
15
  import { PrivateDeclarationsAnalyses } from '../analysis/private_declarations_analyzer';
16
- import { SwitchMarkerAnalyses, SwitchMarkerAnalysis } from '../analysis/switch_marker_analyzer';
17
16
  import { CompiledFile, DecorationAnalyses } from '../analysis/types';
18
17
  import { NgccReflectionHost } from '../host/ngcc_host';
19
18
  import { EntryPointBundle } from '../packages/entry_point_bundle';
@@ -33,13 +32,13 @@ export declare class Renderer {
33
32
  private bundle;
34
33
  private tsConfig;
35
34
  constructor(host: NgccReflectionHost, srcFormatter: RenderingFormatter, fs: ReadonlyFileSystem, logger: Logger, bundle: EntryPointBundle, tsConfig?: ParsedConfiguration | null);
36
- renderProgram(decorationAnalyses: DecorationAnalyses, switchMarkerAnalyses: SwitchMarkerAnalyses, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
35
+ renderProgram(decorationAnalyses: DecorationAnalyses, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
37
36
  /**
38
37
  * Render the source code and source-map for an Analyzed file.
39
38
  * @param compiledFile The analyzed file to render.
40
39
  * @param targetPath The absolute path where the rendered file will be written.
41
40
  */
42
- renderFile(sourceFile: ts.SourceFile, compiledFile: CompiledFile | undefined, switchMarkerAnalysis: SwitchMarkerAnalysis | undefined, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
41
+ renderFile(sourceFile: ts.SourceFile, compiledFile: CompiledFile | undefined, privateDeclarationsAnalyses: PrivateDeclarationsAnalyses): FileToWrite[];
43
42
  /**
44
43
  * From the given list of classes, computes a map of decorators that should be removed.
45
44
  * The decorators to remove are keyed by their container node, such that we can tell if
@@ -14,7 +14,6 @@ import { Import, ImportManager } from '../../../src/ngtsc/translator';
14
14
  import { ModuleWithProvidersInfo } from '../analysis/module_with_providers_analyzer';
15
15
  import { ExportInfo } from '../analysis/private_declarations_analyzer';
16
16
  import { CompiledClass } from '../analysis/types';
17
- import { SwitchableVariableDeclaration } from '../host/ngcc_host';
18
17
  /**
19
18
  * The collected decorators that have become redundant after the compilation
20
19
  * of Ivy static fields. The map is keyed by the container node, such that we
@@ -34,7 +33,6 @@ export interface RenderingFormatter {
34
33
  addDefinitions(output: MagicString, compiledClass: CompiledClass, definitions: string): void;
35
34
  addAdjacentStatements(output: MagicString, compiledClass: CompiledClass, statements: string): void;
36
35
  removeDecorators(output: MagicString, decoratorsToRemove: RedundantDecoratorMap): void;
37
- rewriteSwitchableDeclarations(outputText: MagicString, sourceFile: ts.SourceFile, declarations: SwitchableVariableDeclaration[]): void;
38
36
  addModuleWithProvidersParams(outputText: MagicString, moduleWithProviders: ModuleWithProvidersInfo[], importManager: ImportManager): void;
39
37
  printStatement(stmt: Statement, sourceFile: ts.SourceFile, importManager: ImportManager): string;
40
38
  }
@@ -31,13 +31,6 @@ export interface PartiallyOrderedList<T> extends Array<T> {
31
31
  export declare function getOriginalSymbol(checker: ts.TypeChecker): (symbol: ts.Symbol) => ts.Symbol;
32
32
  export declare function isDefined<T>(value: T | undefined | null): value is T;
33
33
  export declare function getNameText(name: ts.PropertyName | ts.BindingName): string;
34
- /**
35
- * Parse down the AST and capture all the nodes that satisfy the test.
36
- * @param node The start node.
37
- * @param test The function that tests whether a node should be included.
38
- * @returns a collection of nodes that satisfy the test.
39
- */
40
- export declare function findAll<T>(node: ts.Node, test: (node: ts.Node) => node is ts.Node & T): T[];
41
34
  /**
42
35
  * Does the given declaration have a name which is an identifier?
43
36
  * @param declaration The declaration to test.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/compiler-cli",
3
- "version": "13.1.0-next.2",
3
+ "version": "13.1.0-next.3",
4
4
  "description": "Angular - the compiler CLI for Node.js",
5
5
  "typings": "index.d.ts",
6
6
  "bin": {
@@ -66,8 +66,8 @@
66
66
  "yargs": "^17.2.1"
67
67
  },
68
68
  "peerDependencies": {
69
- "@angular/compiler": "13.1.0-next.2",
70
- "typescript": ">=4.4.2 <4.5"
69
+ "@angular/compiler": "13.1.0-next.3",
70
+ "typescript": ">=4.4.2 <4.6"
71
71
  },
72
72
  "repository": {
73
73
  "type": "git",
@@ -42,12 +42,13 @@ export declare class DelegatingCompilerHost implements Omit<RequiredDelegations<
42
42
  readResource: ((fileName: string) => string | Promise<string>) | undefined;
43
43
  transformResource: ((data: string, context: import("@angular/compiler-cli/src/ngtsc/core/api/index").ResourceHostContext) => Promise<import("@angular/compiler-cli/src/ngtsc/core/api/index").TransformResourceResult | null>) | undefined;
44
44
  realpath: ((path: string) => string) | undefined;
45
- resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions) => (ts.ResolvedModule | undefined)[]) | undefined;
45
+ resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingSourceFile?: ts.SourceFile | undefined) => (ts.ResolvedModule | undefined)[]) | undefined;
46
46
  resolveTypeReferenceDirectives: ((typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions) => (ts.ResolvedTypeReferenceDirective | undefined)[]) | undefined;
47
47
  resourceNameToFileName: ((resourceName: string, containingFilePath: string, fallbackResolve?: ((url: string, fromFile: string) => string | null) | undefined) => string | null) | undefined;
48
48
  trace: ((s: string) => void) | undefined;
49
49
  useCaseSensitiveFileNames: () => boolean;
50
50
  writeFile: ts.WriteFileCallback;
51
+ getModuleResolutionCache: any;
51
52
  }
52
53
  /**
53
54
  * A wrapper around `ts.CompilerHost` (plus any extension methods from `ExtendedTsCompilerHost`).
@@ -18,6 +18,11 @@ export declare class ArrayConcatBuiltinFn extends KnownFn {
18
18
  constructor(lhs: ResolvedValueArray);
19
19
  evaluate(node: ts.CallExpression, args: ResolvedValueArray): ResolvedValue;
20
20
  }
21
+ export declare class StringConcatBuiltinFn extends KnownFn {
22
+ private lhs;
23
+ constructor(lhs: string);
24
+ evaluate(node: ts.CallExpression, args: ResolvedValueArray): ResolvedValue;
25
+ }
21
26
  export declare class ObjectAssignBuiltinFn extends KnownFn {
22
27
  evaluate(node: ts.CallExpression, args: ResolvedValueArray): ResolvedValue;
23
28
  }
@@ -36,10 +36,11 @@ export declare class DelegatingCompilerHost implements Omit<RequiredDelegations<
36
36
  readDirectory: ((rootDir: string, extensions: readonly string[], excludes: readonly string[] | undefined, includes: readonly string[], depth?: number | undefined) => string[]) | undefined;
37
37
  readFile: (fileName: string) => string | undefined;
38
38
  realpath: ((path: string) => string) | undefined;
39
- resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions) => (ts.ResolvedModule | undefined)[]) | undefined;
39
+ resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames: string[] | undefined, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions, containingSourceFile?: ts.SourceFile | undefined) => (ts.ResolvedModule | undefined)[]) | undefined;
40
40
  resolveTypeReferenceDirectives: ((typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference: ts.ResolvedProjectReference | undefined, options: ts.CompilerOptions) => (ts.ResolvedTypeReferenceDirective | undefined)[]) | undefined;
41
41
  trace: ((s: string) => void) | undefined;
42
42
  useCaseSensitiveFileNames: () => boolean;
43
+ getModuleResolutionCache: any;
43
44
  }
44
45
  /**
45
46
  * Updates a `ts.Program` instance with a new one that incorporates specific changes, using the
@@ -290,7 +290,7 @@ export interface NoValueDeclaration {
290
290
  export interface TypeOnlyImport {
291
291
  kind: ValueUnavailableKind.TYPE_ONLY_IMPORT;
292
292
  typeNode: ts.TypeNode;
293
- importClause: ts.ImportClause;
293
+ node: ts.ImportClause | ts.ImportSpecifier;
294
294
  }
295
295
  export interface NamespaceImport {
296
296
  kind: ValueUnavailableKind.NAMESPACE;
@@ -62,3 +62,13 @@ export declare type RequiredDelegations<T> = {
62
62
  * Obtains the non-redirected source file for `sf`.
63
63
  */
64
64
  export declare function toUnredirectedSourceFile(sf: ts.SourceFile): ts.SourceFile;
65
+ /**
66
+ * Backwards-compatible version of `ts.createExportSpecifier`
67
+ * to handle a breaking change between 4.4 and 4.5.
68
+ */
69
+ export declare function createExportSpecifier(propertyName: string | ts.Identifier | undefined, name: string | ts.Identifier, isTypeOnly?: boolean): ts.ExportSpecifier;
70
+ /**
71
+ * Backwards-compatible version of `ts.createImportSpecifier`
72
+ * to handle a breaking change between 4.4 and 4.5.
73
+ */
74
+ export declare function createImportSpecifier(propertyName: string | ts.Identifier | undefined, name: string | ts.Identifier, isTypeOnly?: boolean): ts.ImportSpecifier;
@@ -6,106 +6,10 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/transformers/compiler_host" />
9
- import { AotCompilerHost, GeneratedFile, ParseSourceSpan } from '@angular/compiler';
10
9
  import ts from 'typescript';
11
- import { TypeCheckHost } from '../diagnostics/translate_diagnostics';
12
- import { ModuleMetadata } from '../metadata/index';
13
- import { CompilerHost, CompilerOptions, LibrarySummary } from './api';
10
+ import { CompilerHost, CompilerOptions } from './api';
14
11
  export declare function setWrapHostForTest(wrapFn: ((host: ts.CompilerHost) => ts.CompilerHost) | null): void;
15
12
  export declare function createCompilerHost({ options, tsHost }: {
16
13
  options: CompilerOptions;
17
14
  tsHost?: ts.CompilerHost;
18
15
  }): CompilerHost;
19
- export interface MetadataProvider {
20
- getMetadata(sourceFile: ts.SourceFile): ModuleMetadata | undefined;
21
- }
22
- export interface CodeGenerator {
23
- generateFile(genFileName: string, baseFileName?: string): GeneratedFile;
24
- findGeneratedFileNames(fileName: string): string[];
25
- }
26
- /**
27
- * Implements the following hosts based on an api.CompilerHost:
28
- * - ts.CompilerHost to be consumed by a ts.Program
29
- * - AotCompilerHost for @angular/compiler
30
- * - TypeCheckHost for mapping ts errors to ng errors (via translateDiagnostics)
31
- */
32
- export declare class TsCompilerAotCompilerTypeCheckHostAdapter implements ts.CompilerHost, AotCompilerHost, TypeCheckHost {
33
- private rootFiles;
34
- private options;
35
- private context;
36
- private metadataProvider;
37
- private codeGenerator;
38
- private librarySummaries;
39
- private metadataReaderCache;
40
- private fileNameToModuleNameCache;
41
- private flatModuleIndexCache;
42
- private flatModuleIndexNames;
43
- private flatModuleIndexRedirectNames;
44
- private rootDirs;
45
- private moduleResolutionCache;
46
- private originalSourceFiles;
47
- private originalFileExistsCache;
48
- private generatedSourceFiles;
49
- private generatedCodeFor;
50
- private emitter;
51
- private metadataReaderHost;
52
- getCancellationToken: () => ts.CancellationToken;
53
- getDefaultLibLocation: () => string;
54
- trace: (s: string) => void;
55
- getDirectories: (path: string) => string[];
56
- resolveTypeReferenceDirectives?: (names: string[], containingFile: string) => ts.ResolvedTypeReferenceDirective[];
57
- directoryExists?: (directoryName: string) => boolean;
58
- constructor(rootFiles: ReadonlyArray<string>, options: CompilerOptions, context: CompilerHost, metadataProvider: MetadataProvider, codeGenerator: CodeGenerator, librarySummaries?: Map<string, LibrarySummary>);
59
- private resolveModuleName;
60
- resolveModuleNames(moduleNames: string[], containingFile: string): ts.ResolvedModule[];
61
- moduleNameToFileName(m: string, containingFile?: string): string | null;
62
- /**
63
- * We want a moduleId that will appear in import statements in the generated code
64
- * which will be written to `containingFile`.
65
- *
66
- * Note that we also generate files for files in node_modules, as libraries
67
- * only ship .metadata.json files but not the generated code.
68
- *
69
- * Logic:
70
- * 1. if the importedFile and the containingFile are from the project sources
71
- * or from the same node_modules package, use a relative path
72
- * 2. if the importedFile is in a node_modules package,
73
- * use a path that starts with the package name.
74
- * 3. Error if the containingFile is in the node_modules package
75
- * and the importedFile is in the project soures,
76
- * as that is a violation of the principle that node_modules packages cannot
77
- * import project sources.
78
- */
79
- fileNameToModuleName(importedFile: string, containingFile: string): string;
80
- resourceNameToFileName(resourceName: string, containingFile: string): string | null;
81
- toSummaryFileName(fileName: string, referringSrcFileName: string): string;
82
- fromSummaryFileName(fileName: string, referringLibFileName: string): string;
83
- parseSourceSpanOf(fileName: string, line: number, character: number): ParseSourceSpan | null;
84
- private getOriginalSourceFile;
85
- updateGeneratedFile(genFile: GeneratedFile): ts.SourceFile;
86
- private addGeneratedFile;
87
- shouldGenerateFile(fileName: string): {
88
- generate: boolean;
89
- baseFileName?: string;
90
- };
91
- shouldGenerateFilesFor(fileName: string): string | boolean | null;
92
- getSourceFile(fileName: string, languageVersion: ts.ScriptTarget, onError?: ((message: string) => void) | undefined): ts.SourceFile;
93
- private getGeneratedFile;
94
- private originalFileExists;
95
- fileExists(fileName: string): boolean;
96
- loadSummary(filePath: string): string | null;
97
- isSourceFile(filePath: string): boolean;
98
- readFile(fileName: string): string | undefined;
99
- getMetadataFor(filePath: string): ModuleMetadata[] | undefined;
100
- loadResource(filePath: string): Promise<string> | string;
101
- getOutputName(filePath: string): string;
102
- private hasBundleIndex;
103
- getDefaultLibFileName: (options: ts.CompilerOptions) => string;
104
- getCurrentDirectory: () => string;
105
- getCanonicalFileName: (fileName: string) => string;
106
- useCaseSensitiveFileNames: () => boolean;
107
- getNewLine: () => string;
108
- realpath: (p: string) => string;
109
- writeFile: ts.WriteFileCallback;
110
- }
111
- export declare function getOriginalReferences(sourceFile: ts.SourceFile): ts.FileReference[] | undefined;
@@ -6,29 +6,10 @@
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/transformers/program" />
9
- import * as path from 'path';
10
- import ts from 'typescript';
11
9
  import { CompilerHost, CompilerOptions, Program } from './api';
12
- export declare function setTempProgramHandlerForTest(handler: (program: ts.Program) => void): void;
13
- export declare function resetTempProgramHandlerForTest(): void;
14
10
  export declare function createProgram({ rootNames, options, host, oldProgram }: {
15
11
  rootNames: ReadonlyArray<string>;
16
12
  options: CompilerOptions;
17
13
  host: CompilerHost;
18
14
  oldProgram?: Program;
19
15
  }): Program;
20
- /**
21
- * Returns a function that can adjust a path from source path to out path,
22
- * based on an existing mapping from source to out path.
23
- *
24
- * TODO(tbosch): talk to the TypeScript team to expose their logic for calculating the `rootDir`
25
- * if none was specified.
26
- *
27
- * Note: This function works on normalized paths from typescript but should always return
28
- * POSIX normalized paths for output paths.
29
- */
30
- export declare function createSrcToOutPathMapper(outDir: string | undefined, sampleSrcFileName: string | undefined, sampleOutFileName: string | undefined, host?: {
31
- dirname: typeof path.dirname;
32
- resolve: typeof path.resolve;
33
- relative: typeof path.relative;
34
- }): (srcFileName: string) => string;
@@ -7,21 +7,10 @@
7
7
  */
8
8
  /// <amd-module name="@angular/compiler-cli/src/transformers/util" />
9
9
  import ts from 'typescript';
10
- import { CompilerOptions, Diagnostic } from './api';
10
+ import { Diagnostic } from './api';
11
11
  export declare const GENERATED_FILES: RegExp;
12
- export declare const DTS: RegExp;
13
- export declare const TS: RegExp;
14
- export declare const enum StructureIsReused {
15
- Not = 0,
16
- SafeModules = 1,
17
- Completely = 2
18
- }
19
- export declare function tsStructureIsReused(program: ts.Program): StructureIsReused;
20
12
  export declare function error(msg: string): never;
21
- export declare function userError(msg: string): never;
22
13
  export declare function createMessageDiagnostic(messageText: string): ts.Diagnostic & Diagnostic;
23
- export declare function isInRootDir(fileName: string, options: CompilerOptions): string | true | null;
24
- export declare function relativeToRootDirs(filePath: string, rootDirs: string[]): string;
25
14
  /**
26
15
  * Converts a ng.Diagnostic into a ts.Diagnostic.
27
16
  * This looses some information, and also uses an incomplete object as `file`.
@@ -29,9 +18,3 @@ export declare function relativeToRootDirs(filePath: string, rootDirs: string[])
29
18
  * I.e. only use this where the API allows only a ts.Diagnostic.
30
19
  */
31
20
  export declare function ngToTsDiagnostic(ng: Diagnostic): ts.Diagnostic;
32
- /**
33
- * Strip multiline comment start and end markers from the `commentText` string.
34
- *
35
- * This will also strip the JSDOC comment start marker (`/**`).
36
- */
37
- export declare function stripComment(commentText: string): string;
@@ -5,7 +5,7 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.io/license
7
7
  */
8
- /// <amd-module name="@angular/compiler-cli/src/diagnostics/typescript_version" />
8
+ /// <amd-module name="@angular/compiler-cli/src/version_helpers" />
9
9
  /**
10
10
  * Converts a `string` version into an array of numbers
11
11
  * @example