@angular/core 13.0.0-rc.1 → 13.0.0-rc.2

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 (163) hide show
  1. package/core.d.ts +1 -1
  2. package/esm2020/index.mjs +6 -5
  3. package/esm2020/src/render3/error_code.mjs +2 -5
  4. package/esm2020/src/render3/error_details_base_url.mjs +16 -0
  5. package/esm2020/src/version.mjs +1 -1
  6. package/esm2020/testing/src/logger.mjs +3 -3
  7. package/esm2020/testing/src/ng_zone_mock.mjs +3 -3
  8. package/esm2020/testing/src/test_compiler.mjs +3 -3
  9. package/fesm2015/core.mjs +17 -5
  10. package/fesm2015/core.mjs.map +1 -1
  11. package/fesm2015/testing.mjs +4 -4
  12. package/fesm2020/core.mjs +17 -5
  13. package/fesm2020/core.mjs.map +1 -1
  14. package/fesm2020/testing.mjs +4 -4
  15. package/package.json +1 -1
  16. package/schematics/migrations.json +0 -100
  17. package/testing/testing.d.ts +1 -1
  18. package/schematics/migrations/abstract-control-parent/index.d.ts +0 -11
  19. package/schematics/migrations/abstract-control-parent/index.js +0 -69
  20. package/schematics/migrations/abstract-control-parent/util.d.ts +0 -14
  21. package/schematics/migrations/abstract-control-parent/util.js +0 -67
  22. package/schematics/migrations/activated-route-snapshot-fragment/index.d.ts +0 -13
  23. package/schematics/migrations/activated-route-snapshot-fragment/index.js +0 -73
  24. package/schematics/migrations/activated-route-snapshot-fragment/util.d.ts +0 -16
  25. package/schematics/migrations/activated-route-snapshot-fragment/util.js +0 -51
  26. package/schematics/migrations/can-activate-with-redirect-to/index.d.ts +0 -11
  27. package/schematics/migrations/can-activate-with-redirect-to/index.js +0 -69
  28. package/schematics/migrations/can-activate-with-redirect-to/util.d.ts +0 -11
  29. package/schematics/migrations/can-activate-with-redirect-to/util.js +0 -73
  30. package/schematics/migrations/deep-shadow-piercing-selector/index.d.ts +0 -10
  31. package/schematics/migrations/deep-shadow-piercing-selector/index.js +0 -49
  32. package/schematics/migrations/dynamic-queries/index.d.ts +0 -13
  33. package/schematics/migrations/dynamic-queries/index.js +0 -76
  34. package/schematics/migrations/dynamic-queries/util.d.ts +0 -25
  35. package/schematics/migrations/dynamic-queries/util.js +0 -84
  36. package/schematics/migrations/initial-navigation/collector.d.ts +0 -22
  37. package/schematics/migrations/initial-navigation/collector.js +0 -122
  38. package/schematics/migrations/initial-navigation/index.d.ts +0 -11
  39. package/schematics/migrations/initial-navigation/index.js +0 -83
  40. package/schematics/migrations/initial-navigation/transform.d.ts +0 -20
  41. package/schematics/migrations/initial-navigation/transform.js +0 -71
  42. package/schematics/migrations/initial-navigation/update_recorder.d.ts +0 -18
  43. package/schematics/migrations/initial-navigation/update_recorder.js +0 -20
  44. package/schematics/migrations/initial-navigation/util.d.ts +0 -12
  45. package/schematics/migrations/initial-navigation/util.js +0 -46
  46. package/schematics/migrations/missing-injectable/definition_collector.d.ts +0 -37
  47. package/schematics/migrations/missing-injectable/definition_collector.js +0 -92
  48. package/schematics/migrations/missing-injectable/index.d.ts +0 -11
  49. package/schematics/migrations/missing-injectable/index.js +0 -136
  50. package/schematics/migrations/missing-injectable/providers_evaluator.d.ts +0 -26
  51. package/schematics/migrations/missing-injectable/providers_evaluator.js +0 -71
  52. package/schematics/migrations/missing-injectable/transform.d.ts +0 -70
  53. package/schematics/migrations/missing-injectable/transform.js +0 -203
  54. package/schematics/migrations/missing-injectable/update_recorder.d.ts +0 -21
  55. package/schematics/migrations/missing-injectable/update_recorder.js +0 -20
  56. package/schematics/migrations/module-with-providers/collector.d.ts +0 -34
  57. package/schematics/migrations/module-with-providers/collector.js +0 -76
  58. package/schematics/migrations/module-with-providers/index.d.ts +0 -13
  59. package/schematics/migrations/module-with-providers/index.js +0 -107
  60. package/schematics/migrations/module-with-providers/transform.d.ts +0 -50
  61. package/schematics/migrations/module-with-providers/transform.js +0 -149
  62. package/schematics/migrations/module-with-providers/util.d.ts +0 -13
  63. package/schematics/migrations/module-with-providers/util.js +0 -43
  64. package/schematics/migrations/move-document/document_import_visitor.d.ts +0 -27
  65. package/schematics/migrations/move-document/document_import_visitor.js +0 -77
  66. package/schematics/migrations/move-document/index.d.ts +0 -11
  67. package/schematics/migrations/move-document/index.js +0 -93
  68. package/schematics/migrations/move-document/move-import.d.ts +0 -12
  69. package/schematics/migrations/move-document/move-import.js +0 -64
  70. package/schematics/migrations/native-view-encapsulation/index.d.ts +0 -11
  71. package/schematics/migrations/native-view-encapsulation/index.js +0 -63
  72. package/schematics/migrations/native-view-encapsulation/util.d.ts +0 -11
  73. package/schematics/migrations/native-view-encapsulation/util.js +0 -51
  74. package/schematics/migrations/navigation-extras-omissions/index.d.ts +0 -11
  75. package/schematics/migrations/navigation-extras-omissions/index.js +0 -72
  76. package/schematics/migrations/navigation-extras-omissions/util.d.ts +0 -11
  77. package/schematics/migrations/navigation-extras-omissions/util.js +0 -129
  78. package/schematics/migrations/relative-link-resolution/collector.d.ts +0 -22
  79. package/schematics/migrations/relative-link-resolution/collector.js +0 -98
  80. package/schematics/migrations/relative-link-resolution/index.d.ts +0 -11
  81. package/schematics/migrations/relative-link-resolution/index.js +0 -84
  82. package/schematics/migrations/relative-link-resolution/transform.d.ts +0 -22
  83. package/schematics/migrations/relative-link-resolution/transform.js +0 -68
  84. package/schematics/migrations/relative-link-resolution/update_recorder.d.ts +0 -18
  85. package/schematics/migrations/relative-link-resolution/update_recorder.js +0 -20
  86. package/schematics/migrations/relative-link-resolution/util.d.ts +0 -12
  87. package/schematics/migrations/relative-link-resolution/util.js +0 -46
  88. package/schematics/migrations/renderer-to-renderer2/helpers.d.ts +0 -25
  89. package/schematics/migrations/renderer-to-renderer2/helpers.js +0 -241
  90. package/schematics/migrations/renderer-to-renderer2/index.d.ts +0 -14
  91. package/schematics/migrations/renderer-to-renderer2/index.js +0 -138
  92. package/schematics/migrations/renderer-to-renderer2/migration.d.ts +0 -18
  93. package/schematics/migrations/renderer-to-renderer2/migration.js +0 -228
  94. package/schematics/migrations/renderer-to-renderer2/util.d.ts +0 -18
  95. package/schematics/migrations/renderer-to-renderer2/util.js +0 -86
  96. package/schematics/migrations/router-preserve-query-params/index.d.ts +0 -14
  97. package/schematics/migrations/router-preserve-query-params/index.js +0 -75
  98. package/schematics/migrations/router-preserve-query-params/util.d.ts +0 -11
  99. package/schematics/migrations/router-preserve-query-params/util.js +0 -106
  100. package/schematics/migrations/static-queries/angular/directive_inputs.d.ts +0 -11
  101. package/schematics/migrations/static-queries/angular/directive_inputs.js +0 -87
  102. package/schematics/migrations/static-queries/angular/ng_query_visitor.d.ts +0 -45
  103. package/schematics/migrations/static-queries/angular/ng_query_visitor.js +0 -130
  104. package/schematics/migrations/static-queries/angular/query-definition.d.ts +0 -37
  105. package/schematics/migrations/static-queries/angular/query-definition.js +0 -33
  106. package/schematics/migrations/static-queries/angular/super_class.d.ts +0 -15
  107. package/schematics/migrations/static-queries/angular/super_class.js +0 -35
  108. package/schematics/migrations/static-queries/index.d.ts +0 -11
  109. package/schematics/migrations/static-queries/index.js +0 -244
  110. package/schematics/migrations/static-queries/strategies/template_strategy/template_strategy.d.ts +0 -41
  111. package/schematics/migrations/static-queries/strategies/template_strategy/template_strategy.js +0 -210
  112. package/schematics/migrations/static-queries/strategies/test_strategy/test_strategy.d.ts +0 -24
  113. package/schematics/migrations/static-queries/strategies/test_strategy/test_strategy.js +0 -38
  114. package/schematics/migrations/static-queries/strategies/timing-strategy.d.ts +0 -19
  115. package/schematics/migrations/static-queries/strategies/timing-strategy.js +0 -20
  116. package/schematics/migrations/static-queries/strategies/usage_strategy/declaration_usage_visitor.d.ts +0 -82
  117. package/schematics/migrations/static-queries/strategies/usage_strategy/declaration_usage_visitor.js +0 -372
  118. package/schematics/migrations/static-queries/strategies/usage_strategy/super_class_context.d.ts +0 -18
  119. package/schematics/migrations/static-queries/strategies/usage_strategy/super_class_context.js +0 -55
  120. package/schematics/migrations/static-queries/strategies/usage_strategy/template_usage_visitor.d.ts +0 -27
  121. package/schematics/migrations/static-queries/strategies/usage_strategy/template_usage_visitor.js +0 -93
  122. package/schematics/migrations/static-queries/strategies/usage_strategy/usage_strategy.d.ts +0 -34
  123. package/schematics/migrations/static-queries/strategies/usage_strategy/usage_strategy.js +0 -172
  124. package/schematics/migrations/static-queries/transform.d.ts +0 -21
  125. package/schematics/migrations/static-queries/transform.js +0 -105
  126. package/schematics/migrations/template-var-assignment/analyze_template.d.ts +0 -20
  127. package/schematics/migrations/template-var-assignment/analyze_template.js +0 -38
  128. package/schematics/migrations/template-var-assignment/angular/html_variable_assignment_visitor.d.ts +0 -28
  129. package/schematics/migrations/template-var-assignment/angular/html_variable_assignment_visitor.js +0 -80
  130. package/schematics/migrations/template-var-assignment/index.d.ts +0 -11
  131. package/schematics/migrations/template-var-assignment/index.js +0 -101
  132. package/schematics/migrations/undecorated-classes-with-decorated-fields/index.d.ts +0 -14
  133. package/schematics/migrations/undecorated-classes-with-decorated-fields/index.js +0 -128
  134. package/schematics/migrations/undecorated-classes-with-decorated-fields/transform.d.ts +0 -64
  135. package/schematics/migrations/undecorated-classes-with-decorated-fields/transform.js +0 -302
  136. package/schematics/migrations/undecorated-classes-with-decorated-fields/update_recorder.d.ts +0 -19
  137. package/schematics/migrations/undecorated-classes-with-decorated-fields/update_recorder.js +0 -20
  138. package/schematics/migrations/undecorated-classes-with-di/create_ngc_program.d.ts +0 -18
  139. package/schematics/migrations/undecorated-classes-with-di/create_ngc_program.js +0 -56
  140. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/convert_directive_metadata.d.ts +0 -18
  141. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/convert_directive_metadata.js +0 -99
  142. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/decorator_rewriter.d.ts +0 -37
  143. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/decorator_rewriter.js +0 -118
  144. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/import_rewrite_visitor.d.ts +0 -37
  145. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/import_rewrite_visitor.js +0 -129
  146. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/path_format.d.ts +0 -10
  147. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/path_format.js +0 -31
  148. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/source_file_exports.d.ts +0 -16
  149. package/schematics/migrations/undecorated-classes-with-di/decorator_rewrite/source_file_exports.js +0 -68
  150. package/schematics/migrations/undecorated-classes-with-di/index.d.ts +0 -11
  151. package/schematics/migrations/undecorated-classes-with-di/index.js +0 -226
  152. package/schematics/migrations/undecorated-classes-with-di/ng_declaration_collector.d.ts +0 -38
  153. package/schematics/migrations/undecorated-classes-with-di/ng_declaration_collector.js +0 -135
  154. package/schematics/migrations/undecorated-classes-with-di/transform.d.ts +0 -97
  155. package/schematics/migrations/undecorated-classes-with-di/transform.js +0 -373
  156. package/schematics/migrations/undecorated-classes-with-di/update_recorder.d.ts +0 -20
  157. package/schematics/migrations/undecorated-classes-with-di/update_recorder.js +0 -20
  158. package/schematics/migrations/wait-for-async/index.d.ts +0 -11
  159. package/schematics/migrations/wait-for-async/index.js +0 -101
  160. package/schematics/migrations/wait-for-async/util.d.ts +0 -11
  161. package/schematics/migrations/wait-for-async/util.js +0 -40
  162. package/schematics/migrations/xhr-factory/index.d.ts +0 -10
  163. package/schematics/migrations/xhr-factory/index.js +0 -107
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.0.0-rc.1
2
+ * @license Angular v13.0.0-rc.2
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1927,9 +1927,9 @@ class TestingCompiler extends Compiler {
1927
1927
  throw unimplemented();
1928
1928
  }
