@nrwl/angular 13.10.0-beta.6 → 13.10.0-beta.9

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 (158) hide show
  1. package/esm2020/mfe/index.mjs +2 -2
  2. package/executors.json +4 -4
  3. package/fesm2015/nrwl-angular-mfe.mjs +1 -1
  4. package/fesm2015/nrwl-angular-mfe.mjs.map +1 -1
  5. package/fesm2015/nrwl-angular-testing.mjs.map +1 -1
  6. package/fesm2015/nrwl-angular.mjs.map +1 -1
  7. package/fesm2020/nrwl-angular-mfe.mjs +1 -1
  8. package/fesm2020/nrwl-angular-mfe.mjs.map +1 -1
  9. package/fesm2020/nrwl-angular-testing.mjs.map +1 -1
  10. package/fesm2020/nrwl-angular.mjs.map +1 -1
  11. package/generators.json +9 -11
  12. package/mfe/index.d.ts +1 -1
  13. package/mfe/index.js +2 -1
  14. package/mfe/index.js.map +1 -1
  15. package/migrations.json +2 -407
  16. package/package.json +7 -7
  17. package/src/builders/webpack-browser/schema.json +18 -1
  18. package/src/builders/webpack-server/schema.json +6 -0
  19. package/src/executors/ng-packagr-lite/schema.json +14 -0
  20. package/src/executors/package/schema.json +14 -0
  21. package/src/executors/utilities/tailwindcss.js +2 -2
  22. package/src/executors/utilities/tailwindcss.js.map +1 -1
  23. package/src/generators/application/lib/add-mfe.js +1 -0
  24. package/src/generators/application/lib/add-mfe.js.map +1 -1
  25. package/src/generators/application/schema.d.ts +1 -0
  26. package/src/generators/application/schema.json +9 -3
  27. package/src/generators/component/schema.json +4 -4
  28. package/src/generators/convert-to-with-mf/convert-to-with-mf.js +2 -1
  29. package/src/generators/convert-to-with-mf/convert-to-with-mf.js.map +1 -1
  30. package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.d.ts +1 -1
  31. package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js +17 -14
  32. package/src/generators/convert-to-with-mf/lib/write-new-webpack-config.js.map +1 -1
  33. package/src/generators/convert-tslint-to-eslint/schema.json +4 -4
  34. package/src/generators/downgrade-module/schema.json +1 -0
  35. package/src/generators/init/schema.json +1 -1
  36. package/src/generators/karma/karma.d.ts +1 -1
  37. package/src/generators/karma/karma.js +17 -15
  38. package/src/generators/karma/karma.js.map +1 -1
  39. package/src/generators/karma/schema.json +1 -0
  40. package/src/generators/karma-project/karma-project.js +2 -0
  41. package/src/generators/karma-project/karma-project.js.map +1 -1
  42. package/src/generators/karma-project/schema.d.ts +1 -0
  43. package/src/generators/karma-project/schema.json +6 -0
  44. package/src/generators/library/schema.json +2 -1
  45. package/src/generators/library-secondary-entry-point/schema.json +1 -0
  46. package/src/generators/mfe-host/mfe-host.js +1 -0
  47. package/src/generators/mfe-host/mfe-host.js.map +1 -1
  48. package/src/generators/mfe-host/schema.d.ts +1 -0
  49. package/src/generators/mfe-host/schema.json +11 -10
  50. package/src/generators/mfe-remote/schema.json +2 -2
  51. package/src/generators/move/lib/update-ng-package.js +1 -1
  52. package/src/generators/move/lib/update-ng-package.js.map +1 -1
  53. package/src/generators/move/schema.json +3 -3
  54. package/src/generators/ng-add/compat.d.ts +1 -1
  55. package/src/generators/ng-add/files/{root → root-karma}/karma.conf.js__tmpl__ +0 -0
  56. package/src/generators/ng-add/migrate-from-angular-cli.d.ts +2 -2
  57. package/src/generators/ng-add/migrate-from-angular-cli.js +38 -607
  58. package/src/generators/ng-add/migrate-from-angular-cli.js.map +1 -1
  59. package/src/generators/ng-add/ng-add.d.ts +3 -3
  60. package/src/generators/ng-add/ng-add.js +2 -2
  61. package/src/generators/ng-add/ng-add.js.map +1 -1
  62. package/src/generators/ng-add/schema.d.ts +1 -1
  63. package/src/generators/ng-add/utilities/app.migrator.d.ts +18 -0
  64. package/src/generators/ng-add/utilities/app.migrator.js +182 -0
  65. package/src/generators/ng-add/utilities/app.migrator.js.map +1 -0
  66. package/src/generators/ng-add/utilities/e2e-project.migrator.d.ts +19 -0
  67. package/src/generators/ng-add/utilities/e2e-project.migrator.js +186 -0
  68. package/src/generators/ng-add/utilities/e2e-project.migrator.js.map +1 -0
  69. package/src/generators/ng-add/utilities/e2e-utils.d.ts +7 -0
  70. package/src/generators/ng-add/utilities/e2e-utils.js +46 -0
  71. package/src/generators/ng-add/utilities/e2e-utils.js.map +1 -0
  72. package/src/generators/ng-add/utilities/get-all-projects.d.ts +3 -0
  73. package/src/generators/ng-add/utilities/get-all-projects.js +26 -0
  74. package/src/generators/ng-add/utilities/get-all-projects.js.map +1 -0
  75. package/src/generators/ng-add/utilities/normalize-options.d.ts +3 -0
  76. package/src/generators/ng-add/utilities/normalize-options.js +24 -0
  77. package/src/generators/ng-add/utilities/normalize-options.js.map +1 -0
  78. package/src/generators/ng-add/utilities/project.migrator.d.ts +21 -0
  79. package/src/generators/ng-add/utilities/project.migrator.js +53 -0
  80. package/src/generators/ng-add/utilities/project.migrator.js.map +1 -0
  81. package/src/generators/ng-add/utilities/types.d.ts +10 -0
  82. package/src/generators/ng-add/utilities/types.js +3 -0
  83. package/src/generators/ng-add/utilities/types.js.map +1 -0
  84. package/src/generators/ng-add/utilities/workspace.d.ts +12 -0
  85. package/src/generators/ng-add/utilities/workspace.js +258 -0
  86. package/src/generators/ng-add/utilities/workspace.js.map +1 -0
  87. package/src/generators/ngrx/schema.json +1 -0
  88. package/src/generators/scam/schema.json +6 -6
  89. package/src/generators/scam-directive/schema.json +3 -3
  90. package/src/generators/scam-pipe/schema.json +1 -1
  91. package/src/generators/setup-mfe/files/webpack/mfe.config.js__tmpl__ +7 -0
  92. package/src/generators/setup-mfe/files/webpack/webpack.config.js__tmpl__ +2 -7
  93. package/src/generators/setup-mfe/lib/add-remote-to-host.d.ts +2 -2
  94. package/src/generators/setup-mfe/lib/add-remote-to-host.js +49 -24
  95. package/src/generators/setup-mfe/lib/add-remote-to-host.js.map +1 -1
  96. package/src/generators/setup-mfe/lib/fix-bootstrap.d.ts +2 -1
  97. package/src/generators/setup-mfe/lib/fix-bootstrap.js +13 -4
  98. package/src/generators/setup-mfe/lib/fix-bootstrap.js.map +1 -1
  99. package/src/generators/setup-mfe/lib/generate-config.js +2 -1
  100. package/src/generators/setup-mfe/lib/generate-config.js.map +1 -1
  101. package/src/generators/setup-mfe/lib/index.d.ts +1 -0
  102. package/src/generators/setup-mfe/lib/index.js +1 -0
  103. package/src/generators/setup-mfe/lib/index.js.map +1 -1
  104. package/src/generators/setup-mfe/lib/setup-host-if-dynamic.d.ts +3 -0
  105. package/src/generators/setup-mfe/lib/setup-host-if-dynamic.js +15 -0
  106. package/src/generators/setup-mfe/lib/setup-host-if-dynamic.js.map +1 -0
  107. package/src/generators/setup-mfe/schema.d.ts +1 -0
  108. package/src/generators/setup-mfe/schema.json +7 -1
  109. package/src/generators/setup-mfe/setup-mfe.d.ts +1 -1
  110. package/src/generators/setup-mfe/setup-mfe.js +16 -13
  111. package/src/generators/setup-mfe/setup-mfe.js.map +1 -1
  112. package/src/generators/stories/schema.json +2 -0
  113. package/src/generators/storybook-configuration/schema.json +2 -0
  114. package/src/generators/storybook-migrate-defaults-5-to-6/schema.json +2 -0
  115. package/src/generators/storybook-migrate-stories-to-6-2/schema.json +2 -0
  116. package/src/generators/upgrade-module/schema.json +1 -0
  117. package/src/migrations/update-12-3-0/update-storybook.js +1 -1
  118. package/src/utils/mfe/mfe-webpack.js +2 -2
  119. package/src/utils/mfe/mfe-webpack.js.map +1 -1
  120. package/src/utils/mfe/with-module-federation.js +4 -1
  121. package/src/utils/mfe/with-module-federation.js.map +1 -1
  122. package/src/utils/versions.js +1 -1
  123. package/src/generators/ng-add/files/decorate-angular-cli/decorate-angular-cli.js__tmpl__ +0 -69
  124. package/src/generators/ng-add/files/root/nx.json__tmpl__ +0 -29
  125. package/src/migrations/update-10-0-0/update-10-0-0.d.ts +0 -1
  126. package/src/migrations/update-10-0-0/update-10-0-0.js +0 -15
  127. package/src/migrations/update-10-0-0/update-10-0-0.js.map +0 -1
  128. package/src/migrations/update-10-2-0/update-10-2-0.d.ts +0 -1
  129. package/src/migrations/update-10-2-0/update-10-2-0.js +0 -14
  130. package/src/migrations/update-10-2-0/update-10-2-0.js.map +0 -1
  131. package/src/migrations/update-10-3-0/files/tsconfig.editor.json +0 -11
  132. package/src/migrations/update-10-3-0/update-10-3-0.d.ts +0 -2
  133. package/src/migrations/update-10-3-0/update-10-3-0.js +0 -79
  134. package/src/migrations/update-10-3-0/update-10-3-0.js.map +0 -1
  135. package/src/migrations/update-10-4-0/update-10-4-0.d.ts +0 -2
  136. package/src/migrations/update-10-4-0/update-10-4-0.js +0 -36
  137. package/src/migrations/update-10-4-0/update-10-4-0.js.map +0 -1
  138. package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.d.ts +0 -2
  139. package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js +0 -118
  140. package/src/migrations/update-10-5-0/add-template-support-and-presets-to-eslint.js.map +0 -1
  141. package/src/migrations/update-11-0-0/update-builders-config.d.ts +0 -2
  142. package/src/migrations/update-11-0-0/update-builders-config.js +0 -55
  143. package/src/migrations/update-11-0-0/update-builders-config.js.map +0 -1
  144. package/src/migrations/update-8-12-0/change-angular-lib-builder.d.ts +0 -2
  145. package/src/migrations/update-8-12-0/change-angular-lib-builder.js +0 -25
  146. package/src/migrations/update-8-12-0/change-angular-lib-builder.js.map +0 -1
  147. package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.d.ts +0 -1
  148. package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.js +0 -49
  149. package/src/migrations/update-8-3-0/upgrade-ngrx-8-0.js.map +0 -1
  150. package/src/migrations/update-8-5-0/upgrade-cli-8-3.d.ts +0 -1
  151. package/src/migrations/update-8-5-0/upgrade-cli-8-3.js +0 -55
  152. package/src/migrations/update-8-5-0/upgrade-cli-8-3.js.map +0 -1
  153. package/src/migrations/update-9-0-0/add-postinstall.d.ts +0 -1
  154. package/src/migrations/update-9-0-0/add-postinstall.js +0 -22
  155. package/src/migrations/update-9-0-0/add-postinstall.js.map +0 -1
  156. package/src/migrations/update-9-0-0/update-9-0-0.d.ts +0 -2
  157. package/src/migrations/update-9-0-0/update-9-0-0.js +0 -18
  158. package/src/migrations/update-9-0-0/update-9-0-0.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"get-all-projects.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/ng-add/utilities/get-all-projects.ts"],"names":[],"mappings":";;;AAAA,yCAAiD;AAGjD,SAAgB,cAAc,CAAC,IAAU;IACvC,MAAM,QAAQ,GAAG,IAAA,oBAAW,EAAC,IAAI,CAAC,CAAC;IACnC,MAAM,MAAM,GAAsB;QAChC,IAAI,EAAE,EAAE;QACR,IAAI,EAAE,EAAE;KACT,CAAC;IAEF,KAAK,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,IAAI,QAAQ,EAAE;QACtC,MAAM,gBAAgB,GAAkC;YACtD,MAAM,EAAE,OAAO;YACf,IAAI;SACL,CAAC;QAEF,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE;YACrC,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACpC;aAAM;YACL,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC;SACpC;KACF;IAED,OAAO,MAAM,CAAC;AAChB,CAAC;AArBD,wCAqBC"}
