@angular/compiler-cli 15.2.0 → 16.0.0-next.0
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/bundles/{chunk-PKSKJEUS.js → chunk-2DMH5JXJ.js} +9 -18
- package/bundles/{chunk-PKSKJEUS.js.map → chunk-2DMH5JXJ.js.map} +1 -1
- package/bundles/{chunk-P6SWFK2U.js → chunk-4TCRZYAK.js} +2 -2
- package/bundles/{chunk-NJMZRTB6.js → chunk-54RHUHYB.js} +1 -2
- package/bundles/{chunk-2PLRZDNU.js → chunk-6CARGXRJ.js} +5 -5
- package/bundles/{chunk-O4JLZZWJ.js → chunk-EDWIBG7R.js} +1 -10
- package/bundles/chunk-EDWIBG7R.js.map +6 -0
- package/bundles/{chunk-6ZJFIQBG.js → chunk-GYHDNUIK.js} +1 -2
- package/bundles/{chunk-2OF2AI57.js → chunk-IS6KZYEA.js} +377 -609
- package/bundles/chunk-IS6KZYEA.js.map +6 -0
- package/bundles/{chunk-J3L7WZP3.js → chunk-JHMH3CX2.js} +3 -3
- package/bundles/{chunk-ZCBRXUPO.js → chunk-K2A5WD7L.js} +1 -6
- package/bundles/chunk-K2A5WD7L.js.map +6 -0
- package/bundles/{chunk-QRHWLC7U.js → chunk-PSGRCFPQ.js} +2 -2
- package/bundles/index.js +13 -13
- package/bundles/linker/babel/index.js +8 -8
- package/bundles/linker/index.js +4 -4
- package/bundles/private/bazel.js +1 -1
- package/bundles/private/localize.js +1 -1
- package/bundles/private/migrations.js +5 -5
- package/bundles/private/tooling.js +3 -3
- package/bundles/src/bin/ng_xi18n.js +7 -7
- package/bundles/src/bin/ngc.js +7 -7
- package/bundles_metadata.json +1 -1
- package/package.json +2 -15
- package/src/ngtsc/annotations/ng_module/src/handler.d.ts +1 -3
- package/src/ngtsc/core/api/src/adapter.d.ts +0 -7
- package/src/ngtsc/core/api/src/options.d.ts +2 -2
- package/src/ngtsc/core/api/src/public_options.d.ts +0 -25
- package/src/ngtsc/core/src/host.d.ts +3 -5
- package/src/ngtsc/shims/api.d.ts +0 -19
- package/src/ngtsc/shims/index.d.ts +0 -2
- package/src/transformers/api.d.ts +0 -5
- package/bundles/chunk-2OF2AI57.js.map +0 -6
- package/bundles/chunk-7DUI3BSX.js +0 -29
- package/bundles/chunk-7DUI3BSX.js.map +0 -6
- package/bundles/chunk-MLCT4AWL.js +0 -2187
- package/bundles/chunk-MLCT4AWL.js.map +0 -6
- package/bundles/chunk-NXCQCU6C.js +0 -5265
- package/bundles/chunk-NXCQCU6C.js.map +0 -6
- package/bundles/chunk-O4JLZZWJ.js.map +0 -6
- package/bundles/chunk-YRDMG3GM.js +0 -115
- package/bundles/chunk-YRDMG3GM.js.map +0 -6
- package/bundles/chunk-ZCBRXUPO.js.map +0 -6
- package/bundles/ngcc/index.js +0 -52
- package/bundles/ngcc/index.js.map +0 -6
- package/bundles/ngcc/main-ngcc.js +0 -49
- package/bundles/ngcc/main-ngcc.js.map +0 -6
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js +0 -114
- package/bundles/ngcc/src/execution/cluster/ngcc_cluster_worker.js.map +0 -6
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js +0 -34
- package/bundles/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.js.map +0 -6
- package/ngcc/index.d.ts +0 -19
- package/ngcc/main-ngcc.d.ts +0 -2
- package/ngcc/src/analysis/decoration_analyzer.d.ts +0 -80
- package/ngcc/src/analysis/migration_host.d.ts +0 -22
- package/ngcc/src/analysis/module_with_providers_analyzer.d.ts +0 -61
- package/ngcc/src/analysis/ngcc_references_registry.d.ts +0 -34
- package/ngcc/src/analysis/ngcc_trait_compiler.d.ts +0 -42
- package/ngcc/src/analysis/private_declarations_analyzer.d.ts +0 -29
- package/ngcc/src/analysis/types.d.ts +0 -29
- package/ngcc/src/analysis/util.d.ts +0 -11
- package/ngcc/src/command_line_options.d.ts +0 -3
- package/ngcc/src/constants.d.ts +0 -9
- package/ngcc/src/dependencies/commonjs_dependency_host.d.ts +0 -20
- package/ngcc/src/dependencies/dependency_host.d.ts +0 -77
- package/ngcc/src/dependencies/dependency_resolver.d.ts +0 -102
- package/ngcc/src/dependencies/dts_dependency_host.d.ts +0 -20
- package/ngcc/src/dependencies/esm_dependency_host.d.ts +0 -93
- package/ngcc/src/dependencies/module_resolver.d.ts +0 -134
- package/ngcc/src/dependencies/umd_dependency_host.d.ts +0 -9
- package/ngcc/src/entry_point_finder/directory_walker_entry_point_finder.d.ts +0 -41
- package/ngcc/src/entry_point_finder/entry_point_collector.d.ts +0 -41
- package/ngcc/src/entry_point_finder/interface.d.ts +0 -14
- package/ngcc/src/entry_point_finder/program_based_entry_point_finder.d.ts +0 -61
- package/ngcc/src/entry_point_finder/targeted_entry_point_finder.d.ts +0 -95
- package/ngcc/src/entry_point_finder/tracing_entry_point_finder.d.ts +0 -67
- package/ngcc/src/entry_point_finder/utils.d.ts +0 -38
- package/ngcc/src/execution/analyze_entry_points.d.ts +0 -9
- package/ngcc/src/execution/api.d.ts +0 -27
- package/ngcc/src/execution/cluster/api.d.ts +0 -51
- package/ngcc/src/execution/cluster/executor.d.ts +0 -29
- package/ngcc/src/execution/cluster/master.d.ts +0 -57
- package/ngcc/src/execution/cluster/ngcc_cluster_worker.d.ts +0 -8
- package/ngcc/src/execution/cluster/package_json_updater.d.ts +0 -22
- package/ngcc/src/execution/cluster/utils.d.ts +0 -44
- package/ngcc/src/execution/cluster/worker.d.ts +0 -10
- package/ngcc/src/execution/create_compile_function.d.ts +0 -10
- package/ngcc/src/execution/single_process_executor.d.ts +0 -34
- package/ngcc/src/execution/tasks/api.d.ts +0 -141
- package/ngcc/src/execution/tasks/completion.d.ts +0 -41
- package/ngcc/src/execution/tasks/queues/base_task_queue.d.ts +0 -38
- package/ngcc/src/execution/tasks/queues/parallel_task_queue.d.ts +0 -27
- package/ngcc/src/execution/tasks/queues/serial_task_queue.d.ts +0 -16
- package/ngcc/src/execution/tasks/utils.d.ts +0 -57
- package/ngcc/src/host/commonjs_host.d.ts +0 -69
- package/ngcc/src/host/commonjs_umd_utils.d.ts +0 -146
- package/ngcc/src/host/delegating_host.d.ts +0 -43
- package/ngcc/src/host/esm2015_host.d.ts +0 -935
- package/ngcc/src/host/esm5_host.d.ts +0 -299
- package/ngcc/src/host/ngcc_host.d.ts +0 -87
- package/ngcc/src/host/umd_host.d.ts +0 -85
- package/ngcc/src/host/utils.d.ts +0 -9
- package/ngcc/src/locking/async_locker.d.ts +0 -34
- package/ngcc/src/locking/lock_file.d.ts +0 -31
- package/ngcc/src/locking/lock_file_with_child_process/index.d.ts +0 -44
- package/ngcc/src/locking/lock_file_with_child_process/ngcc_lock_unlocker.d.ts +0 -1
- package/ngcc/src/locking/lock_file_with_child_process/util.d.ts +0 -16
- package/ngcc/src/locking/sync_locker.d.ts +0 -35
- package/ngcc/src/main.d.ts +0 -17
- package/ngcc/src/migrations/migration.d.ts +0 -59
- package/ngcc/src/migrations/missing_injectable_migration.d.ts +0 -35
- package/ngcc/src/migrations/undecorated_child_migration.d.ts +0 -15
- package/ngcc/src/migrations/undecorated_parent_migration.d.ts +0 -51
- package/ngcc/src/migrations/utils.d.ts +0 -41
- package/ngcc/src/ngcc_options.d.ts +0 -155
- package/ngcc/src/packages/adjust_cjs_umd_exports.d.ts +0 -16
- package/ngcc/src/packages/build_marker.d.ts +0 -44
- package/ngcc/src/packages/bundle_program.d.ts +0 -35
- package/ngcc/src/packages/configuration.d.ts +0 -222
- package/ngcc/src/packages/entry_point.d.ts +0 -109
- package/ngcc/src/packages/entry_point_bundle.d.ts +0 -46
- package/ngcc/src/packages/entry_point_manifest.d.ts +0 -79
- package/ngcc/src/packages/ngcc_compiler_host.d.ts +0 -36
- package/ngcc/src/packages/patch_ts_expando_initializer.d.ts +0 -41
- package/ngcc/src/packages/source_file_cache.d.ts +0 -97
- package/ngcc/src/packages/transformer.d.ts +0 -70
- package/ngcc/src/path_mappings.d.ts +0 -19
- package/ngcc/src/rendering/commonjs_rendering_formatter.d.ts +0 -34
- package/ngcc/src/rendering/dts_renderer.d.ts +0 -51
- package/ngcc/src/rendering/esm5_rendering_formatter.d.ts +0 -35
- package/ngcc/src/rendering/esm_rendering_formatter.d.ts +0 -84
- package/ngcc/src/rendering/ngcc_import_rewriter.d.ts +0 -13
- package/ngcc/src/rendering/renderer.d.ts +0 -72
- package/ngcc/src/rendering/rendering_formatter.d.ts +0 -37
- package/ngcc/src/rendering/source_maps.d.ts +0 -23
- package/ngcc/src/rendering/umd_rendering_formatter.d.ts +0 -54
- package/ngcc/src/rendering/utils.d.ts +0 -24
- package/ngcc/src/utils.d.ts +0 -112
- package/ngcc/src/writing/cleaning/cleaning_strategies.d.ts +0 -44
- package/ngcc/src/writing/cleaning/package_cleaner.d.ts +0 -38
- package/ngcc/src/writing/cleaning/utils.d.ts +0 -15
- package/ngcc/src/writing/file_writer.d.ts +0 -28
- package/ngcc/src/writing/in_place_file_writer.d.ts +0 -28
- package/ngcc/src/writing/new_entry_point_file_writer.d.ts +0 -48
- package/ngcc/src/writing/package_json_updater.d.ts +0 -98
- package/src/ngtsc/shims/src/factory_generator.d.ts +0 -24
- package/src/ngtsc/shims/src/summary_generator.d.ts +0 -15
- /package/bundles/{chunk-P6SWFK2U.js.map → chunk-4TCRZYAK.js.map} +0 -0
- /package/bundles/{chunk-NJMZRTB6.js.map → chunk-54RHUHYB.js.map} +0 -0
- /package/bundles/{chunk-2PLRZDNU.js.map → chunk-6CARGXRJ.js.map} +0 -0
- /package/bundles/{chunk-6ZJFIQBG.js.map → chunk-GYHDNUIK.js.map} +0 -0
- /package/bundles/{chunk-J3L7WZP3.js.map → chunk-JHMH3CX2.js.map} +0 -0
- /package/bundles/{chunk-QRHWLC7U.js.map → chunk-PSGRCFPQ.js.map} +0 -0
|
@@ -1,59 +0,0 @@
|
|
|
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.io/license
|
|
7
|
-
*/
|
|
8
|
-
import ts from 'typescript';
|
|
9
|
-
import { MetadataReader } from '../../../src/ngtsc/metadata';
|
|
10
|
-
import { PartialEvaluator } from '../../../src/ngtsc/partial_evaluator';
|
|
11
|
-
import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
|
|
12
|
-
import { HandlerFlags } from '../../../src/ngtsc/transform';
|
|
13
|
-
import { NgccReflectionHost } from '../host/ngcc_host';
|
|
14
|
-
/**
|
|
15
|
-
* Implement this interface and add it to the `DecorationAnalyzer.migrations` collection to get ngcc
|
|
16
|
-
* to modify the analysis of the decorators in the program in order to migrate older code to work
|
|
17
|
-
* with Ivy.
|
|
18
|
-
*
|
|
19
|
-
* `Migration.apply()` is called for every class in the program being compiled by ngcc.
|
|
20
|
-
*
|
|
21
|
-
* Note that the underlying program could be in a variety of different formats, e.g. ES2015, ES5,
|
|
22
|
-
* UMD, CommonJS etc. This means that an author of a `Migration` should not attempt to navigate and
|
|
23
|
-
* manipulate the AST nodes directly. Instead, the `MigrationHost` interface, passed to the
|
|
24
|
-
* `Migration`, provides access to a `MetadataReader`, `ReflectionHost` and `PartialEvaluator`
|
|
25
|
-
* interfaces, which should be used.
|
|
26
|
-
*/
|
|
27
|
-
export interface Migration {
|
|
28
|
-
apply(clazz: ClassDeclaration, host: MigrationHost): ts.Diagnostic | null;
|
|
29
|
-
}
|
|
30
|
-
export interface MigrationHost {
|
|
31
|
-
/** Provides access to the decorator information associated with classes. */
|
|
32
|
-
readonly metadata: MetadataReader;
|
|
33
|
-
/** Provides access to navigate the AST in a format-agnostic manner. */
|
|
34
|
-
readonly reflectionHost: NgccReflectionHost;
|
|
35
|
-
/** Enables expressions to be statically evaluated in the context of the program. */
|
|
36
|
-
readonly evaluator: PartialEvaluator;
|
|
37
|
-
/**
|
|
38
|
-
* Associate a new synthesized decorator, which did not appear in the original source, with a
|
|
39
|
-
* given class.
|
|
40
|
-
* @param clazz the class to receive the new decorator.
|
|
41
|
-
* @param decorator the decorator to inject.
|
|
42
|
-
* @param flags optional bitwise flag to influence the compilation of the decorator.
|
|
43
|
-
*/
|
|
44
|
-
injectSyntheticDecorator(clazz: ClassDeclaration, decorator: Decorator, flags?: HandlerFlags): void;
|
|
45
|
-
/**
|
|
46
|
-
* Retrieves all decorators that are associated with the class, including synthetic decorators
|
|
47
|
-
* that have been injected before.
|
|
48
|
-
* @param clazz the class for which all decorators are retrieved.
|
|
49
|
-
* @returns the list of the decorators, or null if the class was not decorated.
|
|
50
|
-
*/
|
|
51
|
-
getAllDecorators(clazz: ClassDeclaration): Decorator[] | null;
|
|
52
|
-
/**
|
|
53
|
-
* Determines whether the provided class in within scope of the entry-point that is currently
|
|
54
|
-
* being compiled.
|
|
55
|
-
* @param clazz the class for which to determine whether it is within the current entry-point.
|
|
56
|
-
* @returns true if the file is part of the compiled entry-point, false otherwise.
|
|
57
|
-
*/
|
|
58
|
-
isInScope(clazz: ClassDeclaration): boolean;
|
|
59
|
-
}
|
|
@@ -1,35 +0,0 @@
|
|
|
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.io/license
|
|
7
|
-
*/
|
|
8
|
-
import ts from 'typescript';
|
|
9
|
-
import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
|
|
10
|
-
import { Migration, MigrationHost } from './migration';
|
|
11
|
-
/**
|
|
12
|
-
* Ensures that classes that are provided as an Angular service in either `NgModule.providers` or
|
|
13
|
-
* `Directive.providers`/`Component.viewProviders` are decorated with one of the `@Injectable`,
|
|
14
|
-
* `@Directive`, `@Component` or `@Pipe` decorators, adding an `@Injectable()` decorator when none
|
|
15
|
-
* are present.
|
|
16
|
-
*
|
|
17
|
-
* At least one decorator is now mandatory, as otherwise the compiler would not compile an
|
|
18
|
-
* injectable definition for the service. This is unlike View Engine, where having just an unrelated
|
|
19
|
-
* decorator may have been sufficient for the service to become injectable.
|
|
20
|
-
*
|
|
21
|
-
* In essence, this migration operates on classes that are themselves an NgModule, Directive or
|
|
22
|
-
* Component. Their metadata is statically evaluated so that their "providers"/"viewProviders"
|
|
23
|
-
* properties can be analyzed. For any provider that refers to an undecorated class, the class will
|
|
24
|
-
* be migrated to have an `@Injectable()` decorator.
|
|
25
|
-
*
|
|
26
|
-
* This implementation mirrors the "missing-injectable" schematic.
|
|
27
|
-
*/
|
|
28
|
-
export declare class MissingInjectableMigration implements Migration {
|
|
29
|
-
apply(clazz: ClassDeclaration, host: MigrationHost): ts.Diagnostic | null;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Determines the original name of a decorator if it is from '@angular/core'. For other decorators,
|
|
33
|
-
* null is returned.
|
|
34
|
-
*/
|
|
35
|
-
export declare function getAngularCoreDecoratorName(decorator: Decorator): string | null;
|
|
@@ -1,15 +0,0 @@
|
|
|
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.io/license
|
|
7
|
-
*/
|
|
8
|
-
import ts from 'typescript';
|
|
9
|
-
import { Reference } from '../../../src/ngtsc/imports';
|
|
10
|
-
import { ClassDeclaration } from '../../../src/ngtsc/reflection';
|
|
11
|
-
import { Migration, MigrationHost } from './migration';
|
|
12
|
-
export declare class UndecoratedChildMigration implements Migration {
|
|
13
|
-
apply(clazz: ClassDeclaration, host: MigrationHost): ts.Diagnostic | null;
|
|
14
|
-
maybeMigrate(ref: Reference<ClassDeclaration>, host: MigrationHost): void;
|
|
15
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
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.io/license
|
|
7
|
-
*/
|
|
8
|
-
import ts from 'typescript';
|
|
9
|
-
import { ClassDeclaration } from '../../../src/ngtsc/reflection';
|
|
10
|
-
import { Migration, MigrationHost } from './migration';
|
|
11
|
-
/**
|
|
12
|
-
* Ensure that the parents of directives and components that have no constructor are also decorated
|
|
13
|
-
* as a `Directive`.
|
|
14
|
-
*
|
|
15
|
-
* Example:
|
|
16
|
-
*
|
|
17
|
-
* ```
|
|
18
|
-
* export class BasePlain {
|
|
19
|
-
* constructor(private vcr: ViewContainerRef) {}
|
|
20
|
-
* }
|
|
21
|
-
*
|
|
22
|
-
* @Directive({selector: '[blah]'})
|
|
23
|
-
* export class DerivedDir extends BasePlain {}
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* When compiling `DerivedDir` which extends the undecorated `BasePlain` class, the compiler needs
|
|
27
|
-
* to generate a directive def (`ɵdir`) for `DerivedDir`. In particular, it needs to generate a
|
|
28
|
-
* factory function that creates instances of `DerivedDir`.
|
|
29
|
-
*
|
|
30
|
-
* As `DerivedDir` has no constructor, the factory function for `DerivedDir` must delegate to the
|
|
31
|
-
* factory function for `BasePlain`. But for this to work, `BasePlain` must have a factory function,
|
|
32
|
-
* itself.
|
|
33
|
-
*
|
|
34
|
-
* This migration adds a `Directive` decorator to such undecorated parent classes, to ensure that
|
|
35
|
-
* the compiler will create the necessary factory function.
|
|
36
|
-
*
|
|
37
|
-
* The resulting code looks like:
|
|
38
|
-
*
|
|
39
|
-
* ```
|
|
40
|
-
* @Directive()
|
|
41
|
-
* export class BasePlain {
|
|
42
|
-
* constructor(private vcr: ViewContainerRef) {}
|
|
43
|
-
* }
|
|
44
|
-
*
|
|
45
|
-
* @Directive({selector: '[blah]'})
|
|
46
|
-
* export class DerivedDir extends BasePlain {}
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
export declare class UndecoratedParentMigration implements Migration {
|
|
50
|
-
apply(clazz: ClassDeclaration, host: MigrationHost): ts.Diagnostic | null;
|
|
51
|
-
}
|
|
@@ -1,41 +0,0 @@
|
|
|
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.io/license
|
|
7
|
-
*/
|
|
8
|
-
import ts from 'typescript';
|
|
9
|
-
import { ClassDeclaration, Decorator } from '../../../src/ngtsc/reflection';
|
|
10
|
-
import { MigrationHost } from './migration';
|
|
11
|
-
export declare function isClassDeclaration(clazz: ts.Node): clazz is ClassDeclaration<ts.Declaration>;
|
|
12
|
-
/**
|
|
13
|
-
* Returns true if the `clazz` is decorated as a `Directive` or `Component`.
|
|
14
|
-
*/
|
|
15
|
-
export declare function hasDirectiveDecorator(host: MigrationHost, clazz: ClassDeclaration): boolean;
|
|
16
|
-
/**
|
|
17
|
-
* Returns true if the `clazz` is decorated as a `Pipe`.
|
|
18
|
-
*/
|
|
19
|
-
export declare function hasPipeDecorator(host: MigrationHost, clazz: ClassDeclaration): boolean;
|
|
20
|
-
/**
|
|
21
|
-
* Returns true if the `clazz` has its own constructor function.
|
|
22
|
-
*/
|
|
23
|
-
export declare function hasConstructor(host: MigrationHost, clazz: ClassDeclaration): boolean;
|
|
24
|
-
/**
|
|
25
|
-
* Create an empty `Directive` decorator that will be associated with the `clazz`.
|
|
26
|
-
*/
|
|
27
|
-
export declare function createDirectiveDecorator(clazz: ClassDeclaration, metadata?: {
|
|
28
|
-
selector: string | null;
|
|
29
|
-
exportAs: string[] | null;
|
|
30
|
-
}): Decorator;
|
|
31
|
-
/**
|
|
32
|
-
* Create an empty `Component` decorator that will be associated with the `clazz`.
|
|
33
|
-
*/
|
|
34
|
-
export declare function createComponentDecorator(clazz: ClassDeclaration, metadata: {
|
|
35
|
-
selector: string | null;
|
|
36
|
-
exportAs: string[] | null;
|
|
37
|
-
}): Decorator;
|
|
38
|
-
/**
|
|
39
|
-
* Create an empty `Injectable` decorator that will be associated with the `clazz`.
|
|
40
|
-
*/
|
|
41
|
-
export declare function createInjectableDecorator(clazz: ClassDeclaration): Decorator;
|
|
@@ -1,155 +0,0 @@
|
|
|
1
|
-
import { AbsoluteFsPath, FileSystem } from '../../src/ngtsc/file_system';
|
|
2
|
-
import { Logger } from '../../src/ngtsc/logging';
|
|
3
|
-
import { ParsedConfiguration } from '../../src/perform_compile';
|
|
4
|
-
import { PathMappings } from './path_mappings';
|
|
5
|
-
import { FileWriter } from './writing/file_writer';
|
|
6
|
-
import { PackageJsonUpdater } from './writing/package_json_updater';
|
|
7
|
-
/**
|
|
8
|
-
* The options to configure the ngcc compiler for synchronous execution.
|
|
9
|
-
*/
|
|
10
|
-
export interface SyncNgccOptions {
|
|
11
|
-
/** The absolute path to the `node_modules` folder that contains the packages to process. */
|
|
12
|
-
basePath: string;
|
|
13
|
-
/**
|
|
14
|
-
* The path to the primary package to be processed. If not absolute then it must be relative to
|
|
15
|
-
* `basePath`.
|
|
16
|
-
*
|
|
17
|
-
* All its dependencies will need to be processed too.
|
|
18
|
-
*
|
|
19
|
-
* If this property is provided then `errorOnFailedEntryPoint` is forced to true.
|
|
20
|
-
*/
|
|
21
|
-
targetEntryPointPath?: string;
|
|
22
|
-
/**
|
|
23
|
-
* Which entry-point properties in the package.json to consider when processing an entry-point.
|
|
24
|
-
* Each property should hold a path to the particular bundle format for the entry-point.
|
|
25
|
-
* Defaults to all the properties in the package.json.
|
|
26
|
-
*/
|
|
27
|
-
propertiesToConsider?: string[];
|
|
28
|
-
/**
|
|
29
|
-
* Whether to only process the typings files for this entry-point.
|
|
30
|
-
*
|
|
31
|
-
* This is useful when running ngcc only to provide typings files to downstream tooling such as
|
|
32
|
-
* the Angular Language Service or ng-packagr. Defaults to `false`.
|
|
33
|
-
*
|
|
34
|
-
* If this is set to `true` then `compileAllFormats` is forced to `false`.
|
|
35
|
-
*/
|
|
36
|
-
typingsOnly?: boolean;
|
|
37
|
-
/**
|
|
38
|
-
* Whether to process all formats specified by (`propertiesToConsider`) or to stop processing
|
|
39
|
-
* this entry-point at the first matching format.
|
|
40
|
-
*
|
|
41
|
-
* Defaults to `true`, but is forced to `false` if `typingsOnly` is `true`.
|
|
42
|
-
*/
|
|
43
|
-
compileAllFormats?: boolean;
|
|
44
|
-
/**
|
|
45
|
-
* Whether to create new entry-points bundles rather than overwriting the original files.
|
|
46
|
-
*/
|
|
47
|
-
createNewEntryPointFormats?: boolean;
|
|
48
|
-
/**
|
|
49
|
-
* Provide a logger that will be called with log messages.
|
|
50
|
-
*/
|
|
51
|
-
logger?: Logger;
|
|
52
|
-
/**
|
|
53
|
-
* Paths mapping configuration (`paths` and `baseUrl`), as found in `ts.CompilerOptions`.
|
|
54
|
-
* These are used to resolve paths to locally built Angular libraries.
|
|
55
|
-
*
|
|
56
|
-
* Note that `pathMappings` specified here take precedence over any `pathMappings` loaded from a
|
|
57
|
-
* TS config file.
|
|
58
|
-
*/
|
|
59
|
-
pathMappings?: PathMappings;
|
|
60
|
-
/**
|
|
61
|
-
* Provide a file-system service that will be used by ngcc for all file interactions.
|
|
62
|
-
*/
|
|
63
|
-
fileSystem?: FileSystem;
|
|
64
|
-
/**
|
|
65
|
-
* Whether the compilation should run and return asynchronously. Allowing asynchronous execution
|
|
66
|
-
* may speed up the compilation by utilizing multiple CPU cores (if available).
|
|
67
|
-
*
|
|
68
|
-
* Default: `false` (i.e. run synchronously)
|
|
69
|
-
*/
|
|
70
|
-
async?: false;
|
|
71
|
-
/**
|
|
72
|
-
* Set to true in order to terminate immediately with an error code if an entry-point fails to be
|
|
73
|
-
* processed.
|
|
74
|
-
*
|
|
75
|
-
* If `targetEntryPointPath` is provided then this property is always true and cannot be
|
|
76
|
-
* changed. Otherwise the default is false.
|
|
77
|
-
*
|
|
78
|
-
* When set to false, ngcc will continue to process entry-points after a failure. In which case it
|
|
79
|
-
* will log an error and resume processing other entry-points.
|
|
80
|
-
*/
|
|
81
|
-
errorOnFailedEntryPoint?: boolean;
|
|
82
|
-
/**
|
|
83
|
-
* Render `$localize` messages with legacy format ids.
|
|
84
|
-
*
|
|
85
|
-
* The default value is `true`. Only set this to `false` if you do not want legacy message ids to
|
|
86
|
-
* be rendered. For example, if you are not using legacy message ids in your translation files
|
|
87
|
-
* AND are not doing compile-time inlining of translations, in which case the extra message ids
|
|
88
|
-
* would add unwanted size to the final source bundle.
|
|
89
|
-
*
|
|
90
|
-
* It is safe to leave this set to true if you are doing compile-time inlining because the extra
|
|
91
|
-
* legacy message ids will all be stripped during translation.
|
|
92
|
-
*/
|
|
93
|
-
enableI18nLegacyMessageIdFormat?: boolean;
|
|
94
|
-
/**
|
|
95
|
-
* Whether to invalidate any entry-point manifest file that is on disk. Instead, walk the
|
|
96
|
-
* directory tree looking for entry-points, and then write a new entry-point manifest, if
|
|
97
|
-
* possible.
|
|
98
|
-
*
|
|
99
|
-
* Default: `false` (i.e. the manifest will be used if available)
|
|
100
|
-
*/
|
|
101
|
-
invalidateEntryPointManifest?: boolean;
|
|
102
|
-
/**
|
|
103
|
-
* An absolute path to a TS config file (e.g. `tsconfig.json`) or a directory containing one, that
|
|
104
|
-
* will be used to configure module resolution with things like path mappings, if not specified
|
|
105
|
-
* explicitly via the `pathMappings` property to `mainNgcc`.
|
|
106
|
-
*
|
|
107
|
-
* If `undefined`, ngcc will attempt to load a `tsconfig.json` file from the directory above the
|
|
108
|
-
* `basePath`.
|
|
109
|
-
*
|
|
110
|
-
* If `null`, ngcc will not attempt to load any TS config file at all.
|
|
111
|
-
*/
|
|
112
|
-
tsConfigPath?: string | null;
|
|
113
|
-
/**
|
|
114
|
-
* Use the program defined in the loaded tsconfig.json (if available - see
|
|
115
|
-
* `tsConfigPath` option) to identify the entry-points that should be processed.
|
|
116
|
-
* If this is set to `true` then only the entry-points reachable from the given
|
|
117
|
-
* program (and their dependencies) will be processed.
|
|
118
|
-
*/
|
|
119
|
-
findEntryPointsFromTsConfigProgram?: boolean;
|
|
120
|
-
}
|
|
121
|
-
/**
|
|
122
|
-
* The options to configure the ngcc compiler for asynchronous execution.
|
|
123
|
-
*/
|
|
124
|
-
export type AsyncNgccOptions = Omit<SyncNgccOptions, 'async'> & {
|
|
125
|
-
async: true;
|
|
126
|
-
};
|
|
127
|
-
/**
|
|
128
|
-
* The options to configure the ngcc compiler.
|
|
129
|
-
*/
|
|
130
|
-
export type NgccOptions = AsyncNgccOptions | SyncNgccOptions;
|
|
131
|
-
export type OptionalNgccOptionKeys = 'targetEntryPointPath' | 'tsConfigPath' | 'pathMappings' | 'findEntryPointsFromTsConfigProgram';
|
|
132
|
-
export type RequiredNgccOptions = Required<Omit<NgccOptions, OptionalNgccOptionKeys>>;
|
|
133
|
-
export type OptionalNgccOptions = Pick<NgccOptions, OptionalNgccOptionKeys>;
|
|
134
|
-
export type SharedSetup = {
|
|
135
|
-
fileSystem: FileSystem;
|
|
136
|
-
absBasePath: AbsoluteFsPath;
|
|
137
|
-
projectPath: AbsoluteFsPath;
|
|
138
|
-
tsConfig: ParsedConfiguration | null;
|
|
139
|
-
getFileWriter(pkgJsonUpdater: PackageJsonUpdater): FileWriter;
|
|
140
|
-
};
|
|
141
|
-
/**
|
|
142
|
-
* Instantiate common utilities that are always used and fix up options with defaults, as necessary.
|
|
143
|
-
*
|
|
144
|
-
* NOTE: Avoid eagerly instantiating anything that might not be used when running sync/async.
|
|
145
|
-
*/
|
|
146
|
-
export declare function getSharedSetup(options: NgccOptions): SharedSetup & RequiredNgccOptions & OptionalNgccOptions;
|
|
147
|
-
export declare function clearTsConfigCache(): void;
|
|
148
|
-
/**
|
|
149
|
-
* Determines the maximum number of workers to use for parallel execution. This can be set using the
|
|
150
|
-
* NGCC_MAX_WORKERS environment variable, or is computed based on the number of available CPUs. One
|
|
151
|
-
* CPU core is always reserved for the master process, so we take the number of CPUs minus one, with
|
|
152
|
-
* a maximum of 4 workers. We don't scale the number of workers beyond 4 by default, as it takes
|
|
153
|
-
* considerably more memory and CPU cycles while not offering a substantial improvement in time.
|
|
154
|
-
*/
|
|
155
|
-
export declare function getMaxNumberOfWorkers(): number;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* UMD/CJS bundles generated by Rollup may be using an element access expression like
|
|
3
|
-
* `exports["ɵa"]` for declaring and exporting classes, instead of a property access like
|
|
4
|
-
* `exports.ɵa`. The element access syntax introduces a problem for ngcc, where it wouldn't consider
|
|
5
|
-
* such export as class declaration, causing them to be skipped. The ngtsc compiler is implemented
|
|
6
|
-
* with the assumption that all class declarations use a `ts.Identifier` as name, whereas the
|
|
7
|
-
* element access is using a string literal for the declared name. This makes it troublesome for
|
|
8
|
-
* ngcc to support this syntax form in UMD bundles.
|
|
9
|
-
*
|
|
10
|
-
* To work around the problem, this function transforms these access expressions into regular
|
|
11
|
-
* property accesses. The source text is parsed to an AST to allow finding the element accesses in a
|
|
12
|
-
* robust way, after which the affected text ranges are replaced with property accesses in the
|
|
13
|
-
* original source text. These replacement operations are faster than applying an AST transform and
|
|
14
|
-
* going through a `ts.Printer` to print the text back out.
|
|
15
|
-
*/
|
|
16
|
-
export declare function adjustElementAccessExports(sourceText: string): string;
|
|
@@ -1,44 +0,0 @@
|
|
|
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.io/license
|
|
7
|
-
*/
|
|
8
|
-
import { AbsoluteFsPath } from '../../../src/ngtsc/file_system';
|
|
9
|
-
import { PackageJsonUpdater } from '../writing/package_json_updater';
|
|
10
|
-
import { EntryPointPackageJson, PackageJsonFormatProperties } from './entry_point';
|
|
11
|
-
export declare const NGCC_VERSION = "15.2.0";
|
|
12
|
-
/**
|
|
13
|
-
* Returns true if there is a format in this entry-point that was compiled with an outdated version
|
|
14
|
-
* of ngcc.
|
|
15
|
-
*
|
|
16
|
-
* @param packageJson The parsed contents of the package.json for the entry-point
|
|
17
|
-
*/
|
|
18
|
-
export declare function needsCleaning(packageJson: EntryPointPackageJson): boolean;
|
|
19
|
-
/**
|
|
20
|
-
* Clean any build marker artifacts from the given `packageJson` object.
|
|
21
|
-
* @param packageJson The parsed contents of the package.json to modify
|
|
22
|
-
* @returns true if the package was modified during cleaning
|
|
23
|
-
*/
|
|
24
|
-
export declare function cleanPackageJson(packageJson: EntryPointPackageJson): boolean;
|
|
25
|
-
/**
|
|
26
|
-
* Check whether ngcc has already processed a given entry-point format.
|
|
27
|
-
*
|
|
28
|
-
* @param packageJson The parsed contents of the package.json file for the entry-point.
|
|
29
|
-
* @param format The entry-point format property in the package.json to check.
|
|
30
|
-
* @returns true if the `format` in the entry-point has already been processed by this ngcc version,
|
|
31
|
-
* false otherwise.
|
|
32
|
-
*/
|
|
33
|
-
export declare function hasBeenProcessed(packageJson: EntryPointPackageJson, format: PackageJsonFormatProperties): boolean;
|
|
34
|
-
/**
|
|
35
|
-
* Write a build marker for the given entry-point and format properties, to indicate that they have
|
|
36
|
-
* been compiled by this version of ngcc.
|
|
37
|
-
*
|
|
38
|
-
* @param pkgJsonUpdater The writer to use for updating `package.json`.
|
|
39
|
-
* @param packageJson The parsed contents of the `package.json` file for the entry-point.
|
|
40
|
-
* @param packageJsonPath The absolute path to the `package.json` file.
|
|
41
|
-
* @param properties The properties in the `package.json` of the formats for which we are writing
|
|
42
|
-
* the marker.
|
|
43
|
-
*/
|
|
44
|
-
export declare function markAsProcessed(pkgJsonUpdater: PackageJsonUpdater, packageJson: EntryPointPackageJson, packageJsonPath: AbsoluteFsPath, formatProperties: PackageJsonFormatProperties[]): void;
|
|
@@ -1,35 +0,0 @@
|
|
|
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.io/license
|
|
7
|
-
*/
|
|
8
|
-
import ts from 'typescript';
|
|
9
|
-
import { AbsoluteFsPath, ReadonlyFileSystem } from '../../../src/ngtsc/file_system';
|
|
10
|
-
/**
|
|
11
|
-
* An entry point bundle contains one or two programs, e.g. `src` and `dts`,
|
|
12
|
-
* that are compiled via TypeScript.
|
|
13
|
-
*
|
|
14
|
-
* To aid with processing the program, this interface exposes the program itself,
|
|
15
|
-
* as well as path and TS file of the entry-point to the program and the r3Symbols
|
|
16
|
-
* file, if appropriate.
|
|
17
|
-
*/
|
|
18
|
-
export interface BundleProgram {
|
|
19
|
-
program: ts.Program;
|
|
20
|
-
options: ts.CompilerOptions;
|
|
21
|
-
host: ts.CompilerHost;
|
|
22
|
-
path: AbsoluteFsPath;
|
|
23
|
-
file: ts.SourceFile;
|
|
24
|
-
package: AbsoluteFsPath;
|
|
25
|
-
r3SymbolsPath: AbsoluteFsPath | null;
|
|
26
|
-
r3SymbolsFile: ts.SourceFile | null;
|
|
27
|
-
}
|
|
28
|
-
/**
|
|
29
|
-
* Create a bundle program.
|
|
30
|
-
*/
|
|
31
|
-
export declare function makeBundleProgram(fs: ReadonlyFileSystem, isCore: boolean, pkg: AbsoluteFsPath, path: AbsoluteFsPath, r3FileName: string, options: ts.CompilerOptions, host: ts.CompilerHost, additionalFiles?: AbsoluteFsPath[]): BundleProgram;
|
|
32
|
-
/**
|
|
33
|
-
* Search the given directory hierarchy to find the path to the `r3_symbols` file.
|
|
34
|
-
*/
|
|
35
|
-
export declare function findR3SymbolsPath(fs: ReadonlyFileSystem, directory: AbsoluteFsPath, filename: string): AbsoluteFsPath | null;
|