1929
1929
  }
1930
- TestingCompiler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.1", ngImport: i0, type: TestingCompiler, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1931
- TestingCompiler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-rc.1", ngImport: i0, type: TestingCompiler });
1932
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.1", ngImport: i0, type: TestingCompiler, decorators: [{
1930
+ TestingCompiler.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "13.0.0-rc.2", ngImport: i0, type: TestingCompiler, deps: null, target: i0.ɵɵFactoryTarget.Injectable });
1931
+ TestingCompiler.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "13.0.0-rc.2", ngImport: i0, type: TestingCompiler });
1932
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "13.0.0-rc.2", ngImport: i0, type: TestingCompiler, decorators: [{
1933
1933
  type: Injectable
1934
1934
  }] });
1935
1935
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/core",
3
- "version": "13.0.0-rc.1",
3
+ "version": "13.0.0-rc.2",
4
4
  "description": "Angular - the core framework",
5
5
  "author": "angular",
6
6
  "license": "MIT",
@@ -1,105 +1,5 @@
1
1
  {
2
2
  "schematics": {
3
- "migration-v8-move-document": {
4
- "version": "8.0.0-beta",
5
- "description": "@DOCUMENT migration. Migrates DOCUMENT Injection token from platform-browser imports to common import.",
6
- "factory": "./migrations/move-document/index"
7
- },
8
- "migration-v8-static-queries": {
9
- "version": "8.0.0-beta",
10
- "description": "ViewChild and ContentChild to explicit query timing migration. In Angular version 8, developers need to explicitly specify the timing of ViewChild and ContentChild queries. Read more about this here: https://v8.angular.io/guide/static-query-migration",
11
- "factory": "./migrations/static-queries/index"
12
- },
13
- "migration-v8-template-local-variables": {
14
- "version": "8.0.0-beta",
15
- "description": "Template Variable Assignment migration. Warns developers if values are assigned to template variables.",
16
- "factory": "./migrations/template-var-assignment/index"
17
- },
18
- "migration-v9-renderer-to-renderer2": {
19
- "version": "9.0.0-beta",
20
- "description": "Renderer to Renderer2 migration. As of Angular 9, the Renderer class is no longer available. Renderer2 should be used instead. Read more about this here: https://v9.angular.io/guide/migration-renderer",
21
- "factory": "./migrations/renderer-to-renderer2/index"
22
- },
23
- "migration-v9-undecorated-classes-with-di": {
24
- "version": "9.0.0-beta",
25
- "description": "Undecorated classes with DI migration. As of Angular 9, it is no longer supported to use Angular DI on a class that does not have an Angular decorator. Read more about this here: https://v9.angular.io/guide/migration-undecorated-classes",
26
- "factory": "./migrations/undecorated-classes-with-di/index"
27
- },
28
- "migration-v9-dynamic-queries": {
29
- "version": "9-beta",
30
- "description": "Static flag migration. Removes the `static` flag from dynamic queries. As of Angular 9, the \"static\" flag defaults to false and is no longer required for your view and content queries. Read more about this here: https://v9.angular.io/guide/migration-dynamic-flag",
31
- "factory": "./migrations/dynamic-queries/index"
32
- },
33
- "migration-v10-missing-injectable": {
34
- "version": "10.0.0-beta",
35
- "description": "Missing @Injectable and incomplete provider definition migration. As of Angular 9, enforcement of @Injectable decorators for DI is a bit stricter and incomplete provider definitions behave differently. Read more about this here: https://v9.angular.io/guide/migration-injectable",
36
- "factory": "./migrations/missing-injectable/index"
37
- },
38
- "migration-v10-module-with-providers": {
39
- "version": "10.0.0-beta",
40
- "description": "ModuleWithProviders migration. As of Angular 10, the ModuleWithProviders type requires a generic. This migration adds the generic where it is missing. Read more about this here: https://v10.angular.io/guide/migration-module-with-providers",
41
- "factory": "./migrations/module-with-providers/index"
42
- },
43
- "migration-v10-undecorated-classes-with-decorated-fields": {
44
- "version": "10.0.0-beta",
45
- "description": "Undecorated classes with Angular features migration. In version 10, classes that use Angular features and do not have an Angular decorator are no longer supported. Read more about this here: https://v10.angular.io/guide/migration-undecorated-classes",
46
- "factory": "./migrations/undecorated-classes-with-decorated-fields/index"
47
- },
48
- "migration-v11-navigation-extras-omissions": {
49
- "version": "11.0.0-beta",
50
- "description": "NavigationExtras omissions migration. In version 11, some unsupported properties were omitted from the `extras` parameter of the `Router.navigateByUrl` and `Router.createUrlTree` methods.",
51
- "factory": "./migrations/navigation-extras-omissions/index"
52
- },
53
- "migration-v11-router-relative-link-resolution-default": {
54
- "version": "11.0.0-beta",
55
- "description": "The default value for `relativeLinkResolution` is changing from 'legacy' to 'corrected'.\nThis migration updates `RouterModule` configurations that use the default value to \nnow specifically use 'legacy' to prevent breakages when updating.",
56
- "factory": "./migrations/relative-link-resolution/index"
57
- },
58
- "migration-v11-abstract-control-parent": {
59
- "version": "11.0.0-beta",
60
- "description": "In Angular version 11, the type of `AbstractControl.parent` can be `null` to reflect the runtime value more accurately. This migration automatically adds non-null assertions to existing accesses of the `parent` property on types like `FormControl`, `FormArray` and `FormGroup`.",
61
- "factory": "./migrations/abstract-control-parent/index"
62
- },
63
- "migration-v11-native-view-encapsulation": {
64
- "version": "11.0.0-beta",
65
- "description": "ViewEncapsulation.Native has been removed as of Angular version 11. This migration replaces any usages with ViewEncapsulation.ShadowDom.",
66
- "factory": "./migrations/native-view-encapsulation/index"
67
- },
68
- "migration-v11-wait-for-async": {
69
- "version": "11.0.0-beta",
70
- "description": "`async` to `waitForAsync` migration. The `async` testing function has been renamed to `waitForAsync` to avoid confusion with the native `async` keyword.",
71
- "factory": "./migrations/wait-for-async/index"
72
- },
73
- "migration-v11-router-preserve-query-params": {
74
- "version": "11.0.0-beta",
75
- "description": "NavigationExtras.preserveQueryParams has been removed as of Angular version 11. This migration replaces any usages with the appropriate assignment of the queryParamsHandling key.",
76
- "factory": "./migrations/router-preserve-query-params/index"
77
- },
78
- "migration-v11-router-initial-navigation-options": {
79
- "version": "11.0.0-beta",
80
- "description": "Updates the `initialNavigation` property for `RouterModule.forRoot`.",
81
- "factory": "./migrations/initial-navigation/index"
82
- },
83
- "migration-v11.1-can-activate-with-redirect-to": {
84
- "version": "11.1.0-beta",
85
- "description": "Removes `canActivate` from a `Route` config when `redirectTo` is also present",
86
- "factory": "./migrations/can-activate-with-redirect-to/index"
87
- },
88
- "migration-v12-activated-route-snapshot-fragment": {
89
- "version": "12.0.0-beta",
90
- "description": "In Angular version 12, the type of ActivatedRouteSnapshot.fragment is nullable. This migration automatically adds non-null assertions to it.",
91
- "factory": "./migrations/activated-route-snapshot-fragment/index"
92
- },
93
- "migration-v12-xhr-factory": {
94
- "version": "12.0.0-next.6",
95
- "description": "`XhrFactory` has been moved from `@angular/common/http` to `@angular/common`.",
96
- "factory": "./migrations/xhr-factory/index"
97
- },
98
- "migration-v12-deep-shadow-piercing-selector": {
99
- "version": "12.0.2",
100
- "description": "Automatically migrates shadow-piercing selector from `/deep/` to the recommended alternative `::ng-deep`.",
101
- "factory": "./migrations/deep-shadow-piercing-selector/index"
102
- },
103
3
  "migration-v13-router-link-empty-expression": {
104
4
  "version": "13.0.0-beta",
105
5
  "description": "Migrates `[routerLink]=\"\"` in templates to `[routerLink]=\"[]\"` because these links are likely intended to route to the current page with updated fragment/query params.",
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @license Angular v13.0.0-rc.1
2
+ * @license Angular v13.0.0-rc.2
3
3
  * (c) 2010-2021 Google LLC. https://angular.io/
4
4
  * License: MIT
5
5
  */
@@ -1,11 +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
- /// <amd-module name="@angular/core/schematics/migrations/abstract-control-parent" />
9
- import { Rule } from '@angular-devkit/schematics';
10
- /** Migration that marks accesses of `AbstractControl.parent` as non-null. */
11
- export default function (): Rule;
@@ -1,69 +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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
- return new (P || (P = Promise))(function (resolve, reject) {
11
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
13
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14
- step((generator = generator.apply(thisArg, _arguments || [])).next());
15
- });
16
- };
17
- (function (factory) {
18
- if (typeof module === "object" && typeof module.exports === "object") {
19
- var v = factory(require, exports);
20
- if (v !== undefined) module.exports = v;
21
- }
22
- else if (typeof define === "function" && define.amd) {
23
- define("@angular/core/schematics/migrations/abstract-control-parent", ["require", "exports", "@angular-devkit/schematics", "path", "@angular/core/schematics/utils/project_tsconfig_paths", "@angular/core/schematics/utils/typescript/compiler_host", "@angular/core/schematics/migrations/abstract-control-parent/util"], factory);
24
- }
25
- })(function (require, exports) {
26
- "use strict";
27
- Object.defineProperty(exports, "__esModule", { value: true });
28
- const schematics_1 = require("@angular-devkit/schematics");
29
- const path_1 = require("path");
30
- const project_tsconfig_paths_1 = require("@angular/core/schematics/utils/project_tsconfig_paths");
31
- const compiler_host_1 = require("@angular/core/schematics/utils/typescript/compiler_host");
32
- const util_1 = require("@angular/core/schematics/migrations/abstract-control-parent/util");
33
- /** Migration that marks accesses of `AbstractControl.parent` as non-null. */
34
- function default_1() {
35
- return (tree) => __awaiter(this, void 0, void 0, function* () {
36
- const { buildPaths, testPaths } = yield (0, project_tsconfig_paths_1.getProjectTsConfigPaths)(tree);
37
- const basePath = process.cwd();
38
- const allPaths = [...buildPaths, ...testPaths];
39
- if (!allPaths.length) {
40
- throw new schematics_1.SchematicsException('Could not find any tsconfig file. Cannot migrate AbstractControl.parent accesses.');
41
- }
42
- for (const tsconfigPath of allPaths) {
43
- runNativeAbstractControlParentMigration(tree, tsconfigPath, basePath);
44
- }
45
- });
46
- }
47
- exports.default = default_1;
48
- function runNativeAbstractControlParentMigration(tree, tsconfigPath, basePath) {
49
- const { program } = (0, compiler_host_1.createMigrationProgram)(tree, tsconfigPath, basePath);
50
- const typeChecker = program.getTypeChecker();
51
- const sourceFiles = program.getSourceFiles().filter(sourceFile => (0, compiler_host_1.canMigrateFile)(basePath, sourceFile, program));
52
- sourceFiles.forEach(sourceFile => {
53
- // We sort the nodes based on their position in the file and we offset the positions by one
54
- // for each non-null assertion that we've added. We have to do it this way, rather than
55
- // creating and printing a new AST node like in other migrations, because property access
56
- // expressions can be nested (e.g. `control.parent.parent.value`), but the node positions
57
- // aren't being updated as we're inserting new code. If we were to go through the AST,
58
- // we'd have to update the `SourceFile` and start over after each operation.
59
- (0, util_1.findParentAccesses)(typeChecker, sourceFile)
60
- .sort((a, b) => a.getStart() - b.getStart())
61
- .forEach((node, index) => {
62
- const update = tree.beginUpdate((0, path_1.relative)(basePath, sourceFile.fileName));
63
- update.insertRight(node.getStart() + node.getWidth() + index, '!');
64
- tree.commitUpdate(update);
65
- });
66
- });
67
- }
68
- });
69
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NjaGVtYXRpY3MvbWlncmF0aW9ucy9hYnN0cmFjdC1jb250cm9sLXBhcmVudC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQUVILDJEQUEyRTtJQUMzRSwrQkFBOEI7SUFFOUIsa0dBQTJFO0lBQzNFLDJGQUE0RjtJQUM1RiwyRkFBMEM7SUFHMUMsNkVBQTZFO0lBQzdFO1FBQ0UsT0FBTyxDQUFPLElBQVUsRUFBRSxFQUFFO1lBQzFCLE1BQU0sRUFBQyxVQUFVLEVBQUUsU0FBUyxFQUFDLEdBQUcsTUFBTSxJQUFBLGdEQUF1QixFQUFDLElBQUksQ0FBQyxDQUFDO1lBQ3BFLE1BQU0sUUFBUSxHQUFHLE9BQU8sQ0FBQyxHQUFHLEVBQUUsQ0FBQzt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AvLyBhcmVuJ3QgYmVpbmcgdXBkYXRlZCBhcyB3ZSdyZSBpbnNlcnRpbmcgbmV3IGNvZGUuIElmIHdlIHdlcmUgdG8gZ28gdGhyb3VnaCB0aGUgQVNULFxuICAgIC8vIHdlJ2QgaGF2ZSB0byB1cGRhdGUgdGhlIGBTb3VyY2VGaWxlYCBhbmQgc3RhcnQgb3ZlciBhZnRlciBlYWNoIG9wZXJhdGlvbi5cbiAgICBmaW5kUGFyZW50QWNjZXNzZXModHlwZUNoZWNrZXIsIHNvdXJjZUZpbGUpXG4gICAgICAgIC5zb3J0KChhLCBiKSA9PiBhLmdldFN0YXJ0KCkgLSBiLmdldFN0YXJ0KCkpXG4gICAgICAgIC5mb3JFYWNoKChub2RlLCBpbmRleCkgPT4ge1xuICAgICAgICAgIGNvbnN0IHVwZGF0ZSA9IHRyZWUuYmVnaW5VcGRhdGUocmVsYXRpdmUoYmFzZVBhdGgsIHNvdXJjZUZpbGUuZmlsZU5hbWUpKTtcbiAgICAgICAgICB1cGRhdGUuaW5zZXJ0UmlnaHQobm9kZS5nZXRTdGFydCgpICsgbm9kZS5nZXRXaWR0aCgpICsgaW5kZXgsICchJyk7XG4gICAgICAgICAgdHJlZS5jb21taXRVcGRhdGUodXBkYXRlKTtcbiAgICAgICAgfSk7XG4gIH0pO1xufVxuIl19
@@ -1,14 +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
- /// <amd-module name="@angular/core/schematics/migrations/abstract-control-parent/util" />
9
- import ts from 'typescript';
10
- /**
11
- * Finds the `PropertyAccessExpression`-s that are accessing the `parent` property in
12
- * such a way that may result in a compilation error after the v11 type changes.
13
- */
14
- export declare function findParentAccesses(typeChecker: ts.TypeChecker, sourceFile: ts.SourceFile): ts.PropertyAccessExpression[];
@@ -1,67 +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
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- (function (factory) {
12
- if (typeof module === "object" && typeof module.exports === "object") {
13
- var v = factory(require, exports);
14
- if (v !== undefined) module.exports = v;
15
- }
16
- else if (typeof define === "function" && define.amd) {
17
- define("@angular/core/schematics/migrations/abstract-control-parent/util", ["require", "exports", "path", "typescript", "@angular/core/schematics/utils/typescript/nodes", "@angular/core/schematics/utils/typescript/symbol"], factory);
18
- }
19
- })(function (require, exports) {
20
- "use strict";
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.findParentAccesses = void 0;
23
- const path_1 = require("path");
24
- const typescript_1 = __importDefault(require("typescript"));
25
- const nodes_1 = require("@angular/core/schematics/utils/typescript/nodes");
26
- const symbol_1 = require("@angular/core/schematics/utils/typescript/symbol");
27
- /** Names of symbols from `@angular/forms` whose `parent` accesses have to be migrated. */
28
- const abstractControlSymbols = ['AbstractControl', 'FormArray', 'FormControl', 'FormGroup'];
29
- /**
30
- * Finds the `PropertyAccessExpression`-s that are accessing the `parent` property in
31
- * such a way that may result in a compilation error after the v11 type changes.
32
- */
33
- function findParentAccesses(typeChecker, sourceFile) {
34
- const results = [];
35
- sourceFile.forEachChild(function walk(node) {
36
- if (typescript_1.default.isPropertyAccessExpression(node) && node.name.text === 'parent' && !(0, nodes_1.isNullCheck)(node) &&
37
- !(0, nodes_1.isSafeAccess)(node) && results.indexOf(node) === -1 &&
38
- isAbstractControlReference(typeChecker, node) && (0, symbol_1.isNullableType)(typeChecker, node)) {
39
- results.unshift(node);
40
- }
41
- node.forEachChild(walk);
42
- });
43
- return results;
44
- }
45
- exports.findParentAccesses = findParentAccesses;
46
- /** Checks whether a property access is on an `AbstractControl` coming from `@angular/forms`. */
47
- function isAbstractControlReference(typeChecker, node) {
48
- var _a, _b;
49
- let current = node;
50
- const formsPattern = /node_modules\/?.*\/@angular\/forms/;
51
- // Walks up the property access chain and tries to find a symbol tied to a `SourceFile`.
52
- // If such a node is found, we check whether the type is one of the `AbstractControl` symbols
53
- // and whether it comes from the `@angular/forms` directory in the `node_modules`.
54
- while (typescript_1.default.isPropertyAccessExpression(current)) {
55
- const symbol = (_a = typeChecker.getTypeAtLocation(current.expression)) === null || _a === void 0 ? void 0 : _a.getSymbol();
56
- if (symbol) {
57
- const sourceFile = (_b = symbol.valueDeclaration) === null || _b === void 0 ? void 0 : _b.getSourceFile();
58
- return sourceFile != null &&
59
- formsPattern.test((0, path_1.normalize)(sourceFile.fileName).replace(/\\/g, '/')) &&
60
- (0, symbol_1.hasOneOfTypes)(typeChecker, current.expression, abstractControlSymbols);
61
- }
62
- current = current.expression;
63
- }
64
- return false;
65
- }
66
- });
67
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc2NoZW1hdGljcy9taWdyYXRpb25zL2Fic3RyYWN0LWNvbnRyb2wtcGFyZW50L3V0aWwudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7Ozs7O0lBRUgsK0JBQStCO0lBQy9CLDREQUE0QjtJQUM1QiwyRUFBdUU7SUFDdkUsNkVBQTRFO0lBRTVFLDBGQUEwRjtJQUMxRixNQUFNLHNCQUFzQixHQUFHLENBQUMsaUJBQWlCLEVBQUUsV0FBVyxFQUFFLGFBQWEsRUFBRSxXQUFXLENBQUMsQ0FBQztJQUU1Rjs7O09BR0c7SUFDSCxTQUFnQixrQkFBa0IsQ0FDOUIsV0FBMkIsRUFBRSxVQUF5QjtRQUN4RCxNQUFNLE9BQU8sR0FBa0MsRUFBRSxDQUF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lICh0cy5pc1Byb3BlcnR5QWNjZXNzRXhwcmVzc2lvbihjdXJyZW50KSkge1xuICAgIGNvbnN0IHN5bWJvbCA9IHR5cGVDaGVja2VyLmdldFR5cGVBdExvY2F0aW9uKGN1cnJlbnQuZXhwcmVzc2lvbik/LmdldFN5bWJvbCgpO1xuICAgIGlmIChzeW1ib2wpIHtcbiAgICAgIGNvbnN0IHNvdXJjZUZpbGUgPSBzeW1ib2wudmFsdWVEZWNsYXJhdGlvbj8uZ2V0U291cmNlRmlsZSgpO1xuICAgICAgcmV0dXJuIHNvdXJjZUZpbGUgIT0gbnVsbCAmJlxuICAgICAgICAgIGZvcm1zUGF0dGVybi50ZXN0KG5vcm1hbGl6ZShzb3VyY2VGaWxlLmZpbGVOYW1lKS5yZXBsYWNlKC9cXFxcL2csICcvJykpICYmXG4gICAgICAgICAgaGFzT25lT2ZUeXBlcyh0eXBlQ2hlY2tlciwgY3VycmVudC5leHByZXNzaW9uLCBhYnN0cmFjdENvbnRyb2xTeW1ib2xzKTtcbiAgICB9XG4gICAgY3VycmVudCA9IGN1cnJlbnQuZXhwcmVzc2lvbjtcbiAgfVxuICByZXR1cm4gZmFsc2U7XG59XG4iXX0=
@@ -1,13 +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
- /// <amd-module name="@angular/core/schematics/migrations/activated-route-snapshot-fragment" />
9
- import { Rule } from '@angular-devkit/schematics';
10
- /**
11
- * Migration that marks accesses of `ActivatedRouteSnapshot.fragment` as non-null.
12
- */
13
- export default function (): Rule;
@@ -1,73 +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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
- return new (P || (P = Promise))(function (resolve, reject) {
11
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
13
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14
- step((generator = generator.apply(thisArg, _arguments || [])).next());
15
- });
16
- };
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
19
- };
20
- (function (factory) {
21
- if (typeof module === "object" && typeof module.exports === "object") {
22
- var v = factory(require, exports);
23
- if (v !== undefined) module.exports = v;
24
- }
25
- else if (typeof define === "function" && define.amd) {
26
- define("@angular/core/schematics/migrations/activated-route-snapshot-fragment", ["require", "exports", "@angular-devkit/schematics", "path", "typescript", "@angular/core/schematics/utils/project_tsconfig_paths", "@angular/core/schematics/utils/typescript/compiler_host", "@angular/core/schematics/migrations/activated-route-snapshot-fragment/util"], factory);
27
- }
28
- })(function (require, exports) {
29
- "use strict";
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- const schematics_1 = require("@angular-devkit/schematics");
32
- const path_1 = require("path");
33
- const typescript_1 = __importDefault(require("typescript"));
34
- const project_tsconfig_paths_1 = require("@angular/core/schematics/utils/project_tsconfig_paths");
35
- const compiler_host_1 = require("@angular/core/schematics/utils/typescript/compiler_host");
36
- const util_1 = require("@angular/core/schematics/migrations/activated-route-snapshot-fragment/util");
37
- /**
38
- * Migration that marks accesses of `ActivatedRouteSnapshot.fragment` as non-null.
39
- */
40
- function default_1() {
41
- return (tree) => __awaiter(this, void 0, void 0, function* () {
42
- const { buildPaths, testPaths } = yield (0, project_tsconfig_paths_1.getProjectTsConfigPaths)(tree);
43
- const basePath = process.cwd();
44
- const allPaths = [...buildPaths, ...testPaths];
45
- if (!allPaths.length) {
46
- throw new schematics_1.SchematicsException('Could not find any tsconfig file. Cannot migrate ' +
47
- '`ActivatedRouteSnapshot.fragment` accesses.');
48
- }
49
- for (const tsconfigPath of allPaths) {
50
- runActivatedRouteSnapshotFragmentMigration(tree, tsconfigPath, basePath);
51
- }
52
- });
53
- }
54
- exports.default = default_1;
55
- function runActivatedRouteSnapshotFragmentMigration(tree, tsconfigPath, basePath) {
56
- const { program } = (0, compiler_host_1.createMigrationProgram)(tree, tsconfigPath, basePath);
57
- const typeChecker = program.getTypeChecker();
58
- const sourceFiles = program.getSourceFiles().filter(sourceFile => (0, compiler_host_1.canMigrateFile)(basePath, sourceFile, program));
59
- const printer = typescript_1.default.createPrinter();
60
- sourceFiles.forEach(sourceFile => {
61
- const nodesToMigrate = (0, util_1.findFragmentAccesses)(typeChecker, sourceFile);
62
- if (nodesToMigrate.size > 0) {
63
- const update = tree.beginUpdate((0, path_1.relative)(basePath, sourceFile.fileName));
64
- nodesToMigrate.forEach(node => {
65
- update.remove(node.getStart(), node.getWidth());
66
- update.insertRight(node.getStart(), printer.printNode(typescript_1.default.EmitHint.Unspecified, (0, util_1.migrateActivatedRouteSnapshotFragment)(node), sourceFile));
67
- });
68
- tree.commitUpdate(update);
69
- }
70
- });
71
- }
72
- });
73
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NjaGVtYXRpY3MvbWlncmF0aW9ucy9hY3RpdmF0ZWQtcm91dGUtc25hcHNob3QtZnJhZ21lbnQvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUE7Ozs7OztHQU1HOzs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7SUFFSCwyREFBMkU7SUFDM0UsK0JBQThCO0lBQzlCLDREQUE0QjtJQUU1QixrR0FBMkU7SUFDM0UsMkZBQTRGO0lBQzVGLHFHQUFtRjtJQUduRjs7T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zb3VyY2VGaWxlcy5mb3JFYWNoKHNvdXJjZUZpbGUgPT4ge1xuICAgIGNvbnN0IG5vZGVzVG9NaWdyYXRlID0gZmluZEZyYWdtZW50QWNjZXNzZXModHlwZUNoZWNrZXIsIHNvdXJjZUZpbGUpO1xuXG4gICAgaWYgKG5vZGVzVG9NaWdyYXRlLnNpemUgPiAwKSB7XG4gICAgICBjb25zdCB1cGRhdGUgPSB0cmVlLmJlZ2luVXBkYXRlKHJlbGF0aXZlKGJhc2VQYXRoLCBzb3VyY2VGaWxlLmZpbGVOYW1lKSk7XG4gICAgICBub2Rlc1RvTWlncmF0ZS5mb3JFYWNoKG5vZGUgPT4ge1xuICAgICAgICB1cGRhdGUucmVtb3ZlKG5vZGUuZ2V0U3RhcnQoKSwgbm9kZS5nZXRXaWR0aCgpKTtcbiAgICAgICAgdXBkYXRlLmluc2VydFJpZ2h0KFxuICAgICAgICAgICAgbm9kZS5nZXRTdGFydCgpLFxuICAgICAgICAgICAgcHJpbnRlci5wcmludE5vZGUoXG4gICAgICAgICAgICAgICAgdHMuRW1pdEhpbnQuVW5zcGVjaWZpZWQsIG1pZ3JhdGVBY3RpdmF0ZWRSb3V0ZVNuYXBzaG90RnJhZ21lbnQobm9kZSksIHNvdXJjZUZpbGUpKTtcbiAgICAgIH0pO1xuICAgICAgdHJlZS5jb21taXRVcGRhdGUodXBkYXRlKTtcbiAgICB9XG4gIH0pO1xufVxuIl19
@@ -1,16 +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
- /// <amd-module name="@angular/core/schematics/migrations/activated-route-snapshot-fragment/util" />
9
- import ts from 'typescript';
10
- /**
11
- * Finds all the accesses of `ActivatedRouteSnapshot.fragment`
12
- * that need to be migrated within a particular file.
13
- */
14
- export declare function findFragmentAccesses(typeChecker: ts.TypeChecker, sourceFile: ts.SourceFile): Set<ts.PropertyAccessExpression>;
15
- /** Migrates an `ActivatedRouteSnapshot.fragment` access. */
16
- export declare function migrateActivatedRouteSnapshotFragment(node: ts.PropertyAccessExpression): ts.Node;
@@ -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
- var __importDefault = (this && this.__importDefault) || function (mod) {
9
- return (mod && mod.__esModule) ? mod : { "default": mod };
10
- };
11
- (function (factory) {
12
- if (typeof module === "object" && typeof module.exports === "object") {
13
- var v = factory(require, exports);
14
- if (v !== undefined) module.exports = v;
15
- }
16
- else if (typeof define === "function" && define.amd) {
17
- define("@angular/core/schematics/migrations/activated-route-snapshot-fragment/util", ["require", "exports", "typescript", "@angular/core/schematics/utils/typescript/nodes", "@angular/core/schematics/utils/typescript/symbol"], factory);
18
- }
19
- })(function (require, exports) {
20
- "use strict";
21
- Object.defineProperty(exports, "__esModule", { value: true });
22
- exports.migrateActivatedRouteSnapshotFragment = exports.findFragmentAccesses = void 0;
23
- const typescript_1 = __importDefault(require("typescript"));
24
- const nodes_1 = require("@angular/core/schematics/utils/typescript/nodes");
25
- const symbol_1 = require("@angular/core/schematics/utils/typescript/symbol");
26
- /**
27
- * Finds all the accesses of `ActivatedRouteSnapshot.fragment`
28
- * that need to be migrated within a particular file.
29
- */
30
- function findFragmentAccesses(typeChecker, sourceFile) {
31
- const results = new Set();
32
- sourceFile.forEachChild(function walk(node) {
33
- if (typescript_1.default.isPropertyAccessExpression(node) && node.name.text === 'fragment' &&
34
- !results.has(node) && !(0, nodes_1.isNullCheck)(node) && !(0, nodes_1.isSafeAccess)(node) &&
35
- (0, symbol_1.hasOneOfTypes)(typeChecker, node.expression, ['ActivatedRouteSnapshot']) &&
36
- (0, symbol_1.isNullableType)(typeChecker, node)) {
37
- results.add(node);
38
- }
39
- node.forEachChild(walk);
40
- });
41
- return results;
42
- }
43
- exports.findFragmentAccesses = findFragmentAccesses;
44
- /** Migrates an `ActivatedRouteSnapshot.fragment` access. */
45
- function migrateActivatedRouteSnapshotFragment(node) {
46
- // Turns `foo.fragment` into `foo.fragment!`.
47
- return typescript_1.default.createNonNullExpression(node);
48
- }
49
- exports.migrateActivatedRouteSnapshotFragment = migrateActivatedRouteSnapshotFragment;
50
- });
51
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uLy4uLy4uLy4uLy4uLy4uL3BhY2thZ2VzL2NvcmUvc2NoZW1hdGljcy9taWdyYXRpb25zL2FjdGl2YXRlZC1yb3V0ZS1zbmFwc2hvdC1mcmFnbWVudC91dGlsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBOzs7Ozs7R0FNRzs7Ozs7Ozs7Ozs7Ozs7OztJQUVILDREQUE0QjtJQUM1QiwyRUFBdUU7SUFDdkUsNkVBQTRFO0lBRTVFOzs7T0FHRztJQUNILFNBQWdCLG9CQUFvQixDQUNoQyxXQUEyQixFQUFFLFVBQXlCO1FBQ3hELE1BQU0sT0FBTyxHQUFHLElBQUksR0FBRyxFQUErQixDQUFDO1FBRXZELFVBQVUsQ0FBQyxZQUFZLENBQUMsU0FBUyxJQUFJLENBQUMsSUFBYTtZQUNqRCxJQUFJLG9CQUFFLENBQUMsMEJBQTBCLENBQUMsSUFBSSxDQUFDLElBQUksSUFBSSxDQUFDLElBQUksQ0FBQyxJQUFJLEtBQUssVUFBVTtnQkFDcEUsQ0FBQyxPQUFPLENBQUMsR0FBRyxDQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBQSxtQkFBVyxFQUFDLElBQUksQ0FBQyxJQUFJLENBQUMsSUFBQSxvQkFBWSxFQUFDLElBQUksQ0FBQztnQkFDL0QsSUFBQSxzQkFBYSxFQUFDLFdBQVcsRUFBRSxJQUFJLENBQUMsV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uICovXG5leHBvcnQgZnVuY3Rpb24gbWlncmF0ZUFjdGl2YXRlZFJvdXRlU25hcHNob3RGcmFnbWVudChub2RlOiB0cy5Qcm9wZXJ0eUFjY2Vzc0V4cHJlc3Npb24pOiB0cy5Ob2RlIHtcbiAgLy8gVHVybnMgYGZvby5mcmFnbWVudGAgaW50byBgZm9vLmZyYWdtZW50IWAuXG4gIHJldHVybiB0cy5jcmVhdGVOb25OdWxsRXhwcmVzc2lvbihub2RlKTtcbn1cbiJdfQ==
@@ -1,11 +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
- /// <amd-module name="@angular/core/schematics/migrations/can-activate-with-redirect-to" />
9
- import { Rule } from '@angular-devkit/schematics';
10
- /** Migration that removes `canActivate` property from routes that also have `redirectTo`. */
11
- export default function (): Rule;
@@ -1,69 +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
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
9
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
10
- return new (P || (P = Promise))(function (resolve, reject) {
11
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
12
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
13
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
14
- step((generator = generator.apply(thisArg, _arguments || [])).next());
15
- });
16
- };
17
- var __importDefault = (this && this.__importDefault) || function (mod) {
18
- return (mod && mod.__esModule) ? mod : { "default": mod };
19
- };
20
- (function (factory) {
21
- if (typeof module === "object" && typeof module.exports === "object") {
22
- var v = factory(require, exports);
23
- if (v !== undefined) module.exports = v;
24
- }
25
- else if (typeof define === "function" && define.amd) {
26
- define("@angular/core/schematics/migrations/can-activate-with-redirect-to", ["require", "exports", "@angular-devkit/schematics", "path", "typescript", "@angular/core/schematics/utils/project_tsconfig_paths", "@angular/core/schematics/utils/typescript/compiler_host", "@angular/core/schematics/migrations/can-activate-with-redirect-to/util"], factory);
27
- }
28
- })(function (require, exports) {
29
- "use strict";
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- const schematics_1 = require("@angular-devkit/schematics");
32
- const path_1 = require("path");
33
- const typescript_1 = __importDefault(require("typescript"));
34
- const project_tsconfig_paths_1 = require("@angular/core/schematics/utils/project_tsconfig_paths");
35
- const compiler_host_1 = require("@angular/core/schematics/utils/typescript/compiler_host");
36
- const util_1 = require("@angular/core/schematics/migrations/can-activate-with-redirect-to/util");
37
- /** Migration that removes `canActivate` property from routes that also have `redirectTo`. */
38
- function default_1() {
39
- return (tree) => __awaiter(this, void 0, void 0, function* () {
40
- const { buildPaths, testPaths } = yield (0, project_tsconfig_paths_1.getProjectTsConfigPaths)(tree);
41
- const basePath = process.cwd();
42
- const allPaths = [...buildPaths, ...testPaths];
43
- if (!allPaths.length) {
44
- throw new schematics_1.SchematicsException('Could not find any tsconfig file. Cannot migrate ' +
45
- 'Router.navigateByUrl and Router.createUrlTree calls.');
46
- }
47
- for (const tsconfigPath of allPaths) {
48
- runCanActivateWithRedirectToMigration(tree, tsconfigPath, basePath);
49
- }
50
- });
51
- }
52
- exports.default = default_1;
53
- function runCanActivateWithRedirectToMigration(tree, tsconfigPath, basePath) {
54
- const { program } = (0, compiler_host_1.createMigrationProgram)(tree, tsconfigPath, basePath);
55
- const printer = typescript_1.default.createPrinter();
56
- const sourceFiles = program.getSourceFiles().filter(sourceFile => (0, compiler_host_1.canMigrateFile)(basePath, sourceFile, program));
57
- sourceFiles.forEach(sourceFile => {
58
- const literalsToMigrate = (0, util_1.findLiteralsToMigrate)(sourceFile);
59
- const update = tree.beginUpdate((0, path_1.relative)(basePath, sourceFile.fileName));
60
- for (const literal of Array.from(literalsToMigrate)) {
61
- const migratedNode = (0, util_1.migrateLiteral)(literal);
62
- update.remove(literal.getStart(), literal.getWidth());
63
- update.insertRight(literal.getStart(), printer.printNode(typescript_1.default.EmitHint.Unspecified, migratedNode, sourceFile));
64
- }
65
- tree.commitUpdate(update);
66
- });
67
- }
68
- });
69
- //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi8uLi8uLi8uLi8uLi8uLi9wYWNrYWdlcy9jb3JlL3NjaGVtYXRpY3MvbWlncmF0aW9ucy9jYW4tYWN0aXZhdGUtd2l0aC1yZWRpcmVjdC10by9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7OztJQUVILDJEQUEyRTtJQUMzRSwrQkFBOEI7SUFDOUIsNERBQTRCO0lBRTVCLGtHQUEyRTtJQUMzRSwyRkFBNEY7SUFDNUYsaUdBQTZEO0lBRzdELDZGQUE2RjtJQUM3RjtRQUNFLE9BQU8sQ0FBTyxJQUFVLEVBQUUsRUFBRTtZQUMxQixNQUFNLEVBQUMsVUFBVSxFQUFFLFNBQVMsRUFBQyxHQUFHLE1BQU0sSUFBQSxnREFBdUIsRUFBQyxJQUFJLENBQUMsQ0FBQztZQUNwRSxNQUFNLFFBQVEsR0FBRyxPQUFPLENBQUMsR0FBRyxFQUFFLENBQUM7WUFDL0IsTUFBTSxRQUFRLEdBQUcsQ0FBQyxHQUFHLFVBQVUsRUFBRSxHQUFHLFNBQVMsQ0FBQyxDQUFDO1lBRS9DLElBQUksQ0FBQyxRQUFRLENBQUMsTUFBTSxFQUFFO2dCQUNwQixNQUFNLElBQUksZ0NBQW1CLENBQ3pCLG1EQUFtRDtvQkFDbkQsc0RBQXNELENBQUMsQ0FBQzthQUM3RDtZQUVELE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G4gICAgfVxuXG4gICAgdHJlZS5jb21taXRVcGRhdGUodXBkYXRlKTtcbiAgfSk7XG59XG4iXX0=
@@ -1,11 +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
- /// <amd-module name="@angular/core/schematics/migrations/can-activate-with-redirect-to/util" />
9
- import ts from 'typescript';
10
- export declare function migrateLiteral(node: ts.ObjectLiteralExpression): ts.ObjectLiteralExpression;
11
- export declare function findLiteralsToMigrate(sourceFile: ts.SourceFile): Set<ts.ObjectLiteralExpression>;