@@ -0,0 +1,3 @@
1
+ import { GeneratorOptions } from '../schema';
2
+ import { WorkspaceProjects } from './types';
3
+ export declare function normalizeOptions(options: GeneratorOptions, projects: WorkspaceProjects): GeneratorOptions;
@@ -0,0 +1,24 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.normalizeOptions = void 0;
4
+ const devkit_1 = require("@nrwl/devkit");
5
+ function normalizeOptions(options, projects) {
6
+ var _a;
7
+ // TODO: this restrictions will be removed, it's here temporarily to
8
+ // execute for both a full migration and a minimal one to maintain
9
+ // the current behavior
10
+ const hasLibraries = projects.libs.length > 0;
11
+ if (projects.apps.length > 2 || hasLibraries) {
12
+ throw new Error('Can only convert projects with one app');
13
+ }
14
+ let npmScope = (_a = options.npmScope) !== null && _a !== void 0 ? _a : options.name;
15
+ if (npmScope) {
16
+ npmScope = (0, devkit_1.names)(npmScope).fileName;
17
+ }
18
+ else {
19
+ npmScope = projects.apps[0].name;
20
+ }
21
+ return Object.assign(Object.assign({}, options), { npmScope });
22
+ }
23
+ exports.normalizeOptions = normalizeOptions;
24
+ //# sourceMappingURL=normalize-options.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalize-options.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/ng-add/utilities/normalize-options.ts"],"names":[],"mappings":";;;AAAA,yCAAqC;AAIrC,SAAgB,gBAAgB,CAC9B,OAAyB,EACzB,QAA2B;;IAE3B,oEAAoE;IACpE,kEAAkE;IAClE,uBAAuB;IACvB,MAAM,YAAY,GAAG,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,CAAC;IAC9C,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,GAAG,CAAC,IAAI,YAAY,EAAE;QAC5C,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;KAC3D;IAED,IAAI,QAAQ,GAAG,MAAA,OAAO,CAAC,QAAQ,mCAAI,OAAO,CAAC,IAAI,CAAC;IAChD,IAAI,QAAQ,EAAE;QACZ,QAAQ,GAAG,IAAA,cAAK,EAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC;KACrC;SAAM;QACL,QAAQ,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;KAClC;IAED,uCAAY,OAAO,KAAE,QAAQ,IAAG;AAClC,CAAC;AApBD,4CAoBC"}
@@ -0,0 +1,21 @@
1
+ import { ProjectConfiguration, Tree } from '@nrwl/devkit';
2
+ import { GeneratorOptions } from '../schema';
3
+ import { MigrationProjectConfiguration, ValidationResult } from './types';
4
+ export declare abstract class ProjectMigrator {
5
+ protected readonly tree: Tree;
6
+ protected readonly options: GeneratorOptions;
7
+ protected projectConfig: ProjectConfiguration;
8
+ protected project: {
9
+ name: string;
10
+ oldRoot: string;
11
+ oldSourceRoot: string;
12
+ newRoot: string;
13
+ newSourceRoot: string;
14
+ };
15
+ constructor(tree: Tree, options: GeneratorOptions, project: MigrationProjectConfiguration, rootDir: string);
16
+ abstract migrate(): Promise<void>;
17
+ abstract validate(): ValidationResult;
18
+ protected moveProjectRootFile(filePath: string, isRequired?: boolean): void;
19
+ protected moveDir(from: string, to: string): void;
20
+ protected moveFile(from: string, to: string, required?: boolean): void;
21
+ }
@@ -0,0 +1,53 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectMigrator = void 0;
4
+ const devkit_1 = require("@nrwl/devkit");
5
+ const path_1 = require("path");
6
+ class ProjectMigrator {
7
+ constructor(tree, options, project, rootDir) {
8
+ var _a, _b, _c;
9
+ this.tree = tree;
10
+ this.options = options;
11
+ this.projectConfig = project.config;
12
+ this.project = {
13
+ name: project.name,
14
+ oldRoot: (_a = this.projectConfig.root) !== null && _a !== void 0 ? _a : '',
15
+ oldSourceRoot: (_c = (_b = this.projectConfig.sourceRoot) !== null && _b !== void 0 ? _b : this.projectConfig.root) !== null && _c !== void 0 ? _c : '',
16
+ newRoot: `${rootDir}/${project.name}`,
17
+ newSourceRoot: `${rootDir}/${project.name}/src`,
18
+ };
19
+ }
20
+ moveProjectRootFile(filePath, isRequired = true) {
21
+ if (!filePath) {
22
+ return;
23
+ }
24
+ const filename = !!filePath ? (0, path_1.basename)(filePath) : '';
25
+ const from = filePath;
26
+ const to = (0, devkit_1.joinPathFragments)(this.project.newRoot, filename);
27
+ this.moveFile(from, to, isRequired);
28
+ }
29
+ moveDir(from, to) {
30
+ (0, devkit_1.visitNotIgnoredFiles)(this.tree, from, (file) => {
31
+ this.moveFile(file, file.replace(from, to), true);
32
+ });
33
+ }
34
+ moveFile(from, to, required = true) {
35
+ if (!this.tree.exists(from)) {
36
+ if (required) {
37
+ console.warn(`Path: ${from} does not exist`);
38
+ }
39
+ }
40
+ else if (this.tree.exists(to)) {
41
+ if (required) {
42
+ console.warn(`Path: ${to} already exists`);
43
+ }
44
+ }
45
+ else {
46
+ const contents = this.tree.read(from);
47
+ this.tree.write(to, contents);
48
+ this.tree.delete(from);
49
+ }
50
+ }
51
+ }
52
+ exports.ProjectMigrator = ProjectMigrator;
53
+ //# sourceMappingURL=project.migrator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"project.migrator.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/ng-add/utilities/project.migrator.ts"],"names":[],"mappings":";;;AAAA,yCAKsB;AACtB,+BAAgC;AAIhC,MAAsB,eAAe;IAUnC,YACqB,IAAU,EACV,OAAyB,EAC5C,OAAsC,EACtC,OAAe;;QAHI,SAAI,GAAJ,IAAI,CAAM;QACV,YAAO,GAAP,OAAO,CAAkB;QAI5C,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,MAAM,CAAC;QACpC,IAAI,CAAC,OAAO,GAAG;YACb,IAAI,EAAE,OAAO,CAAC,IAAI;YAClB,OAAO,EAAE,MAAA,IAAI,CAAC,aAAa,CAAC,IAAI,mCAAI,EAAE;YACtC,aAAa,EACX,MAAA,MAAA,IAAI,CAAC,aAAa,CAAC,UAAU,mCAAI,IAAI,CAAC,aAAa,CAAC,IAAI,mCAAI,EAAE;YAChE,OAAO,EAAE,GAAG,OAAO,IAAI,OAAO,CAAC,IAAI,EAAE;YACrC,aAAa,EAAE,GAAG,OAAO,IAAI,OAAO,CAAC,IAAI,MAAM;SAChD,CAAC;IACJ,CAAC;IAKS,mBAAmB,CAAC,QAAgB,EAAE,UAAU,GAAG,IAAI;QAC/D,IAAI,CAAC,QAAQ,EAAE;YACb,OAAO;SACR;QAED,MAAM,QAAQ,GAAG,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAA,eAAQ,EAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;QACtD,M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 config: ProjectConfiguration;
4
+ name: string;
5
+ };
6
+ export declare type WorkspaceProjects = {
7
+ apps: MigrationProjectConfiguration[];
8
+ libs: MigrationProjectConfiguration[];
9
+ };
10
+ export declare type ValidationResult = string | null;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/ng-add/utilities/types.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ import { Tree } from '@nrwl/devkit';
2
+ import { GeneratorOptions } from '../schema';
3
+ import { WorkspaceProjects } from './types';
4
+ export declare function validateWorkspace(tree: Tree, projects: WorkspaceProjects): void;
5
+ export declare function createNxJson(tree: Tree, options: GeneratorOptions, setWorkspaceLayoutAsNewProjectRoot?: boolean): void;
6
+ export declare function decorateAngularCli(tree: Tree): void;
7
+ export declare function updateWorkspaceConfigDefaults(tree: Tree): void;
8
+ export declare function updateRootTsConfig(tree: Tree): void;
9
+ export declare function updatePackageJson(tree: Tree): void;
10
+ export declare function updateTsLint(tree: Tree): void;
11
+ export declare function createWorkspaceFiles(tree: Tree): Promise<void>;
12
+ export declare function createRootKarmaConfig(tree: Tree): void;
@@ -0,0 +1,258 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.createRootKarmaConfig = exports.createWorkspaceFiles = exports.updateTsLint = exports.updatePackageJson = exports.updateRootTsConfig = exports.updateWorkspaceConfigDefaults = exports.decorateAngularCli = exports.createNxJson = exports.validateWorkspace = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const devkit_1 = require("@nrwl/devkit");
6
+ const workspace_1 = require("@nrwl/workspace/src/generators/workspace/workspace");
7
+ const default_base_1 = require("@nrwl/workspace/src/utilities/default-base");
8
+ const prettier_1 = require("@nrwl/workspace/src/utilities/prettier");
9
+ const typescript_1 = require("@nrwl/workspace/src/utilities/typescript");
10
+ const versions_1 = require("@nrwl/workspace/src/utils/versions");
11
+ const fs_1 = require("fs");
12
+ const path_1 = require("path");
13
+ const versions_2 = require("../../../utils/versions");
14
+ const e2e_utils_1 = require("./e2e-utils");
15
+ // TODO: most of the validation here will be moved to the app migrator when
16
+ // support for multiple apps is added. This will only contain workspace-wide
17
+ // validation.
18
+ function validateWorkspace(tree, projects) {
19
+ try {
20
+ if (!tree.exists('package.json')) {
21
+ throw new Error('Cannot find package.json');
22
+ }
23
+ if (!tree.exists('angular.json')) {
24
+ throw new Error('Cannot find angular.json');
25
+ }
26
+ const e2eKey = (0, e2e_utils_1.getE2eKey)(projects);
27
+ const e2eApp = (0, e2e_utils_1.getE2eProject)(projects);
28
+ if (!e2eApp) {
29
+ return;
30
+ }
31
+ if ((0, e2e_utils_1.isProtractorE2eProject)(e2eApp.config)) {
32
+ if (tree.exists(e2eApp.config.targets.e2e.options.protractorConfig)) {
33
+ return;
34
+ }
35
+ console.info(`Make sure the "${e2eKey}.architect.e2e.options.protractorConfig" is valid or the "${e2eKey}" project is removed from "angular.json".`);
36
+ throw new Error(`An e2e project with Protractor was found but "${e2eApp.config.targets.e2e.options.protractorConfig}" could not be found.`);
37
+ }
38
+ if ((0, e2e_utils_1.isCypressE2eProject)(e2eApp.config)) {
39
+ const configFile = (0, e2e_utils_1.getCypressConfigFile)(e2eApp.config);
40
+ if (configFile && !tree.exists(configFile)) {
41
+ throw new Error(`An e2e project with Cypress was found but "${configFile}" could not be found.`);
42
+ }
43
+ if (!tree.exists('cypress')) {
44
+ throw new Error(`An e2e project with Cypress was found but the "cypress" directory could not be found.`);
45
+ }
46
+ return;
47
+ }
48
+ throw new Error(`An e2e project was found but it's using an unsupported executor "${e2eApp.config.targets.e2e.executor}".`);
49
+ }
50
+ catch (e) {
51
+ console.error(e.message);
52
+ console.error('Your workspace could not be converted into an Nx Workspace because of the above error.');
53
+ throw e;
54
+ }
55
+ }
56
+ exports.validateWorkspace = validateWorkspace;
57
+ function createNxJson(tree, options, setWorkspaceLayoutAsNewProjectRoot = false) {
58
+ var _a;
59
+ const { projects = {}, newProjectRoot = '' } = (0, devkit_1.readJson)(tree, 'angular.json');
60
+ // TODO: temporarily leaving this here because it's the old behavior for a
61
+ // minimal migration, will be removed in a later PR
62
+ const hasLibraries = Object.keys(projects).find((project) => projects[project].projectType &&
63
+ projects[project].projectType !== 'application');
64
+ if (Object.keys(projects).length !== 1 || hasLibraries) {
65
+ throw new Error(`The schematic can only be used with Angular CLI workspaces with a single application.`);
66
+ }
67
+ (0, devkit_1.writeJson)(tree, 'nx.json', {
68
+ npmScope: options.npmScope,
69
+ affected: {
70
+ defaultBase: (_a = options.defaultBase) !== null && _a !== void 0 ? _a : (0, default_base_1.deduceDefaultBase)(),
71
+ },
72
+ implicitDependencies: {
73
+ 'package.json': {
74
+ dependencies: '*',
75
+ devDependencies: '*',
76
+ },
77
+ '.eslintrc.json': '*',
78
+ },
79
+ tasksRunnerOptions: {
80
+ default: {
81
+ runner: 'nx/tasks-runners/default',
82
+ options: {
83
+ cacheableOperations: ['build', 'lint', 'test', 'e2e'],
84
+ },
85
+ },
86
+ },
87
+ targetDependencies: {
88
+ build: [
89
+ {
90
+ target: 'build',
91
+ projects: 'dependencies',
92
+ },
93
+ ],
94
+ },
95
+ workspaceLayout: setWorkspaceLayoutAsNewProjectRoot
96
+ ? { appsDir: newProjectRoot, libsDir: newProjectRoot }
97
+ : undefined,
98
+ });
99
+ }
100
+ exports.createNxJson = createNxJson;
101
+ function decorateAngularCli(tree) {
102
+ const nrwlWorkspacePath = require.resolve('@nrwl/workspace/package.json');
103
+ const decorateCli = (0, fs_1.readFileSync)((0, path_1.join)((0, path_1.dirname)(nrwlWorkspacePath), 'src/generators/utils/decorate-angular-cli.js__tmpl__'), 'utf-8');
104
+ tree.write('decorate-angular-cli.js', decorateCli);
105
+ (0, devkit_1.updateJson)(tree, 'package.json', (json) => {
106
+ if (json.scripts &&
107
+ json.scripts.postinstall &&
108
+ !json.scripts.postinstall.includes('decorate-angular-cli.js')) {
109
+ // if exists, add execution of this script
110
+ json.scripts.postinstall += ' && node ./decorate-angular-cli.js';
111
+ }
112
+ else {
113
+ if (!json.scripts)
114
+ json.scripts = {};
115
+ // if doesn't exist, set to execute this script
116
+ json.scripts.postinstall = 'node ./decorate-angular-cli.js';
117
+ }
118
+ if (json.scripts.ng) {
119
+ json.scripts.ng = 'nx';
120
+ }
121
+ return json;
122
+ });
123
+ }
124
+ exports.decorateAngularCli = decorateAngularCli;
125
+ function updateWorkspaceConfigDefaults(tree) {
126
+ var _a;
127
+ const workspaceConfig = (0, devkit_1.readWorkspaceConfiguration)(tree);
128
+ delete workspaceConfig.newProjectRoot;
129
+ workspaceConfig.cli = (_a = workspaceConfig.cli) !== null && _a !== void 0 ? _a : {};
130
+ if (!workspaceConfig.cli.defaultCollection) {
131
+ workspaceConfig.cli.defaultCollection = '@nrwl/angular';
132
+ }
133
+ (0, devkit_1.updateWorkspaceConfiguration)(tree, workspaceConfig);
134
+ }
135
+ exports.updateWorkspaceConfigDefaults = updateWorkspaceConfigDefaults;
136
+ function updateRootTsConfig(tree) {
137
+ (0, devkit_1.writeJson)(tree, 'tsconfig.base.json', setUpCompilerOptions((0, devkit_1.readJson)(tree, (0, typescript_1.getRootTsConfigPathInTree)(tree))));
138
+ if (tree.exists('tsconfig.json')) {
139
+ tree.delete('tsconfig.json');
140
+ }
141
+ }
142
+ exports.updateRootTsConfig = updateRootTsConfig;
143
+ function updatePackageJson(tree) {
144
+ (0, devkit_1.updateJson)(tree, 'package.json', (packageJson) => {
145
+ var _a, _b;
146
+ packageJson.scripts = packageJson.scripts || {};
147
+ packageJson.scripts = Object.assign(Object.assign({}, packageJson.scripts), { nx: 'nx', 'affected:apps': 'nx affected:apps', 'affected:libs': 'nx affected:libs', 'affected:build': 'nx affected:build', 'affected:e2e': 'nx affected:e2e', 'affected:test': 'nx affected:test', 'affected:lint': 'nx affected:lint', 'affected:graph': 'nx affected:graph', affected: 'nx affected', format: 'nx format:write', 'format:write': 'nx format:write', 'format:check': 'nx format:check', update: 'ng update @nrwl/workspace', 'update:check': 'ng update', lint: 'nx workspace-lint && ng lint', graph: 'nx graph', 'workspace-generator': 'nx workspace-generator', help: 'nx help' });
148
+ packageJson.devDependencies = (_a = packageJson.devDependencies) !== null && _a !== void 0 ? _a : {};
149
+ packageJson.dependencies = (_b = packageJson.dependencies) !== null && _b !== void 0 ? _b : {};
150
+ if (!packageJson.dependencies['@nrwl/angular']) {
151
+ packageJson.dependencies['@nrwl/angular'] = versions_2.nxVersion;
152
+ }
153
+ if (!packageJson.devDependencies['@angular/cli']) {
154
+ packageJson.devDependencies['@angular/cli'] = versions_2.angularDevkitVersion;
155
+ }
156
+ if (!packageJson.devDependencies['@nrwl/workspace']) {
157
+ packageJson.devDependencies['@nrwl/workspace'] = versions_2.nxVersion;
158
+ }
159
+ if (!packageJson.devDependencies['nx']) {
160
+ packageJson.devDependencies['nx'] = versions_2.nxVersion;
161
+ }
162
+ if (!packageJson.devDependencies['prettier']) {
163
+ packageJson.devDependencies['prettier'] = versions_1.prettierVersion;
164
+ }
165
+ return packageJson;
166
+ });
167
+ }
168
+ exports.updatePackageJson = updatePackageJson;
169
+ function updateTsLint(tree) {
170
+ if (!tree.exists(`tslint.json`)) {
171
+ return;
172
+ }
173
+ (0, devkit_1.updateJson)(tree, 'tslint.json', (tslintJson) => {
174
+ var _a;
175
+ [
176
+ 'no-trailing-whitespace',
177
+ 'one-line',
178
+ 'quotemark',
179
+ 'typedef-whitespace',
180
+ 'whitespace',
181
+ ].forEach((key) => {
182
+ tslintJson[key] = undefined;
183
+ });
184
+ tslintJson.rulesDirectory = (_a = tslintJson.rulesDirectory) !== null && _a !== void 0 ? _a : [];
185
+ tslintJson.rulesDirectory.push('node_modules/@nrwl/workspace/src/tslint');
186
+ tslintJson.rules['nx-enforce-module-boundaries'] = [
187
+ true,
188
+ {
189
+ allow: [],
190
+ depConstraints: [{ sourceTag: '*', onlyDependOnLibsWithTags: ['*'] }],
191
+ },
192
+ ];
193
+ return tslintJson;
194
+ });
195
+ }
196
+ exports.updateTsLint = updateTsLint;
197
+ function createWorkspaceFiles(tree) {
198
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
199
+ updateVsCodeRecommendedExtensions(tree);
200
+ yield updatePrettierConfig(tree);
201
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/root'), '.', {
202
+ tmpl: '',
203
+ dot: '.',
204
+ rootTsConfigPath: (0, typescript_1.getRootTsConfigPathInTree)(tree),
205
+ });
206
+ });
207
+ }
208
+ exports.createWorkspaceFiles = createWorkspaceFiles;
209
+ function createRootKarmaConfig(tree) {
210
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/root-karma'), '.', {
211
+ tmpl: '',
212
+ });
213
+ }
214
+ exports.createRootKarmaConfig = createRootKarmaConfig;
215
+ function updateVsCodeRecommendedExtensions(tree) {
216
+ const recommendations = [
217
+ 'nrwl.angular-console',
218
+ 'angular.ng-template',
219
+ 'dbaeumer.vscode-eslint',
220
+ 'esbenp.prettier-vscode',
221
+ ];
222
+ if (tree.exists('.vscode/extensions.json')) {
223
+ (0, devkit_1.updateJson)(tree, '.vscode/extensions.json', (json) => {
224
+ json.recommendations = json.recommendations || [];
225
+ recommendations.forEach((extension) => {
226
+ if (!json.recommendations.includes(extension)) {
227
+ json.recommendations.push(extension);
228
+ }
229
+ });
230
+ return json;
231
+ });
232
+ }
233
+ else {
234
+ (0, devkit_1.writeJson)(tree, '.vscode/extensions.json', {
235
+ recommendations,
236
+ });
237
+ }
238
+ }
239
+ function updatePrettierConfig(tree) {
240
+ return tslib_1.__awaiter(this, void 0, void 0, function* () {
241
+ const existingPrettierConfig = yield (0, prettier_1.resolveUserExistingPrettierConfig)();
242
+ if (!existingPrettierConfig) {
243
+ (0, devkit_1.writeJson)(tree, '.prettierrc', workspace_1.DEFAULT_NRWL_PRETTIER_CONFIG);
244
+ }
245
+ if (!tree.exists('.prettierignore')) {
246
+ (0, devkit_1.generateFiles)(tree, (0, devkit_1.joinPathFragments)(__dirname, '../files/prettier'), '.', { tmpl: '', dot: '.' });
247
+ }
248
+ });
249
+ }
250
+ function setUpCompilerOptions(tsconfig) {
251
+ if (!tsconfig.compilerOptions.paths) {
252
+ tsconfig.compilerOptions.paths = {};
253
+ }
254
+ tsconfig.compilerOptions.baseUrl = '.';
255
+ tsconfig.compilerOptions.rootDir = '.';
256
+ return tsconfig;
257
+ }
258
+ //# sourceMappingURL=workspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"workspace.js","sourceRoot":"","sources":["../../../../../../../packages/angular/src/generators/ng-add/utilities/workspace.ts"],"names":[],"mappings":";;;;AAAA,yCAWsB;AACtB,kFAAkG;AAClG,6EAA+E;AAC/E,qEAA2F;AAC3F,yEAAqF;AACrF,iEAAqE;AACrE,2BAAkC;AAClC,+BAAqC;AACrC,sDAA0E;AAE1E,2CAMqB;AAGrB,2EAA2E;AAC3E,4EAA4E;AAC5E,cAAc;AACd,SAAgB,iBAAiB,CAC/B,IAAU,EACV,QAA2B;IAE3B,IAAI;QACF,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC7C;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,EAAE;YAChC,MAAM,IAAI,KAAK,CAAC,0BAA0B,CAAC,CAAC;SAC7C;QAED,MAAM,MAAM,GAAG,IAAA,qBAAS,EAAC,QAAQ,CAAC,CAAC;QACnC,MAAM,MAAM,GAAG,IAAA,yBAAa,EAAC,QAAQ,CAAC,CAAC;QAEvC,IAAI,CAAC,MAAM,EAAE;YACX,OAAO;SACR;QAED,IAAI,IAAA,kCAAsB,EAAC,MAAM,CAAC,MAAM,CAAC,EAAE;YACzC,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM,CA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AE;oBAC7C,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;iBACtC;YACH,CAAC,CAAC,CAAC;YAEH,OAAO,IAAI,CAAC;QACd,CAAC,CACF,CAAC;KACH;SAAM;QACL,IAAA,kBAAS,EAAC,IAAI,EAAE,yBAAyB,EAAE;YACzC,eAAe;SAChB,CAAC,CAAC;KACJ;AACH,CAAC;AAED,SAAe,oBAAoB,CAAC,IAAU;;QAC5C,MAAM,sBAAsB,GAAG,MAAM,IAAA,4CAAiC,GAAE,CAAC;QACzE,IAAI,CAAC,sBAAsB,EAAE;YAC3B,IAAA,kBAAS,EAAC,IAAI,EAAE,aAAa,EAAE,wCAA4B,CAAC,CAAC;SAC9D;QAED,IAAI,CAAC,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,EAAE;YACnC,IAAA,sBAAa,EACX,IAAI,EACJ,IAAA,0BAAiB,EAAC,SAAS,EAAE,mBAAmB,CAAC,EACjD,GAAG,EACH,EAAE,IAAI,EAAE,EAAE,EAAE,GAAG,EAAE,GAAG,EAAE,CACvB,CAAC;SACH;IACH,CAAC;CAAA;AAED,SAAS,oBAAoB,CAAC,QAAa;IACzC,IAAI,CAAC,QAAQ,CAAC,eAAe,CAAC,KAAK,EAAE;QACnC,QAAQ,CAAC,eAAe,CAAC,KAAK,GAAG,EAAE,CAAC;KACrC;IACD,QAAQ,CAAC,eAAe,CAAC,OAAO,GAAG,GAAG,CAAC;IACvC,QAAQ,CAAC,eAAe,CAAC,OAAO,GAAG,GAAG,CAAC;IAEvC,OAAO,QAAQ,CAAC;AAClB,CAAC"}
@@ -2,6 +2,7 @@
2
2
  "$schema": "http://json-schema.org/schema",
