@schematics/angular 12.0.0-rc.0 → 12.0.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.
Files changed (166) hide show
  1. package/README.md +20 -20
  2. package/app-shell/app-shell-long.md +2 -2
  3. package/app-shell/index.d.ts +7 -0
  4. package/app-shell/index.js +17 -19
  5. package/app-shell/schema.d.ts +4 -4
  6. package/app-shell/schema.json +2 -4
  7. package/application/index.d.ts +7 -0
  8. package/application/index.js +46 -47
  9. package/application/other-files/app.component.html.template +0 -11
  10. package/application/schema.json +15 -13
  11. package/class/index.d.ts +7 -0
  12. package/class/index.js +9 -9
  13. package/class/schema.json +1 -3
  14. package/collection.json +13 -13
  15. package/component/index.d.ts +7 -0
  16. package/component/index.js +23 -20
  17. package/component/schema.json +3 -10
  18. package/directive/index.d.ts +7 -0
  19. package/directive/index.js +13 -13
  20. package/directive/schema.json +1 -3
  21. package/e2e/e2e-long.md +1 -1
  22. package/e2e/index.d.ts +7 -0
  23. package/e2e/index.js +20 -8
  24. package/e2e/schema.json +1 -3
  25. package/enum/files/{__name@dasherize__.enum.ts.template → __name@dasherize____type__.ts.template} +0 -0
  26. package/enum/index.d.ts +7 -0
  27. package/enum/index.js +8 -7
  28. package/enum/schema.d.ts +4 -0
  29. package/enum/schema.json +5 -3
  30. package/guard/files/__name@dasherize__.guard.ts.template +1 -1
  31. package/guard/index.d.ts +7 -0
  32. package/guard/index.js +20 -12
  33. package/guard/schema.json +3 -12
  34. package/interceptor/index.d.ts +7 -0
  35. package/interceptor/index.js +4 -4
  36. package/interface/index.d.ts +7 -0
  37. package/interface/index.js +3 -3
  38. package/interface/schema.json +1 -3
  39. package/library/index.d.ts +7 -0
  40. package/library/index.js +4 -4
  41. package/library/library-long.md +1 -1
  42. package/migrations/update-10/add-deprecation-rule-tslint.d.ts +7 -0
  43. package/migrations/update-10/add-deprecation-rule-tslint.js +8 -1
  44. package/migrations/update-10/remove-es5-browser-support.d.ts +1 -1
  45. package/migrations/update-10/remove-es5-browser-support.js +5 -9
  46. package/migrations/update-10/remove-solution-style-tsconfig.d.ts +7 -0
  47. package/migrations/update-10/remove-solution-style-tsconfig.js +4 -3
  48. package/migrations/update-10/rename-browserslist-config.d.ts +7 -0
  49. package/migrations/update-10/rename-browserslist-config.js +3 -3
  50. package/migrations/update-10/update-angular-config.d.ts +1 -1
  51. package/migrations/update-10/update-angular-config.js +2 -2
  52. package/migrations/update-10/update-dependencies.d.ts +1 -1
  53. package/migrations/update-10/update-dependencies.js +7 -0
  54. package/migrations/update-10/update-libraries-tslib.d.ts +1 -1
  55. package/migrations/update-10/update-libraries-tslib.js +1 -1
  56. package/migrations/update-10/update-module-and-target-compiler-options.d.ts +7 -0
  57. package/migrations/update-10/update-module-and-target-compiler-options.js +11 -12
  58. package/migrations/update-10/update-tslint.d.ts +7 -0
  59. package/migrations/update-10/update-tslint.js +13 -8
  60. package/migrations/update-11/add-declaration-map-compiler-option.d.ts +1 -1
  61. package/migrations/update-11/add-declaration-map-compiler-option.js +1 -1
  62. package/migrations/update-11/replace-ng-packagr-builder.d.ts +1 -1
  63. package/migrations/update-11/replace-ng-packagr-builder.js +3 -3
  64. package/migrations/update-11/update-angular-config.d.ts +1 -1
  65. package/migrations/update-11/update-angular-config.js +3 -3
  66. package/migrations/update-11/update-dependencies.d.ts +1 -1
  67. package/migrations/update-11/update-dependencies.js +7 -0
  68. package/migrations/update-12/production-default-config.d.ts +1 -1
  69. package/migrations/update-12/production-default-config.js +4 -3
  70. package/migrations/update-12/remove-emit-decorator-metadata.d.ts +7 -0
  71. package/migrations/update-12/remove-emit-decorator-metadata.js +15 -3
  72. package/migrations/update-12/update-angular-config.d.ts +1 -1
  73. package/migrations/update-12/update-angular-config.js +6 -5
  74. package/migrations/update-12/update-lazy-module-paths.d.ts +1 -1
  75. package/migrations/update-12/update-lazy-module-paths.js +9 -4
  76. package/migrations/update-12/update-web-workers.d.ts +1 -1
  77. package/migrations/update-12/update-web-workers.js +7 -0
  78. package/migrations/update-12/update-zonejs.d.ts +7 -0
  79. package/migrations/update-12/update-zonejs.js +3 -4
  80. package/migrations/update-9/add-tslib.d.ts +1 -1
  81. package/migrations/update-9/add-tslib.js +8 -1
  82. package/migrations/update-9/index.d.ts +1 -1
  83. package/migrations/update-9/index.js +2 -2
  84. package/migrations/update-9/ivy-libraries.d.ts +1 -1
  85. package/migrations/update-9/ivy-libraries.js +2 -2
  86. package/migrations/update-9/ngsw-config.d.ts +1 -1
  87. package/migrations/update-9/ngsw-config.js +7 -0
  88. package/migrations/update-9/remove-tsickle.d.ts +1 -1
  89. package/migrations/update-9/remove-tsickle.js +7 -0
  90. package/migrations/update-9/schematic-options.d.ts +7 -0
  91. package/migrations/update-9/schematic-options.js +3 -3
  92. package/migrations/update-9/update-app-tsconfigs.d.ts +7 -0
  93. package/migrations/update-9/update-app-tsconfigs.js +3 -3
  94. package/migrations/update-9/update-dependencies.d.ts +1 -1
  95. package/migrations/update-9/update-dependencies.js +7 -0
  96. package/migrations/update-9/update-i18n.d.ts +7 -0
  97. package/migrations/update-9/update-i18n.js +9 -4
  98. package/migrations/update-9/update-server-main-file.d.ts +1 -1
  99. package/migrations/update-9/update-server-main-file.js +12 -5
  100. package/migrations/update-9/update-workspace-config.d.ts +7 -0
  101. package/migrations/update-9/update-workspace-config.js +7 -0
  102. package/migrations/update-9/utils.d.ts +7 -0
  103. package/migrations/update-9/utils.js +3 -3
  104. package/module/index.d.ts +7 -0
  105. package/module/index.js +14 -16
  106. package/module/schema.json +2 -4
  107. package/ng-new/index.d.ts +1 -1
  108. package/ng-new/index.js +3 -5
  109. package/package.json +4 -4
  110. package/pipe/index.d.ts +7 -0
  111. package/pipe/index.js +8 -8
  112. package/pipe/schema.json +1 -3
  113. package/resolver/index.d.ts +7 -0
  114. package/resolver/index.js +9 -11
  115. package/resolver/schema.json +1 -3
  116. package/service/index.d.ts +7 -0
  117. package/service/index.js +4 -4
  118. package/service-worker/index.d.ts +7 -0
  119. package/service-worker/index.js +2 -2
  120. package/service-worker/schema.d.ts +13 -13
  121. package/service-worker/schema.json +1 -3
  122. package/universal/index.d.ts +7 -0
  123. package/universal/index.js +15 -14
  124. package/universal/schema.d.ts +4 -4
  125. package/universal/schema.json +6 -5
  126. package/utility/ast-utils.d.ts +7 -0
  127. package/utility/ast-utils.js +40 -45
  128. package/utility/change.d.ts +1 -1
  129. package/utility/change.js +13 -4
  130. package/utility/dependencies.d.ts +1 -1
  131. package/utility/dependencies.js +7 -0
  132. package/utility/find-module.d.ts +1 -1
  133. package/utility/find-module.js +14 -14
  134. package/utility/json-file.d.ts +1 -1
  135. package/utility/json-file.js +2 -2
  136. package/utility/latest-versions.d.ts +1 -1
  137. package/utility/latest-versions.js +3 -3
  138. package/utility/lint-fix.d.ts +1 -1
  139. package/utility/lint-fix.js +4 -4
  140. package/utility/ng-ast-utils.d.ts +7 -0
  141. package/utility/ng-ast-utils.js +8 -7
  142. package/utility/parse-name.d.ts +1 -1
  143. package/utility/parse-name.js +3 -3
  144. package/utility/paths.d.ts +1 -1
  145. package/utility/paths.js +1 -1
  146. package/utility/project-targets.d.ts +1 -1
  147. package/utility/project-targets.js +1 -1
  148. package/utility/test/create-app-module.d.ts +1 -1
  149. package/utility/test/create-app-module.js +7 -0
  150. package/utility/test/get-file-content.d.ts +1 -1
  151. package/utility/test/get-file-content.js +7 -0
  152. package/utility/test/index.d.ts +1 -1
  153. package/utility/test/index.js +7 -7
  154. package/utility/validation.d.ts +7 -0
  155. package/utility/validation.js +5 -5
  156. package/utility/workspace-models.d.ts +3 -3
  157. package/utility/workspace-models.js +3 -3
  158. package/utility/workspace.d.ts +1 -1
  159. package/utility/workspace.js +3 -3
  160. package/web-worker/index.d.ts +7 -0
  161. package/web-worker/index.js +8 -6
  162. package/web-worker/schema.json +1 -4
  163. package/workspace/files/package.json.template +2 -5
  164. package/workspace/index.d.ts +7 -0
  165. package/workspace/index.js +3 -3
  166. package/workspace/schema.json +1 -4
@@ -1,10 +1,17 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.addTsLib = void 0;
4
11
  const dependencies_1 = require("../../utility/dependencies");
5
12
  const latest_versions_1 = require("../../utility/latest-versions");
6
13
  function addTsLib() {
7
- return host => {
14
+ return (host) => {
8
15
  const tslibDep = dependencies_1.getPackageJsonDependency(host, 'tslib');
9
16
  if (tslibDep && tslibDep.type !== dependencies_1.NodeDependencyType.Default) {
10
17
  dependencies_1.removePackageJsonDependency(host, 'tslib');
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
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
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
@@ -31,7 +31,7 @@ function default_1() {
31
31
  remove_tsickle_1.removeTsickle(),
32
32
  add_tslib_1.addTsLib(),
33
33
  (tree, context) => {
34
- const packageChanges = tree.actions.some(a => a.path.endsWith('/package.json'));
34
+ const packageChanges = tree.actions.some((a) => a.path.endsWith('/package.json'));
35
35
  if (packageChanges) {
36
36
  context.addTask(new tasks_1.NodePackageInstallTask());
37
37
  }
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
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
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  /**
3
3
  * @license
4
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
5
5
  *
6
6
  * Use of this source code is governed by an MIT-style license that can be
7
7
  * found in the LICENSE file at https://angular.io/license
@@ -21,7 +21,7 @@ const workspace_models_1 = require("../../utility/workspace-models");
21
21
  * - Create a prod tsconfig for which disables Ivy and enables VE compilations.
22
22
  */
23
23
  function updateLibraries() {
24
- return workspace_1.updateWorkspace(workspace => {
24
+ return workspace_1.updateWorkspace((workspace) => {
25
25
  const followupRules = [];
26
26
  for (const [, project] of workspace.projects) {
27
27
  if (typeof project.root !== 'string') {
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
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
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.updateNGSWConfig = void 0;
4
11
  const json_file_1 = require("../../utility/json-file");
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
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
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.removeTsickle = void 0;
4
11
  const dependencies_1 = require("../../utility/dependencies");
@@ -1,2 +1,9 @@
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
+ */
1
8
  import { Rule } from '@angular-devkit/schematics';
2
9
  export default function (): Rule;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  /**
4
3
  * @license
5
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
6
5
  *
7
6
  * Use of this source code is governed by an MIT-style license that can be
8
7
  * found in the LICENSE file at https://angular.io/license
9
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const core_1 = require("@angular-devkit/core");
11
11
  const workspace_1 = require("../../utility/workspace");
12
12
  function default_1() {
13
- return workspace_1.updateWorkspace(workspace => {
13
+ return workspace_1.updateWorkspace((workspace) => {
14
14
  // Update root level schematics options if present
15
15
  const rootSchematics = workspace.extensions.schematics;
16
16
  if (rootSchematics && core_1.json.isJsonObject(rootSchematics)) {
@@ -1,3 +1,10 @@
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
+ */
1
8
  import { Rule } from '@angular-devkit/schematics';
2
9
  /**
3
10
  * Update the tsconfig files for applications
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.updateApplicationTsConfigs = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.updateApplicationTsConfigs = void 0;
11
11
  const core_1 = require("@angular-devkit/core");
12
12
  const path_1 = require("path");
13
13
  const json_file_1 = require("../../utility/json-file");
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
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
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.updateDependencies = void 0;
4
11
  const dependencies_1 = require("../../utility/dependencies");
@@ -1,2 +1,9 @@
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
+ */
1
8
  import { Rule } from '@angular-devkit/schematics';
2
9
  export declare function updateI18nConfig(): Rule;
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.updateI18nConfig = void 0;
4
11
  const path_1 = require("path");
@@ -82,7 +89,7 @@ function addProjectI18NOptions(tree, builderConfig, projectConfig) {
82
89
  const i18nOptions = [...workspace_1.allTargetOptions(builderConfig)];
83
90
  const sourceLocale = i18nOptions
84
91
  .map(([, o]) => o.i18nLocale)
85
- .find(x => !!x && typeof x === 'string');
92
+ .find((x) => !!x && typeof x === 'string');
86
93
  projectConfig.extensions['i18n'] = {
87
94
  locales,
88
95
  ...(sourceLocale ? { sourceLocale } : {}),
@@ -102,9 +109,7 @@ function addBuilderI18NOptions(builderConfig, logger) {
102
109
  const localeId = options.i18nLocale;
103
110
  const i18nFile = options.i18nFile;
104
111
  const outputPath = options.outputPath;
105
- if (typeof localeId === 'string' &&
106
- i18nFile &&
107
- typeof outputPath === 'string') {
112
+ if (typeof localeId === 'string' && i18nFile && typeof outputPath === 'string') {
108
113
  if (outputPath.match(new RegExp(`[/\\\\]${localeId}[/\\\\]?$`))) {
109
114
  const newOutputPath = outputPath.replace(new RegExp(`[/\\\\]${localeId}[/\\\\]?$`), '');
110
115
  options.outputPath = newOutputPath;
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
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
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.updateServerMainFile = void 0;
4
11
  const ts = require("../../third_party/github.com/Microsoft/TypeScript/lib/typescript");
@@ -29,7 +36,9 @@ function updateServerMainFile() {
29
36
  const source = ts.createSourceFile(mainFilePath, content.toString().replace(/^\uFEFF/, ''), ts.ScriptTarget.Latest, true);
30
37
  // find exports in main server file
31
38
  const exportDeclarations = ast_utils_1.findNodes(source, ts.SyntaxKind.ExportDeclaration);
32
- const platformServerExports = exportDeclarations.filter(({ moduleSpecifier }) => (moduleSpecifier && ts.isStringLiteral(moduleSpecifier) && moduleSpecifier.text === '@angular/platform-server'));
39
+ const platformServerExports = exportDeclarations.filter(({ moduleSpecifier }) => moduleSpecifier &&
40
+ ts.isStringLiteral(moduleSpecifier) &&
41
+ moduleSpecifier.text === '@angular/platform-server');
33
42
  let hasRenderModule = false;
34
43
  let hasRenderModuleFactory = false;
35
44
  // find exports of renderModule or renderModuleFactory
@@ -69,16 +78,14 @@ function updateServerMainFile() {
69
78
  const moduleSpecifier = ts.createStringLiteral('@angular/platform-server');
70
79
  // TypeScript will emit the Node with double quotes.
71
80
  // In schematics we usually write code with a single quotes
72
- // tslint:disable-next-line: no-any
81
+ // eslint-disable-next-line @typescript-eslint/no-explicit-any
73
82
  moduleSpecifier.singleQuote = true;
74
83
  const newExportDeclarationText = printer.printNode(ts.EmitHint.Unspecified, ts.createExportDeclaration(undefined, undefined, ts.createNamedExports(exportSpecifiers), moduleSpecifier), source);
75
84
  const recorder = tree.beginUpdate(mainFilePath);
76
85
  if (updateExisting) {
77
86
  const start = platformServerExports[0].getStart();
78
87
  const width = platformServerExports[0].getWidth();
79
- recorder
80
- .remove(start, width)
81
- .insertLeft(start, newExportDeclarationText);
88
+ recorder.remove(start, width).insertLeft(start, newExportDeclarationText);
82
89
  }
83
90
  else {
84
91
  recorder.insertLeft(source.getWidth(), '\n' + newExportDeclarationText);
@@ -1,3 +1,10 @@
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
+ */
1
8
  import { Rule } from '@angular-devkit/schematics';
2
9
  export declare const ANY_COMPONENT_STYLE_BUDGET: {
3
10
  type: string;
@@ -1,4 +1,11 @@
1
1
  "use strict";
2
+ /**
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
10
  exports.updateWorkspaceConfig = exports.ANY_COMPONENT_STYLE_BUDGET = void 0;
4
11
  const workspace_1 = require("../../utility/workspace");
@@ -1,3 +1,10 @@
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
+ */
1
8
  import { Tree } from '@angular-devkit/schematics';
2
9
  export declare function isIvyEnabled(tree: Tree, tsConfigPath: string): boolean;
3
10
  export declare function forwardSlashPath(path: string): string;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.forwardSlashPath = exports.isIvyEnabled = void 0;
4
2
  /**
5
3
  * @license
6
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
7
5
  *
8
6
  * Use of this source code is governed by an MIT-style license that can be
9
7
  * found in the LICENSE file at https://angular.io/license
10
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.forwardSlashPath = exports.isIvyEnabled = void 0;
11
11
  const core_1 = require("@angular-devkit/core");
12
12
  const json_file_1 = require("../../utility/json-file");
13
13
  function isIvyEnabled(tree, tsConfigPath) {
package/module/index.d.ts CHANGED
@@ -1,3 +1,10 @@
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
+ */
1
8
  import { Rule } from '@angular-devkit/schematics';
2
9
  import { Schema as ModuleOptions } from './schema';
3
10
  export default function (options: ModuleOptions): Rule;
package/module/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  /**
4
- * @license
5
- * Copyright Google Inc. All Rights Reserved.
6
- *
7
- * Use of this source code is governed by an MIT-style license that can be
8
- * found in the LICENSE file at https://angular.io/license
9
- */
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const core_1 = require("@angular-devkit/core");
11
11
  const schematics_1 = require("@angular-devkit/schematics");
12
12
  const ts = require("../third_party/github.com/Microsoft/TypeScript/lib/typescript");
@@ -18,10 +18,10 @@ const parse_name_1 = require("../utility/parse-name");
18
18
  const workspace_1 = require("../utility/workspace");
19
19
  const schema_1 = require("./schema");
20
20
  function buildRelativeModulePath(options, modulePath) {
21
- const importModulePath = core_1.normalize(`/${options.path}/`
22
- + (options.flat ? '' : core_1.strings.dasherize(options.name) + '/')
23
- + core_1.strings.dasherize(options.name)
24
- + '.module');
21
+ const importModulePath = core_1.normalize(`/${options.path}/` +
22
+ (options.flat ? '' : core_1.strings.dasherize(options.name) + '/') +
23
+ core_1.strings.dasherize(options.name) +
24
+ '.module');
25
25
  return find_module_1.buildRelativePath(modulePath, importModulePath);
26
26
  }
27
27
  function addDeclarationToNgModule(options) {
@@ -107,10 +107,10 @@ function default_1(options) {
107
107
  const templateSource = schematics_1.apply(schematics_1.url('./files'), [
108
108
  options.routing || (isLazyLoadedModuleGen && routingModulePath)
109
109
  ? schematics_1.noop()
110
- : schematics_1.filter(path => !path.endsWith('-routing.module.ts.template')),
110
+ : schematics_1.filter((path) => !path.endsWith('-routing.module.ts.template')),
111
111
  schematics_1.applyTemplates({
112
112
  ...core_1.strings,
113
- 'if-flat': (s) => options.flat ? '' : s,
113
+ 'if-flat': (s) => (options.flat ? '' : s),
114
114
  lazyRoute: isLazyLoadedModuleGen,
115
115
  lazyRouteWithoutRouteModule: isLazyLoadedModuleGen && !routingModulePath,
116
116
  lazyRouteWithRouteModule: isLazyLoadedModuleGen && !!routingModulePath,
@@ -131,9 +131,7 @@ function default_1(options) {
131
131
  !isLazyLoadedModuleGen ? addDeclarationToNgModule(options) : schematics_1.noop(),
132
132
  addRouteDeclarationToNgModule(options, routingModulePath),
133
133
  schematics_1.mergeWith(templateSource),
134
- isLazyLoadedModuleGen
135
- ? schematics_1.schematic('component', componentOptions)
136
- : schematics_1.noop(),
134
+ isLazyLoadedModuleGen ? schematics_1.schematic('component', componentOptions) : schematics_1.noop(),
137
135
  options.lintFix ? lint_fix_1.applyLintFix(options.path) : schematics_1.noop(),
138
136
  ]);
139
137
  };
@@ -55,7 +55,7 @@
55
55
  "default": true,
56
56
  "visible": false
57
57
  },
58
- "module": {
58
+ "module": {
59
59
  "type": "string",
60
60
  "description": "The declaring NgModule.",
61
61
  "alias": "m"
@@ -67,7 +67,5 @@
67
67
  "x-deprecated": "Use \"ng lint --fix\" directly instead."
68
68
  }
69
69
  },
70
- "required": [
71
- "name"
72
- ]
70
+ "required": ["name"]
73
71
  }
package/ng-new/index.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @license
3
- * Copyright Google Inc. All Rights Reserved.
3
+ * Copyright Google LLC All Rights Reserved.
4
4
  *
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
package/ng-new/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  /**
4
3
  * @license
5
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
6
5
  *
7
6
  * Use of this source code is governed by an MIT-style license that can be
8
7
  * found in the LICENSE file at https://angular.io/license
9
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const schematics_1 = require("@angular-devkit/schematics");
11
11
  const tasks_1 = require("@angular-devkit/schematics/tasks");
12
12
  const validation_1 = require("../utility/validation");
@@ -61,9 +61,7 @@ function default_1(options) {
61
61
  }
62
62
  }
63
63
  if (!options.skipGit) {
64
- const commit = typeof options.commit == 'object'
65
- ? options.commit
66
- : (!!options.commit ? {} : false);
64
+ const commit = typeof options.commit == 'object' ? options.commit : options.commit ? {} : false;
67
65
  context.addTask(new tasks_1.RepositoryInitializerTask(options.directory, commit), packageTask ? [packageTask] : []);
68
66
  }
69
67
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schematics/angular",
3
- "version": "12.0.0-rc.0",
3
+ "version": "12.0.0",
4
4
  "description": "Schematics specific to Angular",
5
5
  "homepage": "https://github.com/angular/angular-cli",
6
6
  "keywords": [
@@ -15,8 +15,8 @@
15
15
  ],
16
16
  "schematics": "./collection.json",
17
17
  "dependencies": {
18
- "@angular-devkit/core": "12.0.0-rc.0",
19
- "@angular-devkit/schematics": "12.0.0-rc.0",
18
+ "@angular-devkit/core": "12.0.0",
19
+ "@angular-devkit/schematics": "12.0.0",
20
20
  "jsonc-parser": "3.0.0"
21
21
  },
22
22
  "repository": {
@@ -24,7 +24,7 @@
24
24
  "url": "https://github.com/angular/angular-cli.git"
25
25
  },
26
26
  "engines": {
27
- "node": ">= 12.13.0",
27
+ "node": "^12.14.1 || ^14.0.0",
28
28
  "npm": "^6.11.0 || ^7.5.6",
29
29
  "yarn": ">= 1.13.0"
30
30
  },
package/pipe/index.d.ts CHANGED
@@ -1,3 +1,10 @@
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
+ */
1
8
  import { Rule } from '@angular-devkit/schematics';
2
9
  import { Schema as PipeOptions } from './schema';
3
10
  export default function (options: PipeOptions): Rule;
package/pipe/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  /**
4
3
  * @license
5
- * Copyright Google Inc. All Rights Reserved.
4
+ * Copyright Google LLC All Rights Reserved.
6
5
  *
7
6
  * Use of this source code is governed by an MIT-style license that can be
8
7
  * found in the LICENSE file at https://angular.io/license
9
8
  */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const core_1 = require("@angular-devkit/core");
11
11
  const schematics_1 = require("@angular-devkit/schematics");
12
12
  const ts = require("../third_party/github.com/Microsoft/TypeScript/lib/typescript");
@@ -28,10 +28,10 @@ function addDeclarationToNgModule(options) {
28
28
  }
29
29
  const sourceText = text.toString('utf-8');
30
30
  const source = ts.createSourceFile(modulePath, sourceText, ts.ScriptTarget.Latest, true);
31
- const pipePath = `/${options.path}/`
32
- + (options.flat ? '' : core_1.strings.dasherize(options.name) + '/')
33
- + core_1.strings.dasherize(options.name)
34
- + '.pipe';
31
+ const pipePath = `/${options.path}/` +
32
+ (options.flat ? '' : core_1.strings.dasherize(options.name) + '/') +
33
+ core_1.strings.dasherize(options.name) +
34
+ '.pipe';
35
35
  const relativePath = find_module_1.buildRelativePath(modulePath, pipePath);
36
36
  const changes = ast_utils_1.addDeclarationToModule(source, modulePath, core_1.strings.classify(`${options.name}Pipe`), relativePath);
37
37
  const recorder = host.beginUpdate(modulePath);
@@ -70,10 +70,10 @@ function default_1(options) {
70
70
  options.name = parsedPath.name;
71
71
  options.path = parsedPath.path;
72
72
  const templateSource = schematics_1.apply(schematics_1.url('./files'), [
73
- options.skipTests ? schematics_1.filter(path => !path.endsWith('.spec.ts.template')) : schematics_1.noop(),
73
+ options.skipTests ? schematics_1.filter((path) => !path.endsWith('.spec.ts.template')) : schematics_1.noop(),
74
74
  schematics_1.applyTemplates({
75
75
  ...core_1.strings,
76
- 'if-flat': (s) => options.flat ? '' : s,
76
+ 'if-flat': (s) => (options.flat ? '' : s),
77
77
  ...options,
78
78
  }),
79
79
  schematics_1.move(parsedPath.path),
package/pipe/schema.json CHANGED
@@ -64,7 +64,5 @@
64
64
  "x-deprecated": "Use \"ng lint --fix\" directly instead."
65
65
  }
66
66
  },
67
- "required": [
68
- "name"
69
- ]
67
+ "required": ["name"]
70
68
  }
@@ -1,3 +1,10 @@
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
+ */
1
8
  import { Rule } from '@angular-devkit/schematics';
2
9
  import { Schema } from './schema';
3
10
  export default function (options: Schema): Rule;
package/resolver/index.js CHANGED
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
2
  /**
4
- * @license
5
- * Copyright Google Inc. All Rights Reserved.
6
- *
7
- * Use of this source code is governed by an MIT-style license that can be
8
- * found in the LICENSE file at https://angular.io/license
9
- */
3
+ * @license
4
+ * Copyright Google LLC All Rights Reserved.
5
+ *
6
+ * Use of this source code is governed by an MIT-style license that can be
7
+ * found in the LICENSE file at https://angular.io/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  const core_1 = require("@angular-devkit/core");
11
11
  const schematics_1 = require("@angular-devkit/schematics");
12
12
  const parse_name_1 = require("../utility/parse-name");
@@ -20,16 +20,14 @@ function default_1(options) {
20
20
  options.name = parsedPath.name;
21
21
  options.path = parsedPath.path;
22
22
  const templateSource = schematics_1.apply(schematics_1.url('./files'), [
23
- options.skipTests ? schematics_1.filter(path => !path.endsWith('.spec.ts.template')) : schematics_1.noop(),
23
+ options.skipTests ? schematics_1.filter((path) => !path.endsWith('.spec.ts.template')) : schematics_1.noop(),
24
24
  schematics_1.applyTemplates({
25
25
  ...core_1.strings,
26
26
  ...options,
27
27
  }),
28
28
  schematics_1.move(parsedPath.path + (options.flat ? '' : '/' + core_1.strings.dasherize(options.name))),
29
29
  ]);
30
- return schematics_1.chain([
31
- schematics_1.mergeWith(templateSource),
32
- ]);
30
+ return schematics_1.chain([schematics_1.mergeWith(templateSource)]);
33
31
  };
34
32
  }
35
33
  exports.default = default_1;
@@ -40,7 +40,5 @@
40
40
  }
41
41
  }
42
42
  },
43
- "required": [
44
- "name"
45
- ]
43
+ "required": ["name"]
46
44
  }
@@ -1,3 +1,10 @@
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
+ */
1
8
  import { Rule } from '@angular-devkit/schematics';
2
9
  import { Schema as ServiceOptions } from './schema';
3
10
  export default function (options: ServiceOptions): Rule;