3
3
  "$id": "NxNgrxGenerator",
4
4
  "title": "Add NgRx support to an application or library.",
5
+ "description": "Adds NgRx support to an application or library.",
5
6
  "cli": "nx",
6
7
  "type": "object",
7
8
  "properties": {
@@ -36,13 +36,13 @@
36
36
  "alias": "b"
37
37
  },
38
38
  "inlineStyle": {
39
- "description": "Include styles inline in the component.ts file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the component.ts file.",
39
+ "description": "Include styles inline in the `component.ts` file. Only CSS styles can be included inline. By default, an external styles file is created and referenced in the `component.ts` file.",
40
40
  "type": "boolean",
41
41
  "default": false,
42
42
  "alias": "s"
43
43
  },
44
44
  "inlineTemplate": {
45
- "description": "Include template inline in the component.ts file. By default, an external template file is created and referenced in the component.ts file.",
45
+ "description": "Include template inline in the `component.ts` file. By default, an external template file is created and referenced in the `component.ts` file.",
46
46
  "type": "boolean",
47
47
  "default": false,
48
48
  "alias": "t"
@@ -68,12 +68,12 @@
68
68
  },
69
69
  "skipTests": {
70
70
  "type": "boolean",
71
- "description": "Do not create \"spec.ts\" test files for the new component.",
71
+ "description": "Do not create `spec.ts` test files for the new component.",
72
72
  "default": false
73
73
  },
74
74
  "inlineScam": {
75
75
  "type": "boolean",
76
- "description": "Create the NgModule in the same file as the Component.",
76
+ "description": "Create the `NgModule` in the same file as the component.",
77
77
  "default": true
78
78
  },
79
79
  "flat": {
@@ -84,7 +84,7 @@
84
84
  "selector": {
85
85
  "type": "string",
86
86
  "format": "html-selector",
87
- "description": "The HTML selector to use for this component."
87
+ "description": "The `HTML` selector to use for this component."
88
88
  },
89
89
  "skipSelector": {
90
90
  "type": "boolean",
@@ -93,7 +93,7 @@
93
93
  },
94
94
  "type": {
95
95
  "type": "string",
96
- "description": "Adds a developer-defined type to the filename, in the format \"name.type.ts\".",
96
+ "description": "Adds a developer-defined type to the filename, in the format `name.type.ts`.",
97
97
  "default": "component"
98
98
  },
99
99
  "prefix": {
@@ -31,12 +31,12 @@
31
31
  },
32
32
  "skipTests": {
33
33
  "type": "boolean",
34
- "description": "Do not create \"spec.ts\" test files for the new directive.",
34
+ "description": "Do not create `spec.ts` test files for the new directive.",
35
35
  "default": false
36
36
  },
37
37
  "inlineScam": {
38
38
  "type": "boolean",
39
- "description": "Create the NgModule in the same file as the Directive.",
39
+ "description": "Create the `NgModule` in the same file as the Directive.",
40
40
  "default": true
41
41
  },
42
42
  "flat": {
@@ -47,7 +47,7 @@
47
47
  "selector": {
48
48
  "type": "string",
49
49
  "format": "html-selector",
50
- "description": "The HTML selector to use for this directive."
50
+ "description": "The `HTML` selector to use for this directive."
51
51
  },
52
52
  "prefix": {
53
53
  "type": "string",
@@ -31,7 +31,7 @@
31
31
  },
32
32
  "skipTests": {
33
33
  "type": "boolean",
34
- "description": "Do not create \"spec.ts\" test files for the new pipe.",
34
+ "description": "Do not create `spec.ts` test files for the new pipe.",
35
35
  "default": false
36
36
  },
37
37
  "inlineScam": {
@@ -0,0 +1,7 @@
1
+ module.exports = {
2
+ name: '<%= name %>',<% if(type === 'host') { %>
3
+ remotes: [<% remotes.forEach(function(remote) { %>'<%= remote.remoteName %>',<% }); %>]<% } %><% if(type === 'remote') { %>
4
+ exposes: {
5
+ './Module': '<%= projectRoot %>/src/app/remote-entry/entry.module.ts',
6
+ },<% } %>
7
+ }
@@ -1,8 +1,3 @@
1
1
  const { withModuleFederation } = require('@nrwl/angular/module-federation');
2
- module.exports = withModuleFederation({
3
- name: '<%= name %>',<% if(type === 'host') { %>
4
- remotes: [<% remotes.forEach(function(remote) { %>'<%= remote.remoteName %>',<% }); %>]<% } %><% if(type === 'remote') { %>
5
- exposes: {
6
- './Module': '<%= projectRoot %>/src/app/remote-entry/entry.module.ts',
7
- },<% } %>
8
- });
2
+ const config = require('./mfe.config');
3
+ module.exports = withModuleFederation(config);
@@ -1,4 +1,4 @@
1
- import type { Tree } from '@nrwl/devkit';
1
+ import { Tree } from '@nrwl/devkit';
2
2
  import type { Schema } from '../schema';
3
3
  export declare function checkIsCommaNeeded(mfeRemoteText: string): boolean;
4
- export declare function addRemoteToHost(host: Tree, options: Schema): void;
4
+ export declare function addRemoteToHost(tree: Tree, options: Schema): void;